VTK  9.1.0
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 
30 #ifndef vtkCompositeControlPointsItem_h
31 #define vtkCompositeControlPointsItem_h
32 
33 #include "vtkChartsCoreModule.h" // For export macro
35 
38 
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49 
54 
56 
60  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
62 
64  {
65  ColorPointsFunction = 1,
66  OpacityPointsFunction = 2,
67  ColorAndOpacityPointsFunction = 3
68  };
69 
71 
83  vtkSetMacro(PointsFunction, int);
84  vtkGetMacro(PointsFunction, int);
86 
92  vtkIdType AddPoint(double* newPos) override;
93 
100  vtkIdType RemovePoint(double* pos) override;
101 
103 
110  vtkSetMacro(UseOpacityPointHandles, bool);
111  vtkGetMacro(UseOpacityPointHandles, bool);
113 
115 
118  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
119  bool MouseDoubleClickEvent(const vtkContextMouseEvent& mouse) override;
120  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
122 
128  vtkIdType GetNumberOfPoints() const override;
129 
136  void GetControlPoint(vtkIdType index, double point[4]) const override;
137 
144  void SetControlPoint(vtkIdType index, double* point) override;
145 
146 protected:
149 
150  void emitEvent(unsigned long event, void* params) override;
151 
153 
154  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
155  void EditPoint(float tX, float tY) override;
156  virtual void EditPointCurve(vtkIdType idx);
157 
160 
162  vtkPiecewiseFunction* OpacityFunction = nullptr;
163  vtkPiecewisePointHandleItem* OpacityPointHandle = nullptr;
164  bool UseOpacityPointHandles = false;
165 
166 private:
168  void operator=(const vtkCompositeControlPointsItem&) = delete;
169 };
170 
171 #endif
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:54
vtkCompositeControlPointsItem::vtkCompositeControlPointsItem
vtkCompositeControlPointsItem()
vtkCompositeControlPointsItem::GetControlPointsMTime
vtkMTimeType GetControlPointsMTime() override
Must be reimplemented by subclasses to calculate the points to draw.
vtkCompositeControlPointsItem::MergeTransferFunctions
void MergeTransferFunctions()
vtkIdType
int vtkIdType
Definition: vtkType.h:332
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:64
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
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:164
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.
vtkColorTransferControlPointsItem
Control points for vtkColorTransferFunction.
Definition: vtkColorTransferControlPointsItem.h:37
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkCompositeControlPointsItem::ColorAndOpacityPointsFunction
@ ColorAndOpacityPointsFunction
Definition: vtkCompositeControlPointsItem.h:67
vtkControlPointsItem::RemovePoint
virtual vtkIdType RemovePoint(double *pos)=0
Remove a point of the function.
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 correspondin...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCompositeControlPointsItem::GetControlPoint
void GetControlPoint(vtkIdType index, double point[4]) const override
Returns the x and y coordinates as well as the midpoint and sharpness of the control point correspond...
vtkCompositeControlPointsItem::SetOpacityFunction
void SetOpacityFunction(vtkPiecewiseFunction *opacity)
Utility function that calls SetPiecewiseFunction()
vtkPiecewiseFunction
Defines a 1D piecewise function.
Definition: vtkPiecewiseFunction.h:145
vtkCompositeControlPointsItem::GetNumberOfPoints
vtkIdType GetNumberOfPoints() const override
Returns the total number of points, either from using the superclass implementation or the opacity fu...
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
Internal function that paints a collection of points and optionally excludes some.
vtkCompositeControlPointsItem::emitEvent
void emitEvent(unsigned long event, void *params) override
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkCompositeControlPointsItem::MouseButtonPressEvent
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
vtkCompositeControlPointsItem::New
static vtkCompositeControlPointsItem * New()
Creates a piecewise control points object.
vtkCompositeControlPointsItem
Control points for vtkCompositeFunction.
Definition: vtkCompositeControlPointsItem.h:40
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 move event.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287