]> Creatis software - creaMaracasVisu.git/commitdiff
#2482 creaMaracasVisu Bug New - HighColorLayer refresh missing. The MPR is not...
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Mon, 17 Nov 2014 07:59:33 +0000 (08:59 +0100)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Mon, 17 Nov 2014 07:59:33 +0000 (08:59 +0100)
28 files changed:
bbtk/bbs/appli/exampleColorLayer.bbg
bbtk/bbs/appli/exampleColorLayer.bbs
bbtk/src/bbmaracasvisuDrawAxe3D.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourPerpPlaneControler.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h

index 6ee86ba053bfc87c3667b0c32c917831027e9afd..79c934c16eb4db804e6a609b264a73eab93ea83d 100644 (file)
@@ -1,31 +1,6 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and 
-#  abiding by the rules of distribution of free software. You can  use, 
-#  modify and/ or redistribute the software under the terms of the CeCILL-B 
-#  license as circulated by CEA, CNRS and INRIA at the following URL 
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability. 
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */ 
-
 # ----------------------------------
-# - BBTKGEditor v 1.3 BBG BlackBox Diagram file
-# - /home/mouton/Creatis/all/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbg
 # ----------------------------------
 
 APP_START
@@ -33,6 +8,7 @@ CATEGORY:<VOID>
 DESCRIPTION:Description ??
 AUTHOR:Author ??
 COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
 BOXES:4
 BOX
 creaMaracasVisu:ColorLayerImageView:Box00
@@ -49,16 +25,14 @@ FIN_BOX
 BOX
 vtk:LoadHola:Box01
 ISEXEC:FALSE
--23.247801:74.823885:-900.000000
-22.327199:64.823885:-900.000000
+56.503805:75.675326:-900.000000
+102.078805:65.675326:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:ViewerNV:Box02
 ISEXEC:FALSE
--66.477630:32.155340:-900.000000
--20.902630:22.155340:-900.000000
-PORT
-nTypeView:"0"
+-9.147294:53.441356:-900.000000
+51.492706:43.441356:-900.000000
 FIN_BOX
 BOX
 wx:LayoutSplit:Box03
@@ -68,20 +42,26 @@ ISEXEC:TRUE
 PORT
 Orientation:"H"
 FIN_BOX
-CONNECTIONS:5
+CONNECTIONS:7
 CONNECTION
-Box02:Widget:Box03:Widget1
+Box01:Out:Box00:In
 NumberOfControlPoints:0
 CONNECTION
-Box00:Widget:Box03:Widget2
+Box01:Out:Box02:In
 NumberOfControlPoints:0
 CONNECTION
-Box01:Out:Box00:In
+Box02:wxVtkBaseView2:Box00:WxVtkBaseView
 NumberOfControlPoints:0
 CONNECTION
-Box02:wxVtkBaseView1:Box00:WxVtkBaseView
+Box02:wxVtkBaseView3:Box00:WxVtkBaseView1
 NumberOfControlPoints:0
 CONNECTION
-Box01:Out:Box02:In
+Box02:wxVtkBaseView4:Box00:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box03:Widget2
 NumberOfControlPoints:0
 APP_END
index 7b2fad17d8cee662fefa81e4dc09cbea966663a4..113b44d565fef6ff95471c7790065b84abbe6dd3 100644 (file)
@@ -1,31 +1,6 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and 
-#  abiding by the rules of distribution of free software. You can  use, 
-#  modify and/ or redistribute the software under the terms of the CeCILL-B 
-#  license as circulated by CEA, CNRS and INRIA at the following URL 
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability. 
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */ 
-
 # ----------------------------------
-# - BBTKGEditor v 1.3 BBS BlackBox Script
-# - /home/mouton/Creatis/all/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbs
 # ----------------------------------
 
 # BBTK GEditor Script
@@ -49,16 +24,27 @@ new ColorLayerImageView Box00
 new LoadHola Box01
 
 new ViewerNV Box02
-  set Box02.nTypeView "0"
 
 new LayoutSplit Box03
   set Box03.Orientation "H"
 
 
-connect Box02.Widget Box03.Widget1
-connect Box00.Widget Box03.Widget2
 connect Box01.Out Box00.In
-connect Box02.wxVtkBaseView1 Box00.WxVtkBaseView
+
 connect Box01.Out Box02.In
 
+connect Box02.wxVtkBaseView2 Box00.WxVtkBaseView
+
+connect Box02.wxVtkBaseView3 Box00.WxVtkBaseView1
+
+connect Box02.wxVtkBaseView4 Box00.WxVtkBaseView2
+
+connect Box00.Widget Box03.Widget1
+
+connect Box02.Widget Box03.Widget2
+
+
+
+# Complex input ports
+message    
 exec Box03
index 62972a252b26351b40ac7847a4b754947adc6cb5..da174e61361f8a1805b69f21befcd26d70c9186e 100644 (file)
@@ -56,9 +56,9 @@ class /*BBTK_EXPORT*/ DrawAxe3D
   void Process();
 
   private:
-    bool               firsttime;
-    vtkPolyData                *mallData;
-    vtkActor           *mvtkactor;
+    bool                                               firsttime;
+    vtkPolyData                        *mallData;
+    vtkActor                           *mvtkactor;
     vtkPolyDataMapper  *polydatamapper;
 };
 
index 25d0b62e4f349084a4a7a746ef0916c69f97ab62..3b89d1a2f93be5deafdb135839076344a136e19d 100644 (file)
 
 #include "LayerImageBase.h"
 
+#include "wxMPRBaseData.h"
 #include "wxVtk2DBaseView.h"
 #include "wxVTKRenderWindowInteractor.h"
 
 
