]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
*** empty log message ***
[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
272 void manualContourModel::SetCloseContour(bool closeContour)
273 {
274         _closeContour = closeContour;
275         if (_closeContour==true)
276         {
277                 _cntSplineX->ClosedOn();
278                 _cntSplineY->ClosedOn();
279                 _cntSplineZ->ClosedOn();
280         } else {
281                 _cntSplineX->ClosedOff();
282                 _cntSplineY->ClosedOff();
283                 _cntSplineZ->ClosedOff();
284         }
285 }
286
287 // ----------------------------------------------------------------------------
288 bool manualContourModel::IfCloseContour()
289 {
290         return _closeContour;
291 }
292
293 // ----------------------------------------------------------------------------
294
295 void manualContourModel::UpdateSpline() // virtual
296 {
297         int i, np;
298     np  = _lstPoints.size();
299         manualPoint     *mp;
300         _cntSplineX->RemoveAllPoints();
301         _cntSplineY->RemoveAllPoints();
302         _cntSplineZ->RemoveAllPoints();
303     for( i = 0; i < np; i++ ) {
304                 mp = GetManualPoint(i);
305         _cntSplineX->AddPoint( i, mp->GetX() );
306         _cntSplineY->AddPoint( i, mp->GetY() );
307         _cntSplineZ->AddPoint( i, mp->GetZ() );
308     } //  rof
309
310 //JSTG 25-02-08 ---------------------------------------------------------------------------------------------
311         if (this->_closeContour==true)
312         {
313                 _delta_JSTG = (double) (np) / double (_sizePointsContour - 1);  //Without the -1 the curve is not close
314         } else {
315 //              _delta_JSTG = (double) (np-1) / double (_sizePointsContour );  //Without the -1 the curve is not close
316                 _delta_JSTG = (double) (np) / double (_sizePointsContour-1 );  //Without the -1 the curve is not close
317         }
318 //-----------------------------------------------------------------------------------------------------------
319 }
320
321 //---------------------------------------------------------------------------------
322
323 /*void manualContourModel::GetSplineiPoint(int i, double &x, double &y, double &z)
324 {
325         double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour);
326         double t = delta*(double)i;
327         GetSplinePoint(t, x, y, z);
328 }*/
329
330 //-----------------------------------------------------------------------------
331
332 //JSTG 25-02-08 ---------------------------------------------------------------
333 void manualContourModel::GetSpline_i_Point(int i, double *x, double *y, double *z) // virtal
334 {
335         GetSpline_t_Point(i*_delta_JSTG,x,y,z);
336 }
337
338 // ----------------------------------------------------------------------------
339
340 //JSTG 25-02-08 ---------------------------------------------------------------
341 void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, double *z)
342 {
343                 if (_lstPoints.size()==0)
344         {
345                 *x      = 0;
346                 *y      = 0;
347                 *z      = 0;
348         }
349         if (_lstPoints.size()==1)
350         {
351                 manualPoint     *mp;
352                 mp      = GetManualPoint(0);
353                 *x      = mp->GetX();
354                 *y      = mp->GetY();
355                 *z      = mp->GetZ();
356         }
357         if (_lstPoints.size()>=2)
358         {
359                 *x      = _cntSplineX->Evaluate(t);
360                 *y      = _cntSplineY->Evaluate(t);
361                 *z      = _cntSplineZ->Evaluate(t);
362         }
363 }
364
365 // ----------------------------------------------------------------------------
366
367
368 /*void manualContourModel::GetSplinePoint(double t, double &x, double &y, double &z)
369 {
370         if (_lstPoints.size()==0)
371         {
372                 x       = 0;
373                 y       = 0;
374                 z       = 0;
375         }
376         if (_lstPoints.size()==1)
377         {
378                 manualPoint     *mp;
379                 mp      = GetManualPoint(0);
380                 x       = mp->GetX();
381                 y       = mp->GetY();
382                 z       = mp->GetZ();
383         }
384         if (_lstPoints.size()>=2)
385         {
386                 x       = _cntSplineX->Evaluate(t);
387                 y       = _cntSplineY->Evaluate(t);
388                 z       = _cntSplineZ->Evaluate(t);
389         }
390 }*/
391 // ----------------------------------------------------------------------------
392 double manualContourModel::GetPathSize()
393 {
394         double result = 0;
395         double x1,y1,z1;
396         double x2,y2,z2;
397
398 // JSTG 25-02-08 -----------------------------
399         //double t,delta;
400         //int i,np,nps;
401         int i;
402 //--------------------------------------------
403
404         if (_lstPoints.size()==2)
405         {
406                 x1=_lstPoints[0]->GetX();
407                 y1=_lstPoints[0]->GetY();
408                 z1=_lstPoints[0]->GetZ();
409                 x2=_lstPoints[1]->GetX();
410                 y2=_lstPoints[1]->GetY();
411                 z2=_lstPoints[1]->GetZ();
412                 result = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
413         }
414         if (_lstPoints.size()>2)
415         {
416
417 // JSTG 25-02-08 ------------------------------------------
418                 //np  = _lstPoints.size( );
419                 //nps = 200;
420                 //delta=( double ) ( np  ) / ( double ) ( nps  );
421                 UpdateSpline();
422                 //GetSplinePoint(0,x1,y1,z1);
423                 GetSpline_i_Point(0,&x1,&y1,&z1);
424
425                 //for( i = 1; i < nps; i++ )
426                 for( i = 1; i < GetNumberOfPointsSpline(); i++ )
427                 {
428                         //t = delta * (double)i;
429                         //GetSplinePoint(t,x2,y2,z2);
430                         GetSpline_i_Point(i,&x2,&y2,&z2);
431 //---------------------------------------------------------
432                         result=result + sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
433                         x1=x2;
434                         y1=y2;
435                         z1=z2;
436                 }// for
437         }
438
439         return result;
440 }
441 // ----------------------------------------------------------------------------
442 double manualContourModel::GetPathArea()
443 {
444         double result = 555;
445         if ((_lstPoints.size()>=3) && IfCloseContour()==true )
446         {
447                 double area;
448 //JSTG 25-02-08 ---------------------------------------------
449                 //double ti,tj;
450 //-----------------------------------------------------------
451                 double x1,y1,z1;
452                 double x2,y2,z2;
453                 bool okArea=true;
454                 int i, j;
455
456                 // This uses Green's theorem:
457                 // A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN
458                 // A < 0 -> A = |A| (a negative value could raise because points are
459                 // given in clockwise order).
460
461 //JSTG 25-02-08 -------------------------------------------------
462                 //int np  = _lstPoints.size( );
463                 //int nps = 200;
464                 int nps = GetNumberOfPointsSpline();
465                 //double delta=( double ) ( np  ) / ( double ) ( nps  );
466                 UpdateSpline();
467                 for( i = 0, area = 0.0; i < nps; i++ )
468                 {
469                         j = ( i + 1 ) % nps;
470                         //ti = delta * (double)i;
471                         //tj = delta * (double)j;
472                         //GetSplinePoint(ti,x1,y1,z1);
473                         //GetSplinePoint(tj,x2,y2,z2);
474                         GetSpline_i_Point(i,&x1,&y1,&z1);
475                         GetSpline_i_Point(j,&x2,&y2,&z2);
476 //----------------------------------------------------------------
477                         area +=
478                                         (x1 * y2 ) -
479                                         ( x2 * y1 );
480                         if (z1!=z2)
481                         {
482                                 okArea=false;
483                         }
484                 }// for
485                 area /= 2.0;
486                 area = fabs( area );
487
488 /*
489                 for( i = 0, area = 0.0; i < _lstPoints.size(); i++ )
490                 {
491                         j = ( i + 1 ) % _lstPoints.size();
492                         //  Area
493                         area +=
494                                         (_lstPoints[i]->GetX() * _lstPoints[j]->GetY() ) -
495                                         ( _lstPoints[j]->GetX() * _lstPoints[i]->GetY() );
496                         if (_lstPoints[0]->GetZ()!=_lstPoints[i]->GetZ())
497                         {
498                                 okArea=false;
499                         }
500                 } // rof
501                 area /= 2.0;
502                 area = fabs( area );
503 */
504
505                 if (okArea==true)
506                 {
507                         result = area;
508                 } else {
509                         result = -1;
510                 }
511
512         } else {
513                 result = 0;
514         }
515         return result;
516 }
517
518 // ----------------------------------------------------------------------------
519 // p[x,y,z]   :  data in
520 // rp[x,y,z]  :  data out  result point
521 // rn[x,y,z]  :  data out   result normal
522
523 void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double *rn)
524 {
525         double  distMin=999999999;
526         double  dist,dx,dy,dz;
527         double  x1,y1,z1;
528         double  x2,y2,z2;
529         int             i,np,nps;
530
531 //JSTG 25-02-08 -------------------
532         //double  tback;
533         int iback;
534         //double        t,delta;
535 //---------------------------------
536
537         np      = _lstPoints.size( );
538         if (np>=2)
539         {
540 // JSTG 25-02-08 ------------------------------------------
541                 //nps           = 200;
542                 nps = GetNumberOfPointsSpline();
543                 //delta = ( double ) ( np  ) / ( double ) ( nps  );
544                 UpdateSpline();
545                 //GetSplinePoint(0,x1,y1,z1);
546                 GetSpline_i_Point(0,&x1,&y1,&z1);
547                 for( i = 0; i < nps; i++ )
548                 {
549                         //t = delta * (double)i;
550                         //GetSplinePoint(t,x1,y1,z1);
551                         GetSpline_i_Point(i,&x1,&y1,&z1);
552 //----------------------------------------------------------
553                         dx= x1-p[0];
554                         dy= y1-p[1];
555                         dz= z1-p[2];
556                         dist = sqrt( dx*dx + dy*dy + dz*dz );
557                         if (dist<distMin)
558                         {
559                                 distMin  = dist;
560 //JSTG                  tback = t;
561                                 iback = i;
562                                 rp[0] = x1;
563                                 rp[1] = y1;
564                                 rp[2] = z1;
565                                 rn[0] = x2-x1;
566                                 rn[1] = y2-y1;
567                                 rn[2] = z2-z1;
568                         }
569                         x2=x1;
570                         y2=y1;
571                         z2=z1;
572                 }// for
573
574 // JSTG 25-02-08 ------------------------------------------
575                 //if (tback==0)
576                 if (iback==0)
577                 {
578                         //t = delta * (double)1.0;
579                         //GetSplinePoint(t,x1,y1,z1);
580                         GetSpline_i_Point(i,&x1,&y1,&z1);
581 //----------------------------------------------------------
582                         rn[0]=rp[0]-x1;
583                         rn[1]=rp[1]-y1;
584                         rn[2]=rp[2]-z1;
585                 }
586         }
587         else
588         {
589                 rp[0] = 0;
590                 rp[1] = 0;
591                 rp[2] = 0;
592                 rn[0] = -1;
593                 rn[1] = 0;
594                 rn[2] = 0;
595         }
596 }
597
598 // ----------------------------------------------------------------------------
599 manualContourModel * manualContourModel :: Clone() // virtual
600 {
601         manualContourModel * clone = new manualContourModel();
602         CopyAttributesTo(clone);
603         return clone;
604 }
605
606 // ----------------------------------------------------------------------------
607 void manualContourModel::Open(FILE *ff) // virtual
608 {
609         char tmp[255];
610         int i;
611         int numberOfControlPoints;
612         double x,y,z;
613
614         fscanf(ff,"%s",tmp); // NumberOfControlPoints
615         fscanf(ff,"%s",tmp); // ##
616         numberOfControlPoints = atoi(tmp);
617         for (i=0;i<numberOfControlPoints;i++)
618         {
619                 fscanf(ff,"%s",tmp); // X
620                 x = atof(tmp);
621                 fscanf(ff,"%s",tmp); // Y
622                 y = atof(tmp);
623                 fscanf(ff,"%s",tmp); // Z
624                 z = atof(tmp);
625                 AddPoint(x,y,z);
626         }
627 }
628
629 // ----------------------------------------------------------------------------
630 int manualContourModel::GetTypeModel() //virtual
631 {
632         // 0 spline
633         // 1 spline
634         // 2 rectangle
635         // 3 circle
636         // 4 BullEye
637         // 5 BullEyeSector
638         // 6 Line
639         return 1;
640 }
641
642 // ----------------------------------------------------------------------------
643 void manualContourModel::Save(FILE *ff) // virtual
644 {
645         int i,size=_lstPoints.size();
646         fprintf(ff,"TypeModel %d\n", GetTypeModel() );
647         fprintf(ff,"NumberOfControlPoints %d\n",size);
648         for (i=0;i<size;i++)
649         {
650                 manualPoint *mp=_lstPoints[i];
651                 fprintf(ff,"%f %f %f\n", mp->GetX(), mp->GetY(), mp->GetZ() );
652         }
653 }
654 //CMRU 03-09-09-----------------------------------------------------------------------------------------------
655 void manualContourModel::SaveData(FILE *ff)
656 {
657         std::string etiqueta = GetLabel();
658         if(etiqueta.empty())
659                 fprintf(ff,"Label: NO_LABEL\n");
660         else
661                 fprintf(ff,"Label: %s\n",etiqueta.c_str());
662         fprintf(ff,"Real_Size: %f\n",GetRealSize());
663 }
664
665 void manualContourModel::OpenData(FILE *ff)
666 {
667         char tmp[255];
668
669         fscanf(ff,"%s",tmp); // Label:
670         fscanf(ff,"%s",tmp); // value
671         std::cout<<tmp<<std::endl;
672         //if(strcmp(tmp != "NO_LABEL") // JPR
673         if(strcmp(tmp,"NO_LABEL") != 0)
674                 SetLabel(tmp);
675
676         fscanf(ff,"%s",tmp); // Real_size
677         fscanf(ff,"%s",tmp);// #
678
679         //tmp.ToDouble(&tmp);
680         SetRealSize(atof(tmp));
681 }
682
683 //------------------------------------------------------------------------------------------------------------
684
685 // ---------------------------------------------------------------------------
686
687 void manualContourModel::CopyAttributesTo( manualContourModel * cloneObject)
688 {
689         // Fathers object
690         //XXXX::CopyAttributesTo(cloneObject);
691
692         cloneObject->SetCloseContour( this->IfCloseContour() );
693         int i, size = GetSizeLstPoints();
694         for( i=0; i<size; i++ )
695         {
696                 cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
697         }
698         cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
699         cloneObject->SetCloseContour( _closeContour );
700         cloneObject->UpdateSpline();
701 }
702
703
704 // ---------------------------------------------------------------------------
705 void manualContourModel::AddManualPoint( manualPoint* theManualPoint )//private
706 {
707         _lstPoints.push_back( theManualPoint );
708 }
709
710 std::vector<manualBaseModel*> manualContourModel::ExploseModel(  )
711 {
712         std::vector<manualBaseModel*> lstTmp;
713         lstTmp.push_back(this);
714         return lstTmp;
715 }
716
717
718 // ----------------------------------------------------------------------------
719 void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
720 {
721         manualPoint * mp;
722
723         int i, size = GetSizeLstPoints();
724
725         for( i=0; i<size; i++ )
726         {
727                 mp = GetManualPoint( i );
728
729                 mp->SetPointX( mp->GetX()*Ax + Bx );
730                 mp->SetPointY( mp->GetY()*Ay + By );
731         }
732 }
733
734
735 //CMRU 17-08-09----------------------------------------------------------------------------
736 void manualContourModel::SetLabel(std::string newLabel)
737 {
738         _label = newLabel;
739 }
740
741 void manualContourModel::SetRealSize(double newRealSize) 
742 {
743         _realSize = newRealSize;
744 }
745
746 double manualContourModel::GetRealSize()
747 {
748         return _realSize;
749 }
750
751 std::string manualContourModel::GetLabel()
752 {
753         return _label;
754 }
755 //----------------------------------------------------------------------------