manualBaseModel Class Reference

#include <manualBaseModel.h>

Inheritance diagram for manualBaseModel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 manualBaseModel ()
virtual ~manualBaseModel ()
virtual manualBaseModelClone ()
void CopyAttributesTo (manualBaseModel *cloneObject)
virtual void Open (FILE *ff)
virtual void Save (FILE *ff)
virtual int GetTypeModel ()
virtual void SetNumberOfPointsSpline (int size)
virtual int AddPoint (double x, double y, double z)
virtual int InsertPoint (double x, double y, double z)
virtual void InsertPoint_id (int id, double x, double y, double z)
virtual void AddManualPoint (manualPoint *theManualPoint)
virtual void DeletePoint (int i)
virtual void DeleteAllPoints ()
virtual void MovePoint (int i, double dx, double dy, double dz)
virtual void MoveLstPoints (double dx, double dy, double dz)
virtual void MoveAllPoints (double dx, double dy, double dz)
virtual int GetIdPoint (double x, double y, double z, int i_range, int type)
virtual manualPointGetManualPoint (int id)
virtual int GetSizeLstPoints ()
virtual double GetPathSize ()
virtual void Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
virtual void GetSpline_i_Point (int i, double *x, double *y, double *z)
virtual void GetSpline_t_Point (double t, double *x, double *y, double *z)
virtual int GetNumberOfPointsSpline ()
virtual void UpdateSpline ()
virtual std::vector
< manualBaseModel * > 
ExploseModel ()
virtual double GetPathArea ()
virtual void GetNearestPointAndNormal (double *p, double *rp, double *rn)
virtual void SetCloseContour (bool closeContour)
virtual bool IfCloseContour ()
int IsPoint (double x, double y)
virtual void SetLabel (std::string newLabel)
virtual void SetRealSize (double newRealSize)
virtual std::string GetLabel ()
virtual double GetRealSize ()
virtual void SaveData (FILE *ff)
virtual void OpenData (FILE *ff)

Protected Attributes

int _sizePointsContour
std::vector< manualPoint * > _lstPoints

Detailed Description

Definition at line 30 of file manualBaseModel.h.


Constructor & Destructor Documentation

manualBaseModel::manualBaseModel (  ) 

Definition at line 4 of file manualBaseModel.cpp.

References _sizePointsContour.

Referenced by Clone().

00005 {
00006 
00007         _sizePointsContour      = 100;                  //JSTG 25-02-08 The change in the inisialization of these variable is critical.
00008 
00009 }

Here is the caller graph for this function:

manualBaseModel::~manualBaseModel (  )  [virtual]

Definition at line 12 of file manualBaseModel.cpp.

References _lstPoints.

00013 {
00014         int i,size=_lstPoints.size();
00015         for (i=0;i<size; i++){
00016                 delete _lstPoints[i];
00017         }
00018         _lstPoints.clear();
00019 
00020 }


Member Function Documentation

