CutModelData.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   wxMaracas
00004   Module:    $RCSfile: CutModelData.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009/09/08 08:14:27 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright: (c) 2002, 2003
00010   License:
00011   
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notice for more information.
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 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1