#include <manualContourModelRoi.h>
Public Member Functions | |
manualContourModelRoi () | |
virtual | ~manualContourModelRoi () |
virtual manualContourModelRoi * | Clone () |
void | CopyAttributesTo (manualContourModelRoi *cloneObject) |
void | Open (FILE *ff) |
virtual void | Save (FILE *ff) |
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 manualPoint * | GetManualPoint (int id) |
virtual int | GetSizeLstPoints () |
int | GetNumberOfPointsSpline () |
virtual void | SetNumberOfPointsSpline (int size) |
virtual void | UpdateSpline () |
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) |
virtual std::vector < manualBaseModel * > | ExploseModel () |
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 () |
Definition at line 8 of file manualContourModelRoi.h.
manualContourModelRoi::manualContourModelRoi | ( | ) |
Definition at line 9 of file manualContourModelRoi.cpp.
References manualContourModel::SetNumberOfPointsSpline().
Referenced by Clone().
00010 : manualContourModel() 00011 { 00012 SetNumberOfPointsSpline(5); 00013 }
manualContourModelRoi::~manualContourModelRoi | ( | ) | [virtual] |
Definition at line 15 of file manualContourModelRoi.cpp.
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 }
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 }
manualContourModelRoi * manualContourModelRoi::Clone | ( | ) | [virtual] |
Reimplemented from manualContourModel.
Definition at line 21 of file manualContourModelRoi.cpp.
References CopyAttributesTo(), and manualContourModelRoi().
00022 { 00023 manualContourModelRoi * clone = new manualContourModelRoi(); 00024 CopyAttributesTo(clone); 00025 return clone; 00026 }
void manualContourModelRoi::CopyAttributesTo | ( | manualContourModelRoi * | cloneObject | ) |
Reimplemented from manualContourModel.
Definition at line 30 of file manualContourModelRoi.cpp.
Referenced by Clone().
00031 { 00032 // Fathers object 00033 manualContourModel::CopyAttributesTo(cloneObject); 00034 }
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 }
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 * > manualContourModel::ExploseModel | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Reimplemented in manualContourModelBullEye.
Definition at line 709 of file manualContourModel.cpp.
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 }
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 }
manualPoint * manualContourModel::GetManualPoint | ( | int | id | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 249 of file manualContourModel.cpp.
References manualBaseModel::_lstPoints.
Referenced by manualContourModel::CopyAttributesTo(), manualContourModelRotationTool::getCenter(), manualContourModelRotationTool::GetSpline_i_Point(), manualContourModelPolygon::GetSpline_i_Point(), manualContourModel::GetSpline_t_Point(), manualViewContour::MoveContour(), wxMaracasCoutourTool::OnSaveControlPoints(), manualContourContainer::refreshLumen(), manualContourContainer::refreshWall(), manualContourModel::Transform_Ax_Plus_B(), manualContourModelRotationTool::UpdateSpline(), manualContourModelCircle::UpdateSpline(), manualContourModelBullEye::UpdateSpline(), and manualContourModel::UpdateSpline().
00250 { 00251 return _lstPoints[id]; 00252 }
void manualContourModel::GetNearestPointAndNormal | ( | double * | p, | |
double * | rp, | |||
double * | rn | |||
) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 522 of file manualContourModel.cpp.
References manualBaseModel::_lstPoints, manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSpline_i_Point(), and manualContourModel::UpdateSpline().
00523 { 00524 double distMin=999999999; 00525 double dist,dx,dy,dz; 00526 double x1,y1,z1; 00527 double x2,y2,z2; 00528 int i,np,nps; 00529 00530 //JSTG 25-02-08 ------------------- 00531 //double tback; 00532 int iback; 00533 //double t,delta; 00534 //--------------------------------- 00535 00536 np = _lstPoints.size( ); 00537 if (np>=2) 00538 { 00539 // JSTG 25-02-08 ------------------------------------------ 00540 //nps = 200; 00541 nps = GetNumberOfPointsSpline(); 00542 //delta = ( double ) ( np ) / ( double ) ( nps ); 00543 UpdateSpline(); 00544 //GetSplinePoint(0,x1,y1,z1); 00545 GetSpline_i_Point(0,&x1,&y1,&z1); 00546 for( i = 0; i < nps; i++ ) 00547 { 00548 //t = delta * (double)i; 00549 //GetSplinePoint(t,x1,y1,z1); 00550 GetSpline_i_Point(i,&x1,&y1,&z1); 00551 //---------------------------------------------------------- 00552 dx= x1-p[0]; 00553 dy= y1-p[1]; 00554 dz= z1-p[2]; 00555 dist = sqrt( dx*dx + dy*dy + dz*dz ); 00556 if (dist<distMin) 00557 { 00558 distMin = dist; 00559 //JSTG tback = t; 00560 iback = i; 00561 rp[0] = x1; 00562 rp[1] = y1; 00563 rp[2] = z1; 00564 rn[0] = x2-x1; 00565 rn[1] = y2-y1; 00566 rn[2] = z2-z1; 00567 } 00568 x2=x1; 00569 y2=y1; 00570 z2=z1; 00571 }// for 00572 00573 // JSTG 25-02-08 ------------------------------------------ 00574 //if (tback==0) 00575 if (iback==0) 00576 { 00577 //t = delta * (double)1.0; 00578 //GetSplinePoint(t,x1,y1,z1); 00579 GetSpline_i_Point(i,&x1,&y1,&z1); 00580 //---------------------------------------------------------- 00581 rn[0]=rp[0]-x1; 00582 rn[1]=rp[1]-y1; 00583 rn[2]=rp[2]-z1; 00584 } 00585 } 00586 else 00587 { 00588 rp[0] = 0; 00589 rp[1] = 0; 00590 rp[2] = 0; 00591 rn[0] = -1; 00592 rn[1] = 0; 00593 rn[2] = 0; 00594 } 00595 }
int manualContourModel::GetNumberOfPointsSpline | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 259 of file manualContourModel.cpp.
References manualBaseModel::_sizePointsContour.
Referenced by wxMaracasCoutourTool::AnalisisContourInside(), AutoControlPoints::ChargeSpline(), manualContourModel::CopyAttributesTo(), wxMaracasCoutourTool::GetMinMaxPoint(), manualContourModel::GetNearestPointAndNormal(), manualContourModel::GetPathArea(), manualContourModel::GetPathSize(), manualContourModelRotationTool::GetSpline_i_Point(), manualContourModelBullEyeSector::GetSpline_i_Point(), wxMaracasCoutourTool::GetSplinePoints(), PropContour::method_Spline(), wxMaracasCoutourTool::OnSaveContour(), manualContourModelRotationTool::UpdateSpline(), and manualContourModelCircle::UpdateSpline().
00260 { 00261 return _sizePointsContour; 00262 }
double manualContourModel::GetPathArea | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 441 of file manualContourModel.cpp.
References manualBaseModel::_lstPoints, manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSpline_i_Point(), manualContourModel::IfCloseContour(), and manualContourModel::UpdateSpline().
00442 { 00443 double result = 555; 00444 if ((_lstPoints.size()>=3) && IfCloseContour()==true ) 00445 { 00446 double area; 00447 //JSTG 25-02-08 --------------------------------------------- 00448 //double ti,tj; 00449 //----------------------------------------------------------- 00450 double x1,y1,z1; 00451 double x2,y2,z2; 00452 bool okArea=true; 00453 int i, j; 00454 00455 // This uses Green's theorem: 00456 // A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN 00457 // A < 0 -> A = |A| (a negative value could raise because points are 00458 // given in clockwise order). 00459 00460 //JSTG 25-02-08 ------------------------------------------------- 00461 //int np = _lstPoints.size( ); 00462 //int nps = 200; 00463 int nps = GetNumberOfPointsSpline(); 00464 //double delta=( double ) ( np ) / ( double ) ( nps ); 00465 UpdateSpline(); 00466 for( i = 0, area = 0.0; i < nps; i++ ) 00467 { 00468 j = ( i + 1 ) % nps; 00469 //ti = delta * (double)i; 00470 //tj = delta * (double)j; 00471 //GetSplinePoint(ti,x1,y1,z1); 00472 //GetSplinePoint(tj,x2,y2,z2); 00473 GetSpline_i_Point(i,&x1,&y1,&z1); 00474 GetSpline_i_Point(j,&x2,&y2,&z2); 00475 //---------------------------------------------------------------- 00476 area += 00477 (x1 * y2 ) - 00478 ( x2 * y1 ); 00479 if (z1!=z2) 00480 { 00481 okArea=false; 00482 } 00483 }// for 00484 area /= 2.0; 00485 area = fabs( area ); 00486 00487 /* 00488 for( i = 0, area = 0.0; i < _lstPoints.size(); i++ ) 00489 { 00490 j = ( i + 1 ) % _lstPoints.size(); 00491 // Area 00492 area += 00493 (_lstPoints[i]->GetX() * _lstPoints[j]->GetY() ) - 00494 ( _lstPoints[j]->GetX() * _lstPoints[i]->GetY() ); 00495 if (_lstPoints[0]->GetZ()!=_lstPoints[i]->GetZ()) 00496 { 00497 okArea=false; 00498 } 00499 } // rof 00500 area /= 2.0; 00501 area = fabs( area ); 00502 */ 00503 00504 if (okArea==true) 00505 { 00506 result = area; 00507 } else { 00508 result = -1; 00509 } 00510 00511 } else { 00512 result = 0; 00513 } 00514 return result; 00515 }
double manualContourModel::GetPathSize | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 391 of file manualContourModel.cpp.
References manualBaseModel::_lstPoints, manualContourModel::GetNumberOfPointsSpline(), manualContourModel::GetSpline_i_Point(), and manualContourModel::UpdateSpline().
Referenced by AutoControlPoints::ChargeSpline().
00392 { 00393 double result = 0; 00394 double x1,y1,z1; 00395 double x2,y2,z2; 00396 00397 // JSTG 25-02-08 ----------------------------- 00398 //double t,delta; 00399 //int i,np,nps; 00400 int i; 00401 //-------------------------------------------- 00402 00403 if (_lstPoints.size()==2) 00404 { 00405 x1=_lstPoints[0]->GetX(); 00406 y1=_lstPoints[0]->GetY(); 00407 z1=_lstPoints[0]->GetZ(); 00408 x2=_lstPoints[1]->GetX(); 00409 y2=_lstPoints[1]->GetY(); 00410 z2=_lstPoints[1]->GetZ(); 00411 result = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) ); 00412 } 00413 if (_lstPoints.size()>2) 00414 { 00415 00416 // JSTG 25-02-08 ------------------------------------------ 00417 //np = _lstPoints.size( ); 00418 //nps = 200; 00419 //delta=( double ) ( np ) / ( double ) ( nps ); 00420 UpdateSpline(); 00421 //GetSplinePoint(0,x1,y1,z1); 00422 GetSpline_i_Point(0,&x1,&y1,&z1); 00423 00424 //for( i = 1; i < nps; i++ ) 00425 for( i = 1; i < GetNumberOfPointsSpline(); i++ ) 00426 { 00427 //t = delta * (double)i; 00428 //GetSplinePoint(t,x2,y2,z2); 00429 GetSpline_i_Point(i,&x2,&y2,&z2); 00430 //--------------------------------------------------------- 00431 result=result + sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) ); 00432 x1=x2; 00433 y1=y2; 00434 z1=z2; 00435 }// for 00436 } 00437 00438 return result; 00439 }
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 }
int manualContourModel::GetSizeLstPoints | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 254 of file manualContourModel.cpp.
References manualBaseModel::_lstPoints.
Referenced by manualContourModel::CopyAttributesTo(), wxMaracas_ManualTree_MPRDlg::ExportPoints(), wxMaracasCoutourTool::OnSaveControlPoints(), manualContourContainer::refreshLumen(), manualContourContainer::refreshWall(), manualContourModel::Transform_Ax_Plus_B(), manualContourModelRotationTool::UpdateSpline(), manualContourModelCircle::UpdateSpline(), and manualContourModelBullEye::UpdateSpline().
00255 { 00256 return _lstPoints.size(); 00257 }
void manualContourModel::GetSpline_i_Point | ( | int | i, | |
double * | x, | |||
double * | y, | |||
double * | z | |||
) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Reimplemented in manualContourModelBullEyeSector, manualContourModelCircle, manualContourModelPolygon, and manualContourModelRotationTool.
Definition at line 332 of file manualContourModel.cpp.
References manualContourModel::_delta_JSTG, and manualContourModel::GetSpline_t_Point().
Referenced by wxMaracasCoutourTool::AnalisisContourInside(), AutoControlPoints::ChargeSpline(), wxMaracas_ManualTree_MPRDlg::ExportPoints(), wxMaracasCoutourTool::GetMinMaxPoint(), manualContourModel::GetNearestPointAndNormal(), manualContourModel::GetPathArea(), manualContourModel::GetPathSize(), wxMaracasCoutourTool::GetSplinePoints(), PropContour::method_Spline(), and wxMaracasCoutourTool::OnSaveContour().
00333 { 00334 GetSpline_t_Point(i*_delta_JSTG,x,y,z); 00335 }
void manualContourModel::GetSpline_t_Point | ( | double | t, | |
double * | x, | |||
double * | y, | |||
double * | z | |||
) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 340 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().
00341 { 00342 if (_lstPoints.size()==0) 00343 { 00344 *x = 0; 00345 *y = 0; 00346 *z = 0; 00347 } 00348 if (_lstPoints.size()==1) 00349 { 00350 manualPoint *mp; 00351 mp = GetManualPoint(0); 00352 *x = mp->GetX(); 00353 *y = mp->GetY(); 00354 *z = mp->GetZ(); 00355 } 00356 if (_lstPoints.size()>=2) 00357 { 00358 *x = _cntSplineX->Evaluate(t); 00359 *y = _cntSplineY->Evaluate(t); 00360 *z = _cntSplineZ->Evaluate(t); 00361 } 00362 }
int manualContourModelRoi::GetTypeModel | ( | ) | [private, virtual] |
Reimplemented from manualContourModel.
Definition at line 37 of file manualContourModelRoi.cpp.
bool manualContourModel::IfCloseContour | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 287 of file manualContourModel.cpp.
References manualContourModel::_closeContour.
Referenced by manualContourModel::CopyAttributesTo(), and manualContourModel::GetPathArea().
00288 { 00289 return _closeContour; 00290 }
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 }
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 }
int manualBaseModel::IsPoint | ( | double | x, | |
double | y | |||
) | [inherited] |
Definition at line 183 of file manualBaseModel.cpp.
References manualBaseModel::_lstPoints, manualPoint::GetX(), and manualPoint::GetY().
Referenced by ContourExtractData::isInside().
00184 { 00185 double xx,yy/*,zz*/; 00186 bool exists=false; 00187 int i,size=_lstPoints.size(); 00188 for (i=0;i<size;i++){ 00189 manualPoint *mp=_lstPoints[i]; 00190 xx=mp->GetX(); 00191 yy=mp->GetY(); 00192 00193 //RaC Be Careful!! Cast to have a point like the one in the params 27-09-09 00194 if(x==(int)xx && y==(int)yy ) 00195 { 00196 exists=true; 00197 } 00198 } 00199 return exists; 00200 }
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 }
void manualContourModel::MoveLstPoints | ( | double | dx, | |
double | dy, | |||
double | dz | |||
) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 172 of file manualContourModel.cpp.
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 }
void manualContourModel::Open | ( | FILE * | ff | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Reimplemented in manualContourModelBullEye, and manualContourModelBullEyeSector.
Definition at line 606 of file manualContourModel.cpp.
References manualContourModel::AddPoint().
00607 { 00608 char tmp[255]; 00609 int i; 00610 int numberOfControlPoints; 00611 double x,y,z; 00612 00613 fscanf(ff,"%s",tmp); // NumberOfControlPoints 00614 fscanf(ff,"%s",tmp); // ## 00615 numberOfControlPoints = atoi(tmp); 00616 for (i=0;i<numberOfControlPoints;i++) 00617 { 00618 fscanf(ff,"%s",tmp); // X 00619 x = atof(tmp); 00620 fscanf(ff,"%s",tmp); // Y 00621 y = atof(tmp); 00622 fscanf(ff,"%s",tmp); // Z 00623 z = atof(tmp); 00624 AddPoint(x,y,z); 00625 } 00626 }
void manualContourModel::OpenData | ( | FILE * | ff | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 664 of file manualContourModel.cpp.
References manualContourModel::SetLabel(), and manualContourModel::SetRealSize().
00665 { 00666 char tmp[255]; 00667 00668 fscanf(ff,"%s",tmp); // Label: 00669 fscanf(ff,"%s",tmp); // value 00670 std::cout<<tmp<<std::endl; 00671 //if(strcmp(tmp != "NO_LABEL") // JPR 00672 if(strcmp(tmp,"NO_LABEL") != 0) 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 }
void manualContourModel::Save | ( | FILE * | ff | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Reimplemented in manualContourModelBullEye, and manualContourModelBullEyeSector.
Definition at line 642 of file manualContourModel.cpp.
References manualBaseModel::_lstPoints, manualContourModel::GetTypeModel(), manualPoint::GetX(), manualPoint::GetY(), and manualPoint::GetZ().
00643 { 00644 int i,size=_lstPoints.size(); 00645 fprintf(ff,"TypeModel %d\n", GetTypeModel() ); 00646 fprintf(ff,"NumberOfControlPoints %d\n",size); 00647 for (i=0;i<size;i++) 00648 { 00649 manualPoint *mp=_lstPoints[i]; 00650 fprintf(ff,"%f %f %f\n", mp->GetX(), mp->GetY(), mp->GetZ() ); 00651 } 00652 }
void manualContourModel::SaveData | ( | FILE * | ff | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 654 of file manualContourModel.cpp.
References manualContourModel::GetLabel(), and manualContourModel::GetRealSize().
00655 { 00656 std::string etiqueta = GetLabel(); 00657 if(etiqueta.empty()) 00658 fprintf(ff,"Label: NO_LABEL\n"); 00659 else 00660 fprintf(ff,"Label: %s\n",etiqueta.c_str()); 00661 fprintf(ff,"Real_Size: %f\n",GetRealSize()); 00662 }
void manualContourModel::SetCloseContour | ( | bool | closeContour | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 271 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().
00272 { 00273 _closeContour = closeContour; 00274 if (_closeContour==true) 00275 { 00276 _cntSplineX->ClosedOn(); 00277 _cntSplineY->ClosedOn(); 00278 _cntSplineZ->ClosedOn(); 00279 } else { 00280 _cntSplineX->ClosedOff(); 00281 _cntSplineY->ClosedOff(); 00282 _cntSplineZ->ClosedOff(); 00283 } 00284 }
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 }
void manualContourModel::SetNumberOfPointsSpline | ( | int | size | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Definition at line 264 of file manualContourModel.cpp.
References manualBaseModel::_sizePointsContour.
Referenced by manualContourModelBullEye::AddSector(), AutoControlPoints::ChargeSpline(), wxMaracasCoutourTool::ConfigureVTK(), manualContourModel::CopyAttributesTo(), manualContourModelLine::manualContourModelLine(), manualContourModelRoi(), and PropContour::method_Spline().
00265 { 00266 _sizePointsContour = size; 00267 }
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 }
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 }
void manualContourModel::UpdateSpline | ( | ) | [virtual, inherited] |
Reimplemented from manualBaseModel.
Reimplemented in manualContourModelBullEye, manualContourModelCircle, manualContourModelPolygon, and manualContourModelRotationTool.
Definition at line 294 of file manualContourModel.cpp.
References manualContourModel::_closeContour, manualContourModel::_cntSplineX, manualContourModel::_cntSplineY, manualContourModel::_cntSplineZ, manualContourModel::_delta_JSTG, manualBaseModel::_lstPoints, manualBaseModel::_sizePointsContour, manualContourModel::GetManualPoint(), manualPoint::GetX(), manualPoint::GetY(), and manualPoint::GetZ().
Referenced by wxMaracasCoutourTool::AnalisisContourInside(), AutoControlPoints::ChargeSpline(), manualContourModel::CopyAttributesTo(), manualContourModel::DeleteAllPoints(), wxMaracas_ManualTree_MPRDlg::ExportPoints(), wxMaracasCoutourTool::GetMinMaxPoint(), manualContourModel::GetNearestPointAndNormal(), manualContourModel::GetPathArea(), manualContourModel::GetPathSize(), wxMaracasCoutourTool::GetSplinePoints(), PropContour::method_Spline(), and wxMaracasCoutourTool::SetControlPoints().
00295 { 00296 int i, np; 00297 np = _lstPoints.size(); 00298 manualPoint *mp; 00299 _cntSplineX->RemoveAllPoints(); 00300 _cntSplineY->RemoveAllPoints(); 00301 _cntSplineZ->RemoveAllPoints(); 00302 for( i = 0; i < np; i++ ) { 00303 mp = GetManualPoint(i); 00304 _cntSplineX->AddPoint( i, mp->GetX() ); 00305 _cntSplineY->AddPoint( i, mp->GetY() ); 00306 _cntSplineZ->AddPoint( i, mp->GetZ() ); 00307 } // rof 00308 00309 //JSTG 25-02-08 --------------------------------------------------------------------------------------------- 00310 if (this->_closeContour==true) 00311 { 00312 _delta_JSTG = (double) (np) / double (_sizePointsContour - 1); //Without the -1 the curve is not close 00313 } else { 00314 // _delta_JSTG = (double) (np-1) / double (_sizePointsContour ); //Without the -1 the curve is not close 00315 _delta_JSTG = (double) (np) / double (_sizePointsContour-1 ); //Without the -1 the curve is not close 00316 } 00317 //----------------------------------------------------------------------------------------------------------- 00318 }
bool manualContourModel::_closeContour [inherited] |
Definition at line 133 of file manualContourModel.h.
Referenced by manualContourModel::CopyAttributesTo(), manualContourModel::IfCloseContour(), manualContourModel::InsertPoint(), manualContourModel::SetCloseContour(), and manualContourModel::UpdateSpline().
vtkKochanekSpline* manualContourModel::_cntSplineX [inherited] |
Definition at line 134 of file manualContourModel.h.
Referenced by manualContourModel::GetSpline_t_Point(), manualContourModel::manualContourModel(), manualContourModel::SetCloseContour(), manualContourModel::UpdateSpline(), and manualContourModel::~manualContourModel().
vtkKochanekSpline* manualContourModel::_cntSplineY [inherited] |
Definition at line 135 of file manualContourModel.h.
Referenced by manualContourModel::GetSpline_t_Point(), manualContourModel::manualContourModel(), manualContourModel::SetCloseContour(), manualContourModel::UpdateSpline(), and manualContourModel::~manualContourModel().
vtkKochanekSpline* manualContourModel::_cntSplineZ [inherited] |
Definition at line 136 of file manualContourModel.h.
Referenced by manualContourModel::GetSpline_t_Point(), manualContourModel::manualContourModel(), manualContourModel::SetCloseContour(), manualContourModel::UpdateSpline(), and manualContourModel::~manualContourModel().
double manualContourModel::_delta_JSTG [inherited] |
Definition at line 139 of file manualContourModel.h.
Referenced by manualContourModel::GetSpline_i_Point(), manualContourModel::manualContourModel(), and manualContourModel::UpdateSpline().
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] |
Definition at line 134 of file manualBaseModel.h.
Referenced by manualContourModel::AddManualPoint(), manualBaseModel::AddManualPoint(), manualContourModel::AddPoint(), manualBaseModel::AddPoint(), manualContourModel::DeleteAllPoints(), manualBaseModel::DeleteAllPoints(), manualContourModel::DeletePoint(), manualBaseModel::DeletePoint(), manualContourModel::GetIdPoint(), manualBaseModel::GetIdPoint(), manualContourModel::GetManualPoint(), manualBaseModel::GetManualPoint(), manualContourModel::GetNearestPointAndNormal(), manualBaseModel::GetNumberOfPointsSpline(), manualContourModel::GetPathArea(), manualContourModel::GetPathSize(), manualContourModel::GetSizeLstPoints(), manualBaseModel::GetSizeLstPoints(), manualContourModelPolygon::GetSpline_i_Point(), manualBaseModel::GetSpline_i_Point(), manualContourModel::GetSpline_t_Point(), manualContourModel::InsertPoint(), manualBaseModel::InsertPoint(), manualContourModel::InsertPoint_id(), manualBaseModel::InsertPoint_id(), manualBaseModel::IsPoint(), manualContourModel::MoveAllPoints(), manualBaseModel::MoveAllPoints(), manualContourModel::MovePoint(), manualBaseModel::MovePoint(), manualContourModel::Save(), manualContourModel::UpdateSpline(), manualBaseModel::~manualBaseModel(), and manualContourModel::~manualContourModel().
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] |
Definition at line 133 of file manualBaseModel.h.
Referenced by manualContourModel::GetNumberOfPointsSpline(), manualBaseModel::GetNumberOfPointsSpline(), manualBaseModel::manualBaseModel(), manualContourModel::manualContourModel(), manualContourModel::SetNumberOfPointsSpline(), manualBaseModel::SetNumberOfPointsSpline(), and manualContourModel::UpdateSpline().