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 
113  vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
115 
116  virtual void ReleaseGraphicsResources(vtkWindow *);
117 
118 protected:
120  ~vtkLabeledContourMapper();
121 
122  virtual void ComputeBounds();
123 
124  virtual int FillInputPortInformation(int, vtkInformation*);
125 
126  void Reset();
127 
128  bool CheckInputs(vtkRenderer *ren);
129  bool CheckRebuild(vtkRenderer *ren, vtkActor *act);
130  bool PrepareRender(vtkRenderer *ren, vtkActor *act);
131  bool PlaceLabels();
132  bool ResolveLabels();
133  virtual bool CreateLabels(vtkActor *actor);
134  bool BuildStencilQuads();
135  virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
136  bool RenderPolyData(vtkRenderer *ren, vtkActor *act);
137  virtual bool RemoveStencil();
138  bool RenderLabels(vtkRenderer *ren, vtkActor *act);
139 
140  bool AllocateTextActors(vtkIdType num);
141  bool FreeTextActors();
142 
143  bool LabelVisibility;
144  vtkIdType NumberOfTextActors;
145  vtkIdType NumberOfUsedTextActors;
146  vtkTextActor3D **TextActors;
147 
148  vtkNew<vtkPolyDataMapper> PolyDataMapper;
150  vtkSmartPointer<vtkDoubleArray> TextPropertyMapping;
151 
152  float *StencilQuads;
153  vtkIdType StencilQuadsSize;
154  unsigned int *StencilQuadIndices;
155  vtkIdType StencilQuadIndicesSize;
156  void FreeStencilQuads();
157 
159 
160 private:
161  vtkLabeledContourMapper(const vtkLabeledContourMapper&); // Not implemented.
162  void operator=(const vtkLabeledContourMapper&); // Not implemented.
163 
164  struct Private;
165  Private *Internal;
166 };
167 
168 #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:63
Draw labeled isolines.
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:275
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
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()