 |
VTK
9.1.0
|
Go to the documentation of this file.
39 #ifndef vtkPlotRangeHandlesItem_h
40 #define vtkPlotRangeHandlesItem_h
42 #include "vtkChartsCoreModule.h"
90 vtkSetMacro(HandleWidth,
float);
91 vtkGetMacro(HandleWidth,
float);
98 vtkSetClampMacro(HandleOrientation,
int, VERTICAL, HORIZONTAL);
99 vtkGetMacro(HandleOrientation,
int);
113 vtkSetVector4Macro(Extent,
double);
114 vtkGetVector4Macro(Extent,
double);
190 const double inX,
const double inY,
double& outX,
double& outY)
override;
192 const double inX,
const double inY,
double& outX,
double& outY)
override;
238 float HandleWidth = 2;
239 float HandleDelta = 0;
240 float LeftHandleDrawRange[2] = { 0, 0 };
241 float RightHandleDrawRange[2] = { 0, 0 };
242 int ActiveHandle = NO_HANDLE;
243 int HoveredHandle = NO_HANDLE;
244 float HoveredPosition[2] = { 0, 0 };
246 double ActiveHandlePosition = 0;
247 double ActiveHandleRangeValue = 0;
250 double Extent[4] = { 0, 1, 0, 1 };
253 int HandleOrientation = VERTICAL;
256 #endif // vtkPlotRangeHandlesItem_h
provides a brush that fills shapes drawn by vtkContext2D.
data structure to represent mouse events.
vtkNew< vtkBrush > RangeLabelBrush
static vtkPlotRangeHandlesItem * New()
virtual void TransformScreenToData(const vtkVector2f &in, vtkVector2f &out)
Transform the mouse event in the control-points space.
void TransformScreenToData(const double inX, const double inY, double &outX, double &outY) override
Transform the mouse event in the control-points space.
Class for drawing 2D primitives to a graphical context.
void GetAxesRange(double *abcissaRange, double *ordinateRange)
Get the logical range of abcissa or ordinate axis based on the handle orientation,...
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
Abstract class for 2D plots.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetAxesUnscaledRange(double *abcissaRange, double *ordinateRange)
Get the logical range of abcissa or ordinate axis based on the handle orientation,...
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
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,...
void TransformDataToScreen(const double inX, const double inY, double &outX, double &outY) override
Transform the mouse event in the control-points space.
bool Paint(vtkContext2D *painter) override
Paint both handles and the range if a handle is active or hovered.
a simple class to control print indentation
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
void SetCursor(int cursor)
Set the cursor shape.
virtual void TransformDataToScreen(const vtkVector2f &in, vtkVector2f &out)
Transform the mouse event in the control-points space.
void GetBounds(double bounds[4]) override
Recover the bounds of the item.
virtual void ComputeHandlesDrawRange()
Compute the handles draw range by using the handle width and the transfer function.
bool IsActiveHandleMoved(double tolerance)
Internal method to check if the active handle have actually been moved.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
void SetHandleOrientationToVertical()
Set/Get the handles orientation in the plot.
void ComputeRange(double *range)
Compute the range used for the handles.
virtual void GetHandlesRange(double range[2])
Recover the range currently set by the handles Use this method by observing EndInteractionEvent.
item to show and control a range on vtkAxis
vtkNew< vtkBrush > HighlightBrush
virtual void SetActiveHandlePosition(double position)
Internal method to set the ActiveHandlePosition and compute the ActiveHandleRangeValue accordingly.
void operator=(const vtkPlotRangeHandlesItem &)=delete
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the supplied x, y coordinate is around a handle.
void ComputeHandleDelta(double screenBounds[4])
Compute the delta used for the picking handle size.
vtkPlotRangeHandlesItem()
~vtkPlotRangeHandlesItem() override
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
void SetHandleOrientationToHorizontal()
Set/Get the handles orientation in the plot.
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
vtkPlotRangeHandlesItem(const vtkPlotRangeHandlesItem &)=delete