Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Protected Attributes | List of all members
camitk::Component Class Referenceabstract

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. More...

#include <Component.h>

+ Inheritance diagram for camitk::Component:

Public Types

enum  Representation { GEOMETRY, SLICE, NO_REPRESENTATION }
 The different representation that can be implemented to represent this Component in the InteractiveViewer. More...
 
- Public Types inherited from camitk::InterfaceGeometry
enum  EnhancedMode { Normal = 0x0, Hidden = 0x1, Shaded = 0x2, Highlighted = 0x4 }
 (and QFlags EnhancedModes) handle the way the rendering actors will be enhanced or not (from completely hidden to highlighted) More...
 
enum  GlyphType { NoGlyph = 0x0, Sphere = 0x1 }
 (and QFlags GlyphTypes) is the type of glyph attached to the geometry representation More...
 
enum  RenderingMode { None = 0x0, Surface = 0x1, Wireframe = 0x2, Points = 0x4 }
 (and QFlags RenderingModes) handle actor rendering options (render this InterfaceGeometry as a surface, a wireframe and set of points). More...
 
- Public Types inherited from camitk::InterfaceBitMap
enum  PossibleOrientation { AXIAL_ORIENTATION, CORONAL_ORIENTATION, SAGITTAL_ORIENTATION, ARBITRARY_ORIENTATION }
 Common slices orientation: axial, sagittal, coronal or anything else. More...
 

Public Member Functions

Component top level methods

All the methods specific to a data component (but not described in any abstract representation classes)

 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...
 
virtual void setSelected (const bool, const bool recursive=true)
 Update the selection flag. 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...
 
InterfaceProperty

All the implemented InterfaceProperty methods

QStringList getHierarchy ()
 
bool isInstanceOf (QString className)
 Assert that a Component instance really inherits from a given className. More...
 
virtual QWidget * getPropertyWidget (QWidget *parent=0)
 get the property widget to display. More...
 
virtual QObject * getPropertyObject ()
 get the property object that could be understood by PropertyEditor. 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...
 
InterfaceNode

All the implemented InterfaceNode methods

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 void setName (const QString &)
 set the name to be displayed More...
 
virtual const ComponentListgetChildren ()
 get the list of the InterfaceNode children (sub items in the hierarchy) More...
 
virtual bool doubleClicked ()
 this method is called each time the InterfaceNode is double clicked by the user. More...
 
virtual InterfaceNodegetParent ()
 get the parent Component More...
 
virtual QPixmap getIcon ()
 Get the pixmap that will be displayed for this node. More...
 
virtual bool inItalic () const
 A component name is not displayed in italic by default. More...
 
virtual QMenu * getPopupMenu (QWidget *parent=0)
 get the popup menu to display (always return NULL, overwrite this method if you want to give here you own popup) More...
 
InterfaceGeometry

All the implemented InterfaceGeometry methods (delegated or not, see also Component.cpp)

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 setPointSet (vtkSmartPointer< vtkPointSet > param)
 set the low-level data set. More...
 
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 pointPicked (vtkIdType, bool)
 an inherited class can redefine this method something specific. 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 void setEnhancedModes (const EnhancedModes param)
 set the enhanced mode 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...
 
InterfaceBitMap

All the implemented InterfaceBitMap methods

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...
 

Protected Attributes

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...
 

Static Private Attributes

Static members

All the static member (manage the application-wide list of Component + the application-wide current selection + viewers)

static QSet< Viewer * > allViewers
 

Instance members

Representation myService
 the service implemented to be represented in the InteractiveViewer More...
 
QString myName
 my name More...
 
QMap< Viewer *, bool > myViewers
 Where is this Component currently viewed. More...
 
QMenu * actionsMenu
 the action menu for this component More...
 
void init ()
 method called in constructors for general initialization More...
 
virtual void initRepresentation ()=0
 Instanciate the concrete representation (either InterfaceGeometry or InterfaceBitMap) if needed. More...
 

Additional Inherited Members

- Public Attributes inherited from camitk::InterfaceBitMap
QMap< QString, vtkSmartPointer
< vtkProp > > 
extraProp
 The additional map for prop (include at least "label" and "glyph". More...
 

Detailed Description

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 instanciated 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 property, you might want to override updateProperty() in order to update the internal state of your object when a dynamic property has been changed.

See Also
ObjComponent for a good example

It is extensively using Qt Meta-Object system (concepts and implementation). see http://doc.qt.nokia.com/latest/metaobjects.html

Member Enumeration Documentation

The different representation that can be implemented to represent this Component in the InteractiveViewer.

use getRepresentation() to get the information about a specific Component.

Note
the representation cannot be NULL; if a Component does not have any representation, then getRepresentation() should return NO_REPRESENTATION (default).
Enumerator
GEOMETRY 

this Component can be displayed as a GEOMETRY

SLICE 

this Component can be displayed as a SLICE

NO_REPRESENTATION 

this Component has no representation implemented

Constructor & Destructor Documentation

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).

parentComponent is set to NULL (=> isTopLevel() will return true).

Parameters
filethe file to get the data from
namethe Component name
repthe representation concretely implemented by this Component (default=NO_REPRESENTATION)

References init().

camitk::Component::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.

Parameters
parentComponentthe parent Component
namethe Component name
repthe representation implemented by this Component (default=NO_REPRESENTATION)
Exceptions
AbortExceptionif parentComponent is NULL.

References CAMITK_ERROR.

camitk::Component::~Component ( )
virtual

Member Function Documentation

void camitk::Component::addChild ( InterfaceNode )
virtual

add a child Component (sub item in the hierarchy), and modify the child's parent to be equal to this instance

Implements camitk::InterfaceNode.

Reimplemented in StructuralComponentDC, and MultiComponentDC.

References attachChild(), and camitk::InterfaceNode::setParent().

Referenced by MultiComponentDC::addChild(), StructuralComponentDC::addChild(), and MMLComponent::connectPml().

virtual bool camitk::Component::addProp ( const QString &  ,
vtkSmartPointer< vtkProp >   
)
inlinevirtual

insert an additional prop, defining it by its name (default visibility = false)

Returns
true if the additional prop was added (i.e. another additional prop of the same name does not exist)

Implements camitk::InterfaceBitMap.

Referenced by RenderingOption::apply(), VolumeRenderingAction::process(), AnyDecoration::show(), and AtomDecoration::show().

void camitk::Component::attachChild ( InterfaceNode )
virtual
virtual void camitk::Component::cellPicked ( vtkIdType  ,
bool   
)
inlinevirtual

an inherited class can redefine this method something specific.

Default behaviour: do nothing.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC, camitk::MeshComponent, and VtkMeshComponent.

Referenced by camitk::InteractiveViewer::actorPicked().

void camitk::Component::deleteChildren ( )
virtual

delete all sub Component, but do not delete the pointer (only the top-level component has the right to do that)

Implements camitk::InterfaceNode.

Reimplemented in ComponentDC.

References childrenComponent, and camitk::Application::isAlive().

Referenced by MMLComponent::connectPml(), camitk::ImageComponent::replaceImageData(), and ~Component().

bool camitk::Component::doubleClicked ( )
inlinevirtual

this method is called each time the InterfaceNode is double clicked by the user.

Returns
a boolean telling if there was modification made in the Component due to this double click

Implements camitk::InterfaceNode.

Reimplemented in AtomDC.

Referenced by camitk::Explorer::doubleClicked().

bool camitk::Component::event ( QEvent *  e)

Overriden from QObject, this one is only intercepting signal for dynamic property changed (see constructor).

References updateProperty().

virtual vtkSmartPointer<vtkImageActor> camitk::Component::get2DImageActor ( ) const
inlinevirtual

Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D.

Implements camitk::InterfaceBitMap.

Referenced by camitk::InteractiveViewer::refresh(), and camitk::InteractiveViewer::toggleInterpolation().

virtual vtkSmartPointer<vtkImageActor> camitk::Component::get3DImageActor ( ) const
inlinevirtual

Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D.

Implements camitk::InterfaceBitMap.

Referenced by camitk::InteractiveViewer::refresh(), and camitk::InteractiveViewer::toggleInterpolation().

QMenu * camitk::Component::getActionAndPopupMenu ( )

Get a QMenu that contains all the action that can be applied to this component + the popup menu (if exists).

This method will be soon obsolete and be replaced by getPopupMenu, which will not be maintain in its current version). You are encourage to build Action not getPopupMenu() anymore.

References camitk::actionLessThan(), actionsMenu, camitk::Application::getActions(), camitk::Action::getFamily(), getPopupMenu(), and camitk::Action::getQAction().