+
+
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+
+// Callback for the interaction
+class ColorLayerObserver : public vtkCommand{
+  public:
+       virtual char const *GetClassName() const { return "ColorLayerObserver";}
+
+       static ColorLayerObserver *New()        {      return new ColorLayerObserver;   }
+
+       ColorLayerObserver() 
+       {
+               _layerimagebase = NULL;
+       }
+
+       virtual void Execute(vtkObject *wdg, unsigned long event, void* calldata)       
+       { 
+               if (_layerimagebase!= NULL)
+               {
+
+                       wxVtkBaseView           *wxvtkbaseview = _layerimagebase->GetwxVtkBaseView();
+                       if (wxvtkbaseview!=NULL)
+                       {
+
+                               vtkMPRBaseData  *vtkmprbasedata =       (vtkMPRBaseData*)wxvtkbaseview->GetVtkBaseData();
+                               if (vtkmprbasedata!=NULL)
+                               {
+                                       _layerimagebase->SetX( vtkmprbasedata->GetX() );
+                                       _layerimagebase->SetY( vtkmprbasedata->GetY() );
+                                       _layerimagebase->SetZ( vtkmprbasedata->GetZ() );
+                       _layerimagebase->onThresholdChange();
+                               } // if basedata
+                               
+                       } // if wxvtkbaseview
+               } //if layerimagebase
+       }
+
+       void SetLayerImageBase(LayerImageBase* layerimagebase)
+       {
+       _layerimagebase =       layerimagebase;
+       }
+
+private:
+       LayerImageBase* _layerimagebase;
+};
+
+
 //---------------------------------------------------------------------------------------------
 //---------------------------------------------------------------------------------------------
 //---------------------------------------------------------------------------------------------
 
 ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase)
 {
-    _state=false;
-    _stateKey=false;
-    _layerImageBase=layerImageBase;
+    _state                             =       false;
+    _stateKey                  =       false;
+    _layerImageBase    =       layerImageBase;
        
 }
 
@@ -72,13 +123,12 @@ bool ColorLayerImageBasevtkInteractor::OnMouseMove()   // vitual
 //     if ( this->_vtkInteractorStyleBaseView->GetParent_refresh_waiting() == true )
 
        if ( interactor->GetControlKey()==1 )  // EED This if for ManaulPaint Interaction compatibility
