Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkAxisActor2D Class Reference

Create an axis with tick marks and labels. More...

#include <vtkAxisActor2D.h>

Inheritance diagram for vtkAxisActor2D:

Inheritance graph
[legend]
Collaboration diagram for vtkAxisActor2D:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual vtkCoordinateGetPoint1Coordinate ()
virtual void SetPoint1 (float x[2])
virtual void SetPoint1 (float x, float y)
virtual float * GetPoint1 ()
virtual vtkCoordinateGetPoint2Coordinate ()
virtual void SetPoint2 (float x[2])
virtual void SetPoint2 (float x, float y)
virtual float * GetPoint2 ()
virtual void SetRange (float, float)
void SetRange (float[2])
virtual float * GetRange ()
virtual void GetRange (float data[2])
virtual void SetNumberOfLabels (int)
virtual int GetNumberOfLabels ()
virtual void SetLabelFormat (const char *)
virtual char * GetLabelFormat ()
virtual void SetAdjustLabels (int)
virtual int GetAdjustLabels ()
virtual void AdjustLabelsOn ()
virtual void AdjustLabelsOff ()
virtual void SetTitle (const char *)
virtual char * GetTitle ()
virtual void SetBold (int)
virtual int GetBold ()
virtual void BoldOn ()
virtual void BoldOff ()
virtual void SetItalic (int)
virtual int GetItalic ()
virtual void ItalicOn ()
virtual void ItalicOff ()
virtual void SetShadow (int)
virtual int GetShadow ()
virtual void ShadowOn ()
virtual void ShadowOff ()
virtual void SetFontFamily (int)
virtual int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()
virtual void SetTickLength (int)
virtual int GetTickLength ()
virtual void SetTickOffset (int)
virtual int GetTickOffset ()
virtual void SetAxisVisibility (int)
virtual int GetAxisVisibility ()
virtual void AxisVisibilityOn ()
virtual void AxisVisibilityOff ()
virtual void SetTickVisibility (int)
virtual int GetTickVisibility ()
virtual void TickVisibilityOn ()
virtual void TickVisibilityOff ()
virtual void SetLabelVisibility (int)
virtual int GetLabelVisibility ()
virtual void LabelVisibilityOn ()
virtual void LabelVisibilityOff ()
virtual void SetTitleVisibility (int)
virtual int GetTitleVisibility ()
virtual void TitleVisibilityOn ()
virtual void TitleVisibilityOff ()
virtual void SetFontFactor (float)
virtual float GetFontFactor ()
virtual void SetLabelFactor (float)
virtual float GetLabelFactor ()
int RenderOverlay (vtkViewport *viewport)
int RenderOpaqueGeometry (vtkViewport *viewport)
int RenderTranslucentGeometry (vtkViewport *)
void ReleaseGraphicsResources (vtkWindow *)
void ShallowCopy (vtkProp *prop)

Static Public Methods

int IsTypeOf (const char *type)
vtkAxisActor2D * SafeDownCast (vtkObject *o)
vtkAxisActor2D * New ()
void ComputeRange (float inRange[2], float outRange[2], int inNumTicks, int &outNumTicks, float &interval)
int SetFontSize (vtkViewport *viewport, vtkTextMapper *textMapper, int *size, float factor, int &stringWidth, int &stringHeight)

Protected Methods

 vtkAxisActor2D ()
 ~vtkAxisActor2D ()
 vtkAxisActor2D (const vtkAxisActor2D &)
void operator= (const vtkAxisActor2D &)

Protected Attributes

vtkCoordinatePoint1Coordinate
vtkCoordinatePoint2Coordinate
char * Title
float Range [2]
int NumberOfLabels
char * LabelFormat
int NumberOfLabelsBuilt
int AdjustLabels
float FontFactor
float LabelFactor
int TickLength
int TickOffset
int Bold
int Italic
int Shadow
int FontFamily
int AxisVisibility
int TickVisibility
int LabelVisibility
int TitleVisibility
int LastPoint1 [2]
int LastPoint2 [2]
int LastSize [2]
int LastTitleFontSize
int LastLabelFontSize

Detailed Description

Create an axis with tick marks and labels.

Date:
2000/12/10 20:09:02
Revision:
1.15

vtkAxisActor2D creates an axis with tick marks, labels, and/or a title, depending on the particular instance variable settings. To use this class, you typically specify two points defining the start and end points of the line (x-y definition using vtkCoordinate class), the number of labels, and the data range (min,max). You can also control what parts of the axis are visible including the line, the tick marks, the labels, and the title. It is also possible to control the font family, the font style (bold and/or italic), and whether font shadows are drawn. You can also specify the label format (a printf style format).

This class decides what font size to use and how to locate the labels. It also decides how to create reasonable tick marks and labels. The number of labels and the range of values may not match the number specified, but should be close.