Referenced by camitk::Explorer::rightButtonPressed(), and ImpMainWindow::updateActionStates().

virtual vtkSmartPointer<vtkActor> camitk::Component::getActor ( const RenderingModes  )
inlinevirtual
void camitk::Component::getActorColor ( const RenderingModes  ,
double  [4] 
)
virtual
virtual double camitk::Component::getActorOpacity ( const RenderingModes  ) const
inlinevirtual

Return the opacity of a given renderng mode.

Implements camitk::InterfaceGeometry.

double camitk::Component::getBoundingRadius ( )
virtual

compute the object's bounding sphere radius,

See Also
Component.cpp
Returns
the bounding radius of the Geometry or -1 if there is no Geometry

Implements camitk::InterfaceGeometry.

Reimplemented in PMManagerDC.

References childrenComponent, camitk::InterfaceGeometry::getBoundingRadius(), getBoundingRadius(), and myGeometry.

Referenced by RenderingOption::apply(), and getBoundingRadius().

void camitk::Component::getBounds ( double  bounds[6])
virtual

compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax], see Component.cpp

Implements camitk::InterfaceGeometry.

Reimplemented in PMManagerDC.

References childrenComponent, getBounds(), invoke1, and myGeometry.

Referenced by getBounds(), and camitk::InteractiveViewer::getBoundsOfSelected().

const ComponentList & camitk::Component::getChildren ( )
inlinevirtual
virtual vtkSmartPointer<vtkAlgorithmOutput> camitk::Component::getDataPort ( ) const
inlinevirtual

get the custom algorithm pipeline input.

This method returns the unmodified data that you have to use as an input for your filter/algorithm. I.e. if you want to temporarily apply some filter/algorithm to the InterfaceGeometry call this method to get the input of your filter/algorithm pipeline. Typically, your custom filter/algorithm connection should start with:

vtkSomeAlgorithm *startFilter = vtkSomeAlgorithm::New();
startFilter->SetInputConnection(theAbstractGeometry->getDataPort());
...
// in the end call setDataConnection()
See Also
setDataConnection(vtkAlgorithmOutput*), Geometry

Implements camitk::InterfaceGeometry.

Referenced by CenterMesh::apply(), MeshQuality::apply(), RigidTransform::getWidget(), and VtkMeshComponentPopup::loadTransformationFile().

virtual const EnhancedModes camitk::Component::getEnhancedModes ( ) const
inlinevirtual

get the current enhanced mode

Implements camitk::InterfaceGeometry.

Reimplemented in ComponentDC.

const QString camitk::Component::getFileName ( ) const
QStringList camitk::Component::getHierarchy ( )
virtual

Get the inheritance hierachy of this Component instance as a list of QString

Implements camitk::InterfaceProperty.

Referenced by camitk::Application::getActions(), and isInstanceOf().

QPixmap camitk::Component::getIcon ( )
inlinevirtual

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)...

Implements camitk::InterfaceNode.

Reimplemented in PMManagerDC, StructuralComponentDC, AtomDC, VtkMeshComponent, MultiComponentDC, and CellDC.

Referenced by camitk::Explorer::getNewItem().

virtual vtkSmartPointer<vtkImageData> camitk::Component::getImageData ( ) const
inlinevirtual

Return the displayed images as a vtkImageData.

Implements camitk::InterfaceBitMap.

Referenced by camitk::SingleImageComponent::initRepresentation().

const QString camitk::Component::getLabel ( ) const
inlinevirtual

get the string used to display the label, do the same as getName

Implements camitk::InterfaceGeometry.

bool camitk::Component::getModified ( ) const
inlinevirtual

set the modified flag

Reimplemented in PMManagerDC, and MMLComponent.

Referenced by camitk::Application::close(), MMLComponent::getModified(), and camitk::Action::postProcess().

QString camitk::Component::getName ( ) const
inlinevirtual

get the name to be displayed

Implements camitk::InterfaceNode.