void manualBaseModel::AddManualPoint ( manualPoint theManualPoint  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 246 of file manualBaseModel.cpp.

References _lstPoints.

Referenced by AddPoint(), and CopyAttributesTo().

00247 {
00248         _lstPoints.push_back( theManualPoint );
00249 }

Here is the caller graph for this function:

int manualBaseModel::AddPoint ( double  x,
double  y,
double  z 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 22 of file manualBaseModel.cpp.

References _lstPoints, AddManualPoint(), and manualPoint::SetPoint().

Referenced by manualContourBaseControler::AddPoint(), manualContour3VControler::AddPoint(), CutModelPolygon::InitializeContourModel(), manualContourBaseControler::InsertPoint(), manualContourContainer::refreshLumen(), and manualContourContainer::refreshWall().

00023 {
00024    manualPoint *mp = new manualPoint();
00025    mp->SetPoint(x,y,z);
00026    AddManualPoint(mp);
00027 
00028    return _lstPoints.size()-1;
00029 }

Here is the call graph for this function:

Here is the caller graph for this function:

manualBaseModel * manualBaseModel::Clone (  )  [virtual]

Reimplemented in manualContourModel, manualContourModelBullEye, manualContourModelBullEyeSector, manualContourModelCircle, manualContourModelLine, manualContourModelPolygon, manualContourModelRoi, and manualContourModelRotationTool.

Definition at line 213 of file manualBaseModel.cpp.

References CopyAttributesTo(), and manualBaseModel().

Referenced by CopyAttributesTo().

00214 {
00215         manualBaseModel * clone = new manualBaseModel();
00216         CopyAttributesTo(clone);
00217         return clone;
00218 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualBaseModel::CopyAttributesTo ( manualBaseModel cloneObject  ) 

Reimplemented in manualContourModel, manualContourModelBullEye, manualContourModelBullEyeSector, manualContourModelCircle, manualContourModelLine, manualContourModelPolygon, manualContourModelRoi, and manualContourModelRotationTool.

Definition at line 236 of file manualBaseModel.cpp.

References AddManualPoint(), Clone(), GetManualPoint(), and GetSizeLstPoints().

Referenced by Clone().

00237 {
00238         int i, size = GetSizeLstPoints();
00239         for( i=0; i<size; i++ )
00240         {
00241                 cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
00242         }
00243 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualBaseModel::DeleteAllPoints (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 90 of file manualBaseModel.cpp.

References _lstPoints.

Referenced by manualContourBaseControler::DeleteContour().

00091 {
00092         int i,size=_lstPoints.size();
00093         for (i=0;i<size;i++){
00094            _lstPoints.erase( _lstPoints.begin() );
00095         }
00096 }

Here is the caller graph for this function:

void manualBaseModel::DeletePoint ( int  i  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 84 of file manualBaseModel.cpp.

References _lstPoints.

Referenced by manualContourBaseControler::DeleteActualMousePoint().

00085 {
00086         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + i;
00087    _lstPoints.erase(itNum);
00088 }

Here is the caller graph for this function:

std::vector< manualBaseModel * > manualBaseModel::ExploseModel (  )  [virtual]

Reimplemented in manualContourModel, and manualContourModelBullEye.

Definition at line 321 of file manualBaseModel.cpp.

00322 {
00323         std::vector<manualBaseModel*> lstTmp;
00324         lstTmp.push_back(this);
00325         return lstTmp;
00326 }

int manualBaseModel::GetIdPoint ( double  x,
double  y,
double  z,
int  i_range,
int  type 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 126 of file manualBaseModel.cpp.

References _lstPoints, manualPoint::GetX(), manualPoint::GetY(), and manualPoint::GetZ().

Referenced by manualViewBaseContour::GetIdPoint(), manualView3VContour::GetIdPoint(), manualViewPoints::ifTouchContour(), and manualContourBaseControler::Magnet().

00127 {
00128         double range = i_range+1;
00129 
00130         double xx,yy,zz,dd,ddmin=9999999;
00131         int ibak=-1;
00132         int i,size=_lstPoints.size();
00133         for (i=0;i<size;i++){
00134                 manualPoint *mp=_lstPoints[i];
00135                 xx=mp->GetX();
00136                 yy=mp->GetY();
00137                 zz=mp->GetZ();
00138 
00139                 if (type==-1)
00140                 {
00141                         if ((fabs(xx-x)<range) && (fabs(yy-y)<range) && (fabs(zz-z)<range)) {
00142                            dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
00143                            if (dd<ddmin){
00144                                    ddmin=dd;
00145                                    ibak=i;
00146                            }
00147                         }
00148                 }
00149                 if (type==0)
00150                 {
00151                         if ((fabs(yy-y)<range) && (fabs(zz-z)<range)) {
00152                            dd=sqrt(   (yy-y)*(yy-y) + (zz-z)*(zz-z) );
00153                            if (dd<ddmin){
00154                                    ddmin=dd;
00155                                    ibak=i;
00156                            }
00157                         }
00158                 }
00159                 if (type==1)
00160                 {
00161                         if ((fabs(xx-x)<range) && (fabs(zz-z)<range)) {
00162                            dd=sqrt(   (xx-x)*(xx-x)  + (zz-z)*(zz-z) );
00163                            if (dd<ddmin){
00164                                    ddmin=dd;
00165                                    ibak=i;
00166                            }
00167                         }
00168                 }
00169                 if (type==2)
00170                 {
00171                         if ((fabs(xx-x)<range) && (fabs(yy-y)<range) ) {
00172                            dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y)  );
00173                            if (dd<ddmin){
00174                                    ddmin=dd;
00175                                    ibak=i;
00176                            }
00177                         }
00178                 }
00179         }
00180         return ibak;
00181 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string manualBaseModel::GetLabel (  )  [virtual]

Returns the label of the contour

Reimplemented in manualContourModel.

Definition at line 357 of file manualBaseModel.cpp.

Referenced by manualViewContour::RefreshText().

00358 {
00359         return "";
00360 }

Here is the caller graph for this function:

manualPoint * manualBaseModel::GetManualPoint ( int  id  )  [virtual]
void manualBaseModel::GetNearestPointAndNormal ( double *  p,
double *  rp,
double *  rn 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 333 of file manualBaseModel.cpp.

Referenced by manualContourPerpPlaneControler::ResetOrientationPlane(), and manualContour3DControler::ResetOrientationPlane().

00334 {
00335 }

Here is the caller graph for this function:

int manualBaseModel::GetNumberOfPointsSpline (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 305 of file manualBaseModel.cpp.

References _lstPoints, _sizePointsContour, and GetTypeModel().

Referenced by manualViewBaseContour::ConstructVTKObjects(), ContourExtractData::Fill_lstlstlstVecXY(), ContourExtractData::GetMinMaxPoint(), manualContourBaseControler::GetNumberOfPointsSplineManualContour(), manualViewPerpPlaneContour::RefreshContour(), manualViewContour::RefreshContour(), manualViewBullEyeSector::RefreshContour(), and manualView3VContour::RefreshContour().

00306 {
00307 
00308         //RaC 20-09-09 IF it's a points contour
00309         if(GetTypeModel()==7){
00310                 return _lstPoints.size();
00311         }
00312         return _sizePointsContour;
00313 }

Here is the call graph for this function:

Here is the caller graph for this function:

double manualBaseModel::GetPathArea (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 329 of file manualBaseModel.cpp.

Referenced by manualViewContour::RefreshText().

00330 {
00331         return 0.0;
00332 }

Here is the caller graph for this function:

double manualBaseModel::GetPathSize (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 270 of file manualBaseModel.cpp.

Referenced by manualViewContour::RefreshText().

00271 {
00272         return 0.0;
00273 }

Here is the caller graph for this function:

double manualBaseModel::GetRealSize (  )  [virtual]

Returns the real size in milimeters of the contour

Reimplemented in manualContourModel.

Definition at line 352 of file manualBaseModel.cpp.

00353 {
00354         return -1;
00355 }

int manualBaseModel::GetSizeLstPoints (  )  [virtual]
void manualBaseModel::GetSpline_i_Point ( int  i,
double *  x,
double *  y,
double *  z 
) [virtual]

Reimplemented in manualContourModel, manualContourModelBullEyeSector, manualContourModelCircle, manualContourModelPolygon, and manualContourModelRotationTool.

Definition at line 279 of file manualBaseModel.cpp.

References _lstPoints, GetTypeModel(), manualPoint::GetX(), manualPoint::GetY(), and manualPoint::GetZ().

Referenced by ContourExtractData::Fill_lstlstlstVecXY(), ContourExtractData::GetMinMaxPoint(), manualViewPerpPlaneContour::RefreshContour(), manualViewContour::RefreshContour(), and manualViewBullEyeSector::RefreshContour().

00280 {
00281         //RaC 20-09-09 IF it's a points contour
00282         if(GetTypeModel()==7){
00283                 if (_lstPoints.size()==0)
00284                 {
00285                         *x      = 0;
00286                         *y      = 0;
00287                         *z      = 0;
00288                 }
00289                 else
00290                 {
00291                         manualPoint     *mp;
00292                         mp      = _lstPoints[i];
00293                         *x      = mp->GetX();
00294                         *y      = mp->GetY();
00295                         *z      = mp->GetZ();
00296                 }
00297         }
00298 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualBaseModel::GetSpline_t_Point ( double  t,
double *  x,
double *  y,
double *  z 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 300 of file manualBaseModel.cpp.

00301 {
00302 }

int manualBaseModel::GetTypeModel (  )  [virtual]

Reimplemented in manualContourModel, manualContourModelBullEye, manualContourModelBullEyeSector, manualContourModelCircle, manualContourModelLine, manualContourModelPolygon, manualContourModelRoi, and manualContourModelRotationTool.

Definition at line 221 of file manualBaseModel.cpp.

Referenced by GetNumberOfPointsSpline(), GetSpline_i_Point(), and ContourExtractData::isInside().

00222 {
00223         // 0 spline
00224         // 1 spline
00225         // 2 rectangle
00226         // 3 circle
00227         // 4 BullEye
00228         // 5 BullEyeSector
00229         // 6 Line
00230         // 7 Points
00231         return 7;
00232 }

Here is the caller graph for this function:

bool manualBaseModel::IfCloseContour (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 339 of file manualBaseModel.cpp.

Referenced by manualViewContour::ifTouchContour(), manualView3VContour::ifTouchContour(), and manualViewContour::RefreshText().

00340 {
00341         return false;
00342 }

Here is the caller graph for this function:

int manualBaseModel::InsertPoint ( double  x,
double  y,
double  z 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 31 of file manualBaseModel.cpp.

References _lstPoints, and InsertPoint_id().

Referenced by manualContourBaseControler::InsertPoint(), and manualContour3VControler::InsertPoint().

00032 {
00033         double dd,ddmin=9999999;
00034         int    ibak=0;
00035         double xx,x1,x2;
00036         double yy,y1,y2;
00037         double zz,z1,z2;
00038         int i,ii,iii,size=_lstPoints.size();
00039         double j,MaxDivisions=20,porcentage;
00040         int sizeB=size;
00041 
00042         double jbak;
00043 
00044         for ( i=0 ; i<size ; i++ )
00045         {
00046                 ii=i % sizeB ;
00047                 iii=(i+1) % sizeB;
00048                 x1=_lstPoints[ii]->GetX();
00049                 y1=_lstPoints[ii]->GetY();
00050                 z1=_lstPoints[ii]->GetZ();
00051                 x2=_lstPoints[iii]->GetX();
00052                 y2=_lstPoints[iii]->GetY();
00053                 z2=_lstPoints[iii]->GetZ();
00054                 for (j=0; j<=MaxDivisions; j++)
00055                 {
00056                         porcentage=(j/MaxDivisions);
00057                         xx=(x2-x1)*porcentage+x1;
00058                         yy=(y2-y1)*porcentage+y1;
00059                         zz=(z2-z1)*porcentage+z1;
00060                         dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
00061                         if ( dd<ddmin )
00062                         {
00063                                 ddmin=dd;
00064                                 ibak=iii;
00065                                 jbak=j;
00066                         }
00067                 }
00068         }
00069 
00070         InsertPoint_id(ibak,x,y,z);
00071 
00072         return ibak;
00073 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualBaseModel::InsertPoint_id ( int  id,
double  x,
double  y,
double  z 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 75 of file manualBaseModel.cpp.

References _lstPoints, and manualPoint::SetPoint().

Referenced by InsertPoint().

00076 {
00077         manualPoint *mp = new manualPoint();
00078         mp->SetPoint(x,y,z);
00079         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + id;
00080         _lstPoints.insert(itNum,mp);
00081 }

Here is the call graph for this function:

Here is the caller graph for this function:

int manualBaseModel::IsPoint ( double  x,
double  y 
)

Definition at line 183 of file manualBaseModel.cpp.

References _lstPoints, manualPoint::GetX(), and manualPoint::GetY().

Referenced by ContourExtractData::isInside().

00184 {
00185         double xx,yy/*,zz*/;
00186         bool exists=false;
00187         int i,size=_lstPoints.size();
00188         for (i=0;i<size;i++){
00189                 manualPoint *mp=_lstPoints[i];
00190                 xx=mp->GetX();
00191                 yy=mp->GetY();
00192 
00193                 //RaC Be Careful!! Cast to have a point like the one in the params 27-09-09
00194                 if(x==(int)xx && y==(int)yy )
00195                 {
00196                         exists=true;
00197                 }
00198         }
00199         return exists;
00200 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualBaseModel::MoveAllPoints ( double  dx,
double  dy,
double  dz 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 113 of file manualBaseModel.cpp.

References _lstPoints, and MovePoint().

00114 {
00115         int i,size=_lstPoints.size();
00116         for (i=0;i<size;i++){
00117                 MovePoint(i,dx,dy,dz);
00118         }
00119 }

Here is the call graph for this function:

void manualBaseModel::MoveLstPoints ( double  dx,
double  dy,
double  dz 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 108 of file manualBaseModel.cpp.

00109 {
00110         // ToDo
00111 }

void manualBaseModel::MovePoint ( int  i,
double  dx,
double  dy,
double  dz 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 99 of file manualBaseModel.cpp.

References _lstPoints, manualPoint::GetX(), manualPoint::GetY(), manualPoint::GetZ(), and manualPoint::SetPoint().

Referenced by MoveAllPoints().

00100 {
00101         manualPoint *mp=_lstPoints[i];
00102         double x=mp->GetX()+dx;
00103         double y=mp->GetY()+dy;
00104         double z=mp->GetZ()+dz;
00105         mp->SetPoint(x,y,z);
00106 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualBaseModel::Open ( FILE *  ff  )  [virtual]

Reimplemented in manualContourModel, manualContourModelBullEye, and manualContourModelBullEyeSector.

Definition at line 251 of file manualBaseModel.cpp.

00252 {
00253 }

void manualBaseModel::OpenData ( FILE *  ff  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 361 of file manualBaseModel.cpp.

00362 {
00363 }

void manualBaseModel::Save ( FILE *  ff  )  [virtual]

Reimplemented in manualContourModel, manualContourModelBullEye, and manualContourModelBullEyeSector.

Definition at line 255 of file manualBaseModel.cpp.

00256 {
00257 }

void manualBaseModel::SaveData ( FILE *  ff  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 259 of file manualBaseModel.cpp.

00260 {
00261 }

void manualBaseModel::SetCloseContour ( bool  closeContour  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 336 of file manualBaseModel.cpp.

Referenced by manualContourControler::MouseClickLeft(), and manualContourBaseControler::MouseClickRight().

00337 {
00338 }

Here is the caller graph for this function:

void manualBaseModel::SetLabel ( std::string  newLabel  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 344 of file manualBaseModel.cpp.

00345 {
00346 }

void manualBaseModel::SetNumberOfPointsSpline ( int  size  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 265 of file manualBaseModel.cpp.

References _sizePointsContour.

Referenced by manualRoiControler::Configure().

00266 {
00267         _sizePointsContour = size;
00268 }

Here is the caller graph for this function:

void manualBaseModel::SetRealSize ( double  newRealSize  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 348 of file manualBaseModel.cpp.

00349 {
00350 }

void manualBaseModel::Transform_Ax_Plus_B ( double  Ax,
double  Bx,
double  Ay,
double  By 
) [virtual]

Reimplemented in manualContourModel.

Definition at line 275 of file manualBaseModel.cpp.

00276 {
00277 }

void manualBaseModel::UpdateSpline (  )  [virtual]

Member Data Documentation

std::vector<manualPoint*> manualBaseModel::_lstPoints [protected]

The documentation for this class was generated from the following files:

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1