X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2FCutModule%2Fkernel%2FCutModelManager.h;h=abc8d3e95686142707cf1d225f6da9b39aa95075;hb=b11f0ef609b10c7165bf66f6da99e7972b612818;hp=8ea3fa7e1f41c50b3e369d3f46b44a703b0398b8;hpb=2d5984d688d7b149aa7706a0a0bf8c4b4556d788;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h index 8ea3fa7..abc8d3e 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h @@ -1,17 +1,17 @@ /*========================================================================= - Program: wxMaracas - Module: $RCSfile: CutModelManager.h,v $ - Language: C++ - Date: $Date: 2009/08/31 08:46:12 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. +Program: wxMaracas +Module: $RCSfile: CutModelManager.h,v $ +Language: C++ +Date: $Date: 2010/02/24 13:56:08 $ +Version: $Revision: 1.5 $ + +Copyright: (c) 2002, 2003 +License: + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. =========================================================================*/ @@ -22,27 +22,50 @@ #define __CutModelManagerH__ #include +#include #include #include "vtkImageData.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderer.h" +#include "wxVtkBaseView.h" +#include "wxVtk3DBaseView.h" +#include #include "CutModelException.h" #include "CutModelData.h" +#include "CutModelSaveBinInfo.h" + +#include "vtkPoints.h" +#include "CutModelPolygon.h" +#include "vtkInteractorStyleTrackballCamera.h" +#include "vtkInteractorStyleCutter.h" +#include "wxVTKRenderWindowInteractor.h" +#include "vtkImplicitSelectionLoop.h" +#include "vtkPolyDataMapper.h" +#include "vtkSampleFunction.h" +#include "vtkContourFilter.h" +#include "vtkPolyData.h" +#include "vtkActor.h" + + class CutModelManager { public: - CutModelManager(); + CutModelManager(std::string path); ~CutModelManager(); void setImageData(vtkImageData* img); + vtkImageData* getImageData(); + void setInteractor(vtkRenderWindowInteractor* interactor); void setRenderer(vtkRenderer* renderer); - + + void setBaseView(wxVtkBaseView* baseView); + void onAddCutModel(int id, vtkCommand* observer) throw( CutModelException); double* getImageRange()throw( CutModelException); @@ -62,16 +85,56 @@ public: void ExecuteCut(int id, double* range, bool isinside)throw( CutModelException); vtkImageData* GetResultImage(); -private: + + void RefreshActor(int id); + + void SaveCutModelData(std::string filename)throw( CutModelException); + + void LoadCutModelData(std::string filename)throw( CutModelException); + + CutModelSaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModelException); + + int Undo()throw( CutModelException); + + int Redo()throw( CutModelException); + + void ParallelProjectionOn(); + + void ParallelProjectionOff(); + + void UpdatePolygon(bool mode); + + void ExecuteCutPolygon(bool inOutCut); + + void InitializePolygonInteractorStyle(); + +private: + + int _currentaction; + void checkInvariant() throw( CutModelException); + std::string _path; vtkImageData* _img; - vtkImageData* _copyimg; + vtkImageData* _img2; vtkRenderer* _render; vtkRenderWindowInteractor* _interactor; std::vector _vectordata; + std::vector _undoredo; CutModelData* getCutModelData(int id)throw( CutModelException); - + + CutModelPolygon* _polygonCutter; + vtkPoints *contourPoints ; + double *contourDirection; + vtkInteractorStyleTrackballCamera *interactorstyle; + vtkInteractorStyleCutter *cutterstyle; + vtkContourFilter *contour; + vtkSampleFunction *sample; + vtkPolyData *actor; + vtkActor *actor3D; + vtkImplicitSelectionLoop *loop; + vtkPolyDataMapper *mapper; + }; #endif