From f369752f86b8a540df6638ba87945e83c9498b4b Mon Sep 17 00:00:00 2001 From: davila Date: Mon, 17 Nov 2014 08:59:33 +0100 Subject: [PATCH] #2482 creaMaracasVisu Bug New - HighColorLayer refresh missing. The MPR is not refresh at the same time --- bbtk/bbs/appli/exampleColorLayer.bbg | 58 +++------ bbtk/bbs/appli/exampleColorLayer.bbs | 48 +++---- bbtk/src/bbmaracasvisuDrawAxe3D.h | 6 +- .../ThresholdImageView/LayerImageBase.cxx | 107 ++++++++++++---- .../ThresholdImageView/LayerImageBase.h | 23 ++-- .../manualContour/manualContour3DControler.h | 1 + .../manualContour/manualContour3VControler.h | 1 + .../manualContourPerpPlaneControler.h | 2 + .../manualContour/manualView3DContour.h | 1 + .../wxWindows/widgets/vtkBaseData.cxx | 27 +++- .../interface/wxWindows/widgets/vtkBaseData.h | 26 ++-- .../widgets/vtkClipping3DDataViewer.h | 120 +++++++++--------- .../wxWindows/widgets/vtkMPR3DDataViewer.h | 20 +-- .../wxWindows/widgets/vtkPlane2DView.h | 1 + .../wxWindows/widgets/wxMPRBaseData.cxx | 2 + .../wxWindows/widgets/wxMPRBaseData.h | 32 ++--- .../wxWindows/widgets/wxMPRWidget.cxx | 17 ++- .../widgets/wxManualTree_MPRWidget.cxx | 2 +- .../widgets/wxMaracas_ViewerWidget.cxx | 27 ++-- .../wxWindows/widgets/wxSphereView.h | 1 + .../wxWindows/widgets/wxVtk2DBaseView.cxx | 29 ++--- .../wxWindows/widgets/wxVtk2DBaseView.h | 20 ++- .../wxWindows/widgets/wxVtk3DBaseView.cxx | 12 +- .../wxWindows/widgets/wxVtk3DBaseView.h | 25 ++-- .../wxWindows/widgets/wxVtkBaseView.cxx | 13 ++ .../wxWindows/widgets/wxVtkBaseView.h | 35 +++-- .../wxWindows/widgets/wxVtkClipping3DView.h | 22 ++-- .../wxWindows/widgets/wxVtkMPR2DView.h | 1 + 28 files changed, 365 insertions(+), 314 deletions(-) diff --git a/bbtk/bbs/appli/exampleColorLayer.bbg b/bbtk/bbs/appli/exampleColorLayer.bbg index 6ee86ba..79c934c 100644 --- a/bbtk/bbs/appli/exampleColorLayer.bbg +++ b/bbtk/bbs/appli/exampleColorLayer.bbg @@ -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: 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 diff --git a/bbtk/bbs/appli/exampleColorLayer.bbs b/bbtk/bbs/appli/exampleColorLayer.bbs index 7b2fad1..113b44d 100644 --- a/bbtk/bbs/appli/exampleColorLayer.bbs +++ b/bbtk/bbs/appli/exampleColorLayer.bbs @@ -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 diff --git a/bbtk/src/bbmaracasvisuDrawAxe3D.h b/bbtk/src/bbmaracasvisuDrawAxe3D.h index 62972a2..da174e6 100644 --- a/bbtk/src/bbmaracasvisuDrawAxe3D.h +++ b/bbtk/src/bbmaracasvisuDrawAxe3D.h @@ -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; }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index 25d0b62..3b89d1a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -30,19 +30,70 @@ #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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h index 1e48287..e9e92aa 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h @@ -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); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.h index 71876f9..c46b74c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.h @@ -26,6 +26,7 @@ #ifndef manualContour3DControler_h #define manualContour3DControler_h +#include "wxMPRBaseData.h" #include "manualContourControler.h" #include "manualView3DContour.h" diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.h index a8c88f2..178ee30 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.h @@ -26,6 +26,7 @@ #ifndef manualContour3VControler_h #define manualContour3VControler_h +#include "wxMPRBaseData.h" #include "manualContourControler.h" // ---------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourPerpPlaneControler.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourPerpPlaneControler.h index 2796f80..876b31f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourPerpPlaneControler.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourPerpPlaneControler.h @@ -26,6 +26,8 @@ #ifndef manualContourPerpPlaneControler_h #define manualContourPerpPlaneControler_h + +#include "wxMPRBaseData.h" #include "manualContourControler.h" #include "manualContour3VControler.h" diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h index 3f972ec..7d3fd17 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h @@ -26,6 +26,7 @@ #ifndef manualView3DContour_h #define manualView3DContour_h +#include "wxMPRBaseData.h" #include "manualViewContour.h" // ---------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx index f8df99a..e34a19e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx @@ -26,12 +26,15 @@ #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(); +} + + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h index df0a4e6..7d72298 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h @@ -27,28 +27,30 @@ #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_*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h index 236aa3c..33a3e74 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h @@ -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 gf, vector 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 gf, vector 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 greyValuesTransferenceFVector; - std::vector intensityValuesTransferenceFVector; - std::vector redColorsOfColorTransferenceFVector; - std::vector greenColorsOfColorTransferenceFVector; - std::vector blueColorsOfColorTransferenceFVector; - std::vector greyValueColorsOfColorTransferenceFVector; + std::vector greyValuesTransferenceFVector; + std::vector intensityValuesTransferenceFVector; + std::vector redColorsOfColorTransferenceFVector; + std::vector greenColorsOfColorTransferenceFVector; + std::vector blueColorsOfColorTransferenceFVector; + std::vector greyValueColorsOfColorTransferenceFVector; vtkVolumeRayCastCompositeFunction *_compositeFunction; vtkVolumeRayCastMIPFunction *_compositeFunctionMIP ; bool _isRayCasting; - bool _isMIP; + bool _isMIP; bool _interpolation; bool _shade; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h index 70b16f0..ce96cc40 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h @@ -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 _ctFunVectorPoint; - std::vector _ctFunVectorRed; - std::vector _ctFunVectorGreen; - std::vector _ctFunVectorBlue; + vtkColorTransferFunction *_ctfun; + std::vector _ctFunVectorPoint; + std::vector _ctFunVectorRed; + std::vector _ctFunVectorGreen; + std::vector _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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h index 7a4efed..522b6a0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h @@ -30,6 +30,7 @@ #include "vtkInfoTextImageInteractorPlane2D.h" #include "vtkInfoTextImage.h" +#include "wxMPRBaseData.h" #include "wxVtk2DBaseView.h" #include "vtkTransform.h" diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx index 6e8a688..feb2f74 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx @@ -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); } } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h index 40f1fb0..76ea0a1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h @@ -89,26 +89,26 @@ 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; }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx index a11e073..e1901a1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx index 87ff24c..eafbb9a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index b61bb0d..de0a52f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -127,9 +127,9 @@ }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(); @@ -185,19 +185,14 @@ 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); @@ -221,7 +216,7 @@ }else if (type==7) { - mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel ); + mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel ,vtkmprbasedata); wxwindow = (wxWindow*) mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.h index c8d4818..8a022bd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.h @@ -26,6 +26,7 @@ #ifndef WXSPHEREVIEW_H_ #define WXSPHEREVIEW_H_ +#include "wxMPRBaseData.h" #include "wxVtk2DBaseView.h" #include "idAlBeRa.h" #include "vtkInteractorStyleSphere.h" diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index b8b2037..e9d096a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -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(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h index 9ea2b96..c4d275a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h @@ -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: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index 9d92c22..013770a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -30,22 +30,24 @@ #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; } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h index 8a32d1f..db9804e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h @@ -40,23 +40,22 @@ 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: }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index b19937e..2cd9da1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -217,6 +217,19 @@ int wxVtkBaseView::GetDirection() // virtual return -1; } +//------------------------------------------------------------------- +vtkBaseData *wxVtkBaseView::GetVtkBaseData() +{ + return _vtkbasedata; +} + +//------------------------------------------------------------------- +void wxVtkBaseView::SetVtkBaseData(vtkBaseData *vtkbasedata) +{ + _vtkbasedata=vtkbasedata; +} + + //------------------------------------------------------------------- //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h index 43ccd2f..07d9e46 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h @@ -43,7 +43,7 @@ #include #include -#include "wxMPRBaseData.h" +#include "vtkBaseData.h" #include "wxVTKRenderWindowInteractorEditContour.h" #include @@ -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: }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h index d3b1cec..8e7f4bb 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h @@ -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 gf, vector vf, vtkColorTransferFunction* ctfun); + void UpdateVolumeBox(vector gf, vector vf, vtkColorTransferFunction* ctfun); private: - wxVtk3DBaseView *_wxvtk3Dbaseview; - vtkClipping3DDataViewer *_vtkclipping3Ddataviewer; + wxVtk3DBaseView *_wxvtk3Dbaseview; + vtkClipping3DDataViewer *_vtkclipping3Ddataviewer; vtkBoxWidget *_boxWidgetS1; vtkBoxWidget *_boxWidgetVolume; wxPanel *_wxvtkclipping3DviewCntrlPanel; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h index 7005761..11e0030 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h @@ -28,6 +28,7 @@ #include "vtkInteractorStyleMPRView.h" +#include "wxMPRBaseData.h" #include "wxVtk2DBaseView.h" #include "vtkPolyDataMapper.h" -- 2.45.1