30 #ifndef vtkControlPointsItem_h
31 #define vtkControlPointsItem_h
56 CurrentPointChangedEvent = vtkCommand::UserEvent,
68 vtkSetVector4Macro(UserBounds,
double);
69 vtkGetVector4Macro(UserBounds,
double);
76 vtkSetVector4Macro(ValidBounds,
double);
77 vtkGetVector4Macro(ValidBounds,
double);
82 vtkGetMacro(ScreenPointRadius,
float);
83 vtkSetMacro(ScreenPointRadius,
float);
97 void SelectPoint(
double* currentPoint);
100 void SelectAllPoints();
108 void DeselectPoint(
double* currentPoint);
111 void DeselectAllPoints();
115 void ToggleSelectPoint(
vtkIdType pointId);
120 void ToggleSelectPoint(
double* currentPoint);
126 vtkIdType GetNumberOfSelectedPoints()
const;
135 bool IsOverPoint(
double* pos,
vtkIdType pointId);
139 vtkIdType GetControlPointId(
double* pos);
146 bool excludeFirstAndLast =
false)
const;
152 vtkGetMacro(StrokeMode,
bool);
160 vtkSetMacro(SwitchPointsMode,
bool);
161 vtkGetMacro(SwitchPointsMode,
bool);
167 vtkSetMacro(EndPointsXMovable,
bool);
168 vtkGetMacro(EndPointsXMovable,
bool);
169 vtkSetMacro(EndPointsYMovable,
bool);
170 vtkGetMacro(EndPointsYMovable,
bool);
171 virtual bool GetEndPointsMovable();
177 vtkSetMacro(EndPointsRemovable,
bool);
178 vtkGetMacro(EndPointsRemovable,
bool);
184 vtkSetMacro(ShowLabels,
bool);
185 vtkGetMacro(ShowLabels,
bool);
190 vtkSetStringMacro(LabelFormat);
191 vtkGetStringMacro(LabelFormat);
197 virtual vtkIdType AddPoint(
double* newPos) = 0;
202 virtual vtkIdType RemovePoint(
double* pos) = 0;
209 inline void RemoveCurrentPoint();
212 virtual vtkIdType GetNumberOfPoints()
const = 0;
247 void SpreadPoints(
float factor,
bool dontSpreadFirstAndLast =
false);
258 vtkGetObjectMacro(SelectedPointPen,
vtkPen);
264 vtkGetObjectMacro(SelectedPointBrush,
vtkBrush);
289 void StartInteraction();
290 void StartInteractionIfNotStarted();
292 void EndInteraction();
293 int GetInteractionsCount()
const;
294 virtual void emitEvent(
unsigned long event,
void* params = 0) = 0;
296 static void CallComputePoints(
vtkObject* sender,
unsigned long event,
void* receiver,
void* params);
301 virtual void ComputePoints();
302 virtual unsigned long int GetControlPointsMTime() =0;
318 virtual bool ClampPos(
double pos[2],
double bounds[4]);
319 bool ClampValidPos(
double pos[2]);
330 void SetCurrentPointPos(
const vtkVector2f& newPos);
335 inline vtkVector2f GetSelectionCenterOfMass()
const;
339 virtual void EditPoint(
float vtkNotUsed(tX),
float vtkNotUsed(tY));
350 bool IsEndPointPicked();
353 bool IsPointRemovable(
vtkIdType pointId);
360 virtual void ComputeBounds(
double* bounds);
376 double UserBounds[4];
377 double ValidBounds[4];
400 void ComputeBounds();
Wrapper around std::string to keep symbols short.
data structure to represent key events.
abstract base class for most VTK objects
vtkIdType GetCurrentPoint() const
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
virtual bool Paint(vtkContext2D *painter)
bool PointAboutToBeToggled
virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key)
vtkVector2f GetSelectionCenterOfMass() const
Abstract class for control points items.
virtual void GetBounds(double bounds[4])
dynamic, self-adjusting array of vtkIdType
vtkPen * SelectedPointPen
virtual bool UsingLogScale()
vtkVector2f GetCenterOfMass(vtkIdTypeArray *pointIDs) const
vtkIdTypeArray * Selection
void RemoveCurrentPoint()
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)
vtkTransform2D * Transform
a simple class to control print indentation
represent and manipulate 2D points
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Abstract class for 2D plots.
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
virtual vtkIdType RemovePoint(double *pos)=0
virtual void PrintSelf(ostream &os, vtkIndent indent)
bool EnforceValidFunction
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
bool PointAboutToBeDeleted
virtual bool Hit(const vtkContextMouseEvent &mouse)
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
vtkCallbackCommand * Callback
#define VTKCHARTSCORE_EXPORT