#include <FXPlot2D.h>
Inheritance diagram for FXPlot2D:
Public Types | |
enum | Commands { ID_FIRST = FXPlotBase::ID_LAST, ID_ZOOM_OUT, ID_SHOW_ALL, ID_GRID, ID_LEGEND, ID_SAVE, ID_PROPERTIES, ID_LAST } |
Public Member Functions | |
FXPlot2D (FXComposite *parent, FXString name) | |
Constructs an empty FXPlot2D widget. | |
~FXPlot2D () | |
Destructor, releases the owned FXCurve's. | |
void | setRangesShowAll (void) |
Set the ranges of the plot to show all the data of all curves. | |
FXCurve * | addCurve (const FXString &label, FXCurveData *x, FXCurveData *y, FXCurve::CurveStyle style=FXCurve::Lines) |
Create a new FXCurve. | |
void | addCurve (FXCurve *FXCurve) |
Add a new FXCurve to the plot. | |
void | removeCurve (FXCurve *FXCurve, FXbool del=TRUE) |
Remove the FXCurve FXCurve. | |
void | removeAllCurves () |
Remove all curves deleting them. | |
void | setRanges (double xmin, double xmax, double ymin, double ymax) |
Set the visible ranges of the first FXAxis set. | |
void | setLegend (FXbool on=TRUE) |
Set the legend visible. | |
void | setGrid (FXbool on=TRUE) |
Set the grid visible. | |
void | drawSelf (FXDC *dc, FXint rootx, FXint rooty) |
Draw this plot in the device context dc. | |
void | create (void) |
void | layout (void) |
void | recalc (void) |
long | onZoomOut (FXObject *obj, FXSelector sel, void *ptr) |
long | onShowAll (FXObject *, FXSelector, void *ptr) |
long | onProperties (FXObject *obj, FXSelector sel, void *ptr) |
long | onCmdToogleGrid (FXObject *obj, FXSelector sel, void *ptr) |
long | onCmdToogleLegend (FXObject *obj, FXSelector sel, void *ptr) |
long | onLeftBtnPress (FXObject *, FXSelector, void *ptr) |
long | onLeftBtnRelease (FXObject *, FXSelector, void *ptr) |
long | onMotion (FXObject *, FXSelector, void *ptr) |
long | onRightBtnPress (FXObject *, FXSelector, void *ptr) |
long | onKeyPress (FXObject *, FXSelector, void *ptr) |
long | onKeyRelease (FXObject *, FXSelector, void *ptr) |
long | onFocusOut (FXObject *, FXSelector, void *ptr) |
std::vector< FXCurve * >::iterator | curveBegin (void) |
First curve iterator. | |
std::vector< FXCurve * >::iterator | curveEnd (void) |
Past end curve iterator. | |
FXAxis * | getBottomAxis () |
Return a pointer to the bottom FXAxis. | |
FXAxis * | getTopAxis () |
Return a pointer to the top FXAxis. | |
FXAxis * | getLeftAxis () |
Return a pointer to the left FXAxis. | |
FXAxis * | getRightAxis () |
Return a pointer to the right FXAxis. | |
Public Attributes | |
FXRectangle | plotRect |
Rectangle for the curves (the remaining area of the zoom). | |
Protected Types | |
enum | Modes { ZoomInMode = 0x0001, ZoomOutMode = 0x0002, ZoomMask = 0x000f, LegendShown = 0x0010, LegendMoving = 0x0020, LegendMask = 0x00f0, GridShown = 0x0100 } |
Flags for zooming or legend moving. | |
Protected Member Functions | |
FXPlot2D () | |
void | updateCurves (void) |
Mark all the FXCurve's of this plot as not calculated. | |
void | drawPlot (FXDC *dc, FXint rootx, FXint rooty) |
Draw the curves in the device context dc. | |
void | drawLegend (FXDC *dc, FXint rootx, FXint rooty) |
Draw the legend in the device context dc. | |
void | drawGrid (FXDC *dc, FXint rootx, FXint rooty) |
Draw the grid in the device context dc. | |
void | drawAuxWindows (FXDC *dc, FXint rootx, FXint rooty) |
Draw the auxiliary windows in the device context dc (zoom window and legend moving). | |
void | updateCursor (FXEvent *event) |
Update the cursor (zoom in, out, etc). | |
void | setRanges (const FXDoubleRect &rect) |
Set the visible ranges of the plot to rect. | |
void | newFactor () |
Recalculate the conversion factor. | |
Static Protected Member Functions | |
static void | putRectangleInside (FXRectangle &outer, FXRectangle &r) |
Function used to guarantee that r is inside of outer. | |
Protected Attributes | |
std::vector< FXCurve * > | curves |
The curves on this plot. | |
FXCurve * | selCurve |
Current selectec FXCurve. | |
FXPlotPen | auxW |
Pen for the auxiliary windows (zoom rectangle). | |
bool | _bgRepaint |
FXRectangle | legendRect |
FXRectangle | legendRect2 |
FXFont * | legendFont |
Font for the legend. | |
FXint | flags |
Flags (zomming, legend moving...). | |
FXPoint | zoominit |
Inital point of zoom. | |
FXPoint | zoomfinal |
Final (current) point of zoom. | |
FXMenuPane * | mainmenu |
FXMenuPane * | curvesmenu |
FXCursor * | zoomin |
Zoom in cursor. | |
FXCursor * | zoomout |
Zoom out cursor. | |
FXAxis * | axisx [2] |
X FXAxis. | |
FXAxis * | axisy [2] |
Y FXAxis. |
The FXPlot2D class can be used to show FXCurve's in a 2D way. Are provided methods for zooming.
The plot has four FXAxis, each one represented by the class FXAxis. Each FXCurve is related to two different FXAxis.
New curves can be added to the plot by the addCurve() methods and can be removed with removeCurve().
Definition at line 68 of file FXPlot2D.h.
|
Add a new FXCurve to the plot. This function adds FXCurve to the plot and set the FXAxis of this FXCurve to Bottom and Right.
|
|
Create a new FXCurve. This function new FXCurve named name, given the vectors x and and add it to the Plot2D with the function addCurve(FXCurve *FXCurve); |
|
Remove all curves deleting them. This function is equivalent to call removeCurve() for all curves. |
|
If del is |
|
Mark all the FXCurve's of this plot as not calculated. When redimensioning or zooming the plot the curves became invalid, so this function is called. |
|
Rectangle for the curves (the remaining area of the zoom). FIXME: update the layout mechanism of FXAxis and make it protected. Definition at line 154 of file FXPlot2D.h. |