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 =========================================================================*/
31 #ifndef vtkLabeledContourMapper_h
32 #define vtkLabeledContourMapper_h
33 
34 #include "vtkRenderingCoreModule.h" // For export macro
35 
36 #include "vtkMapper.h"
37 #include "vtkNew.h" // For vtkNew
38 #include "vtkSmartPointer.h" // For vtkSmartPointer
39 
40 class vtkDoubleArray;
41 class vtkTextActor3D;
42 class vtkTextProperty;
44 class vtkPolyData;
45 class vtkPolyDataMapper;
46 
48 {
49 public:
50  static vtkLabeledContourMapper *New();
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
54  virtual void Render(vtkRenderer *ren, vtkActor *act);
55 
57 
58  void SetInputData(vtkPolyData *in);
59  vtkPolyData *GetInput();
61 
63 
65  virtual double *GetBounds();
66  virtual void GetBounds(double bounds[6]);
68 
74  virtual void SetTextProperty(vtkTextProperty *tprop);
75 
77 
89  virtual void SetTextProperties(vtkTextPropertyCollection *coll);
90  virtual vtkTextPropertyCollection *GetTextProperties();
92 
94 
98  virtual vtkDoubleArray* GetTextPropertyMapping();
99  virtual void SetTextPropertyMapping(vtkDoubleArray *mapping);
101 
103 
106  vtkSetMacro(LabelVisibility, bool)
107  vtkGetMacro(LabelVisibility, bool)
108  vtkBooleanMacro(LabelVisibility, bool)
110 
112 
115  vtkSetMacro(SkipDistance, double)
116  vtkGetMacro(SkipDistance, double)
118 
120 
121  vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
123 
124  virtual void ReleaseGraphicsResources(vtkWindow *);
125 
126 protected:
128  ~vtkLabeledContourMapper();
129 
130  virtual void ComputeBounds();
131 
132  virtual int FillInputPortInformation(int, vtkInformation*);
133 
134  void Reset();
135 
136  bool CheckInputs(vtkRenderer *ren);
137  bool CheckRebuild(vtkRenderer *ren, vtkActor *act);
138  bool PrepareRender(vtkRenderer *ren, vtkActor *act);
139  bool PlaceLabels();
140  bool ResolveLabels();
141  virtual bool CreateLabels(vtkActor *actor);
142  bool BuildStencilQuads();
143  virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
144  bool RenderPolyData(vtkRenderer *ren, vtkActor *act);
145  virtual bool RemoveStencil();
146  bool RenderLabels(vtkRenderer *ren, vtkActor *act);
147 
148  bool AllocateTextActors(vtkIdType num);
149  bool FreeTextActors();
150 
151  double SkipDistance;
152 
153  bool LabelVisibility;
154  vtkIdType NumberOfTextActors;
155  vtkIdType NumberOfUsedTextActors;
156  vtkTextActor3D **TextActors;
157 
158  vtkNew<vtkPolyDataMapper> PolyDataMapper;
160  vtkSmartPointer<vtkDoubleArray> TextPropertyMapping;
161 
162  float *StencilQuads;
163  vtkIdType StencilQuadsSize;
164  unsigned int *StencilQuadIndices;
165  vtkIdType StencilQuadIndicesSize;
166  void FreeStencilQuads();
167 
169 
170 private:
171  vtkLabeledContourMapper(const vtkLabeledContourMapper&); // Not implemented.
172  void operator=(const vtkLabeledContourMapper&); // Not implemented.
173 
174  struct Private;
175  Private *Internal;
176 };
177 
178 #endif
vtkTimeStamp BuildTime
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
abstract specification for renderers
Definition: vtkRenderer.h:62
Draw labeled isolines.
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:247
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
a list of vtkTextProperty objects.
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
An actor that displays text.
represent text properties.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:89
map vtkPolyData to graphics primitives
Allocate and hold a VTK object.
Definition: vtkNew.h:66
#define VTKRENDERINGCORE_EXPORT
static vtkAlgorithm * New()