]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx
a425cb98722d34aacba2500264ab11a76f0c2b84
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pGraphicalFunction.cxx
1
2 //----------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------
5 #include "pGraphicalFunction.h"
6 #include "math.h"
7 #include <iostream>
8 #include <fstream>
9 #include <string>
10 #include <vector>
11
12 // ----------------------------------------------------------------------------
13 // WX headers inclusion.
14 // For compilers that support precompilation, includes <wx/wx.h>.
15 // ----------------------------------------------------------------------------
16
17 #ifndef WX_PRECOMP
18 #include <wx/wx.h>
19 #endif
20
21 //----------------------------------------------------------------------------
22 // Class implementation
23 //----------------------------------------------------------------------------
24
25 IMPLEMENT_CLASS(pGraphicalFunction, pPlotterLayer)
26
27 pGraphicalFunction:: pGraphicalFunction(wxString name, int flags)
28 {
29         SetName(name);
30         showPointsF = false;
31         validPointRange = 5;
32         logicFunction = new pLogicalFunction ();
33         fromWindow=false;
34         factorZoom=1;
35         drawing=false;
36         editable=true;
37         ifActual=false;
38         zoomIn=false;
39         setOffsetX(0);
40         setOffsetY(0);
41         initialDrawingPoint=NULL;
42         finalDrawingPoint=NULL;
43         //type=1 means that is going to be a piecewise function
44         _type=1;
45         xKSpline=NULL;
46         yKSpline=NULL;
47         offsetPixelX=0;
48         offsetPixelY=0;
49         xTraslation=0;
50         mType=DEFAULT;
51 }
52
53 /**
54 * Is the destructor!!!
55 */
56 pGraphicalFunction :: ~ pGraphicalFunction ()
57 {
58         
59 }
60
61 //set if the function has to draw the points
62 void pGraphicalFunction::SetShowPoints(bool showPoints)
63 {
64         showPointsF = showPoints;
65 }
66 //get the paramater showPointsF
67 bool pGraphicalFunction::getShowPoints()
68 {
69         return showPointsF;
70 }
71 /*
72  * Set Up startPoint, endPoint, maxY,maxX points        
73 */
74 void pGraphicalFunction::setUp()
75 {
76         logicFunction->setUp();
77         setMaxX(logicFunction->getMaxX());
78         setMinX(logicFunction->getMinX());
79         setMaxY(logicFunction->getMaxY());
80         setMinY(logicFunction->getMinY());
81         setStartX(logicFunction->getStartX());
82         setEndX(logicFunction->getEndX());
83         setStartY(logicFunction->getStartY());
84         setEndY(logicFunction->getEndY());
85         
86 }
87
88 /*
89 * validate if the function has that point in a sensible area returning the index where the point was found or -1 if is in not part of the function: define the sensible area is  
90 * x1-validPointRange<x<x1+validPointRange y1-validPointRange<y<y1+validPointRange
91 */
92 int pGraphicalFunction::validPointOnFunction(wxPoint realPoint)
93 {
94         return (logicFunction -> validPointOnFunction (realPoint));
95 }
96 /*
97 * returns the index in the list of the point 
98 */
99 int pGraphicalFunction::getIndexOf(wxPoint realpoint)
100 {
101         return logicFunction -> getIndexOf( realpoint );        
102 }
103
104 /*
105 * This metohd returns the node of the point that is the movingPointIndex position in the list of points.
106 * @param: int movingPointIndex, Is the index value of the searched node. 
107 * @return: Return a pointer to the node corresponding to the index value by parameter.
108 */
109 wxNode* pGraphicalFunction::GetPointAt( int movingPointIndex )
110 {
111         return logicFunction -> GetPointAt ( movingPointIndex );        
112 }
113 /*
114  * Set the scales of the function in x and y
115  * 
116  */
117 void pGraphicalFunction::setScales()
118 {
119         //int dx= logicFunction->getMaxX()-logicFunction->getMinX();
120         //int dy= logicFunction->getMaxY()-logicFunction->getMinY();
121         int dx= maxShowedX-minShowedX;
122         int dy= maxShowedY-minShowedY;
123         
124         
125         if(dx!=0 && dy!=0)
126         {
127                 double scaleX=(((float)(screenX-100))/dx)*factorZoom;
128                 double scaleY=(((float)(screenY-50))/dy)*factorZoom;
129                 setScaleX(scaleX);
130                 setScaleY(scaleY);
131                 logicFunction->setScaleX(scaleX);
132                 logicFunction->setScaleY(scaleY);
133
134         }
135 }
136 /*
137 * Includes a point between two existing points of this function. The new point (x,y) was not defined when the function was created.
138 * @return Returns true is the point was succcesfully added to the funcion.
139 */
140 bool pGraphicalFunction:: AddNewPoint(int x,int y)
141 {
142         bool added= logicFunction -> AddNewPoint ( x, y );
143         if(!fromWindow)
144          setUp();
145         else
146         {
147                 logicFunction->setEndPoints();
148                 logicFunction->setStartPoints();
149         }
150         return added;
151 }
152
153 /*
154 * This tries to Add a point to the function if possible it returns true.
155 * @pre: The list of existing points is ordered.
156 * @param: int aX, The x value of the point.
157 * @param: int aY, The y value of the point.
158 * @param: return Returns TRUE if the point was succesfuly included in the realPoints list.
159 */
160 bool pGraphicalFunction::AddPoint(int aX, int aY,bool order) 
161 {       
162         bool added=false;
163         if (logicFunction!=NULL){
164                 added=logicFunction -> AddPoint( aX, aY,order );
165                 if(!fromWindow)
166                         setUp();
167                 else
168                 {
169                         logicFunction->setEndPoints();
170                         logicFunction->setStartPoints();
171                 } // if fromWindow
172         } // if logicFunction
173         return added;
174 }
175
176 /**
177 * deletes the point given by the  user  from the collection of logical points of the function
178 * is not used
179 */
180
181 bool pGraphicalFunction::DeletePoint(int aX, int aY) 
182 {
183         bool added= logicFunction -> DeletePoint( aX, aY );     
184         if(!fromWindow)
185          setUp();
186         else
187         {
188                 logicFunction->setEndPoints();
189                 logicFunction->setStartPoints();
190         }
191         return added;
192 }
193
194 /**
195 * deletes a point of the functio given its index
196 */
197 bool pGraphicalFunction::deletePointAt(int index)
198 {
199         bool added=logicFunction -> deletePointAt( index );
200         if(!fromWindow)
201          setUp();
202         else
203         {
204                 logicFunction->setEndPoints();
205                 logicFunction->setStartPoints();
206         }
207         return added;
208 }
209
210 /**
211 * Change de coordinates of the given index point to the newCoords, if it is possible and return the result of the invoked action. 
212 * @retun Return TRUE if it was possible to do the change. A valid change is when the new x value of the point is still between the previous and next point, when condition.
213 */
214 bool pGraphicalFunction::changePoint(wxPoint newCoords, int movingIndexPoint) 
215 {
216         bool added= (logicFunction -> changePoint( newCoords, movingIndexPoint ));
217         if(!fromWindow)
218          setUp();
219         else
220         {
221                 logicFunction->setEndPoints();
222                 logicFunction->setStartPoints();
223         }
224         return added;
225 }
226 /**
227 * Evaluates if the given point belongs to the function.
228 */
229 /*
230 bool pGraphicalFunction::hasPoint(wxPoint aPoint) 
231 {
232         return logicFunction -> hasPoint( aPoint );     
233 }
234 */
235
236 /**
237 * Returns the real x values of the control points of the function. It dont includes the points calculated by interpolation.
238 */
239 double* pGraphicalFunction::getX_RealValues() 
240 {
241         return (logicFunction -> getX_RealValues( ));   
242 }
243
244 /**
245 * Returns the real y values of the control points of the function. It dont includes the points calculated by interpolation.
246 */
247 double * pGraphicalFunction::getY_RealValues() 
248 {  
249
250         return (logicFunction -> getY_RealValues());    
251 }
252
253 //----------------------------------
254 // Asking if it has a point (x,y)
255 //----------------------------------
256
257 /*
258 * returns true if the point is along the function
259 * false otherway
260 */
261 bool pGraphicalFunction:: isInFunction(int x, int y)
262 {
263         wxNode* before;
264         wxNode* next;
265         pFunctionPoint* point= new pFunctionPoint(x,y);
266         bool inLine;
267         before=getBefore(point);
268
269         if(before && before->GetNext())
270         {
271                 next = before->GetNext();
272                 //next = (before->GetNext())->GetNext();
273                 inLine= isInLine((pFunctionPoint*)before->GetData(),(pFunctionPoint*)next->GetData(),point);
274         }
275         else 
276                 inLine=false;
277         return inLine;
278 }
279 /*
280 * give us the point that is in the function and is exactly before
281 * the point we are giving
282 */
283 wxNode* pGraphicalFunction:: getBefore(pFunctionPoint* point)
284 {
285         int minDiference=10000000;
286         wxNode* node=logicFunction->GetPointAt(0);
287         wxNode* before=NULL;
288         while(node)
289         {
290                 pFunctionPoint* before1=(pFunctionPoint*)node->GetData();
291                 int beforeX=before1->getRealX();
292                 int pointX=point->getRealX();
293                 if(beforeX<pointX)
294                 {
295                   int minDiference1=pointX-beforeX;
296                   if(minDiference1<minDiference)
297                   {
298                           minDiference=minDiference1;
299                           before=node;
300                   }
301                 }
302                 node=node->GetNext();
303         }
304         return before;
305 }
306 /*
307 * Returns true if the point is in the line
308 */
309 bool pGraphicalFunction::isInLine(pFunctionPoint* before,pFunctionPoint* next, pFunctionPoint* point)
310 {
311         int x1,x2,x,y1,y2,y;
312         
313         x1=(float)before->getRealX();
314         x2=(float)next->getRealX();
315         y1=(float)before->getRealY();
316         y2=(float)next->getRealY();
317         x=(float)point->getRealX();
318         y=(float)point->getRealY();
319
320         
321         float d1= (float)sqrt(pow(float(x1-x),2)+ pow(float(y1-y),2));
322         float d2= (float)sqrt(pow(float(x2-x),2)+ pow(float(y2-y),2));
323         float d=(float)sqrt(pow(float(x2-x1),2)+ pow(float(y2-y1),2));
324         if(d1+d2<=(d*1.1) && d1<=d && d2<=d)
325                 return true;
326         return false;
327 }
328 /**
329 * give us the value of y in the line define by the arguments
330 */
331 double pGraphicalFunction::interpolateY(double m, int x1,int y1,int x)
332 {
333         return m*(x-x1)+y1;
334 }
335
336 //----------------------------
337 //NEW METHODS
338 //----------------------------
339
340 //----------------------------
341 // Spline Methods
342 //----------------------------
343
344
345         /*
346         * clear the spline vectors
347         */
348         void pGraphicalFunction:: clearSplineVectors()
349         {
350                 xSpline.clear();
351                 ySpline.clear();
352         }
353
354         /*
355         Initiliaze xSpline and ySpline vectors
356         */
357         void pGraphicalFunction:: initializeSplines()
358         {
359                 if(xKSpline==NULL)
360                         xKSpline = vtkKochanekSpline::New();
361                 if(yKSpline==NULL)
362                         yKSpline= vtkKochanekSpline::New();
363                 addSplinesPoints();
364
365         }
366
367         /*
368         Add the (x,y) points of the function to the 
369         spline
370         */
371         void pGraphicalFunction::addSplinesPoints()
372         {
373                 xKSpline->RemoveAllPoints();
374                 yKSpline->RemoveAllPoints();
375                 wxNode *node= logicFunction->GetPointAt(0);
376                 pFunctionPoint* p;
377                 int i=0;
378                 while(node)
379                 {
380                         p=(pFunctionPoint*)node->GetData();
381                         xKSpline->AddPoint(i,p->getRealX());
382                         yKSpline->AddPoint(i,p->getRealY());
383                         i++;
384                         node=node->GetNext();
385                 }
386         }
387         /*
388          This Method adds the point calculated by
389          the splines to the vectors
390         */
391         void pGraphicalFunction:: initializeSplineVectors()
392         {
393                 double x=0,y=0,t,delta;
394                 int i,np,nps;
395                 //realPoints.DeleteC  
396
397                 np = logicFunction->getSizePoints();
398                 nps = 100;
399                 delta=( double ) ( np ) / ( double ) ( nps );
400                 for( i = 0; i < nps; i++ )
401                 {
402                   t = delta * (double)i;
403                   GetSplinePoint(t,x,y);
404                   xSpline.push_back(x);
405                   ySpline.push_back(y);
406                 }
407         }
408         /*
409          get the spline point for t, in xKSpline and yKSpline
410         */
411         void pGraphicalFunction::GetSplinePoint(double t, double &x, double &y)
412         {
413                 if (logicFunction->getSizePoints()==0)
414                 {
415                         x = 0;
416                         y = 0;
417                 }
418                 if (logicFunction->getSizePoints()>=2)
419                 {
420                         x = xKSpline->Evaluate(t);
421                         y = yKSpline->Evaluate(t);
422                 }
423         }
424
425 //------------------------------
426 // Zoom Methods
427 //------------------------------
428
429 /**
430 This method set the initial point and the final point of drawing
431 according with the width of the square around the point clicked
432 @param clickedX
433 @param clickedY
434 @param width: width of the square
435 Note: all the parameters are pixels
436 Pre: screenX, screenY, zoom are set! with the actual data.
437 DEPRECATED!
438 */
439 void pGraphicalFunction::zooming(int clickedX,int clickedY,int width)
440 {
441         int xS,yS,x1,x2,y1,y2;
442         setScales();
443         xS=clickedX/_scaleX+_offsetX;
444         yS=clickedY/_scaleY+_offsetY;
445         //square
446         x1=(clickedX-width)/_scaleX+_offsetX;
447         x2=(clickedX+width)/_scaleX+_offsetX;
448         y1=(clickedY-width)/_scaleY+_offsetY;
449         y2=(clickedY+width)/_scaleY+_offsetY;
450
451         int numberPoints=getSizePoints();
452         pFunctionPoint* point;
453         wxNode* p;
454         bool inSquare=false,first=false;
455         
456         //if the user made a zoom
457         if(zoomIn)
458         {
459                 int i;
460                 for(i=0; i<numberPoints;i++)
461                 {
462                         p=logicFunction->GetPointAt(i);
463                         point=(pFunctionPoint*)p->GetData();
464                         int rx=point->getRealX();
465                         int ry=point->getRealY();
466                         inSquare= rx>=x1 && rx<=x2; //&& ry>=y1 && ry<=y2;
467                         if(inSquare)
468                         {
469                                 if(!first)
470                                 {
471                                         initialDrawingPoint=point;
472                                         _offsetX=rx;
473                                         _offsetY=ry;
474                                         first=true;
475                                 }
476                                 finalDrawingPoint=point;
477                         }
478                 }
479         }       
480         else
481         {
482                 //We extend the range of vision in x and y,20 and 10 respectively
483                 if((_offsetX-20)>=0)
484                 {
485                         _offsetX=_offsetX-20;
486                 }
487                 else
488                         _offsetX=0;
489                 if((_offsetY-10)>=0)
490                 {
491                         _offsetY=_offsetY-10;
492                 }
493                 else
494                         _offsetY=0;
495         }
496 }
497
498         /*
499         This method sets the offsets according with the point 
500         clicked on the window
501         @param offx: x-value of the point clicked
502         @param offx: y-value of the point clicked
503         Note: all the parameters are pixels
504         Pre: screenX, screenY are set! with the actual data.
505         Pos: Sets the value of minXshowed,minYshowed 
506         */
507         void pGraphicalFunction::setOffsets(int offx,int offy)
508         {
509                 int xS,yS;
510
511                 setScales();
512                 
513                 xS=(offx-offsetPixelX)/_scaleX+_offsetX + minShowedX;
514                 yS=(offy-offsetPixelY)/_scaleY+_offsetY+ minShowedY;
515                 
516                 setOffsetX(xS);
517                 setOffsetY(yS);
518                         
519                 //setMinShowedX(xS);
520                 //setMinShowedY(yS);
521
522                 setOffsetPixelX(offx);
523                 setOffsetPixelY(offy);
524                 //setMinShowed();
525         }
526         /*
527         *  This method sets the minShowedX 
528         *  and the minShowedY, accordig to the offset in
529         *  x-axis and y-axis respectively
530         *  pre: _offsetX>=0,_offsetY>=0
531         *               screenX and screenY are set with the actual size of the window
532         *               scaleX and scaleY are set to the actual size of the window
533         * DEPRECATED!
534         */
535         void pGraphicalFunction::setMinShowed()
536         {
537                 bool firstX=false,firstY=false;
538                 
539                 wxNode* node=logicFunction->GetPointAt(0);
540                 pFunctionPoint* p;
541
542                 //float middleWX=(((float)(screenX-100))/2)/scaleX; // JPRx
543                 //float middleWY=(((float)(screenY-50))/2)/scaleY; // JPRx
544                 
545                 //node=node->GetNext(); 
546                 while(node)
547                 {
548                         p=(pFunctionPoint*)node->GetData();
549                         int px=p->getRealX();
550                         int py=p->getRealY();
551                         int x=(px-_offsetX);//+middleWX;
552                         int y=(py-_offsetY);//+middleWY;
553                         if(!firstX && x>=0)
554                         {
555                                 firstX=true;
556                                 setMinShowedX(px);
557                         }
558                         if(!firstY && y>=0)
559                         {
560                                 firstY=true;
561                                 setMinShowedY(py);
562                         }       
563                         node=node->GetNext();
564                 }
565         }
566
567 //-----------------------
568 // Persistence
569 //-----------------------
570
571 /*
572  Save the points of the function
573 */
574 void pGraphicalFunction::save(wxString fileName)
575 {
576         
577         logicFunction->save(fileName);
578
579 }
580 /*
581  Load the points of a function 
582 */
583 void pGraphicalFunction::load(wxString fileName)
584 {
585         logicFunction->load(fileName);
586         logicFunction->setUp();
587         setMaxShowedX(logicFunction->getMaxX());
588         setMinShowedX(logicFunction->getMinX());
589         setMaxShowedY(logicFunction->getMaxY());
590         setMinShowedY(logicFunction->getMinY());
591 }
592         
593 //--------------------------
594 //GETTERS AND SETTERS
595 //---------------------------
596 /**
597 * actual
598 */
599 void pGraphicalFunction::setActual(bool act)
600 {
601   ifActual=act;
602 }
603 bool pGraphicalFunction:: getActual()
604 {
605         return ifActual;
606 }
607 /**
608 * SCALE WAY
609 * DEFECT_SCALE 1
610 * MAX_SCALE 2
611 * USER_SCALE 3
612 */
613 void pGraphicalFunction::setScaleWay(int typeS)
614 {
615   scaleWay=typeS;
616 }
617
618 int pGraphicalFunction:: getScaleWay()
619 {
620  return scaleWay;
621 }
622
623
624 /*
625 * SCREEN
626 */
627 void pGraphicalFunction::setScreenX(int scrX)
628 {
629   this->screenX=scrX;
630 }
631 int pGraphicalFunction::getScreenX()
632 {
633   return this->screenX;
634 }
635 void pGraphicalFunction::setScreenY(int scrY)
636 {
637   this->screenY=scrY;
638 }
639 int pGraphicalFunction::getScreenY()
640 {
641   return this->screenY;
642 }
643
644
645 /*
646 * STARTS
647 */
648 void pGraphicalFunction::setStartX(double aStartX) {
649         
650         logicFunction->setStartX(aStartX);
651         this->_startX =logicFunction->getStartX();
652 }
653
654 double pGraphicalFunction::getStartX() 
655 {
656         return logicFunction->getStartX();
657 }
658
659 void pGraphicalFunction::setStartY(double aStartY) 
660 {
661         logicFunction->setStartY(aStartY);
662         this->_startY = aStartY;
663 }
664
665 double pGraphicalFunction::getStartY() {
666         return logicFunction->getStartY();
667 }
668 /*
669 * ENDs
670 */
671 void pGraphicalFunction::setEndX(double aEndX) 
672 {
673         logicFunction->setEndX(aEndX);
674         this->_endX = aEndX;
675 }
676
677 double pGraphicalFunction::getEndX() {
678         return logicFunction->getEndX();
679 }
680
681 void pGraphicalFunction::setEndY(double aEndY) {
682         logicFunction->setEndY(aEndY);
683         this->_endY = aEndY;
684 }
685
686 double pGraphicalFunction::getEndY() {
687         return logicFunction->getEndY();
688 }
689 /*
690  * SCALES
691  */
692 void pGraphicalFunction::setScaleX(double aScaleX) 
693 {
694         logicFunction->setScaleX(aScaleX);
695         this->_scaleX = aScaleX;
696 }
697
698 double pGraphicalFunction::getScaleX() 
699 {
700         return this->_scaleX;
701 }
702
703 void pGraphicalFunction::setScaleY(double aScaleY) 
704 {
705         logicFunction->setScaleY(aScaleY);
706         this->_scaleY = aScaleY;
707 }
708
709 double pGraphicalFunction::getScaleY() {
710         return this->_scaleY;
711 }
712 /*
713  * Mins
714  */
715 void pGraphicalFunction::setMinX(double aMinX) 
716 {
717         logicFunction->setMinX(aMinX);
718         this->_minX = aMinX;
719 }
720
721 double pGraphicalFunction::getMinX() 
722 {
723         return logicFunction->getMinX();
724 }
725
726 void pGraphicalFunction::setMinY(double aMinY) 
727 {
728         logicFunction->setMinY(aMinY);
729         this->_minY = aMinY;
730 }
731
732 double pGraphicalFunction::getMinY() {
733         return logicFunction->getMinY();
734 }
735 /*
736  * MAXS
737  */
738 void pGraphicalFunction::setMaxX(double aMaxX) 
739 {
740         logicFunction->setMaxX(aMaxX);
741         this->_maxX = aMaxX;
742 }
743
744 double pGraphicalFunction::getMaxX() 
745 {
746         return logicFunction->getMaxX();
747 }
748
749 void pGraphicalFunction::setMaxY(double aMaxY) 
750 {
751         logicFunction->setMaxY(aMaxY);
752         this->_maxY = aMaxY;
753 }
754
755 double pGraphicalFunction::getMaxY() {
756         return logicFunction->getMaxY();
757 }
758
759 /*
760  * OFFSETS
761  */
762 void pGraphicalFunction::setOffsetX(double aOffsetX) 
763 {
764         logicFunction->setOffsetX(aOffsetX);
765         this->_offsetX = aOffsetX;
766 }
767
768 double pGraphicalFunction:: getOffsetX() 
769 {
770         
771         return this->_offsetX;
772 }
773
774 void pGraphicalFunction:: setOffsetY(double aOffsetY) 
775 {
776         logicFunction->setOffsetY(aOffsetY);
777         this->_offsetY = aOffsetY;
778 }
779
780 double pGraphicalFunction:: getOffsetY() {
781         return this->_offsetY;
782 }
783
784 /*
785  * TYPE
786  */
787 void pGraphicalFunction:: setType(int aType) 
788 {
789         logicFunction->setType(aType);
790         this->_type = aType;
791 }
792
793 int pGraphicalFunction :: getType() {
794         return this->_type;
795 }
796
797 /*
798  * validPoint
799  */
800 int pGraphicalFunction :: getValidPointRange()
801 {
802         return validPointRange;
803 }
804
805 void pGraphicalFunction :: setValidPointRange(int theRange)
806 {
807         logicFunction->setValidPointRange(theRange);
808         validPointRange = theRange;
809 }
810 /*
811 * Returns the number of points that the function
812 * has
813 */
814 int pGraphicalFunction :: getSizePoints()
815 {
816         return logicFunction->getSizePoints();
817 }
818
819 /*
820 * Sets the color points of the function by teh given parameter
821 * @param colorVector Is the color points vector to set
822 */
823 void pGraphicalFunction :: setColorPoints(std::vector<pColorPoint *> &colorVector)
824 {
825         f_colorPoints.clear();
826         int i = 0;      
827         while(i<(int)(colorVector.size()))
828         {
829                 f_colorPoints.push_back(colorVector[i]);                
830                 i++;
831         }
832 }
833
834 /*
835 * Gets the color points of the function in the given parameter
836 * @param colorVector Is the color points list to get the points
837 */
838 void pGraphicalFunction :: getColorPoints(std::vector<pColorPoint *> &colorVector)
839 {
840         int i = 0;      
841         while(i<(int)(f_colorPoints.size()))
842         {
843                 pColorPoint * originaslPoint = f_colorPoints[i];
844                 pColorPoint * copyPoint = new pColorPoint(originaslPoint->getRealX(), originaslPoint->getColor(), originaslPoint->isTemporalColor());
845                 colorVector.push_back(copyPoint);               
846                 i++;
847         }
848 }
849
850