Computer Assited Medical Intervention Tool Kit  version 4.1
sdk/libraries/core/component/Component.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef CAMITK_COMPONENT_H
27 #define CAMITK_COMPONENT_H
28 
29 // -- Core stuff
30 #include "InterfaceNode.h"
31 #include "InterfaceGeometry.h"
32 #include "InterfaceBitMap.h"
33 #include "InterfaceProperty.h"
34 #include "InterfaceFrame.h"
35 #include "AbortException.h"
36 
37 // -- QT stuff
38 #include <QPixmap>
39 #include <QMenu>
40 #include <QVector>
41 
42 // -- vtk stuff
43 #include <vtkWindowLevelLookupTable.h>
44 #include <vtkImageData.h>
45 #include <vtkPointSet.h>
46 #include <vtkSmartPointer.h>
47 #include <vtkAlgorithmOutput.h>
48 #include <vtkActor.h>
49 #include <vtkAxesActor.h>
50 #include <vtkActor2D.h>
51 #include <vtkImageActor.h>
52 #include <vtkTransform.h>
53 
54 // -- vtk stuff Classes
55 class vtkActor;
56 class vtkTexture;
57 class vtkPointSet;
58 class vtkUnstructuredGridAlgorithm;
59 class vtkDataSetToUnstructuredGridFilter;
60 class vtkWindowLevelLookupTable;
61 
62 // -----------------------------------------------------------------------
63 //
64 // Delegation macros
65 // (And your dream comes true)
66 //
67 // -----------------------------------------------------------------------
68 
73 #define invoke0(HANDLER,METHOD) \
74 if (HANDLER) \
75  HANDLER->METHOD();
76 
77 #define invoke1(HANDLER,METHOD,PARAM) \
78 if (HANDLER) \
79  HANDLER->METHOD(PARAM);
80 
81 #define invoke2(HANDLER,METHOD,PARAM1,PARAM2) \
82 if (HANDLER) \
83  HANDLER->METHOD(PARAM1,PARAM2);
84 
85 #define invoke3(HANDLER,METHOD,PARAM1,PARAM2,PARAM3) \
86 if (HANDLER) \
87  HANDLER->METHOD(PARAM1,PARAM2,PARAM3);
88 
89 #define invoke4(HANDLER,METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
90 if (HANDLER) \
91  HANDLER->METHOD(PARAM1,PARAM2,PARAM3,PARAM4);
92 
97 #define invokeGet0(HANDLER,METHOD) \
98 if (HANDLER) \
99  return HANDLER->METHOD();
100 
101 #define invokeGet1(HANDLER,METHOD,PARAM) \
102 if (HANDLER) \
103  return HANDLER->METHOD(PARAM);
104 
105 #define invokeGet2(HANDLER,METHOD,PARAM1,PARAM2) \
106 if (HANDLER) \
107  return HANDLER->METHOD(PARAM1,PARAM2);
108 
109 #define invokeGet3(HANDLER,METHOD,PARAM1,PARAM2,PARAM3) \
110 if (HANDLER) \
111  return HANDLER->METHOD(PARAM1,PARAM2,PARAM3);
112 
113 #define invokeGet4(HANDLER,METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
114 if (HANDLER) \
115  return HANDLER->METHOD(PARAM1,PARAM2,PARAM3,PARAM4);
116 
120 #define invokeChildren0(METHOD) \
121 foreach (Component *child, childrenComponent) { \
122  child->METHOD(); \
123  }
124 
125 #define invokeChildren1(METHOD,PARAM) \
126 foreach (Component *child, childrenComponent) { \
127  child->METHOD(PARAM); \
128  }
129 
130 #define invokeChildren2(METHOD,PARAM1,PARAM2) \
131 foreach (Component *child, childrenComponent) { \
132  child->METHOD(PARAM1,PARAM2); \
133  }
134 
135 #define invokeChildren3(METHOD,PARAM1,PARAM2,PARAM3) \
136 foreach (Component *child, childrenComponent) { \
137  child->METHOD(PARAM1,PARAM2,PARAM3); \
138  }
139 
140 #define invokeChildren4(METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
141 foreach (Component *child, childrenComponent) { \
142  child->METHOD(PARAM1,PARAM2,PARAM3,PARAM4); \
143  }
144 
150 #define delegate0(HANDLER,METHOD) \
151 virtual void METHOD() { \
152  invoke0(HANDLER,METHOD) \
153  }
154 
155 #define delegate1(HANDLER,METHOD,PARAM_TYPE) \
156 virtual void METHOD(PARAM_TYPE param) { \
157  invoke1(HANDLER,METHOD,param) \
158  }
159 
160 #define delegate2(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2) \
161 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2) { \
162  invoke2(HANDLER,METHOD,param1,param2) \
163  }
164 
165 #define delegate3(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3) \
166 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3) { \
167  invoke3(HANDLER,METHOD,param1,param2,param3) \
168  }
169 
170 #define delegate4(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3, PARAM_TYPE4) \
171 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3, PARAM_TYPE4 param4) { \
172  invoke4(HANDLER,METHOD,param1,param2,param3,param4) \
173  }
174 
181 #define delegateGet0(HANDLER,METHOD,TYPE) \
182 virtual TYPE METHOD() { \
183  invokeGet0(HANDLER,METHOD) \
184  else \
185  return 0; \
186  }
187 
188 #define delegateGet1(HANDLER,METHOD,TYPE,PARAM_TYPE) \
189 virtual TYPE METHOD(PARAM_TYPE param) { \
190  invokeGet1(HANDLER,METHOD,param) \
191  else \
192  return 0; \
193  }
194 
195 #define delegateGet2(HANDLER,METHOD,TYPE,PARAM1_TYPE,PARAM2_TYPE) \
196 virtual TYPE METHOD(PARAM1_TYPE param1, PARAM2_TYPE param2) { \
197  invokeGet2(HANDLER,METHOD,param1,param2) \
198  else \
199  return 0; \
200  }
201 
204 #define delegateConstGet0(HANDLER,METHOD,TYPE) \
205 virtual TYPE METHOD() const { \
206  invokeGet0(HANDLER,METHOD) \
207  else \
208  return 0; \
209  }
210 
211 #define delegateConstGet1(HANDLER,METHOD,TYPE,PARAM_TYPE) \
212 virtual TYPE METHOD(PARAM_TYPE param) const { \
213  invokeGet1(HANDLER,METHOD,param) \
214  else \
215  return 0; \
216  }
217 
222 #define delegateAndInvokeChildren1(HANDLER,METHOD,PARAM_TYPE) \
223 virtual void METHOD(PARAM_TYPE param) { \
224  invoke1(HANDLER,METHOD,param) \
225  invokeChildren1(METHOD,param) \
226  }
227 
228 #define delegateAndInvokeChildren2(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2) \
229 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2) { \
230  invoke2(HANDLER,METHOD,param1,param2) \
231  invokeChildren2(METHOD,param1,param2) \
232  }
233 
234 #define delegateAndInvokeChildren1Array(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,DIM) \
235 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2[DIM]) { \
236  invoke2(HANDLER,METHOD,param1,param2) \
237  invokeChildren2(METHOD,param1,param2) \
238  }
239 
240 #define delegateAndInvokeChildren3(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3) \
241 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3) { \
242  invoke3(HANDLER,METHOD,param1,param2,param3) \
243  invokeChildren3(METHOD,param1,param2,param3) \
244  }
245 
246 #define delegateAndInvokeChildren4(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3,PARAM_TYPE4) \
247 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3,PARAM_TYPE4 param4) { \
248  invoke4(HANDLER,METHOD,param1,param2,param3,param4) \
249  invokeChildren4(METHOD,param1,param2,param3,param4) \
250  }
251 
252 
253 namespace camitk {
254 // -- Core stuff classes
255 class Geometry;
256 class Slice;
257 class Viewer;
258 class Frame;
259 
260 
299  Q_OBJECT
300 
301 public:
310  NO_REPRESENTATION
311  };
312 
316 
324  Component(QString file, QString name, Representation rep = NO_REPRESENTATION);
325 
335  Component(Component* parentComponent, const QString& name, Representation rep = NO_REPRESENTATION);
336 
344  ~Component() override;
345 
349  Representation getRepresentation() const;
350 
352  bool isTopLevel() const;
353 
355  virtual Component* getParentComponent();
356 
358  virtual Component* getTopLevelComponent();
359 
361  virtual InterfaceFrame* getFrame();
362 
364  virtual void setModified(bool modified = true);
365 
367  virtual bool getModified() const;
368 
370  virtual void setVisibility(Viewer*, bool);
371 
373  virtual bool getVisibility(Viewer*) const;
374 
376  virtual void refresh() const;
377 
384  virtual void refreshInterfaceNode();
385 
387  virtual bool isSelected() const;
388 
393  virtual void setSelected(const bool b, const bool recursive = true);
394 
396  const QString getFileName() const;
397 
399  void setFileName(const QString&);
400 
402  bool event(QEvent* e) override;
403 
405  QMenu* getActionMenu();
407 
412  QStringList getHierarchy() const override;
415 
417  bool isInstanceOf(QString className) const override;
418 
423  unsigned int getNumberOfPropertyWidget() {
424  return 0;
425  }
426 
431  QWidget* getPropertyWidgetAt(unsigned int i) {
432  return nullptr;
433  }
434 
443  QObject* getPropertyObject() {
444  return this;
445  }
446 
453  void updateProperty(QString name, QVariant value) override;
454 
462  inline void setIndexOfPropertyExplorerTab(unsigned int index) {
463  this->indexOfPropertyExplorerTab = index;
464  }
465 
473  inline unsigned int getIndexOfPropertyExplorerTab() {
474  return this->indexOfPropertyExplorerTab;
475  }
476 
483  Q_INVOKABLE Property* getProperty(QString name) override;
484 
493  bool addProperty(Property*) override;
495 
500  //-- the methods below are commented because the default comment in InterfaceNode lacks some information...
502  void addChild(InterfaceNode*) override;
503  void attachChild(InterfaceNode*) override;
507  void removeChild(InterfaceNode*) override;
508 
510  void setParent(InterfaceNode*) override;
511 
512  //--not commented because Doxygen automatically use the inherited documentation (set INHERIT_DOCS flag to YES in the Doxyfile)
513  void deleteChildren() override;
514  QString getName() const override;
515  void setName(const QString&) override;
516  const ComponentList& getChildren() override;
517  bool doubleClicked() override;
518  InterfaceNode* getParent() override;
519  QPixmap getIcon() override;
520 
524  bool inItalic() const override;
525 
527  QMenu* getPopupMenu(QWidget* parent = nullptr) {
528  return nullptr;
529  }
531 
536  const QString getLabel() const override;
539 
541  void setLabel(QString newName) override;
542 
543  delegateGet0(myGeometry, getPointSet, vtkSmartPointer<vtkPointSet>)
544 
545  delegate1(myGeometry, setPointSet, vtkSmartPointer<vtkPointSet>)
546 
547  delegate1(myGeometry, setPointData, vtkSmartPointer<vtkDataArray>)
548 
549  delegateConstGet0(myGeometry, getDataPort, vtkSmartPointer<vtkAlgorithmOutput>)
550 
551  delegate1(myGeometry, setDataConnection, vtkSmartPointer<vtkAlgorithmOutput>)
552 
553  delegateGet1(myGeometry, getActor, vtkSmartPointer<vtkActor>, const RenderingModes)
554 
555  // TODO : uses an object myRepresentation (which is a Geometry or a Slice)
556  // to use a single delegate macro
557  vtkSmartPointer<vtkProp> getProp(const QString& param) {
558  if (myGeometry) {
559  return myGeometry->getProp(param);
560  }
561  else if (mySlice) {
562  return mySlice->getProp(param);
563  }
564  return nullptr;
565  }
566 
567  unsigned int getNumberOfProp() const {
568  if (myGeometry) {
569  return myGeometry->getNumberOfProp();
570  }
571  else if (mySlice) {
572  return mySlice->getNumberOfProp();
573  }
574  return 0;
575  }
576 
577  vtkSmartPointer<vtkProp> getProp(unsigned int index) {
578  if (myGeometry) {
579  return myGeometry->getProp(index);
580  }
581  else if (mySlice) {
582  return mySlice->getProp(index);
583  }
584  return nullptr;
585  }
586 
587  bool addProp(const QString& name, vtkSmartPointer<vtkProp> prop) {
588  if (myGeometry) {
589  return myGeometry->addProp(name, prop);
590  }
591  else if (mySlice) {
592  return mySlice->addProp(name, prop);
593  }
594  return false;
595  }
596 
597 
598  bool removeProp(const QString& name) {
599  if (myGeometry) {
600  return myGeometry->removeProp(name);
601  }
602  else if (mySlice) {
603  return mySlice->removeProp(name);
604  }
605  return false;
606  }
607  // END TODO
608 
609 
613  void pointPicked(vtkIdType, bool) {}
614 
618  void cellPicked(vtkIdType, bool) {}
619 
620  // --
621 
623  void getBounds(double* bounds) override;
624 
628  double getBoundingRadius() override;
629 
630  delegate4(myGeometry, setPointPosition, const unsigned int, const double, const double, const double)
631 
632  delegateAndInvokeChildren1(myGeometry, setRenderingModes, const RenderingModes)
633 
635  const InterfaceGeometry::RenderingModes getRenderingModes() const override;
636 
637  delegateAndInvokeChildren1(myGeometry, setEnhancedModes, const EnhancedModes)
638 
639  delegateConstGet0(myGeometry, getEnhancedModes, const EnhancedModes)
640 
641  delegateAndInvokeChildren1Array(myGeometry, setActorColor, const RenderingModes, double, 4)
642 
643  delegateAndInvokeChildren4(myGeometry, setActorColor, const RenderingModes, const double, const double, const double)
644 
646  void getActorColor(const RenderingModes, double [4]) override;
647 
648  delegateAndInvokeChildren3(myGeometry, setColor, const double, const double, const double)
649 
650  delegateAndInvokeChildren4(myGeometry, setColor, const double, const double, const double, const double)
651 
652  delegateAndInvokeChildren2(myGeometry, setActorOpacity, const RenderingModes, const double)
653 
654  delegateConstGet1(myGeometry, getActorOpacity, double, const RenderingModes)
655 
656  delegateAndInvokeChildren1(myGeometry, setOpacity, const double)
657 
658  delegate2(myGeometry, setMapperScalarRange, double, double)
659 
660  delegate1(myGeometry, setTexture, vtkSmartPointer<vtkTexture>)
661 
662  void setGlyphType(const GlyphTypes type, const double size = 0.0) override;
663 
664  delegate1(myGeometry, setLinesAsTubes, bool)
665 
666  delegate1(myGeometry, setMeshWorldTransform, vtkSmartPointer<vtkTransform>)
667 
669 
674  delegateConstGet0(mySlice, getImageData, vtkSmartPointer<vtkImageData>)
676 
677  delegate1(mySlice, setOriginalVolume, vtkSmartPointer<vtkImageData>)
678 
679  delegateConstGet0(mySlice, get2DImageActor, vtkSmartPointer<vtkImageActor>)
680 
681  delegateConstGet0(mySlice, get3DImageActor, vtkSmartPointer<vtkImageActor>)
682 
683  delegateConstGet0(mySlice, getPickPlaneActor, vtkSmartPointer<vtkActor>)
684 
685  delegateGet0(mySlice, getPixelActor, vtkSmartPointer<vtkActor>)
686 
687 // delegateGet0(mySlice, get2DAxesActor, vtkSmartPointer<vtkAxesActor>)
688 
689  delegate3(mySlice, pixelPicked, double, double, double)
690 
691  delegate0(mySlice, updatePickPlane)
692 
693  delegate1(mySlice, setSlice, int)
694 
695  delegate3(mySlice, setSlice, double, double, double)
696 
697  delegateConstGet0(mySlice, getNumberOfColors, int)
698 
699  delegate3(mySlice, setPixelRealPosition, double, double, double)
700 
701  delegate1(mySlice, setImageWorldTransform, vtkSmartPointer<vtkTransform>)
702 
704  int getNumberOfSlices() const override;
705 
707  int getSlice() const override;
709 
710 
715  const QString& getFrameName() const override;
717 
718  delegate1(myFrame, setFrameName, QString)
719 
720  InterfaceFrame* getParentFrame() const override;
721 
722  void setParentFrame(InterfaceFrame* frame, bool keepTransform = true) override;
723 
724  const QVector<InterfaceFrame*>& getChildrenFrame() const override;
725 
726  const vtkSmartPointer<vtkTransform> getTransformFromWorld() const override;
727 
728  const vtkSmartPointer<vtkTransform> getTransform() const override;
729 
730  const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame* frame) const override;
731 
732  delegate1(myFrame, setTransform, vtkSmartPointer<vtkTransform>)
733 
734  delegate0(myFrame, resetTransform)
735 
736  delegate3(myFrame, translate, double, double, double)
737 
738  delegate3(myFrame, rotate, double, double, double)
739 
740  delegate3(myFrame, rotateVTK, double, double, double)
741 
742  delegate3(myFrame, setTransformTranslation, double, double, double)
743 
744  delegate3(myFrame, setTransformTranslationVTK, double, double, double)
745 
746  delegate3(myFrame, setTransformRotation, double, double, double)
747 
748  delegate3(myFrame, setTransformRotationVTK, double, double, double)
749 
750  vtkSmartPointer<vtkAxesActor> getFrameAxisActor() override;
751 
752  delegate2(myFrame, setFrameVisibility, Viewer*, bool)
753 
754  bool getFrameVisibility(Viewer* viewer) const override;
755 
756  delegate1(myFrame, addFrameChild, InterfaceFrame*)
757 
758  delegate1(myFrame, removeFrameChild, InterfaceFrame*)
760 
761 
762 protected:
764  InterfaceGeometry* myGeometry;
765 
767  InterfaceBitMap* mySlice;
768 
770  InterfaceNode* myParentNode;
771 
773  InterfaceFrame* myFrame;
774 
776  ComponentList childrenComponent;
777 
779  bool isSelectedFlag;
780 
782  bool modifiedFlag;
783 
785  QString myFileName;
786 
788  unsigned int indexOfPropertyExplorerTab;
789 
790 
791 private:
794 
797  void init();
798 
800  Representation myService;
801 
803  QString myName;
804 
809  virtual void initRepresentation() = 0;
810 
812  QMap<Viewer*, bool> myViewers;
813 
815  QMenu* actionsMenu;
816 
818  QMap<QString, Property*> propertyMap;
820 
824  static QSet<Viewer*> allViewers;
828 
829 };
830 
831 
832 // -------------------- isSelected --------------------
833 inline bool Component::isSelected() const {
834  return isSelectedFlag;
835 }
836 
837 // -------------------- doubleClicked --------------------
839  // always false by default. You must overload this method in Components to change its behaviour.
840  return false;
841 }
842 
843 // -------------------- getChildren --------------------
845  return childrenComponent;
846 }
847 
848 // -------------------- getName --------------------
849 inline QString Component::getName() const {
850  return myName;
851 }
852 
853 // -------------------- getParent --------------------
855  return ((Component*) myParentNode);
856 }
857 
858 // -------------------- getFrame --------------------
860  return myFrame;
861 }
862 
863 // -------------------- getPixmap ------------------
864 inline QPixmap Component::getIcon() {
865  return QPixmap(0, 0); // this is a NULL QPixmap in the Qt sense. QPixmap::isNull will then return true;
866 }
867 
868 // -------------------- inItalic --------------------
869 inline bool Component::inItalic() const {
870  return false;
871 }
872 
873 // -------------------- setName --------------------
874 inline void Component::setName(const QString& n) {
875  myName = n;
876  if (myGeometry) {
877  myGeometry->setLabel(n);
878  }
879 }
880 
881 // -------------------- setModified --------------------
882 inline void Component::setModified(bool modification) {
883  modifiedFlag = modification;
884 }
885 
886 // -------------------- getModified --------------------
887 inline bool Component::getModified() const {
888  return modifiedFlag;
889 }
890 
891 // -------------------- getModified --------------------
892 inline const QString Component::getLabel() const {
893  return getName();
894 }
895 // -------------------- getModified --------------------
896 inline void Component::setLabel(QString newName) {
897  setLabel(newName);
898 }
899 
900 }
901 
902 #endif
903 
904 
#define delegateAndInvokeChildren4(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3, PARAM_TYPE4)
Definition: sdk/libraries/core/component/Component.h:246
This class describe what are the methods to implement in order to manage dynamic properties.
Definition: InterfaceProperty.h:43
This class describes what are the methods to implement for a BitMap.
Definition: InterfaceBitMap.h:63
#define delegateGet0(HANDLER, METHOD, TYPE)
delegateGet macros: Same as delegate macro but for an accessor non-const METHOD, returns a value of t...
Definition: sdk/libraries/core/component/Component.h:181
virtual InterfaceFrame * getFrame()
get the associated frame
Definition: sdk/libraries/core/component/Component.h:859
InterfaceNode * getParent() override
get the parent Component
Definition: sdk/libraries/core/component/Component.h:854
#define delegate1(HANDLER, METHOD, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:155
QPixmap getIcon() override
Get the pixmap that will be displayed for this node.
Definition: sdk/libraries/core/component/Component.h:864
unsigned int getNumberOfPropertyWidget()
get the number of alternative property widgets
Definition: sdk/libraries/core/component/Component.h:423
#define delegateAndInvokeChildren3(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3)
Definition: sdk/libraries/core/component/Component.h:240
Viewer is an abstract viewer.
Definition: Viewer.h:55
#define delegate3(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3)
Definition: sdk/libraries/core/component/Component.h:165
this Component can be displayed as a SLICE
Definition: sdk/libraries/core/component/Component.h:309
This class describe what are the methods to implement for a hierarchical tree node.
Definition: InterfaceNode.h:58
bool inItalic() const override
A component name is not displayed in italic by default.
Definition: sdk/libraries/core/component/Component.h:869
Definition: Action.cpp:36
this Component can be displayed as a GEOMETRY
Definition: sdk/libraries/core/component/Component.h:308
void pointPicked(vtkIdType, bool)
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:613
unsigned int getNumberOfProp() const
return the number of additional prop
Definition: sdk/libraries/core/component/Component.h:567
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:298
This class describes what are the methods to implement in order to manage a Component position in spa...
Definition: InterfaceFrame.h:64
#define CAMITK_API
Definition: CamiTKAPI.h:49
virtual void setModified(bool modified=true)
set the modified flag
Definition: sdk/libraries/core/component/Component.h:882
bool removeProp(const QString &name)
remove a given additional prop.
Definition: sdk/libraries/core/component/Component.h:598
void setIndexOfPropertyExplorerTab(unsigned int index)
Set the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:462
bool doubleClicked() override
this method is called each time the InterfaceNode is double clicked by the user.
Definition: sdk/libraries/core/component/Component.h:838
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:844
#define delegateAndInvokeChildren1Array(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, DIM)
Definition: sdk/libraries/core/component/Component.h:234
QWidget * getPropertyWidgetAt(unsigned int i)
Get the ith alternative property widget.
Definition: sdk/libraries/core/component/Component.h:431
#define delegate4(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3, PARAM_TYPE4)
Definition: sdk/libraries/core/component/Component.h:170
unsigned int getIndexOfPropertyExplorerTab()
Get the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:473
#define delegate2(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2)
Definition: sdk/libraries/core/component/Component.h:160
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:849
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:89
#define delegateGet1(HANDLER, METHOD, TYPE, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:188
vtkSmartPointer< vtkProp > getProp(unsigned int index)
return an additional prop by its index
Definition: sdk/libraries/core/component/Component.h:577
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:874
Representation
The different representation that can be implemented to represent this Component in the InteractiveVi...
Definition: sdk/libraries/core/component/Component.h:307
virtual bool getModified() const
set the modified flag
Definition: sdk/libraries/core/component/Component.h:887
void setLabel(QString newName) override
set the string used to display the label, do the same as setName
Definition: sdk/libraries/core/component/Component.h:896
This class describes what are the methods to implement for a Geometry (rendering parameters, input/output, filters, picking parameters...)
Definition: InterfaceGeometry.h:61
#define delegate0(HANDLER, METHOD)
delegate macros: completely delegates METHOD to HANDLER, eventually using parameters of given PARAM_T...
Definition: sdk/libraries/core/component/Component.h:150
#define delegateAndInvokeChildren2(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2)
Definition: sdk/libraries/core/component/Component.h:228
#define delegateConstGet1(HANDLER, METHOD, TYPE, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:211
bool addProp(const QString &name, vtkSmartPointer< vtkProp > prop)
insert an additional prop, defining it by its name (default visibility = false)
Definition: sdk/libraries/core/component/Component.h:587
void cellPicked(vtkIdType, bool)
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:618
const QString getLabel() const override
Definition: sdk/libraries/core/component/Component.h:892
QObject * getPropertyObject()
Get the property object that could be understood by PropertyEditor.
Definition: sdk/libraries/core/component/Component.h:443
#define delegateAndInvokeChildren1(HANDLER, METHOD, PARAM_TYPE)
delegateAndInvokeChildren macros: Same as delegate but also calls METHOD, eventually with PARAM_TYPE...
Definition: sdk/libraries/core/component/Component.h:222
QMenu * getPopupMenu(QWidget *parent=nullptr)
get the popup menu to display (always return NULL, overwrite this method if you want to give here you...
Definition: sdk/libraries/core/component/Component.h:527
#define delegateConstGet0(HANDLER, METHOD, TYPE)
delegateConstGet macros: Same as delegateGet but for const METHOD
Definition: sdk/libraries/core/component/Component.h:204
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:291