-        {
+       {
                printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove need Refresh \n" );
                _layerImageBase->onThreshold();
-                       _layerImageBase->GetvtkImageReslice()->Modified();
-       } 
-        else {
-       printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove NOT need Refresh \n" );
+               _layerImageBase->GetvtkImageReslice()->Modified();
+       } else {
+               printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove NOT need Refresh \n" );
        }       
 
        
@@ -120,9 +170,10 @@ bool  ColorLayerImageBasevtkInteractor::OnRightButtonDown() // virtual
 {
        printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonDown \n");
        _state=true;
-       return true;
+   return true;
 }
 
+
 //---------------------------------------------------------------------------------------------
 bool  ColorLayerImageBasevtkInteractor::OnRightButtonUp()  // virtual
 {
@@ -141,23 +192,22 @@ bool  ColorLayerImageBasevtkInteractor::OnRightButtonUp()  // virtual
 LayerImageBase::LayerImageBase()
 {
        _actorPresent                   =       false;
-       _X                              =       0;
-       _Y                              =       0;
-       _Z                              =       0;
-       _thresholdTable                 =       NULL;
+       _X                                                      =       0;
+       _Y                                                      =       0;
+       _Z                                                      =       0;
+       _thresholdTable         =       NULL;
        _thresholdMapper                =       NULL;
-       _scalarbarActor = NULL;
-       _thresholdActor                 =       NULL;
-       _image                          =       NULL;
-       _baseView                       =       NULL;
+       _scalarbarActor         =       NULL;
+       _thresholdActor         =       NULL;
+       _image                                  =       NULL;
+       _baseView                               =       NULL;
        _imageReslicer                  =       vtkImageReslice::New();
-
 }
 
 //----------------------------------------------------------------------------
-  LayerImageBase::~LayerImageBase()
-  {
-  }
+LayerImageBase::~LayerImageBase()
+{
+}
 
 //----------------------------------------------------------------------------
 void LayerImageBase::SetX(int x)
@@ -219,10 +269,16 @@ void LayerImageBase::SetImage(vtkImageData* image)
 void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview)
 {
        if (_baseView==NULL)
-       {
-         _baseView = baseview;
-         vtkInteractorStyleBaseView *isbv    = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
-         isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
+   {
+               _baseView = baseview;
+// Old EED 2014 11 13
+//     vtkInteractorStyleBaseView *isbv    = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
+//     isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
+
+               ColorLayerObserver *colorlayerobserver = ColorLayerObserver::New();
+               _baseView->GetVtkBaseData()->AddObserver( 1, colorlayerobserver );
+               colorlayerobserver->SetLayerImageBase(this);
+
        } // if _baseView
 }
 
@@ -452,6 +508,7 @@ vtkLookupTable *LayerImageBase::GetvtkLookupTable()
     return _thresholdTable;
 }
 
+//----------------------------------------------------------------------------
 vtkImageReslice *LayerImageBase::GetvtkImageReslice()
 {
     return _imageReslicer;
index 1e4828790b92bc7a7d16663b7d5996c149b6fe99..e9e92aadb22910a09ff647fc4237c66128c71489 100644 (file)
@@ -51,7 +51,8 @@
 //----------------------------------------------------------------------------------
 class LayerImageBase;
 
-class ColorLayerImageBasevtkInteractor : public InteractorStyleMaracas {
+class ColorLayerImageBasevtkInteractor : public InteractorStyleMaracas 
+{
 public:
        ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase);
        virtual ~ColorLayerImageBasevtkInteractor();
@@ -78,7 +79,7 @@ protected:
 
 
 class LayerImageBase
 {
+ {
   public:
                LayerImageBase();
                virtual ~LayerImageBase();
@@ -103,18 +104,18 @@ class LayerImageBase
                bool GetActorPresent();
 
   private:
-               int                     _X;
-               int                     _Y;
-               int                     _Z;
-               bool                    _actorPresent;
-               vtkImageData            *_image;
+               int                                             _X;
+               int                                             _Y;
+               int                                             _Z;
+               bool                                            _actorPresent;
+               vtkImageData                    *_image;
                vtkImageReslice         *_imageReslicer;
-               vtkLookupTable          *_thresholdTable;
+               vtkLookupTable                  *_thresholdTable;
                vtkImageMapToColors     *_thresholdMapper;
-               vtkImageActor           *_thresholdActor;
-               wxVtkBaseView           *_baseView;
+               vtkImageActor                   *_thresholdActor;
+               wxVtkBaseView                   *_baseView;
 
-               vtkScalarBarActor       *_scalarbarActor;
+               vtkScalarBarActor               *_scalarbarActor;
 
                virtual void ConfigLookupTable() = 0;           
                void CleanXYZ(double &x, double &y, double &z);
index 71876f9829905d637ad0aca18586b645c585817c..c46b74c84393d96a8367896ee23b39638a8b9db4 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef manualContour3DControler_h
 #define manualContour3DControler_h
 
+#include "wxMPRBaseData.h"
 #include "manualContourControler.h"
 #include "manualView3DContour.h"
 
index a8c88f21d08b1b3dd2283e13b2551d8fbfeb4cab..178ee30fa68c349f0a1f122eff479586129491f0 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef manualContour3VControler_h
 #define manualContour3VControler_h
 
+#include "wxMPRBaseData.h"
 #include "manualContourControler.h"
 
 // ----------------------------------------------------------------------------
index 2796f8011fb123a8054df66c2c93628a49fffbf3..876b31fc515b2218be26dae31694eddd76a2ec83 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef manualContourPerpPlaneControler_h
 #define manualContourPerpPlaneControler_h
 
+
+#include "wxMPRBaseData.h"
 #include "manualContourControler.h"
 #include "manualContour3VControler.h"
 
index 3f972ec5f8f544ed1e817d237c807e903d86db88..7d3fd17f255d130cf69b2934c1d7fb550cd0b360 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef manualView3DContour_h
 #define manualView3DContour_h
 
+#include "wxMPRBaseData.h"
 #include "manualViewContour.h"
 
 // ----------------------------------------------------------------------------
index f8df99a5922db2b4fd84c5dd37bbd18334d8a7f2..e34a19e94bde117e3ddf2e0676ef98eba66f79e8 100644 (file)
 
 #include "vtkBaseData.h"
 
+
+
+//-------------------------------------------------------------------
 vtkBaseData::vtkBaseData()
 {
-
-       _z            = 0;
-       _t            = 0;
-       _marImageData = 0;
+       _z              = 0;
+       _t              = 0;
+       _marImageData   = 0;
+       _observable     = vtkObject::New();
 }
 
 //-------------------------------------------------------------------
@@ -39,6 +42,8 @@ vtkBaseData::~vtkBaseData()
 {
 }
 
+
+
 //-------------------------------------------------------------------
 void vtkBaseData::SetMarImageData(marImageData *marimagedata)
 {
@@ -90,7 +95,9 @@ void vtkBaseData::Configure()  // virtual
 }
 
 //-------------------------------------------------------------------
-void vtkBaseData::SetZ(double z){
+void vtkBaseData::SetZ(double z)
+{
+
        //int maxZ;
 
 //     int dim[3];
@@ -128,6 +135,7 @@ void vtkBaseData::SetZ(double z){
                }
 
                _z=z;
+               _observable->InvokeEvent(3);    
        }
 }
 
@@ -182,3 +190,12 @@ double vtkBaseData::GetColorLevel()
        return _colorLevel;
 }
 
+
+//-------------------------------------------------------------------
+void vtkBaseData::AddObserver(int eventNumber, vtkCommand *observer)
+{
+       _observable->AddObserver( eventNumber , observer );
+       //Configure();
+}
+
+
index df0a4e68bb83f0d00a790f4c5e9fae4a812f90ee..7d72298b28a2a923ac07ae275d05d95c0884b6c9 100644 (file)
 #define VTKBASEDATA_H_
 
 #include "marTypes.h"
-
-#include "marImageData.h"
+#include "vtkCommand.h"
 #include "vtkImageData.h"
+#include "marImageData.h"
+
 
 class creaMaracasVisu_EXPORT vtkBaseData {
 public:
        vtkBaseData();
-       virtual ~vtkBaseData();
+       virtual                         ~vtkBaseData();
        vtkImageData*   GetImageData();
        marImageData*   GetMarImageData();
-                       void    SetMarImageData(marImageData *marimagedata);
+       void                            SetMarImageData(marImageData *marimagedata);
        virtual void    Configure();
        double                  GetZ();
-       void                    SetZ(double z);
+       void                            SetZ(double z);
 
        int                             GetT();
-       void                    SetT(double t);
+       void                            SetT(double t);
        
-       void SetColorWindow(double colorWindow);
-       void SetColorLevel(double colorLevel);  
-       double GetColorWindow();
-       double GetColorLevel(); 
+       void                            SetColorWindow(double colorWindow);
+       void                            SetColorLevel(double colorLevel);       
+       double                  GetColorWindow();
+       double                  GetColorLevel();        
+       void                            AddObserver(int eventNumber, vtkCommand *observer);
        
 protected:
        marImageData    *_marImageData;
@@ -57,6 +59,10 @@ protected:
        
        double                  _colorWindow;
        double                  _colorLevel;
+
+       vtkObject*              _observable;
+
+private:
 };
 
 #endif /*VTKBASEDATA_H_*/
index 236aa3c57361c2a63cf1d5dfd0466c8ee2f9ee24..33a3e74cefb8c6ecc881c5b45e555cf40b736c1c 100644 (file)
@@ -59,7 +59,7 @@ public:
 //     vtkImageActor*                  GetImageActor(int id);
        vtkActor*                               GetOutlineActor();
        vtkClipPolyData*                GetTissueClipper(int id);
-       vtkPolyDataMapper*              GetTissueMapper(int id);
+       vtkPolyDataMapper*      GetTissueMapper(int id);
        vtkPlanes*                              GetTissuePlanes(int id);
        vtkStripper*                    GetTissueStripper(int id);
 //     vtkGlyph3D*                             GetGlyph(int id);
@@ -68,45 +68,45 @@ public:
        vtkMarchingCubes                *GetMCubes(int idTissue);
 
        virtual void                    Refresh();
-                       void                    RefreshSurface();
+       void                                            RefreshSurface();
 
        virtual void                    Configure();
-       void                                    Configure_Tissue();
-       void                                    Configure_Volume();
-
-       void                                    SetIsovalue(int idTissue, int isoValue);
+       void                                            Configure_Tissue();
+       void                                            Configure_Volume();
+       
+       void                                            SetIsovalue(int idTissue, int isoValue);
        double                                  GetIsovalue(int idTissue);
 
        vtkVolume                               *GetVolumeActor();
        vtkVolumeRayCastMapper  *GetVolumeMapper();
        vtkPlanes                               *GetVolumePlanes();
 
-       void                                    SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
-       vtkMPRBaseData*                 GetVtkMPRBaseData();
+       void                                            SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
+       vtkMPRBaseData*         GetVtkMPRBaseData();
 
-       vtkActor                                *GetTissueActor(int id);
-       void                                    SetVisibleTissue(int idTissue, bool visible);
-       bool                                    GetVisibleTissue(int idTissue);
-       bool                                    GetVisibleVolume();
-       void                                    SetVisibleVolume(bool visibleVolume);
+       vtkActor                                        *GetTissueActor(int id);
+       void                                            SetVisibleTissue(int idTissue, bool visible);
+       bool                                            GetVisibleTissue(int idTissue);
+       bool                                            GetVisibleVolume();
+       void                                            SetVisibleVolume(bool visibleVolume);
 
-    bool                                       GetVisibleVolumeBox();
-       void                                    SetVisibleVolumeBox(bool visibleBox);
+   bool                                                GetVisibleVolumeBox();
+       void                                            SetVisibleVolumeBox(bool visibleBox);
 
-       void                                    SetRepresentationType(int idTissue, bool representationType);
-       bool                                    GetRepresentationType(int idTissue);
+       void                                            SetRepresentationType(int idTissue, bool representationType);
+       bool                                            GetRepresentationType(int idTissue);
 
-       boxSurfaceObserver              *GetObserverS(int idObserverS);
-       boxSurfaceObserver              *GetObserverV();
+       boxSurfaceObserver      *GetObserverS(int idObserverS);
+       boxSurfaceObserver      *GetObserverV();
 
        //void                                  ReadVolumeFunctions(char *namefile);
-       void                                    ReadVolumeFunctions();
-       void                                    ReadMeshVTK(char *namefile);
+       void                                            ReadVolumeFunctions();
+       void                                            ReadMeshVTK(char *namefile);
 
 
-    void                    Configure_VolumeBox();
-    void                    SetInteractor(vtkRenderWindowInteractor* interactor);
-    void                    SetRenderer(vtkRenderer* renderer);
+    void                                               Configure_VolumeBox();
+    void                                               SetInteractor(vtkRenderWindowInteractor* interactor);
+    void                                               SetRenderer(vtkRenderer* renderer);
 
        //-------------------
        //Getters Vectors
@@ -125,67 +125,61 @@ public:
        //Getters transference function
        //and color of the transference function
        //---------------------------------------
-       vtkPiecewiseFunction                            *GetTransferencefunction();
-       vtkColorTransferFunction                        *GetColorTransferenceFunction();
-
-    void                        SetRayCasting(bool active);
-       void                        SetMIPActive(bool active);
-    void                        SetInterpolation(bool active);
-    void                        SetShade(bool active);
-    void                        updateVolume();
+       vtkPiecewiseFunction                    *GetTransferencefunction();
+       vtkColorTransferFunction        *GetColorTransferenceFunction();
 
-
-    void                        BoxActorChanged(bool changed);
-    void                        UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
+       void                      SetRayCasting(bool active);
+       void                      SetMIPActive(bool active);
+   void                      SetInterpolation(bool active);
+   void                      SetShade(bool active);
+   void                      updateVolume();
+   void                      BoxActorChanged(bool changed);
+   void                      UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
 
 
 
 private:
 
-       vtkMarchingCubes                                        *_mCubes[ VTKMPRDATA_MAXTISSUE ];
-       vtkStripper                                                     *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
-       vtkPolyDataMapper                                       *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
-       vtkPlanes                                                       *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
-       vtkClipPolyData                                         *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
+       vtkMarchingCubes                                *_mCubes[ VTKMPRDATA_MAXTISSUE ];
+       vtkStripper                                             *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
+       vtkPolyDataMapper                               *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
+       vtkPlanes                                               *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
+       vtkClipPolyData                         *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
 
        // outline
-       vtkOutlineFilter                                        *_outlineData;
-       vtkPolyDataMapper                                       *_mapOutline;
+       vtkOutlineFilter                                *_outlineData;
+       vtkPolyDataMapper                               *_mapOutline;
        vtkActor                                                        *_outline;
 
        /// Volume
-       vtkPiecewiseFunction                            *_tfun;
-       vtkColorTransferFunction                        *_ctfun;
+       vtkPiecewiseFunction                    *_tfun;
+       vtkColorTransferFunction        *_ctfun;
 //     vtkVolumeRayCastCompositeFunction       *_compositeFunction;
-       vtkPlanes                                                       *_volumePlanes;
-       vtkVolumeRayCastMapper                          *_volumeMapper;
-       vtkVolumeProperty                                       *_volumeProperty;
-       vtkVolume                                                       *_newvol;
-
-       vtkMPRBaseData                                          *_vtkmprbasedata;
-
+       vtkPlanes                                               *_volumePlanes;
+       vtkVolumeRayCastMapper          *_volumeMapper;
+       vtkVolumeProperty                               *_volumeProperty;
+       vtkVolume                                               *_newvol;
+       vtkMPRBaseData                                  *_vtkmprbasedata;
        bool                                                            _visibleVolume;
-
-    bool                                                               _visibleVolumeBox;
-
+   bool                                                                _visibleVolumeBox;
        bool                                                            _representationType[VTKMPRDATA_MAXTISSUE];
        bool                                                            _visibleTissue[VTKMPRDATA_MAXTISSUE];
        vtkActor                                                        *_tissue[VTKMPRDATA_MAXTISSUE];
-       boxSurfaceObserver                                      *_observerV;
-       boxSurfaceObserver                                      *_observerS[VTKMPRDATA_MAXTISSUE];
+       boxSurfaceObserver                      *_observerV;
+       boxSurfaceObserver                      *_observerS[VTKMPRDATA_MAXTISSUE];
 
-       std::vector<double>                                     greyValuesTransferenceFVector;
-       std::vector<double>                                     intensityValuesTransferenceFVector;
-       std::vector<double>                                     redColorsOfColorTransferenceFVector;
-       std::vector<double>                                     greenColorsOfColorTransferenceFVector;
-       std::vector<double>                                     blueColorsOfColorTransferenceFVector;
-       std::vector<double>                                     greyValueColorsOfColorTransferenceFVector;
+       std::vector<double>                     greyValuesTransferenceFVector;
+       std::vector<double>                     intensityValuesTransferenceFVector;
+       std::vector<double>                     redColorsOfColorTransferenceFVector;
+       std::vector<double>                     greenColorsOfColorTransferenceFVector;
+       std::vector<double>                     blueColorsOfColorTransferenceFVector;
+       std::vector<double>                     greyValueColorsOfColorTransferenceFVector;
 
        vtkVolumeRayCastCompositeFunction   *_compositeFunction;
        vtkVolumeRayCastMIPFunction         *_compositeFunctionMIP ;
 
        bool _isRayCasting;
-    bool _isMIP;
+   bool _isMIP;
        bool _interpolation;
        bool _shade;
 
index 70b16f0715cf2ed69c9c7f01bb488c8556ba1f49..ce96cc400586deb9a0cfa51ca60a8cea8d4d83b0 100644 (file)
@@ -71,29 +71,29 @@ public:
 
 private:
        
-       bool                                                            _visiblePosition[3];
+       bool                                                                    _visiblePosition[3];
 
        // outline
        vtkOutlineFilter                                        *_outlineData;
        vtkPolyDataMapper                                       *_mapOutline;
-       vtkActor                                                        *_outline;
+       vtkActor                                                                *_outline;
 
        //
-       vtkColorTransferFunction                        *_ctfun;
-       std::vector<double>                                     _ctFunVectorPoint;
-       std::vector<double>                                     _ctFunVectorRed;
-       std::vector<double>                                     _ctFunVectorGreen;
-       std::vector<double>                                     _ctFunVectorBlue;
+       vtkColorTransferFunction                *_ctfun;
+       std::vector<double>                             _ctFunVectorPoint;
+       std::vector<double>                             _ctFunVectorRed;
+       std::vector<double>                             _ctFunVectorGreen;
+       std::vector<double>                             _ctFunVectorBlue;
 
 //     vtkLookupTable                                          *_bwLut;
 //     vtkLookupTable                                          *_hueLut;
 //     vtkLookupTable                                          *_satLut;
 
-       vtkImageMapToColors                                     *_saggitalColors;
+       vtkImageMapToColors                             *_saggitalColors;
        vtkImageActor                                           *_saggital;
-       vtkImageMapToColors                                     *_axialColors;
+       vtkImageMapToColors                             *_axialColors;
        vtkImageActor                                           *_axial;
-       vtkImageMapToColors                                     *_coronalColors;
+       vtkImageMapToColors                             *_coronalColors;
        vtkImageActor                                           *_coronal;
        vtkMPRBaseData                                          *_vtkmprbasedata;
 
index 7a4efed64e68bd249489f43dc21bf4be718f35c5..522b6a0277e1d9378cda2512bf5de721ee2bebcf 100644 (file)
@@ -30,6 +30,7 @@
 #include "vtkInfoTextImageInteractorPlane2D.h"
 #include "vtkInfoTextImage.h"
 
+#include "wxMPRBaseData.h"
 #include "wxVtk2DBaseView.h"
 
 #include "vtkTransform.h"
index 6e8a688f0036c2da8ac947b5edbae3c74e315d53..feb2f74282b21457dac7a573bb21e26fc7679fac 100644 (file)
@@ -163,6 +163,7 @@ void vtkMPRBaseData::SetX(double x)
                }
                
                _x=x;
+               _observable->InvokeEvent(1);    
        }
 }
 //-------------------------------------------------------------------
@@ -197,6 +198,7 @@ void vtkMPRBaseData::SetY(double y)
                        y=ext[3] + origin[1];
                }
                _y=y;
