camitk.Component¶
- class camitk.Component¶
A Component represents something that could be included in the explorer view, the interactive 3D viewer, and that could have or not a contextual popup menu (open by a right click in the explorer), a property dialog (to change some properties) Thus, a Component inherits from many abstract classes. A Component can only have one implemented representation.
For CAMITK core developers: This class uses the Object Adapter Design Pattern (aka delegate pattern) to delegates all InterfaceGeometry and InterfaceBitMap to respectively myGeometry:Geometry and mySlice:InterfaceBitMap It handles the InterfaceNode without delegation. Considering this Design Pattern, Component is the Adaptor and Geometry and InterfaceBitMap are the Adaptee classes.
This class has some static member to manage all the currently instantiated Components as well as the currently selected Components.
Actions generally use setPointSet() (for InterfaceGeometry) and setOriginalVolume (for InterfaceBitMap) to do some data processing and directly modify the low-level Vtk data. It is thus very important to rewrite these methods in your Component subclass to takes the actions’ modification into account in your low-level data.
Dynamic properties: if your Component defines some dynamic properties, you might want to override propertyValueChanged() in order to update the internal state of your object when a dynamic property’s value has been changed.
See also
ObjComponent for a good example
It extensively uses Qt Meta-Object system (concepts and implementation). see http://doc.qt.nokia.com/latest/metaobjects.html
- __init__(self: camitk.Component, arg0: str, arg1: str) None¶
Component constructor for top-level component (please use the other constructor for sub-level components). parentComponent is set to nullptr (=> isTopLevel() will return true).
Parameter
file: the file to get the data fromParameter
name: the Component nameParameter
rep: the representation concretely implemented by this Component (default=NO_REPRESENTATION)Parameter
createDefaultFrame: Whether the component should create its frame (should be set to false only if the frame is created/set in another way)
Methods
__init__(self, arg0, arg1)Component constructor for top-level component (please use the other constructor for sub-level components).
addChild(self, arg0)add a child Component (sub item in the hierarchy), and modify the child's parent to be equal to this instance
getChildren(self)get the list of the InterfaceNode children (sub items in the hierarchy)
getFileName(self)get the file name where the data have to be stored/were stored
getFrame(self)Get the pointer to this object's FrameOfReference.
getName(self)get the name to be displayed
getParent(self)get the parent Component
getPropertyValue(self, arg0)get the property QVariant (same as property(const char*)) but check if it exists first.
isSelected(self)Check if this data component is selected
isTopLevel(self)return true if this component is a top-level component
refresh(self)refresh all the viewer that are currently displaying this Component At the end the InterfaceNode modification flag is reset.
setFrame(self, arg0)Set the FrameOfReference of this object.
setFrameFrom(self, arg0)Modify this object's frame using the given object's frame.
setModified(self, arg0)set the modified flag
setName(self, arg0)set the name to be displayed
setPropertyValue(self, arg0, arg1)set the property QVariant value (same as setProperty(const char*, newValue)) but check if it exists first.
setSelected(self, b[, recursive])Update the selection flag.
Attributes
NoRenderingModePointsSurfaceWireframe