|
Public Member Functions |
| | Axis (double ix, double iy, double ex, double ey, double length, double imin, double imax, const AxisStyle &style=AxisStyle()) |
| | Constructor.
|
| | Axis (double ix, double iy, double direction, double length, double imin, double imax, const AxisStyle &style=AxisStyle()) |
| | Constructor.
|
| | ~Axis () |
| void | setPosition (double ix, double iy) |
| | Set the x and y position.
|
| void | setLength (double length) |
| | Set the length.
|
| void | setRange (double imin, double imax) |
| | Set the range.
|
| void | setGap (double igap) |
| | Set the gap (distance in plot space between ticks).
|
| void | setAngle (double angle) |
| | Set the angle for the axis.
|
| void | drawToFrame (const vdraw::Frame &ff) |
| | Draw this zxis to this frame.
|
| bool | pointFromValue (double &x, double &y, double value) |
| | Finds out the x, y point given a value.
|
| bool | labelPointAbove (double &x, double &y, double &rotation, double value) |
| | Finds out the x, y point for a label above the axis given a value.
|
| bool | labelPointBelow (double &x, double &y, double &rotation, double value) |
| | Finds out the x, y point for a label below the axis given a value.
|
Public Attributes |
| AxisStyle | axis_style |
| | Axis style.
|
Static Public Attributes |
| const double | RIGHT |
| const double | UP |
| const double | LEFT |
| const double | DOWN |
| const double | N |
| const double | E |
| const double | S |
| const double | W |
| const double | NORTH |
| const double | EAST |
| const double | SOUTH |
| const double | WEST |
Protected Member Functions |
| void | init (double ix, double iy, double direction, double length, double imin, double imax, const AxisStyle &style) |
| | Initializer (the real constructor).
|
| void | fromRatio (double &x, double &y, double ratio) |
| | Finds out the point for the ratio along the axis line.
|
| void | axisTick (double ratio, double dist) |
| | Helper to start the recursive method.
|
| void | axisTickRecursive (bool draw, int depth, double ratio, double dist, double length) |
| | Recursively draw the axis ticks.
|
| void | drawTick (double ratio, double length) |
| | Draw a tick at this ratio with this length.
|
| void | fromTic (double &x1, double &y1, double &x2, double &y2, double distratio, double length) |
| | Get the endpoints of a tick at ratio.
|
| void | guessTickInfo (double &startpos, double &startval, double &distpos, double &distval) |
| | The major axis ticks will start at the the startpos ratio with value startval and at every increment of distpos there will be the previous value + distval.
|
| bool | label (double value, int direction, const vdraw::TextStyle &style) |
| | Put a label at this position.
|
| bool | label (const char *str, double value, int direction, const vdraw::TextStyle &style) |
| | Put a label at this position.
|
| bool | label (vdraw::Text &t, double value, int direction, const vdraw::TextStyle &style) |
| | Put a label at this position.
|
| bool | labelPoint (double &x, double &y, double &rotation, double value, int direction) |
| | Get the x,y position for a label and its rotation Note that rotation needs to be corrected to be right-side up.
|
Protected Attributes |
| vdraw::Frame | f |
| | Temporary frame pointer (so we don't have to pass it to every function).
|
| double | x |
| | X coordinate of this axis.
|
| double | y |
| | Y coordinate of this axis.
|
| double | line_length |
| | Length of this axis.
|
| double | line_direction |
| | Direction is an angle in radians (for use with sin, cos).
|
| double | sindir |
| | Sin(line_direction).
|
| double | cosdir |
| | Cos(line_direction).
|
| double | sintic |
| | Sin(line_direction+PI/2).
|
| double | costic |
| | Cos(line_direction+PI/2).
|
| double | max |
| | For the axis, this is the data's maximum for the axis to show.
|
| double | axesMax |
| | For the axis, this is the data's maximum from which to draw tics.
|
| double | min |
| | For the axis, this is the data's minimum for the axis to show.
|
| double | axesMin |
| | For the axis, this is the data's minimum from which to draw tics.
|
| double | gap |
| | For the axis, this is the gap between tick marks.
|