30 #ifndef __vtkControlPointsItem_h
31 #define __vtkControlPointsItem_h
33 #include "vtkChartsCoreModule.h"
50 CurrentPointChangedEvent = vtkCommand::UserEvent,
62 vtkSetVector4Macro(UserBounds,
double);
63 vtkGetVector4Macro(UserBounds,
double);
70 vtkSetVector4Macro(ValidBounds,
double);
71 vtkGetVector4Macro(ValidBounds,
double);
76 vtkGetMacro(ScreenPointRadius,
float);
77 vtkSetMacro(ScreenPointRadius,
float);
91 void SelectPoint(
double* currentPoint);
94 void SelectAllPoints();
102 void DeselectPoint(
double* currentPoint);
105 void DeselectAllPoints();
109 void ToggleSelectPoint(
vtkIdType pointId);
114 void ToggleSelectPoint(
double* currentPoint);
120 vtkIdType GetNumberOfSelectedPoints()
const;
129 bool IsOverPoint(
double* pos,
vtkIdType pointId);
133 vtkIdType GetControlPointId(
double* pos);
140 bool excludeFirstAndLast =
false)
const;
146 vtkGetMacro(StrokeMode,
bool);
154 vtkSetMacro(SwitchPointsMode,
bool);
155 vtkGetMacro(SwitchPointsMode,
bool);
161 vtkSetMacro(EndPointsXMovable,
bool);
162 vtkGetMacro(EndPointsXMovable,
bool);
163 vtkSetMacro(EndPointsYMovable,
bool);
164 vtkGetMacro(EndPointsYMovable,
bool);
165 virtual bool GetEndPointsMovable();
171 vtkSetMacro(EndPointsRemovable,
bool);
172 vtkGetMacro(EndPointsRemovable,
bool);
178 virtual vtkIdType AddPoint(
double* newPos) = 0;
183 virtual vtkIdType RemovePoint(
double* pos) = 0;
190 inline void RemoveCurrentPoint();
193 virtual vtkIdType GetNumberOfPoints()
const = 0;
228 void SpreadPoints(
float factor,
bool dontSpreadFirstAndLast =
false);
239 vtkGetObjectMacro(SelectedPointPen,
vtkPen);
245 vtkGetObjectMacro(SelectedPointBrush,
vtkBrush);
270 void StartInteraction();
271 void StartInteractionIfNotStarted();
273 void EndInteraction();
274 int GetInteractionsCount()
const;
275 virtual void emitEvent(
unsigned long event,
void* params = 0) = 0;
277 static void CallComputePoints(
vtkObject* sender,
unsigned long event,
void* receiver,
void* params);
282 virtual void ComputePoints();
283 virtual unsigned long int GetControlPointsMTime() =0;
292 bool ClampPos(
double pos[2],
double bounds[4]);
293 bool ClampValidPos(
double pos[2]);
304 void SetCurrentPointPos(
const vtkVector2f& newPos);
309 inline vtkVector2f GetSelectionCenterOfMass()
const;
313 virtual void EditPoint(
float vtkNotUsed(tX),
float vtkNotUsed(tY));
321 bool IsEndPointPicked();
324 bool IsPointRemovable(
vtkIdType pointId);
334 double UserBounds[4];
335 double ValidBounds[4];
356 void ComputeBounds();
357 void ComputeBounds(
double* bounds);