manualViewBaseContour.h
Go to the documentation of this file.00001 #ifndef manualViewBaseContour_h
00002 #define manualViewBaseContour_h
00003
00004 #include "vtkRenderWindow.h"
00005
00006 #include "vtkRenderer.h"
00007 #include "vtkRenderWindowInteractor.h"
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 <vtkActor.h>
00017 #include <vtkProperty.h>
00018 #include <vtkCellArray.h>
00019 #include <vtkRenderer.h>
00020 #include <vtkCoordinate.h>
00021 #include <vtkTextProperty.h>
00022 #include <vtkTextActor.h>
00023 #include <vtkProperty2D.h>
00024 #include <vtkPointPicker.h>
00025
00026 #include "UtilVtk3DGeometriSelection.h"
00027 #include <vtkCellPicker.h>
00028
00029
00030 #include <vtkCamera.h>
00031 #include <vtkPolyLine.h>
00032 #include <vtkDataSetMapper.h>
00033 #include <vtkUnstructuredGrid.h>
00034
00035 #include "wxVTKRenderWindowInteractor.h"
00036
00037
00038
00039
00040 #include <vector>
00041 #include "wxVtkBaseView.h"
00042 #include "marTypes.h"
00043
00044 #include "manualViewPoint.h"
00045 #include "manualContourModel.h"
00046
00047
00048
00049
00050
00051
00052 class creaMaracasVisu_EXPORT manualViewBaseContour{
00053
00054
00055
00056
00057
00058 public:
00059 manualViewBaseContour();
00060 virtual ~manualViewBaseContour();
00061
00062 virtual int GetType();
00063 virtual void Save(FILE *pFile);
00064 virtual void Open(FILE *pFile);
00065
00066 void AddPoint();
00067 virtual void AddPoint( manualViewPoint * manualViewPoint );
00068 void InsertPoint(int id);
00069 void DeleteContour();
00070 void DeletePoint(int x, int y,int z);
00071 virtual void DeletePoint(int id);
00072
00073 virtual void UpdateViewPoint(int id);
00074 virtual void UpdateViewPoints();
00075
00076 void SetSelected(bool selected);
00077 void SetPosibleSelected(bool posibleSelected);
00078 bool GetSelected();
00079 bool GetPosibleSelected();
00080 void DeleteSelectedPoints();
00081 bool GetEditable();
00082 void SetEditable( bool * condition );
00083
00084
00085
00086 virtual int GetIdPoint(int x, int y, int z);
00087
00088 void SelectPoint(int i,bool select);
00089 void SelectLstPoints();
00090 void SelectAllPoints(bool select);
00091 virtual int SelectPosiblePoint(int x, int y ,int z);
00092 bool SelectPosibleContour(int x, int y ,int z);
00093 void SelectAllPossibleSelected(bool select);
00094 void SetPointSelected(int id,bool select);
00095 void SetPointPosibleSelected(int id,bool select);
00096 void SetIfViewControlPoints(bool ifShow);
00097 bool GetIfViewControlPoints();
00098
00099 void UnSelectPoint(int i);
00100 void UnSelectLstPoints();
00101 void UnSelectAllPoints();
00102
00103 void SetModel(manualBaseModel *manContModel);
00104 void SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview);
00105
00106 virtual void Refresh();
00107 int GetNumberOfPoints();
00108
00109
00110
00111 void CreateNewContour();
00112 double* GetVectorPointsXManualContour();
00113 double* GetVectorPointsYManualContour();
00114 double* GetVectorPointsZManualContour();
00115
00116 virtual bool ifTouchContour(int x,int y, int z);
00117 void UpdateColorActor();
00118
00119 void SetRange(double range);
00120 double GetRange();
00121 void SetZ(int z);
00122 int GetZ();
00123
00124 wxVtkBaseView *GetWxVtkBaseView();
00125
00126 virtual void InitMove(int x, int y, int z);
00127 virtual void MoveContour(int x, int y, int z);
00128 virtual void MoveContour(int horizontalUnits, int verticalUnits );
00129 virtual void GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ );
00130 virtual void TransfromCoordViewWorld(double &X, double &Y, double &Z, int type=2);
00131
00132 void ClearContour();
00133 virtual void ClearPoint(int id);
00134
00135 void SetVisible(bool ok);
00136 void SetShowText(bool ok);
00137
00138 void GetSpacing(double spc[3]);
00139 void SetSpacing(double spc[3]);
00140
00141 void SetColorNormalContour(double r, double g, double b);
00142 void GetColorNormalContour(double &r, double &g, double &b);
00143 void SetColorEditContour(double r, double g, double b);
00144 void GetColorEditContour(double &r, double &g, double &b);
00145 void SetColorSelectContour(double r, double g, double b);
00146 void GetColorSelectContour(double &r, double &g, double &b);
00147
00148
00149 void AddCompleteContourActor( bool ifControlPoints = false);
00150 void RemoveCompleteContourActor();
00151 virtual void AddSplineActor();
00152 virtual void RemoveSplineActor();
00153 virtual void AddControlPoints();
00154 virtual void RemoveControlPoints();
00155 void AddTextActor();
00156 void RemoveTextActor();
00157 void InitTextActor();
00158
00159 virtual manualViewBaseContour * Clone();
00160 void CopyAttributesTo( manualViewBaseContour *cloneObject );
00161 virtual void RefreshContour();
00162 void SetWidthLine(double width);
00163 double GetWidthLine();
00164
00165 virtual void ConstructVTKObjects();
00166
00167
00168
00169
00170
00171 private:
00172
00173 vtkPolyData *_pd;
00174 vtkActor *_contourVtkActor;
00175 vtkPolyDataMapper *_bboxMapper;
00176
00177 void DeleteVtkObjects();
00178
00179
00180
00181
00182
00183
00184 protected:
00185
00186 double _range;
00187
00188 double _coulorEdit_r;
00189 double _coulorEdit_g;
00190 double _coulorEdit_b;
00191 double _coulorNormal_r;
00192 double _coulorNormal_g;
00193 double _coulorNormal_b;
00194 double _coulorSelection_r;
00195 double _coulorSelection_g;
00196 double _coulorSelection_b;
00197 double _widthline;
00198
00199
00200
00201
00202 wxVtkBaseView *_wxvtkbaseview;
00203
00204
00205
00206
00207 bool _selected;
00208 bool *_editable;
00209 bool _posibleSelected;
00210 bool _viewControlPoints;
00211
00212
00213 bool _show_text;
00214 int _id_viewPoint_for_text;
00215 vtkTextActor *_textActor;
00216
00217
00218
00219
00220 manualBaseModel *_manContModel;
00221
00222 vtkPoints *_pts;
00223
00224 int _sizePointsContour;
00225
00226
00227
00228
00229
00230 std::vector<manualViewPoint*> _lstViewPoints;
00231
00232
00233
00234
00235 double _spc[3];
00236
00237 virtual void RefreshText();
00238
00239 };
00240
00241
00242 #endif // manualViewBaseContour_h