]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h
ROI interaction added
[cpPlugins.git] / lib / cpPlugins / Extensions / Visualization / MPRWithDifferentWindows.h
index 6ac17e80112b9c8cda8bdb04512b4a207aaacde0..b0f8c40de6a8d7b18aa1aa6e6c8eaceb3409c435 100644 (file)
@@ -9,6 +9,27 @@
 #include <vtkRenderWindow.h>
 #include <vtkSmartPointer.h>
 
+// -------------------------------------------------------------------------
+#define cpPlugins_MPRWithDifferentWindows_ObserverMacro( e )    \
+inline void Add##e##Observer( vtkCommand* observer )            \
+{                                                               \
+  for( int i = 0; i < 3; ++i )                                  \
+    if( this->m_Styles[ i ].GetPointer( ) != NULL )             \
+      this->m_Styles[ i ]->Add##e##Observer( observer );        \
+}                                                               \
+inline void Remove##e##Observer( vtkCommand* observer )         \
+{                                                               \
+  for( int i = 0; i < 3; ++i )                                  \
+    if( this->m_Styles[ i ].GetPointer( ) != NULL )             \
+      this->m_Styles[ i ]->Remove##e##Observer( observer );     \
+}                                                               \
+inline void Remove##e##Observers( )                             \
+{                                                               \
+  for( int i = 0; i < 3; ++i )                                  \
+    if( this->m_Styles[ i ].GetPointer( ) != NULL )             \
+      this->m_Styles[ i ]->Remove##e##Observers( );             \
+}
+
 namespace cpPlugins
 {
   namespace Extensions
@@ -25,6 +46,11 @@ namespace cpPlugins
         typedef cpPlugins::Extensions::Visualization::
         ImageInteractorStyle TStyle;
 
+      public:
+        cpPlugins_MPRWithDifferentWindows_ObserverMacro( DoubleClick );
+        cpPlugins_MPRWithDifferentWindows_ObserverMacro( Cursor );
+        cpPlugins_MPRWithDifferentWindows_ObserverMacro( Radius );
+
       public:
         MPRWithDifferentWindows(
           vtkRenderWindow* xWin = NULL,
@@ -34,9 +60,6 @@ namespace cpPlugins
           );
         virtual ~MPRWithDifferentWindows( );
 
-        void AddDoubleClickObserver( vtkCommand* observer );
-        void RemoveDoubleClickObserver( vtkCommand* observer );
-        void RemoveDoubleClickObservers( );
 
         void SetImage( vtkImageData* image );
         void SetSegmentation( vtkImageData* image );