VTK  9.5.20250715
vtkLabeledContourMapper.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
20#ifndef vtkLabeledContourMapper_h
21#define vtkLabeledContourMapper_h
22
23#include "vtkRenderingCoreModule.h" // For export macro
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26#include "vtkMapper.h"
27#include "vtkNew.h" // For vtkNew
28#include "vtkSmartPointer.h" // For vtkSmartPointer
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkDoubleArray;
32class vtkTextActor3D;
33class vtkTextProperty;
35class vtkPolyData;
37
38class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkLabeledContourMapper : public vtkMapper
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
45 void Render(vtkRenderer* ren, vtkActor* act) override;
46
48
54
56
60 double* GetBounds() override;
61 void GetBounds(double bounds[6]) override;
63
71 virtual void SetTextProperty(vtkTextProperty* tprop);
72
74
94
96
105
107
112 vtkSetMacro(LabelVisibility, bool);
113 vtkGetMacro(LabelVisibility, bool);
114 vtkBooleanMacro(LabelVisibility, bool);
116
118
122 vtkSetMacro(SkipDistance, double);
123 vtkGetMacro(SkipDistance, double);
125
127
133
135
136protected:
139
140 virtual void ComputeBounds();
141
143
144 void Reset();
145
151 virtual bool CreateLabels(vtkActor* actor);
153 virtual bool ApplyStencil(vtkRenderer* ren, vtkActor* act);
155 virtual bool RemoveStencil(vtkRenderer* ren);
157
160
161 double SkipDistance = false;
162
163 bool LabelVisibility = true;
164 vtkIdType NumberOfTextActors = 0;
165 vtkIdType NumberOfUsedTextActors = 0;
166 vtkTextActor3D** TextActors = nullptr;
167
171
172 float* StencilQuads = nullptr;
173 vtkIdType StencilQuadsSize = 0;
174 unsigned int* StencilQuadIndices = nullptr;
175 vtkIdType StencilQuadIndicesSize = 0;
177
179
180private:
182 void operator=(const vtkLabeledContourMapper&) = delete;
183
184 struct Private;
185 Private* Internal;
186};
187
188VTK_ABI_NAMESPACE_END
189#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
virtual void SetPolyDataMapper(vtkPolyDataMapper *)
The polydata mapper used to render the contours.
void Render(vtkRenderer *ren, vtkActor *act) override
Method initiates the mapping process.
bool PrepareRender(vtkRenderer *ren, vtkActor *act)
~vtkLabeledContourMapper() override
bool RenderLabels(vtkRenderer *ren, vtkActor *act)
vtkPolyData * GetInput()
Specify the input data to map.
vtkNew< vtkPolyDataMapper > PolyDataMapper
virtual void SetTextProperty(vtkTextProperty *tprop)
The text property used to label the lines.
bool AllocateTextActors(vtkIdType num)
void GetBounds(double bounds[6]) override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act)
virtual vtkTextPropertyCollection * GetTextProperties()
The text properties used to label the lines.
void SetInputData(vtkPolyData *in)
Specify the input data to map.
vtkSmartPointer< vtkDoubleArray > TextPropertyMapping
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
virtual bool CreateLabels(vtkActor *actor)
virtual void ComputeBounds()
bool CheckInputs(vtkRenderer *ren)
virtual void SetTextProperties(vtkTextPropertyCollection *coll)
The text properties used to label the lines.
static vtkLabeledContourMapper * New()
bool CheckRebuild(vtkRenderer *ren, vtkActor *act)
bool RenderPolyData(vtkRenderer *ren, vtkActor *act)
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
virtual vtkDoubleArray * GetTextPropertyMapping()
Values in this array correspond to vtkTextProperty objects in the TextProperties collection.
vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
The polydata mapper used to render the contours.
virtual void SetTextPropertyMapping(vtkDoubleArray *mapping)
Values in this array correspond to vtkTextProperty objects in the TextProperties collection.
virtual bool RemoveStencil(vtkRenderer *ren)
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:98
Allocate and hold a VTK object.
Definition vtkNew.h:167
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
An actor that displays text.
an ordered list of vtkTextProperty objects.
represent text properties.
record modification and/or execution time
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkIdType
Definition vtkType.h:332
#define VTK_MARSHALAUTO