Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AtomDC Class Reference

The manager of the Atom data. More...

#include <AtomDC.h>

+ Inheritance diagram for AtomDC:

Public Member Functions

void addPointData (StructuralComponentDC *, double *)
 add a ptr to a pointData for this atom corresponding to the given SCDC More...
 
 AtomDC (camitk::Component *parent, PMManagerDC *pmManagerDC, Atom *)
 
void clearPointData ()
 clear the point data ptr list More...
 
Atom * getAtom ()
 get the atom this dc is representing More...
 
AtomDecorationgetDecoration (const QString &name, camitk::GeometricObject::Geometry t)
 get a decoration of the AtomDC using its name. More...
 
int getOrderNumberInSCDC (StructuralComponentDC *)
 knowing a StructuralComponentDC get the order number of this AtomDC in it (return -1 if not found) More...
 
virtual PMManagerDCgetPMManagerDC ()
 get the PMManagerDC (given during instanciation), allows to get PML/Component maps More...
 
void getPosition (double &, double &, double &)
 get the current position for this atom More...
 
unsigned int registerIndexInSCDC (const std::IndexInParentItemPair)
 register a StructuralComponentDC and this AtomDC corresponding order number in it (NOTE: this method replace the previous index if there was one) More...
 
void resetAlreadyMovedFlag ()
 reset the alreadyMoved flag to false More...
 
void setPosition (double, double, double)
 set a new position for this atom More...
 
unsigned int unregisterIndexInSCDC (StructuralComponentDC *)
 unregister a StructuralComponentDC item from the map More...
 
void updatePointData (const double)
 update point data value More...
 
void updatePosition ()
 update the position of the 3D representation and launch the update position cascade process (updating all the 3D representation of all the SC/cells containing this atom, then of all the SC containing all the cells containing this atom...) More...
 
virtual ~AtomDC ()
 
Redefined from camitk::Component
virtual void setParent (InterfaceNode *)
 An AtomDC can have more than one parent... More...
 
virtual QPixmap getIcon ()
 Get the pixmap that will be displayed for this node. More...
 
void pointPicked (vtkIdType, bool)
 picking is selecting/unselecting More...
 
virtual void setSelected (const bool, const bool recursive=false)
 when seleceted add a sphere glyph around the atom position and set the enhanced mode to Normal More...
 
virtual void setEnhancedModes (const EnhancedModes)
 do nothing here (the enhanced mode is controled by the setSelected method) More...
 
virtual void setName (const QString &)
 set the name of the atom as well as the name of the DC More...
 
virtual void setPointSet (vtkSmartPointer< vtkPointSet >)
 if the vtkPointSet is modified externally (e.g. by an operator), change the PM structure More...
 
virtual QMenu * getPopupMenu (QWidget *parent)
 Overriden method so that we actually can build a popup menu with different actions. More...
 
virtual QWidget * getPropertyWidget (QWidget *parent=0)
 reimplement this method to give the property widget to the app More...
 
virtual QObject * getPropertyObject ()
 reimplement this method to give the property object to the property editor More...
 
virtual bool doubleClicked ()
 overloaded method, allows to set the point when double clicked More...
 
- Public Member Functions inherited from camitk::Component
 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). More...
 
 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. More...
 
virtual ~Component ()
 default destructor More...
 
Representation getRepresentation () const
 return the type of representation concretely implemented by this Component in the InteractiveViewer. More...
 
bool isTopLevel () const
 return true if this component is a top-level component More...
 
virtual ComponentgetParentComponent ()
 get the parent component More...
 
virtual ComponentgetTopLevelComponent ()
 get the top-level component More...
 
virtual void setModified (bool modified=true)
 set the modified flag More...
 
virtual bool getModified () const
 set the modified flag More...
 
virtual void setVisibility (Viewer *, bool)
 set the visibility for a viewer More...
 
virtual bool getVisibility (Viewer *) const
 get the visibility of a viewer More...
 
virtual void refresh () const
 refresh all the viewer that are currently displaying this Component More...
 
virtual void refreshInterfaceNode ()
 Asks all viewers that are currently displaying this Component to rebuild the representation of the InterfaceNode for this Component. More...
 
virtual bool isSelected () const
 Check if this data component is selected. More...
 
const QString getFileName () const
 get the file name where the data have to be stored/were stored More...
 
void setFileName (const QString &)
 set the file name where the data have to be stored More...
 
bool event (QEvent *e)
 Overriden from QObject, this one is only intercepting signal for dynamic property changed (see constructor). More...
 
QMenu * getActionAndPopupMenu ()
 Get a QMenu that contains all the action that can be applied to this component + the popup menu (if exists). More...
 
QStringList getHierarchy ()
 
bool isInstanceOf (QString className)
 Assert that a Component instance really inherits from a given className. More...
 
void updateProperty (QString name, QVariant value)
 update property: if you override this method, do not forget to call the superclass method for the property not managed locally in order to properly manage all inherited dynamic properties. More...
 
virtual void addChild (InterfaceNode *)
 add a child Component (sub item in the hierarchy), and modify the child's parent to be equal to this instance More...
 
virtual void attachChild (InterfaceNode *)
 add a child Component (but leave its parent unchanged) More...
 
virtual void removeChild (InterfaceNode *)
 remove from the the sub item vector. More...
 
virtual void setParent (InterfaceNode *)
 set the parent Component. This method automatically remove this Component from its previous (if already had one parent Component) More...
 
virtual void deleteChildren ()
 delete all sub Component, but do not delete the pointer (only the top-level component has the right to do that) More...
 
virtual QString getName () const
 get the name to be displayed More...
 
virtual const ComponentListgetChildren ()
 get the list of the InterfaceNode children (sub items in the hierarchy) More...
 
virtual InterfaceNodegetParent ()
 get the parent Component More...
 
virtual bool inItalic () const
 A component name is not displayed in italic by default. More...
 
const QString getLabel () const
 
void setLabel (QString newName)
 set the string used to display the label, do the same as setName More...
 
virtual vtkSmartPointer
< vtkPointSet > 
getPointSet ()
 
virtual void setPointData (vtkSmartPointer< vtkDataArray > param)
 set the point data (may contains a lookup table). More...
 
virtual vtkSmartPointer
< vtkAlgorithmOutput > 
getDataPort () const
 get the custom algorithm pipeline input. More...
 
virtual void setDataConnection (vtkSmartPointer< vtkAlgorithmOutput > param)
 Set/reset the connection for the InterfaceGeometry internal algorithm. More...
 
virtual vtkSmartPointer< vtkActor > getActor (const RenderingModes param)
 Return the actor for the representation mode, NULL if the actor doesn't exist. More...
 
virtual vtkSmartPointer< vtkProp > getProp (const QString &param)
 Return the vtkProp (actors, volumes and annotations) corresponding to the given name. More...
 
virtual unsigned int getNumberOfProp () const
 return the number of additional prop More...
 
virtual vtkSmartPointer< vtkProp > getProp (unsigned int index)
 return an additional prop by its index More...
 
virtual bool addProp (const QString &name, vtkSmartPointer< vtkProp > prop)
 insert an additional prop, defining it by its name (default visibility = false) More...
 
virtual bool removeProp (const QString &name)
 remove a given additional prop. More...
 
virtual void cellPicked (vtkIdType, bool)
 an inherited class can redefine this method something specific. More...
 
virtual void getBounds (double bounds[6])
 compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax], see Component.cpp More...
 
virtual double getBoundingRadius ()
 compute the object's bounding sphere radius, More...
 
virtual void setPointPosition (const unsigned int param1, const double param2, const double param3, const double param4)
 set a given point position More...
 
virtual void setRenderingModes (const RenderingModes param)
 
virtual const RenderingModes getRenderingModes () const
 see Component.cpp More...
 
virtual const EnhancedModes getEnhancedModes () const
 get the current enhanced mode More...
 
virtual void setActorColor (const RenderingModes param1, double param2[4])
 Set the color of given representation modes. More...
 
virtual void setActorColor (const RenderingModes param1, const double param2, const double param3, const double param4)
 Set the color of given representation modes. More...
 
virtual void getActorColor (const RenderingModes, double[4])
 see Component.cpp More...
 
virtual void setColor (const double param1, const double param2, const double param3)
 Set an (r,g,b) color to all representation modes, without changing the opacity. More...
 
virtual void setColor (const double param1, const double param2, const double param3, const double param4)
 Set an (r,g,b,a) color to all representation modes. More...
 
virtual void setActorOpacity (const RenderingModes param1, const double param2)
 Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified! More...
 
virtual double getActorOpacity (const RenderingModes param) const
 Return the opacity of a given renderng mode. More...
 
virtual void setOpacity (const double param)
 Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified! More...
 
virtual void setTexture (vtkSmartPointer< vtkTexture > param)
 Set a texture to this object. More...
 
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). More...
 
virtual void setLinesAsTubes (bool param)
 set the lines as tubes (works only for vtkDataSet representation that contains lines) More...
 
virtual vtkSmartPointer
< vtkImageData > 
getImageData () const
 Return the displayed images as a vtkImageData. More...
 
virtual void setOriginalVolume (vtkSmartPointer< vtkImageData > param)
 set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline More...
 
virtual vtkSmartPointer
< vtkImageActor > 
get2DImageActor () const
 Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D. More...
 
virtual vtkSmartPointer
< vtkImageActor > 
get3DImageActor () const
 Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D. More...
 
virtual vtkSmartPointer< vtkActor > getPickPlaneActor () const
 Return the vtkActor used to pick pixels in the slices. More...
 
virtual vtkSmartPointer< vtkActor > getPixelActor ()
 Return the vtkActor used to pick pixels in the slices. More...
 
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. More...
 
virtual void updatePickPlane ()
 
virtual void setSlice (int param)
 Set the current slice index. More...
 
virtual void setSlice (double param1, double param2, double param3)
 Set the slice corresponding to the given world coordinates. More...
 
virtual void setRotationX (double param)
 Set the current angle to the arbitrary slice. More...
 
virtual void setRotationY (double param)
 
virtual void setRotationZ (double param)
 
virtual int getNumberOfColors () const
 Return the number of colors in the images. More...
 
virtual void setPixelRealPosition (double param1, double param2, double param3)
 move the pixel selection green indicator (pixelActor) to the given real position More...
 
virtual double getRotationX () const
 see Component.cpp More...
 
virtual double getRotationY () const
 see Component.cpp More...
 
virtual double getRotationZ () const
 see Component.cpp More...
 
virtual int getNumberOfSlices () const
 see Component.cpp More...
 
virtual int getSlice () const
 see Component.cpp More...
 
- Public Member Functions inherited from camitk::InterfaceProperty
virtual ~InterfaceProperty ()
 empty virtual destructor, to avoid memory leak More...
 
- Public Member Functions inherited from camitk::InterfaceNode
virtual ~InterfaceNode ()
 empty virtual destructor, to avoid memory leak More...
 
- Public Member Functions inherited from camitk::InterfaceGeometry
virtual ~InterfaceGeometry ()
 empty virtual destructor, to avoid memory leak More...
 
- Public Member Functions inherited from camitk::InterfaceBitMap
virtual ~InterfaceBitMap ()
 virtual destructor More...
 

Private Member Functions

virtual void initRepresentation ()
 the concrete building of the geometry More...
 

Private Attributes

bool alreadyMoved
 true if the atom has been already moved by another SC This is a way to solve the bug which occurs when 2 selected cells has this atom in common. More...
 
QMap< QString, AtomDecoration * > decorations
 list of decorations attached to this AtomDC More...
 
Atom * myAtom
 The atom the dc is representing. More...
 
PMManagerDCmyPMManagerDC
 the PMManagerDC More...
 
AtomDCPopupmyPopupMenu
 the popup menu More...
 
AtomDCPropertiesmyProp
 the atom'properties More...
 
std::IndexInParentItemMap mySCDCindexes
 correspondance between a SCDC and the order number of this atom dc in a particular SCDC (parent items). More...
 
std::vector< double * > pointData
 list of all the point data adresses More...
 
std::set< StructuralComponentDC * > pointDataSC
 list of all the SC who asked for a point data in this AtomDC More...
 

Static Private Attributes

static QPixmap * myPixmap = NULL
 the AtomDC pixmap More...
 

Additional Inherited Members

- Public Types inherited from camitk::Component
enum  Representation { GEOMETRY, SLICE, NO_REPRESENTATION }
 The different representation that can be implemented to represent this Component in the InteractiveViewer. More...
 
