pGraphicalFunction.cxx

Go to the documentation of this file.
00001 
00002 //----------------------------------------------------------------------------
00003 // Class definition include
00004 //----------------------------------------------------------------------------
00005 #include "pGraphicalFunction.h"
00006 #include "math.h"
00007 #include <iostream>
00008 #include <fstream>
00009 #include <string>
00010 #include <vector>
00011 
00012 // ----------------------------------------------------------------------------
00013 // WX headers inclusion.
00014 // For compilers that support precompilation, includes <wx/wx.h>.
00015 // ----------------------------------------------------------------------------
00016 
00017 #ifndef WX_PRECOMP
00018 #include <wx/wx.h>
00019 #endif
00020 
00021 //----------------------------------------------------------------------------
00022 // Class implementation
00023 //----------------------------------------------------------------------------
00024 
00025 IMPLEMENT_CLASS(pGraphicalFunction, pPlotterLayer)
00026 
00027 pGraphicalFunction:: pGraphicalFunction(wxString name, int flags)
00028 {
00029         SetName(name);
00030         showPointsF = false;
00031         validPointRange = 5;
00032         logicFunction = new pLogicalFunction ();
00033         fromWindow=false;
00034         factorZoom=1;
00035         drawing=false;
00036         editable=true;
00037         ifActual=false;
00038         zoomIn=false;
00039         setOffsetX(0);
00040         setOffsetY(0);
00041         initialDrawingPoint=NULL;
00042         finalDrawingPoint=NULL;
00043         //type=1 means that is going to be a piecewise function
00044         _type=1;
00045         xKSpline=NULL;
00046         yKSpline=NULL;
00047         offsetPixelX=0;
00048         offsetPixelY=0;
00049         xTraslation=0;
00050         mType=DEFAULT;
00051 }
00052 
00056 pGraphicalFunction :: ~ pGraphicalFunction ()
00057 {
00058         
00059 }
00060 
00061 //set if the function has to draw the points
00062 void pGraphicalFunction::SetShowPoints(bool showPoints)
00063 {
00064         showPointsF = showPoints;
00065 }
00066 //get the paramater showPointsF
00067 bool pGraphicalFunction::getShowPoints()
00068 {
00069         return showPointsF;
00070 }
00071 /*
00072  * Set Up startPoint, endPoint, maxY,maxX points        
00073 */
00074 void pGraphicalFunction::setUp()
00075 {
00076         logicFunction->setUp();
00077         setMaxX(logicFunction->getMaxX());
00078         setMinX(logicFunction->getMinX());
00079         setMaxY(logicFunction->getMaxY());
00080         setMinY(logicFunction->getMinY());
00081         setStartX(logicFunction->getStartX());
00082         setEndX(logicFunction->getEndX());
00083         setStartY(logicFunction->getStartY());
00084         setEndY(logicFunction->getEndY());
00085         
00086 }
00087 
00088 /*
00089 * 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  
00090 * x1-validPointRange<x<x1+validPointRange y1-validPointRange<y<y1+validPointRange
00091 */
00092 int pGraphicalFunction::validPointOnFunction(wxPoint realPoint)
00093 {
00094         return (logicFunction -> validPointOnFunction (realPoint));
00095 }
00096 /*
00097 * returns the index in the list of the point 
00098 */
00099 int pGraphicalFunction::getIndexOf(wxPoint realpoint)
00100 {
00101         return logicFunction -> getIndexOf( realpoint );        
00102 }
00103 
00104 /*
00105 * This metohd returns the node of the point that is the movingPointIndex position in the list of points.
00106 * @param: int movingPointIndex, Is the index value of the searched node. 
00107 * @return: Return a pointer to the node corresponding to the index value by parameter.
00108 */
00109 wxNode* pGraphicalFunction::GetPointAt( int movingPointIndex )
00110 {
00111         return logicFunction -> GetPointAt ( movingPointIndex );        
00112 }
00113 /*
00114  * Set the scales of the function in x and y
00115  * 
00116  */
00117 void pGraphicalFunction::setScales()
00118 {
00119         //int dx= logicFunction->getMaxX()-logicFunction->getMinX();
00120         //int dy= logicFunction->getMaxY()-logicFunction->getMinY();
00121         int dx= maxShowedX-minShowedX;
00122         int dy= maxShowedY-minShowedY;
00123         
00124         
00125         if(dx!=0 && dy!=0)
00126         {
00127                 double scaleX=(((float)(screenX-100))/dx)*factorZoom;
00128                 double scaleY=(((float)(screenY-50))/dy)*factorZoom;
00129                 setScaleX(scaleX);
00130                 setScaleY(scaleY);
00131                 logicFunction->setScaleX(scaleX);
00132                 logicFunction->setScaleY(scaleY);
00133 
00134         }
00135 }
00136 /*
00137 * Includes a point between two existing points of this function. The new point (x,y) was not defined when the function was created.
00138 * @return Returns true is the point was succcesfully added to the funcion.
00139 */
00140 bool pGraphicalFunction:: AddNewPoint(int x,int y)
00141 {
00142         bool added= logicFunction -> AddNewPoint ( x, y );
00143         if(!fromWindow)
00144          setUp();
00145         else
00146         {
00147                 logicFunction->setEndPoints();
00148                 logicFunction->setStartPoints();
00149         }
00150         return added;
00151 }
00152 
00153 /*
00154 * This tries to Add a point to the function if possible it returns true.
00155 * @pre: The list of existing points is ordered.
00156 * @param: int aX, The x value of the point.
00157 * @param: int aY, The y value of the point.
00158 * @param: return Returns TRUE if the point was succesfuly included in the realPoints list.
00159 */
00160 bool pGraphicalFunction::AddPoint(int aX, int aY,bool order) 
00161 {       
00162         bool added=false;
00163         if (logicFunction!=NULL){
00164                 added=logicFunction -> AddPoint( aX, aY,order );
00165                 if(!fromWindow)
00166                         setUp();
00167                 else
00168                 {
00169                         logicFunction->setEndPoints();
00170                         logicFunction->setStartPoints();
00171                 } // if fromWindow
00172         } // if logicFunction
00173         return added;
00174 }
00175 
00181 bool pGraphicalFunction::DeletePoint(int aX, int aY) 
00182 {
00183         bool added= logicFunction -> DeletePoint( aX, aY );     
00184         if(!fromWindow)
00185          setUp();
00186         else
00187         {
00188                 logicFunction->setEndPoints();
00189                 logicFunction->setStartPoints();
00190         }
00191         return added;
00192 }
00193 
00197 bool pGraphicalFunction::deletePointAt(int index)
00198 {
00199         bool added=logicFunction -> deletePointAt( index );
00200         if(!fromWindow)
00201          setUp();
00202         else
00203         {
00204                 logicFunction->setEndPoints();
00205                 logicFunction->setStartPoints();
00206         }
00207         return added;
00208 }
00209 
00214 bool pGraphicalFunction::changePoint(wxPoint newCoords, int movingIndexPoint) 
00215 {
00216         bool added= (logicFunction -> changePoint( newCoords, movingIndexPoint ));
00217         if(!fromWindow)
00218          setUp();
00219         else
00220         {
00221                 logicFunction->setEndPoints();
00222                 logicFunction->setStartPoints();
00223         }
00224         return added;
00225 }
00229 /*
00230 bool pGraphicalFunction::hasPoint(wxPoint aPoint) 
00231 {
00232         return logicFunction -> hasPoint( aPoint );     
00233 }
00234 */
00235 
00239 double* pGraphicalFunction::getX_RealValues() 
00240 {
00241         return (logicFunction -> getX_RealValues( ));   
00242 }
00243 
00247 double * pGraphicalFunction::getY_RealValues() 
00248 {  
00249 
00250         return (logicFunction -> getY_RealValues());    
00251 }
00252 
00253 //----------------------------------
00254 // Asking if it has a point (x,y)
00255 //----------------------------------
00256 
00257 /*
00258 * returns true if the point is along the function
00259 * false otherway
00260 */
00261 bool pGraphicalFunction:: isInFunction(int x, int y)
00262 {
00263         wxNode* before;
00264         wxNode* next;
00265         pFunctionPoint* point= new pFunctionPoint(x,y);
00266         bool inLine;
00267         before=getBefore(point);
00268 
00269         if(before && before->GetNext())
00270         {
00271                 next = before->GetNext();
00272                 //next = (before->GetNext())->GetNext();
00273                 inLine= isInLine((pFunctionPoint*)before->GetData(),(pFunctionPoint*)next->GetData(),point);
00274         }
00275         else 
00276                 inLine=false;
00277         return inLine;
00278 }
00279 /*
00280 * give us the point that is in the function and is exactly before
00281 * the point we are giving
00282 */
00283 wxNode* pGraphicalFunction:: getBefore(pFunctionPoint* point)
00284 {
00285         int minDiference=10000000;
00286         wxNode* node=logicFunction->GetPointAt(0);
00287         wxNode* before=NULL;
00288         while(node)
00289         {
00290                 pFunctionPoint* before1=(pFunctionPoint*)node->GetData();
00291                 int beforeX=before1->getRealX();
00292                 int pointX=point->getRealX();
00293                 if(beforeX<pointX)
00294                 {
00295                   int minDiference1=pointX-beforeX;
00296                   if(minDiference1<minDiference)
00297                   {
00298                           minDiference=minDiference1;
00299                           before=node;
00300                   }
00301                 }
00302                 node=node->GetNext();
00303         }
00304         return before;
00305 }
00306 /*
00307 * Returns true if the point is in the line
00308 */
00309 bool pGraphicalFunction::isInLine(pFunctionPoint* before,pFunctionPoint* next, pFunctionPoint* point)
00310 {
00311         int x1,x2,x,y1,y2,y;
00312         
00313         x1=(float)before->getRealX();
00314         x2=(float)next->getRealX();
00315         y1=(float)before->getRealY();
00316         y2=(float)next->getRealY();
00317         x=(float)point->getRealX();
00318         y=(float)point->getRealY();
00319 
00320         
00321         float d1= (float)sqrt(pow(float(x1-x),2)+ pow(float(y1-y),2));
00322         float d2= (float)sqrt(pow(float(x2-x),2)+ pow(float(y2-y),2));
00323         float d=(float)sqrt(pow(float(x2-x1),2)+ pow(float(y2-y1),2));
00324         if(d1+d2<=(d*1.1) && d1<=d && d2<=d)
00325                 return true;
00326         return false;
00327 }
00331 double pGraphicalFunction::interpolateY(double m, int x1,int y1,int x)
00332 {
00333         return m*(x-x1)+y1;
00334 }
00335 
00336 //----------------------------
00337 //NEW METHODS
00338 //----------------------------
00339 
00340 //----------------------------
00341 // Spline Methods
00342 //----------------------------
00343 
00344 
00345         /*
00346         * clear the spline vectors
00347         */
00348         void pGraphicalFunction:: clearSplineVectors()
00349         {
00350                 xSpline.clear();
00351                 ySpline.clear();
00352         }
00353 
00354         /*
00355         Initiliaze xSpline and ySpline vectors
00356         */
00357         void pGraphicalFunction:: initializeSplines()
00358         {
00359                 if(xKSpline==NULL)
00360                         xKSpline = vtkKochanekSpline::New();
00361                 if(yKSpline==NULL)
00362                         yKSpline= vtkKochanekSpline::New();
00363                 addSplinesPoints();
00364 
00365         }
00366 
00367         /*
00368         Add the (x,y) points of the function to the 
00369         spline
00370         */
00371         void pGraphicalFunction::addSplinesPoints()
00372         {
00373                 xKSpline->RemoveAllPoints();
00374                 yKSpline->RemoveAllPoints();
00375                 wxNode *node= logicFunction->GetPointAt(0);
00376                 pFunctionPoint* p;
00377                 int i=0;
00378                 while(node)
00379                 {
00380                         p=(pFunctionPoint*)node->GetData();
00381                         xKSpline->AddPoint(i,p->getRealX());
00382                         yKSpline->AddPoint(i,p->getRealY());
00383                         i++;
00384                         node=node->GetNext();
00385                 }
00386         }
00387         /*
00388          This Method adds the point calculated by
00389          the splines to the vectors
00390         */
00391         void pGraphicalFunction:: initializeSplineVectors()
00392         {
00393                 double x=0,y=0,t,delta;
00394                 int i,np,nps;
00395                 //realPoints.DeleteC  
00396 
00397                 np = logicFunction->getSizePoints();
00398                 nps = 100;
00399                 delta=( double ) ( np ) / ( double ) ( nps );
00400                 for( i = 0; i < nps; i++ )
00401                 {
00402                   t = delta * (double)i;
00403                   GetSplinePoint(t,x,y);
00404                   xSpline.push_back(x);
00405                   ySpline.push_back(y);
00406                 }
00407         }
00408         /*
00409          get the spline point for t, in xKSpline and yKSpline
00410         */
00411         void pGraphicalFunction::GetSplinePoint(double t, double &x, double &y)
00412         {
00413                 if (logicFunction->getSizePoints()==0)
00414                 {
00415                         x = 0;
00416                         y = 0;
00417                 }
00418                 if (logicFunction->getSizePoints()>=2)
00419                 {
00420                         x = xKSpline->Evaluate(t);
00421                         y = yKSpline->Evaluate(t);
00422                 }
00423         }
00424 
00425 //------------------------------
00426 // Zoom Methods
00427 //------------------------------
00428 
00439 void pGraphicalFunction::zooming(int clickedX,int clickedY,int width)
00440 {
00441         int xS,yS,x1,x2,y1,y2;
00442         setScales();
00443         xS=clickedX/_scaleX+_offsetX;
00444         yS=clickedY/_scaleY+_offsetY;
00445         //square
00446         x1=(clickedX-width)/_scaleX+_offsetX;
00447         x2=(clickedX+width)/_scaleX+_offsetX;
00448         y1=(clickedY-width)/_scaleY+_offsetY;
00449         y2=(clickedY+width)/_scaleY+_offsetY;
00450 
00451         int numberPoints=getSizePoints();
00452         pFunctionPoint* point;
00453         wxNode* p;
00454         bool inSquare=false,first=false;
00455         
00456         //if the user made a zoom
00457         if(zoomIn)
00458         {
00459                 int i;
00460                 for(i=0; i<numberPoints;i++)
00461                 {
00462                         p=logicFunction->GetPointAt(i);
00463                         point=(pFunctionPoint*)p->GetData();
00464                         int rx=point->getRealX();
00465                         int ry=point->getRealY();
00466                         inSquare= rx>=x1 && rx<=x2; //&& ry>=y1 && ry<=y2;
00467                         if(inSquare)
00468                         {
00469                                 if(!first)
00470                                 {
00471                                         initialDrawingPoint=point;
00472                                         _offsetX=rx;
00473                                         _offsetY=ry;
00474                                         first=true;
00475                                 }
00476                                 finalDrawingPoint=point;
00477                         }
00478                 }
00479         }       
00480         else
00481         {
00482                 //We extend the range of vision in x and y,20 and 10 respectively
00483                 if((_offsetX-20)>=0)
00484                 {
00485                         _offsetX=_offsetX-20;
00486                 }
00487                 else
00488                         _offsetX=0;
00489                 if((_offsetY-10)>=0)
00490                 {
00491                         _offsetY=_offsetY-10;
00492                 }
00493                 else
00494                         _offsetY=0;
00495         }
00496 }
00497 
00498         /*
00499         This method sets the offsets according with the point 
00500         clicked on the window
00501         @param offx: x-value of the point clicked
00502         @param offx: y-value of the point clicked
00503         Note: all the parameters are pixels
00504         Pre: screenX, screenY are set! with the actual data.
00505         Pos: Sets the value of minXshowed,minYshowed 
00506         */
00507         void pGraphicalFunction::setOffsets(int offx,int offy)
00508         {
00509                 int xS,yS;
00510 
00511                 setScales();
00512                 
00513                 xS=(offx-offsetPixelX)/_scaleX+_offsetX + minShowedX;
00514                 yS=(offy-offsetPixelY)/_scaleY+_offsetY+ minShowedY;
00515                 
00516                 setOffsetX(xS);
00517                 setOffsetY(yS);
00518                         
00519                 //setMinShowedX(xS);
00520                 //setMinShowedY(yS);
00521 
00522                 setOffsetPixelX(offx);
00523                 setOffsetPixelY(offy);
00524                 //setMinShowed();
00525         }
00526         /*
00527         *  This method sets the minShowedX 
00528         *  and the minShowedY, accordig to the offset in
00529         *  x-axis and y-axis respectively
00530         *  pre: _offsetX>=0,_offsetY>=0
00531         *               screenX and screenY are set with the actual size of the window
00532         *               scaleX and scaleY are set to the actual size of the window
00533         * DEPRECATED!
00534         */
00535         void pGraphicalFunction::setMinShowed()
00536         {
00537                 bool firstX=false,firstY=false;
00538                 
00539                 wxNode* node=logicFunction->GetPointAt(0);
00540                 pFunctionPoint* p;
00541 
00542                 //float middleWX=(((float)(screenX-100))/2)/scaleX; // JPRx
00543                 //float middleWY=(((float)(screenY-50))/2)/scaleY; // JPRx
00544                 
00545                 //node=node->GetNext(); 
00546                 while(node)
00547                 {
00548                         p=(pFunctionPoint*)node->GetData();
00549                         int px=p->getRealX();
00550                         int py=p->getRealY();
00551                         int x=(px-_offsetX);//+middleWX;
00552                         int y=(py-_offsetY);//+middleWY;
00553                         if(!firstX && x>=0)
00554                         {
00555                                 firstX=true;
00556                                 setMinShowedX(px);
00557                         }
00558                         if(!firstY && y>=0)
00559                         {
00560                                 firstY=true;
00561                                 setMinShowedY(py);
00562                         }       
00563                         node=node->GetNext();
00564                 }
00565         }
00566 
00567 //-----------------------
00568 // Persistence
00569 //-----------------------
00570 
00571 /*
00572  Save the points of the function
00573 */
00574 void pGraphicalFunction::save(wxString fileName)
00575 {
00576         
00577         logicFunction->save(fileName);
00578 
00579 }
00580 /*
00581  Load the points of a function 
00582 */
00583 void pGraphicalFunction::load(wxString fileName)
00584 {
00585         logicFunction->load(fileName);
00586         logicFunction->setUp();
00587         setMaxShowedX(logicFunction->getMaxX());
00588         setMinShowedX(logicFunction->getMinX());
00589         setMaxShowedY(logicFunction->getMaxY());
00590         setMinShowedY(logicFunction->getMinY());
00591 }
00592         
00593 //--------------------------
00594 //GETTERS AND SETTERS
00595 //---------------------------
00599 void pGraphicalFunction::setActual(bool act)
00600 {
00601   ifActual=act;
00602 }
00603 bool pGraphicalFunction:: getActual()
00604 {
00605         return ifActual;
00606 }
00613 void pGraphicalFunction::setScaleWay(int typeS)
00614 {
00615   scaleWay=typeS;
00616 }
00617 
00618 int pGraphicalFunction:: getScaleWay()
00619 {
00620  return scaleWay;
00621 }
00622 
00623 
00624 /*
00625 * SCREEN
00626 */
00627 void pGraphicalFunction::setScreenX(int scrX)
00628 {
00629   this->screenX=scrX;
00630 }
00631 int pGraphicalFunction::getScreenX()
00632 {
00633   return this->screenX;
00634 }
00635 void pGraphicalFunction::setScreenY(int scrY)
00636 {
00637   this->screenY=scrY;
00638 }
00639 int pGraphicalFunction::getScreenY()
00640 {
00641   return this->screenY;
00642 }
00643 
00644 
00645 /*
00646 * STARTS
00647 */
00648 void pGraphicalFunction::setStartX(double aStartX) {
00649         
00650         logicFunction->setStartX(aStartX);
00651         this->_startX =logicFunction->getStartX();
00652 }
00653 
00654 double pGraphicalFunction::getStartX() 
00655 {
00656         return logicFunction->getStartX();
00657 }
00658 
00659 void pGraphicalFunction::setStartY(double aStartY) 
00660 {
00661         logicFunction->setStartY(aStartY);
00662         this->_startY = aStartY;
00663 }
00664 
00665 double pGraphicalFunction::getStartY() {
00666         return logicFunction->getStartY();
00667 }
00668 /*
00669 * ENDs
00670 */
00671 void pGraphicalFunction::setEndX(double aEndX) 
00672 {
00673         logicFunction->setEndX(aEndX);
00674         this->_endX = aEndX;
00675 }
00676 
00677 double pGraphicalFunction::getEndX() {
00678         return logicFunction->getEndX();
00679 }
00680 
00681 void pGraphicalFunction::setEndY(double aEndY) {
00682         logicFunction->setEndY(aEndY);
00683         this->_endY = aEndY;
00684 }
00685 
00686 double pGraphicalFunction::getEndY() {
00687         return logicFunction->getEndY();
00688 }
00689 /*
00690  * SCALES
00691  */
00692 void pGraphicalFunction::setScaleX(double aScaleX) 
00693 {
00694         logicFunction->setScaleX(aScaleX);
00695         this->_scaleX = aScaleX;
00696 }
00697 
00698 double pGraphicalFunction::getScaleX() 
00699 {
00700         return this->_scaleX;
00701 }
00702 
00703 void pGraphicalFunction::setScaleY(double aScaleY) 
00704 {
00705         logicFunction->setScaleY(aScaleY);
00706         this->_scaleY = aScaleY;
00707 }
00708 
00709 double pGraphicalFunction::getScaleY() {
00710         return this->_scaleY;
00711 }
00712 /*
00713  * Mins
00714  */
00715 void pGraphicalFunction::setMinX(double aMinX) 
00716 {
00717         logicFunction->setMinX(aMinX);
00718         this->_minX = aMinX;
00719 }
00720 
00721 double pGraphicalFunction::getMinX() 
00722 {
00723         return logicFunction->getMinX();
00724 }
00725 
00726 void pGraphicalFunction::setMinY(double aMinY) 
00727 {
00728         logicFunction->setMinY(aMinY);
00729         this->_minY = aMinY;
00730 }
00731 
00732 double pGraphicalFunction::getMinY() {
00733         return logicFunction->getMinY();
00734 }
00735 /*
00736  * MAXS
00737  */
00738 void pGraphicalFunction::setMaxX(double aMaxX) 
00739 {
00740         logicFunction->setMaxX(aMaxX);
00741         this->_maxX = aMaxX;
00742 }
00743 
00744 double pGraphicalFunction::getMaxX() 
00745 {
00746         return logicFunction->getMaxX();
00747 }
00748 
00749 void pGraphicalFunction::setMaxY(double aMaxY) 
00750 {
00751         logicFunction->setMaxY(aMaxY);
00752         this->_maxY = aMaxY;
00753 }
00754 
00755 double pGraphicalFunction::getMaxY() {
00756         return logicFunction->getMaxY();
00757 }
00758 
00759 /*
00760  * OFFSETS
00761  */
00762 void pGraphicalFunction::setOffsetX(double aOffsetX) 
00763 {
00764         logicFunction->setOffsetX(aOffsetX);
00765         this->_offsetX = aOffsetX;
00766 }
00767 
00768 double pGraphicalFunction:: getOffsetX() 
00769 {
00770         
00771         return this->_offsetX;
00772 }
00773 
00774 void pGraphicalFunction:: setOffsetY(double aOffsetY) 
00775 {
00776         logicFunction->setOffsetY(aOffsetY);
00777         this->_offsetY = aOffsetY;
00778 }
00779 
00780 double pGraphicalFunction:: getOffsetY() {
00781         return this->_offsetY;
00782 }
00783 
00784 /*
00785  * TYPE
00786  */
00787 void pGraphicalFunction:: setType(int aType) 
00788 {
00789         logicFunction->setType(aType);
00790         this->_type = aType;
00791 }
00792 
00793 int pGraphicalFunction :: getType() {
00794         return this->_type;
00795 }
00796 
00797 /*
00798  * validPoint
00799  */
00800 int pGraphicalFunction :: getValidPointRange()
00801 {
00802         return validPointRange;
00803 }
00804 
00805 void pGraphicalFunction :: setValidPointRange(int theRange)
00806 {
00807         logicFunction->setValidPointRange(theRange);
00808         validPointRange = theRange;
00809 }
00810 /*
00811 * Returns the number of points that the function
00812 * has
00813 */
00814 int pGraphicalFunction :: getSizePoints()
00815 {
00816         return logicFunction->getSizePoints();
00817 }
00818 
00819 /*
00820 * Sets the color points of the function by teh given parameter
00821 * @param colorVector Is the color points vector to set
00822 */
00823 void pGraphicalFunction :: setColorPoints(std::vector<pColorPoint *> &colorVector)
00824 {
00825         f_colorPoints.clear();
00826         int i = 0;      
00827         while(i<(int)(colorVector.size()))
00828         {
00829                 f_colorPoints.push_back(colorVector[i]);                
00830                 i++;
00831         }
00832 }
00833 
00834 /*
00835 * Gets the color points of the function in the given parameter
00836 * @param colorVector Is the color points list to get the points
00837 */
00838 void pGraphicalFunction :: getColorPoints(std::vector<pColorPoint *> &colorVector)
00839 {
00840         int i = 0;      
00841         while(i<(int)(f_colorPoints.size()))
00842         {
00843                 pColorPoint * originaslPoint = f_colorPoints[i];
00844                 pColorPoint * copyPoint = new pColorPoint(originaslPoint->getRealX(), originaslPoint->getColor(), originaslPoint->isTemporalColor());
00845                 colorVector.push_back(copyPoint);               
00846                 i++;
00847         }
00848 }
00849 
00850 

Generated on Fri Jun 12 00:08:33 2009 for creaMaracasVisu by  doxygen 1.5.7.1