Referenced by camitk::InteractiveViewer::actorPicked(), MultiComponentDC::addChild(), AnyDecoration::AnyDecoration(), CleanPolyData::apply(), ExtractSurface::apply(), FillWithPoints::apply(), WarpOut::apply(), CreateSC::apply(), Decimation::apply(), CenterMesh::apply(), SaveAsAction::apply(), MeshQuality::apply(), MeshPicking::apply(), StructuralComponentDC::atomsToGeometry(), ImageReconstructionAction::build3DModel(), CellDC::CellDC(), StructuralComponentDC::cellsToGeometry(), VtkMeshComponentPopup::cleanPolyData(), camitk::Application::close(), camitk::ImageComponent::getImageName(), StructuralComponentDCProperties::getName(), CellDCProperties::getName(), camitk::Explorer::getNewItem(), camitk::ActionWidget::getTargetLabel(), ImageReconstructionAction::init(), CellDC::initRepresentation(), camitk::MeshComponent::initRepresentation(), AtomDC::initRepresentation(), PMManagerDC::initRepresentation(), MultiPickingWidget::manuallyModified(), StructuralComponentDC::pointPicked(), ManualThreshold::process(), MedianFilter::process(), MeanFilter::process(), Derivative::process(), LaplacianRecursiveGaussian::process(), LaplacianSharpening::process(), GradientMagnitudeRecursiveGaussian::process(), Laplacian::process(), CannyEdgeDetection::process(), SobelEdgeDetection::process(), GradientMagnitude::process(), OtsuFilter::process(), ConnectedComponents::process(), RegionGrowing::process(), GaussianFilter::process(), AnisotropicDiffusion::process(), MorphologicalOperators::process(), camitk::Explorer::renameItem(), VtkMeshComponentExtension::save(), camitk::ComponentExtension::save(), camitk::Application::save(), and RegionGrowingWidget::updateComponent().

virtual int camitk::Component::getNumberOfColors ( ) const
inlinevirtual

Return the number of colors in the images.

If color is coded on 1 byte, the images are on 256 grey level. If color is coded on 2 bytes, the images are on 4096 grey level (not 65536).

Implements camitk::InterfaceBitMap.

Reimplemented in camitk::ImageComponent.

virtual unsigned int camitk::Component::getNumberOfProp ( ) const
inlinevirtual

return the number of additional prop

Implements camitk::InterfaceBitMap.

Referenced by camitk::InteractiveViewer::refresh().

int camitk::Component::getNumberOfSlices ( ) const
virtual
InterfaceNode * camitk::Component::getParent ( )
inlinevirtual
Component * camitk::Component::getParentComponent ( )
virtual
virtual vtkSmartPointer<vtkActor> camitk::Component::getPickPlaneActor ( ) const
inlinevirtual

Return the vtkActor used to pick pixels in the slices.

Implements camitk::InterfaceBitMap.

Referenced by camitk::InteractiveViewer::refresh().

virtual vtkSmartPointer<vtkActor> camitk::Component::getPixelActor ( )
inlinevirtual

Return the vtkActor used to pick pixels in the slices.

Implements camitk::InterfaceBitMap.

Referenced by camitk::InteractiveViewer::refresh().

virtual vtkSmartPointer<vtkPointSet> camitk::Component::getPointSet ( )
inlinevirtual
virtual QMenu* camitk::Component::getPopupMenu ( QWidget *  parent = 0)
inlinevirtual

get the popup menu to display (always return NULL, overwrite this method if you want to give here you own popup)

Implements camitk::InterfaceNode.

Reimplemented in StructuralComponentDC, PMManagerDC, AtomDC, MMLComponent, VtkMeshComponent, and MultiComponentDC.

Referenced by getActionAndPopupMenu().

virtual vtkSmartPointer<vtkProp> camitk::Component::getProp ( const QString &  )
inlinevirtual
virtual vtkSmartPointer<vtkProp> camitk::Component::getProp ( unsigned int  int)
inlinevirtual

return an additional prop by its index

Implements camitk::InterfaceBitMap.

virtual QObject* camitk::Component::getPropertyObject ( )
inlinevirtual

get the property object that could be understood by PropertyEditor.

Returns this as any Component instance can manage its list of dynamic properties (and Component inherits from InterfaceProperty ). You can also have a separate class to manage your Component properties. In this case, just overide this method and return the corresponding instance.

See Also
PropertyExplorer ObjectController

Implements camitk::InterfaceProperty.

Reimplemented in StructuralComponentDC, AtomDC, ComponentDC, VtkMeshComponent, and CellDC.

virtual QWidget* camitk::Component::getPropertyWidget ( QWidget *  parent = 0)
inlinevirtual

get the property widget to display.

(always return NULL, overwrite this method if you want to give here you own widget)

See Also
PropertyExplorer

Implements camitk::InterfaceProperty.

Reimplemented in AtomDC.

const InterfaceGeometry::RenderingModes camitk::Component::getRenderingModes ( ) const
virtual
Component::Representation camitk::Component::getRepresentation ( ) const
double camitk::Component::getRotationX ( ) const
virtual
double camitk::Component::getRotationY ( ) const
virtual
double camitk::Component::getRotationZ ( ) const
virtual
int camitk::Component::getSlice ( ) const
virtual
Component * camitk::Component::getTopLevelComponent ( )
virtual
bool camitk::Component::getVisibility ( Viewer v) const
virtual
void camitk::Component::init ( )
private

method called in constructors for general initialization

References actionsMenu, camitk::Application::addComponent(), childrenComponent, isSelectedFlag, modifiedFlag, myGeometry, and mySlice.

Referenced by Component().

bool camitk::Component::inItalic ( ) const
inlinevirtual

A component name is not displayed in italic by default.

You must redefine this method in you inherited Component to change this behaviour.

Implements camitk::InterfaceNode.

Referenced by camitk::Explorer::getNewItem().

virtual void camitk::Component::initRepresentation ( )
privatepure virtual

Instanciate the concrete representation (either InterfaceGeometry or InterfaceBitMap) if needed.

This method have to instanciate Slice (mySlice) or Geometry (myGeometry) that does all the work for this Component, i.e. the adaptee handler. Generally this method should be called in the Component constructor.

Implemented in PMManagerDC, camitk::ImageComponent, StructuralComponentDC, AtomDC, camitk::MeshComponent, camitk::SingleImageComponent, CellDC, MultiComponentDC, MMLComponent, and VRMLComponent.

bool camitk::Component::isInstanceOf ( QString  className)
virtual
bool camitk::Component::isSelected ( ) const
inlinevirtual
bool camitk::Component::isTopLevel ( ) const

return true if this component is a top-level component

References myParentNode.

Referenced by SaveAsAction::apply(), and getTopLevelComponent().

virtual void camitk::Component::pixelPicked ( double  ,
double  ,
double   
)
inlinevirtual

This method is called when the associated plane has been picked in the InteractiveViewer, the given coordinates is position where the plane was picked.

Implements camitk::InterfaceBitMap.

Reimplemented in camitk::SingleImageComponent.

Referenced by camitk::InteractiveViewer::actorPicked().

virtual void camitk::Component::pointPicked ( vtkIdType  ,
bool   
)
inlinevirtual

an inherited class can redefine this method something specific.

Default behaviour: do nothing.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC, AtomDC, camitk::MeshComponent, and VtkMeshComponent.

Referenced by camitk::InteractiveViewer::actorPicked().

void camitk::Component::refresh ( ) const
virtual
void camitk::Component::refreshInterfaceNode ( )
virtual

Asks all viewers that are currently displaying this Component to rebuild the representation of the InterfaceNode for this Component.

It calls the method update(Component *) of the class Viewer. This method does nothing except for the Explorer where it does not only refresh, but remove this and re-load the Component.

References myViewers.

Referenced by CreateSC::apply(), MMLComponent::connectPml(), and camitk::ImageComponent::replaceImageData().

void camitk::Component::removeChild ( InterfaceNode childNode)
virtual

remove from the the sub item vector.

This method automatically update the parentComponent of (set to NULL).

Implements camitk::InterfaceNode.

Reimplemented in StructuralComponentDC, and MultiComponentDC.

References childrenComponent, and camitk::InterfaceNode::setParent().

Referenced by MMLComponent::connectPml(), MultiComponentDC::removeChild(), StructuralComponentDC::removeChild(), and camitk::ImageComponent::replaceImageData().

virtual bool camitk::Component::removeProp ( const QString &  )
inlinevirtual

remove a given additional prop.

Returns
true if effictively done

Implements camitk::InterfaceBitMap.

Referenced by VolumeRenderingAction::process(), AnyDecoration::~AnyDecoration(), and AtomDecoration::~AtomDecoration().

virtual void camitk::Component::setActorColor ( const RenderingModes  ,
double  [4] 
)
inlinevirtual

Set the color of given representation modes.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC.

Referenced by ChangeColor::apply(), and StructuralComponentDC::setActorColor().

virtual void camitk::Component::setActorColor ( const RenderingModes  ,
const double  ,
const double  ,
const double   
)
inlinevirtual

Set the color of given representation modes.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC.

virtual void camitk::Component::setActorOpacity ( const RenderingModes  ,
const double   
)
inlinevirtual

Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified!

Implements camitk::InterfaceGeometry.

virtual void camitk::Component::setColor ( const double  ,
const double  ,
const double   
)
inlinevirtual

Set an (r,g,b) color to all representation modes, without changing the opacity.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC.

Referenced by StructuralComponentDC::setColor().

virtual void camitk::Component::setColor ( const double  ,
const double  ,
const double  ,
const double   
)
inlinevirtual

Set an (r,g,b,a) color to all representation modes.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC.

virtual void camitk::Component::setDataConnection ( vtkSmartPointer< vtkAlgorithmOutput >  )
inlinevirtual

Set/reset the connection for the InterfaceGeometry internal algorithm.

This method sets the input for the InterfaceGeometry mapping/rendering pipeline. Your should call this method to have the correct rendering of your custom filter/algorithm pipelines. Typically, your custom filter/algorithm connection should end with:

// begining of the custom filter/algorithm pipelines (don't forget to call getDataPort()!)
...
theAbstractGeometry->setDataConnection(endFilter->GetOutputPort());

To remove your custom pipeline, either call setDataConnection(NULL) or theAbstractGeometry->setDataConnection(theAbstractGeometry->getDataPort())

See Also
getDataPort(), Geometry

Implements camitk::InterfaceGeometry.

Referenced by RigidTransform::close(), RigidTransform::getWidget(), and VtkMeshComponentPopup::loadTransformationFile().

virtual void camitk::Component::setEnhancedModes ( const EnhancedModes  )
inlinevirtual
void camitk::Component::setFileName ( const QString &  fName)

set the file name where the data have to be stored

References myFileName.

Referenced by SaveAsAction::apply().

void camitk::Component::setGlyphType ( const GlyphTypes  type,
const double  size = 0.0 
)
virtual

Set the glyph type (a glyph is a geometric representation attached to every point in the input dataset).

The glyph size is needed when the type is not NoGlyph (the size value is used depending on the current GlyphTypes) :

  • if type is Sphere, size is the radius for the sphere (this is the default)
  • if type is NoGlyph, then no glyph are shown

To show the glyph call getProp("glyph")->SetVisibility(true) or getProp("glyph")->VisibilityOn().

Parameters
typethe glyph type
sizesize of the glyph (default is 0.0)

Implements camitk::InterfaceGeometry.

References myGeometry, and camitk::InterfaceGeometry::setGlyphType().

void camitk::Component::setLabel ( QString  newName)
inlinevirtual

set the string used to display the label, do the same as setName

Implements camitk::InterfaceGeometry.

virtual void camitk::Component::setLinesAsTubes ( bool  )
inlinevirtual

set the lines as tubes (works only for vtkDataSet representation that contains lines)

Implements camitk::InterfaceGeometry.

Referenced by camitk::InteractiveViewer::refresh().

void camitk::Component::setModified ( bool  modified = true)
inlinevirtual
void camitk::Component::setName ( const QString &  )
inlinevirtual
virtual void camitk::Component::setOpacity ( const double  )
inlinevirtual

Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified!

Implements camitk::InterfaceGeometry.

Reimplemented in ComponentDC.

Referenced by ComponentDC::setOpacity().

virtual void camitk::Component::setOriginalVolume ( vtkSmartPointer< vtkImageData >  )
inlinevirtual

set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline

Implements camitk::InterfaceBitMap.

Referenced by camitk::ImageComponent::updateImageComponents().

void camitk::Component::setParent ( InterfaceNode pes)
virtual

set the parent Component. This method automatically remove this Component from its previous (if already had one parent Component)

Implements camitk::InterfaceNode.

References camitk::Application::getTopLevelComponentList(), myParentNode, and camitk::InterfaceNode::removeChild().

virtual void camitk::Component::setPixelRealPosition ( double  ,
double  ,
double   
)
inlinevirtual

move the pixel selection green indicator (pixelActor) to the given real position

Implements camitk::InterfaceBitMap.

virtual void camitk::Component::setPointData ( vtkSmartPointer< vtkDataArray >  )
inlinevirtual

set the point data (may contains a lookup table).

Note
values have to be in interval [0..1]

Implements camitk::InterfaceGeometry.

Referenced by CellDC::createPointData(), StructuralComponentDC::createPointData(), CellDC::destroyPointData(), and StructuralComponentDC::destroyPointData().

