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

FXAxis Class Reference

Abstraction of a axis for a FXPlot2D. More...

#include <FXAxis.h>

List of all members.

Public Types

enum  Orientation {
  Bottom = 0x0001,
  Left = 0x0002,
  Right = 0x0004,
  Top = 0x0008
}
 Possible orientation of a Axis.
enum  Style {
  Linear = 0x0010,
  Logarithimic = 0x0020
}
 Axis style.
enum  Status {
  Enabled = 0x0100,
  Disabled = 0x0200
}
 Axis status.
enum  GridFlags {
  MinorThicks = 0x1000,
  MajorThicks = 0x2000,
  MinorGrid = 0x4000,
  MajorGrid = 0x8000
}
 Grid flags.

Public Member Functions

 FXAxis (FXPlot2D *p, FXint flags=Bottom|Enabled|Linear|MajorThicks)
 Constructor.
virtual ~FXAxis ()
 Destructor.
FXint transform (double value) const
 Transforms the given double value to the int (pixel) point.
double backTransform (FXint y) const
 Backward trasnformation of coordinates (from pixel to double).
FXbool contains (double value) const
 Checks if the given point is within the current axis range.
void recalcule (void)
 Recalculate the axis conversion factors.
double getMin () const
 Return the lower value of the double range.
double getMax () const
 Return the upper limit of the double range.
void setRange (double min, double max)
 Set the range that the Axis will cover.
void setPosition (FXPoint p1, FXPoint p2)
 Set the axis position on the Plot2D.
void zoomIn (FXint x)
 Zomms the axis in around the given point.
void zoomOut (void)
 Zomms the axis out.
void drawSelf (FXDC *dc, FXint rootx, FXint rooty)
 Draw itself on the device context.
void setFlags (FXint flag)
 Set the axis flags.
FXint getFlags (void) const
 The axis flags.
void setLabel (const FXString &name)
 Set the label of the Axis.
const FXString & getLabel () const
 Retrun the label of the Axis.
FXint getDefaultHeight ()
FXint getDefaultWidth ()
void create ()

Protected Member Functions

void buildThicksLinear ()
 Adjusts the limits and builds the thicks for the linear case.
void buildThicksLog ()
 Adjusts the limits and builds the thicks for the logarithmic case.

Protected Attributes

FXPlot2Dplot
 The plot were this axis exists.
double min
 The lower double value.
double max
 The uppder double value.
double step
 The step for the marks.
double minmark
 The start value for the marks.
double maxmark
 The last value for the marks.
double cnv
 The conversion factor.
FXPoint p1
 The points of the axis position.
FXPoint p2
FXint y1
 The output transformation points.
FXint y2
FXint prec
FXuint maxMajor
 Maximun number of major ticks.
FXuint maxMinor
 Maximun number of minor ticks.
FXint markwidth
 The mark width.
FXFont * font
 Default font.
FXFont * fontmini
 Font for the exponents.
std::vector< FXAxisMarkmarks
 The marks of the axis.
FXint flags
 The flags Orientation, Style, Status and GirdFlags.
FXString label
 Axis label.


Detailed Description

Abstraction of a axis for a FXPlot2D.

To plot a FXCurve in a FXPlot2D it has to be attached to tow FXAxis. The FXAxis class provides the relation between the data holded by the FXCurve and the pixes that the curve will draw. Furthermore, the FXAxis draws itself on the plot to give scale informations.

Note:
Only linear scale is implemented, logarithimic and etc could be done.

Definition at line 56 of file FXAxis.h.


Constructor & Destructor Documentation

FXAxis::FXAxis FXPlot2D p,
FXint  flags = Bottom|Enabled|Linear|MajorThicks
 

Constructor.

Create a new Axis on the Plot2D p, with a given OrientationType orientation and a flag enable.


Member Function Documentation

double FXAxis::backTransform FXint  y  )  const
 

Backward trasnformation of coordinates (from pixel to double).

See also:
transform

FXbool FXAxis::contains double  value  )  const
 

Checks if the given point is within the current axis range.

See also:
setRange

double FXAxis::getMax  )  const
 

Return the upper limit of the double range.

See also:
getMin setRange transform

double FXAxis::getMin  )  const
 

Return the lower value of the double range.

See also:
getMax setRange transform

void FXAxis::setPosition FXPoint  p1,
FXPoint  p2
 

Set the axis position on the Plot2D.

This function should be called by the layout algorithm of the Plot2D. The points given here are used by transform() and to draw the Axis.

void FXAxis::setRange double  min,
double  max
 

Set the range that the Axis will cover.

The range is used to transform() a given value to its pixel (integer) equivalent.

void FXAxis::zoomIn FXint  x  ) 
 

Zomms the axis in around the given point.

This function changes the range covered by the axis.

See also:
setRange.

void FXAxis::zoomOut void   ) 
 

Zomms the axis out.

This function changes the range covered by the axis.

See also:
zoomIn setRange


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