VTK  9.0.1
vtkLabeledContourMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLabeledContourMapper.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 =========================================================================*/
29 #ifndef vtkLabeledContourMapper_h
30 #define vtkLabeledContourMapper_h
31 
32 #include "vtkRenderingCoreModule.h" // For export macro
33 
34 #include "vtkMapper.h"
35 #include "vtkNew.h" // For vtkNew
36 #include "vtkSmartPointer.h" // For vtkSmartPointer
37 
38 class vtkDoubleArray;
39 class vtkTextActor3D;
40 class vtkTextProperty;
42 class vtkPolyData;
43 class vtkPolyDataMapper;
44 
45 class VTKRENDERINGCORE_EXPORT vtkLabeledContourMapper : public vtkMapper
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
52  void Render(vtkRenderer* ren, vtkActor* act) override;
53 
55 
61 
63 
67  double* GetBounds() override;
68  void GetBounds(double bounds[6]) override;
70 
78  virtual void SetTextProperty(vtkTextProperty* tprop);
79 
81 
101 
103 
110  virtual void SetTextPropertyMapping(vtkDoubleArray* mapping);
112 
114 
119  vtkSetMacro(LabelVisibility, bool);
120  vtkGetMacro(LabelVisibility, bool);
121  vtkBooleanMacro(LabelVisibility, bool);
123 
125 
129  vtkSetMacro(SkipDistance, double);
130  vtkGetMacro(SkipDistance, double);
132 
134 
139 
141 
142 protected:
145 
146  virtual void ComputeBounds();
147 
149 
150  void Reset();
151 
155  bool PlaceLabels();
157  virtual bool CreateLabels(vtkActor* actor);
159  virtual bool ApplyStencil(vtkRenderer* ren, vtkActor* act);
161  virtual bool RemoveStencil(vtkRenderer* ren);
163 
166 
167  double SkipDistance;
168 
173 
177 
178  float* StencilQuads;
180  unsigned int* StencilQuadIndices;
183 
185 
186 private:
188  void operator=(const vtkLabeledContourMapper&) = delete;
189 
190  struct Private;
191  Private* Internal;
192 };
193 
194 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:37
vtkLabeledContourMapper::PlaceLabels
bool PlaceLabels()
vtkLabeledContourMapper::StencilQuadsSize
vtkIdType StencilQuadsSize
Definition: vtkLabeledContourMapper.h:179
vtkLabeledContourMapper::BuildStencilQuads
bool BuildStencilQuads()
vtkLabeledContourMapper::SetTextProperty
virtual void SetTextProperty(vtkTextProperty *tprop)
The text property used to label the lines.
vtkLabeledContourMapper::RenderPolyData
bool RenderPolyData(vtkRenderer *ren, vtkActor *act)
vtkLabeledContourMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLabeledContourMapper::StencilQuadIndices
unsigned int * StencilQuadIndices
Definition: vtkLabeledContourMapper.h:180
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkLabeledContourMapper::GetBounds
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkLabeledContourMapper::TextActors
vtkTextActor3D ** TextActors
Definition: vtkLabeledContourMapper.h:172
vtkLabeledContourMapper::SetInputData
void SetInputData(vtkPolyData *in)
Specify the input data to map.
vtkTextActor3D
An actor that displays text.
Definition: vtkTextActor3D.h:45
vtkLabeledContourMapper::LabelBuildTime
vtkTimeStamp LabelBuildTime
Definition: vtkLabeledContourMapper.h:184
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkLabeledContourMapper::vtkLabeledContourMapper
vtkLabeledContourMapper()
vtkLabeledContourMapper::ResolveLabels
bool ResolveLabels()
vtkSmartPointer< vtkTextPropertyCollection >
vtkLabeledContourMapper::NumberOfUsedTextActors
vtkIdType NumberOfUsedTextActors
Definition: vtkLabeledContourMapper.h:171
vtkTextPropertyCollection
an ordered list of vtkTextProperty objects.
Definition: vtkTextPropertyCollection.h:34
vtkLabeledContourMapper::ApplyStencil
virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act)
vtkLabeledContourMapper::RenderLabels
bool RenderLabels(vtkRenderer *ren, vtkActor *act)
vtkLabeledContourMapper::Render
void Render(vtkRenderer *ren, vtkActor *act) override
Method initiates the mapping process.
vtkLabeledContourMapper::TextProperties
vtkSmartPointer< vtkTextPropertyCollection > TextProperties
Definition: vtkLabeledContourMapper.h:175
vtkLabeledContourMapper::GetInput
vtkPolyData * GetInput()
vtkLabeledContourMapper::LabelVisibility
bool LabelVisibility
Definition: vtkLabeledContourMapper.h:169
vtkLabeledContourMapper::AllocateTextActors
bool AllocateTextActors(vtkIdType num)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkMapper.h
vtkLabeledContourMapper::GetTextPropertyMapping
virtual vtkDoubleArray * GetTextPropertyMapping()
Values in this array correspond to vtkTextProperty objects in the TextProperties collection.
vtkLabeledContourMapper::FreeStencilQuads
void FreeStencilQuads()
vtkLabeledContourMapper::vtkGetNewMacro
vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
The polydata mapper used to render the contours.
vtkLabeledContourMapper::FreeTextActors
bool FreeTextActors()
vtkLabeledContourMapper::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkLabeledContourMapper::PrepareRender
bool PrepareRender(vtkRenderer *ren, vtkActor *act)
vtkLabeledContourMapper::New
static vtkLabeledContourMapper * New()
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:81
vtkLabeledContourMapper::StencilQuadIndicesSize
vtkIdType StencilQuadIndicesSize
Definition: vtkLabeledContourMapper.h:181
vtkLabeledContourMapper::NumberOfTextActors
vtkIdType NumberOfTextActors
Definition: vtkLabeledContourMapper.h:170
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkLabeledContourMapper::CheckRebuild
bool CheckRebuild(vtkRenderer *ren, vtkActor *act)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkLabeledContourMapper::~vtkLabeledContourMapper
~vtkLabeledContourMapper() override
vtkLabeledContourMapper
Draw labeled isolines.
Definition: vtkLabeledContourMapper.h:46
vtkLabeledContourMapper::ComputeBounds
virtual void ComputeBounds()
vtkSmartPointer.h
vtkLabeledContourMapper::RemoveStencil
virtual bool RemoveStencil(vtkRenderer *ren)
vtkNew< vtkPolyDataMapper >
vtkLabeledContourMapper::CheckInputs
bool CheckInputs(vtkRenderer *ren)
vtkLabeledContourMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkLabeledContourMapper::SetTextProperties
virtual void SetTextProperties(vtkTextPropertyCollection *coll)
The text properties used to label the lines.
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:34
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkLabeledContourMapper::TextPropertyMapping
vtkSmartPointer< vtkDoubleArray > TextPropertyMapping
Definition: vtkLabeledContourMapper.h:176
vtkLabeledContourMapper::SetTextPropertyMapping
virtual void SetTextPropertyMapping(vtkDoubleArray *mapping)
vtkLabeledContourMapper::CreateLabels
virtual bool CreateLabels(vtkActor *actor)
vtkNew.h
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkLabeledContourMapper::Reset
void Reset()
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkLabeledContourMapper::GetTextProperties
virtual vtkTextPropertyCollection * GetTextProperties()
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:36
vtkLabeledContourMapper::PolyDataMapper
vtkNew< vtkPolyDataMapper > PolyDataMapper
Definition: vtkLabeledContourMapper.h:174
vtkLabeledContourMapper::GetBounds
void GetBounds(double bounds[6]) override
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkLabeledContourMapper::SkipDistance
double SkipDistance
Definition: vtkLabeledContourMapper.h:167
vtkLabeledContourMapper::StencilQuads
float * StencilQuads
Definition: vtkLabeledContourMapper.h:178