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 
57  virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
58 
60 
63  void SetOpacityFunction(vtkPiecewiseFunction* opacity);
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:
126  ~vtkCompositeControlPointsItem() override;
127 
132  bool UsingLogScale() override;
133 
134  void emitEvent(unsigned long event, void* params) override;
135 
137 
138  vtkIdType GetNumberOfPoints()const override;
139  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
140  void GetControlPoint(vtkIdType index, double* pos)const override;
141  void SetControlPoint(vtkIdType index, double *point) override;
142  void EditPoint(float tX, float tY) override;
143  virtual void EditPointCurve(vtkIdType idx);
144 
145  void MergeTransferFunctions();
146  void SilentMergeTransferFunctions();
147 
152 
153 private:
155  void operator=(const vtkCompositeControlPointsItem &) = delete;
156 };
157 
158 #endif
static vtkColorTransferControlPointsItem * New()
Creates a piecewise control points object.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
bool UsingLogScale() override
Returns true if control points are to be rendered in log-space.
Defines a 1D piecewise function.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
int vtkIdType
Definition: vtkType.h:345
vtkMTimeType GetControlPointsMTime() override
Must be reimplemented by subclasses to calculate the points to draw.
void GetControlPoint(vtkIdType index, double *point) const override
Returns the x and y coordinates as well as the midpoint and sharpness of the control point correspond...
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
a vtkContextItem that draws handles around a point of a piecewise function
vtkIdType GetNumberOfPoints() const override
Return the number of points in the color transfer function.
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:39
Control points for vtkCompositeFunction.
vtkIdType AddPoint(double *newPos) override
Add a point to the function.
void EditPoint(float tX, float tY) override
vtkIdType RemovePoint(double *pos) override
Remove a point of the function.
vtkPiecewisePointHandleItem * OpacityPointHandle
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Control points for vtkColorTransferFunction.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetColorTransferFunction(vtkColorTransferFunction *function)
Set the piecewise function to draw its points.
Defines a transfer function for mapping a property to an RGB color value.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
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...
void emitEvent(unsigned long event, void *params) override
void DrawPoint(vtkContext2D *painter, vtkIdType index) override
Internal function that paints a collection of points and optionally excludes some.