manualBaseModel.h

Go to the documentation of this file.
00001 #ifndef manualBaseModel_h
00002 #define manualBaseModel_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 <vtkCellPicker.h> 
00015 #include <vtkCamera.h> 
00016 #include <vtkPolyLine.h>
00017 #include <vtkDataSetMapper.h>
00018 #include <vtkUnstructuredGrid.h>
00019 
00020 #include "wxVTKRenderWindowInteractor.h"
00021 
00022 #include <vector>
00023 #include "wxVtkBaseView.h"
00024 #include "marTypes.h"
00025 #include "manualPoint.h"
00026 
00027 // --------------------------------------------------------------------------------------------
00028 // Includes the functionality to manage a contour without the spline line usage
00029 // @author RaC 09-09
00030 class creaMaracasVisu_EXPORT manualBaseModel
00031 {
00032 public:
00033         manualBaseModel();
00034         virtual ~manualBaseModel();
00035 
00036         virtual manualBaseModel * Clone();
00037         void CopyAttributesTo( manualBaseModel *cloneObject );
00038         virtual void Open(FILE *ff);    // virtual
00039         virtual void Save(FILE *ff);    // virtual
00040         virtual int GetTypeModel();                     // virtual 
00041         
00042         virtual void                    SetNumberOfPointsSpline(int size);
00043 
00044         virtual int                             AddPoint(double x,double y,double z);
00045         virtual int                             InsertPoint(double x,double y,double z);
00046         virtual void                    InsertPoint_id(int id, double x,double y,double z);
00047         virtual void                    AddManualPoint( manualPoint* theManualPoint );
00048         virtual void                    DeletePoint(int i);
00049         virtual void                    DeleteAllPoints();
00050 
00051         virtual void                    MovePoint(int i,double dx,double dy,double dz);
00052         virtual void                    MoveLstPoints(double dx,double dy,double dz);
00053         virtual void                    MoveAllPoints(double dx,double dy,double dz);
00054 
00055         // Returns the id of the point in the coordinates and the i_range given, according to the type
00056         // which corresponds to the plane where it's necessary to find the point.
00057         // @param type=-1  x,y,z - type=0 y,z - type=1  x,z - type=2    x,y
00058         // @return int - Returns the id of the point in the coordinates given. Returns -1 otherwise.
00059         virtual int                             GetIdPoint(double x, double y, double z, int i_range,int type);
00060         virtual manualPoint*    GetManualPoint(int id);
00061         virtual int                             GetSizeLstPoints();
00062         virtual double                  GetPathSize();
00063         virtual void                    Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
00064         virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
00065         virtual void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
00066 
00067         //
00068         // Returns the number of points of the spline line, but not the contour control points
00069         // @return int - spline points size
00070         //
00071         virtual int                             GetNumberOfPointsSpline();
00072         virtual void    UpdateSpline();
00073 
00074         //
00075         // Returns a list with the actual model
00076         // @return std::vector<manualBaseModel*>
00077         //
00078         virtual std::vector<manualBaseModel*> ExploseModel(  );
00079         virtual double                  GetPathArea();
00080         virtual void                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
00081 
00082         virtual void                    SetCloseContour(bool closeContour);
00083         virtual bool                    IfCloseContour();
00084 
00085         // RaC 27-09-09 ----
00086 
00087         //
00088         // Returns true if the point with the coordinates in parameters is one of the points in
00089         // the list of points of the model,
00090         // @param x double
00091         // @param y double
00092         // @return true if the point with the coordinates in parameters is one of the points, false otherwise
00093         //
00094         int     IsPoint(double x, double y);
00095 
00096         // CMRU 17-08-09 -----------------------------------------------------------------
00097         
00098         /*
00099         * Assigns the parameter value to the label
00100         * @param newLabel New label of the contour
00101         */
00102         virtual void SetLabel(std::string newLabel);
00103         
00104         /*
00105         * Assigns the parameter value to the real size
00106         * @param newRealSize New real size in milimeters of the contour
00107         */
00108         virtual void SetRealSize(double newRealSize);
00109         
00113         virtual std::string GetLabel();
00114 
00118         virtual double GetRealSize();
00119         
00120         /*
00121         * Saves the label and the real size of the contour
00122         * @param ff File where the information is stored 
00123         */
00124         virtual void SaveData(FILE *ff);
00125  
00126         /*
00127         * Reads and interprets the information of the label and the real size
00128         * @param ff File where the information is readed 
00129         */
00130         virtual void OpenData(FILE *ff);
00131 
00132 protected:
00133         int                                                     _sizePointsContour;
00134         std::vector<manualPoint*>       _lstPoints;
00135 
00136 }; 
00137 
00138 
00139 #endif // manualBaseModel_h

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1