30#ifndef vtkPlotRangeHandlesItem_h
31#define vtkPlotRangeHandlesItem_h
33#include "vtkChartsCoreModule.h"
38VTK_ABI_NAMESPACE_BEGIN
83 vtkSetMacro(HandleWidth,
float);
84 vtkGetMacro(HandleWidth,
float);
91 vtkSetClampMacro(HandleOrientation,
int, VERTICAL, HORIZONTAL);
92 vtkGetMacro(HandleOrientation,
int);
106 vtkSetVector4Macro(Extent,
double);
107 vtkGetVector4Macro(Extent,
double);
229 float HandleWidth = 2;
230 float HandleDelta = 0;
231 float LeftHandleDrawRange[2] = { 0, 0 };
232 float RightHandleDrawRange[2] = { 0, 0 };
233 int ActiveHandle = NO_HANDLE;
234 int HoveredHandle = NO_HANDLE;
235 float HoveredPosition[2] = { 0, 0 };
237 double ActiveHandlePosition = 0;
238 double ActiveHandleRangeValue = 0;
241 double Extent[4] = { 0, 1, 0, 1 };
244 int HandleOrientation = VERTICAL;
provides a brush that fills shapes drawn by vtkContext2D.
Class for drawing 2D primitives to a graphical context.
data structure to represent mouse events.
a simple class to control print indentation
Allocate and hold a VTK object.
item to show and control a range on vtkAxis
virtual void SetActiveHandlePosition(double position)
Internal method to set the ActiveHandlePosition and compute the ActiveHandleRangeValue accordingly.
vtkPlotRangeHandlesItem(const vtkPlotRangeHandlesItem &)=delete
void GetAxesUnscaledRange(double *abcissaRange, double *ordinateRange)
Get the logical range of abcissa or ordinate axis based on the handle orientation,...
static vtkPlotRangeHandlesItem * New()
void GetBounds(double bounds[4]) override
Recover the bounds of the item.
bool Paint(vtkContext2D *painter) override
Paint both handles and the range if a handle is active or hovered.
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
void TransformScreenToData(double inX, double inY, double &outX, double &outY) override
Transform the mouse event in the control-points space.
~vtkPlotRangeHandlesItem() override
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the supplied x, y coordinate is around a handle.
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
bool IsActiveHandleMoved(double tolerance)
Internal method to check if the active handle have actually been moved.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkBrush > HighlightBrush
void GetAxesRange(double *abcissaRange, double *ordinateRange)
Get the logical range of abcissa or ordinate axis based on the handle orientation,...
void SetHandleOrientationToVertical()
Set/Get the handles orientation in the plot.
void SetCursor(int cursor)
Set the cursor shape.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
void SetHandleOrientationToHorizontal()
Set/Get the handles orientation in the plot.
virtual void GetHandlesRange(double range[2])
Recover the range currently set by the handles Use this method by observing EndInteractionEvent.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
vtkPlotRangeHandlesItem()
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
vtkNew< vtkBrush > RangeLabelBrush
void ComputeRange(double *range)
Compute the range used for the handles.
void TransformDataToScreen(double inX, double inY, double &outX, double &outY) override
Transform the mouse event in the control-points space.
void ComputeHandleDelta(double screenBounds[4])
Compute the delta used for the picking handle size.
virtual void ComputeHandlesDrawRange()
Compute the handles draw range by using the handle width and the transfer function.
void operator=(const vtkPlotRangeHandlesItem &)=delete
virtual int FindRangeHandle(const vtkVector2f &point, const vtkVector2f &tolerance)
Returns the handle the provided point is over with a provided tolerance, it can be NO_HANDLE,...
Abstract class for 2D plots.
virtual void TransformScreenToData(const vtkVector2f &in, vtkVector2f &out)
Transform the mouse event in the control-points space.
virtual void TransformDataToScreen(const vtkVector2f &in, vtkVector2f &out)
Transform the mouse event in the control-points space.