+               _observable->InvokeEvent(2);    
        }
 }
 //-------------------------------------------------------------------
index 40f1fb0ce33d70424689089ed602b267443629c4..76ea0a1c798fdcf260276b90f5086636a2e2904e 100644 (file)
 class creaMaracasVisu_EXPORT vtkMPRBaseData: public vtkBaseData{
 public:
        vtkMPRBaseData();
-       virtual ~vtkMPRBaseData();
-       virtual void                    Configure();
-       int                                             GetMaxPositionX( );
-       int                                             GetMaxPositionY( );
-       int                                             GetMaxPositionZ( );
-       double                                  GetX();
-       double                                  GetY();
-       void                                    SetX(double x);
-       void                                    SetY(double y);
-       void                                    GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
-       vtkTransform                    *GetTransformOrientation();
-       void                                    SetNormal(double nx, double ny, double nz);
-       void                                    InitTransformOrientation(vtkTransform *trans);
+       virtual                         ~vtkMPRBaseData();
+       virtual void    Configure();
+       int                             GetMaxPositionX( );
+       int                             GetMaxPositionY( );
+       int                             GetMaxPositionZ( );
+       double                  GetX();
+       double                  GetY();
+       void                            SetX(double x);
+       void                            SetY(double y);
+       void                            GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
+       vtkTransform*   GetTransformOrientation();
+       void                            SetNormal(double nx, double ny, double nz);
+       void                            InitTransformOrientation(vtkTransform *trans);
 
 protected:
-       int                                             _x1,_x2,_y1,_y2,_z1,_z2;
+       int                             _x1,_x2,_y1,_y2,_z1,_z2;
 
 private:
-       double                                  _x,_y;
-       vtkTransform                    *_transformOrientation;
+       double                  _x,_y;
+       vtkTransform    *_transformOrientation;
 };
 
 
