Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

FXCurve Class Reference

A FXCurve to be plotted in a FXPlot2D. More...

#include <FXCurve.h>

Inheritance diagram for FXCurve:

FXSPCCurve List of all members.

Public Types

enum  CurveStyle {
  Lines = 0,
  Steps,
  NoCurve
}
 FXCurve styles. More...
enum  MarkStyle {
  Square = 0,
  Circle,
  Triangle,
  TriangleInv,
  X,
  NoMark
}
 Possible marks for the curve.

Public Member Functions

void loadDefault (FXuint width, FXuint counter)
 Load default settings for the pen, based on a given counter.
void setAxis (FXAxis *x, FXAxis *y)
 Sets the axis for the curve.
void drawSample (FXDC *p, FXint x, FXint y, FXbool line=false) const
 Draws one point of the curve at a given point.
void setLabel (FXString curveName)
 Sets the curve label.
virtual void drawSelf (FXDC *dc, FXint rootx, FXint rooty)
 Draws the contents on the device context.
const FXCurveDatagetDataX (void)
 Returns the x curve data.
const FXCurveDatagetDataY (void)
 Returns the y curve data.
void setView (FXPlot2D *view)
 Changes the view where this curve lives.
const FXPlotPengetPen (void) const
 The pen of this curve.
CurveStyle getStyle () const
 Returns the curve style.
void setStyle (CurveStyle style)
 Ste the curve style.
enum MarkStyle getMarkStyle (void) const
 The mark style.
FXint getMarkSize (void) const
 The mark size.
FXColor getMarkColor (void) const
 The mark color.
void setPen (const FXPlotPen &pen)
 Set the pen.
void setMarkSize (FXint size)
 Sets the mark size.
void setMarkStyle (MarkStyle m)
 Sets the mark style.
void setMarkColor (FXColor color)
 Set mark color.
void update ()
 Schedule a calculation for the curve.
 FXCurve (const FXString &label, FXCurveData *x, FXCurveData *y, CurveStyle style=Lines, FXPlot2D *view=NULL)
 Constructor for a curve memory x and y.
virtual ~FXCurve ()
 Destructor.
void calcule (FXint rootx, FXint rooty)
 Calculate the point positions (depends on axis).
FXString getLabel () const
 The curve label.

Protected Member Functions

virtual void drawSteps (FXDC *dc) const
 Draw a step line curve for the current points.
virtual void drawMarks (FXDC *dc) const
 Draw the marks of the curve.
virtual void drawMark (FXDC *dc, FXPoint p, MarkStyle style, FXint size, FXColor color) const
 Draws one mark at the given point with the given style and color.

Protected Attributes

FXString label
 FXCurve label.
FXPlot2Dplot
 Plot pointer.
FXAxisaxisx
 X axis for this curve.
FXAxisaxisy
 Y axis for this curve.
FXCurveDatadatax
 Raw data for x.
FXCurveDatadatay
 Raw data for y.
std::vector< FXPoint > points
 Points to be ploted.
MarkStyle mark
 Mark style.
FXint marksize
 Mark size.
FXColor markcolor
 Mark color.
FXPlotPen pen
 Drawing pen.
CurveStyle style
 The curve style.
FXbool calculated
 Flag if already calculated.

Detailed Description

A FXCurve to be plotted in a FXPlot2D.

One plot can have any number of curves.

Definition at line 141 of file FXCurve.h.


Member Enumeration Documentation

enum FXCurve::CurveStyle
 

FXCurve styles.

See also:
setStyle.

Definition at line 147 of file FXCurve.h.


Constructor & Destructor Documentation

FXCurve::FXCurve const FXString &  label,
FXCurveData x,
FXCurveData y,
CurveStyle  style = Lines,
FXPlot2D view = NULL
 

Constructor for a curve memory x and y.

The FXCurve will delete the given FXCurveData pointers when destructing the curve.


Member Function Documentation

virtual void FXCurve::drawMarks FXDC *  dc  )  const [protected, virtual]
 

Draw the marks of the curve.

This function is called by drawSelf() and can be overloaded to get a different behaviour.

See also:
drawMark

void FXCurve::drawSample FXDC *  p,
FXint  x,
FXint  y,
FXbool  line = false
const
 

Draws one point of the curve at a given point.

This function is used to draw the legend.

See also:
drawMark

virtual void FXCurve::drawSteps FXDC *  dc  )  const [protected, virtual]
 

Draw a step line curve for the current points.

This function is called by drawSelf() and can be overloaded to get a different behaviour.

void FXCurve::setAxis FXAxis x,
FXAxis y
 

Sets the axis for the curve.

The calculation of the points of a curve are based on the axis.

void FXCurve::update  )  [inline]
 

Schedule a calculation for the curve.

This function is called when zooming, or if the axis has changed.

Definition at line 278 of file FXCurve.h.

References calculated.


The documentation for this class was generated from the following file:
Generated on Tue Jan 31 10:55:30 2006 for FXPlot by  doxygen 1.4.4