VTK  9.6.1
vtkLabeledDataMapper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
41
42#ifndef vtkLabeledDataMapper_h
43#define vtkLabeledDataMapper_h
44
45#include "vtkLabeledDatatypeDefinitions.h" // For Data type Definitions
46#include "vtkMapper2D.h"
47#include "vtkRenderingLabelModule.h" // For export macro
48#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
49
50#include <cassert> // For assert macro
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkDataObject;
54class vtkDataSet;
55class vtkTextMapper;
56class vtkTextProperty;
57class vtkTransform;
58
59class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabeledDataMapper : public vtkMapper2D
60{
61public:
67
69 void PrintSelf(ostream& os, vtkIndent indent) override;
70
72
83 vtkSetStringMacro(LabelFormat);
84 vtkGetStringMacro(LabelFormat);
86
88
95 vtkSetMacro(LabeledComponent, int);
96 vtkGetMacro(LabeledComponent, int);
98
100
103 vtkSetMacro(ComponentSeparator, char);
104 vtkGetMacro(ComponentSeparator, char);
106
108
113 vtkSetClampMacro(FieldDataArray, int, 0, VTK_INT_MAX);
114 vtkGetMacro(FieldDataArray, int);
116
118
123 vtkSetStringMacro(FieldDataName)
124 vtkGetStringMacro(FieldDataName);
126
131
137
139
145 vtkSetMacro(LabelMode, int);
146 vtkGetMacro(LabelMode, int);
155
157
165 virtual void SetLabelTextProperty(vtkTextProperty* p, int type);
168
170
173 void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
174 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
176
181
183
186 vtkGetObjectMacro(Transform, vtkTransform);
189
192 {
193 WORLD = 0,
196 };
197
199
203 vtkGetMacro(CoordinateSystem, int);
204 vtkSetClampMacro(CoordinateSystem, int, WORLD, DISPLAY);
208
213
215
218 vtkGetMacro(NumberOfLabels, int);
220
222
225 void GetLabelPosition(int label, double pos[3])
226 {
227 assert("label index range" && label >= 0 && label < this->NumberOfLabels);
228 pos[0] = this->LabelPositions[3 * label];
229 pos[1] = this->LabelPositions[3 * label + 1];
230 pos[2] = this->LabelPositions[3 * label + 2];
231 }
232
233
237 const char* GetLabelText(int label);
238
239protected:
242
244
251
253
255
261
263
264 void AllocateLabels(int numLabels);
267
268 class Internals;
269 Internals* Implementation;
270
271private:
273 void operator=(const vtkLabeledDataMapper&) = delete;
274
275 struct vtkLabeledDataMapperFunctor;
276};
277
278VTK_ABI_NAMESPACE_END
279#endif
a actor that draws 2D data
Definition vtkActor2D.h:36
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
virtual void SetLabelTextProperty(vtkTextProperty *p, int type)
Set/Get the text property.
virtual void SetCoordinateSystem(int)
Set/get the coordinate system used for output labels.
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
void CoordinateSystemWorld()
Set/get the coordinate system used for output labels.
void SetLabelModeToLabelIds()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
virtual void SetInputData(vtkDataObject *)
Set the input dataset to the mapper.
void SetLabelModeToLabelVectors()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
void SetLabelModeToLabelNormals()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
void SetLabelModeToLabelTensors()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
virtual vtkTextProperty * GetLabelTextProperty()
Set/Get the text property.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
virtual void SetLabelMode(int)
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
void AllocateLabels(int numLabels)
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the text property.
vtkDataSet * GetInput()
Use GetInputDataObject() to get the input data object for composite datasets.
int FillInputPortInformation(int, vtkInformation *) override
void SetLabelModeToLabelTCoords()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
static vtkLabeledDataMapper * New()
Instantiate object with {:<#6.3g} label format.
void SetLabelModeToLabelScalars()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
const char * GetLabelText(int label)
Return the text for the requested label.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetLabelModeToLabelFieldData()
Specify which data to plot: IDs, scalars, vectors, normals, texture coords, tensors,...
vtkMTimeType GetMTime() override
Return the modified time for this object.
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
~vtkLabeledDataMapper() override
void SetTransform(vtkTransform *t)
The transform to apply to the labels before mapping to 2D.
virtual vtkTextProperty * GetLabelTextProperty(int type)
Set/Get the text property.
void BuildLabelsInternal(vtkDataSet *)
void GetLabelPosition(int label, double pos[3])
Return the position of the requested label.
void CoordinateSystemDisplay()
Set/get the coordinate system used for output labels.
Coordinates
Coordinate systems that output dataset may use.
@ WORLD
Output 3-D world-space coordinates for each label anchor.
vtkMapper2D()=default
2D text annotation
represent text properties.
record modification and/or execution time
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
#define VTK_LABEL_TENSORS
#define VTK_LABEL_TCOORDS
#define VTK_LABEL_VECTORS
#define VTK_LABEL_SCALARS
#define VTK_LABEL_FIELD_DATA
#define VTK_LABEL_IDS
#define VTK_LABEL_NORMALS
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_MARSHALAUTO