index a11e073be9d68c5a42ebb8133576a21c84b8a30c..e1901a1c0dd4a619b2f33a78ce78646cb2b66275 100644 (file)
@@ -380,7 +380,7 @@ wxPanel* wxMPRWidget::CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkm
        if (type==3)
        {
                _widgetMesure_B         = new wxWidgetMesure2D_Plane_in_MPR(panel);
-               _vtkplane2Dview_B       = new vtkPlane2DView( _widgetMesure_B->GetWindow2());
+               _vtkplane2Dview_B               = new vtkPlane2DView( _widgetMesure_B->GetWindow2());
                _widgetMesure_B->SetVtkPlane2DView( _vtkplane2Dview_B );
                _vtkplane2Dview_B->SetImgSize( 200 );
                _vtkplane2Dview_B->SetVtkBaseData(vtkmprbasedata);
@@ -395,16 +395,16 @@ wxPanel* wxMPRWidget::CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkm
        if (type==5)
        {
                wxSplitterWindow *panelMPR3D    = new wxSplitterWindow( panel , -1);
-               _wxvtk3Dbaseview_MPR3D_B                = new wxVtk3DBaseView( panelMPR3D );
+               _wxvtk3Dbaseview_MPR3D_B                = new wxVtk3DBaseView( panelMPR3D , vtkmprbasedata );
 
-               _wxvtkmpr3Dview_B                               = new wxVtkMPR3DView(_wxvtk3Dbaseview_MPR3D_B);
+               _wxvtkmpr3Dview_B                                       = new wxVtkMPR3DView(_wxvtk3Dbaseview_MPR3D_B);
                vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer(); 
                vtkmpr3Ddataviewer->SetVtkMPRBaseData(vtkmprbasedata);
                vtkmpr3Ddataviewer->Configure();
                _wxvtkmpr3Dview_B->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
 
-               wxWindow        *window3D                       = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
-               wxPanel         *controlPanel3D         = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
+               wxWindow        *window3D                               = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
+               wxPanel *controlPanel3D         = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
 
 //EEDxx2.4
                panelMPR3D      -> SetMinimumPaneSize( 5 );
@@ -418,7 +418,7 @@ wxPanel* wxMPRWidget::CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkm
        if (type==6)
        {
                wxSplitterWindow        *panelClipping3D        = new wxSplitterWindow( panel , -1);
-               _wxvtk3Dbaseview_Clipping3D_BB                  = new wxVtk3DBaseView( panelClipping3D );
+               _wxvtk3Dbaseview_Clipping3D_BB          = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata );
 
                _wxvtkclipping3Dview_BB                                 = new wxVtkClipping3DView(_wxvtk3Dbaseview_Clipping3D_BB);
                vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer(); 
@@ -432,7 +432,7 @@ wxPanel* wxMPRWidget::CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkm
                vtkmpr3Ddataviewer->Configure();
                _wxvtkmpr3Dview_BB->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
 
-               wxWindow        *window3D                                       = _wxvtk3Dbaseview_Clipping3D_BB->GetWxVTKRenderWindowInteractor();
+               wxWindow        *window3D                                               = _wxvtk3Dbaseview_Clipping3D_BB->GetWxVTKRenderWindowInteractor();
 
                wxPanel                 *panelControl                   = new wxPanel(panelClipping3D,-1);      
                wxPanel                 *controlPanelMPR3D              = _wxvtkmpr3Dview_BB->CreateControlPanel(panelControl, false);
@@ -541,10 +541,9 @@ wxPanel* wxMPRWidget::CreateMPRPanel4View(wxWindow *parent, vtkMPRBaseData *vtkm
        wxVTKRenderWindowInteractor *iren3B = _wxsphereview->GetWxVTKRenderWindowInteractor();  
        notebook->AddPage( iren3B, _T("Sphere") );
 
-
         // view 3.2
        wxSplitterWindow *panelMPR3D    = new wxSplitterWindow( notebook , -1);
-       _wxvtk3Dbaseview_MPRClipping3D  = new wxVtk3DBaseView( panelMPR3D );
+       _wxvtk3Dbaseview_MPRClipping3D  = new wxVtk3DBaseView( panelMPR3D ,vtkmprbasedata );
 
        _wxvtkmpr3Dview = new wxVtkMPR3DView( _wxvtk3Dbaseview_MPRClipping3D );
        vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer(); 
index 87ff24cf58c822804f072f77883de15f3d5c156a..eafbb9a4a9d3512c03b1e01f6d1d4b72c0c56be5 100644 (file)
@@ -107,7 +107,7 @@ wxPanel* wxManualTree_MPRWidget::Create3DViewContour( wxWindow *parent, vtkMPRBa
        wxPanel *panel=new wxPanel(parent,-1);
 
        wxSplitterWindow        *panelClipping3D        = new wxSplitterWindow( panel , -1);
-       _wxvtk3Dbaseview_Clipping3D_C = new wxVtk3DBaseView( panelClipping3D );
+       _wxvtk3Dbaseview_Clipping3D_C = new wxVtk3DBaseView( panelClipping3D, vtkmprbasedata );
 
        _wxvtkclipping3Dview_C = new wxVtkClipping3DView(_wxvtk3Dbaseview_Clipping3D_C);
        vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer(); 
index b61bb0d52aa096cbbd79d95aa38340ed129b5529..de0a52f846c72762d97a654e70188f45b9d213cc 100644 (file)
                }else if (type==5)
                {
                        panelClipping3D = new wxSplitterWindow( panel , -1);
-                       mwxvtk3Dbaseview_Clipping3D             = new wxVtk3DBaseView( panelClipping3D );
+                       mwxvtk3Dbaseview_Clipping3D             = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
 
-                       mwxvtkclipping3Dview                    = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
+                       mwxvtkclipping3Dview                                    = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
                        vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer();
                        vtkclipping3Ddataviewer->SetVtkMPRBaseData(mvtkmprbasedata);                    
                        vtkclipping3Ddataviewer->Configure();
                        wxwindow=panelClipping3D;
 
                } else if (type==6)             {
-                       panelClipping3D = new wxSplitterWindow( panel , -1);
-                       mwxvtk3Dbaseview_Clipping3D     = new wxVtk3DBaseView( panelClipping3D );
-
-                       mwxvtkmpr3Dview         = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
-
-                       vtkmpr3Ddataviewer      = new vtkMPR3DDataViewer();
-
-                       wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
-
-                       wxPanel *panelControl   = new wxPanel(panelClipping3D,-1);
-                       wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
-
-                       wxFlexGridSizer  *sizerCtrol     = new wxFlexGridSizer(1);
+                       panelClipping3D                                 = new wxSplitterWindow( panel , -1);
+                       mwxvtk3Dbaseview_Clipping3D     = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
+                       mwxvtkmpr3Dview                                 = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
+                       vtkmpr3Ddataviewer                              = new vtkMPR3DDataViewer();
+                       wxWindow *window3D                              = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
+                       wxPanel *panelControl                   = new wxPanel(panelClipping3D,-1);
+                       wxPanel *controlPanelMPR3D      = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
+                       wxFlexGridSizer  *sizerCtrol  = new wxFlexGridSizer(1);
                        sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
 
                        panelControl->SetAutoLayout(true);
 
                }else if (type==7)
                {
-                       mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel );
+                       mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel ,vtkmprbasedata);
                        wxwindow = (wxWindow*) mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
                }
 
index c8d4818e9d641fd29aa01c010be799cc26c4d6bc..8a022bd06023df9ea04430b6676bc103cd03bb46 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef WXSPHEREVIEW_H_
 #define WXSPHEREVIEW_H_
 
+#include "wxMPRBaseData.h"
 #include "wxVtk2DBaseView.h"
 #include "idAlBeRa.h"
 #include "vtkInteractorStyleSphere.h"
index b8b203730bb37c7d2a87dcb18afaf0e8e8d3905f..e9d096ab41ef4f380e103cddeea6d27284bf99ed 100644 (file)
@@ -276,28 +276,15 @@ void wxVtk2DBaseView::Configure(bool okimage)
 
 int    wxVtk2DBaseView::GetActualSlice()  // virtual
 {
-   return (int)(_vtkbasedata->GetZ());
+   return (int)(GetVtkBaseData()->GetZ());
 }
 
 //-------------------------------------------------------------------
 void wxVtk2DBaseView::SetActualSlice(int slice)  // Virtual
 {
-   _vtkbasedata->SetZ(slice);
+   GetVtkBaseData()->SetZ(slice);
 }
 
-//-------------------------------------------------------------------
-
-vtkBaseData *wxVtk2DBaseView::GetVtkBaseData()
-{
-   return _vtkbasedata;
-}
-
-//-------------------------------------------------------------------
-
-void wxVtk2DBaseView::SetVtkBaseData(vtkBaseData *vtkbasedata)
-{
-   _vtkbasedata=vtkbasedata;
-}
 
 //-------------------------------------------------------------------
 void wxVtk2DBaseView::UpdateColorWindowLevel()
@@ -309,12 +296,12 @@ void wxVtk2DBaseView::UpdateColorWindowLevel()
        
        
        vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel();
-       imagemaptowindowlevel->SetWindow( _vtkbasedata->GetColorWindow() );
-       imagemaptowindowlevel->SetLevel( _vtkbasedata->GetColorLevel() );
+       imagemaptowindowlevel->SetWindow( GetVtkBaseData()->GetColorWindow() );
+       imagemaptowindowlevel->SetLevel( GetVtkBaseData()->GetColorLevel() );
        
 // EED Borrame
-//     vtkimageviewer2->SetColorWindow( _vtkbasedata->GetColorWindow() );
-//     vtkimageviewer2->SetColorLevel(  _vtkbasedata->GetColorLevel() );
+//     vtkimageviewer2->SetColorWindow( GetVtkBaseData()->GetColorWindow() );
+//     vtkimageviewer2->SetColorLevel(  GetVtkBaseData()->GetColorLevel() );
        _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified();
 }
 
