00001 #ifndef manualViewPoint_h 00002 #define manualViewPoint_h 00003 00004 #include "vtkRenderWindow.h" 00005 00006 #include "vtkRenderer.h" 00007 #include "vtkRenderWindowInteractor.h" //extremely important with VC++ don't remove ! 00008 #include "vtkCommand.h" 00009 #include "vtkPolyData.h" 00010 #include "vtkCellArray.h" 00011 #include "vtkPolyDataMapper.h" 00012 #include "vtkInteractorObserver.h" 00013 #include "vtkInteractorStyleImage.h" 00014 #include <vtkKochanekSpline.h> 00015 00016 #include <vtkCellPicker.h> 00017 #include <vtkCamera.h> 00018 #include <vtkPolyLine.h> 00019 #include <vtkDataSetMapper.h> 00020 #include <vtkUnstructuredGrid.h> 00021 00022 #include "wxVTKRenderWindowInteractor.h" 00023 00024 #include <vector> 00025 #include "wxVtkBaseView.h" 00026 #include "marTypes.h" 00027 00028 //-------------------------------------------------------- 00029 00030 class manualViewPoint{ 00031 public: 00032 00033 manualViewPoint(wxVtkBaseView *wxvtkbaseview); 00034 ~manualViewPoint(); 00035 00036 virtual manualViewPoint * Clone(); 00037 void CopyAttributesTo( manualViewPoint *cloneObject ); 00038 void SetSelected(bool selected); 00039 void SetPosibleSelected(bool posibleSelected); 00040 bool GetSelected(); 00041 bool GetPosibleSelected(); 00042 void DeleteVtkObjects(); 00043 vtkActor* CreateVtkPointActor(); 00044 00045 // 00046 // Sets the x,y,z position to the actual point. Establishes a range of the points respect 00047 // to the final coordinate. 00048 // @param x - double 00049 // @param y - double 00050 // @param z - double 00051 // @param range - double 00052 // 00053 void SetPositionXY(double x, double y, double range, double posZ); 00054 00055 // 00056 // Get ViewPoint VtkActor 00057 // @return vtkActor* 00058 // 00059 vtkActor* GetVtkActor(); 00060 00061 // 00062 // Updates the color and width of the actual point if the VTK Actor has been created 00063 // 00064 void UpdateColorActor(); 00065 00066 // 00067 // Updates the point normal color of the actual point. 00068 // 00069 void UpdateColorActor(double nR, double nG, double nB); 00070 00071 void GetSpacing(double spc[3]); 00072 void SetSpacing(double spc[3]); 00073 void SetWidthLine( double width); 00074 00075 00076 private: 00077 00078 // 00079 // Is point selected 00080 // 00081 bool _selected; 00082 bool _posibleSelected; 00083 00084 vtkPoints *_pts; 00085 00086 // 00087 // Point VTK PolyData object 00088 // 00089 vtkPolyData *_pd; 00090 00091 // 00092 // Point VTK Actor 00093 // 00094 vtkActor *_pointVtkActor; 00095 00096 // 00097 // Point VTK PolyData mapper 00098 // 00099 vtkPolyDataMapper *_bboxMapper; 00100 00101 // 00102 // Reference to VtkBaseView 00103 // 00104 wxVtkBaseView *_wxvtkbaseview; 00105 00106 // 00107 // Line Width (def=1) 00108 // 00109 double _widthline; 00110 protected: 00111 00112 // 00113 // Point spacing (def=1) 00114 // 00115 double _spc[3]; 00116 00117 // Point normal color 00118 double _colorNormal_r; 00119 double _colorNormal_g; 00120 double _colorNormal_b; 00121 00122 // Posible selected point color 00123 double _colorPosibleSelected_r; 00124 double _colorPosibleSelected_g; 00125 double _colorPosibleSelected_b; 00126 }; 00127 00128 #endif // manualViewPoint_h