35 #ifndef vtkRangeHandlesItem_h
36 #define vtkRangeHandlesItem_h
38 #include "vtkChartsCoreModule.h"
89 vtkSetMacro(HandleWidth,
float);
90 vtkGetMacro(HandleWidth,
float);
148 float HandleWidth = 2;
149 float HandleDelta = 0;
150 float LeftHandleDrawRange[2] = { 0, 0 };
151 float RightHandleDrawRange[2] = { 0, 0 };
152 int ActiveHandle = NO_HANDLE;
153 int HoveredHandle = NO_HANDLE;
154 double ActiveHandlePosition = 0;
155 double ActiveHandleRangeValue = 0;
provides a brush that fills shapes drawn by vtkContext2D.
Defines a transfer function for mapping a property to an RGB color value.
Class for drawing 2D primitives to a graphical context.
data structure to represent mouse events.
a simple class to control print indentation
Abstract class for 2D plots.
item to show and control the range of a vtkColorTransferFunction
void SetActiveHandlePosition(double position)
Internal method to set the ActiveHandlePosition and compute the ActiveHandleRangeValue accordingly.
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the supplied x, y coordinate is around a handle.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
bool MouseEnterEvent(const vtkContextMouseEvent &mouse) override
Mouse enter event.
virtual void GetHandlesRange(double range[2])
Recover the range currently set by the handles Use this method by observing EndInteractionEvent.
bool MouseLeaveEvent(const vtkContextMouseEvent &mouse) override
Mouse leave event.
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,...
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Interaction methods to interact with the handles.
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Mouse button double click event.
void SetColorTransferFunction(vtkColorTransferFunction *ctf)
Get/set the color transfer function to interact with.
bool Paint(vtkContext2D *painter) override
Paint both handles and the range if a handle is active or hovered.
static vtkRangeHandlesItem * New()
bool IsActiveHandleMoved(double tolerance)
Internal method to check if the active handle have actually been moved.
void SetCursor(int cursor)
Set the cursor shape.
void GetBounds(double bounds[4]) override
Recover the bounds of the item.
~vtkRangeHandlesItem() override
void ComputeHandlesDrawRange()
Compute the handles draw range by using the handle width and the transfer function.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.