VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkChartXYZ Class Reference

Factory class for drawing 3D XYZ charts. More...

#include <vtkChartXYZ.h>

Inheritance diagram for vtkChartXYZ:
Inheritance graph
[legend]
Collaboration diagram for vtkChartXYZ:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkContextItem Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkChartXYZNewInstance () const
virtual void PrintSelf (ostream &os, vtkIndent indent)
void SetGeometry (const vtkRectf &bounds)
void SetAngle (double angle)
void SetAroundX (bool isX)
virtual void SetAnnotationLink (vtkAnnotationLink *link)
vtkAxisGetAxis (int axis)
void SetAutoRotate (bool b)
void SetDecorateAxes (bool b)
void SetFitToScene (bool b)
virtual void Update ()
virtual bool Paint (vtkContext2D *painter)
virtual vtkIdType AddPlot (vtkPlot3D *plot)
void ClearPlots ()
void RecalculateBounds ()
void RecalculateTransform ()
virtual bool Hit (const vtkContextMouseEvent &mouse)
virtual bool MouseButtonPressEvent (const vtkContextMouseEvent &mouse)
virtual bool MouseMoveEvent (const vtkContextMouseEvent &mouse)
virtual bool MouseWheelEvent (const vtkContextMouseEvent &mouse, int delta)
void SetAxisColor (const vtkColor4ub &color)
vtkColor4ub GetAxisColor ()
virtual bool KeyPressEvent (const vtkContextKeyEvent &key)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkChartXYZSafeDownCast (vtkObjectBase *o)
static vtkChartXYZNew ()

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkChartXYZ ()
 ~vtkChartXYZ ()
virtual void CalculateTransforms ()
bool Rotate (const vtkContextMouseEvent &mouse)
bool Pan (const vtkContextMouseEvent &mouse)
bool Zoom (const vtkContextMouseEvent &mouse)
bool Spin (const vtkContextMouseEvent &mouse)
void LookDownX ()
void LookDownY ()
void LookDownZ ()
void LookUpX ()
void LookUpY ()
void LookUpZ ()
bool CheckForSceneResize ()
void RescaleAxes ()
void ScaleUpAxes ()
void ScaleDownAxes ()
void ZoomAxes (int delta)
void InitializeAxesBoundaryPoints ()
void InitializeFutureBox ()
void ComputeDataBounds ()
void DrawAxes (vtkContext3D *context)
void DetermineWhichAxesToLabel ()
void DrawTickMarks (vtkContext2D *painter)
void DrawAxesLabels (vtkContext2D *painter)
void GetOffsetForAxisLabel (int axis, float *bounds, float *offset)
double CalculateNiceMinMax (double &min, double &max, int axis)
void GetClippingPlaneEquation (int i, double *planeEquation)
bool CalculatePlotTransform (vtkAxis *x, vtkAxis *y, vtkAxis *z, vtkTransform *transform)

Protected Attributes

vtkRectf Geometry
std::vector< vtkSmartPointer
< vtkAxis > > 
Axes
bool AutoRotate
bool IsX
double Angle
bool DrawAxesDecoration
bool FitToScene
vtkNew< vtkTransformContextTransform
vtkNew< vtkTransformPlotTransform
vtkNew< vtkTransformBox
vtkNew< vtkTransformRotation
vtkNew< vtkTransformTranslation
vtkNew< vtkTransformScale
vtkNew< vtkTransformBoxScale
vtkNew< vtkTransformFutureBox
vtkNew< vtkTransformFutureBoxScale
vtkNew< vtkPenPen
vtkNew< vtkPenAxisPen
vtkSmartPointer
< vtkAnnotationLink
Link
std::vector< vtkPlot3D * > Plots
std::string XAxisLabel
std::string YAxisLabel
std::string ZAxisLabel
vtkNew< vtkPlaneCollectionBoundingCube
float AxesBoundaryPoints [14][3]
float TickLabelOffset [3][2]
int SceneHeight
int SceneWidth
int DirectionToData [3]
double DataBounds [4]
int XAxisToLabel [3]
int YAxisToLabel [3]
int ZAxisToLabel [3]

Detailed Description

Factory class for drawing 3D XYZ charts.

Tests:
vtkChartXYZ (Tests)