@@ -386,7 +373,7 @@ void wxVtk2DBaseView::setColorTransferFunction(vtkColorTransferFunction* colorta
 void wxVtk2DBaseView::SetColorWindow(double level)
 {
 //     _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level);
-       _vtkbasedata->SetColorWindow(level);    
+       GetVtkBaseData()->SetColorWindow(level);        
        this->Refresh();
 }
 
@@ -394,7 +381,7 @@ void wxVtk2DBaseView::SetColorWindow(double level)
 void wxVtk2DBaseView::SetColorLevel(double level)
 {
 //     _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel(level);
-       _vtkbasedata->SetColorLevel(level);
+       GetVtkBaseData()->SetColorLevel(level);
        this->Refresh();
 }
 
index 9ea2b96d9d860dcccba7945f0fb1dfa06ae1e8f6..c4d275a70495cb3bac305ef3c8a53c5f1e3fe50b 100644 (file)
@@ -39,33 +39,31 @@ class vtkInfoTextImageInteractor;
 
 //------------------------------------------------------------------
 
-
 class creaMaracasVisu_EXPORT wxVtk2DBaseView: public wxVtkBaseView{
 public:
        wxVtk2DBaseView(wxWindow *parent);
        virtual ~wxVtk2DBaseView();
        virtual void                    Configure(bool okimage=true);
        vtkImageViewer2_XYZ*    _imageViewer2XYZ;
-       vtkBaseData*                    GetVtkBaseData();
-       void                                    SetVtkBaseData(vtkBaseData *vtkbasedata);
+
+
        virtual void                    Refresh();
        virtual void                    ResetView();
        virtual int                             GetActualSlice();
-       virtual void                    SetActualSlice(int slice);
-                       void                    SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview);
+       virtual void                    SetActualSlice(int slice);
+       void                                            SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview);
 
