manualContourModelBullEyeSector Class Reference

#include <manualContourModelBullEyeSector.h>

Inheritance diagram for manualContourModelBullEyeSector:

Inheritance graph
[legend]
Collaboration diagram for manualContourModelBullEyeSector:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 manualContourModelBullEyeSector ()
virtual ~manualContourModelBullEyeSector ()
virtual
manualContourModelBullEyeSector
Clone ()
void CopyAttributesTo (manualContourModelBullEyeSector *cloneObject)
void SetSector (double radioA, double radioB, double ang, double angDelta)
void GetSector (double *radioA, double *radioB, double *ang, double *angDelta)
void SetSize (double ww, double hh)
void SetCenter (double cx, double cy)
virtual void GetSpline_i_Point (int i, double *x, double *y, double *z)
virtual void Save (FILE *ff)
virtual void Open (FILE *ff)
void CopyAttributesTo (manualContourModel *cloneObject)
int AddPoint (double x, double y, double z)
int InsertPoint (double x, double y, double z)
void InsertPoint_id (int id, double x, double y, double z)
void AddManualPoint (manualPoint *theManualPoint)
void Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
void DeletePoint (int i)
void DeleteAllPoints ()
void MovePoint (int i, double dx, double dy, double dz)
void MoveLstPoints (double dx, double dy, double dz)
void MoveAllPoints (double dx, double dy, double dz)
int GetIdPoint (double x, double y, double z, int i_range, int type)
manualPointGetManualPoint (int id)
int GetSizeLstPoints ()
int GetNumberOfPointsSpline ()
void SetNumberOfPointsSpline (int size)
virtual void UpdateSpline ()
void SetCloseContour (bool closeContour)
bool IfCloseContour ()
double GetPathSize ()
double GetPathArea ()
void GetNearestPointAndNormal (double *p, double *rp, double *rn)
void GetSpline_t_Point (double t, double *x, double *y, double *z)
virtual std::vector
< manualContourModel * > 
ExploseModel ()

Private Member Functions

virtual int GetTypeModel ()

Private Attributes

double _radioA
double _radioB
double _ang
double _angDelta
double _ww
double _hh
double _cx
double _cy


Detailed Description

Definition at line 9 of file manualContourModelBullEyeSector.h.


Constructor & Destructor Documentation

manualContourModelBullEyeSector::manualContourModelBullEyeSector (  ) 

Definition at line 8 of file manualContourModelBullEyeSector.cpp.

Referenced by Clone().

00009 : manualContourModel()
00010 {
00011 }

Here is the caller graph for this function:

manualContourModelBullEyeSector::~manualContourModelBullEyeSector (  )  [virtual]

Definition at line 13 of file manualContourModelBullEyeSector.cpp.

00014 {
00015 }


Member Function Documentation

manualContourModelBullEyeSector * manualContourModelBullEyeSector::Clone (  )  [virtual]

Reimplemented from manualContourModel.

Definition at line 19 of file manualContourModelBullEyeSector.cpp.

References CopyAttributesTo(), and manualContourModelBullEyeSector().

00020 {
00021         manualContourModelBullEyeSector * clone = new manualContourModelBullEyeSector();
00022         CopyAttributesTo(clone);
00023         return clone;
00024 }

Here is the call graph for this function:

void manualContourModelBullEyeSector::CopyAttributesTo ( manualContourModelBullEyeSector cloneObject  ) 

Definition at line 28 of file manualContourModelBullEyeSector.cpp.

References manualContourModel::CopyAttributesTo().

Referenced by Clone().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void manualContourModelBullEyeSector::SetSector ( double  radioA,
double  radioB,
double  ang,
double  angDelta 
)

Definition at line 42 of file manualContourModelBullEyeSector.cpp.

References _ang, _angDelta, _radioA, and _radioB.

Referenced by manualContourModelBullEye::AddSector().

00046 {
00047         _radioA         = radioA;
00048         _radioB         = radioB;
00049         _ang            = ang*3.14159265/180.0;
00050         _angDelta       = angDelta*3.14159265/180.0;
00051 }

