]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
creaButtonContainer & creaPanelButtonContainer: Updates in doxygen documentation...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourModel.cpp
1 #include "manualContourModel.h"
2
3 // ----------------------------------------------------------------------------
4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
6
7 manualContourModel::manualContourModel()
8 {
9     _cntSplineX = vtkKochanekSpline::New( );
10     _cntSplineY = vtkKochanekSpline::New( );
11     _cntSplineZ = vtkKochanekSpline::New( );
12
13         this->SetCloseContour(true);
14
15     _cntSplineX->SetDefaultTension( 0 );
16         _cntSplineX->SetDefaultBias( 0 );
17         _cntSplineX->SetDefaultContinuity( 0 );
18
19     _cntSplineY->SetDefaultTension( 0 );
20         _cntSplineY->SetDefaultBias( 0 );
21         _cntSplineY->SetDefaultContinuity( 0 );
22
23     _cntSplineZ->SetDefaultTension( 0 );
24         _cntSplineZ->SetDefaultBias( 0 );
25         _cntSplineZ->SetDefaultContinuity( 0 );
26
27 //JSTG 25-02-08 -------------------------------------------------------------------------------------------------
28
29         // this parameter is reset in the  VIRTUAL manualContourBaseControler::Configure
30         _sizePointsContour      = 100;                  //JSTG 25-02-08 The change in the inisialization of these variable is critical.
31
32         _delta_JSTG                     = 0.0;
33 //---------------------------------------------------------------------------------------------------------------
34
35 //CMRU 17-08-09 -------------------------------------------------------------------------------------------------
36         _realSize                       = 0.0;
37         _label                          = "";
38 //---------------------------------------------------------------------------------------------------------------
39
40 }
41
42 // ----------------------------------------------------------------------------
43 manualContourModel::~manualContourModel()
44 {
45         int i,size=_lstPoints.size();
46         for (i=0;i<size; i++){
47                 delete _lstPoints[i];
48         }
49         _lstPoints.clear();
50
51         _cntSplineX->RemoveAllPoints();
52         _cntSplineY->RemoveAllPoints();
53         _cntSplineZ->RemoveAllPoints();
54
55         _cntSplineX->Delete();
56         _cntSplineY->Delete();
57         _cntSplineZ->Delete();
58 }
59 // ----------------------------------------------------------------------------
60 int manualContourModel::AddPoint(double x,double y,double z)
61 {
62    manualPoint *mp = new manualPoint();
63    mp->SetPoint(x,y,z);
64    AddManualPoint(mp);
65    //UpdateSpline();
66
67    return _lstPoints.size()-1;
68 }
69 // ----------------------------------------------------------------------------
70 int manualContourModel::InsertPoint(double x,double y,double z)
71 {
72         double dd,ddmin=9999999;
73         int    ibak=0;
74         double xx,x1,x2;
75         double yy,y1,y2;
76         double zz,z1,z2;
77         int i,ii,iii,size=_lstPoints.size();
78         double j,MaxDivisions=20,porcentage;
79         int sizeB=size;
80
81         if (_closeContour==false)
82         {
83                 size=size-1;
84         }
85
86         double jbak;
87
88         for ( i=0 ; i<size ; i++ )
89         {
90                 ii=i % sizeB ;
91                 iii=(i+1) % sizeB;
92                 x1=_lstPoints[ii]->GetX();
93                 y1=_lstPoints[ii]->GetY();
94                 z1=_lstPoints[ii]->GetZ();
95                 x2=_lstPoints[iii]->GetX();
96                 y2=_lstPoints[iii]->GetY();
97                 z2=_lstPoints[iii]->GetZ();
98                 for (j=0; j<=MaxDivisions; j++)
99                 {
100                         porcentage=(j/MaxDivisions);
101                         xx=(x2-x1)*porcentage+x1;
102                         yy=(y2-y1)*porcentage+y1;
103                         zz=(z2-z1)*porcentage+z1;
104                         dd=sqrt( (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
105                         if ( dd<ddmin )
106                         {
107                                 ddmin=dd;
108                                 ibak=iii;
109                                 jbak=j;
110                         }
111                 }
112         }
113
114         if (_closeContour==false)
115         {
116                 if ( (ibak==1) && (jbak==0) )
117                 {
118                         ibak=0;
119                 }
120                 if ( ( ibak==size ) && ( jbak==MaxDivisions ) )
121                 {
122                         ibak=sizeB;
123                 }
124         }
125
126
127 //JSTG - 25-04-08 ----------------------------------------------------------
128         //manualPoint *mp = new manualPoint();
129         //mp->SetPoint(x,y,z);
130         //std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + ibak;
131         //_lstPoints.insert(itNum,mp);
132         InsertPoint_id(ibak,x,y,z);
133 //----------------------------------------------------------------------------
134
135         return ibak;
136 }
137 // ----------------------------------------------------------------------------
138 void manualContourModel::InsertPoint_id(int id, double x, double y, double z)
139 {
140         manualPoint *mp = new manualPoint();
141         mp->SetPoint(x,y,z);
142         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + id;
143         _lstPoints.insert(itNum,mp);
144 }
145 // ----------------------------------------------------------------------------
146
147 void manualContourModel::DeletePoint(int i)
148 {
149         std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + i;
150    _lstPoints.erase(itNum);
151 }
152 // ----------------------------------------------------------------------------
153 void manualContourModel::DeleteAllPoints()
154 {
155         int i,size=_lstPoints.size();
156         for (i=0;i<size;i++){
157            _lstPoints.erase( _lstPoints.begin() );
158         }
159         this->UpdateSpline();
160 }
161 // ----------------------------------------------------------------------------
162
163 void manualContourModel::MovePoint(int i,double dx,double dy,double dz)
164 {
165         manualPoint *mp=_lstPoints[i];
166         double x=mp->GetX()+dx;
167         double y=mp->GetY()+dy;
168         double z=mp->GetZ()+dz;
169         mp->SetPoint(x,y,z);
170 }
171 // ----------------------------------------------------------------------------
172 void manualContourModel::MoveLstPoints(double dx,double dy,double dz)
173 {
174         // ToDo
175 }
176 // ----------------------------------------------------------------------------
177 void manualContourModel::MoveAllPoints(double dx,double dy,double dz)
178 {
179         int i,size=_lstPoints.size();
180         for (i=0;i<size;i++){
181                 MovePoint(i,dx,dy,dz);
182         }
183 }
184
185
186 // ----------------------------------------------------------------------------
187
188 // type=-1  x,y,z
189 // type=0       x,y
190 // type=1       y,z
191 // type=2       x,z
192 int      manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type)
193 {
194         double range = i_range+1;
195
196         double xx,yy,zz,dd,ddmin=9999999;
197         int ibak=-1;
198         int i,size=_lstPoints.size();
199         for (i=0;i<size;i++){
200                 manualPoint *mp=_lstPoints[i];
201                 xx=mp->GetX();
202                 yy=mp->GetY();
203                 zz=mp->GetZ();
204
205                 if (type==-1)
206                 {
207                         if ((fabs(xx-x)<range) && (fabs(yy-y)<range) && (fabs(zz-z)<range)) {
208                            dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
209                            if (dd<ddmin){
210                                    ddmin=dd;
211                                    ibak=i;
212                            }
213                         }
214                 }
215                 if (type==0)
216                 {
217                         if ((fabs(yy-y)<range) && (fabs(zz-z)<range)) {
218                            dd=sqrt(   (yy-y)*(yy-y) + (zz-z)*(zz-z) );
219                            if (dd<ddmin){
220                                    ddmin=dd;
221                                    ibak=i;
222                            }
223                         }
224                 }
225                 if (type==1)
226                 {
227                         if ((fabs(xx-x)<range) && (fabs(zz-z)<range)) {
228                            dd=sqrt(   (xx-x)*(xx-x)  + (zz-z)*(zz-z) );
229                            if (dd<ddmin){
230                                    ddmin=dd;
231                                    ibak=i;
232                            }
233                         }
234                 }
235                 if (type==2)
236                 {
237                         if ((fabs(xx-x)<range) && (fabs(yy-y)<range) ) {
238                            dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y)  );
239                            if (dd<ddmin){
240                                    ddmin=dd;
241                                    ibak=i;
242                            }
243                         }
244                 }
245         }
246         return ibak;
247 }
248 // ----------------------------------------------------------------------------
249 manualPoint* manualContourModel::GetManualPoint(int id)
250 {
251         return _lstPoints[id];
252 }
253 // ----------------------------------------------------------------------------
254 int manualContourModel::GetSizeLstPoints()
255 {
256         return _lstPoints.size();
257 }
258 //----------------------------------------------------------------------------
259 int manualContourModel::GetNumberOfPointsSpline()
260 {
261         return _sizePointsContour;
262 }
263 //----------------------------------------------------------------------------
264 void manualContourModel::SetNumberOfPointsSpline(int size)
265 {
266         _sizePointsContour = size;
267 }
268
269 // ----------------------------------------------------------------------------
270
271 void manualContourModel::SetCloseContour(bool closeContour)
272 {
273         _closeContour = closeContour;
274         if (_closeContour==true)
275         {
276                 _cntSplineX->ClosedOn();
277                 _cntSplineY->ClosedOn();
278                 _cntSplineZ->ClosedOn();
279         } else {
280                 _cntSplineX->ClosedOff();
281                 _cntSplineY->ClosedOff();
282                 _cntSplineZ->ClosedOff();
283         }
284 }
285
286 // ----------------------------------------------------------------------------
287 bool manualContourModel::IfCloseContour()
288 {
289         return _closeContour;
290 }
291
292 // ----------------------------------------------------------------------------
293
294 void manualContourModel::UpdateSpline() // virtual
295 {
296         int i, np;
297     np  = _lstPoints.size();
298         manualPoint     *mp;
299         _cntSplineX->RemoveAllPoints();
300         _cntSplineY->RemoveAllPoints();
301         _cntSplineZ->RemoveAllPoints();
302     for( i = 0; i < np; i++ ) {
303                 mp = GetManualPoint(i);
304         _cntSplineX->AddPoint( i, mp->GetX() );
305         _cntSplineY->AddPoint( i, mp->GetY() );
306         _cntSplineZ->AddPoint( i, mp->GetZ() );
307     } //  rof
308
309 //JSTG 25-02-08 ---------------------------------------------------------------------------------------------
310         if (this->_closeContour==true)
311         {
312                 _delta_JSTG = (double) (np) / double (_sizePointsContour - 1);  //Without the -1 the curve is not close
313         } else {
314 //              _delta_JSTG = (double) (np-1) / double (_sizePointsContour );  //Without the -1 the curve is not close
315                 _delta_JSTG = (double) (np) / double (_sizePointsContour-1 );  //Without the -1 the curve is not close
316         }
317 //-----------------------------------------------------------------------------------------------------------
318 }
319
320 //---------------------------------------------------------------------------------
321
322 /*void manualContourModel::GetSplineiPoint(int i, double &x, double &y, double &z)
323 {
324         double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour);
325         double t = delta*(double)i;
326         GetSplinePoint(t, x, y, z);
327 }*/
328
329 //-----------------------------------------------------------------------------
330
331 //JSTG 25-02-08 ---------------------------------------------------------------
332 void manualContourModel::GetSpline_i_Point(int i, double *x, double *y, double *z) // virtal
333 {
334         GetSpline_t_Point(i*_delta_JSTG,x,y,z);
335 }
336
337 // ----------------------------------------------------------------------------
338
339 //JSTG 25-02-08 ---------------------------------------------------------------
340 void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, double *z)
341 {
342                 if (_lstPoints.size()==0)
343         {
344                 *x      = 0;
345                 *y      = 0;
346                 *z      = 0;
347         }
348         if (_lstPoints.size()==1)
349         {
350                 manualPoint     *mp;
351                 mp      = GetManualPoint(0);
352                 *x      = mp->GetX();
353                 *y      = mp->GetY();
354                 *z      = mp->GetZ();
355         }
356         if (_lstPoints.size()>=2)
357         {
358                 *x      = _cntSplineX->Evaluate(t);
359                 *y      = _cntSplineY->Evaluate(t);
360                 *z      = _cntSplineZ->Evaluate(t);
361         }
362 }
363
364 // ----------------------------------------------------------------------------
365
366
367 /*void manualContourModel::GetSplinePoint(double t, double &x, double &y, double &z)
368 {
369         if (_lstPoints.size()==0)
370         {
371                 x       = 0;
372                 y       = 0;
373                 z       = 0;
374         }
375         if (_lstPoints.size()==1)
376         {
377                 manualPoint     *mp;
378                 mp      = GetManualPoint(0);
379                 x       = mp->GetX();
380                 y       = mp->GetY();
381                 z       = mp->GetZ();
382         }
383         if (_lstPoints.size()>=2)
384         {
385                 x       = _cntSplineX->Evaluate(t);
386                 y       = _cntSplineY->Evaluate(t);
387                 z       = _cntSplineZ->Evaluate(t);
388         }
389 }*/
390 // ----------------------------------------------------------------------------
391 double manualContourModel::GetPathSize()
392 {
393         double result = 0;
394         double x1,y1,z1;
395         double x2,y2,z2;
396
397 // JSTG 25-02-08 -----------------------------
398         //double t,delta;
399         //int i,np,nps;
400         int i;
401 //--------------------------------------------
402
403         if (_lstPoints.size()==2)
404         {
405                 x1=_lstPoints[0]->GetX();
406                 y1=_lstPoints[0]->GetY();
407                 z1=_lstPoints[0]->GetZ();
408                 x2=_lstPoints[1]->GetX();
409                 y2=_lstPoints[1]->GetY();
410                 z2=_lstPoints[1]->GetZ();
411                 result = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
412         }
413         if (_lstPoints.size()>2)
414         {
415
416 // JSTG 25-02-08 ------------------------------------------
417                 //np  = _lstPoints.size( );
418                 //nps = 200;
419                 //delta=( double ) ( np  ) / ( double ) ( nps  );
420                 UpdateSpline();
421                 //GetSplinePoint(0,x1,y1,z1);
422                 GetSpline_i_Point(0,&x1,&y1,&z1);
423
424                 //for( i = 1; i < nps; i++ )
425                 for( i = 1; i < GetNumberOfPointsSpline(); i++ )
426                 {
427                         //t = delta * (double)i;
428                         //GetSplinePoint(t,x2,y2,z2);
429                         GetSpline_i_Point(i,&x2,&y2,&z2);
430 //---------------------------------------------------------
431                         result=result + sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
432                         x1=x2;
433                         y1=y2;
434                         z1=z2;
435                 }// for
436         }
437
438         return result;
439 }
440 // ----------------------------------------------------------------------------
441 double manualContourModel::GetPathArea()
442 {
443         double result = 555;
444         if ((_lstPoints.size()>=3) && IfCloseContour()==true )
445         {
446                 double area;
447 //JSTG 25-02-08 ---------------------------------------------
448                 //double ti,tj;
449 //-----------------------------------------------------------
450                 double x1,y1,z1;
451                 double x2,y2,z2;
452                 bool okArea=true;
453                 int i, j;
454
455                 // This uses Green's theorem:
456                 // A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN
457                 // A < 0 -> A = |A| (a negative value could raise because points are
458                 // given in clockwise order).
459
460 //JSTG 25-02-08 -------------------------------------------------
461                 //int np  = _lstPoints.size( );
462                 //int nps = 200;
463                 int nps = GetNumberOfPointsSpline();
464                 //double delta=( double ) ( np  ) / ( double ) ( nps  );
465                 UpdateSpline();
466                 for( i = 0, area = 0.0; i < nps; i++ )
467                 {
468                         j = ( i + 1 ) % nps;
469                         //ti = delta * (double)i;
470                         //tj = delta * (double)j;
471                         //GetSplinePoint(ti,x1,y1,z1);
472                         //GetSplinePoint(tj,x2,y2,z2);
473                         GetSpline_i_Point(i,&x1,&y1,&z1);
474                         GetSpline_i_Point(j,&x2,&y2,&z2);
475 //----------------------------------------------------------------
476                         area +=
477                                         (x1 * y2 ) -
478                                         ( x2 * y1 );
479                         if (z1!=z2)
480                         {
481                                 okArea=false;
482                         }
483                 }// for
484                 area /= 2.0;
485                 area = fabs( area );
486
487 /*
488                 for( i = 0, area = 0.0; i < _lstPoints.size(); i++ )
489                 {
490                         j = ( i + 1 ) % _lstPoints.size();
491                         //  Area
492                         area +=
493                                         (_lstPoints[i]->GetX() * _lstPoints[j]->GetY() ) -
494                                         ( _lstPoints[j]->GetX() * _lstPoints[i]->GetY() );
495                         if (_lstPoints[0]->GetZ()!=_lstPoints[i]->GetZ())
496                         {
497                                 okArea=false;
498                         }
499                 } // rof
500                 area /= 2.0;
501                 area = fabs( area );
502 */
503
504                 if (okArea==true)
505                 {
506                         result = area;
507                 } else {
508                         result = -1;
509                 }
510
511         } else {
512                 result = 0;
513         }
514         return result;
515 }
516
517 // ----------------------------------------------------------------------------
518 // p[x,y,z]   :  data in
519 // rp[x,y,z]  :  data out  result point
520 // rn[x,y,z]  :  data out   result normal
521
522 void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double *rn)
523 {
524         double  distMin=999999999;
525         double  dist,dx,dy,dz;
526         double  x1,y1,z1;
527         double  x2,y2,z2;
528         int             i,np,nps;
529
530 //JSTG 25-02-08 -------------------
531         //double  tback;
532         int iback;
533         //double        t,delta;
534 //---------------------------------
535
536         np      = _lstPoints.size( );
537         if (np>=2)
538         {
539 // JSTG 25-02-08 ------------------------------------------
540                 //nps           = 200;
541                 nps = GetNumberOfPointsSpline();
542                 //delta = ( double ) ( np  ) / ( double ) ( nps  );
543                 UpdateSpline();
544                 //GetSplinePoint(0,x1,y1,z1);
545                 GetSpline_i_Point(0,&x1,&y1,&z1);
546                 for( i = 0; i < nps; i++ )
547                 {
548                         //t = delta * (double)i;
549                         //GetSplinePoint(t,x1,y1,z1);
550                         GetSpline_i_Point(i,&x1,&y1,&z1);
551 //----------------------------------------------------------
552                         dx= x1-p[0];
553                         dy= y1-p[1];
554                         dz= z1-p[2];
555                         dist = sqrt( dx*dx + dy*dy + dz*dz );
556                         if (dist<distMin)
557                         {
558                                 distMin  = dist;
559 //JSTG                  tback = t;
560                                 iback = i;
561                                 rp[0] = x1;
562                                 rp[1] = y1;
563                                 rp[2] = z1;
564                                 rn[0] = x2-x1;
565                                 rn[1] = y2-y1;
566                                 rn[2] = z2-z1;
567                         }
568                         x2=x1;
569                         y2=y1;
570                         z2=z1;
571                 }// for
572
573 // JSTG 25-02-08 ------------------------------------------
574                 //if (tback==0)
575                 if (iback==0)
576                 {
577                         //t = delta * (double)1.0;
578                         //GetSplinePoint(t,x1,y1,z1);
579                         GetSpline_i_Point(i,&x1,&y1,&z1);
580 //----------------------------------------------------------
581                         rn[0]=rp[0]-x1;
582                         rn[1]=rp[1]-y1;
583                         rn[2]=rp[2]-z1;
584                 }
585         }
586         else
587         {
588                 rp[0] = 0;
589                 rp[1] = 0;
590                 rp[2] = 0;
591                 rn[0] = -1;
592                 rn[1] = 0;
593                 rn[2] = 0;
594         }
595 }
596
597 // ----------------------------------------------------------------------------
598 manualContourModel * manualContourModel :: Clone() // virtual
599 {
600         manualContourModel * clone = new manualContourModel();
601         CopyAttributesTo(clone);
602         return clone;
603 }
604
605 // ----------------------------------------------------------------------------
606 void manualContourModel::Open(FILE *ff) // virtual
607 {
608         char tmp[255];
609         int i;
610         int numberOfControlPoints;
611         double x,y,z;
612
613         fscanf(ff,"%s",tmp); // NumberOfControlPoints
614         fscanf(ff,"%s",tmp); // ##
615         numberOfControlPoints = atoi(tmp);
616         for (i=0;i<numberOfControlPoints;i++)
617         {
618                 fscanf(ff,"%s",tmp); // X
619                 x = atof(tmp);
620                 fscanf(ff,"%s",tmp); // Y
621                 y = atof(tmp);
622                 fscanf(ff,"%s",tmp); // Z
623                 z = atof(tmp);
624                 AddPoint(x,y,z);
625         }
626 }
627
628 // ----------------------------------------------------------------------------
629 int manualContourModel::GetTypeModel() //virtual
630 {
631         // 0 spline
632         // 1 spline
633         // 2 rectangle
634         // 3 circle
635         // 4 BullEye
636         // 5 BullEyeSector
637         // 6 Line
638         return 1;
639 }
640
641 // ----------------------------------------------------------------------------
642 void manualContourModel::Save(FILE *ff) // virtual
643 {
644         int i,size=_lstPoints.size();
645         fprintf(ff,"TypeModel %d\n", GetTypeModel() );
646         fprintf(ff,"NumberOfControlPoints %d\n",size);
647         for (i=0;i<size;i++)
648         {
649                 manualPoint *mp=_lstPoints[i];
650                 fprintf(ff,"%f %f %f\n", mp->GetX(), mp->GetY(), mp->GetZ() );
651         }
652 }
653 //CMRU 03-09-09-----------------------------------------------------------------------------------------------
654 void manualContourModel::SaveData(FILE *ff)
655 {
656         std::string etiqueta = GetLabel();
657         if(etiqueta.empty())
658                 fprintf(ff,"Label: NO_LABEL\n");
659         else
660                 fprintf(ff,"Label: %s\n",etiqueta.c_str());
661         fprintf(ff,"Real_Size: %f\n",GetRealSize());
662 }
663
664 void manualContourModel::OpenData(FILE *ff)
665 {
666         char tmp[255];
667
668         fscanf(ff,"%s",tmp); // Label:
669         fscanf(ff,"%s",tmp); // value
670         std::cout<<tmp<<std::endl;
671         //if(strcmp(tmp != "NO_LABEL") // JPR
672         if(strcmp(tmp,"NO_LABEL") != 0)
673                 SetLabel(tmp);
674
675         fscanf(ff,"%s",tmp); // Real_size
676         fscanf(ff,"%s",tmp);// #
677
678         //tmp.ToDouble(&tmp);
679         SetRealSize(atof(tmp));
680 }
681
682 //------------------------------------------------------------------------------------------------------------
683
684 // ---------------------------------------------------------------------------
685
686 void manualContourModel::CopyAttributesTo( manualContourModel * cloneObject)
687 {
688         // Fathers object
689         //XXXX::CopyAttributesTo(cloneObject);
690
691         cloneObject->SetCloseContour( this->IfCloseContour() );
692         int i, size = GetSizeLstPoints();
693         for( i=0; i<size; i++ )
694         {
695                 cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
696         }
697         cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
698         cloneObject->SetCloseContour( _closeContour );
699         cloneObject->UpdateSpline();
700 }
701
702
703 // ---------------------------------------------------------------------------
704 void manualContourModel::AddManualPoint( manualPoint* theManualPoint )//private
705 {
706         _lstPoints.push_back( theManualPoint );
707 }
708
709 std::vector<manualBaseModel*> manualContourModel::ExploseModel(  )
710 {
711         std::vector<manualBaseModel*> lstTmp;
712         lstTmp.push_back(this);
713         return lstTmp;
714 }
715
716
717 // ----------------------------------------------------------------------------
718 void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
719 {
720         manualPoint * mp;
721
722         int i, size = GetSizeLstPoints();
723
724         for( i=0; i<size; i++ )
725         {
726                 mp = GetManualPoint( i );
727
728                 mp->SetPointX( mp->GetX()*Ax + Bx );
729                 mp->SetPointY( mp->GetY()*Ay + By );
730         }
731 }
732
733
734 //CMRU 17-08-09----------------------------------------------------------------------------
735 void manualContourModel::SetLabel(std::string newLabel)
736 {
737         _label = newLabel;
738 }
739
740 void manualContourModel::SetRealSize(double newRealSize) 
741 {
742         _realSize = newRealSize;
743 }
744
745 double manualContourModel::GetRealSize()
746 {
747         return _realSize;
748 }
749
750 std::string manualContourModel::GetLabel()
751 {
752         return _label;
753 }
754 //----------------------------------------------------------------------------