-       virtual vtkRenderer*            GetRenderer();
+       virtual vtkRenderer*                    GetRenderer();
        virtual vtkRenderWindow*        GetRenWin();
        virtual void                    TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z);
        virtual void                    TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z);
        virtual void                    GetSpacing(double spc[3]);
 
        void setColorTransferFunction(vtkColorTransferFunction* colortable);
-
        void SetColorWindow(double level);
        void SetColorLevel(double level);
        
-    virtual int GetDirection();
+   virtual int GetDirection();
        void SetImageToVtkViewer(vtkImageData *imageData);
        
        //EED 01nov2012
@@ -73,11 +71,9 @@ public:
 
 
 private:
-       vtkBaseData                                                     *_vtkbasedata;
-
        vtkInfoTextImage                                        *_vtkIinfoTextImage;
-       vtkInfoTextImageInteractor                      *_vtkIinfoTextImageInteractor;
-       vtkInteractorStyleBaseView2D * _style2D;
+       vtkInfoTextImageInteractor              *_vtkIinfoTextImageInteractor;
+       vtkInteractorStyleBaseView2D    * _style2D;
 
 protected:
 
index 9d92c225526295afd8d36d392e09c339d3e1f7df..013770adfd86282ccef0ebf10887ba9d1af7763f 100644 (file)
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
-wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent)
+wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent, vtkBaseData* vtkbasedata)
 :wxVtkBaseView( parent )
 {
+       SetVtkBaseData( vtkbasedata );
        _configure      = false;
        _aRenderer      = NULL;
        _renWin         = NULL;
-       _aCamera        = NULL;
+       _aCamera                = NULL;
 }
 //-------------------------------------------------------------------
 wxVtk3DBaseView::~wxVtk3DBaseView()
 {
 
-       if (_aCamera!=NULL)     { _aCamera              -> Delete(); _aCamera=NULL;}
+       if (_aCamera!=NULL)             { _aCamera              -> Delete(); _aCamera=NULL;}
        if (_aRenderer!=NULL)   { _aRenderer    -> Delete(); _aRenderer=NULL;}
-       if (_renWin!=NULL)      { 
-               if(_renWin->GetReferenceCount()==0){
+       if (_renWin!=NULL)              { 
+               if(_renWin->GetReferenceCount()==0)
+               {
                        _renWin         -> Delete(); _renWin=NULL;
                }
        }
index 8a32d1f8ade5bc72e05de795cb82d3996ad920f7..db9804e7d8eca2f2fca15f77ae998f24f8d71545 100644 (file)
 class creaMaracasVisu_EXPORT wxVtk3DBaseView: public wxVtkBaseView
 {
 public:
-       wxVtk3DBaseView( wxWindow *parent );
+       wxVtk3DBaseView( wxWindow *parent, vtkBaseData* vtkbasedata );
        virtual ~wxVtk3DBaseView();
-       vtkCamera*                      GetCamera();
-       virtual vtkRenderer*            GetRenderer();
+       vtkCamera*                                              GetCamera();
+       virtual vtkRenderer*                    GetRenderer();
        virtual vtkRenderWindow*        GetRenWin();
-       void                            Refresh();
-       void                            Configure();
-       virtual void                    GetSpacing(double spc[3]);
-       void                            SetStereo(int type);
-       void                            ResetCamera(int *ext=NULL,double* spc=NULL);
-
+       void                                                            Refresh();
+       void                                                            Configure();
+       virtual void                                    GetSpacing(double spc[3]);
+       void                                                            SetStereo(int type);
+       void                                                            ResetCamera(int *ext=NULL,double* spc=NULL);
 
 private:
-       bool                            _configure;
-       vtkRenderer                     *_aRenderer;
-       vtkRenderWindow         *_renWin;
-       vtkCamera                       *_aCamera;
+       bool                                                            _configure;
+       vtkRenderer                                             *_aRenderer;
+       vtkRenderWindow                         *_renWin;
+       vtkCamera                                               *_aCamera;
 protected:
 };
 
index b19937e2e847e88950cb61091ed60ca50ca6bc3e..2cd9da1c9fc2f881e475adc909abe438668b5bfe 100644 (file)
@@ -217,6 +217,19 @@ int  wxVtkBaseView::GetDirection()   // virtual
        return -1;
 }
 
+//-------------------------------------------------------------------
+vtkBaseData *wxVtkBaseView::GetVtkBaseData()
+{
+   return _vtkbasedata;
+}
+
+//-------------------------------------------------------------------
+void wxVtkBaseView::SetVtkBaseData(vtkBaseData *vtkbasedata)
+{
+   _vtkbasedata=vtkbasedata;
+}
+
+
 
 //-------------------------------------------------------------------
 //-------------------------------------------------------------------
index 43ccd2f1b68839b7b64ecdf34a2456ad87f65aca..07d9e462d6afc2817a7bbe11791d6719583f832a 100644 (file)
@@ -43,7 +43,7 @@
 #include <vtkImageViewer2.h> 
 #include <vtkInteractorStyleImage.h> 
 
-#include "wxMPRBaseData.h"
+#include "vtkBaseData.h"
 #include "wxVTKRenderWindowInteractorEditContour.h"
 
 #include <wx/wx.h>
@@ -70,36 +70,45 @@ public:
        wxVtkBaseView( wxWindow *parent );
        virtual ~wxVtkBaseView();
        wxVTKRenderWindowInteractor             *GetWxVTKRenderWindowInteractor() throw (char*);
-       virtual void                            Configure();
-       virtual void                            Refresh();
-       virtual void                            RefreshView();
+       virtual void                                    Configure();
+       virtual void                                    Refresh();
+       virtual void                                    RefreshView();
        virtual vtkRenderer*                    GetRenderer();
-       virtual vtkRenderWindow*                GetRenWin();
-       virtual void                            TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2);
+       virtual vtkRenderWindow*        GetRenWin();
+       virtual void                                    TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2);
 
        //RaC 03-2010 Method used by TransFromCoordScreenToWorld