- Public Attributes inherited from camitk::InterfaceBitMap
QMap< QString, vtkSmartPointer
< vtkProp > > 
extraProp
 The additional map for prop (include at least "label" and "glyph". More...
 
- Protected Attributes inherited from camitk::Component
ComponentList childrenComponent
 The explorer sub items. More...
 
bool isSelectedFlag
 tells if this particular Component is selected or not More...
 
bool modifiedFlag
 the modificatio flag (could be extended to manage a undo/redo list) More...
 
QString myFileName
 the file name from which the Component is loaded More...
 
InterfaceGeometrymyGeometry
 myGeometry is the 3d representation of this Component, the Component delegates all InterfaceGeometry activity to myGeometry (delegation pattern) More...
 
InterfaceNodemyParentNode
 who is the boss? The Component! More...
 
InterfaceBitMapmySlice
 mySlice is the slice representation of this data component, the Component delegates all InterfaceBitMap activity to mySlice (delegation pattern) More...
 

Detailed Description

The manager of the Atom data.

AtomDC are only created in the StructuralComponentDC constructor, which garanties that each atom has ONE AND ONLY ONE DC. But as Atom can be referenced by more than one Component (StructuralComponent or Cell) AtomDC is a particular type of DC that can have more than one parent DC (setParent is rewritten here).

Constructor & Destructor Documentation

AtomDC::AtomDC ( camitk::Component parent,
PMManagerDC pmManagerDC,
Atom *  a 
)
AtomDC::~AtomDC ( )
virtual

References decorations, myPopupMenu, and myProp.

Member Function Documentation

void AtomDC::addPointData ( StructuralComponentDC sc,
double *  ptr 
)

add a ptr to a pointData for this atom corresponding to the given SCDC

References pointData, and pointDataSC.

void AtomDC::clearPointData ( )

clear the point data ptr list

References pointData.

bool AtomDC::doubleClicked ( )
virtual

overloaded method, allows to set the point when double clicked

Reimplemented from camitk::Component.

References CAMITK_INFO, and myAtom.

Atom * AtomDC::getAtom ( )
inline
AtomDecoration * AtomDC::getDecoration ( const QString &  name,
camitk::GeometricObject::Geometry  t 
)

get a decoration of the AtomDC using its name.

If the AtomDC has no decoration using this name, create a new one using the given type.

Parameters
namethe decoration name
tthe decoration type

References decorations.

Referenced by Arrows::hide(), and Arrows::update().

QPixmap AtomDC::getIcon ( )
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):
public:
virtual QPixmap getIcon();
private:
static QPixmap * myPixmap; // declare a ptr here (it is static for optimization)
  1. add these lines in your code (in MyComponent.cpp):
    // use this two lines or better use a Qt resource bundle (recommanded!)
    #include "myComponent_pixmap.xpm" // include the pixmap resource file or use a Qt resource bundle
    QPixmap * MyComponent::myPixmap = NULL; // static initialization
    QPixmap MyComponent::getIcon() {
    // check if the class instance was already used somewhere
    if (!myPixmap) {
    // create the pixmap from the data like this (or using the Qt resource bundle, see Qt documentation)
    myPixmap = new QPixmap(myComponent_pixmap); // myComponent_pixmap is the name of the char[] found in the .xpm file
    }
    // return the object (not the pointer
    return (*myPixmap);
    }
    And that all folks! A nice icon will be now used to display your component!
Note
Recommanded pixmap size is 20x20 (not nice, but efficient)...

Reimplemented from camitk::Component.

References myPixmap.

int AtomDC::getOrderNumberInSCDC ( StructuralComponentDC parent)

knowing a StructuralComponentDC get the order number of this AtomDC in it (return -1 if not found)

References mySCDCindexes.

Referenced by StructuralComponentDC::cellsToGeometry(), and StructuralComponentDC::updatePosition().

virtual PMManagerDC* AtomDC::getPMManagerDC ( )
inlinevirtual

get the PMManagerDC (given during instanciation), allows to get PML/Component maps

Referenced by AtomDCWidget::usedInTableClicked().

QMenu * AtomDC::getPopupMenu ( QWidget *  parent)
virtual

Overriden method so that we actually can build a popup menu with different actions.

Reimplemented from camitk::Component.

References myPopupMenu.

void AtomDC::getPosition ( double &  x,
double &  y,
double &  z 
)

get the current position for this atom

References myAtom.

Referenced by StructuralComponentDC::atomsToGeometry(), and CellDC::initRepresentation().

QObject * AtomDC::getPropertyObject ( )
virtual

reimplement this method to give the property object to the property editor

Reimplemented from camitk::Component.

References myProp.

QWidget * AtomDC::getPropertyWidget ( QWidget *  parent = 0)
virtual

reimplement this method to give the property widget to the app

Reimplemented from camitk::Component.

References PMManagerDC::getAtomDCWidget(), and myPMManagerDC.

void AtomDC::initRepresentation ( )
privatevirtual

