manualContourModel.h

Go to the documentation of this file.
00001 #ifndef manualContourModel_h
00002 #define manualContourModel_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 
00018 
00019 #include <vtkCamera.h> 
00020 #include <vtkPolyLine.h>
00021 #include <vtkDataSetMapper.h>
00022 #include <vtkUnstructuredGrid.h>
00023 
00024 #include "wxVTKRenderWindowInteractor.h"
00025 
00026 
00027 //--
00028 
00029 #include <vector>
00030 #include "wxVtkBaseView.h"
00031 #include "marTypes.h"
00032 #include "manualPoint.h"
00033 #include "manualBaseModel.h"
00034 
00035 
00036 // ----------------------------------------------------------------------------
00037 // ----------------------------------------------------------------------------
00038 // ----------------------------------------------------------------------------
00039 
00040 
00041 class creaMaracasVisu_EXPORT manualContourModel : public manualBaseModel
00042 {
00043 public:
00044         manualContourModel();
00045         virtual ~manualContourModel();
00046 
00047         virtual manualContourModel * Clone();
00048         void CopyAttributesTo( manualContourModel *cloneObject );
00049         void Open(FILE *ff);    // virtual
00050         virtual void Save(FILE *ff);    // virtual
00051         virtual int GetTypeModel();                     // virtual 
00052 
00053         virtual int                             AddPoint(double x,double y,double z);
00054         virtual int                             InsertPoint(double x,double y,double z);
00055 //JSTG 25-04-08 -------------------------------------------------------
00056         virtual void                    InsertPoint_id(int id, double x,double y,double z);
00057 //---------------------------------------------------------------------
00058         virtual void                    AddManualPoint( manualPoint* theManualPoint );
00059         virtual void                    Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
00060 
00061         virtual void                    DeletePoint(int i);
00062         virtual void                    DeleteAllPoints();
00063 
00064         virtual void                    MovePoint(int i,double dx,double dy,double dz);
00065         virtual void                    MoveLstPoints(double dx,double dy,double dz);
00066         virtual void                    MoveAllPoints(double dx,double dy,double dz);
00067 
00068         virtual int                             GetIdPoint(double x, double y, double z, int i_range,int type);
00069         virtual manualPoint*    GetManualPoint(int id);
00070         virtual int                             GetSizeLstPoints();
00071         int                             GetNumberOfPointsSpline();
00072         virtual void                    SetNumberOfPointsSpline(int size);
00073 
00074         virtual void    UpdateSpline();
00075         void                    SetCloseContour(bool closeContour);
00076         bool                    IfCloseContour();
00077 //JSTG 25-02-08 -----------------------------------------------------------------
00078         //void                  GetSplinePoint(double t, double &x, double &y, double &z);      //Method Original
00079         //void                  GetSplineiPoint(int i, double &x, double &y, double &z);        //Method Original
00080 //-------------------------------------------------------------------------------
00081         virtual double                  GetPathSize();
00082         virtual double                  GetPathArea();
00083 
00084         void                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
00085         
00086 // JSTG 25-02-08 -----------------------------------------------------------------
00087         virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
00088         void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
00089 //--------------------------------------------------------------------------------
00090 
00091         virtual std::vector<manualBaseModel*> ExploseModel(  );
00092 
00093 // CMRU 17-08-09 -----------------------------------------------------------------
00094         
00095         /*
00096         * Assigns the parameter value to the label
00097         * @param newLabel New label of the contour
00098         */
00099         void SetLabel(std::string newLabel);
00100         
00101         /*
00102         * Assigns the parameter value to the real size
00103         * @param newRealSize New real size in milimeters of the contour
00104         */
00105         void SetRealSize(double newRealSize);
00106         
00110         std::string GetLabel();
00111 
00115         double GetRealSize();
00116         
00117         /*
00118         * Saves the label and the real size of the contour
00119         * @param ff File where the information is stored 
00120         */
00121         void SaveData(FILE *ff);
00122 
00123         /*
00124         * Reads and interprets the information of the label and the real size
00125         * @param ff File where the information is readed 
00126         */
00127         void OpenData(FILE *ff);
00128 //--------------------------------------------------------------------------------
00129 
00130 //public:
00131         //int                                                   _sizePointsContour;
00132         //std::vector<manualPoint*>     _lstPoints;
00133         bool                                            _closeContour;
00134     vtkKochanekSpline                   *_cntSplineX;
00135     vtkKochanekSpline                   *_cntSplineY;
00136     vtkKochanekSpline                   *_cntSplineZ;
00137 
00138 //JSTG 25-02-08 ----------------------------------------
00139         double                  _delta_JSTG;
00140 //------------------------------------------------------
00141 
00142 //CMRU 17-08-09 -----------------------------------------------------------------
00146         double                  _realSize;
00147 
00151         std::string             _label;
00152 //--------------------------------------------------------------------------------
00153 
00154 }; 
00155 
00156 
00157 #endif // manualContourModel_h

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1