-       void                                    TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2);
+       void                                                            TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2);
 
        /* JCP 04/05/09
        void                                    SetInteractorStyleBaseView( vtkInteractorStyleBaseView* interactorStyle);
        */
-       void                                    SetInteractorStyleBaseView( vtkInteractorStyleImage*    interactorStyle);
+       void                                                            SetInteractorStyleBaseView( vtkInteractorStyleImage*    interactorStyle);
        /* JCP 04/05/09
         * 
        vtkInteractorStyleBaseView*             GetInteractorStyleBaseView();   
        */
-       vtkInteractorStyleImage*                GetInteractorStyleBaseView();
-       virtual void                            GetSpacing(double spc[3]);
-       virtual int                             GetDirection();
+       vtkInteractorStyleImage*        GetInteractorStyleBaseView();
+       virtual void                                    GetSpacing(double spc[3]);
+       virtual int                                             GetDirection();
+
+
+       vtkBaseData*                                    GetVtkBaseData();
+       void                                                            SetVtkBaseData(vtkBaseData *vtkbasedata);
+
 
 private:
-       wxWindow                                *_parent;
-       wxVTKRenderWindowInteractor             *_iren;
+       wxWindow                                                         *_parent;
+       wxVTKRenderWindowInteractor *_iren;
        /**
         * JCP 04/05/09
         * vtkInteractorStyleImage              *_interactorStyle;
         */
        vtkInteractorStyleImage         *_interactorStyle;
+
+// EED Nov 15 2014
+       vtkBaseData                                             *_vtkbasedata;
+
 protected:
 
 };
index d3b1cec0f6f350dffebd03984d008f5697a59023..8e7f4bbf2f01c7dde73b277f9d8386b1632aded4 100644 (file)
@@ -39,8 +39,8 @@ class wxVtkClipping3DView
 public:
        wxVtkClipping3DView( wxVtk3DBaseView* wxvtk3Dbaseview );
        virtual ~wxVtkClipping3DView();
-       virtual void                            Refresh();
-       virtual void                            Configure();
+       virtual void                    Refresh();
+       virtual void                    Configure();
        void                                            SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
 
        wxPanel*                                        CreateSurfControlPanel(wxWindow *parent);
@@ -51,25 +51,25 @@ public:
        void                                            VisibleActor(int idTissue, bool visTissue);
        void                                            VisibleVolumeActor( bool visVolume );
 
-       void                        VisibleVolumeBoxActor(bool visible);
+       void                 VisibleVolumeBoxActor(bool visible);
 
        void                                            SetVisibleBoxSurface(bool visible);
        void                                            SetVisibleBoxVolume(bool visible);
        void                                            SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation );
 
-       wxVtk3DBaseView*                        GetWxvtk3Dbaseview()throw(char*);
+       wxVtk3DBaseView*                GetWxvtk3Dbaseview()throw(char*);
 
-       void                        SetRayCasting(bool active);
-       void                        SetMIPActive(bool active);
-    void                        SetInterpolation(bool active);
-    void                        SetShade(bool active);
+       void                 SetRayCasting(bool active);
+       void                 SetMIPActive(bool active);
+   void                        SetInterpolation(bool active);
+   void                        SetShade(bool active);
 
-    void                        UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
+   void                        UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
 
 
 private:
-       wxVtk3DBaseView                                 *_wxvtk3Dbaseview;
-       vtkClipping3DDataViewer                 *_vtkclipping3Ddataviewer;
+       wxVtk3DBaseView                         *_wxvtk3Dbaseview;
+       vtkClipping3DDataViewer         *_vtkclipping3Ddataviewer;
        vtkBoxWidget                                    *_boxWidgetS1;
        vtkBoxWidget                                    *_boxWidgetVolume;
        wxPanel                                                 *_wxvtkclipping3DviewCntrlPanel;
index 7005761b0aaf4755ee3363bc529c64b2cc66dc7b..11e0030810ee30ea7dd14678704779236837eeba 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "vtkInteractorStyleMPRView.h"
 
+#include "wxMPRBaseData.h"
 #include "wxVtk2DBaseView.h"
 
 #include "vtkPolyDataMapper.h"