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