 |
VTK
9.0.1
|
Go to the documentation of this file.
31 #include "vtkChartsCoreModule.h"
43 class vtkChartXYPrivate;
208 vtkSetMacro(DrawAxesAtOrigin,
bool);
209 vtkGetMacro(DrawAxesAtOrigin,
bool);
210 vtkBooleanMacro(DrawAxesAtOrigin,
bool);
218 vtkSetMacro(AutoAxes,
bool);
219 vtkGetMacro(AutoAxes,
bool);
220 vtkBooleanMacro(AutoAxes,
bool);
227 vtkSetMacro(HiddenAxisBorder,
int);
228 vtkGetMacro(HiddenAxisBorder,
int);
237 vtkSetMacro(ForceAxesToBounds,
bool);
238 vtkGetMacro(ForceAxesToBounds,
bool);
239 vtkBooleanMacro(ForceAxesToBounds,
bool);
250 vtkSetMacro(BarWidthFraction,
float);
251 vtkGetMacro(BarWidthFraction,
float);
261 vtkSetMacro(ZoomWithMouseWheel,
bool);
262 vtkGetMacro(ZoomWithMouseWheel,
bool);
263 vtkBooleanMacro(ZoomWithMouseWheel,
bool);
272 vtkSetMacro(AdjustLowerBoundForLogPlot,
bool);
273 vtkGetMacro(AdjustLowerBoundForLogPlot,
bool);
274 vtkBooleanMacro(AdjustLowerBoundForLogPlot,
bool);
283 vtkSetMacro(DragPointAlongX,
bool);
284 vtkGetMacro(DragPointAlongX,
bool);
285 vtkBooleanMacro(DragPointAlongX,
bool);
294 vtkSetMacro(DragPointAlongY,
bool);
295 vtkGetMacro(DragPointAlongY,
bool);
296 vtkBooleanMacro(DragPointAlongY,
bool);
508 vtkChartXYPrivate* ChartPrivate;
519 void CalculateBarPlots();
534 bool RemovePlotFromCorners(
vtkPlot* plot);
542 void ReleasePlotSelections();
547 void TransformBoxOrPolygon(
bool polygonMode,
vtkTransform2D* transform,
567 #endif // vtkChartXY_h
Factory class for drawing 2D charts.
vtkRectf MouseBox
The box created as the mouse is dragged around the screen.
data structure to represent mouse events.
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Mouse leave event.
virtual vtkIdType GetPlotIndex(vtkPlot *)
Get the index of the specified plot, returns -1 if the plot does not belong to the chart.
data structure to represent key events.
virtual vtkIdType StackPlotAbove(vtkPlot *plot, vtkPlot *under)
Raises the plot above the under plot.
vtkSmartPointer< vtkChartLegend > Legend
The legend for the chart.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
vtkIdType GetNumberOfAxes() override
Get the number of axes in the current chart.
static void AddSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Add the supplied selection from the oldSelection.
void SetShowLegend(bool visible) override
Set whether the chart should draw a legend.
Small struct used by InvokeEvent to send some information about the point that was clicked on.
vtkIdType RaisePlot(vtkPlot *plot)
Raises the plot to the top of the plot's stack.
static int GetMouseSelectionMode(const vtkContextMouseEvent &mouse, int selectionMode)
Combine the SelectionMode with any mouse modifiers to get an effective selection mode for this click ...
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event, positive delta indicates forward movement of the wheel.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
vtkSmartPointer< vtkTooltipItem > Tooltip
The tooltip item for the chart - can be used to display extra information.
virtual void SetLegendPosition(const vtkRectf &rect)
Called after the edges of the chart are decided, set the position of the legend, depends upon its ali...
vtkIdType LowerPlot(vtkPlot *plot)
Lowers the plot to the bottom of the plot's stack.
An algorithm for linking annotations among objects.
Class for drawing 2D primitives to a graphical context.
bool DragPointAlongX
Properties to enable the drag of a point for the ClickAndDrag Action.
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
Abstract class for 2D plots.
bool AutoAxes
Should axes be turned on and off automatically - defaults to on.
float BarWidthFraction
The fraction of the interval taken up along the x axis by any bars that are drawn on the chart.
bool DrawNearestPoint
Should we draw the location of the nearest point on the plot?
vtkPlot * GetPlot(vtkIdType index) override
Get the plot at the specified index, returns null if the index is invalid.
void Update() override
Perform any updates to the item that may be necessary before rendering.
bool ZoomWithMouseWheel
Property to enable zooming the chart with the mouse wheel.
bool KeyPressEvent(const vtkContextKeyEvent &key) override
Key press event.
static void MinusSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Subtract the supplied selection from the oldSelection.
bool DrawAxesAtOrigin
Keep the axes drawn at the origin? This will attempt to keep the axes drawn at the origin,...
vtkIdType GetNumberOfPlots() override
Get the number of plots the chart contains.
void RecalculatePlotBounds()
Calculate the optimal zoom level such that all of the points to be plotted will fit into the plot are...
static void MakeSelection(vtkAnnotationLink *link, vtkIdTypeArray *selectionIds, vtkPlot *plot)
Populate the annotation link with the supplied selectionIds array, and set the appropriate node prope...
static vtkChartXY * New()
Creates a 2D Chart object.
void SetSelectionMethod(int method) override
Set the selection method, which controls how selections are handled by the chart.
vtkChartLegend * GetLegend() override
Get the vtkChartLegend object that will be displayed by the chart.
takes care of drawing the plot grid
bool AdjustLowerBoundForLogPlot
Property to adjust the minimum of a logarithmic axis to be greater than 0, regardless of the minimum ...
bool ForceAxesToBounds
Property to force the axes to have their Minimum and Maximum properties inside the plot boundaries.
a simple class to control print indentation
bool PlotTransformValid
Does the plot area transform need to be recalculated?
virtual vtkTooltipItem * GetTooltip()
Get the vtkTooltipItem object that will be displayed by the chart.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
vtkIdType AddPlot(vtkPlot *plot) override
Adds a plot to the chart.
void RecalculatePlotTransforms()
Recalculate the necessary transforms.
static void BuildSelection(vtkAnnotationLink *link, int selectionMode, vtkIdTypeArray *plotSelection, vtkIdTypeArray *oldSelection, vtkPlot *plot)
Build a selection based on the supplied selectionMode using the new plotSelection and combining it wi...
vtkAxis * GetAxis(int axisIndex) override
Get the axis specified by axisIndex.
bool RemovePlot(vtkIdType index) override
Remove the plot at the specified index, returns true if successful, false if the index was invalid.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
virtual int GetLegendBorder(vtkContext2D *painter, int axisPosition)
Layout for the legend if it is visible.
void ClearPlots() override
Remove all plots from the chart.
vtkVector2i ScreenPosition
int HiddenAxisBorder
Size of the border when an axis is hidden.
void RemovePlotSelections()
Remove all the selection from Plots.
dynamic, self-adjusting array of vtkIdType
takes care of drawing 2D axes
virtual void SetTooltipInfo(const vtkContextMouseEvent &, const vtkVector2d &, vtkIdType, vtkPlot *, vtkIdType segmentIndex=-1)
Set the information passed to the tooltip.
vtkContextPolygon SelectionPolygon
The polygon created as the mouse is dragged around the screen when in polygonal selection mode.
virtual bool UpdateLayout(vtkContext2D *painter)
Update the layout of the chart, this may require the vtkContext2D in order to get font metrics etc.
Some derived classes for the different vectors commonly used.
virtual void SetAxis(int axisIndex, vtkAxis *) override
Set the axis specified by axisIndex.
Factory class for drawing XY charts.
Wrapper around std::string to keep symbols short.
int GetPlotCorner(vtkPlot *plot)
Figure out which quadrant the plot is in.
bool DrawSelectionPolygon
Should the selection polygon be drawn.
vtkPlot * AddPlot(int type) override
Add a plot to the chart, defaults to using the name of the y column.
void RecalculateBounds() override
Request that the chart recalculates the range of its axes.
bool DrawBox
Should the box be drawn (could be selection, zoom etc).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkIdType StackPlotUnder(vtkPlot *plot, vtkPlot *above)
Lowers the plot under the above plot.
void SetPlotCorner(vtkPlot *plot, int corner)
Figure out which quadrant the plot is in.
static void ToggleSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Toggle the supplied selection from the oldSelection.
bool Paint(vtkContext2D *painter) override
Paint event for the chart, called whenever the chart needs to be drawn.
virtual void SetTooltip(vtkTooltipItem *tooltip)
Set the vtkTooltipItem object that will be displayed by the chart.