28 #ifndef vtkControlPointsItem_h 29 #define vtkControlPointsItem_h 31 #include "vtkChartsCoreModule.h" 54 CurrentPointChangedEvent = vtkCommand::UserEvent,
62 void GetBounds(
double bounds[4]) VTK_OVERRIDE;
70 vtkSetVector4Macro(UserBounds,
double);
71 vtkGetVector4Macro(UserBounds,
double);
80 vtkSetVector4Macro(ValidBounds,
double);
81 vtkGetVector4Macro(ValidBounds,
double);
89 vtkGetMacro(ScreenPointRadius,
float);
110 void SelectPoint(
double* currentPoint);
115 void SelectAllPoints();
127 void DeselectPoint(
double* currentPoint);
132 void DeselectAllPoints();
138 void ToggleSelectPoint(
vtkIdType pointId);
145 void ToggleSelectPoint(
double* currentPoint);
155 vtkIdType GetNumberOfSelectedPoints()
const;
168 bool IsOverPoint(
double* pos,
vtkIdType pointId);
173 vtkIdType GetControlPointId(
double* pos);
181 bool excludeFirstAndLast =
false)
const;
189 vtkGetMacro(StrokeMode,
bool);
200 vtkGetMacro(SwitchPointsMode,
bool);
209 vtkGetMacro(EndPointsXMovable,
bool);
211 vtkGetMacro(EndPointsYMovable,
bool);
212 virtual bool GetEndPointsMovable();
221 vtkGetMacro(EndPointsRemovable,
bool);
230 vtkGetMacro(ShowLabels,
bool);
237 vtkSetStringMacro(LabelFormat);
246 virtual vtkIdType AddPoint(
double* newPos) = 0;
253 virtual vtkIdType RemovePoint(
double* pos) = 0;
264 inline void RemoveCurrentPoint();
269 virtual vtkIdType GetNumberOfPoints()
const = 0;
316 void SpreadPoints(
float factor,
bool dontSpreadFirstAndLast =
false);
333 vtkGetObjectMacro(SelectedPointPen,
vtkPen);
341 vtkGetObjectMacro(SelectedPointBrush,
vtkBrush);
372 void StartInteraction();
373 void StartInteractionIfNotStarted();
375 void EndInteraction();
376 int GetInteractionsCount()const;
377 virtual
void emitEvent(
unsigned long event,
void* params = 0) = 0;
379 static
void CallComputePoints(
vtkObject* sender,
unsigned long event,
void* receiver,
void* params);
386 virtual
void ComputePoints();
409 virtual
bool ClampPos(
double pos[2],
double bounds[4]);
410 bool ClampValidPos(
double pos[2]);
423 void SetCurrentPointPos(const
vtkVector2f& newPos);
428 inline
vtkVector2f GetSelectionCenterOfMass()const;
432 virtual
void EditPoint(
float vtkNotUsed(tX),
float vtkNotUsed(tY));
449 bool IsEndPointPicked();
454 bool IsPointRemovable(
vtkIdType pointId);
462 virtual
void ComputeBounds(
double* bounds);
469 virtual
bool UsingLogScale() {
return false; }
480 double UserBounds[4];
481 double ValidBounds[4];
504 void ComputeBounds();
512 this->RemovePoint(this->GetCurrentPoint());
518 return this->GetCenterOfMass(this->Selection);
vtkVector2f GetSelectionCenterOfMass() const
Wrapper around std::string to keep symbols short.
data structure to represent key events.
abstract base class for most VTK objects
vtkTypeUInt32 vtkMTimeType
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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...
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
bool PointAboutToBeToggled
virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key)
Key release event.
Abstract class for control points items.
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
dynamic, self-adjusting array of vtkIdType
vtkPen * SelectedPointPen
void RemoveCurrentPoint()
Remove the current point.
vtkBrush * SelectedPointBrush
Class for drawing 2D primitives to a graphical context.
supports function callbacks
provides a brush that fills shapes drawn by vtkContext2D.
data structure to represent mouse events.
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
vtkTransform2D * Transform
a simple class to control print indentation
represent and manipulate 2D points
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Abstract class for 2D plots.
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
Key press event.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
bool EnforceValidFunction
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
bool PointAboutToBeDeleted
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
Mouse button double click event.
vtkCallbackCommand * Callback