CutModelData.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CutModelDataH__
00022 #define __CutModelDataH__
00023
00024 #include <iostream>
00025 #include <vector>
00026
00027 #include "vtkImageData.h"
00028 #include "vtkRenderWindowInteractor.h"
00029 #include "vtkCommand.h"
00030 #include "vtkBoxWidget.h"
00031 #include "vtkPolyDataMapper.h"
00032 #include "vtkActor.h"
00033 #include "vtkProperty.h"
00034 #include "CutModelException.h"
00035 #include "CutModelFigure.h"
00036 #include "CutModelFigureCube.h"
00037 #include "CutModelFigureSphere.h"
00038 #include "CutModelFigureCylinder.h"
00039
00040 #include <wx/utils.h>
00041
00042 class CutModelData {
00043
00044 public:
00045 CutModelData();
00046 CutModelData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
00047 ~CutModelData();
00048 void initializeData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
00049
00050
00051 int getId(){
00052 return _id;
00053 }
00054
00055 void changeOpacity(int opacity)throw( CutModelException);
00056
00057 void ShowViewBox(bool check)throw( CutModelException);
00058
00059 void ChangeShape(int selection)throw( CutModelException);
00060
00061 vtkActor* getActor()throw( CutModelException);
00062
00063 vtkPolyData* getPolyData()throw( CutModelException);
00064
00065 void changeColor(double r,double g,double b)throw( CutModelException);
00066
00067 void udapteActorDirection()throw( CutModelException);
00068
00069 void ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModelException);
00070
00071 void ExecuteUnCut( bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModelException);
00072
00073 void RefreshViewBox();
00074
00075 vtkTransform* getCurrentMatrix(){
00076 return currentmatrix;
00077 }
00078
00079 int getCurrentShape(){
00080 return _currentshape;
00081 }
00082
00083 void setCurrentShape(int currentshape){
00084 _currentshape = currentshape;
00085 }
00086
00087 void setTransform(vtkTransform* transform,vtkImageData* img)throw( CutModelException);
00088 private:
00089
00090 void checkInvariant()throw( CutModelException);
00091
00092 void createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCommand* observer);
00093 void createActor();
00094 void setTransform(vtkImageData* img)throw( CutModelException);
00095 void createShapes();
00096
00097 vtkBoxWidget* _boxWidgetVolume;
00098 vtkPolyDataMapper* _Mapper;
00099 vtkActor* _Actor;
00100 int _id;
00101
00102 int _currentshape;
00103
00104 CutModelFigureCube* _cubefigure;
00105 CutModelFigureCylinder* _cylinderfigure;
00106 CutModelFigureSphere* _spherefigure;
00107 vtkTransform* currentmatrix;
00108 vtkTransform* modeltransform;
00109 vtkTransform* inversModel;
00110
00111
00112 CutModelFigure* getCurentCuttingModel();
00113
00114 vtkTransform* getModelTransform(vtkImageData* copyimage);
00115 vtkTransform* getModelTransformInvers();
00116 };
00117
00118 #endif