 |
VTK
9.0.1
|
Go to the documentation of this file.
28 #ifndef vtkControlPointsItem_h
29 #define vtkControlPointsItem_h
31 #include "vtkChartsCoreModule.h"
39 class vtkControlPointsAddPointItem;
66 void GetBounds(
double bounds[4])
override;
74 vtkSetVector4Macro(UserBounds,
double);
75 vtkGetVector4Macro(UserBounds,
double);
84 vtkSetVector4Macro(ValidBounds,
double);
85 vtkGetVector4Macro(ValidBounds,
double);
93 vtkGetMacro(ScreenPointRadius,
float);
94 vtkSetMacro(ScreenPointRadius,
float);
114 void SelectPoint(
double* currentPoint);
119 void SelectAllPoints();
131 void DeselectPoint(
double* currentPoint);
136 void DeselectAllPoints();
142 void ToggleSelectPoint(
vtkIdType pointId);
149 void ToggleSelectPoint(
double* currentPoint);
159 vtkIdType GetNumberOfSelectedPoints()
const;
172 bool IsOverPoint(
double* pos,
vtkIdType pointId);
177 vtkIdType GetControlPointId(
double* pos);
184 void GetControlPointsIds(
vtkIdTypeArray* ids,
bool excludeFirstAndLast =
false)
const;
192 vtkGetMacro(StrokeMode,
bool);
202 vtkSetMacro(SwitchPointsMode,
bool);
203 vtkGetMacro(SwitchPointsMode,
bool);
211 vtkSetMacro(EndPointsXMovable,
bool);
212 vtkGetMacro(EndPointsXMovable,
bool);
213 vtkSetMacro(EndPointsYMovable,
bool);
214 vtkGetMacro(EndPointsYMovable,
bool);
215 virtual bool GetEndPointsMovable();
223 vtkSetMacro(EndPointsRemovable,
bool);
224 vtkGetMacro(EndPointsRemovable,
bool);
232 vtkSetMacro(ShowLabels,
bool);
233 vtkGetMacro(ShowLabels,
bool);
240 vtkSetStringMacro(LabelFormat);
241 vtkGetStringMacro(LabelFormat);
249 virtual vtkIdType AddPoint(
double* newPos) = 0;
256 virtual vtkIdType RemovePoint(
double* pos) = 0;
267 inline void RemoveCurrentPoint();
272 virtual vtkIdType GetNumberOfPoints()
const = 0;
319 void SpreadPoints(
float factor,
bool dontSpreadFirstAndLast =
false);
336 vtkGetObjectMacro(SelectedPointPen,
vtkPen);
344 vtkGetObjectMacro(SelectedPointBrush,
vtkBrush);
354 vtkGetMacro(UseAddPointItem,
bool);
355 vtkSetMacro(UseAddPointItem,
bool);
356 vtkBooleanMacro(UseAddPointItem,
bool);
391 void StartInteraction();
392 void StartInteractionIfNotStarted();
394 void EndInteraction();
395 int GetInteractionsCount()
const;
396 virtual void emitEvent(
unsigned long event,
void* params =
nullptr) = 0;
398 static void CallComputePoints(
399 vtkObject* sender,
unsigned long event,
void* receiver,
void* params);
406 virtual void ComputePoints();
422 bool ClampValidDataPos(
double pos[2]);
423 bool ClampValidScreenPos(
double pos[2]);
436 void SetCurrentPointPos(
const vtkVector2f& newPos);
441 inline vtkVector2f GetSelectionCenterOfMass()
const;
445 virtual void EditPoint(
float vtkNotUsed(tX),
float vtkNotUsed(tY));
458 bool IsEndPointPicked();
463 bool IsPointRemovable(
vtkIdType pointId);
471 virtual void ComputeBounds(
double* bounds);
482 double UserBounds[4];
483 double ValidBounds[4];
507 void ComputeBounds();
511 bool UseAddPointItem =
false;
provides a brush that fills shapes drawn by vtkContext2D.
represent and manipulate 2D points
bool EnforceValidFunction
vtkBrush * SelectedPointBrush
data structure to represent mouse events.
data structure to represent key events.
bool PointAboutToBeToggled
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
Key press event.
bool PointAboutToBeDeleted
abstract base class for most VTK objects
Class for drawing 2D primitives to a graphical context.
Abstract class for 2D plots.
a vtkContextItem that draws handles around a point of a piecewise function
Abstract class for control points items.
vtkVector2f GetSelectionCenterOfMass() const
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
virtual vtkIdType RemovePoint(double *pos)=0
Remove a point of the function.
a simple class to control print indentation
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
vtkTransform2D * Transform
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
vtkIdTypeArray * Selection
Selected indices for the table the plot is rendering.
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
vtkVector2f GetCenterOfMass(vtkIdTypeArray *pointIDs) const
dynamic, self-adjusting array of vtkIdType
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkPen * SelectedPointPen
vtkIdType GetCurrentPoint() const
Returns the current point ID selected or -1 if there is no point current.
supports function callbacks
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
Mouse button double click event.
virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key)
Key release event.
void RemoveCurrentPoint()
Remove the current point.
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...
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Wrapper around std::string to keep symbols short.
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCallbackCommand * Callback
vtkTypeUInt32 vtkMTimeType