Definition at line 47 of file vtkChartXYZ.h.


Member Typedef Documentation

Reimplemented from vtkContextItem.

Definition at line 50 of file vtkChartXYZ.h.


Constructor & Destructor Documentation

vtkChartXYZ::vtkChartXYZ ( ) [protected]
vtkChartXYZ::~vtkChartXYZ ( ) [protected]

Member Function Documentation

static int vtkChartXYZ::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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkContextItem.

virtual int vtkChartXYZ::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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkContextItem.

Reimplemented from vtkContextItem.

virtual vtkObjectBase* vtkChartXYZ::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkContextItem.

Reimplemented from vtkContextItem.

virtual void vtkChartXYZ::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 vtkChartXYZ* vtkChartXYZ::New ( ) [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

void vtkChartXYZ::SetGeometry ( const vtkRectf bounds)

Set the geometry in pixel coordinates (origin and width/height). This method also sets up the end points of the axes of the chart. For this reason, if you call SetAroundX(), you should call SetGeometry() afterwards.

void vtkChartXYZ::SetAngle ( double  angle)

Set the rotation angle for the chart (AutoRotate mode only).

void vtkChartXYZ::SetAroundX ( bool  isX)

Set whether or not we're rotating about the X axis.

virtual void vtkChartXYZ::SetAnnotationLink ( vtkAnnotationLink link) [virtual]

Set the vtkAnnotationLink for the chart.

Get the x (0), y (1) or z (2) axis.

void vtkChartXYZ::SetAxisColor ( const vtkColor4ub color)

Set the color for the axes.

Set the color for the axes.

void vtkChartXYZ::SetAutoRotate ( bool  b)

Set whether or not we're using this chart to rotate on a timer. Default value is false.

void vtkChartXYZ::SetDecorateAxes ( bool  b)

Set whether or not axes labels & tick marks should be drawn. Default value is true.

void vtkChartXYZ::SetFitToScene ( bool  b)

Set whether or not the chart should automatically resize itself to fill the scene. Default value is true.

virtual void vtkChartXYZ::Update ( ) [virtual]

Perform any updates to the item that may be necessary before rendering.

Reimplemented from vtkAbstractContextItem.

virtual bool vtkChartXYZ::Paint ( vtkContext2D painter) [virtual]

Paint event for the chart, called whenever the chart needs to be drawn.

Reimplemented from vtkAbstractContextItem.

virtual vtkIdType vtkChartXYZ::AddPlot ( vtkPlot3D plot) [virtual]

Adds a plot to the chart.

Remove all the plots from this chart.

Determine the XYZ bounds of the plots within this chart. This information is then used to set the range of the axes.

Use this chart's Geometry to set the endpoints of its axes. This method also sets up a transformation that is used to properly render the data within the chart.

virtual bool vtkChartXYZ::Hit ( const vtkContextMouseEvent mouse) [virtual]

Returns true if the transform is interactive, false otherwise.

Reimplemented from vtkAbstractContextItem.

virtual bool vtkChartXYZ::MouseButtonPressEvent ( const vtkContextMouseEvent mouse) [virtual]

Mouse press event. Keep track of zoom anchor position.

Reimplemented from vtkAbstractContextItem.

virtual bool vtkChartXYZ::MouseMoveEvent ( const vtkContextMouseEvent mouse) [virtual]

Mouse move event. Perform pan or zoom as specified by the mouse bindings.

Reimplemented from vtkAbstractContextItem.

virtual bool vtkChartXYZ::MouseWheelEvent ( const vtkContextMouseEvent mouse,
int  delta 
) [virtual]

Mouse wheel event. Zooms in or out.

Reimplemented from vtkAbstractContextItem.

virtual bool vtkChartXYZ::KeyPressEvent ( const vtkContextKeyEvent key) [virtual]

Key press event. This allows the user to snap the chart to one of three different 2D views. "x" changes the view so we're looking down the X axis. Similar behavior occurs for "y" or "z".

Reimplemented from vtkAbstractContextItem.

virtual void vtkChartXYZ::CalculateTransforms ( ) [protected, virtual]

Calculate the transformation matrices used to draw data points and axes in the scene. This function also sets up clipping planes that determine whether or not a data point is within range.

bool vtkChartXYZ::CalculatePlotTransform ( vtkAxis x,
vtkAxis y,
vtkAxis z,
vtkTransform transform 
) [protected]

Given the x, y and z vtkAxis, and a transform, calculate the transform that the points in a chart would need to be drawn within the axes. This assumes that the axes have the correct start and end positions, and that they are perpendicular.

bool vtkChartXYZ::Rotate ( const vtkContextMouseEvent mouse) [protected]

Rotate the chart in response to a mouse movement.

bool vtkChartXYZ::Pan ( const vtkContextMouseEvent mouse) [protected]

Pan the data within the chart in response to a mouse movement.

bool vtkChartXYZ::Zoom ( const vtkContextMouseEvent mouse) [protected]

Zoom in or out on the data in response to a mouse movement.

bool vtkChartXYZ::Spin ( const vtkContextMouseEvent mouse) [protected]

Spin the chart in response to a mouse movement.

void vtkChartXYZ::LookDownX ( ) [protected]

Adjust the rotation of the chart so that we are looking down the X axis.

void vtkChartXYZ::LookDownY ( ) [protected]

Adjust the rotation of the chart so that we are looking down the Y axis.

void vtkChartXYZ::LookDownZ ( ) [protected]

Adjust the rotation of the chart so that we are looking down the Z axis.

void vtkChartXYZ::LookUpX ( ) [protected]

Adjust the rotation of the chart so that we are looking up the X axis.

void vtkChartXYZ::LookUpY ( ) [protected]

Adjust the rotation of the chart so that we are looking up the Y axis.

void vtkChartXYZ::LookUpZ ( ) [protected]

Adjust the rotation of the chart so that we are looking up the Z axis.

bool vtkChartXYZ::CheckForSceneResize ( ) [protected]

Check to see if the scene changed size since the last render.

void vtkChartXYZ::RescaleAxes ( ) [protected]

Scale the axes up or down in response to a scene resize.

void vtkChartXYZ::ScaleUpAxes ( ) [protected]

Scale up the axes when the scene gets larger.

void vtkChartXYZ::ScaleDownAxes ( ) [protected]

Scale down the axes when the scene gets smaller.

void vtkChartXYZ::ZoomAxes ( int  delta) [protected]

Change the scaling of the axes by a specified amount.

Initialize a list of "test points". These are used to determine whether or not the chart fits completely within the bounds of the current scene.

void vtkChartXYZ::InitializeFutureBox ( ) [protected]

Initialize the "future box" transform. This transform is a duplicate of the Box transform, which dictates how the chart's axes should be drawn. In ScaleUpAxes() and ScaleDownAxes(), we incrementally change the scaling of the FutureBox transform to determine how much we need to zoom in or zoom out to fit the chart within the newly resized scene. Using a separate transform for this process allows us to resize the Box in a single step.

void vtkChartXYZ::ComputeDataBounds ( ) [protected]

Compute a bounding box for the data that is rendered within the axes.

void vtkChartXYZ::DrawAxes ( vtkContext3D context) [protected]

Draw the cube axes of this chart.

For each of the XYZ dimensions, find the axis line that is furthest from the rendered data.

void vtkChartXYZ::DrawTickMarks ( vtkContext2D painter) [protected]

Draw tick marks and tick mark labels along the axes.

void vtkChartXYZ::DrawAxesLabels ( vtkContext2D painter) [protected]

Label the axes.

void vtkChartXYZ::GetOffsetForAxisLabel ( int  axis,
float bounds,
float offset 
) [protected]

Compute how some text should be offset from an axis. The parameter bounds contains the bounding box of the text to be rendered. The result is stored in the parameter offset.

double vtkChartXYZ::CalculateNiceMinMax ( double min,
double max,
int  axis 
) [protected]

Calculate the next "nicest" numbers above and below the current minimum.

Returns:
the "nice" spacing of the numbers. This function was mostly copied from vtkAxis.
void vtkChartXYZ::GetClippingPlaneEquation ( int  i,
double planeEquation 
) [protected]

Get the equation for the ith face of our bounding cube.


Member Data Documentation

The size and position of this chart.

Definition at line 249 of file vtkChartXYZ.h.

std::vector< vtkSmartPointer<vtkAxis> > vtkChartXYZ::Axes [protected]

The 3 axes of this chart.

Definition at line 252 of file vtkChartXYZ.h.

bool vtkChartXYZ::AutoRotate [protected]

This boolean indicates whether or not we're using this chart to rotate on a timer.

Definition at line 256 of file vtkChartXYZ.h.

bool vtkChartXYZ::IsX [protected]

When we're in AutoRotate mode, this boolean tells us if we should rotate about the X axis or the Y axis.

Definition at line 260 of file vtkChartXYZ.h.

When we're in AutoRotate mode, this value tells the chart how much it should be rotated.

Definition at line 264 of file vtkChartXYZ.h.

This boolean indicates whether or not we should draw tick marks and axes labels.

Definition at line 268 of file vtkChartXYZ.h.

bool vtkChartXYZ::FitToScene [protected]

This boolean indicates whether or not we should automatically resize the chart so that it snugly fills up the scene.

Definition at line 272 of file vtkChartXYZ.h.

This is the transform that is applied when rendering data from the plots.

Definition at line 276 of file vtkChartXYZ.h.

This transform translates and scales the plots' data points so that they appear within the axes of this chart. It is one of the factors that makes up the ContextTransform.

Definition at line 281 of file vtkChartXYZ.h.

This is the transform that is applied when rendering data from the plots.

Definition at line 285 of file vtkChartXYZ.h.

This transform keeps track of how the chart has been rotated.

Definition at line 288 of file vtkChartXYZ.h.

This transform keeps track of how the data points have been panned within the chart.

Definition at line 292 of file vtkChartXYZ.h.

This transform keeps track of how the data points have been scaled (zoomed in or zoomed out) within the chart.

Definition at line 296 of file vtkChartXYZ.h.

This transform keeps track of how the axes have been scaled (zoomed in or zoomed out).

Definition at line 300 of file vtkChartXYZ.h.

This transform is initialized as a copy of Box. It is used within ScaleUpAxes() and ScaleDownAxes() to figure out how much we need to zoom in or zoom out to fit our chart within the newly resized scene.

Definition at line 305 of file vtkChartXYZ.h.

This transform keeps track of the Scale of the FutureBox transform.

Definition at line 308 of file vtkChartXYZ.h.

This is the pen that is used to draw data from the plots.

Definition at line 311 of file vtkChartXYZ.h.

This is the pen that is used to draw the axes.

Definition at line 314 of file vtkChartXYZ.h.

This link is used to share selected points with other classes.

Definition at line 317 of file vtkChartXYZ.h.

std::vector<vtkPlot3D *> vtkChartXYZ::Plots [protected]

The plots that are drawn within this chart.

Definition at line 320 of file vtkChartXYZ.h.

std::string vtkChartXYZ::XAxisLabel [protected]

The label for the X Axis.

Definition at line 323 of file vtkChartXYZ.h.

std::string vtkChartXYZ::YAxisLabel [protected]

The label for the Y Axis.

Definition at line 326 of file vtkChartXYZ.h.

std::string vtkChartXYZ::ZAxisLabel [protected]

The label for the Z Axis.

Definition at line 329 of file vtkChartXYZ.h.

The six planes that define the bounding cube of our 3D axes.

Definition at line 332 of file vtkChartXYZ.h.

Points used to determine whether the axes will fit within the scene as currently sized, regardless of rotation.

Definition at line 336 of file vtkChartXYZ.h.

This member variable stores the size of the tick labels for each axis. It is used to determine the position of the axis labels.

Definition at line 340 of file vtkChartXYZ.h.

The height of the scene, as of the most recent call to Paint().

Definition at line 343 of file vtkChartXYZ.h.

The weight of the scene, as of the most recent call to Paint().

Definition at line 346 of file vtkChartXYZ.h.

Which line to label.

Definition at line 350 of file vtkChartXYZ.h.

Which line to label.

Definition at line 351 of file vtkChartXYZ.h.

Which line to label.

Definition at line 352 of file vtkChartXYZ.h.

What direction the data is from each labeled axis line.

Definition at line 356 of file vtkChartXYZ.h.

A bounding box surrounding the currently rendered data points.

Definition at line 359 of file vtkChartXYZ.h.


The documentation for this class was generated from the following file: