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 
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 
53  virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
54 
56 
59  void SetOpacityFunction(vtkPiecewiseFunction* opacity);
60  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
62 
64  {
65  ColorPointsFunction = 1,
66  OpacityPointsFunction = 2,
67  ColorAndOpacityPointsFunction = 3
68  };
70 
82  vtkSetMacro(PointsFunction, int);
83  vtkGetMacro(PointsFunction, int);
85 
91  vtkIdType AddPoint(double* newPos) override;
92 
98  vtkIdType RemovePoint(double* pos) override;
99 
101 
108  vtkSetMacro(UseOpacityPointHandles, bool);
109  vtkGetMacro(UseOpacityPointHandles, bool);
111 
113 
116  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
117  bool MouseDoubleClickEvent(const vtkContextMouseEvent& mouse) override;
118  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
120 
121 protected:
123  ~vtkCompositeControlPointsItem() override;
124 
125  void emitEvent(unsigned long event, void* params) override;
126 
128 
129  vtkIdType GetNumberOfPoints() const override;
130  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
131  void GetControlPoint(vtkIdType index, double* pos) const override;
132  void SetControlPoint(vtkIdType index, double* point) override;
133  void EditPoint(float tX, float tY) override;
134  virtual void EditPointCurve(vtkIdType idx);
135 
136  void MergeTransferFunctions();
137  void SilentMergeTransferFunctions();
138 
143 
144 private:
146  void operator=(const vtkCompositeControlPointsItem&) = delete;
147 };
148 
149 #endif
vtkControlPointsItem::MouseButtonPressEvent
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse and key events.
vtkColorTransferControlPointsItem::emitEvent
void emitEvent(unsigned long event, void *params) override
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:34
vtkColorTransferControlPointsItem::GetControlPoint
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...
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkColorTransferControlPointsItem::SetColorTransferFunction
void SetColorTransferFunction(vtkColorTransferFunction *function)
Set the piecewise function to draw its points.
vtkControlPointsItem::MouseDoubleClickEvent
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Mouse button double click event.
vtkColorTransferControlPointsItem::EditPoint
void EditPoint(float tX, float tY) override
vtkColorTransferControlPointsItem.h
vtkCompositeControlPointsItem::PointsFunctionType
PointsFunctionType
Definition: vtkCompositeControlPointsItem.h:63
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkColorTransferControlPointsItem::AddPoint
vtkIdType AddPoint(double *newPos) override
Add a point to the function.
vtkPiecewisePointHandleItem
a vtkContextItem that draws handles around a point of a piecewise function
Definition: vtkPiecewisePointHandleItem.h:39
vtkColorTransferFunction
Defines a transfer function for mapping a property to an RGB color value.
Definition: vtkColorTransferFunction.h:54
vtkCompositeControlPointsItem::PointsFunction
int PointsFunction
Definition: vtkCompositeControlPointsItem.h:139
vtkColorTransferControlPointsItem::GetNumberOfPoints
vtkIdType GetNumberOfPoints() const override
Return the number of points in the color transfer function.
vtkCompositeControlPointsItem::OpacityFunction
vtkPiecewiseFunction * OpacityFunction
Definition: vtkCompositeControlPointsItem.h:140
vtkColorTransferControlPointsItem
Control points for vtkColorTransferFunction.
Definition: vtkColorTransferControlPointsItem.h:36
vtkX3D::point
Definition: vtkX3D.h:242
vtkColorTransferControlPointsItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkColorTransferControlPointsItem::New
static vtkColorTransferControlPointsItem * New()
Creates a piecewise control points object.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkColorTransferControlPointsItem::DrawPoint
void DrawPoint(vtkContext2D *painter, vtkIdType index) override
vtkColorTransferControlPointsItem::RemovePoint
vtkIdType RemovePoint(double *pos) override
Remove a point of the function.
vtkColorTransferControlPointsItem::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...
vtkCompositeControlPointsItem::OpacityPointHandle
vtkPiecewisePointHandleItem * OpacityPointHandle
Definition: vtkCompositeControlPointsItem.h:141
vtkPiecewiseFunction
Defines a 1D piecewise function.
Definition: vtkPiecewiseFunction.h:45
vtkColorTransferControlPointsItem::GetControlPointsMTime
vtkMTimeType GetControlPointsMTime() override
vtkControlPointsItem::MouseMoveEvent
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
vtkCompositeControlPointsItem::UseOpacityPointHandles
bool UseOpacityPointHandles
Definition: vtkCompositeControlPointsItem.h:142
vtkX3D::index
Definition: vtkX3D.h:252
vtkCompositeControlPointsItem
Control points for vtkCompositeFunction.
Definition: vtkCompositeControlPointsItem.h:39
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304