Remoting
Views
vtkTransferFunctionChartHistogram2D.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2
// SPDX-License-Identifier: BSD-3-Clause
3
#ifndef vtkTransferFunctionChartHistogram2D_h
4
#define vtkTransferFunctionChartHistogram2D_h
5
6
#include "
vtkChartHistogram2D.h
"
7
8
#include "
vtkCommand.h
"
// needed for vtkCommand::UserEvent
9
#include "
vtkRemotingViewsModule.h
"
// needed for export macro
10
#include "
vtkWeakPointer.h
"
// needed for vtkWeakPointer
11
12
#include <vector>
// needed for ivar
13
14
// Forward declarations
15
class
vtkContext2D
;
16
class
vtkContextMouseEvent
;
17
class
vtkPVTransferFunction2D
;
18
class
vtkTransferFunctionBoxItem
;
19
20
class
VTKREMOTINGVIEWS_EXPORT
vtkTransferFunctionChartHistogram2D
:
public
vtkChartHistogram2D
21
{
22
public
:
23
static
vtkTransferFunctionChartHistogram2D
*
New
();
24
vtkTypeMacro(
vtkTransferFunctionChartHistogram2D
,
vtkChartHistogram2D
);
25
26
// Events fires by this class (and subclasses).
27
// \li TransferFunctionModified is fired when the 2D transfer function is modified.
28
enum
29
{
30
TransferFunctionModified = vtkCommand::UserEvent + 1000,
31
};
32
36
bool
IsInitialized();
37
39
45
vtkSmartPointer<vtkTransferFunctionBoxItem>
AddNewBox();
46
vtkSmartPointer<vtkTransferFunctionBoxItem>
AddNewBox(
47
const
vtkRectd
& r,
double
* color,
double
alpha,
bool
addToTF2D =
true
);
48
void
AddBox(
vtkSmartPointer<vtkTransferFunctionBoxItem>
box,
bool
addToTF2D =
true
);
50
54
virtual
void
RemoveBox(
vtkSmartPointer<vtkTransferFunctionBoxItem>
box);
55
59
bool
MouseDoubleClickEvent
(
const
vtkContextMouseEvent
& mouse)
override
;
60
64
bool
KeyPressEvent
(
const
vtkContextKeyEvent
& key)
override
;
65
69
void
SetInputData
(
vtkImageData
*,
vtkIdType
z = 0)
override
;
70
72
75
virtual
void
SetTransferFunction2D(
vtkPVTransferFunction2D
* transfer2D);
76
virtual
vtkPVTransferFunction2D
* GetTransferFunction2D();
78
80
83
vtkSmartPointer<vtkTransferFunctionBoxItem>
GetActiveBox()
const
;
84
void
SetActiveBox(
vtkSmartPointer<vtkTransferFunctionBoxItem>
box);
86
88
91
void
SetActiveBoxColorAlpha(
double
r,
double
g,
double
b,
double
a);
92
void
SetActiveBoxColorAlpha(
double
color[3],
double
alpha);
94
98
bool
Paint
(
vtkContext2D
* painter)
override
;
99
100
protected
:
101
vtkTransferFunctionChartHistogram2D
() =
default
;
102
~
vtkTransferFunctionChartHistogram2D
()
override
=
default
;
103
107
void
UpdateItemsBounds(
double
xMin,
double
xMax,
double
yMin,
double
yMax);
108
112
virtual
void
GenerateTransfer2D();
113
118
void
OnTransferFunctionBoxItemModified(
vtkObject
* caller,
unsigned
long
eid,
void
* callData);
119
120
// Member variables;
121
vtkWeakPointer<vtkPVTransferFunction2D>
TransferFunction2D
;
122
vtkSmartPointer<vtkTransferFunctionBoxItem>
ActiveBox
;
123
std::vector<int>
BoxesToRemove
;
124
125
private
:
126
vtkTransferFunctionChartHistogram2D
(
const
vtkTransferFunctionChartHistogram2D
&);
127
void
operator=
(
const
vtkTransferFunctionChartHistogram2D
&);
128
};
129
130
#endif // vtkTransferFunctionChartHistogram2D_h
vtkTransferFunctionChartHistogram2D::ActiveBox
vtkSmartPointer< vtkTransferFunctionBoxItem > ActiveBox
Definition:
vtkTransferFunctionChartHistogram2D.h:122
vtkContextKeyEvent
vtkObject
VTKREMOTINGVIEWS_EXPORT
#define VTKREMOTINGVIEWS_EXPORT
Definition:
vtkRemotingViewsModule.h:15
vtkCommand.h
vtkChartHistogram2D
vtkChartXY::KeyPressEvent
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
vtkChartHistogram2D::New
static vtkChartHistogram2D * New()
vtkSmartPointer< vtkTransferFunctionBoxItem >
vtkIdType
int vtkIdType
vtkChartHistogram2D.h
vtkTransferFunctionBoxItem
Definition:
vtkTransferFunctionBoxItem.h:18
vtkContext2D
vtkContextMouseEvent
vtkWeakPointer< vtkPVTransferFunction2D >
vtkImageData
vtkChartHistogram2D::SetInputData
virtual void SetInputData(vtkImageData *data, vtkIdType z=0)
vtkPVTransferFunction2D
Defines a 2D transfer function for mapping to RGBA values for volume rendering.
Definition:
vtkPVTransferFunction2D.h:27
vtkRemotingViewsModule.h
vtkTransferFunctionChartHistogram2D::BoxesToRemove
std::vector< int > BoxesToRemove
Definition:
vtkTransferFunctionChartHistogram2D.h:123
vtkWeakPointer.h
vtkTransferFunctionChartHistogram2D::TransferFunction2D
vtkWeakPointer< vtkPVTransferFunction2D > TransferFunction2D
Definition:
vtkTransferFunctionChartHistogram2D.h:121
vtkTransferFunctionChartHistogram2D
Definition:
vtkTransferFunctionChartHistogram2D.h:20
vtkRectd
vtkAbstractContextItem::MouseDoubleClickEvent
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
vtkObjectBase::operator=
void operator=(const vtkObjectBase &)
vtkChartXY::Paint
virtual bool Paint(vtkContext2D *painter)
Generated by
1.8.13 on Thu Mar 28 2024