 |
VTK
9.1.0
|
Go to the documentation of this file.
55 #include "vtkChartsCoreModule.h"
107 vtkSetMacro(Angle,
double);
178 vtkSetMacro(EnsureOuterEdgeAxisLabelling,
bool);
184 vtkSetMacro(AutoRotate,
bool);
271 vtkGetMacro(ClippingPlanesEnabled,
bool);
276 vtkSetMacro(ScaleBoxWithPlot,
bool);
281 vtkGetMacro(ScaleBoxWithPlot,
bool);
521 } SizeStrategy = USE_GEOMETRY;
538 std::vector<vtkSmartPointer<vtkAxis>>
Axes;
544 bool AutoRotate =
false;
562 bool DrawAxesDecoration =
true;
568 bool FitToScene =
true;
672 bool EnsureOuterEdgeAxisLabelling =
false;
682 float AxesBoundaryPoints[8][3];
688 float TickLabelOffset[3][2];
712 int DirectionToData[3];
717 double DataBounds[4];
722 bool ClippingPlanesEnabled =
true;
727 bool ScaleBoxWithPlot =
true;
bool Spin(const vtkContextMouseEvent &mouse)
Spin the chart in response to a mouse movement.
vtkNew< vtkTransform > Scale
This transform keeps track of how the data points have been scaled (zoomed in or zoomed out) within t...
void ScaleUpAxes()
Scale up the axes when the scene gets larger.
std::size_t GetPlotHeight() const
Gets the current height of the plot in pixels irrespective of the size-strategy used.
vtkNew< vtkTransform > Box
This is the transform that is applied when rendering data from the plots.
virtual vtkIdType AddPlot(vtkPlot3D *plot)
Adds a plot to the chart.
vtkNew< vtkPen > Pen
This is the pen that is used to draw data from the plots.
data structure to represent mouse events.
vtkNew< vtkTransform > BoxScale
This transform keeps track of how the axes have been scaled (zoomed in or zoomed out).
bool CalculatePlotTransform(vtkAxis *x, vtkAxis *y, vtkAxis *z, vtkTransform *transform)
Given the x, y and z vtkAxis, and a transform, calculate the transform that the points in a chart wou...
void InitializeFutureBox()
Initialize the "future box" transform.
data structure to represent key events.
void LookDownZ()
Adjust the rotation of the chart so that we are looking down the Z axis.
bool Pan(const vtkContextMouseEvent &mouse)
Pan the data within the chart in response to a mouse movement.
vtkNew< vtkTransform > Rotation
This transform keeps track of how the chart has been rotated.
virtual bool RemovePlot(vtkPlot3D *plot)
Removes a plot from the chart.
vtkTextProperty * GetAxesTextProperty()
Get the text property for axes.
void InitializeAxesBoundaryPoints()
Initialize a list of "test points".
void ZoomAxes(int delta)
Change the scaling of the axes by a specified amount.
std::vector< vtkIdType > FreePlaces
These plots got removed (from Plots), try to reuse the free spot.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse press event.
vtkNew< vtkTransform > PlotTransform
This transform translates and scales the plots' data points so that they appear within the axes of th...
A table, which contains similar-typed columns of data.
void SetAroundX(bool isX)
Set whether or not we're rotating about the X axis.
Factory class for drawing 3D XYZ charts.
void SetGeometry(const vtkRectf &bounds)
Set the geometry in pixel coordinates (origin and width/height).
void DetermineWhichAxesToLabel()
For each of the XYZ dimensions, find the axis line that is furthest from the rendered data.
dynamic, self-adjusting array of unsigned char
void LookUpY()
Adjust the rotation of the chart so that we are looking up the Y axis.
bool Paint(vtkContext2D *painter) override
Paint event for the chart, called whenever the chart needs to be drawn.
void RecalculateBounds()
Determine the XYZ bounds of the plots within this chart.
void DrawAxes(vtkContext3D *context)
Draw the cube axes of this chart.
An algorithm for linking annotations among objects.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Class for drawing 2D primitives to a graphical context.
vtkAxis * GetAxis(int axis)
Get the x (0), y (1) or z (2) axis.
vtkColor4ub GetAxisColor()
Set the color for the axes.
bool KeyPressEvent(const vtkContextKeyEvent &key) override
Key press event.
void SetAxisColor(const vtkColor4ub &color)
Set the color for the axes.
void ScaleDownAxes()
Scale down the axes when the scene gets smaller.
void GetClippingPlaneEquation(int i, double *planeEquation)
Get the equation for the ith face of our bounding cube.
bool CheckForSceneResize()
Check to see if the scene changed size since the last render.
void LookDownY()
Adjust the rotation of the chart so that we are looking down the Y axis.
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the transform is interactive, false otherwise.
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event.
virtual void CalculateTransforms()
Calculate the transformation matrices used to draw data points and axes in the scene.
void NewDetermineWhichAxesToLabel()
New style axis labelling, ensuring labelling is always at the edges of the chart in the most sensible...
void GetOffsetForAxisLabel(int axis, float *bounds, float *offset)
Compute how some text should be offset from an axis.
void Update() override
Perform any updates to the item that may be necessary before rendering.
bool Zoom(const vtkContextMouseEvent &mouse)
Zoom in or out on the data in response to a mouse movement.
virtual void SetAnnotationLink(vtkAnnotationLink *link)
Set the vtkAnnotationLink for the chart.
bool Rotate(const vtkContextMouseEvent &mouse)
Rotate the chart in response to a mouse movement.
std::string YAxisLabel
The label for the Y Axis.
vtkSmartPointer< vtkAnnotationLink > Link
This link is used to share selected points with other classes.
void LookUpZ()
Adjust the rotation of the chart so that we are looking up the Z axis.
std::string ZAxisLabel
The label for the Z Axis.
void RecalculateTransform()
Use this chart's Geometry to set the endpoints of its axes.
void ComputeDataBounds()
Compute a bounding box for the data that is rendered within the axes.
a simple class to control print indentation
vtkNew< vtkTextProperty > AxesTextProperty
The text properties of the axes.
static vtkChartXYZ * New()
std::vector< vtkSmartPointer< vtkAxis > > Axes
The 3 axes of this chart.
void RescaleAxes()
Scale the axes up or down in response to a scene resize.
void DrawAxesLabels(vtkContext2D *painter)
Label the axes.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
Direction
The direction to data from an axis.
std::vector< vtkPlot3D * > Plots
The plots that are drawn within this chart.
void SetFitToScene(bool b)
Set whether or not the chart should automatically resize itself to fill the scene.
vtkNew< vtkTransform > ContextTransform
This is the transform that is applied when rendering data from the plots.
vtkNew< vtkTransform > Translation
This transform keeps track of how the data points have been panned within the chart.
void ClearPlots()
Remove all the plots from this chart.
represent text properties.
base class for items that are part of a vtkContextScene.
Abstract class for 3D plots.
std::size_t GetMarginBottom() const
Gets the current margin top in pixels irrespective of the size-strategy used.
void LookUpX()
Adjust the rotation of the chart so that we are looking up the X axis.
@ USE_MARGINS_AND_SCENE_SIZE
vtkNew< vtkPlaneCollection > BoundingCube
The six planes that define the bounding cube of our 3D axes.
void LegacyDetermineWhichAxesToLabel()
Old-style axis labelling, for compatibility; labelling may occur in less optimal places e....
void SetMargins(const vtkVector4i &margins)
Set the margins in pixels ordered top right bottom left The box will be drawn inside those margins,...
void SetDecorateAxes(bool b)
Set whether or not axes labels & tick marks should be drawn.
vtkNew< vtkTransform > FutureBox
This transform is initialized as a copy of Box.
bool Rotate(const RotateDirection rotateDirection)
Rotate the chart in a specific direction.
vtkNew< vtkPen > AxisPen
This is the pen that is used to draw the axes.
takes care of drawing 2D axes
void DrawTickMarks(vtkContext2D *painter)
Draw tick marks and tick mark labels along the axes.
vtkNew< vtkTransform > FutureBoxScale
This transform keeps track of the Scale of the FutureBox transform.
Class for drawing 3D primitives to a graphical context.
RotateDirection
Rotation directions.
int SceneHeight
The height of the scene, as of the most recent call to Paint().
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
maintain a list of planes
Wrapper around std::string to keep symbols short.
void SetClippingPlanesEnabled(bool)
Hide data outside the box.
AxisState
The state of an axis.
void LookDownX()
Adjust the rotation of the chart so that we are looking down the X axis.
virtual void SetAxis(int axisIndex, vtkAxis *axis)
Set the x (0), y (1) or z (2) axis.
double CalculateNiceMinMax(double &min, double &max, int axis)
Calculate the next "nicest" numbers above and below the current minimum.
std::size_t GetMarginLeft() const
Gets the current margin left in pixels irrespective of the size-strategy used.
std::size_t GetPlotWidth() const
Gets the current width of the plot in pixels irrespective of the size-strategy used.
std::string XAxisLabel
The label for the X Axis.
int SceneWidth
The weight of the scene, as of the most recent call to Paint().