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 250 of file manualBaseModel.cpp.

References _lstPoints.

Referenced by AddPoint(), and CopyAttributesTo().

00251 {
00252         _lstPoints.push_back( theManualPoint );
00253 }

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 216 of file manualBaseModel.cpp.

References CopyAttributesTo(), and manualBaseModel().

Referenced by CopyAttributesTo().

00217 {
00218         manualBaseModel * clone = new manualBaseModel();
00219         CopyAttributesTo(clone);
00220         return clone;
00221 }

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 239 of file manualBaseModel.cpp.

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

Referenced by Clone().

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

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 91 of file manualBaseModel.cpp.

References _lstPoints.

Referenced by manualContourBaseControler::DeleteContour().

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

Here is the caller graph for this function:

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

Reimplemented in manualContourModel.

Definition at line 85 of file manualBaseModel.cpp.

References _lstPoints.

Referenced by manualContourBaseControler::DeleteActualMousePoint().

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

Here is the caller graph for this function:

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

Reimplemented in manualContourModel, and manualContourModelBullEye.

Definition at line 326 of file manualBaseModel.cpp.

00327 {
00328         std::vector<manualBaseModel*> lstTmp;
00329         lstTmp.push_back(this);
00330         return lstTmp;
00331 }

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

Reimplemented in manualContourModel.

Definition at line 128 of file manualBaseModel.cpp.

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

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

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

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 362 of file manualBaseModel.cpp.

Referenced by manualViewContour::RefreshText().

00363 {
00364         return "";
00365 }

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 338 of file manualBaseModel.cpp.

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

00339 {
00340 }

Here is the caller graph for this function:

int manualBaseModel::GetNumberOfPointsSpline (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 310 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().

00311 {
00312 
00313         //RaC 20-09-09 IF it's a points contour
00314         if(GetTypeModel()==7){
00315                 return _lstPoints.size();
00316         }
00317         return _sizePointsContour;
00318 }

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 334 of file manualBaseModel.cpp.

Referenced by manualViewContour::RefreshText().

00335 {
00336         return 0.0;
00337 }

Here is the caller graph for this function:

double manualBaseModel::GetPathSize (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 273 of file manualBaseModel.cpp.

Referenced by manualViewContour::RefreshText().

00274 {
00275         return 0.0;
00276 }

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 357 of file manualBaseModel.cpp.

00358 {
00359         return -1;
00360 }

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 282 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().

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

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 305 of file manualBaseModel.cpp.

00306 {
00307 }

int manualBaseModel::GetTypeModel (  )  [virtual]

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

Definition at line 224 of file manualBaseModel.cpp.

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

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

Here is the caller graph for this function:

bool manualBaseModel::IfCloseContour (  )  [virtual]

Reimplemented in manualContourModel.

Definition at line 344 of file manualBaseModel.cpp.

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

00345 {
00346         return false;
00347 }

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 
00071         InsertPoint_id(ibak,x,y,z);
00072 
00073         return ibak;
00074 }

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 76 of file manualBaseModel.cpp.

References _lstPoints, and manualPoint::SetPoint().

Referenced by InsertPoint().

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

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 185 of file manualBaseModel.cpp.

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

Referenced by ContourExtractData::isInside().

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

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 114 of file manualBaseModel.cpp.

References _lstPoints, and MovePoint().

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

Here is the call graph for this function:

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

Reimplemented in manualContourModel.

Definition at line 109 of file manualBaseModel.cpp.

00110 {
00111         // ToDo
00112 }

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

Reimplemented in manualContourModel.

Definition at line 100 of file manualBaseModel.cpp.

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

Referenced by MoveAllPoints().

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

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 255 of file manualBaseModel.cpp.

00256 {
00257 }

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

Reimplemented in manualContourModel.

Definition at line 366 of file manualBaseModel.cpp.

00367 {
00368 }

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

Reimplemented in manualContourModel, manualContourModelBullEye, and manualContourModelBullEyeSector.

Definition at line 258 of file manualBaseModel.cpp.

00259 {
00260 }

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

Reimplemented in manualContourModel.

Definition at line 262 of file manualBaseModel.cpp.

00263 {
00264 }

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

Reimplemented in manualContourModel.

Definition at line 341 of file manualBaseModel.cpp.

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

00342 {
00343 }

Here is the caller graph for this function:

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

Reimplemented in manualContourModel.

Definition at line 349 of file manualBaseModel.cpp.

00350 {
00351 }

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

Reimplemented in manualContourModel.

Definition at line 268 of file manualBaseModel.cpp.

References _sizePointsContour.

Referenced by manualRoiControler::Configure().

00269 {
00270         _sizePointsContour = size;
00271 }

Here is the caller graph for this function:

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

Reimplemented in manualContourModel.

Definition at line 353 of file manualBaseModel.cpp.

00354 {
00355 }

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

Reimplemented in manualContourModel.

Definition at line 278 of file manualBaseModel.cpp.

00279 {
00280 }

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 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1