2 #ifndef __pPlotterLayer_h__
3 #define __pPlotterLayer_h__
4 // ----------------------------------------------------------------------------
5 // WX headers inclusion.
6 // For compilers that support precompilation, includes <wx/wx.h>.
7 // ----------------------------------------------------------------------------
18 //----------------------------------------------------------------------------
20 //----------------------------------------------------------------------------
22 #include "pFunctionPoint.h"
29 //using namespace std;
30 //----------------------------------------------------------------------------
32 //----------------------------------------------------------------------------
33 class creaMaracasVisu_EXPORT pPlotterLayer: public mpLayer
38 @param flags Label alignment, pass one of #mpALIGN_NE, #mpALIGN_NW, #mpALIGN_SW, #mpALIGN_SE.
40 pPlotterLayer(wxString name = wxEmptyString, int flags = mpALIGN_NE);
42 it define the first point of the polygon for be drawing
43 returs true if the first and second point of the polygon are setted
45 bool initializePolygon(wxPoint* points,double x1, double y1,double x2, double y2);
47 Draw the line from (x1,y1) to (x2,y2) only passing by the
48 positive points in the line
50 void draw(wxDC & dc,mpWindow & w,double x1,double y1,double x2,double y2);
53 * Draw the function with th spline points
56 void drawSplineCurve(wxDC & dc,mpWindow & w);
59 * Draw the line between the last point of the function
60 * and the position of the mouse
62 void drawLineToMousePoint(wxDC & dc,mpWindow & w);
64 * Draw le lines between the points of the function
66 void drawFunction(wxDC & dc,mpWindow & w);
68 * Draw the points of the function
70 void drawPoints(wxDC & dc,mpWindow & w);
73 Get the value of the traslation
76 virtual int getXTraslation()
81 Get the type of the curve
85 virtual int getmType()
90 * get the maxShowed of the function in x and y
92 virtual void getMaxShowed(int & maxX, int &maxY)
96 * get the minShowed of the function in x and y
98 virtual void getMinShowed(int & minX, int &minY)
103 Gets the x-offset of the zoom
106 virtual int getOffsetPixelsXv(){return -1;}
110 Gets the Y-offset of the zoom
113 virtual int getOffsetPixelsYv(){ return -1;}
117 returns the xSpline to plotter
119 virtual std::vector<double> getXSpline()
121 std::vector<double> v;
125 returns the ySpline to plotter
127 virtual std::vector<double> getYSpline()
129 std::vector<double> v;
134 Get the type of the curve
138 virtual int vGetType()
143 Get _offsetX and _offsetY
146 virtual void getOffsets(int &offsetX,int &offSetY )
150 * Get the factor zoom
152 virtual void getFactorZoom(float & fz){}
154 * if the function that is drawing is the actual
156 virtual void getIfActual(bool &actual){}
160 * get the max of the function in x and y
162 virtual void getMax(int & maxX, int &maxY){}
165 * Get screens of the function
167 virtual void getScreens(int & scrX, int & scrY){}
172 virtual void setScreens(int scrX,int scrY){}
175 * Let us know the scale of the function
177 virtual void getScales(double & scaleX,double & scaleY){}
180 *Rewind the value of node
182 virtual void Rewind(){}
184 /** Get locus value for next N.
185 Override this function in your implementation.
186 @param x Returns X value
187 @param y Returns Y value
189 virtual bool GetNextXY(double & x, double & y){return false;}
192 Get Point list of the funcion
195 virtual void GetPoints(wxList &points){}
197 /** Layer plot handler.
198 This implementation will plot the locus in the visible area and
199 put a label according to the aligment specified.
201 virtual void Plot(wxDC & dc, mpWindow & w);
203 Let us Know if the user want to see the points of the function
204 of other color than the color of the lines
206 virtual void ifShowPoints(bool & show){}
209 * Let us Know if the user has finished the drawing
210 * that starts before.
212 virtual void getDrawing(bool &draw){}
214 * Gets the point of the mouse where the user is
216 virtual void getMousePoint(int &x,int &y){}
218 * this method gets the direction of the drawing
220 virtual void getDirection(bool &dir){}
222 * Get the number of points of the function
224 virtual void getSize(int &size){};
227 int m_flags; //!< Holds label alignment
229 * Points of the function thats is drawing
233 * the scale in x, with wich it must draw
237 * the scale in y, with wich it must draw
252 DECLARE_CLASS (pPlotterLayer)