manualContourModelBullEye Class Reference

#include <manualContourModelBullEye.h>

Inheritance diagram for manualContourModelBullEye:
Inheritance graph
[legend]
Collaboration diagram for manualContourModelBullEye:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 manualContourModelBullEye ()
virtual ~manualContourModelBullEye ()
virtual manualContourModelBullEyeClone ()
void CopyAttributesTo (manualContourModelBullEye *cloneObject)
virtual void Save (FILE *ff)
virtual void Open (FILE *ff)
int GetNumberOfPointsSplineSectorBulleEje ()
void SetNumberOfPointsSplineSectorBulleEje (int)
void AddSector (double radioA, double radioB, double ang, double angDelta)
void GetSector (int id, double *radioA, double *radioB, double *ang, double *angDelta)
manualContourModelBullEyeSectorGetModelSector (int id)
void ResetSectors ()
int GetSizeOfSectorLst ()
virtual void UpdateSpline ()
virtual std::vector
< manualBaseModel * > 
ExploseModel ()
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 Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
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 ()
int GetNumberOfPointsSpline ()
virtual void SetNumberOfPointsSpline (int size)
void SetCloseContour (bool closeContour)
bool IfCloseContour ()
virtual double GetPathSize ()
virtual double GetPathArea ()
void GetNearestPointAndNormal (double *p, double *rp, double *rn)
virtual void GetSpline_i_Point (int i, double *x, double *y, double *z)
void GetSpline_t_Point (double t, double *x, double *y, double *z)
void SetLabel (std::string newLabel)
void SetRealSize (double newRealSize)
std::string GetLabel ()
double GetRealSize ()
void SaveData (FILE *ff)
void OpenData (FILE *ff)
int IsPoint (double x, double y)

Public Attributes

bool _closeContour
vtkKochanekSpline * _cntSplineX
vtkKochanekSpline * _cntSplineY
vtkKochanekSpline * _cntSplineZ
double _delta_JSTG
double _realSize
std::string _label

Protected Attributes

int _sizePointsContour
std::vector< manualPoint * > _lstPoints

Private Member Functions

virtual int GetTypeModel ()

Private Attributes

int _numberPointsSlineBySector
std::vector
< manualContourModelBullEyeSector * > 
_lstModelBullEyeSector

Detailed Description

Definition at line 9 of file manualContourModelBullEye.h.


Constructor & Destructor Documentation

manualContourModelBullEye::manualContourModelBullEye (  ) 

Definition at line 8 of file manualContourModelBullEye.cpp.

References _numberPointsSlineBySector.

Referenced by Clone().

00009 : manualContourModel()
00010 {
00011         _numberPointsSlineBySector=101;   // impaire
00012 }

Here is the caller graph for this function:

manualContourModelBullEye::~manualContourModelBullEye (  )  [virtual]

Definition at line 14 of file manualContourModelBullEye.cpp.

00015 {
00016 }


Member Function Documentation

void manualContourModel::AddManualPoint ( manualPoint theManualPoint  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 704 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints.

Referenced by manualContourModel::AddPoint(), and manualContourModel::CopyAttributesTo().

00705 {
00706         _lstPoints.push_back( theManualPoint );
00707 }

Here is the caller graph for this function:

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

Reimplemented from manualBaseModel.

Definition at line 60 of file manualContourModel.cpp.

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

Referenced by AutoControlPoints::ChargeSpline(), manualViewContour::InitMove(), PropContour::method_Spline(), manualContourModel::Open(), and wxMaracasCoutourTool::SetControlPoints().

00061 {
00062    manualPoint *mp = new manualPoint();
00063    mp->SetPoint(x,y,z);
00064    AddManualPoint(mp);
00065    //UpdateSpline();
00066 
00067    return _lstPoints.size()-1;
00068 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualContourModelBullEye::AddSector ( double  radioA,
double  radioB,
double  ang,
double  angDelta 
)

Definition at line 54 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector, GetNumberOfPointsSplineSectorBulleEje(), manualContourModel::SetNumberOfPointsSpline(), and manualContourModelBullEyeSector::SetSector().

Referenced by creaContoursFactory::getContourModel(), and Open().

00058 {
00059         manualContourModelBullEyeSector *modelSector = new manualContourModelBullEyeSector();
00060         modelSector->SetSector(radioA,radioB,ang,angDelta);
00061         modelSector->SetNumberOfPointsSpline( this->GetNumberOfPointsSplineSectorBulleEje() );
00062         _lstModelBullEyeSector.push_back(modelSector);
00063 }

Here is the call graph for this function:

Here is the caller graph for this function:

manualContourModelBullEye * manualContourModelBullEye::Clone (  )  [virtual]

Reimplemented from manualContourModel.

Definition at line 20 of file manualContourModelBullEye.cpp.

References CopyAttributesTo(), and manualContourModelBullEye().

00021 {
00022         manualContourModelBullEye * clone = new manualContourModelBullEye();
00023         CopyAttributesTo(clone);
00024         return clone;
00025 }

Here is the call graph for this function:

void manualContourModelBullEye::CopyAttributesTo ( manualContourModelBullEye cloneObject  ) 

Reimplemented from manualContourModel.

Definition at line 29 of file manualContourModelBullEye.cpp.

Referenced by Clone().

00030 {
00031         // Fathers object
00032         manualContourModel::CopyAttributesTo(cloneObject);
00033 }

Here is the caller graph for this function:

void manualContourModel::DeleteAllPoints (  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 153 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints, and manualContourModel::UpdateSpline().

Referenced by AutoControlPoints::ChargeSpline(), manualViewContour::InitMove(), PropContour::method_Spline(), manualContourContainer::refreshLumen(), manualContourContainer::refreshWall(), and wxMaracasCoutourTool::SetControlPoints().

00154 {
00155         int i,size=_lstPoints.size();
00156         for (i=0;i<size;i++){
00157            _lstPoints.erase( _lstPoints.begin() );
00158         }
00159         this->UpdateSpline();
00160 }

Here is the call graph for this function:

Here is the caller graph for this function:

void manualContourModel::DeletePoint ( int  i  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 147 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints.

00148 {
00149         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + i;
00150    _lstPoints.erase(itNum);
00151 }

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

Reimplemented from manualContourModel.

Definition at line 157 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector.

00158 {
00159 //EED004
00160         std::vector<manualBaseModel*> lstTmp;
00161         int i,iSize=_lstModelBullEyeSector.size();
00162         for (i=0;i<iSize;i++)
00163         {
00164                 lstTmp.push_back( _lstModelBullEyeSector[i] );
00165         }
00166         return lstTmp;
00167 }

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

Reimplemented from manualBaseModel.

Definition at line 192 of file manualContourModel.cpp.

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

00193 {
00194         double range = i_range+1;
00195 
00196         double xx,yy,zz,dd,ddmin=9999999;
00197         int ibak=-1;
00198         int i,size=_lstPoints.size();
00199         for (i=0;i<size;i++){
00200                 manualPoint *mp=_lstPoints[i];
00201                 xx=mp->GetX();
00202                 yy=mp->GetY();
00203                 zz=mp->GetZ();
00204 
00205                 if (type==-1)
00206                 {
00207                         if ((fabs(xx-x)<range) && (fabs(yy-y)<range) && (fabs(zz-z)<range)) {
00208                            dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
00209                            if (dd<ddmin){
00210                                    ddmin=dd;
00211                                    ibak=i;
00212                            }
00213                         }
00214                 }
00215                 if (type==0)
00216                 {
00217                         if ((fabs(yy-y)<range) && (fabs(zz-z)<range)) {
00218                            dd=sqrt(   (yy-y)*(yy-y) + (zz-z)*(zz-z) );
00219                            if (dd<ddmin){
00220                                    ddmin=dd;
00221                                    ibak=i;
00222                            }
00223                         }
00224                 }
00225                 if (type==1)
00226                 {
00227                         if ((fabs(xx-x)<range) && (fabs(zz-z)<range)) {
00228                            dd=sqrt(   (xx-x)*(xx-x)  + (zz-z)*(zz-z) );
00229                            if (dd<ddmin){
00230                                    ddmin=dd;
00231                                    ibak=i;
00232                            }
00233                         }
00234                 }
00235                 if (type==2)
00236                 {
00237                         if ((fabs(xx-x)<range) && (fabs(yy-y)<range) ) {
00238                            dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y)  );
00239                            if (dd<ddmin){
00240                                    ddmin=dd;
00241                                    ibak=i;
00242                            }
00243                         }
00244                 }
00245         }
00246         return ibak;
00247 }

Here is the call graph for this function:

std::string manualContourModel::GetLabel (  )  [virtual, inherited]

Returns the label of the contour

Reimplemented from manualBaseModel.

Definition at line 750 of file manualContourModel.cpp.

References manualContourModel::_label.

Referenced by manualContourModel::SaveData().

00751 {
00752         return _label;
00753 }

Here is the caller graph for this function:

manualPoint * manualContourModel::GetManualPoint ( int  id  )  [virtual, inherited]
manualContourModelBullEyeSector * manualContourModelBullEye::GetModelSector ( int  id  ) 

Definition at line 66 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector.

Referenced by manualViewBullEye::ConstructVTKObjects().

00067 {
00068         return _lstModelBullEyeSector[id];
00069 }

Here is the caller graph for this function:

void manualContourModel::GetNearestPointAndNormal ( double *  p,
double *  rp,
double *  rn 
) [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 523 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints, manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSpline_i_Point(), and manualContourModel::UpdateSpline().

00524 {
00525         double  distMin=999999999;
00526         double  dist,dx,dy,dz;
00527         double  x1,y1,z1;
00528         double  x2,y2,z2;
00529         int             i,np,nps;
00530 
00531 //JSTG 25-02-08 -------------------
00532         //double  tback;
00533         int iback;
00534         //double        t,delta;
00535 //---------------------------------
00536 
00537         np      = _lstPoints.size( );
00538         if (np>=2)
00539         {
00540 // JSTG 25-02-08 ------------------------------------------
00541                 //nps           = 200;
00542                 nps = GetNumberOfPointsSpline();
00543                 //delta = ( double ) ( np  ) / ( double ) ( nps  );
00544                 UpdateSpline();
00545                 //GetSplinePoint(0,x1,y1,z1);
00546                 GetSpline_i_Point(0,&x1,&y1,&z1);
00547                 for( i = 0; i < nps; i++ )
00548                 {
00549                         //t = delta * (double)i;
00550                         //GetSplinePoint(t,x1,y1,z1);
00551                         GetSpline_i_Point(i,&x1,&y1,&z1);
00552 //----------------------------------------------------------
00553                         dx= x1-p[0];
00554                         dy= y1-p[1];
00555                         dz= z1-p[2];
00556                         dist = sqrt( dx*dx + dy*dy + dz*dz );
00557                         if (dist<distMin)
00558                         {
00559                                 distMin  = dist;
00560 //JSTG                  tback = t;
00561                                 iback = i;
00562                                 rp[0] = x1;
00563                                 rp[1] = y1;
00564                                 rp[2] = z1;
00565                                 rn[0] = x2-x1;
00566                                 rn[1] = y2-y1;
00567                                 rn[2] = z2-z1;
00568                         }
00569                         x2=x1;
00570                         y2=y1;
00571                         z2=z1;
00572                 }// for
00573 
00574 // JSTG 25-02-08 ------------------------------------------
00575                 //if (tback==0)
00576                 if (iback==0)
00577                 {
00578                         //t = delta * (double)1.0;
00579                         //GetSplinePoint(t,x1,y1,z1);
00580                         GetSpline_i_Point(i,&x1,&y1,&z1);
00581 //----------------------------------------------------------
00582                         rn[0]=rp[0]-x1;
00583                         rn[1]=rp[1]-y1;
00584                         rn[2]=rp[2]-z1;
00585                 }
00586         }
00587         else
00588         {
00589                 rp[0] = 0;
00590                 rp[1] = 0;
00591                 rp[2] = 0;
00592                 rn[0] = -1;
00593                 rn[1] = 0;
00594                 rn[2] = 0;
00595         }
00596 }

Here is the call graph for this function:

int manualContourModel::GetNumberOfPointsSpline (  )  [virtual, inherited]
int manualContourModelBullEye::GetNumberOfPointsSplineSectorBulleEje (  ) 

Definition at line 42 of file manualContourModelBullEye.cpp.

References _numberPointsSlineBySector.

Referenced by AddSector().

00043 {
00044         return _numberPointsSlineBySector;
00045 }

Here is the caller graph for this function:

double manualContourModel::GetPathArea (  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 442 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints, manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSpline_i_Point(), manualContourModel::IfCloseContour(), and manualContourModel::UpdateSpline().

00443 {
00444         double result = 555;
00445         if ((_lstPoints.size()>=3) && IfCloseContour()==true )
00446         {
00447                 double area;
00448 //JSTG 25-02-08 ---------------------------------------------
00449                 //double ti,tj;
00450 //-----------------------------------------------------------
00451                 double x1,y1,z1;
00452                 double x2,y2,z2;
00453                 bool okArea=true;
00454                 int i, j;
00455 
00456                 // This uses Green's theorem:
00457                 // A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN
00458                 // A < 0 -> A = |A| (a negative value could raise because points are
00459                 // given in clockwise order).
00460 
00461 //JSTG 25-02-08 -------------------------------------------------
00462                 //int np  = _lstPoints.size( );
00463                 //int nps = 200;
00464                 int nps = GetNumberOfPointsSpline();
00465                 //double delta=( double ) ( np  ) / ( double ) ( nps  );
00466                 UpdateSpline();
00467                 for( i = 0, area = 0.0; i < nps; i++ )
00468                 {
00469                         j = ( i + 1 ) % nps;
00470                         //ti = delta * (double)i;
00471                         //tj = delta * (double)j;
00472                         //GetSplinePoint(ti,x1,y1,z1);
00473                         //GetSplinePoint(tj,x2,y2,z2);
00474                         GetSpline_i_Point(i,&x1,&y1,&z1);
00475                         GetSpline_i_Point(j,&x2,&y2,&z2);
00476 //----------------------------------------------------------------
00477                         area +=
00478                                         (x1 * y2 ) -
00479                                         ( x2 * y1 );
00480                         if (z1!=z2)
00481                         {
00482                                 okArea=false;
00483                         }
00484                 }// for
00485                 area /= 2.0;
00486                 area = fabs( area );
00487 
00488 /*
00489                 for( i = 0, area = 0.0; i < _lstPoints.size(); i++ )
00490                 {
00491                         j = ( i + 1 ) % _lstPoints.size();
00492                         //  Area
00493                         area +=
00494                                         (_lstPoints[i]->GetX() * _lstPoints[j]->GetY() ) -
00495                                         ( _lstPoints[j]->GetX() * _lstPoints[i]->GetY() );
00496                         if (_lstPoints[0]->GetZ()!=_lstPoints[i]->GetZ())
00497                         {
00498                                 okArea=false;
00499                         }
00500                 } // rof
00501                 area /= 2.0;
00502                 area = fabs( area );
00503 */
00504 
00505                 if (okArea==true)
00506                 {
00507                         result = area;
00508                 } else {
00509                         result = -1;
00510                 }
00511 
00512         } else {
00513                 result = 0;
00514         }
00515         return result;
00516 }

Here is the call graph for this function:

double manualContourModel::GetPathSize (  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 392 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints, manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSpline_i_Point(), and manualContourModel::UpdateSpline().

Referenced by AutoControlPoints::ChargeSpline().

00393 {
00394         double result = 0;
00395         double x1,y1,z1;
00396         double x2,y2,z2;
00397 
00398 // JSTG 25-02-08 -----------------------------
00399         //double t,delta;
00400         //int i,np,nps;
00401         int i;
00402 //--------------------------------------------
00403 
00404         if (_lstPoints.size()==2)
00405         {
00406                 x1=_lstPoints[0]->GetX();
00407                 y1=_lstPoints[0]->GetY();
00408                 z1=_lstPoints[0]->GetZ();
00409                 x2=_lstPoints[1]->GetX();
00410                 y2=_lstPoints[1]->GetY();
00411                 z2=_lstPoints[1]->GetZ();
00412                 result = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
00413         }
00414         if (_lstPoints.size()>2)
00415         {
00416 
00417 // JSTG 25-02-08 ------------------------------------------
00418                 //np  = _lstPoints.size( );
00419                 //nps = 200;
00420                 //delta=( double ) ( np  ) / ( double ) ( nps  );
00421                 UpdateSpline();
00422                 //GetSplinePoint(0,x1,y1,z1);
00423                 GetSpline_i_Point(0,&x1,&y1,&z1);
00424 
00425                 //for( i = 1; i < nps; i++ )
00426                 for( i = 1; i < GetNumberOfPointsSpline(); i++ )
00427                 {
00428                         //t = delta * (double)i;
00429                         //GetSplinePoint(t,x2,y2,z2);
00430                         GetSpline_i_Point(i,&x2,&y2,&z2);
00431 //---------------------------------------------------------
00432                         result=result + sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
00433                         x1=x2;
00434                         y1=y2;
00435                         z1=z2;
00436                 }// for
00437         }
00438 
00439         return result;
00440 }

Here is the call graph for this function:

Here is the caller graph for this function:

double manualContourModel::GetRealSize (  )  [virtual, inherited]

Returns the real size in milimeters of the contour

Reimplemented from manualBaseModel.

Definition at line 745 of file manualContourModel.cpp.

References manualContourModel::_realSize.

Referenced by manualContourModel::SaveData().

00746 {
00747         return _realSize;
00748 }

Here is the caller graph for this function:

void manualContourModelBullEye::GetSector ( int  id,
double *  radioA,
double *  radioB,
double *  ang,
double *  angDelta 
)

Definition at line 72 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector.

00077 {
00078         _lstModelBullEyeSector[id]->GetSector(radioA,radioB,ang,angDelta);
00079 }

int manualContourModel::GetSizeLstPoints (  )  [virtual, inherited]
int manualContourModelBullEye::GetSizeOfSectorLst (  ) 

Definition at line 116 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector.

Referenced by manualViewBullEye::ConstructVTKObjects(), and Save().

00117 {
00118         return _lstModelBullEyeSector.size();
00119 }

Here is the caller graph for this function:

void manualContourModel::GetSpline_i_Point ( int  i,
double *  x,
double *  y,
double *  z 
) [virtual, inherited]
void manualContourModel::GetSpline_t_Point ( double  t,
double *  x,
double *  y,
double *  z 
) [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 341 of file manualContourModel.cpp.

References manualContourModel::_cntSplineX, manualContourModel::_cntSplineY, manualContourModel::_cntSplineZ, manualBaseModel::_lstPoints, manualContourModel::GetManualPoint(), manualPoint::GetX(), manualPoint::GetY(), and manualPoint::GetZ().

Referenced by manualContourModel::GetSpline_i_Point().

00342 {
00343                 if (_lstPoints.size()==0)
00344         {
00345                 *x      = 0;
00346                 *y      = 0;
00347                 *z      = 0;
00348         }
00349         if (_lstPoints.size()==1)
00350         {
00351                 manualPoint     *mp;
00352                 mp      = GetManualPoint(0);
00353                 *x      = mp->GetX();
00354                 *y      = mp->GetY();
00355                 *z      = mp->GetZ();
00356         }
00357         if (_lstPoints.size()>=2)
00358         {
00359                 *x      = _cntSplineX->Evaluate(t);
00360                 *y      = _cntSplineY->Evaluate(t);
00361                 *z      = _cntSplineZ->Evaluate(t);
00362         }
00363 }

Here is the call graph for this function:

Here is the caller graph for this function:

int manualContourModelBullEye::GetTypeModel (  )  [private, virtual]

Reimplemented from manualContourModel.

Definition at line 36 of file manualContourModelBullEye.cpp.

00037 {
00038         return 4;
00039 }

bool manualContourModel::IfCloseContour (  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 288 of file manualContourModel.cpp.

References manualContourModel::_closeContour.

Referenced by manualContourModel::CopyAttributesTo(), and manualContourModel::GetPathArea().

00289 {
00290         return _closeContour;
00291 }

Here is the caller graph for this function:

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

Reimplemented from manualBaseModel.

Definition at line 70 of file manualContourModel.cpp.

References manualContourModel::_closeContour, manualBaseModel::_lstPoints, and manualContourModel::InsertPoint_id().

00071 {
00072         double dd,ddmin=9999999;
00073         int    ibak=0;
00074         double xx,x1,x2;
00075         double yy,y1,y2;
00076         double zz,z1,z2;
00077         int i,ii,iii,size=_lstPoints.size();
00078         double j,MaxDivisions=20,porcentage;
00079         int sizeB=size;
00080 
00081         if (_closeContour==false)
00082         {
00083                 size=size-1;
00084         }
00085 
00086         double jbak;
00087 
00088         for ( i=0 ; i<size ; i++ )
00089         {
00090                 ii=i % sizeB ;
00091                 iii=(i+1) % sizeB;
00092                 x1=_lstPoints[ii]->GetX();
00093                 y1=_lstPoints[ii]->GetY();
00094                 z1=_lstPoints[ii]->GetZ();
00095                 x2=_lstPoints[iii]->GetX();
00096                 y2=_lstPoints[iii]->GetY();
00097                 z2=_lstPoints[iii]->GetZ();
00098                 for (j=0; j<=MaxDivisions; j++)
00099                 {
00100                         porcentage=(j/MaxDivisions);
00101                         xx=(x2-x1)*porcentage+x1;
00102                         yy=(y2-y1)*porcentage+y1;
00103                         zz=(z2-z1)*porcentage+z1;
00104                         dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
00105                         if ( dd<ddmin )
00106                         {
00107                                 ddmin=dd;
00108                                 ibak=iii;
00109                                 jbak=j;
00110                         }
00111                 }
00112         }
00113 
00114         if (_closeContour==false)
00115         {
00116                 if ( (ibak==1) && (jbak==0) )
00117                 {
00118                         ibak=0;
00119                 }
00120                 if ( ( ibak==size ) && ( jbak==MaxDivisions ) )
00121                 {
00122                         ibak=sizeB;
00123                 }
00124         }
00125 
00126 
00127 //JSTG - 25-04-08 ----------------------------------------------------------
00128         //manualPoint *mp = new manualPoint();
00129         //mp->SetPoint(x,y,z);
00130         //std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + ibak;
00131         //_lstPoints.insert(itNum,mp);
00132         InsertPoint_id(ibak,x,y,z);
00133 //----------------------------------------------------------------------------
00134 
00135         return ibak;
00136 }

Here is the call graph for this function:

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

Reimplemented from manualBaseModel.

Definition at line 138 of file manualContourModel.cpp.

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

Referenced by manualContourModel::InsertPoint().

00139 {
00140         manualPoint *mp = new manualPoint();
00141         mp->SetPoint(x,y,z);
00142         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + id;
00143         _lstPoints.insert(itNum,mp);
00144 }

Here is the call graph for this function:

Here is the caller graph for this function:

int manualBaseModel::IsPoint ( double  x,
double  y 
) [inherited]

Definition at line 185 of file manualBaseModel.cpp.

References manualBaseModel::_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 manualContourModel::MoveAllPoints ( double  dx,
double  dy,
double  dz 
) [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 177 of file manualContourModel.cpp.

References manualBaseModel::_lstPoints, and manualContourModel::MovePoint().

00178 {
00179         int i,size=_lstPoints.size();
00180         for (i=0;i<size;i++){
00181                 MovePoint(i,dx,dy,dz);
00182         }
00183 }

Here is the call graph for this function:

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

Reimplemented from manualBaseModel.

Definition at line 172 of file manualContourModel.cpp.

00173 {
00174         // ToDo
00175 }

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

Reimplemented from manualBaseModel.

Definition at line 163 of file manualContourModel.cpp.

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

Referenced by manualContourModel::MoveAllPoints().

00164 {
00165         manualPoint *mp=_lstPoints[i];
00166         double x=mp->GetX()+dx;
00167         double y=mp->GetY()+dy;
00168         double z=mp->GetZ()+dz;
00169         mp->SetPoint(x,y,z);
00170 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from manualContourModel.

Definition at line 134 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector, AddSector(), and ResetSectors().

00135 {
00136         manualContourModel::Open(ff);
00137 
00138         ResetSectors();
00139 
00140         char tmp[255];
00141         int i;
00142         int numberOfSections;
00143 //      double radioA,radioB,ang,deltaAng;
00144 
00145         fscanf(ff,"%s",tmp); // NumberOfSections
00146         fscanf(ff,"%s",tmp); // ##
00147         numberOfSections = atoi(tmp);
00148         for (i=0;i<numberOfSections;i++)
00149         {
00150                 AddSector(0,1,90,0);
00151                 _lstModelBullEyeSector[i]->Open(ff);
00152         }
00153 
00154 }

Here is the call graph for this function:

void manualContourModel::OpenData ( FILE *  ff  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 665 of file manualContourModel.cpp.

References manualContourModel::SetLabel(), and manualContourModel::SetRealSize().

00666 {
00667         char tmp[255];
00668 
00669         fscanf(ff,"%s",tmp); // Label:
00670         fscanf(ff,"%s",tmp); // value
00671         std::cout<<tmp<<std::endl;
00672         if(tmp != "NO_LABEL")
00673                 SetLabel(tmp);
00674 
00675         fscanf(ff,"%s",tmp); // Real_size
00676         fscanf(ff,"%s",tmp);// #
00677 
00678         //tmp.ToDouble(&tmp);
00679         SetRealSize(atof(tmp));
00680 }

Here is the call graph for this function:

void manualContourModelBullEye::ResetSectors (  ) 

Definition at line 105 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector.

Referenced by Open().

00106 {
00107         int i,size=_lstModelBullEyeSector.size();
00108         for (i=0;i<size;i++)
00109         {
00110                 delete _lstModelBullEyeSector[i];
00111         }
00112         _lstModelBullEyeSector.clear();
00113 }

Here is the caller graph for this function:

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

Reimplemented from manualContourModel.

Definition at line 122 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector, and GetSizeOfSectorLst().

00123 {
00124         manualContourModel::Save(ff);
00125         int i,size = GetSizeOfSectorLst();
00126         fprintf(ff,"numberOfSections %d \n",size);
00127         for ( i=0 ; i<size ; i++ )
00128         {
00129                 _lstModelBullEyeSector[i]->Save(ff);
00130         }
00131 }

Here is the call graph for this function:

void manualContourModel::SaveData ( FILE *  ff  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 655 of file manualContourModel.cpp.

References manualContourModel::GetLabel(), and manualContourModel::GetRealSize().

00656 {
00657         std::string etiqueta = GetLabel();
00658         if(etiqueta.empty())
00659                 fprintf(ff,"Label: NO_LABEL\n");
00660         else
00661                 fprintf(ff,"Label: %s\n",etiqueta.c_str());
00662         fprintf(ff,"Real_Size: %f\n",GetRealSize());
00663 }

Here is the call graph for this function:

void manualContourModel::SetCloseContour ( bool  closeContour  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 272 of file manualContourModel.cpp.

References manualContourModel::_closeContour, manualContourModel::_cntSplineX, manualContourModel::_cntSplineY, and manualContourModel::_cntSplineZ.

Referenced by AutoControlPoints::ChargeSpline(), wxManualTree_MPRWidget::ConfigureContour(), manualContourModel::CopyAttributesTo(), manualContourModel::manualContourModel(), manualContourModelLine::manualContourModelLine(), PropContour::method_Spline(), and wxWidgetMesure2D::OnCloseContour().

00273 {
00274         _closeContour = closeContour;
00275         if (_closeContour==true)
00276         {
00277                 _cntSplineX->ClosedOn();
00278                 _cntSplineY->ClosedOn();
00279                 _cntSplineZ->ClosedOn();
00280         } else {
00281                 _cntSplineX->ClosedOff();
00282                 _cntSplineY->ClosedOff();
00283                 _cntSplineZ->ClosedOff();
00284         }
00285 }

Here is the caller graph for this function:

void manualContourModel::SetLabel ( std::string  newLabel  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 735 of file manualContourModel.cpp.

References manualContourModel::_label.

Referenced by manualContourModel::OpenData().

00736 {
00737         _label = newLabel;
00738 }

Here is the caller graph for this function:

void manualContourModel::SetNumberOfPointsSpline ( int  size  )  [virtual, inherited]
void manualContourModelBullEye::SetNumberOfPointsSplineSectorBulleEje ( int  numpoints  ) 

Definition at line 48 of file manualContourModelBullEye.cpp.

References _numberPointsSlineBySector.

00049 {
00050         this->_numberPointsSlineBySector = numpoints;
00051 }

void manualContourModel::SetRealSize ( double  newRealSize  )  [virtual, inherited]

Reimplemented from manualBaseModel.

Definition at line 740 of file manualContourModel.cpp.

References manualContourModel::_realSize.

Referenced by manualContourModel::OpenData().

00741 {
00742         _realSize = newRealSize;
00743 }

Here is the caller graph for this function:

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

Reimplemented from manualBaseModel.

Definition at line 718 of file manualContourModel.cpp.

References manualContourModel::GetManualPoint(), manualContourModel::GetSizeLstPoints(), manualPoint::GetX(), manualPoint::GetY(), manualPoint::SetPointX(), and manualPoint::SetPointY().

00719 {
00720         manualPoint * mp;
00721 
00722         int i, size = GetSizeLstPoints();
00723 
00724         for( i=0; i<size; i++ )
00725         {
00726                 mp = GetManualPoint( i );
00727 
00728                 mp->SetPointX( mp->GetX()*Ax + Bx );
00729                 mp->SetPointY( mp->GetY()*Ay + By );
00730         }
00731 }

Here is the call graph for this function:

void manualContourModelBullEye::UpdateSpline (  )  [virtual]

Reimplemented from manualContourModel.

Definition at line 81 of file manualContourModelBullEye.cpp.

References _lstModelBullEyeSector, manualContourModel::GetManualPoint(), manualContourModel::GetSizeLstPoints(), manualPoint::GetX(), and manualPoint::GetY().

00082 {
00083         manualContourModel::UpdateSpline();
00084 
00085         if (this->GetSizeLstPoints()>2){
00086                 double cx,cy;
00087                 double ww,hh;
00088                 manualPoint *mpA = GetManualPoint(0);
00089                 manualPoint *mpB = GetManualPoint(2);
00090                 cx = (mpA->GetX() + mpB->GetX()) / 2.0;
00091                 cy = (mpA->GetY() + mpB->GetY()) / 2.0;
00092                 ww = fabs( mpA->GetX() - mpB->GetX() )/2.0;
00093                 hh = fabs( mpA->GetY() - mpB->GetY() )/2.0;
00094                 int i,size = _lstModelBullEyeSector.size();
00095                 for (i=0;i<size;i++)
00096                 {
00097                         _lstModelBullEyeSector[i]->SetCenter(cx,cy);
00098                         _lstModelBullEyeSector[i]->SetSize(ww,hh);
00099                 } // for
00100         }
00101 }

Here is the call graph for this function:


Member Data Documentation

vtkKochanekSpline* manualContourModel::_cntSplineX [inherited]
vtkKochanekSpline* manualContourModel::_cntSplineY [inherited]
vtkKochanekSpline* manualContourModel::_cntSplineZ [inherited]
double manualContourModel::_delta_JSTG [inherited]
std::string manualContourModel::_label [inherited]

Represents the label associated with the contour

Definition at line 151 of file manualContourModel.h.

Referenced by manualContourModel::GetLabel(), manualContourModel::manualContourModel(), and manualContourModel::SetLabel().

std::vector<manualPoint*> manualBaseModel::_lstPoints [protected, inherited]
double manualContourModel::_realSize [inherited]

Represents the real size in milimeters of the contour

Definition at line 146 of file manualContourModel.h.

Referenced by manualContourModel::GetRealSize(), manualContourModel::manualContourModel(), and manualContourModel::SetRealSize().

int manualBaseModel::_sizePointsContour [protected, inherited]

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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1