VTK
vtkCompositeControlPointsItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositeControlPointsItem.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
33 #ifndef vtkCompositeControlPointsItem_h
34 #define vtkCompositeControlPointsItem_h
35 
36 #include "vtkChartsCoreModule.h" // For export macro
38 
41 
42 class VTKCHARTSCORE_EXPORT vtkCompositeControlPointsItem:
44 {
45 public:
47  void PrintSelf(ostream &os, vtkIndent indent) override;
48 
53 
58 
60 
64  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
66 
68  ColorPointsFunction = 1,
69  OpacityPointsFunction = 2,
70  ColorAndOpacityPointsFunction = 3
71  };
73 
85  vtkSetMacro(PointsFunction, int);
86  vtkGetMacro(PointsFunction, int);
88 
94  vtkIdType AddPoint(double* newPos) override;
95 
101  vtkIdType RemovePoint(double* pos) override;
102 
104 
111  vtkSetMacro(UseOpacityPointHandles, bool);
112  vtkGetMacro(UseOpacityPointHandles, bool);
114 
116 
119  bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override;
120  bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override;
121  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override;
123 
124 protected:
127 
128  void emitEvent(unsigned long event, void* params) override;
129 
131 
132  vtkIdType GetNumberOfPoints()const override;
133  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
134  void GetControlPoint(vtkIdType index, double* pos)const override;
135  void SetControlPoint(vtkIdType index, double *point) override;
136  void EditPoint(float tX, float tY) override;
137  virtual void EditPointCurve(vtkIdType idx);
138 
141 
146 
147 private:
149  void operator=(const vtkCompositeControlPointsItem &) = delete;
150 };
151 
152 #endif
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:41
vtkCompositeControlPointsItem::vtkCompositeControlPointsItem
vtkCompositeControlPointsItem()
vtkCompositeControlPointsItem::GetControlPointsMTime
vtkMTimeType GetControlPointsMTime() override
vtkCompositeControlPointsItem::MergeTransferFunctions
void MergeTransferFunctions()
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkCompositeControlPointsItem::SilentMergeTransferFunctions
void SilentMergeTransferFunctions()
vtkCompositeControlPointsItem::EditPoint
void EditPoint(float tX, float tY) override
vtkColorTransferControlPointsItem.h
vtkCompositeControlPointsItem::EditPointCurve
virtual void EditPointCurve(vtkIdType idx)
vtkCompositeControlPointsItem::PointsFunctionType
PointsFunctionType
Definition: vtkCompositeControlPointsItem.h:67
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
vtkPiecewisePointHandleItem
a vtkContextItem that draws handles around a point of a piecewise function
Definition: vtkPiecewisePointHandleItem.h:40
vtkCompositeControlPointsItem::~vtkCompositeControlPointsItem
~vtkCompositeControlPointsItem() override
vtkColorTransferFunction
Defines a transfer function for mapping a property to an RGB color value.
Definition: vtkColorTransferFunction.h:55
vtkCompositeControlPointsItem::AddPoint
vtkIdType AddPoint(double *newPos) override
Add a point to the function.
vtkCompositeControlPointsItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCompositeControlPointsItem::PointsFunction
int PointsFunction
Definition: vtkCompositeControlPointsItem.h:142
vtkCompositeControlPointsItem::OpacityFunction
vtkPiecewiseFunction * OpacityFunction
Definition: vtkCompositeControlPointsItem.h:143
vtkColorTransferControlPointsItem
Control points for vtkColorTransferFunction.
Definition: vtkColorTransferControlPointsItem.h:40
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkCompositeControlPointsItem::SetControlPoint
void SetControlPoint(vtkIdType index, double *point) override
Sets the x and y coordinates as well as the midpoint and sharpness of the control point corresponding...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCompositeControlPointsItem::SetOpacityFunction
void SetOpacityFunction(vtkPiecewiseFunction *opacity)
Utility function that calls SetPiecewiseFunction()
vtkCompositeControlPointsItem::OpacityPointHandle
vtkPiecewisePointHandleItem * OpacityPointHandle
Definition: vtkCompositeControlPointsItem.h:144
vtkPiecewiseFunction
Defines a 1D piecewise function.
Definition: vtkPiecewiseFunction.h:52
vtkCompositeControlPointsItem::GetNumberOfPoints
vtkIdType GetNumberOfPoints() const override
Return the number of points in the color transfer function.
vtkCompositeControlPointsItem::MouseMoveEvent
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
vtkCompositeControlPointsItem::RemovePoint
vtkIdType RemovePoint(double *pos) override
Remove a point of the function.
vtkCompositeControlPointsItem::DrawPoint
void DrawPoint(vtkContext2D *painter, vtkIdType index) override
vtkCompositeControlPointsItem::GetControlPoint
void GetControlPoint(vtkIdType index, double *pos) const override
Returns the x and y coordinates as well as the midpoint and sharpness of the control point correspond...
vtkCompositeControlPointsItem::emitEvent
void emitEvent(unsigned long event, void *params) override
vtkCompositeControlPointsItem::UseOpacityPointHandles
bool UseOpacityPointHandles
Definition: vtkCompositeControlPointsItem.h:145
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkCompositeControlPointsItem::MouseButtonPressEvent
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
vtkCompositeControlPointsItem::New
static vtkCompositeControlPointsItem * New()
Creates a piecewise control points object.
vtkCompositeControlPointsItem
Control points for vtkCompositeFunction.
Definition: vtkCompositeControlPointsItem.h:44
vtkCompositeControlPointsItem::SetColorTransferFunction
virtual void SetColorTransferFunction(vtkColorTransferFunction *function)
Set the color transfer function to draw its points.
vtkCompositeControlPointsItem::MouseDoubleClickEvent
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Mouse button double click event.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302