Here is the caller graph for this function:

void manualContourModelBullEyeSector::GetSector ( double *  radioA,
double *  radioB,
double *  ang,
double *  angDelta 
)

Definition at line 54 of file manualContourModelBullEyeSector.cpp.

References _ang, _angDelta, _radioA, and _radioB.

00059 {
00060         *radioA         = _radioA;
00061         *radioB         = _radioB;
00062         *ang            = _ang;
00063         *angDelta       = _angDelta;
00064 }

void manualContourModelBullEyeSector::SetSize ( double  ww,
double  hh 
)

Definition at line 74 of file manualContourModelBullEyeSector.cpp.

References _hh, and _ww.

00075 {
00076         _ww = ww;
00077         _hh = hh;
00078 }

void manualContourModelBullEyeSector::SetCenter ( double  cx,
double  cy 
)

Definition at line 67 of file manualContourModelBullEyeSector.cpp.

References _cx, and _cy.

00068 {
00069         _cx = cx;
00070         _cy = cy;
00071 }

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

Reimplemented from manualContourModel.

Definition at line 81 of file manualContourModelBullEyeSector.cpp.

References _ang, _angDelta, _cx, _cy, _hh, _radioA, _radioB, _ww, and manualContourModel::GetNumberOfPointsSpline().

00082 {
00083 //EED004
00084 
00085         int ii,nps;
00086 //      double x,y,z;
00087         double ang,angcos, angsin;
00088         double radio;
00089 
00090         nps     =  GetNumberOfPointsSpline() - 3;
00091 
00092         if (i==GetNumberOfPointsSpline()-1)
00093         {
00094                 i=0;
00095         }
00096 
00097         if (i<=nps/2)
00098         {
00099                 ii=i;
00100                 radio=_radioA;
00101         } else {
00102                 ii=nps-i+1;
00103                 radio=_radioB;
00104         }
00105         ang = ((double)ii/(nps/2))*_angDelta + _ang;
00106         angcos =  cos(ang);
00107         angsin =  sin(ang);
00108 
00109         *x = _ww*radio*angcos + _cx;
00110         *y = _hh*radio*angsin + _cy;
00111         *z= 900;
00112 }

Here is the call graph for this function:

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

Reimplemented from manualContourModel.

Definition at line 115 of file manualContourModelBullEyeSector.cpp.

References _ang, _angDelta, _radioA, _radioB, and manualContourModel::Save().

00116 {
00117         manualContourModel::Save(ff);
00118         fprintf(ff,"rA= %f rB= %f ang= %f deltaAng= %f\n", _radioA,_radioB, _ang , _angDelta);
00119 }

Here is the call graph for this function:

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

Reimplemented from manualContourModel.

Definition at line 122 of file manualContourModelBullEyeSector.cpp.

References _ang, _angDelta, _radioA, _radioB, and manualContourModel::Open().

00123 {
00124         char tmp[255];
00125         fscanf(ff,"%s",tmp); // TypeModel
00126         fscanf(ff,"%s",tmp); // ##
00127 
00128         manualContourModel::Open(ff);
00129 
00130 
00131         fscanf(ff,"%s",tmp); // radioA=
00132         fscanf(ff,"%s",tmp); // radioA
00133         _radioA = atof(tmp);
00134 
00135         fscanf(ff,"%s",tmp); // radioB=
00136         fscanf(ff,"%s",tmp); // radioB
00137         _radioB = atof(tmp);
00138 
00139         fscanf(ff,"%s",tmp); // ang=
00140         fscanf(ff,"%s",tmp); // ang
00141         _ang = atof(tmp);
00142 
00143         fscanf(ff,"%s",tmp); // deltaAng=
00144         fscanf(ff,"%s",tmp); // deltaAng
00145         _angDelta = atof(tmp);
00146 }

Here is the call graph for this function:

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

Reimplemented from manualContourModel.

Definition at line 35 of file manualContourModelBullEyeSector.cpp.

