![]() |
Computer Assited Medical Intervention Tool Kit
|
The manager of the Structural component data. More...
#include <StructuralComponentDC.h>
Public Member Functions | |
Geometry * | cellsToGeometry () |
create an Geometry (composed by vtk unstructured grid of n cells) from the managed SC which is a list of cells | |
StructuralComponent::ComposedBy | composedBy () |
return if the structural component is a list of cells or of atoms | |
virtual void | createPointData () |
create all the point data to display specific information (only works for SCs that have a surface representation). | |
virtual void | destroyPointData () |
destroy all the point data | |
StructuralComponent * | getSC () |
convenient methods | |
StructuralComponentDC (camitk::Component *parent, PMManagerDC *pmManagerDC, StructuralComponent *sc, bool delayRepresentationInit=false) | |
Default constructor, set the 3rd parameter to false to delay the construction of the Geometry (represention of the DC in 3D). | |
void | updateAtoms () |
the method to update both atomDCs vector and atomVtkPointsIndexMap | |
void | updatePosition (AtomDC *, int atomOrderNr=-1) |
This atom position has been changed, the 3D representation has to be updated. | |
virtual | ~StructuralComponentDC () |
destructor | |
camitk::Component rewritten | |
This methods are overloaded from camitk::Component to give the StructuralComponentDC and its sub classe CellDC a different behaviour. | |
virtual QPixmap | getIcon () |
Get the pixmap that will be displayed for this node. | |
virtual void | setPointSet (vtkSmartPointer< vtkPointSet >) |
if the vtkPointSet is modified externally (e.g. by an operator), change the PM structure | |
virtual void | cellPicked (vtkIdType, bool) |
select a specific sub DC using the cell id (do nothing if the SC is not composed by cells) | |
virtual void | pointPicked (vtkIdType, bool) |
select a specific sub DC using the point id (do nothing if the SC is not composed by atoms) | |
virtual void | setSelected (const bool, const bool recursive=false) |
do not select sub DC if they are AtomDC (AtomDC can only be selected individually) | |
virtual void | setEnhancedModes (const EnhancedModes) |
do not set enhanced modes if children are atomDC | |
virtual void | setRenderingModes (const RenderingModes) |
set the rendering mode of the StructuralComponent as well as the DC | |
virtual void | setActorColor (const RenderingModes, const double, const double, const double) |
Set the color of given representation modes. | |
virtual void | setActorColor (const RenderingModes, double[4]) |
Set the color of given representation modes. | |
virtual void | setColor (const double, const double, const double) |
Set an (r,g,b) color to all representation modes, without changing the opacity. | |
virtual void | setColor (const double, const double, const double, const double) |
Set an (r,g,b,a) color to all representation modes. | |
virtual void | addChild (InterfaceNode *) |
add a sub DC: overloaded method to allow change in the physical model data representation | |
virtual void | removeChild (InterfaceNode *) |
remove a sub DC: overloaded method to allow change in the physical model data representation | |
virtual QMenu * | getPopupMenu (QWidget *parent) |
Overriden method so that we actually can build a popup menu with different actions. | |
virtual QObject * | getPropertyObject () |
reimplement this method to give the property object to the property editor | |
![]() | |
ComponentDC (camitk::Component *parent, PMManagerDC *pmManagerDC,::Component *c=NULL) | |
constructors | |
::Component * | getComponent () |
return the component that this dc is managing | |
virtual PMManagerDC * | getPMManagerDC () |
get the PMManagerDC (given during instanciation), allows to get PML/Component maps | |
virtual void | updateProperty (QString name, QVariant value) |
update a specific property | |
virtual | ~ComponentDC () |
virtual void | setOpacity (const double) |
virtual const EnhancedModes | getEnhancedModes () const |
get the current enhanced mode | |
virtual const RenderingModes | getRenderingModes () const |
see Component.cpp | |
virtual void | setName (const QString &) |
set the name to be displayed | |
virtual void | deleteChildren () |
remove a sub DC: overloaded method to avoir deletion of children that are used in more than one SCDC (that have more than one parent) | |
![]() | |
vtkIdType | getPickedCellId () |
get the last pick point id, | |
vtkIdType | getPickedPointId () |
get the last pick point id, | |
MeshComponent (const QString &file) throw (AbortException) | |
Creates a top-level MeshComponent from a file. | |
MeshComponent (vtkSmartPointer< vtkPointSet > aPointSet, const QString &name) | |
Creates a top-level MeshComponent from a vtkPointSet (and instanciate its 3D representation). | |
MeshComponent (Component *parentComponent, vtkSmartPointer< vtkPointSet > aPointSet, const QString &name) | |
Creates a MeshComponent as a sub component of another Component using a vtkPointSet (and instanciate its 3D representation). | |
virtual | ~MeshComponent () |
Destructor. | |
![]() | |
Component (const QString &file, const QString &name, Representation rep=NO_REPRESENTATION) | |
Component constructor for top-level component (please use the other constructor for sub-level components). | |
Component (Component *parentComponent, const QString &name, Representation rep=NO_REPRESENTATION) throw (AbortException) | |
Component constructor for a Component that is a child of another Component You should not use this constructor for a top-level component. | |
virtual | ~Component () |
default destructor | |
Representation | getRepresentation () const |
return the type of representation concretely implemented by this Component in the InteractiveViewer. | |
bool | isTopLevel () const |
return true if this component is a top-level component | |
virtual Component * | getParentComponent () |
get the parent component | |
virtual Component * | getTopLevelComponent () |
get the top-level component | |
virtual void | setModified (bool modified=true) |
set the modified flag | |
virtual bool | getModified () const |
set the modified flag | |
virtual void | setVisibility (Viewer *, bool) |
set the visibility for a viewer | |
virtual bool | getVisibility (Viewer *) const |
get the visibility of a viewer | |
virtual void | refresh () const |
refresh all the viewer that are currently displaying this Component | |
virtual void | refreshInterfaceNode () |
Asks all viewers that are currently displaying this Component to rebuild the representation of the InterfaceNode for this Component. | |
virtual bool | isSelected () const |
Check if this data component is selected. | |
const QString | getFileName () const |
get the file name where the data have to be stored/were stored | |
void | setFileName (const QString &) |
set the file name where the data have to be stored | |
bool | event (QEvent *e) |
Overriden from QObject, this one is only intercepting signal for dynamic property changed (see constructor). | |
QMenu * | getActionAndPopupMenu () |
Get a QMenu that contains all the action that can be applied to this component + the popup menu (if exists). | |
QStringList | getHierarchy () |
bool | isInstanceOf (QString className) |
Assert that a Component instance really inherits from a given className. | |
virtual QWidget * | getPropertyWidget (QWidget *parent=0) |
get the property widget to display. | |
virtual void | attachChild (InterfaceNode *) |
add a child Component (but leave its parent unchanged) | |
virtual void | setParent (InterfaceNode *) |
set the parent Component. This method automatically remove this Component from its previous (if already had one parent Component) | |
virtual QString | getName () const |
get the name to be displayed | |
virtual const ComponentList & | getChildren () |
get the list of the InterfaceNode children (sub items in the hierarchy) | |
virtual bool | doubleClicked () |
this method is called each time the InterfaceNode is double clicked by the user. | |
virtual InterfaceNode * | getParent () |
get the parent Component | |
virtual bool | inItalic () const |
A component name is not displayed in italic by default. | |
const QString | getLabel () const |
void | setLabel (QString newName) |
set the string used to display the label, do the same as setName | |
virtual vtkSmartPointer < vtkPointSet > | getPointSet () |
virtual void | setPointData (vtkSmartPointer< vtkDataArray > param) |
set the point data (may contains a lookup table). | |
virtual vtkSmartPointer < vtkAlgorithmOutput > | getDataPort () const |
get the custom algorithm pipeline input. | |
virtual void | setDataConnection (vtkSmartPointer< vtkAlgorithmOutput > param) |
Set/reset the connection for the InterfaceGeometry internal algorithm. | |
virtual vtkSmartPointer< vtkActor > | getActor (const RenderingModes param) |
Return the actor for the representation mode, NULL if the actor doesn't exist. | |
virtual vtkSmartPointer< vtkProp > | getProp (const QString ¶m) |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name. | |
virtual unsigned int | getNumberOfProp () const |
return the number of additional prop | |
virtual vtkSmartPointer< vtkProp > | getProp (unsigned int index) |
return an additional prop by its index | |
virtual bool | addProp (const QString &name, vtkSmartPointer< vtkProp > prop) |
insert an additional prop, defining it by its name (default visibility = false) | |
virtual bool | removeProp (const QString &name) |
remove a given additional prop. | |
virtual void | getBounds (double bounds[6]) |
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax], see Component.cpp | |
virtual double | getBoundingRadius () |
compute the object's bounding sphere radius, | |
virtual void | setPointPosition (const unsigned int param1, const double param2, const double param3, const double param4) |
set a given point position | |
virtual void | getActorColor (const RenderingModes, double[4]) |
see Component.cpp | |
virtual void | setActorOpacity (const RenderingModes param1, const double param2) |
Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified! | |
virtual double | getActorOpacity (const RenderingModes param) const |
Return the opacity of a given renderng mode. | |
virtual void | setTexture (vtkSmartPointer< vtkTexture > param) |
Set a texture to this object. | |
virtual void | setGlyphType (const GlyphTypes type, const double size=0.0) |
Set the glyph type (a glyph is a geometric representation attached to every point in the input dataset). | |
virtual void | setLinesAsTubes (bool param) |
set the lines as tubes (works only for vtkDataSet representation that contains lines) | |
virtual vtkSmartPointer < vtkImageData > | getImageData () const |
Return the displayed images as a vtkImageData. | |
virtual void | setOriginalVolume (vtkSmartPointer< vtkImageData > param) |
set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline | |
virtual vtkSmartPointer < vtkImageActor > | get2DImageActor () const |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D. | |
virtual vtkSmartPointer < vtkImageActor > | get3DImageActor () const |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D. | |
virtual vtkSmartPointer< vtkActor > | getPickPlaneActor () const |
Return the vtkActor used to pick pixels in the slices. | |
virtual vtkSmartPointer< vtkActor > | getPixelActor () |
Return the vtkActor used to pick pixels in the slices. | |
virtual void | pixelPicked (double param1, double param2, double param3) |
This method is called when the associated plane has been picked in the InteractiveViewer, the given coordinates is position where the plane was picked. | |
virtual void | updatePickPlane () |
virtual void | setSlice (int param) |
Set the current slice index. | |
virtual void | setSlice (double param1, double param2, double param3) |
Set the slice corresponding to the given world coordinates. | |
virtual void | setRotationX (double param) |
Set the current angle to the arbitrary slice. | |
virtual void | setRotationY (double param) |
virtual void | setRotationZ (double param) |
virtual int | getNumberOfColors () const |
Return the number of colors in the images. | |
virtual void | setPixelRealPosition (double param1, double param2, double param3) |
move the pixel selection green indicator (pixelActor) to the given real position | |
virtual double | getRotationX () const |
see Component.cpp | |
virtual double | getRotationY () const |
see Component.cpp | |
virtual double | getRotationZ () const |
see Component.cpp | |
virtual int | getNumberOfSlices () const |
see Component.cpp | |
virtual int | getSlice () const |
see Component.cpp | |
![]() | |
virtual | ~InterfaceProperty () |
empty virtual destructor, to avoid memory leak | |
![]() | |
virtual | ~InterfaceNode () |
empty virtual destructor, to avoid memory leak | |
![]() | |
virtual | ~InterfaceGeometry () |
empty virtual destructor, to avoid memory leak | |
![]() | |
virtual | ~InterfaceBitMap () |
virtual destructor |
Static Public Member Functions | |
static vtkSmartPointer < vtkUnstructuredGrid > | structuralComponentToVtk (StructuralComponent *, std::AtomVtkPointsIndexMap *) |
Build an unstructured grid from a Structural Component, and build the correct AtomVtkPointsIndexMap. | |
static vtkSmartPointer < vtkUnstructuredGrid > | structuralComponentToVtk (StructuralComponent *) |
Build an unstructured grid from a Structural Component. |
Protected Attributes | |
unsigned int | nrOfAtoms |
nr of atoms | |
vtkSmartPointer< vtkDoubleArray > | pointData |
the point data array | |
![]() | |
::Component * | myComponent |
the managed Component | |
PMManagerDC * | myPMManagerDC |
the PMManagerDC |
Private Member Functions | |
Geometry * | atomsToGeometry () |
create an Geometry (a vtk unstructured grid of 1 poly vertex) from the managed SC which is a list of atoms | |
virtual void | initRepresentation () |
the concrete building of the geometry |
Private Attributes | |
std::vector< AtomDC * > | atomDCs |
list of atom DCs. | |
std::vector< unsigned int > | cellIdToBeRemoved |
cell ids in the vtk structures to be removed | |
StructuralComponentDCPopup * | myPopupMenu |
the popup menu | |
StructuralComponentDCProperties * | myProp |
the SC DC properties | |
unsigned int | nrOfParts |
cumulative nr of cell and points. |
Static Private Attributes | |
static QPixmap * | myPixmap = NULL |
the StructuralComponentDC pixmap |
Additional Inherited Members | |
![]() | |
enum | Representation { GEOMETRY, SLICE, NO_REPRESENTATION } |
The different representation that can be implemented to represent this Component in the InteractiveViewer. More... | |
![]() | |
QMap< QString, vtkSmartPointer < vtkProp > > | extraProp |
The additional map for prop (include at least "label" and "glyph". | |
![]() | |
virtual void | initRepresentation (vtkSmartPointer< vtkPointSet >) |
build the instance of Geometry from the given vtkPointSet |
The manager of the Structural component data.
Maintains a map to tell at what position is a give atom in the vtkPoints list. This class gives also a conveniant method to save a StructuralComponent in a vtk unstructured grid.
StructuralComponentDC::StructuralComponentDC | ( | camitk::Component * | parent, |
PMManagerDC * | pmManagerDC, | ||
StructuralComponent * | sc, | ||
bool | delayRepresentationInit = false |
||
) |
Default constructor, set the 3rd parameter to false to delay the construction of the Geometry (represention of the DC in 3D).
delayRepresentationInit should always be set to true when the constructor is called by a sub-class (see CellDC constructor). If delayRepresentationInit is false (default) and if the default mode is visible, then the SCDC constructor will build an Geometry considering a SC not a sub-class (i.e. Cell).
References PMManagerDC::addStructuralComponentDCPair(), camitk::Component::attachChild(), PMManagerDC::getDC(), getSC(), initRepresentation(), ComponentDC::myPMManagerDC, myPopupMenu, myProp, nrOfAtoms, nrOfParts, pointData, PMManagerDC::progressOneStep(), ComponentDC::setName(), and camitk::Component::setVisibility().
|
virtual |
destructor
References destroyPointData(), myPopupMenu, and myProp.
|
virtual |
add a sub DC: overloaded method to allow change in the physical model data representation
Reimplemented from camitk::Component.
References getSC().
|
private |
create an Geometry (a vtk unstructured grid of 1 poly vertex) from the managed SC which is a list of atoms
References camitk::Component::childrenComponent, camitk::Component::getName(), AtomDC::getPosition(), getSC(), ComponentDC::myPMManagerDC, nrOfAtoms, and PMManagerDC::toDCRenderingMode().
Referenced by initRepresentation().
|
virtual |
select a specific sub DC using the cell id (do nothing if the SC is not composed by cells)
Reimplemented from camitk::MeshComponent.
References camitk::Component::childrenComponent, composedBy(), and getSC().
Geometry * StructuralComponentDC::cellsToGeometry | ( | ) |
create an Geometry (composed by vtk unstructured grid of n cells) from the managed SC which is a list of cells
References atomDCs, camitk::Component::childrenComponent, CellDC::getCell(), camitk::Component::getChildren(), camitk::Component::getName(), AtomDC::getOrderNumberInSCDC(), getSC(), ComponentDC::myPMManagerDC, nrOfAtoms, nrOfParts, camitk::Geometry::setActorColor(), and PMManagerDC::toDCRenderingMode().
Referenced by initRepresentation().
StructuralComponent::ComposedBy StructuralComponentDC::composedBy | ( | ) |
return if the structural component is a list of cells or of atoms
References getSC().
Referenced by cellPicked(), createPointData(), initRepresentation(), pointPicked(), setEnhancedModes(), setPointSet(), setSelected(), updateAtoms(), and updatePosition().
|
virtual |
create all the point data to display specific information (only works for SCs that have a surface representation).
This will automatically fills up the AtomDC point data pointers.
Reimplemented from ComponentDC.
Reimplemented in CellDC.
References atomDCs, composedBy(), getSC(), pointData, and camitk::Component::setPointData().
|
virtual |
destroy all the point data
Reimplemented from ComponentDC.
Reimplemented in CellDC.
References atomDCs, pointData, and camitk::Component::setPointData().
Referenced by ~StructuralComponentDC().
|
virtual |
Get the pixmap that will be displayed for this node.
If you want your component to have a nice pixmap displayed in the explorer, for example, you just need to 1. declare a new static member and redefines the getIcon() method (in MyComponent.h): @code
public: virtual QPixmap getIcon(); private: static QPixmap * myPixmap; // declare a ptr here (it is static for optimization)
Reimplemented from camitk::Component.
Reimplemented in CellDC.
References myPixmap.
|
virtual |
Overriden method so that we actually can build a popup menu with different actions.
Reimplemented from camitk::Component.
References myPopupMenu.
|
virtual |
reimplement this method to give the property object to the property editor
Reimplemented from ComponentDC.
Reimplemented in CellDC.
References myProp.
|
inline |
convenient methods
References ComponentDC::myComponent.
Referenced by addChild(), AnyDecoration::AnyDecoration(), atomsToGeometry(), cellPicked(), cellsToGeometry(), composedBy(), createPointData(), StructuralComponentDCProperties::event(), CellDC::initRepresentation(), initRepresentation(), pointPicked(), removeChild(), setActorColor(), setColor(), setEnhancedModes(), StructuralComponentDCProperties::setName(), setPointSet(), setRenderingModes(), setSelected(), StructuralComponentDC(), updateAtoms(), updatePosition(), and StructuralComponentDCProperties::updateProperties().
|
privatevirtual |
the concrete building of the geometry
References atomsToGeometry(), cellsToGeometry(), composedBy(), getSC(), camitk::Component::myGeometry, and updateAtoms().
Referenced by StructuralComponentDC().
|
virtual |
select a specific sub DC using the point id (do nothing if the SC is not composed by atoms)
Reimplemented from camitk::MeshComponent.
References atomDCs, CAMITK_ERROR, camitk::Component::childrenComponent, composedBy(), camitk::Component::getName(), and getSC().
|
virtual |
remove a sub DC: overloaded method to allow change in the physical model data representation
Reimplemented from camitk::Component.
References cellIdToBeRemoved, camitk::Component::childrenComponent, and getSC().
|
virtual |
Set the color of given representation modes.
Reimplemented from camitk::Component.
References camitk::Component::getActorColor(), and getSC().
Referenced by setActorColor().
|
virtual |
Set the color of given representation modes.
Reimplemented from camitk::Component.
References getSC(), and setActorColor().
|
virtual |
Set an (r,g,b) color to all representation modes, without changing the opacity.
Reimplemented from camitk::Component.
References getSC().
Referenced by setColor().
|
virtual |
Set an (r,g,b,a) color to all representation modes.
Reimplemented from camitk::Component.
References getSC(), and setColor().
|
virtual |
do not set enhanced modes if children are atomDC
Reimplemented from camitk::Component.
References composedBy(), and getSC().
|
virtual |
if the vtkPointSet is modified externally (e.g. by an operator), change the PM structure
Reimplemented from camitk::Component.
References atomDCs, camitk::Component::childrenComponent, composedBy(), getSC(), camitk::Component::getTopLevelComponent(), camitk::Component::myGeometry, camitk::Component::setModified(), and AtomDC::setPosition().
|
virtual |
set the rendering mode of the StructuralComponent as well as the DC
Reimplemented from camitk::Component.
References getSC(), ComponentDC::myPMManagerDC, and PMManagerDC::toPMRenderingMode().
Referenced by CellDC::setSelected().
|
virtual |
do not select sub DC if they are AtomDC (AtomDC can only be selected individually)
Reimplemented from camitk::Component.
Reimplemented in CellDC.
References composedBy(), and getSC().
|
static |
Build an unstructured grid from a Structural Component, and build the correct AtomVtkPointsIndexMap.
Referenced by AnyDecoration::AnyDecoration(), and structuralComponentToVtk().
|
static |
Build an unstructured grid from a Structural Component.
References structuralComponentToVtk().
void StructuralComponentDC::updateAtoms | ( | ) |
the method to update both atomDCs vector and atomVtkPointsIndexMap
References atomDCs, camitk::Component::childrenComponent, composedBy(), camitk::Component::getChildren(), getSC(), nrOfAtoms, nrOfParts, and AtomDC::registerIndexInSCDC().
Referenced by CellDC::initRepresentation(), and initRepresentation().
void StructuralComponentDC::updatePosition | ( | AtomDC * | modifiedAtomDC, |
int | atomOrderNr = -1 |
||
) |
This atom position has been changed, the 3D representation has to be updated.
For optimization reason: if you know the atom order nr in this SCDC, please give it! An atom in the cell position has been changed this method starts the update cascade process, consisting in updating all the 3D representation of the all the components containing this component, then of all the components containing all the components containing this component... etc... up to the PM void updatePosition(AtomDC *, CellDC *);
References composedBy(), AtomDC::getAtom(), AtomDC::getOrderNumberInSCDC(), getSC(), camitk::Component::isInstanceOf(), camitk::Component::myGeometry, and camitk::InterfaceGeometry::setPointPosition().
|
private |
list of atom DCs.
This list is used only when the structural component is made of cells. This list is here to speed up the application: When you need atom's DC you could always call the PMManager::getDC method, but that is at a high cost. So why not maintain the list of the Atom DCs of the structural component. This list is build/update in the updateAtoms method.
Referenced by cellsToGeometry(), createPointData(), destroyPointData(), pointPicked(), setPointSet(), and updateAtoms().
|
private |
cell ids in the vtk structures to be removed
Referenced by removeChild().
|
staticprivate |
the StructuralComponentDC pixmap
Referenced by getIcon().
|
private |
the popup menu
Referenced by getPopupMenu(), StructuralComponentDC(), and ~StructuralComponentDC().
|
private |
the SC DC properties
Referenced by getPropertyObject(), StructuralComponentDC(), and ~StructuralComponentDC().
|
protected |
nr of atoms
Referenced by atomsToGeometry(), cellsToGeometry(), StructuralComponentDC(), and updateAtoms().
|
private |
cumulative nr of cell and points.
Example: if sc=[c0,c1] , c0=[a0,a2,a3] and c1=[a1,a2,a4,a0] then nrOfParts = 1 + 3 + 1 + 4 = 9. Updated in updateAtoms()
Referenced by cellsToGeometry(), StructuralComponentDC(), and updateAtoms().
|
protected |
the point data array
Referenced by CellDC::createPointData(), createPointData(), CellDC::destroyPointData(), destroyPointData(), and StructuralComponentDC().