vtkAxis Class Reference
#include <vtkAxis.h>
List of all members.
Detailed Description
takes care of drawing 2D axes
The vtkAxis is drawn in screen coordinates. It is usually one of the last elements of a chart to be drawn. It renders the axis label, tick marks and tick labels.
Definition at line 36 of file vtkAxis.h.
|
Public Types |
typedef vtkContextItem | Superclass |
|
enum | {
LEFT = 0,
BOTTOM,
RIGHT,
TOP,
PARALLEL
} |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | Update () |
virtual bool | Paint (vtkContext2D *painter) |
virtual void | AutoScale () |
virtual void | RecalculateTickSpacing () |
vtkFloatArray * | GetTickPositions () |
|
virtual void | SetPosition (int) |
virtual int | GetPosition () |
|
virtual void | SetPoint1 (float, float) |
void | SetPoint1 (float[2]) |
|
virtual float * | GetPoint1 () |
virtual void | GetPoint1 (float &, float &) |
virtual void | GetPoint1 (float[2]) |
|
virtual void | SetPoint2 (float, float) |
void | SetPoint2 (float[2]) |
|
virtual float * | GetPoint2 () |
virtual void | GetPoint2 (float &, float &) |
virtual void | GetPoint2 (float[2]) |
|
virtual void | SetNumberOfTicks (int) |
|
virtual int | GetNumberOfTicks () |
|
virtual vtkTextProperty * | GetLabelProperties () |
|
virtual void | SetMinimum (double) |
|
virtual double | GetMinimum () |
|
virtual void | SetMaximum (double) |
|
virtual double | GetMaximum () |
|
virtual void | SetTitle (const char *) |
virtual char * | GetTitle () |
|
virtual vtkTextProperty * | GetTitleProperties () |
|
virtual void | SetLogScale (bool) |
virtual bool | GetLogScale () |
|
virtual void | SetGridVisible (bool) |
virtual bool | GetGridVisible () |
|
virtual void | SetLabelsVisible (bool) |
virtual bool | GetLabelsVisible () |
|
virtual void | SetPrecision (int) |
virtual int | GetPrecision () |
|
virtual void | SetNotation (int) |
virtual int | GetNotation () |
|
virtual void | SetBehavior (int) |
virtual int | GetBehavior () |
|
virtual vtkPen * | GetPen () |
|
virtual vtkPen * | GetGridPen () |
Static Public Member Functions |
static int | IsTypeOf (const char *type) |
static vtkAxis * | SafeDownCast (vtkObject *o) |
static vtkAxis * | New () |
Protected Member Functions |
| vtkAxis () |
| ~vtkAxis () |
float | CalculateNiceMinMax (double &min, double &max) |
float | NiceNumber (double number, bool roundUp) |
Protected Attributes |
int | Position |
float | Point1 [2] |
float | Point2 [2] |
double | TickInterval |
int | NumberOfTicks |
vtkTextProperty * | LabelProperties |
int | TickLabelSize |
double | Minimum |
double | Maximum |
char * | Title |
vtkTextProperty * | TitleProperties |
bool | LogScale |
bool | GridVisible |
bool | LabelsVisible |
int | Precision |
int | Notation |
int | Behavior |
vtkPen * | Pen |
vtkPen * | GridPen |
vtkFloatArray * | TickPositions |
vtkStringArray * | TickLabels |
vtkTimeStamp | BuildTime |
Member Typedef Documentation
Member Enumeration Documentation
Enumeration of the axis locations in a conventional XY chart. Other layouts are possible.
- Enumerator:
-
LEFT |
|
BOTTOM |
|
RIGHT |
|
TOP |
|
PARALLEL |
|
Definition at line 46 of file vtkAxis.h.
Constructor & Destructor Documentation
vtkAxis::vtkAxis |
( |
|
) |
[protected] |
vtkAxis::~vtkAxis |
( |
|
) |
[protected] |
Member Function Documentation
virtual const char* vtkAxis::GetClassName |
( |
|
) |
[virtual] |
static int vtkAxis::IsTypeOf |
( |
const char * |
name |
) |
[static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkContextItem.
virtual int vtkAxis::IsA |
( |
const char * |
name |
) |
[virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkContextItem.
virtual void vtkAxis::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent | |
|
) |
| | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkContextItem.
static vtkAxis* vtkAxis::New |
( |
|
) |
[static] |
Creates a 2D Chart object.
Reimplemented from vtkObject.
virtual void vtkAxis::SetPosition |
( |
int |
|
) |
[virtual] |
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP).
virtual int vtkAxis::GetPosition |
( |
|
) |
[virtual] |
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP).
virtual void vtkAxis::SetPoint1 |
( |
float |
, |
|
|
float |
| |
|
) |
| | [virtual] |
Set point 1 of the axis (in pixels), this is usually the origin.
void vtkAxis::SetPoint1 |
( |
float |
[2] |
) |
|
Set point 1 of the axis (in pixels), this is usually the origin.
virtual float* vtkAxis::GetPoint1 |
( |
|
) |
[virtual] |
Get point 1 of the axis (in pixels), this is usually the origin.
virtual void vtkAxis::GetPoint1 |
( |
float & |
, |
|
|
float & |
| |
|
) |
| | [virtual] |
Get point 1 of the axis (in pixels), this is usually the origin.
virtual void vtkAxis::GetPoint1 |
( |
float |
[2] |
) |
[virtual] |
Get point 1 of the axis (in pixels), this is usually the origin.
virtual void vtkAxis::SetPoint2 |
( |
float |
, |
|
|
float |
| |
|
) |
| | [virtual] |
Set point 2 of the axis (in pixels), this is usually the terminus.
void vtkAxis::SetPoint2 |
( |
float |
[2] |
) |
|
Set point 2 of the axis (in pixels), this is usually the terminus.
virtual float* vtkAxis::GetPoint2 |
( |
|
) |
[virtual] |
Get point 2 of the axis (in pixels), this is usually the terminus.
virtual void vtkAxis::GetPoint2 |
( |
float & |
, |
|
|
float & |
| |
|
) |
| | [virtual] |
Get point 2 of the axis (in pixels), this is usually the terminus.
virtual void vtkAxis::GetPoint2 |
( |
float |
[2] |
) |
[virtual] |
Get point 2 of the axis (in pixels), this is usually the terminus.
virtual void vtkAxis::SetNumberOfTicks |
( |
int |
|
) |
[virtual] |
Set the number of tick marks for this axis.
virtual int vtkAxis::GetNumberOfTicks |
( |
|
) |
[virtual] |
Get the number of tick marks for this axis.
Get the vtkTextProperty that governs how the axis lables are displayed. Note that the alignment properties are not used.
virtual void vtkAxis::SetMinimum |
( |
double |
|
) |
[virtual] |
Set the logical minimum value of the axis, in plot coordinates.
virtual double vtkAxis::GetMinimum |
( |
|
) |
[virtual] |
Get the logical minimum value of the axis, in plot coordinates.
virtual void vtkAxis::SetMaximum |
( |
double |
|
) |
[virtual] |
Set the logical maximum value of the axis, in plot coordinates.
virtual double vtkAxis::GetMaximum |
( |
|
) |
[virtual] |
Get the logical maximum value of the axis, in plot coordinates.
virtual void vtkAxis::SetTitle |
( |
const char * |
|
) |
[virtual] |
Get/set the title text of the axis.
virtual char* vtkAxis::GetTitle |
( |
|
) |
[virtual] |
Get/set the title text of the axis.
virtual void vtkAxis::SetLogScale |
( |
bool |
|
) |
[virtual] |
Get/set whether the axis should use a log scale, default is false.
virtual bool vtkAxis::GetLogScale |
( |
|
) |
[virtual] |
Get/set whether the axis should use a log scale, default is false.
virtual void vtkAxis::SetGridVisible |
( |
bool |
|
) |
[virtual] |
Get/set whether the axis grid lines should be drawn, default is true.
virtual bool vtkAxis::GetGridVisible |
( |
|
) |
[virtual] |
Get/set whether the axis grid lines should be drawn, default is true.
virtual void vtkAxis::SetLabelsVisible |
( |
bool |
|
) |
[virtual] |
Get/set whether the axis labels should be visible.
virtual bool vtkAxis::GetLabelsVisible |
( |
|
) |
[virtual] |
Get/set whether the axis labels should be visible.
virtual void vtkAxis::SetPrecision |
( |
int |
|
) |
[virtual] |
Get/set the numerical precision to use, default is 2.
virtual int vtkAxis::GetPrecision |
( |
|
) |
[virtual] |
Get/set the numerical precision to use, default is 2.
virtual void vtkAxis::SetNotation |
( |
int |
|
) |
[virtual] |
Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
virtual int vtkAxis::GetNotation |
( |
|
) |
[virtual] |
Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
virtual void vtkAxis::SetBehavior |
( |
int |
|
) |
[virtual] |
Get/set the behavior of the axis (auto, fixed, custom). Default is 0 (auto).
virtual int vtkAxis::GetBehavior |
( |
|
) |
[virtual] |
Get/set the behavior of the axis (auto, fixed, custom). Default is 0 (auto).
virtual vtkPen* vtkAxis::GetPen |
( |
|
) |
[virtual] |
Get a pointer to the vtkPen object that controls the way this axis is drawn.
virtual vtkPen* vtkAxis::GetGridPen |
( |
|
) |
[virtual] |
Get a pointer to the vtkPen object that controls the way this axis is drawn.
virtual void vtkAxis::Update |
( |
|
) |
[virtual] |
Update the geometry of the axis. Takes care of setting up the tick mark locations etc. Should be called by the scene before rendering.
Reimplemented from vtkContextItem.
virtual bool vtkAxis::Paint |
( |
vtkContext2D * |
painter |
) |
[virtual] |
Paint event for the axis, called whenever the axis needs to be drawn.
Implements vtkContextItem.
virtual void vtkAxis::AutoScale |
( |
|
) |
[virtual] |
Use this function to autoscale the axes after setting the minimum and maximum values. This will cause the axes to select the nicest numbers that enclose the minimum and maximum values, and to select an appropriate number of tick marks.
virtual void vtkAxis::RecalculateTickSpacing |
( |
|
) |
[virtual] |
Recalculate the spacing of the tick marks - typically useful to do after scaling the axis.
A float array with the positions of the tick marks along the axis line. The positions are specified in the coordinate system the axis is drawn in (normally screen coordinates).
Definition at line 202 of file vtkAxis.h.
float vtkAxis::CalculateNiceMinMax |
( |
double & |
min, |
|
|
double & |
max | |
|
) |
| | [protected] |
Calculate the next "nicest" numbers above and below the current minimum.
- Returns:
- the "nice" spacing of the numbers.
float vtkAxis::NiceNumber |
( |
double |
number, |
|
|
bool |
roundUp | |
|
) |
| | [protected] |
Return a "nice number", often defined as 1, 2 or 5. If roundUp is true then the nice number will be rounded up, false it is rounded down. The supplied number should be between 0.0 and 9.9.
Member Data Documentation
This object stores the vtkPen that controls how the axis is drawn.
Definition at line 237 of file vtkAxis.h.
This object stores the vtkPen that controls how the grid lines are drawn.
Definition at line 241 of file vtkAxis.h.
The point cache is marked dirty until it has been initialized.
Definition at line 247 of file vtkAxis.h.
The documentation for this class was generated from the following file: