VTK
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:
48  static vtkLabeledContourMapper *New();
50  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
51 
52  void Render(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
53 
55 
58  void SetInputData(vtkPolyData *in);
61 
63 
67  double *GetBounds() VTK_OVERRIDE;
68  void GetBounds(double bounds[6]) VTK_OVERRIDE;
70 
78  virtual void SetTextProperty(vtkTextProperty *tprop);
79 
81 
98  virtual void SetTextProperties(vtkTextPropertyCollection *coll);
99  virtual vtkTextPropertyCollection *GetTextProperties();
101 
103 
109  virtual vtkDoubleArray* GetTextPropertyMapping();
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 
137  vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
139 
140  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
141 
142 protected:
144  ~vtkLabeledContourMapper() VTK_OVERRIDE;
145 
146  virtual void ComputeBounds();
147 
148  int FillInputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
149 
150  void Reset();
151 
152  bool CheckInputs(vtkRenderer *ren);
153  bool CheckRebuild(vtkRenderer *ren, vtkActor *act);
154  bool PrepareRender(vtkRenderer *ren, vtkActor *act);
155  bool PlaceLabels();
156  bool ResolveLabels();
157  virtual bool CreateLabels(vtkActor *actor);
158  bool BuildStencilQuads();
159  virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
160  bool RenderPolyData(vtkRenderer *ren, vtkActor *act);
161  virtual bool RemoveStencil();
162  bool RenderLabels(vtkRenderer *ren, vtkActor *act);
163 
164  bool AllocateTextActors(vtkIdType num);
165  bool FreeTextActors();
166 
167  double SkipDistance;
168 
169  bool LabelVisibility;
170  vtkIdType NumberOfTextActors;
171  vtkIdType NumberOfUsedTextActors;
172  vtkTextActor3D **TextActors;
173 
174  vtkNew<vtkPolyDataMapper> PolyDataMapper;
176  vtkSmartPointer<vtkDoubleArray> TextPropertyMapping;
177 
178  float *StencilQuads;
179  vtkIdType StencilQuadsSize;
180  unsigned int *StencilQuadIndices;
181  vtkIdType StencilQuadIndicesSize;
182  void FreeStencilQuads();
183 
184  vtkTimeStamp LabelBuildTime;
185 
186 private:
187  vtkLabeledContourMapper(const vtkLabeledContourMapper&) VTK_DELETE_FUNCTION;
188  void operator=(const vtkLabeledContourMapper&) VTK_DELETE_FUNCTION;
189 
190  struct Private;
191  Private *Internal;
192 };
193 
194 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
abstract specification for renderers
Definition: vtkRenderer.h:57
Draw labeled isolines.
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
an ordered list of vtkTextProperty objects.
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An actor that displays text.
represent text properties.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:85
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
map vtkPolyData to graphics primitives
Allocate and hold a VTK object.
Definition: vtkNew.h:61
static vtkAlgorithm * New()
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkDataSet * GetInput()
Get the input as a vtkDataSet.
virtual void Render(vtkRenderer *ren, vtkActor *a)=0
Method initiates the mapping process.