37 #include "vtkChartsCoreModule.h"
52 class vtkChartXYPrivate;
159 int GetPlotCorner(
vtkPlot* plot);
164 void SetPlotCorner(
vtkPlot* plot,
int corner);
223 void RemovePlotSelections();
229 vtkSetMacro(DrawAxesAtOrigin,
bool);
230 vtkGetMacro(DrawAxesAtOrigin,
bool);
231 vtkBooleanMacro(DrawAxesAtOrigin,
bool);
239 vtkSetMacro(AutoAxes,
bool);
240 vtkGetMacro(AutoAxes,
bool);
241 vtkBooleanMacro(AutoAxes,
bool);
248 vtkSetMacro(HiddenAxisBorder,
int);
249 vtkGetMacro(HiddenAxisBorder,
int);
258 vtkSetMacro(ForceAxesToBounds,
bool);
259 vtkGetMacro(ForceAxesToBounds,
bool);
260 vtkBooleanMacro(ForceAxesToBounds,
bool);
270 vtkSetMacro(IgnoreNanInBounds,
bool);
271 vtkGetMacro(IgnoreNanInBounds,
bool);
272 vtkBooleanMacro(IgnoreNanInBounds,
bool);
283 vtkSetMacro(BarWidthFraction,
float);
284 vtkGetMacro(BarWidthFraction,
float);
294 vtkSetMacro(ZoomWithMouseWheel,
bool);
295 vtkGetMacro(ZoomWithMouseWheel,
bool);
296 vtkBooleanMacro(ZoomWithMouseWheel,
bool);
305 void SetAxisZoom(
int index,
bool v);
306 bool GetAxisZoom(
int index);
315 vtkSetMacro(AdjustLowerBoundForLogPlot,
bool);
316 vtkGetMacro(AdjustLowerBoundForLogPlot,
bool);
317 vtkBooleanMacro(AdjustLowerBoundForLogPlot,
bool);
326 vtkSetMacro(DragPointAlongX,
bool);
327 vtkGetMacro(DragPointAlongX,
bool);
328 vtkBooleanMacro(DragPointAlongX,
bool);
337 vtkSetMacro(DragPointAlongY,
bool);
338 vtkGetMacro(DragPointAlongY,
bool);
339 vtkBooleanMacro(DragPointAlongY,
bool);
388 typedef std::map<unsigned int, vtkSmartPointer<vtkIdTypeArray>>
MapIndexToIds;
394 static void MakeSelection(
vtkAnnotationLink* link,
const MapIndexToIds& selection);
399 const std::vector<vtkContextTransform*>& GetTransforms()
const;
437 static void BuildSelection(
438 int selectionMode, MapIndexToIds& selection,
const MapIndexToIds& oldSelection);
453 void RecalculatePlotTransforms();
459 void RecalculatePlotBounds();
473 virtual int GetLegendBorder(
vtkContext2D* painter,
int axisPosition);
479 virtual void SetLegendPosition(
const vtkRectf& rect);
588 vtkChartXYPrivate* ChartPrivate;
599 void CalculateBarPlots();
614 bool RemovePlotFromCorners(
vtkPlot* plot);
622 void ReleasePlotSelections();
627 void TransformBoxOrPolygon(
bool polygonMode,
vtkTransform2D* transform,
647 #endif // vtkChartXY_h
bool DrawAxesAtOrigin
Keep the axes drawn at the origin? This will attempt to keep the axes drawn at the origin...
Wrapper around std::string to keep symbols short.
data structure to represent key events.
virtual void SetShowLegend(bool visible)
Set/get whether the chart should draw a legend.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
bool AdjustLowerBoundForLogPlot
Property to adjust the minimum of a logarithmic axis to be greater than 0, regardless of the minimum ...
vtkContextPolygon SelectionPolygon
The polygon created as the mouse is dragged around the screen when in polygonal selection mode...
virtual vtkIdType GetNumberOfAxes()
Get the number of axes in the current chart.
bool ForceAxesToBounds
Property to force the axes to have their Minimum and Maximum properties inside the plot boundaries...
bool Paint(vtkContext2D *painter) override=0
Paint event for the chart, called whenever the chart needs to be drawn.
virtual void RecalculateBounds()
Request that the chart recalculates the range of its axes.
dynamic, self-adjusting array of vtkIdType
int HiddenAxisBorder
Size of the border when an axis is hidden.
bool DrawSelectionPolygon
Should the selection polygon be drawn.
vtkRectf MouseBox
The box created as the mouse is dragged around the screen.
virtual void ClearPlots()
Remove all plots from the chart.
Class for drawing 2D primitives to a graphical context.
Factory class for drawing 2D charts.
virtual bool RemovePlot(vtkIdType index)
Remove the plot at the specified index, returns true if successful, false if the index was invalid...
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event, positive delta indicates forward movement of the wheel.
takes care of drawing 2D axes
data structure to represent mouse events.
vtkVector2i ScreenPosition
virtual void SetAxis(int axisIndex, vtkAxis *)
Set the axis specified by axisIndex.
virtual vtkChartLegend * GetLegend()
Get the legend for the chart, if available.
a simple class to control print indentation
std::map< unsigned int, vtkSmartPointer< vtkIdTypeArray > > MapIndexToIds
bool DrawBox
Should the box be drawn (could be selection, zoom etc).
Some derived classes for the different vectors commonly used.
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
Abstract class for 2D plots.
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
Key press event.
vtkSmartPointer< vtkChartLegend > Legend
The legend for the chart.
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
bool DragPointAlongX
Properties to enable the drag of a point for the ClickAndDrag Action.
Factory class for drawing XY charts.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool IgnoreNanInBounds
Property to ignore NaN in RecalculateBounds().
Small struct used by InvokeEvent to send some information about the point that was clicked on...
Composite dataset that organizes datasets into blocks.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
takes care of drawing the plot grid
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
bool ZoomWithMouseWheel
Property to enable zooming the chart with the mouse wheel.
bool AutoAxes
Should axes be turned on and off automatically - defaults to on.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkSmartPointer< vtkTooltipItem > Tooltip
The tooltip item for the chart - can be used to display extra information.
float BarWidthFraction
The fraction of the interval taken up along the x axis by any bars that are drawn on the chart...
virtual void SetSelectionMethod(int method)
Set the selection method, which controls how selections are handled by the chart. ...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.
virtual vtkPlot * AddPlot(int type)
Add a plot to the chart, defaults to using the name of the y column.
virtual vtkAxis * GetAxis(int axisIndex)
Get the axis specified by axisIndex.
An algorithm for linking annotations among objects.
bool DrawNearestPoint
Should we draw the location of the nearest point on the plot?
bool PlotTransformValid
Does the plot area transform need to be recalculated?