Labels are drawn on the "right" side of the axis. The "right" side is the side of the axis on the right as you move from Point1 to Point2. The way the labels and title line up with the axis and tick marks depends on whether the line is considered horizontal or vertical.

The instance variables Point1 and Point2 are instances of vtkCoordinate. What this means is that you can specify the axis in a variety of coordinate systems. Also, the axis does not have to be either horizontal or vertical. The tick marks are created so that they are perpendicular to the axis.

See also:
vtkActor2D vtkTextMapper vtkPolyDataMapper2D vtkScalarBarActor vtkCoordinate
Examples:
vtkAxisActor2D (examples)

Definition at line 86 of file vtkAxisActor2D.h.


Constructor & Destructor Documentation

vtkAxisActor2D::vtkAxisActor2D   [protected]
 

vtkAxisActor2D::~vtkAxisActor2D   [protected]
 

vtkAxisActor2D::vtkAxisActor2D const vtkAxisActor2D &    [inline, protected]
 

Definition at line 232 of file vtkAxisActor2D.h.


Member Function Documentation

virtual const char* vtkAxisActor2D::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

int vtkAxisActor2D::IsTypeOf const char *    type [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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

virtual int vtkAxisActor2D::IsA const char *    type [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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

vtkAxisActor2D* vtkAxisActor2D::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

void vtkAxisActor2D::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 vtkActor2D.

vtkAxisActor2D* vtkAxisActor2D::New   [static]
 

Instantiate object.

Reimplemented from vtkActor2D.

virtual vtkCoordinate* vtkAxisActor2D::GetPoint1Coordinate   [virtual]
 

Specify the position of the first point defining the axis.

virtual void vtkAxisActor2D::SetPoint1 float    x[2] [virtual]
 

virtual void vtkAxisActor2D::SetPoint1 float    x,
float    y
[virtual]
 

virtual float* vtkAxisActor2D::GetPoint1   [virtual]
 

virtual vtkCoordinate* vtkAxisActor2D::GetPoint2Coordinate   [virtual]
 

Specify the position of the second point defining the axis. Note that the order from Point1 to Point2 controls which side the tick marks are drawn on (ticks are drawn on the right, if visible).

virtual void vtkAxisActor2D::SetPoint2 float    x[2] [virtual]
 

virtual void vtkAxisActor2D::SetPoint2 float    x,
float    y
[virtual]
 

virtual float* vtkAxisActor2D::GetPoint2   [virtual]
 

virtual void vtkAxisActor2D::SetRange float   ,
float   
[virtual]
 

Specify the (min,max) axis range. This will be used in the generation of labels, if labels are visible.

void vtkAxisActor2D::SetRange float   [2]
 

virtual float* vtkAxisActor2D::GetRange   [virtual]
 

virtual void vtkAxisActor2D::GetRange float    data[2] [virtual]
 

virtual void vtkAxisActor2D::SetNumberOfLabels int    [virtual]
 

Set/Get the number of annotation labels to show.

virtual int vtkAxisActor2D::GetNumberOfLabels   [virtual]
 

virtual void vtkAxisActor2D::SetLabelFormat const char *    [virtual]
 

Set/Get the format with which to print the labels on the scalar bar.

virtual char* vtkAxisActor2D::GetLabelFormat   [virtual]
 

virtual void vtkAxisActor2D::SetAdjustLabels int    [virtual]
 

Set/Get the flag that controls whether the labels and ticks are adjusted for "nice" numerical values to make it easier to read the labels. The adjustment is based in the Range instance variable.

virtual int vtkAxisActor2D::GetAdjustLabels   [virtual]
 

virtual void vtkAxisActor2D::AdjustLabelsOn   [virtual]
 

virtual void vtkAxisActor2D::AdjustLabelsOff   [virtual]
 

virtual void vtkAxisActor2D::SetTitle const char *    [virtual]
 

Set/Get the title of the scalar bar actor,

virtual char* vtkAxisActor2D::GetTitle   [virtual]
 

virtual void vtkAxisActor2D::SetBold int    [virtual]
 

Enable/Disable bolding annotation text.

virtual int vtkAxisActor2D::GetBold   [virtual]
 

virtual void vtkAxisActor2D::BoldOn   [virtual]
 

virtual void vtkAxisActor2D::BoldOff   [virtual]
 

virtual void vtkAxisActor2D::SetItalic int    [virtual]
 

Enable/Disable italicizing annotation text.

virtual int vtkAxisActor2D::GetItalic   [virtual]
 

virtual void vtkAxisActor2D::ItalicOn   [virtual]
 

virtual void vtkAxisActor2D::ItalicOff   [virtual]
 

virtual void vtkAxisActor2D::SetShadow int    [virtual]
 

Enable/Disable creating shadows on the annotation text. Shadows make the text easier to read.

virtual int vtkAxisActor2D::GetShadow   [virtual]
 

virtual void vtkAxisActor2D::ShadowOn   [virtual]
 

virtual void vtkAxisActor2D::ShadowOff   [virtual]
 

virtual void vtkAxisActor2D::SetFontFamily int    [virtual]
 

Set/Get the font family for the annotation text. Three font types are available: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES).

virtual int vtkAxisActor2D::GetFontFamily   [virtual]
 

void vtkAxisActor2D::SetFontFamilyToArial   [inline]
 

Definition at line 148 of file vtkAxisActor2D.h.

void vtkAxisActor2D::SetFontFamilyToCourier   [inline]
 

Definition at line 149 of file vtkAxisActor2D.h.

void vtkAxisActor2D::SetFontFamilyToTimes   [inline]
 

Definition at line 150 of file vtkAxisActor2D.h.

virtual void vtkAxisActor2D::SetTickLength int    [virtual]
 

Set/Get the length of the tick marks (expressed in pixels or display coordinates).

virtual int vtkAxisActor2D::GetTickLength   [virtual]
 

virtual void vtkAxisActor2D::SetTickOffset int    [virtual]
 

Set/Get the offset of the labels (expressed in pixels or display coordinates). The offset is the distance of labels from tick marks or other objects.

virtual int vtkAxisActor2D::GetTickOffset   [virtual]
 

virtual void vtkAxisActor2D::SetAxisVisibility int    [virtual]
 

Set/Get visibility of the axis line.

virtual int vtkAxisActor2D::GetAxisVisibility   [virtual]
 

virtual void vtkAxisActor2D::AxisVisibilityOn   [virtual]
 

virtual void vtkAxisActor2D::AxisVisibilityOff   [virtual]
 

virtual void vtkAxisActor2D::SetTickVisibility int    [virtual]
 

Set/Get visibility of the axis tick marks.

virtual int vtkAxisActor2D::GetTickVisibility   [virtual]
 

virtual void vtkAxisActor2D::TickVisibilityOn   [virtual]
 

virtual void vtkAxisActor2D::TickVisibilityOff   [virtual]
 

virtual void vtkAxisActor2D::SetLabelVisibility int    [virtual]
 

Set/Get visibility of the axis labels.

virtual int vtkAxisActor2D::GetLabelVisibility   [virtual]
 

virtual void vtkAxisActor2D::LabelVisibilityOn   [virtual]
 

virtual void vtkAxisActor2D::LabelVisibilityOff   [virtual]
 

virtual void vtkAxisActor2D::SetTitleVisibility int    [virtual]
 

Set/Get visibility of the axis title.

virtual int vtkAxisActor2D::GetTitleVisibility   [virtual]
 

virtual void vtkAxisActor2D::TitleVisibilityOn   [virtual]
 

virtual void vtkAxisActor2D::TitleVisibilityOff   [virtual]
 

virtual void vtkAxisActor2D::SetFontFactor float    [virtual]
 

Set/Get the factor that controls the overall size of the fonts used to label and title the axes. This ivar used in conjunction with the LabelFactor can be used to control font sizes.

virtual float vtkAxisActor2D::GetFontFactor   [virtual]
 

virtual void vtkAxisActor2D::SetLabelFactor float    [virtual]
 

Set/Get the factor that controls the relative size of the axis labels to the axis title.

virtual float vtkAxisActor2D::GetLabelFactor   [virtual]
 

int vtkAxisActor2D::RenderOverlay vtkViewport   viewport [virtual]
 

Draw the axis.

Reimplemented from vtkActor2D.

int vtkAxisActor2D::RenderOpaqueGeometry vtkViewport   viewport [virtual]
 

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDERING PROCESS All concrete subclasses must be able to render themselves. There are five key render methods in vtk and they correspond to five different points in the rendering cycle. Any given prop may implement one or more of these methods. The first two methods are designed to render 3D geometry such as polygons lines, triangles. We render the opaque first then the transparent. Ray casting is different from the other methods in that the rendering process is driven not by the mapper but by the ray caster. Two methods are required to support ray casting - one for initialization, and the other to cast a ray (in viewing coordinates.) The next three methods are primarily intended for volume rendering and supports any technique that returns an image to be composited. The RenderIntoImage() method causes the rendering to occur, and the GetRGBAImage() and GetZImage() methods are used to gather results. The last method is to render any 2D annotation or overlays. Except for the ray casting methods, these methods return an integer value indicating whether or not this render method was applied to this data. For the ray cast initialization, the integer indicated whether or not the initialization was successful. For ray casting, the integer return value indicates whether or not the ray intersected something.

Reimplemented from vtkActor2D.

int vtkAxisActor2D::RenderTranslucentGeometry vtkViewport   viewport [inline, virtual]
 

Reimplemented from vtkActor2D.

Definition at line 197 of file vtkAxisActor2D.h.

void vtkAxisActor2D::ReleaseGraphicsResources vtkWindow   [virtual]
 

Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.

Reimplemented from vtkActor2D.

void vtkAxisActor2D::ComputeRange float    inRange[2],
float    outRange[2],
int    inNumTicks,
int &    outNumTicks,
float &    interval
[static]
 

This method computes the range of the axis given an input range. It also computes the number of tick marks given a suggested number. (The number of tick marks includes end ticks as well.) The number of tick marks computed (in conjunction with the output range) will yield "nice" tick values. For example, if the input range is (0.25,96.7) and the number of ticks requested is 10, the output range will be (0,100) with the number of computed ticks to 11 to yield tick values of (0,10,20,...,100).

int vtkAxisActor2D::SetFontSize vtkViewport   viewport,
vtkTextMapper   textMapper,
int *    size,
float    factor,
int &    stringWidth,
int &    stringHeight
[static]
 

General method computes font size from a representative size on the viewport (given by size[2]). The method returns the font size (in points) and the string height/width (in pixels). It also sets the font size of the instance of vtkTextMapper provided. The factor is used when you're trying to create text of different size-factor is usually =1 but you can adjust the font size by making factor larger or smaller.

void vtkAxisActor2D::ShallowCopy vtkProp   prop [virtual]
 

Shallow copy of an axis actor. Overloads the virtual vtkProp method.

Reimplemented from vtkActor2D.

void vtkAxisActor2D::operator= const vtkAxisActor2D &    [inline, protected]
 

Definition at line 233 of file vtkAxisActor2D.h.


Member Data Documentation

vtkCoordinate* vtkAxisActor2D::Point1Coordinate [protected]
 

Definition at line 235 of file vtkAxisActor2D.h.

vtkCoordinate* vtkAxisActor2D::Point2Coordinate [protected]
 

Definition at line 236 of file vtkAxisActor2D.h.

char* vtkAxisActor2D::Title [protected]
 

Definition at line 237 of file vtkAxisActor2D.h.

float vtkAxisActor2D::Range[2] [protected]
 

Definition at line 238 of file vtkAxisActor2D.h.

int vtkAxisActor2D::NumberOfLabels [protected]
 

Definition at line 239 of file vtkAxisActor2D.h.

char* vtkAxisActor2D::LabelFormat [protected]
 

Definition at line 240 of file vtkAxisActor2D.h.

int vtkAxisActor2D::NumberOfLabelsBuilt [protected]
 

Definition at line 241 of file vtkAxisActor2D.h.

int vtkAxisActor2D::AdjustLabels [protected]
 

Definition at line 242 of file vtkAxisActor2D.h.

float vtkAxisActor2D::FontFactor [protected]
 

Definition at line 243 of file vtkAxisActor2D.h.

float vtkAxisActor2D::LabelFactor [protected]
 

Definition at line 244 of file vtkAxisActor2D.h.

int vtkAxisActor2D::TickLength [protected]
 

Definition at line 245 of file vtkAxisActor2D.h.

int vtkAxisActor2D::TickOffset [protected]
 

Definition at line 246 of file vtkAxisActor2D.h.

int vtkAxisActor2D::Bold [protected]
 

Definition at line 248 of file vtkAxisActor2D.h.

int vtkAxisActor2D::Italic [protected]
 

Definition at line 249 of file vtkAxisActor2D.h.

int vtkAxisActor2D::Shadow [protected]
 

Definition at line 250 of file vtkAxisActor2D.h.

int vtkAxisActor2D::FontFamily [protected]
 

Definition at line 251 of file vtkAxisActor2D.h.

int vtkAxisActor2D::AxisVisibility [protected]
 

Definition at line 253 of file vtkAxisActor2D.h.

int vtkAxisActor2D::TickVisibility [protected]
 

Definition at line 254 of file vtkAxisActor2D.h.

int vtkAxisActor2D::LabelVisibility [protected]
 

Definition at line 255 of file vtkAxisActor2D.h.

int vtkAxisActor2D::TitleVisibility [protected]
 

Definition at line 256 of file vtkAxisActor2D.h.

int vtkAxisActor2D::LastPoint1[2] [protected]
 

Definition at line 258 of file vtkAxisActor2D.h.

int vtkAxisActor2D::LastPoint2[2] [protected]
 

Definition at line 259 of file vtkAxisActor2D.h.

int vtkAxisActor2D::LastSize[2] [protected]
 

Definition at line 261 of file vtkAxisActor2D.h.

int vtkAxisActor2D::LastTitleFontSize [protected]
 

Definition at line 262 of file vtkAxisActor2D.h.

int vtkAxisActor2D::LastLabelFontSize [protected]
 

Definition at line 263 of file vtkAxisActor2D.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:46:34 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001