00036 {
00037         return 5;
00038 }

void manualContourModel::CopyAttributesTo ( manualContourModel cloneObject  )  [inherited]

Definition at line 652 of file manualContourModel.cpp.

References manualContourModel::_closeContour, manualContourModel::AddManualPoint(), manualContourModel::Clone(), manualContourModel::GetManualPoint(), manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSizeLstPoints(), manualContourModel::SetCloseContour(), manualContourModel::SetNumberOfPointsSpline(), and manualContourModel::UpdateSpline().

Referenced by manualContourModel::Clone(), manualContourModelRoi::CopyAttributesTo(), manualContourModelLine::CopyAttributesTo(), manualContourModelCircle::CopyAttributesTo(), CopyAttributesTo(), and manualContourModelBullEye::CopyAttributesTo().

00653 {
00654         // Fathers object
00655         //XXXX::CopyAttributesTo(cloneObject);
00656 
00657         cloneObject->SetCloseContour( this->IfCloseContour() );
00658         int i, size = GetSizeLstPoints();
00659         for( i=0; i<size; i++ )
00660         {
00661                 cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
00662         }
00663         cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
00664         cloneObject->SetCloseContour( _closeContour );
00665         cloneObject->UpdateSpline();
00666 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 54 of file manualContourModel.cpp.

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

Referenced by manualContourBaseControler::AddPoint(), manualContour3VControler::AddPoint(), AutoControlPoints::ChargeSpline(), manualViewContour::InitMove(), manualContourBaseControler::InsertPoint(), PropContour::method_Spline(), manualContourModel::Open(), manualContourContainer::refreshLumen(), manualContourContainer::refreshWall(), and wxMaracasCoutourTool::SetControlPoints().

00055 {
00056    manualPoint *mp = new manualPoint();
00057    mp->SetPoint(x,y,z);
00058    AddManualPoint(mp);
00059    //UpdateSpline();
00060 
00061    return _lstPoints.size()-1;
00062 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 64 of file manualContourModel.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 132 of file manualContourModel.cpp.

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

Referenced by manualContourModel::InsertPoint().

00133 {
00134         manualPoint *mp = new manualPoint();
00135         mp->SetPoint(x,y,z);
00136         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + id;
00137         _lstPoints.insert(itNum,mp);
00138 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 670 of file manualContourModel.cpp.

References manualContourModel::_lstPoints.

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

00671 {
00672         _lstPoints.push_back( theManualPoint );
00673 }

Here is the caller graph for this function:

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

Definition at line 684 of file manualContourModel.cpp.

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

00685 {
00686         manualPoint * mp;
00687 
00688         int i, size = GetSizeLstPoints();
00689 
00690         for( i=0; i<size; i++ )
00691         {
00692                 mp = GetManualPoint( i );
00693 
00694                 mp->SetPointX( mp->GetX()*Ax + Bx );
00695                 mp->SetPointY( mp->GetY()*Ay + By );
00696         }
00697 }

Here is the call graph for this function:

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

Definition at line 141 of file manualContourModel.cpp.

References manualContourModel::_lstPoints.

Referenced by manualContourBaseControler::DeleteActualMousePoint().

00142 {
00143         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + i;
00144    _lstPoints.erase(itNum);
00145 }

Here is the caller graph for this function:

void manualContourModel::DeleteAllPoints (  )  [inherited]

Definition at line 147 of file manualContourModel.cpp.

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

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

00148 {
00149         int i,size=_lstPoints.size();
00150         for (i=0;i<size;i++){
00151            _lstPoints.erase( _lstPoints.begin() );
00152         }
00153         this->UpdateSpline();
00154 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 157 of file manualContourModel.cpp.

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

Referenced by manualContourModel::MoveAllPoints().

00158 {
00159         manualPoint *mp=_lstPoints[i];
00160         double x=mp->GetX()+dx;
00161         double y=mp->GetY()+dy;
00162         double z=mp->GetZ()+dz;
00163         mp->SetPoint(x,y,z);
00164 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 166 of file manualContourModel.cpp.

00167 {
00168         // ToDo
00169 }

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

Definition at line 171 of file manualContourModel.cpp.

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

00172 {
00173         int i,size=_lstPoints.size();
00174         for (i=0;i<size;i++){
00175                 MovePoint(i,dx,dy,dz);
00176         }
00177 }

Here is the call graph for this function:

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

Definition at line 186 of file manualContourModel.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

manualPoint * manualContourModel::GetManualPoint ( int  id  )  [inherited]

Definition at line 243 of file manualContourModel.cpp.

References manualContourModel::_lstPoints.

Referenced by manualContourModel::CopyAttributesTo(), manualView3DContour::GetIdPoint2(), manualViewRoi::GetMinMax(), manualViewCircle::GetMinMax(), manualViewBaseContour::GetMinMax(), manualContourModel::GetSpline_t_Point(), manualViewRoi::InitMove(), manualViewLine::InitMove(), manualViewContour::InitMove(), manualViewCircle::InitMove(), manualRoiControler::InitRoi(), manualLineControler::InitRoi(), manualCircleControler::InitRoi(), manualContourBaseControler::Magnet(), manualContour3DControler::MouseClickLeft(), manualViewRoi::MoveContour(), manualViewLine::MoveContour(), manualViewContour::MoveContour(), manualViewCircle::MoveContour(), wxMaracasCoutourTool::OnSaveControlPoints(), manualViewRoi::RefreshContour(), manualContourContainer::refreshLumen(), manualViewContour::RefreshText(), manualContourContainer::refreshWall(), manualContourBaseControler::SetPoint(), manualContour3VControler::SetPoint(), manualContourBaseControler::SetPointX(), manualContourBaseControler::SetPointY(), manualContourBaseControler::SetPointZ(), manualRoiControler::SetRoi(), manualContourModel::Transform_Ax_Plus_B(), manualContourModelCircle::UpdateSpline(), manualContourModelBullEye::UpdateSpline(), manualContourModel::UpdateSpline(), manualViewPerpPlaneContour::UpdateViewPoint(), manualViewBaseContour::UpdateViewPoint(), and manualView3VContour::UpdateViewPoint().

00244 {
00245         return _lstPoints[id];
00246 }

Here is the caller graph for this function:

int manualContourModel::GetSizeLstPoints (  )  [inherited]

Definition at line 248 of file manualContourModel.cpp.

References manualContourModel::_lstPoints.

Referenced by manualContourModel::CopyAttributesTo(), manualContourBaseControler::DeleteActualMousePoint(), wxMaracas_ManualTree_MPRDlg::ExportPoints(), manualView3DContour::GetIdPoint2(), manualViewRoi::GetMinMax(), manualViewBaseContour::GetMinMax(), manualViewRoi::InitMove(), manualViewLine::InitMove(), manualViewContour::InitMove(), manualViewCircle::InitMove(), manualViewContour::MoveContour(), wxMaracasCoutourTool::OnSaveControlPoints(), manualContourContainer::refreshLumen(), manualContourContainer::refreshWall(), manualContourModel::Transform_Ax_Plus_B(), and manualContourModelCircle::UpdateSpline().

00249 {
00250         return _lstPoints.size();
00251 }

Here is the caller graph for this function:

int manualContourModel::GetNumberOfPointsSpline (  )  [inherited]

Definition at line 253 of file manualContourModel.cpp.

References manualContourModel::_sizePointsContour.

Referenced by wxMaracasCoutourTool::AnalisisContourInside(), AutoControlPoints::ChargeSpline(), manualViewBaseContour::ConstructVTKObjects(), manualContourModel::CopyAttributesTo(), ContourExtractData::Fill_lstlstlstVecXY(), ContourExtractData::GetMinMaxPoint(), wxMaracasCoutourTool::GetMinMaxPoint(), manualContourModel::GetNearestPointAndNormal(), manualContourBaseControler::GetNumberOfPointsSplineManualContour(), manualContourModel::GetPathArea(), manualContourModel::GetPathSize(), GetSpline_i_Point(), wxMaracasCoutourTool::GetSplinePoints(), PropContour::method_Spline(), wxMaracasCoutourTool::OnSaveContour(), manualViewPerpPlaneContour::RefreshContour(), manualViewContour::RefreshContour(), manualViewBullEyeSector::RefreshContour(), manualView3VContour::RefreshContour(), and manualContourModelCircle::UpdateSpline().

00254 {
00255         return _sizePointsContour;
00256 }

Here is the caller graph for this function:

void manualContourModel::SetNumberOfPointsSpline ( int  size  )  [inherited]

Definition at line 258 of file manualContourModel.cpp.

References manualContourModel::_sizePointsContour.

Referenced by manualContourModelBullEye::AddSector(), AutoControlPoints::ChargeSpline(), manualRoiControler::Configure(), wxMaracasCoutourTool::ConfigureVTK(), manualContourModel::CopyAttributesTo(), manualContourModelLine::manualContourModelLine(), manualContourModelRoi::manualContourModelRoi(), and PropContour::method_Spline().

00259 {
00260         _sizePointsContour = size;
00261 }

Here is the caller graph for this function:

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

Reimplemented in manualContourModelBullEye, and manualContourModelCircle.

Definition at line 289 of file manualContourModel.cpp.

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

Referenced by wxMaracasCoutourTool::AnalisisContourInside(), AutoControlPoints::ChargeSpline(), manualContourModel::CopyAttributesTo(), manualContourModel::DeleteAllPoints(), wxMaracas_ManualTree_MPRDlg::ExportPoints(), ContourExtractData::Fill_lstlstlstVecXY(), ContourExtractData::GetMinMaxPoint(), wxMaracasCoutourTool::GetMinMaxPoint(), manualContourModel::GetNearestPointAndNormal(), manualContourModel::GetPathArea(), manualContourModel::GetPathSize(), wxMaracasCoutourTool::GetSplinePoints(), PropContour::method_Spline(), manualViewPerpPlaneContour::RefreshContour(), manualViewContour::RefreshContour(), manualViewBullEyeSector::RefreshContour(), manualViewBullEye::RefreshContour(), wxMaracasCoutourTool::SetControlPoints(), and manualContourModelBullEye::UpdateSpline().

00290 {
00291         int i, np;
00292     np  = _lstPoints.size();
00293         manualPoint     *mp;
00294         _cntSplineX->RemoveAllPoints();
00295         _cntSplineY->RemoveAllPoints();
00296         _cntSplineZ->RemoveAllPoints();
00297     for( i = 0; i < np; i++ ) {
00298                 mp = GetManualPoint(i);
00299         _cntSplineX->AddPoint( i, mp->GetX() );
00300         _cntSplineY->AddPoint( i, mp->GetY() );
00301         _cntSplineZ->AddPoint( i, mp->GetZ() );
00302     } //  rof
00303 
00304 //JSTG 25-02-08 ---------------------------------------------------------------------------------------------
00305         if (this->_closeContour==true)
00306         {
00307                 _delta_JSTG = (double) (np) / double (_sizePointsContour - 1);  //Without the -1 the curve is not close
00308         } else {
00309 //              _delta_JSTG = (double) (np-1) / double (_sizePointsContour );  //Without the -1 the curve is not close
00310                 _delta_JSTG = (double) (np) / double (_sizePointsContour-1 );  //Without the -1 the curve is not close
00311         }
00312 //-----------------------------------------------------------------------------------------------------------
00313 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 266 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(), manualContourControler::MouseClickLeft(), wxWidgetMesure2D::OnCloseContour(), and manualContourBaseControler::OnRightButtonDown().

00267 {
00268         _closeContour = closeContour;
00269         if (_closeContour==true)
00270         {
00271                 _cntSplineX->ClosedOn();
00272                 _cntSplineY->ClosedOn();
00273                 _cntSplineZ->ClosedOn();
00274         } else {
00275                 _cntSplineX->ClosedOff();
00276                 _cntSplineY->ClosedOff();
00277                 _cntSplineZ->ClosedOff();
00278         }
00279 }

Here is the caller graph for this function:

bool manualContourModel::IfCloseContour (  )  [inherited]

Definition at line 282 of file manualContourModel.cpp.

References manualContourModel::_closeContour.

Referenced by manualContourModel::GetPathArea(), and manualViewContour::RefreshText().

00283 {
00284         return _closeContour;
00285 }

Here is the caller graph for this function:

double manualContourModel::GetPathSize (  )  [inherited]

Definition at line 386 of file manualContourModel.cpp.

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

Referenced by AutoControlPoints::ChargeSpline().

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

Here is the call graph for this function:

Here is the caller graph for this function:

double manualContourModel::GetPathArea (  )  [inherited]

Definition at line 436 of file manualContourModel.cpp.

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

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

Here is the call graph for this function:

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

Definition at line 517 of file manualContourModel.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 335 of file manualContourModel.cpp.

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

Referenced by manualContourModel::GetSpline_i_Point().

00336 {
00337                 if (_lstPoints.size()==0)
00338         {
00339                 *x      = 0;
00340                 *y      = 0;
00341                 *z      = 0;
00342         }
00343         if (_lstPoints.size()==1)
00344         {
00345                 manualPoint     *mp;
00346                 mp      = GetManualPoint(0);
00347                 *x      = mp->GetX();
00348                 *y      = mp->GetY();
00349                 *z      = mp->GetZ();
00350         }
00351         if (_lstPoints.size()>=2)
00352         {
00353                 *x      = _cntSplineX->Evaluate(t);
00354                 *y      = _cntSplineY->Evaluate(t);
00355                 *z      = _cntSplineZ->Evaluate(t);
00356         }
00357 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< manualContourModel * > manualContourModel::ExploseModel (  )  [virtual, inherited]

Reimplemented in manualContourModelBullEye.

Definition at line 675 of file manualContourModel.cpp.

00676 {
00677         std::vector<manualContourModel*> lstTmp;
00678         lstTmp.push_back(this);
00679         return lstTmp;
00680 }


Member Data Documentation

double manualContourModelBullEyeSector::_radioA [private]

Definition at line 31 of file manualContourModelBullEyeSector.h.

Referenced by GetSector(), GetSpline_i_Point(), Open(), Save(), and SetSector().

double manualContourModelBullEyeSector::_radioB [private]

Definition at line 32 of file manualContourModelBullEyeSector.h.

Referenced by GetSector(), GetSpline_i_Point(), Open(), Save(), and SetSector().

double manualContourModelBullEyeSector::_ang [private]

Definition at line 33 of file manualContourModelBullEyeSector.h.

Referenced by GetSector(), GetSpline_i_Point(), Open(), Save(), and SetSector().

double manualContourModelBullEyeSector::_angDelta [private]

Definition at line 34 of file manualContourModelBullEyeSector.h.

Referenced by GetSector(), GetSpline_i_Point(), Open(), Save(), and SetSector().

double manualContourModelBullEyeSector::_ww [private]

Definition at line 35 of file manualContourModelBullEyeSector.h.

Referenced by GetSpline_i_Point(), and SetSize().

double manualContourModelBullEyeSector::_hh [private]

Definition at line 36 of file manualContourModelBullEyeSector.h.

Referenced by GetSpline_i_Point(), and SetSize().

double manualContourModelBullEyeSector::_cx [private]

Definition at line 37 of file manualContourModelBullEyeSector.h.

Referenced by GetSpline_i_Point(), and SetCenter().

double manualContourModelBullEyeSector::_cy [private]

Definition at line 38 of file manualContourModelBullEyeSector.h.

Referenced by GetSpline_i_Point(), and SetCenter().


The documentation for this class was generated from the following files:
Generated on Wed Jul 29 16:35:47 2009 for creaMaracasVisu_lib by  doxygen 1.5.3