Computer Assisted Medical Intervention Tool Kit  version 5.2
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-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
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 "InterfacePersistence.h"
36 #include "AbortException.h"
37 
38 // -- QT stuff
39 #include <QPixmap>
40 #include <QMenu>
41 #include <QVector>
42 
43 // -- vtk stuff
44 // disable warning generated by clang about the surrounded headers
45 #include <CamiTKDisableWarnings>
46 #include <vtkWindowLevelLookupTable.h>
47 #include <vtkActor.h>
48 #include <vtkAxesActor.h>
49 #include <vtkImageActor.h>
50 #include <CamiTKReEnableWarnings>
51 
52 #include <vtkImageData.h>
53 #include <vtkPointSet.h>
54 #include <vtkSmartPointer.h>
55 #include <vtkAlgorithmOutput.h>
56 #include <vtkActor2D.h>
57 #include <vtkTransform.h>
58 
59 // -- vtk stuff Classes
60 class vtkActor;
61 class vtkTexture;
62 class vtkPointSet;
63 class vtkUnstructuredGridAlgorithm;
64 class vtkDataSetToUnstructuredGridFilter;
65 class vtkWindowLevelLookupTable;
66 
67 // -----------------------------------------------------------------------
68 //
69 // Delegation macros
70 // (And your dream comes true)
71 //
72 // -----------------------------------------------------------------------
73 
78 #define invoke0(HANDLER,METHOD) \
79 if (HANDLER) \
80  HANDLER->METHOD();
81 
82 #define invoke1(HANDLER,METHOD,PARAM) \
83 if (HANDLER) \
84  HANDLER->METHOD(PARAM);
85 
86 #define invoke2(HANDLER,METHOD,PARAM1,PARAM2) \
87 if (HANDLER) \
88  HANDLER->METHOD(PARAM1,PARAM2);
89 
90 #define invoke3(HANDLER,METHOD,PARAM1,PARAM2,PARAM3) \
91 if (HANDLER) \
92  HANDLER->METHOD(PARAM1,PARAM2,PARAM3);
93 
94 #define invoke4(HANDLER,METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
95 if (HANDLER) \
96  HANDLER->METHOD(PARAM1,PARAM2,PARAM3,PARAM4);
97 
102 #define invokeGet0(HANDLER,METHOD) \
103 if (HANDLER) \
104  return HANDLER->METHOD();
105 
106 #define invokeGet1(HANDLER,METHOD,PARAM) \
107 if (HANDLER) \
108  return HANDLER->METHOD(PARAM);
109 
110 #define invokeGet2(HANDLER,METHOD,PARAM1,PARAM2) \
111 if (HANDLER) \
112  return HANDLER->METHOD(PARAM1,PARAM2);
113 
114 #define invokeGet3(HANDLER,METHOD,PARAM1,PARAM2,PARAM3) \
115 if (HANDLER) \
116  return HANDLER->METHOD(PARAM1,PARAM2,PARAM3);
117 
118 #define invokeGet4(HANDLER,METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
119 if (HANDLER) \
120  return HANDLER->METHOD(PARAM1,PARAM2,PARAM3,PARAM4);
121 
125 #define invokeChildren0(METHOD) \
126 foreach (Component *child, childrenComponent) { \
127  child->METHOD(); \
128  }
129 
130 #define invokeChildren1(METHOD,PARAM) \
131 foreach (Component *child, childrenComponent) { \
132  child->METHOD(PARAM); \
133  }
134 
135 #define invokeChildren2(METHOD,PARAM1,PARAM2) \
136 foreach (Component *child, childrenComponent) { \
137  child->METHOD(PARAM1,PARAM2); \
138  }
139 
140 #define invokeChildren3(METHOD,PARAM1,PARAM2,PARAM3) \
141 foreach (Component *child, childrenComponent) { \
142  child->METHOD(PARAM1,PARAM2,PARAM3); \
143  }
144 
145 #define invokeChildren4(METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
146 foreach (Component *child, childrenComponent) { \
147  child->METHOD(PARAM1,PARAM2,PARAM3,PARAM4); \
148  }
149 
155 #define delegate0(HANDLER,METHOD) \
156 virtual void METHOD() override { \
157  invoke0(HANDLER,METHOD) \
158  }
159 
160 #define delegate1(HANDLER,METHOD,PARAM_TYPE) \
161 virtual void METHOD(PARAM_TYPE param) override { \
162  invoke1(HANDLER,METHOD,param) \
163  }
164 
165 #define delegate2(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2) \
166 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2) override { \
167  invoke2(HANDLER,METHOD,param1,param2) \
168  }
169 
170 #define delegate3(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3) \
171 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3) override { \
172  invoke3(HANDLER,METHOD,param1,param2,param3) \
173  }
174 
175 #define delegate4(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3, PARAM_TYPE4) \
176 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3, PARAM_TYPE4 param4) override { \
177  invoke4(HANDLER,METHOD,param1,param2,param3,param4) \
178  }
179 
186 #define delegateGet0(HANDLER,METHOD,TYPE) \
187 virtual TYPE METHOD() override { \
188  invokeGet0(HANDLER,METHOD) \
189  else \
190  return 0; \
191  }
192 
193 #define delegateGet1(HANDLER,METHOD,TYPE,PARAM_TYPE) \
194 virtual TYPE METHOD(PARAM_TYPE param) override { \
195  invokeGet1(HANDLER,METHOD,param) \
196  else \
197  return 0; \
198  }
199 
200 #define delegateGet2(HANDLER,METHOD,TYPE,PARAM1_TYPE,PARAM2_TYPE) \
201 virtual TYPE METHOD(PARAM1_TYPE param1, PARAM2_TYPE param2) override { \
202  invokeGet2(HANDLER,METHOD,param1,param2) \
203  else \
204  return 0; \
205  }
209 #define delegateConstGet0(HANDLER,METHOD,TYPE) \
210 virtual TYPE METHOD() const override { \
211  invokeGet0(HANDLER,METHOD) \
212  else \
213  return 0; \
214  }
215 
216 #define delegateConstGet1(HANDLER,METHOD,TYPE,PARAM_TYPE) \
217 virtual TYPE METHOD(PARAM_TYPE param) const override { \
218  invokeGet1(HANDLER,METHOD,param) \
219  else \
220  return 0; \
221  }
222 
227 #define delegateAndInvokeChildren1(HANDLER,METHOD,PARAM_TYPE) \
228 virtual void METHOD(PARAM_TYPE param) override { \
229  invoke1(HANDLER,METHOD,param) \
230  invokeChildren1(METHOD,param) \
231  }
232 
233 #define delegateAndInvokeChildren2(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2) \
234 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2) override { \
235  invoke2(HANDLER,METHOD,param1,param2) \
236  invokeChildren2(METHOD,param1,param2) \
237  }
238 
239 #define delegateAndInvokeChildren1Array(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,DIM) \
240 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2[DIM]) override { \
241  invoke2(HANDLER,METHOD,param1,param2) \
242  invokeChildren2(METHOD,param1,param2) \
243  }
244 
245 #define delegateAndInvokeChildren3(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3) \
246 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3) override { \
247  invoke3(HANDLER,METHOD,param1,param2,param3) \
248  invokeChildren3(METHOD,param1,param2,param3) \
249  }
250 
251 #define delegateAndInvokeChildren4(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3,PARAM_TYPE4) \
252 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3,PARAM_TYPE4 param4) override { \
253  invoke4(HANDLER,METHOD,param1,param2,param3,param4) \
254  invokeChildren4(METHOD,param1,param2,param3,param4) \
255  }
256 
257 
258 namespace camitk {
259 // -- Core stuff classes
260 class Geometry;
261 class Slice;
262 class Viewer;
263 class Frame;
264 
265 
304  Q_OBJECT
305 
306 public:
315  NO_REPRESENTATION
316  };
317 
322 
329  Component(QString file, QString name, Representation rep = NO_REPRESENTATION);
330 
340  Component(Component* parentComponent, const QString& name, Representation rep = NO_REPRESENTATION);
341 
349  ~Component() override;
350 
354  Representation getRepresentation() const;
355 
357  bool isTopLevel() const;
358 
360  Component* getParentComponent();
361 
363  Component* getTopLevelComponent();
364 
366  InterfaceFrame* getFrame();
367 
369  virtual void setModified(bool modified = true);
370 
372  virtual bool getModified() const;
373 
375 
383  CAMITK_API_DEPRECATED("Please use setVisibility(QString viewerName, bool) instead") virtual void setVisibility(Viewer*, bool);
384 
386  CAMITK_API_DEPRECATED("Please use getVisibility(QString viewerName, bool) instead") virtual bool getVisibility(Viewer*) const;
388 
390  virtual void setVisibility(QString, bool);
391 
393  virtual bool getVisibility(QString) const;
394 
397  virtual void refresh();
398 
400 
414  CAMITK_API_DEPRECATED("refreshInterfaceNode() is not required anymore. Everything should now be done transparently (if it does not work, use setNodeModified(true) to force a specific InterfaceNode refresh instead)") virtual void refreshInterfaceNode();
416 
418  virtual bool isSelected() const;
419 
424  virtual void setSelected(const bool b, const bool recursive = true);
425 
427  const QString getFileName() const;
428 
430  void setFileName(const QString&);
431 
433  bool event(QEvent* e) override;
434 
436  QMenu* getActionMenu();
438 
439 
446  virtual QVariant toVariant() const override;
447 
449  virtual void fromVariant(const QVariant&) override;
451 
452 
459  QStringList getHierarchy() const override;
460 
462  bool isInstanceOf(QString className) const override;
463 
468  unsigned int getNumberOfPropertyWidget() override {
469  return 0;
470  }
471 
476  QWidget* getPropertyWidgetAt(unsigned int) override {
477  return nullptr;
478  }
479 
488  QObject* getPropertyObject() override {
489  return this;
490  }
491  const QObject* getPropertyObject() const override {
492  return this;
493  }
494 
501  void updateProperty(QString name, QVariant value) override;
502 
510  inline void setIndexOfPropertyExplorerTab(unsigned int index) override final {
511  indexOfPropertyExplorerTab = index;
512  }
513 
521  inline unsigned int getIndexOfPropertyExplorerTab() override {
522  return indexOfPropertyExplorerTab;
523  }
524 
531  Q_INVOKABLE camitk::Property* getProperty(QString name) override;
532 
541  bool addProperty(Property*) override;
543 
549 
552  void removeChild(InterfaceNode*) override;
553 
556  void setParent(InterfaceNode*) override;
557 
561  bool doubleClicked() override;
562 
563  //-- not commented because Doxygen automatically use the inherited documentation (set INHERIT_DOCS flag to YES in the Doxyfile)
564  void addChild(InterfaceNode*) override;
565  void attachChild(InterfaceNode*) override;
566  void deleteChildren() override final;
567  QString getName() const override;
568  void setName(const QString&) override;
569  const ComponentList& getChildren() override;
570  InterfaceNode* getParent() override;
571  QPixmap getIcon() override;
572  void setNodeModified(bool) override final;
573  bool getNodeModified() const override;
574 
578  bool inItalic() const override;
579 
581  QMenu* getPopupMenu(QWidget* parent = nullptr) override {
582  return nullptr;
583  }
585 
592  const QString getLabel() const override;
593 
595  void setLabel(QString newName) override;
596 
597  delegateGet0(myGeometry, getPointSet, vtkSmartPointer<vtkPointSet>)
598 
599  delegate1(myGeometry, setPointSet, vtkSmartPointer<vtkPointSet>)
600 
601  delegate1(myGeometry, setPointData, vtkSmartPointer<vtkDataArray>)
602 
603  delegateConstGet0(myGeometry, getDataPort, vtkSmartPointer<vtkAlgorithmOutput>)
604 
605  delegate1(myGeometry, setDataConnection, vtkSmartPointer<vtkAlgorithmOutput>)
606 
607  delegateGet1(myGeometry, getActor, vtkSmartPointer<vtkActor>, const RenderingModes)
608 
609  delegate1(myGeometry, setColorMode, int)
610 
611  // TODO : uses an object myRepresentation (which is a Geometry or a Slice)
612  // to use a single delegate macro
613  vtkSmartPointer<vtkProp> getProp(const QString& param) override {
614  if (myGeometry) {
615  return myGeometry->getProp(param);
616  }
617  else if (mySlice) {
618  return mySlice->getProp(param);
619  }
620 
621  return nullptr;
622  }
623 
624  unsigned int getNumberOfProp() const override {
625  if (myGeometry) {
626  return myGeometry->getNumberOfProp();
627  }
628  else if (mySlice) {
629  return mySlice->getNumberOfProp();
630  }
631 
632  return 0;
633  }
634 
635  vtkSmartPointer<vtkProp> getProp(unsigned int index) override {
636  if (myGeometry) {
637  return myGeometry->getProp(index);
638  }
639  else if (mySlice) {
640  return mySlice->getProp(index);
641  }
642 
643  return nullptr;
644  }
645 
646  bool addProp(const QString& name, vtkSmartPointer<vtkProp> prop) override {
647  if (myGeometry) {
648  return myGeometry->addProp(name, prop);
649  }
650  else if (mySlice) {
651  return mySlice->addProp(name, prop);
652  }
653 
654  return false;
655  }
656 
657 
658  bool removeProp(const QString& name) override {
659  if (myGeometry) {
660  return myGeometry->removeProp(name);
661  }
662  else if (mySlice) {
663  return mySlice->removeProp(name);
664  }
665 
666  return false;
667  }
668  // END TODO
669 
670 
674  void pointPicked(vtkIdType, bool) override {}
675 
679  void cellPicked(vtkIdType, bool) override {}
680 
682  void getBounds(double* bounds) override;
683 
687  double getBoundingRadius() override;
688 
689  delegate4(myGeometry, setPointPosition, const unsigned int, const double, const double, const double)
690 
691  delegateAndInvokeChildren1(myGeometry, setRenderingModes, const RenderingModes)
692 
694  const InterfaceGeometry::RenderingModes getRenderingModes() const override;
695 
696  delegateAndInvokeChildren1(myGeometry, setEnhancedModes, const EnhancedModes)
697 
698  // cannot use macro here as the return type is a QFlag
699  virtual const EnhancedModes getEnhancedModes() const override {
700  if (myGeometry) {
701  return myGeometry->getEnhancedModes();
702  }
703  else {
704  return EnhancedModes();
705  }
706  }
707 
708  delegateAndInvokeChildren1Array(myGeometry, setActorColor, const RenderingModes, double, 4)
709 
710  delegateAndInvokeChildren4(myGeometry, setActorColor, const RenderingModes, const double, const double, const double)
711 
713  void getActorColor(const RenderingModes, double [4]) const override;
714 
715  delegateAndInvokeChildren3(myGeometry, setColor, const double, const double, const double)
716 
717  delegateAndInvokeChildren4(myGeometry, setColor, const double, const double, const double, const double)
718 
719  delegateAndInvokeChildren2(myGeometry, setActorOpacity, const RenderingModes, const double)
720 
721  delegateConstGet1(myGeometry, getActorOpacity, double, const RenderingModes)
722 
723  delegateAndInvokeChildren1(myGeometry, setOpacity, const double)
724 
725  delegate2(myGeometry, setMapperScalarRange, double, double)
726 
727  delegate1(myGeometry, setTexture, vtkSmartPointer<vtkTexture>)
728 
729  void setGlyphType(const GlyphTypes type, const double size = 0.0) override;
730 
731  virtual void setLinesAsTubes(bool isTubes = true, bool radiusFromLength = true, double radiusFactor = 1.0 / 40.0, int numberOfSides = 5) override {
732  if (myGeometry) {
733  myGeometry->setLinesAsTubes(isTubes, radiusFromLength, radiusFactor, numberOfSides);
734  }
735  }
736 
737  delegate1(myGeometry, setMeshWorldTransform, vtkSmartPointer<vtkTransform>)
738 
739 
740 
741 
746  delegateConstGet0(mySlice, getImageData, vtkSmartPointer<vtkImageData>)
747 
748  delegate1(mySlice, setOriginalVolume, vtkSmartPointer<vtkImageData>)
749 
750  delegateConstGet0(mySlice, get2DImageActor, vtkSmartPointer<vtkImageActor>)
751 
752  delegateConstGet0(mySlice, get3DImageActor, vtkSmartPointer<vtkImageActor>)
753 
754  delegateConstGet0(mySlice, getPickPlaneActor, vtkSmartPointer<vtkActor>)
755 
756  delegateGet0(mySlice, getPixelActor, vtkSmartPointer<vtkActor>)
757 
758  delegate3(mySlice, pixelPicked, double, double, double)
759 
760  delegate0(mySlice, updatePickPlane)
761 
762  delegate1(mySlice, setSlice, int)
763 
764  delegate3(mySlice, setSlice, double, double, double)
765 
766  delegateConstGet0(mySlice, getNumberOfColors, int)
767 
768  delegate3(mySlice, setPixelRealPosition, double, double, double)
769 
770  delegate1(mySlice, setImageWorldTransform, vtkSmartPointer<vtkTransform>)
771 
772  delegate1(mySlice, setArbitraryTransform, vtkSmartPointer<vtkTransform>)
773 
775  int getNumberOfSlices() const override;
776 
778  int getSlice() const override;
780 
781 
787  const QString& getFrameName() const override;
788 
789  delegate1(myFrame, setFrameName, QString)
790 
791  InterfaceFrame* getParentFrame() const override;
792 
793  void setParentFrame(InterfaceFrame* frame, bool keepTransform = true) override;
794 
795  const QVector<InterfaceFrame*>& getChildrenFrame() const override;
796 
797  const vtkSmartPointer<vtkTransform> getTransformFromWorld() const override;
798 
799  const vtkSmartPointer<vtkTransform> getTransform() const override;
800 
801  const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame* frame) const override;
802 
803  delegate1(myFrame, setTransform, vtkSmartPointer<vtkTransform>)
804 
805  delegate0(myFrame, resetTransform)
806 
807  delegate3(myFrame, translate, double, double, double)
808 
809  delegate3(myFrame, rotate, double, double, double)
810 
811  delegate3(myFrame, rotateVTK, double, double, double)
812 
813  delegate3(myFrame, setTransformTranslation, double, double, double)
814 
815  delegate3(myFrame, setTransformTranslationVTK, double, double, double)
816 
817  delegate3(myFrame, setTransformRotation, double, double, double)
818 
819  delegate3(myFrame, setTransformRotationVTK, double, double, double)
820 
821  vtkSmartPointer<vtkAxesActor> getFrameAxisActor() override;
822 
824 
831  /*CAMITK_API_DEPRECATED("Please use Component::setFrameVisibility(QString viewerName, bool) instead") */virtual void setFrameVisibility(Viewer*, bool) override;
832 
833  /*CAMITK_API_DEPRECATED("Please use Component::getFrameVisibility(QString viewerName, bool) instead") */virtual bool getFrameVisibility(Viewer*) const override;
835 
836  delegate2(myFrame, setFrameVisibility, QString, bool)
837 
838  bool getFrameVisibility(QString) const override;
839 
840  delegate1(myFrame, addFrameChild, InterfaceFrame*)
841 
842  delegate1(myFrame, removeFrameChild, InterfaceFrame*)
844 
845 
846 protected:
848  InterfaceGeometry* myGeometry;
849 
851  InterfaceBitMap* mySlice;
852 
854  InterfaceNode* myParentNode;
855 
857  InterfaceFrame* myFrame;
858 
860  ComponentList childrenComponent;
861 
863  bool isSelectedFlag;
864 
866  bool modifiedFlag;
867 
869  QString myFileName;
870 
872  unsigned int indexOfPropertyExplorerTab;
873 
874 
875 private:
879 
881  void init();
882 
884  Representation myService;
885 
887  QString myName;
888 
893  virtual void initRepresentation() = 0;
894 
896  QMap<QString, bool> myViewers;
897 
899  QMenu* actionsMenu;
900 
902  QMenu* visibilityMenu;
903 
905  QMap<QString, Property*> propertyMap;
906 
908  bool interfaceNodeModifiedFlag;
909 
911 
912 };
913 
914 
915 // -------------------- isSelected --------------------
916 inline bool Component::isSelected() const {
917  return isSelectedFlag;
918 }
919 
920 // -------------------- doubleClicked --------------------
922  return false;
923 }
924 
925 // -------------------- getChildren --------------------
927  return childrenComponent;
928 }
929 
930 // -------------------- getName --------------------
931 inline QString Component::getName() const {
932  return myName;
933 }
934 
935 // -------------------- getParent --------------------
937  return ((Component*) myParentNode);
938 }
939 
940 // -------------------- getFrame --------------------
942  return myFrame;
943 }
944 
945 // -------------------- getPixmap ------------------
946 inline QPixmap Component::getIcon() {
947  return QPixmap(0, 0); // this is a NULL QPixmap in the Qt sense. QPixmap::isNull will then return true;
948 }
949 
950 // -------------------- inItalic --------------------
951 inline bool Component::inItalic() const {
952  return false;
953 }
954 
955 // -------------------- setName --------------------
956 inline void Component::setName(const QString& n) {
957  myName = n;
958 
959  if (myGeometry) {
960  myGeometry->setLabel(n);
961  }
962 
963  setNodeModified(true);
964 }
965 
966 // -------------------- setModified --------------------
967 inline void Component::setModified(bool modification) {
968  modifiedFlag = modification;
969 }
970 
971 // -------------------- getModified --------------------
972 inline bool Component::getModified() const {
973  return modifiedFlag;
974 }
975 
976 // -------------------- getModified --------------------
977 inline const QString Component::getLabel() const {
978  return getName();
979 }
980 
981 // -------------------- getModified --------------------
982 inline void Component::setLabel(QString newName) {
983  setName(newName);
984 }
985 
986 // -------------------- setNodeModified --------------------
987 inline void Component::setNodeModified(bool nodeModified) {
988  interfaceNodeModifiedFlag = nodeModified;
989 }
990 
991 // -------------------- getNodeModified --------------------
992 inline bool Component::getNodeModified() const {
993  return interfaceNodeModifiedFlag;
994 }
995 
996 }
997 
998 #endif
999 
1000 
#define CAMITK_API_DEPRECATED(X)
Definition: CamiTKAPI.h:94
#define CAMITK_API
Definition: CamiTKAPI.h:49
if(${CMAKE_VERSION} VERSION_GREATER "3.3" OR ${CMAKE_VERSION} VERSION_EQUAL "3.3") option(CAMITK_INCLUDE_WHAT_YOU_USE "Enable the header analysis on you code
#define a
Interface for all objects that should be serialized by the PersistenceManager.
Definition: InterfacePersistence.h:36
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:303
void setIndexOfPropertyExplorerTab(unsigned int index) override final
Set the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:510
delegateGet0(myGeometry, getPointSet, vtkSmartPointer< vtkPointSet >) delegate1(myGeometry
Representation
The different representation that can be implemented to represent this Component in the InteractiveVi...
Definition: sdk/libraries/core/component/Component.h:312
@ GEOMETRY
this Component can be displayed as a GEOMETRY
Definition: sdk/libraries/core/component/Component.h:313
@ SLICE
this Component can be displayed as a SLICE
Definition: sdk/libraries/core/component/Component.h:314
unsigned int getNumberOfProp() const override
return the number of additional prop
Definition: sdk/libraries/core/component/Component.h:624
unsigned int getIndexOfPropertyExplorerTab() override
Get the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:521
InterfaceNode * getParent() override
get the parent Component
Definition: sdk/libraries/core/component/Component.h:936
const QObject * getPropertyObject() const override
Definition: sdk/libraries/core/component/Component.h:491
delegate4(myGeometry, setPointPosition, const unsigned int, const double, const double, const double) delegateAndInvokeChildren1(myGeometry
InterfaceFrame * getFrame()
get the associated frame
Definition: sdk/libraries/core/component/Component.h:941
vtkSmartPointer< vtkProp > getProp(unsigned int index) override
return an additional prop by its index
Definition: sdk/libraries/core/component/Component.h:635
bool removeProp(const QString &name) override
remove a given additional prop.
Definition: sdk/libraries/core/component/Component.h:658
bool inItalic() const override
A component name is not displayed in italic by default.
Definition: sdk/libraries/core/component/Component.h:951
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:956
virtual void setModified(bool modified=true)
set the modified flag
Definition: sdk/libraries/core/component/Component.h:967
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:931
void pointPicked(vtkIdType, bool) override
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:674
bool addProp(const QString &name, vtkSmartPointer< vtkProp > prop) override
insert an additional prop, defining it by its name (default visibility = false)
Definition: sdk/libraries/core/component/Component.h:646
void setNodeModified(bool) override final
Set up the node modification flag.
Definition: sdk/libraries/core/component/Component.h:987
QPixmap getIcon() override
Get the pixmap that will be displayed for this node.
Definition: sdk/libraries/core/component/Component.h:946
void cellPicked(vtkIdType, bool) override
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:679
QObject * getPropertyObject() override
Get the property object that could be understood by PropertyEditor.
Definition: sdk/libraries/core/component/Component.h:488
virtual bool getModified() const
set the modified flag
Definition: sdk/libraries/core/component/Component.h:972
delegateAndInvokeChildren1Array(myGeometry, setActorColor, const RenderingModes, double, 4) delegateAndInvokeChildren4(myGeometry
const QString getLabel() const override
Definition: sdk/libraries/core/component/Component.h:977
bool getNodeModified() const override
Get the current modification flag.
Definition: sdk/libraries/core/component/Component.h:992
bool doubleClicked() override
This method is called each time the InterfaceNode is double clicked by the user.
Definition: sdk/libraries/core/component/Component.h:921
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:982
QWidget * getPropertyWidgetAt(unsigned int) override
Get the ith alternative property widget.
Definition: sdk/libraries/core/component/Component.h:476
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:926
This class describes what are the methods to implement for a BitMap.
Definition: InterfaceBitMap.h:68
This class describes what are the methods to implement in order to manage a Component position in spa...
Definition: InterfaceFrame.h:64
This class describes what are the methods to implement for a Geometry (rendering parameters,...
Definition: InterfaceGeometry.h:61
This class describe what are the methods to implement for a hierarchical tree node.
Definition: InterfaceNode.h:58
This class describe what are the methods to implement in order to manage dynamic properties.
Definition: InterfaceProperty.h:43
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:280
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:181
Definition: Action.cpp:36
vtkScalarBarRepresentation * rep
Definition: RendererWidget.cpp:554
void refresh()
refresh the display
#define delegate3(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3)
Definition: sdk/libraries/core/component/Component.h:170
#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:155
#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:227
#define delegateConstGet1(HANDLER, METHOD, TYPE, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:216
#define delegateAndInvokeChildren2(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2)
Definition: sdk/libraries/core/component/Component.h:233
#define delegate2(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2)
Definition: sdk/libraries/core/component/Component.h:165
#define delegate1(HANDLER, METHOD, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:160
#define delegateAndInvokeChildren4(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3, PARAM_TYPE4)
Definition: sdk/libraries/core/component/Component.h:251
#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:186
#define delegateAndInvokeChildren3(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3)
Definition: sdk/libraries/core/component/Component.h:245
#define delegateGet1(HANDLER, METHOD, TYPE, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:193
#define delegateConstGet0(HANDLER, METHOD, TYPE)
delegateConstGet macros: Same as delegateGet but for const METHOD
Definition: sdk/libraries/core/component/Component.h:209