the concrete building of the geometry

Implements camitk::Component.

References camitk::Component::getName(), camitk::Component::isSelectedFlag, myAtom, camitk::Component::myGeometry, and setSelected().

Referenced by AtomDC().

void AtomDC::pointPicked ( vtkIdType  ,
bool  pickingIsSelecting 
)
virtual

picking is selecting/unselecting

Reimplemented from camitk::Component.

References setSelected().

unsigned int AtomDC::registerIndexInSCDC ( const std::IndexInParentItemPair  p)

register a StructuralComponentDC and this AtomDC corresponding order number in it (NOTE: this method replace the previous index if there was one)

Returns
the new number of registered SCDC

References mySCDCindexes, and unregisterIndexInSCDC().

Referenced by StructuralComponentDC::updateAtoms().

void AtomDC::resetAlreadyMovedFlag ( )
void AtomDC::setEnhancedModes ( const EnhancedModes  em)
virtual

do nothing here (the enhanced mode is controled by the setSelected method)

Reimplemented from camitk::Component.

void AtomDC::setName ( const QString &  n)
virtual

set the name of the atom as well as the name of the DC

Reimplemented from camitk::Component.

References myAtom, and camitk::Component::setName().

void AtomDC::setParent ( InterfaceNode )
virtual

An AtomDC can have more than one parent...

myParentDC is the first DC (atom list).

void AtomDC::setPointSet ( vtkSmartPointer< vtkPointSet >  newPointSet)
virtual

if the vtkPointSet is modified externally (e.g. by an operator), change the PM structure

Reimplemented from camitk::Component.

References camitk::Component::getTopLevelComponent(), camitk::Component::setModified(), and setPosition().

void AtomDC::setPosition ( double  x,
double  y,
double  z 
)
void AtomDC::setSelected ( const bool  d,
const bool  recursive = false 
)
virtual
unsigned int AtomDC::unregisterIndexInSCDC ( StructuralComponentDC parent)

unregister a StructuralComponentDC item from the map

Returns
the new number of registered SCDC

References mySCDCindexes.

Referenced by registerIndexInSCDC().

void AtomDC::updatePointData ( const double  value)

update point data value

References pointData, and pointDataSC.

void AtomDC::updatePosition ( )

update the position of the 3D representation and launch the update position cascade process (updating all the 3D representation of all the SC/cells containing this atom, then of all the SC containing all the cells containing this atom...)

References PMManagerDC::getDC(), myAtom, camitk::Component::myGeometry, myPMManagerDC, mySCDCindexes, camitk::Component::setModified(), and camitk::InterfaceGeometry::setPointPosition().

Referenced by setPosition().

Member Data Documentation

bool AtomDC::alreadyMoved
private

true if the atom has been already moved by another SC This is a way to solve the bug which occurs when 2 selected cells has this atom in common.

The call of setRealTransformation() being sequencial, the first cell will move the atom first, and then the second cell will move it again... Set to false when setTranform(...) is called with the identity. Set to true when updatePosition is called

Referenced by AtomDC(), resetAlreadyMovedFlag(), and setPosition().

QMap<QString, AtomDecoration*> AtomDC::decorations
private

list of decorations attached to this AtomDC

Referenced by getDecoration(), and ~AtomDC().

Atom* AtomDC::myAtom
private
QPixmap * AtomDC::myPixmap = NULL
staticprivate

the AtomDC pixmap

Referenced by getIcon().

PMManagerDC* AtomDC::myPMManagerDC
private
AtomDCPopup* AtomDC::myPopupMenu
private

the popup menu

Referenced by AtomDC(), getPopupMenu(), and ~AtomDC().

AtomDCProperties* AtomDC::myProp
private

the atom'properties

Referenced by AtomDC(), getPropertyObject(), and ~AtomDC().

std::IndexInParentItemMap AtomDC::mySCDCindexes
private

correspondance between a SCDC and the order number of this atom dc in a particular SCDC (parent items).

Referenced by getOrderNumberInSCDC(), registerIndexInSCDC(), unregisterIndexInSCDC(), and updatePosition().

std::vector<double *> AtomDC::pointData
private

list of all the point data adresses

Referenced by addPointData(), clearPointData(), and updatePointData().

std::set<StructuralComponentDC *> AtomDC::pointDataSC
private

list of all the SC who asked for a point data in this AtomDC

Referenced by addPointData(), and updatePointData().


The documentation for this class was generated from the following files: