Computer Assited Medical Intervention Tool Kit  version 5.0
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-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, 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 "AbortException.h"
36 
37 // -- QT stuff
38 #include <QPixmap>
39 #include <QMenu>
40 #include <QVector>
41 
42 // -- vtk stuff
43 // disable warning generated by clang about the surrounded headers
44 #include <CamiTKDisableWarnings>
45 #include <vtkWindowLevelLookupTable.h>
46 #include <vtkActor.h>
47 #include <vtkAxesActor.h>
48 #include <vtkImageActor.h>
49 #include <CamiTKReEnableWarnings>
50 
51 #include <vtkImageData.h>
52 #include <vtkPointSet.h>
53 #include <vtkSmartPointer.h>
54 #include <vtkAlgorithmOutput.h>
55 #include <vtkActor2D.h>
56 #include <vtkTransform.h>
57 
58 // -- vtk stuff Classes
59 class vtkActor;
60 class vtkTexture;
61 class vtkPointSet;
62 class vtkUnstructuredGridAlgorithm;
63 class vtkDataSetToUnstructuredGridFilter;
64 class vtkWindowLevelLookupTable;
65 
66 // -----------------------------------------------------------------------
67 //
68 // Delegation macros
69 // (And your dream comes true)
70 //
71 // -----------------------------------------------------------------------
72 
77 #define invoke0(HANDLER,METHOD) \
78 if (HANDLER) \
79  HANDLER->METHOD();
80 
81 #define invoke1(HANDLER,METHOD,PARAM) \
82 if (HANDLER) \
83  HANDLER->METHOD(PARAM);
84 
85 #define invoke2(HANDLER,METHOD,PARAM1,PARAM2) \
86 if (HANDLER) \
87  HANDLER->METHOD(PARAM1,PARAM2);
88 
89 #define invoke3(HANDLER,METHOD,PARAM1,PARAM2,PARAM3) \
90 if (HANDLER) \
91  HANDLER->METHOD(PARAM1,PARAM2,PARAM3);
92 
93 #define invoke4(HANDLER,METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
94 if (HANDLER) \
95  HANDLER->METHOD(PARAM1,PARAM2,PARAM3,PARAM4);
96 
101 #define invokeGet0(HANDLER,METHOD) \
102 if (HANDLER) \
103  return HANDLER->METHOD();
104 
105 #define invokeGet1(HANDLER,METHOD,PARAM) \
106 if (HANDLER) \
107  return HANDLER->METHOD(PARAM);
108 
109 #define invokeGet2(HANDLER,METHOD,PARAM1,PARAM2) \
110 if (HANDLER) \
111  return HANDLER->METHOD(PARAM1,PARAM2);
112 
113 #define invokeGet3(HANDLER,METHOD,PARAM1,PARAM2,PARAM3) \
114 if (HANDLER) \
115  return HANDLER->METHOD(PARAM1,PARAM2,PARAM3);
116 
117 #define invokeGet4(HANDLER,METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
118 if (HANDLER) \
119  return HANDLER->METHOD(PARAM1,PARAM2,PARAM3,PARAM4);
120 
124 #define invokeChildren0(METHOD) \
125 foreach (Component *child, childrenComponent) { \
126  child->METHOD(); \
127  }
128 
129 #define invokeChildren1(METHOD,PARAM) \
130 foreach (Component *child, childrenComponent) { \
131  child->METHOD(PARAM); \
132  }
133 
134 #define invokeChildren2(METHOD,PARAM1,PARAM2) \
135 foreach (Component *child, childrenComponent) { \
136  child->METHOD(PARAM1,PARAM2); \
137  }
138 
139 #define invokeChildren3(METHOD,PARAM1,PARAM2,PARAM3) \
140 foreach (Component *child, childrenComponent) { \
141  child->METHOD(PARAM1,PARAM2,PARAM3); \
142  }
143 
144 #define invokeChildren4(METHOD,PARAM1,PARAM2,PARAM3,PARAM4) \
145 foreach (Component *child, childrenComponent) { \
146  child->METHOD(PARAM1,PARAM2,PARAM3,PARAM4); \
147  }
148 
154 #define delegate0(HANDLER,METHOD) \
155 virtual void METHOD() override { \
156  invoke0(HANDLER,METHOD) \
157  }
158 
159 #define delegate1(HANDLER,METHOD,PARAM_TYPE) \
160 virtual void METHOD(PARAM_TYPE param) override { \
161  invoke1(HANDLER,METHOD,param) \
162  }
163 
164 #define delegate2(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2) \
165 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2) override { \
166  invoke2(HANDLER,METHOD,param1,param2) \
167  }
168 
169 #define delegate3(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3) \
170 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3) override { \
171  invoke3(HANDLER,METHOD,param1,param2,param3) \
172  }
173 
174 #define delegate4(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3, PARAM_TYPE4) \
175 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3, PARAM_TYPE4 param4) override { \
176  invoke4(HANDLER,METHOD,param1,param2,param3,param4) \
177  }
178 
185 #define delegateGet0(HANDLER,METHOD,TYPE) \
186 virtual TYPE METHOD() override { \
187  invokeGet0(HANDLER,METHOD) \
188  else \
189  return 0; \
190  }
191 
192 #define delegateGet1(HANDLER,METHOD,TYPE,PARAM_TYPE) \
193 virtual TYPE METHOD(PARAM_TYPE param) override { \
194  invokeGet1(HANDLER,METHOD,param) \
195  else \
196  return 0; \
197  }
198 
199 #define delegateGet2(HANDLER,METHOD,TYPE,PARAM1_TYPE,PARAM2_TYPE) \
200 virtual TYPE METHOD(PARAM1_TYPE param1, PARAM2_TYPE param2) override { \
201  invokeGet2(HANDLER,METHOD,param1,param2) \
202  else \
203  return 0; \
204  }
205 
208 #define delegateConstGet0(HANDLER,METHOD,TYPE) \
209 virtual TYPE METHOD() const override { \
210  invokeGet0(HANDLER,METHOD) \
211  else \
212  return 0; \
213  }
214 
215 #define delegateConstGet1(HANDLER,METHOD,TYPE,PARAM_TYPE) \
216 virtual TYPE METHOD(PARAM_TYPE param) const override { \
217  invokeGet1(HANDLER,METHOD,param) \
218  else \
219  return 0; \
220  }
221 
226 #define delegateAndInvokeChildren1(HANDLER,METHOD,PARAM_TYPE) \
227 virtual void METHOD(PARAM_TYPE param) override { \
228  invoke1(HANDLER,METHOD,param) \
229  invokeChildren1(METHOD,param) \
230  }
231 
232 #define delegateAndInvokeChildren2(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2) \
233 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2) override { \
234  invoke2(HANDLER,METHOD,param1,param2) \
235  invokeChildren2(METHOD,param1,param2) \
236  }
237 
238 #define delegateAndInvokeChildren1Array(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,DIM) \
239 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2[DIM]) override { \
240  invoke2(HANDLER,METHOD,param1,param2) \
241  invokeChildren2(METHOD,param1,param2) \
242  }
243 
244 #define delegateAndInvokeChildren3(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3) \
245 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3) override { \
246  invoke3(HANDLER,METHOD,param1,param2,param3) \
247  invokeChildren3(METHOD,param1,param2,param3) \
248  }
249 
250 #define delegateAndInvokeChildren4(HANDLER,METHOD,PARAM_TYPE1,PARAM_TYPE2,PARAM_TYPE3,PARAM_TYPE4) \
251 virtual void METHOD(PARAM_TYPE1 param1, PARAM_TYPE2 param2, PARAM_TYPE3 param3,PARAM_TYPE4 param4) override { \
252  invoke4(HANDLER,METHOD,param1,param2,param3,param4) \
253  invokeChildren4(METHOD,param1,param2,param3,param4) \
254  }
255 
256 
257 namespace camitk {
258 // -- Core stuff classes
259 class Geometry;
260 class Slice;
261 class Viewer;
262 class Frame;
263 
264 
303  Q_OBJECT
304 
305 public:
314  NO_REPRESENTATION
315  };
316 
320 
328  Component(QString file, QString name, Representation rep = NO_REPRESENTATION);
329 
339  Component(Component* parentComponent, const QString& name, Representation rep = NO_REPRESENTATION);
340 
348  ~Component() override;
349 
353  Representation getRepresentation() const;
354 
356  bool isTopLevel() const;
357 
359  Component* getParentComponent();
360 
362  Component* getTopLevelComponent();
363 
365  InterfaceFrame* getFrame();
366 
368  virtual void setModified(bool modified = true);
369 
371  virtual bool getModified() const;
372 
374 
381  CAMITK_API_DEPRECATED("Please use setVisibility(QString viewerName, bool) instead") virtual void setVisibility(Viewer*, bool);
383 
385  CAMITK_API_DEPRECATED("Please use getVisibility(QString viewerName, bool) instead") virtual bool getVisibility(Viewer*) const;
387 
389  virtual void setVisibility(QString, bool);
390 
392  virtual bool getVisibility(QString) const;
393 
396  virtual void refresh();
397 
399 
413  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();
415 
417  virtual bool isSelected() const;
418 
423  virtual void setSelected(const bool b, const bool recursive = true);
424 
426  const QString getFileName() const;
427 
429  void setFileName(const QString&);
430 
432  bool event(QEvent* e) override;
433 
435  QMenu* getActionMenu();
437 
442  QStringList getHierarchy() const override;
445 
447  bool isInstanceOf(QString className) const override;
448 
453  unsigned int getNumberOfPropertyWidget() override {
454  return 0;
455  }
456 
461  QWidget* getPropertyWidgetAt(unsigned int) override {
462  return nullptr;
463  }
464 
473  QObject* getPropertyObject() override {
474  return this;
475  }
476 
483  void updateProperty(QString name, QVariant value) override;
484 
492  inline void setIndexOfPropertyExplorerTab(unsigned int index) override final {
493  indexOfPropertyExplorerTab = index;
494  }
495 
503  inline unsigned int getIndexOfPropertyExplorerTab() override {
504  return indexOfPropertyExplorerTab;
505  }
506 
513  Q_INVOKABLE camitk::Property* getProperty(QString name) override;
514 
523  bool addProperty(Property*) override;
525 
530 
534  void removeChild(InterfaceNode*) override;
535 
538  void setParent(InterfaceNode*) override;
539 
543  bool doubleClicked() override;
544 
545  //-- not commented because Doxygen automatically use the inherited documentation (set INHERIT_DOCS flag to YES in the Doxyfile)
546  void addChild(InterfaceNode*) override;
547  void attachChild(InterfaceNode*) override;
548  void deleteChildren() override final;
549  QString getName() const override;
550  void setName(const QString&) override;
551  const ComponentList& getChildren() override;
552  InterfaceNode* getParent() override;
553  QPixmap getIcon() override;
554  void setNodeModified(bool) override final;
555  bool getNodeModified() const override;
556 
560  bool inItalic() const override;
561 
563  QMenu* getPopupMenu(QWidget* parent = nullptr) override {
564  return nullptr;
565  }
567 
572  const QString getLabel() const override;
575 
577  void setLabel(QString newName) override;
578 
579  delegateGet0(myGeometry, getPointSet, vtkSmartPointer<vtkPointSet>)
580 
581  delegate1(myGeometry, setPointSet, vtkSmartPointer<vtkPointSet>)
582 
583  delegate1(myGeometry, setPointData, vtkSmartPointer<vtkDataArray>)
584 
585  delegateConstGet0(myGeometry, getDataPort, vtkSmartPointer<vtkAlgorithmOutput>)
586 
587  delegate1(myGeometry, setDataConnection, vtkSmartPointer<vtkAlgorithmOutput>)
588 
589  delegateGet1(myGeometry, getActor, vtkSmartPointer<vtkActor>, const RenderingModes)
590 
591  // TODO : uses an object myRepresentation (which is a Geometry or a Slice)
592  // to use a single delegate macro
593  vtkSmartPointer<vtkProp> getProp(const QString& param) override {
594  if (myGeometry) {
595  return myGeometry->getProp(param);
596  }
597  else if (mySlice) {
598  return mySlice->getProp(param);
599  }
600 
601  return nullptr;
602  }
603 
604  unsigned int getNumberOfProp() const override {
605  if (myGeometry) {
606  return myGeometry->getNumberOfProp();
607  }
608  else if (mySlice) {
609  return mySlice->getNumberOfProp();
610  }
611 
612  return 0;
613  }
614 
615  vtkSmartPointer<vtkProp> getProp(unsigned int index) override {
616  if (myGeometry) {
617  return myGeometry->getProp(index);
618  }
619  else if (mySlice) {
620  return mySlice->getProp(index);
621  }
622 
623  return nullptr;
624  }
625 
626  bool addProp(const QString& name, vtkSmartPointer<vtkProp> prop) override {
627  if (myGeometry) {
628  return myGeometry->addProp(name, prop);
629  }
630  else if (mySlice) {
631  return mySlice->addProp(name, prop);
632  }
633 
634  return false;
635  }
636 
637 
638  bool removeProp(const QString& name) override {
639  if (myGeometry) {
640  return myGeometry->removeProp(name);
641  }
642  else if (mySlice) {
643  return mySlice->removeProp(name);
644  }
645 
646  return false;
647  }
648  // END TODO
649 
650 
654  void pointPicked(vtkIdType, bool) override {}
655 
659  void cellPicked(vtkIdType, bool) override {}
660 
662  void getBounds(double* bounds) override;
663 
667  double getBoundingRadius() override;
668 
669  delegate4(myGeometry, setPointPosition, const unsigned int, const double, const double, const double)
670 
671  delegateAndInvokeChildren1(myGeometry, setRenderingModes, const RenderingModes)
672 
674  const InterfaceGeometry::RenderingModes getRenderingModes() const override;
675 
676  delegateAndInvokeChildren1(myGeometry, setEnhancedModes, const EnhancedModes)
677 
678  // cannot use macro here as the return type is a QFlag
679  virtual const EnhancedModes getEnhancedModes() const override {
680  if (myGeometry) {
681  return myGeometry->getEnhancedModes();
682  }
683  else {
684  return EnhancedModes();
685  }
686  }
687 
688  delegateAndInvokeChildren1Array(myGeometry, setActorColor, const RenderingModes, double, 4)
689 
690  delegateAndInvokeChildren4(myGeometry, setActorColor, const RenderingModes, const double, const double, const double)
691 
693  void getActorColor(const RenderingModes, double [4]) override;
694 
695  delegateAndInvokeChildren3(myGeometry, setColor, const double, const double, const double)
696 
697  delegateAndInvokeChildren4(myGeometry, setColor, const double, const double, const double, const double)
698 
699  delegateAndInvokeChildren2(myGeometry, setActorOpacity, const RenderingModes, const double)
700 
701  delegateConstGet1(myGeometry, getActorOpacity, double, const RenderingModes)
702 
703  delegateAndInvokeChildren1(myGeometry, setOpacity, const double)
704 
705  delegate2(myGeometry, setMapperScalarRange, double, double)
706 
707  delegate1(myGeometry, setTexture, vtkSmartPointer<vtkTexture>)
708 
709  void setGlyphType(const GlyphTypes type, const double size = 0.0) override;
710 
711  delegate1(myGeometry, setLinesAsTubes, bool)
712 
713  delegate1(myGeometry, setMeshWorldTransform, vtkSmartPointer<vtkTransform>)
714 
716 
721  delegateConstGet0(mySlice, getImageData, vtkSmartPointer<vtkImageData>)
723 
724  delegate1(mySlice, setOriginalVolume, vtkSmartPointer<vtkImageData>)
725 
726  delegateConstGet0(mySlice, get2DImageActor, vtkSmartPointer<vtkImageActor>)
727 
728  delegateConstGet0(mySlice, get3DImageActor, vtkSmartPointer<vtkImageActor>)
729 
730  delegateConstGet0(mySlice, getPickPlaneActor, vtkSmartPointer<vtkActor>)
731 
732  delegateGet0(mySlice, getPixelActor, vtkSmartPointer<vtkActor>)
733 
734  delegate3(mySlice, pixelPicked, double, double, double)
735 
736  delegate0(mySlice, updatePickPlane)
737 
738  delegate1(mySlice, setSlice, int)
739 
740  delegate3(mySlice, setSlice, double, double, double)
741 
742  delegateConstGet0(mySlice, getNumberOfColors, int)
743 
744  delegate3(mySlice, setPixelRealPosition, double, double, double)
745 
746  delegate1(mySlice, setImageWorldTransform, vtkSmartPointer<vtkTransform>)
747 
748  delegate1(mySlice, setArbitraryTransform, vtkSmartPointer<vtkTransform>)
749 
751  int getNumberOfSlices() const override;
752 
754  int getSlice() const override;
756 
757 
762  const QString& getFrameName() const override;
764 
765  delegate1(myFrame, setFrameName, QString)
766 
767  InterfaceFrame* getParentFrame() const override;
768 
769  void setParentFrame(InterfaceFrame* frame, bool keepTransform = true) override;
770 
771  const QVector<InterfaceFrame*>& getChildrenFrame() const override;
772 
773  const vtkSmartPointer<vtkTransform> getTransformFromWorld() const override;
774 
775  const vtkSmartPointer<vtkTransform> getTransform() const override;
776 
777  const vtkSmartPointer<vtkTransform> getTransformFromFrame(InterfaceFrame* frame) const override;
778 
779  delegate1(myFrame, setTransform, vtkSmartPointer<vtkTransform>)
780 
781  delegate0(myFrame, resetTransform)
782 
783  delegate3(myFrame, translate, double, double, double)
784 
785  delegate3(myFrame, rotate, double, double, double)
786 
787  delegate3(myFrame, rotateVTK, double, double, double)
788 
789  delegate3(myFrame, setTransformTranslation, double, double, double)
790 
791  delegate3(myFrame, setTransformTranslationVTK, double, double, double)
792 
793  delegate3(myFrame, setTransformRotation, double, double, double)
794 
795  delegate3(myFrame, setTransformRotationVTK, double, double, double)
796 
797  vtkSmartPointer<vtkAxesActor> getFrameAxisActor() override;
798 
800 
807  /*CAMITK_API_DEPRECATED("Please use Component::setFrameVisibility(QString viewerName, bool) instead") */virtual void setFrameVisibility(Viewer*, bool) override;
808 
809  /*CAMITK_API_DEPRECATED("Please use Component::getFrameVisibility(QString viewerName, bool) instead") */virtual bool getFrameVisibility(Viewer*) const override;
811 
812  delegate2(myFrame, setFrameVisibility, QString, bool)
813 
814  bool getFrameVisibility(QString) const override;
815 
816  delegate1(myFrame, addFrameChild, InterfaceFrame*)
817 
818  delegate1(myFrame, removeFrameChild, InterfaceFrame*)
820 
821 
822 protected:
824  InterfaceGeometry* myGeometry;
825 
827  InterfaceBitMap* mySlice;
828 
830  InterfaceNode* myParentNode;
831 
833  InterfaceFrame* myFrame;
834 
836  ComponentList childrenComponent;
837 
839  bool isSelectedFlag;
840 
842  bool modifiedFlag;
843 
845  QString myFileName;
846 
848  unsigned int indexOfPropertyExplorerTab;
849 
850 
851 private:
854 
857  void init();
858 
860  Representation myService;
861 
863  QString myName;
864 
869  virtual void initRepresentation() = 0;
870 
872  QMap<QString, bool> myViewers;
873 
875  QMenu* actionsMenu;
876 
878  QMenu* visibilityMenu;
879 
881  QMap<QString, Property*> propertyMap;
882 
884  bool interfaceNodeModifiedFlag;
885 
887 
888 };
889 
890 
891 // -------------------- isSelected --------------------
892 inline bool Component::isSelected() const {
893  return isSelectedFlag;
894 }
895 
896 // -------------------- doubleClicked --------------------
898  return false;
899 }
900 
901 // -------------------- getChildren --------------------
903  return childrenComponent;
904 }
905 
906 // -------------------- getName --------------------
907 inline QString Component::getName() const {
908  return myName;
909 }
910 
911 // -------------------- getParent --------------------
913  return ((Component*) myParentNode);
914 }
915 
916 // -------------------- getFrame --------------------
918  return myFrame;
919 }
920 
921 // -------------------- getPixmap ------------------
922 inline QPixmap Component::getIcon() {
923  return QPixmap(0, 0); // this is a NULL QPixmap in the Qt sense. QPixmap::isNull will then return true;
924 }
925 
926 // -------------------- inItalic --------------------
927 inline bool Component::inItalic() const {
928  return false;
929 }
930 
931 // -------------------- setName --------------------
932 inline void Component::setName(const QString& n) {
933  myName = n;
934 
935  if (myGeometry) {
936  myGeometry->setLabel(n);
937  }
938 
939  setNodeModified(true);
940 }
941 
942 // -------------------- setModified --------------------
943 inline void Component::setModified(bool modification) {
944  modifiedFlag = modification;
945 }
946 
947 // -------------------- getModified --------------------
948 inline bool Component::getModified() const {
949  return modifiedFlag;
950 }
951 
952 // -------------------- getModified --------------------
953 inline const QString Component::getLabel() const {
954  return getName();
955 }
956 
957 // -------------------- getModified --------------------
958 inline void Component::setLabel(QString newName) {
959  setName(newName);
960 }
961 
962 // -------------------- setNodeModified --------------------
963 inline void Component::setNodeModified(bool nodeModified) {
964  interfaceNodeModifiedFlag = nodeModified;
965 }
966 
967 // -------------------- getNodeModified --------------------
968 inline bool Component::getNodeModified() const {
969  return interfaceNodeModifiedFlag;
970 }
971 
972 }
973 
974 #endif
975 
976 
Component.h
camitk::Component::inItalic
bool inItalic() const override
A component name is not displayed in italic by default.
Definition: sdk/libraries/core/component/Component.h:927
CAMITK_WARNING
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
delegateGet1
#define delegateGet1(HANDLER, METHOD, TYPE, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:192
delegate2
#define delegate2(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2)
Definition: sdk/libraries/core/component/Component.h:164
camitk::Component::addProp
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:626
if
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
Component::removeFromParents
void removeFromParents()
this tell the parent components that this component is removed from memory.
Definition: modeling/libraries/pml/Component.cpp:48
AbortException.h
camitk::Component::setLabel
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:958
InterfaceBitMap.h
delegateAndInvokeChildren1Array
#define delegateAndInvokeChildren1Array(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, DIM)
Definition: sdk/libraries/core/component/Component.h:238
Component::parentMultiComponentList
std::vector< MultiComponent * > parentMultiComponentList
list of Component that are using this component (if another component is using this component,...
Definition: modeling/libraries/pml/Component.h:136
camitk::Component::setIndexOfPropertyExplorerTab
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:492
Component::properties
Properties * properties
Definition: modeling/libraries/pml/Component.h:118
a
#define a
CAMITK_INFO
#define CAMITK_INFO(MSG)
Log for info verbosity (the second most verbose one) The msg will appear only if the user asked for I...
Definition: Log.h:261
Component::isInstanceOf
virtual bool isInstanceOf(const char *) const =0
pure virtual method, implemented in the child-class
camitk::Component::setModified
virtual void setModified(bool modified=true)
set the modified flag
Definition: sdk/libraries/core/component/Component.h:943
Component::deleteProperties
void deleteProperties()
delete the "properties" pointer and set it to NULL
Definition: modeling/libraries/pml/Component.cpp:42
Action.h
camitk::Component::getRenderingModes
const const RenderingModes InterfaceGeometry::RenderingModes getRenderingModes() const override
see Component.cpp
Definition: sdk/libraries/core/component/Component.cpp:622
delegateAndInvokeChildren1
#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:226
delegateAndInvokeChildren2
#define delegateAndInvokeChildren2(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2)
Definition: sdk/libraries/core/component/Component.h:232
camitk::ActionList
QList< Action * > ActionList
A list of Action.
Definition: CamiTKAPI.h:136
delegateConstGet1
#define delegateConstGet1(HANDLER, METHOD, TYPE, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:215
camitk::actionLessThan
bool actionLessThan(const camitk::Action *a1, const camitk::Action *a2)
Definition: Application.cpp:778
camitk::Component::getIndexOfPropertyExplorerTab
unsigned int getIndexOfPropertyExplorerTab() override
Get the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:503
camitk::Property
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
delegateAndInvokeChildren4
#define delegateAndInvokeChildren4(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3, PARAM_TYPE4)
Definition: sdk/libraries/core/component/Component.h:250
InterfaceNode.h
Log.h
camitk::Component::getNodeModified
bool getNodeModified() const override
Get the current modification flag.
Definition: sdk/libraries/core/component/Component.h:968
Component.h
PhysicalModel
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
camitk::Action
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
camitk::Action::getQAction
virtual QAction * getQAction(Component *target=nullptr)
Get the corresponding QAction.
Definition: Action.cpp:204
Property.h
camitk::Component::setParent
void setParent(InterfaceNode *) override
set the parent Component.
Definition: sdk/libraries/core/component/Component.cpp:587
InterfaceGeometry.h
delegate0
#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:154
camitk::Application
The generic/default application. Once this class is intanciated in the main, everything is setup....
Definition: Application.h:82
Component::getName
const std::string getName() const
get the name of the component
Definition: modeling/libraries/pml/Component.h:147
delegateConstGet0
#define delegateConstGet0(HANDLER, METHOD, TYPE)
delegateConstGet macros: Same as delegateGet but for const METHOD
Definition: sdk/libraries/core/component/Component.h:208
camitk::InterfaceGeometry
This class describes what are the methods to implement for a Geometry (rendering parameters,...
Definition: InterfaceGeometry.h:61
delegateGet0
#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:185
camitk::Component::getNumberOfProp
unsigned int getNumberOfProp() const override
return the number of additional prop
Definition: sdk/libraries/core/component/Component.h:604
CAMITK_ERROR
#define CAMITK_ERROR(MSG)
Log for error verbosity (the minimum verbosity) Will always appear.
Definition: Log.h:276
InterfaceFrame.h
delegate1
#define delegate1(HANDLER, METHOD, PARAM_TYPE)
Definition: sdk/libraries/core/component/Component.h:159
delegateAndInvokeChildren3
#define delegateAndInvokeChildren3(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3)
Definition: sdk/libraries/core/component/Component.h:244
Component::exclusive
bool exclusive
Definition: modeling/libraries/pml/Component.h:131
camitk::Component::getName
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:907
invoke1
#define invoke1(HANDLER, METHOD, PARAM)
Definition: sdk/libraries/core/component/Component.h:81
camitk::Component::removeProp
bool removeProp(const QString &name) override
remove a given additional prop.
Definition: sdk/libraries/core/component/Component.h:638
Frame.h
camitk::InterfaceFrame
This class describes what are the methods to implement in order to manage a Component position in spa...
Definition: InterfaceFrame.h:64
camitk::Component::doubleClicked
bool doubleClicked() override
This method is called each time the InterfaceNode is double clicked by the user.
Definition: sdk/libraries/core/component/Component.h:897
camitk::Component::Representation
Representation
Definition: sdk/libraries/core/component/Component.h:311
camitk::ComponentList
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:127
camitk::Component::setNodeModified
void setNodeModified(bool) override final
Set up the node modification flag.
Definition: sdk/libraries/core/component/Component.h:963
camitk::Component::getBounds
void getBounds(double *bounds) override
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax], see Component....
Definition: sdk/libraries/core/component/Component.cpp:671
camitk::Component::Component
Component(QString file, QString name, Representation rep=NO_REPRESENTATION)
Component constructor for top-level component (please use the other constructor for sub-level compone...
Definition: sdk/libraries/core/component/Component.cpp:65
camitk::Component::getChildren
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:902
Component
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
CAMITK_TRACE
#define CAMITK_TRACE(MSG)
Log for trace verbosity (the most verbose one, should be used for bug report) The msg will appear onl...
Definition: Log.h:256
camitk::Viewer
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
camitk::ViewerList
QList< Viewer * > ViewerList
A list of Viewer.
Definition: CamiTKAPI.h:139
camitk::Component::GEOMETRY
@ GEOMETRY
this Component can be displayed as a GEOMETRY
Definition: sdk/libraries/core/component/Component.h:312
camitk::InterfaceBitMap
This class describes what are the methods to implement for a BitMap. An InterfaceBitMap is a kind of ...
Definition: InterfaceBitMap.h:68
delegate3
#define delegate3(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3)
Definition: sdk/libraries/core/component/Component.h:169
camitk::Component::cellPicked
void cellPicked(vtkIdType, bool) override
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:659
Viewer.h
camitk::Component::getProp
vtkSmartPointer< vtkProp > getProp(unsigned int index) override
return an additional prop by its index
Definition: sdk/libraries/core/component/Component.h:615
MultiComponent.h
camitk::Component::pointPicked
void pointPicked(vtkIdType, bool) override
an inherited class can redefine this method something specific.
Definition: sdk/libraries/core/component/Component.h:654
camitk::rep
vtkScalarBarRepresentation * rep
Definition: RendererWidget.cpp:510
camitk::Component::SLICE
@ SLICE
this Component can be displayed as a SLICE
Definition: sdk/libraries/core/component/Component.h:313
Properties
Describes the properties common to all structures and components.
Definition: Properties.h:59
camitk::Component::setName
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:932
camitk::Component::getParent
InterfaceNode * getParent() override
get the parent Component
Definition: sdk/libraries/core/component/Component.h:912
camitk::refresh
void refresh()
refresh the display
Component::Component
Component(PhysicalModel *, std::string n="")
Default constructor, a component needs to know the PM it is in.
Definition: modeling/libraries/pml/Component.cpp:30
camitk::InterfaceProperty
This class describe what are the methods to implement in order to manage dynamic properties....
Definition: InterfaceProperty.h:66
Component::~Component
virtual ~Component()
Virtual destructor needed here as this is an abstract class (pure virtual)
Definition: modeling/libraries/pml/Component.cpp:36
camitk::InterfaceNode::setParent
virtual void setParent(InterfaceNode *)=0
set the parent Component
camitk::Component::getIcon
QPixmap getIcon() override
Get the pixmap that will be displayed for this node.
Definition: sdk/libraries/core/component/Component.h:922
camitk::Component::getPropertyWidgetAt
QWidget * getPropertyWidgetAt(unsigned int) override
Get the ith alternative property widget.
Definition: sdk/libraries/core/component/Component.h:461
camitk::InterfaceNode
This class describe what are the methods to implement for a hierarchical tree node.
Definition: InterfaceNode.h:58
CAMITK_API_DEPRECATED
#define CAMITK_API_DEPRECATED(X)
Definition: CamiTKAPI.h:94
InterfaceProperty.h
camitk::Component
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:302
camitk::Component::getModified
virtual bool getModified() const
set the modified flag
Definition: sdk/libraries/core/component/Component.h:948
camitk::Component::getLabel
const QString getLabel() const override
Definition: sdk/libraries/core/component/Component.h:953
delegate4
#define delegate4(HANDLER, METHOD, PARAM_TYPE1, PARAM_TYPE2, PARAM_TYPE3, PARAM_TYPE4)
Definition: sdk/libraries/core/component/Component.h:174
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:49
camitk
Definition: Action.cpp:35
camitk::Component::getFrame
InterfaceFrame * getFrame()
get the associated frame
Definition: sdk/libraries/core/component/Component.h:917
camitk::Component::getPropertyObject
QObject * getPropertyObject() override
Get the property object that could be understood by PropertyEditor.
Definition: sdk/libraries/core/component/Component.h:473