virtual void camitk::Component::setPointPosition ( const unsigned int  orderNumber,
const double  x,
const double  y,
const double  z 
)
inlinevirtual

set a given point position

Implements camitk::InterfaceGeometry.

virtual void camitk::Component::setPointSet ( vtkSmartPointer< vtkPointSet >  )
inlinevirtual

set the low-level data set.

Note
if there is already a vtkPointSet, this method calls DeepCopy(ds)
it is very important to overload this method in your Component subclass as this will be called by all the operators that operates a change directly on the data.

Implements camitk::InterfaceGeometry.

Reimplemented in StructuralComponentDC, and AtomDC.

Referenced by CenterMesh::apply(), RigidTransform::apply(), VtkMeshComponentPopup::loadTransformationFile(), and StructuralComponentDC::setPointSet().

virtual void camitk::Component::setRenderingModes ( const RenderingModes  param)
inlinevirtual
virtual void camitk::Component::setRotationX ( double  angle)
inlinevirtual

Set the current angle to the arbitrary slice.

Implements camitk::InterfaceBitMap.

virtual void camitk::Component::setRotationY ( double  param)
inlinevirtual
virtual void camitk::Component::setRotationZ ( double  param)
inlinevirtual
void camitk::Component::setSelected ( const bool  b,
const bool  recursive = true 
)
virtual
virtual void camitk::Component::setSlice ( int  s)
inlinevirtual

Set the current slice index.

If the slice index is less than the first slice index, the first slice is displayed. If the slice index is more than the last slice index, the last slice is displayed.

Parameters
sthe index of the slice to display (base 0).

Implements camitk::InterfaceBitMap.

Referenced by camitk::ImageComponent::pixelPicked().

virtual void camitk::Component::setSlice ( double  x,
double  y,
double  z 
)
inlinevirtual

Set the slice corresponding to the given world coordinates.

Implements camitk::InterfaceBitMap.

virtual void camitk::Component::setTexture ( vtkSmartPointer< vtkTexture >  )
inlinevirtual

Set a texture to this object.

Implements camitk::InterfaceGeometry.

void camitk::Component::setVisibility ( Viewer v,
bool  b 
)
virtual
virtual void camitk::Component::updatePickPlane ( )
inlinevirtual
void camitk::Component::updateProperty ( QString  name,
QVariant  value 
)
virtual

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.

This method is called when a dynamic property has to be udpated

Parameters
namethe name of the dynamic property
valuethe new value to take into account

Implements camitk::InterfaceProperty.

References CAMITK_INFO.

Referenced by event(), and ObjComponent::updateProperty().

Member Data Documentation

QMenu* camitk::Component::actionsMenu
private

the action menu for this component

Referenced by getActionAndPopupMenu(), and init().

QSet< Viewer * > camitk::Component::allViewers
staticprivate

set of used viewers

ComponentList camitk::Component::childrenComponent
protected
bool camitk::Component::isSelectedFlag
protected

tells if this particular Component is selected or not

Referenced by init(), AtomDC::initRepresentation(), AtomDC::setSelected(), setSelected(), and ~Component().

bool camitk::Component::modifiedFlag
protected

the modificatio flag (could be extended to manage a undo/redo list)

Referenced by PMManagerDC::getModified(), and init().

QString camitk::Component::myFileName
protected

the file name from which the Component is loaded

Referenced by getFileName(), and setFileName().

InterfaceGeometry* camitk::Component::myGeometry
protected
QString camitk::Component::myName
private

my name

InterfaceNode* camitk::Component::myParentNode
protected
Representation camitk::Component::myService
private

the service implemented to be represented in the InteractiveViewer

Referenced by getRepresentation().

InterfaceBitMap* camitk::Component::mySlice
protected

mySlice is the slice representation of this data component, the Component delegates all InterfaceBitMap activity to mySlice (delegation pattern)

Referenced by getNumberOfSlices(), getRepresentation(), getRotationX(), getRotationY(), getRotationZ(), getSlice(), init(), camitk::SingleImageComponent::initRepresentation(), camitk::SingleImageComponent::pixelPicked(), and ~Component().

QMap<Viewer *, bool> camitk::Component::myViewers
private

Where is this Component currently viewed.

Referenced by getVisibility(), refresh(), refreshInterfaceNode(), setVisibility(), and ~Component().


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