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 vtkTextActor3D;
41 class vtkTextProperty;
43 class vtkPolyData;
44 class vtkPolyDataMapper;
45 
47 {
48 public:
49  static vtkLabeledContourMapper *New();
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
53  virtual void Render(vtkRenderer *ren, vtkActor *act);
54 
56 
57  void SetInputData(vtkPolyData *in);
58  vtkPolyData *GetInput();
60 
62 
64  virtual double *GetBounds();
65  virtual void GetBounds(double bounds[6]);
67 
73  virtual void SetTextProperty(vtkTextProperty *tprop);
74 
76 
84  virtual void SetTextProperties(vtkTextPropertyCollection *coll);
85  virtual vtkTextPropertyCollection *GetTextProperties();
87 
89 
92  vtkSetMacro(LabelVisibility, bool)
93  vtkGetMacro(LabelVisibility, bool)
94  vtkBooleanMacro(LabelVisibility, bool)
96 
98 
99  vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
101 
102 protected:
104  ~vtkLabeledContourMapper();
105 
106  virtual void ComputeBounds();
107 
108  virtual int FillInputPortInformation(int, vtkInformation*);
109 
110  void Reset();
111 
112  bool CheckInputs(vtkRenderer *ren);
113  bool CheckRebuild(vtkRenderer *ren, vtkActor *act);
114  bool PrepareRender(vtkRenderer *ren, vtkActor *act);
115  bool PlaceLabels();
116  bool ResolveLabels();
117  bool CreateLabels();
118  bool BuildStencilQuads();
119  virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
120  bool RenderPolyData(vtkRenderer *ren, vtkActor *act);
121  virtual bool RemoveStencil();
122  bool RenderLabels(vtkRenderer *ren, vtkActor *act);
123 
124  bool AllocateTextActors(vtkIdType num);
125  bool FreeTextActors();
126 
127  vtkTextProperty* GetTextPropertyForCellId(vtkIdType cellId) const;
128 
129  bool LabelVisibility;
130  vtkIdType NumberOfTextActors;
131  vtkIdType NumberOfUsedTextActors;
132  vtkTextActor3D **TextActors;
133 
134  vtkNew<vtkPolyDataMapper> PolyDataMapper;
136 
137  float *StencilQuads;
138  vtkIdType StencilQuadsSize;
139  unsigned int *StencilQuadIndices;
140  vtkIdType StencilQuadIndicesSize;
141  void FreeStencilQuads();
142 
144 
145 private:
146  vtkLabeledContourMapper(const vtkLabeledContourMapper&); // Not implemented.
147  void operator=(const vtkLabeledContourMapper&); // Not implemented.
148 
149  struct Private;
150  Private *Internal;
151 };
152 
153 #endif
vtkTimeStamp BuildTime
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Store vtkAlgorithm input/output information.
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
record modification and/or execution time
Definition: vtkTimeStamp.h:34
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
abstract specification for renderers
Definition: vtkRenderer.h:63
GLuint in
Definition: vtkgl.h:16905
Draw labeled isolines.
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:281
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
#define vtkGetNewMacro(name, type)
Definition: vtkSetGet.h:209
GLuint GLuint num
Definition: vtkgl.h:16907
a list of vtkTextProperty objects.
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:88
map vtkPolyData to graphics primitives
Allocate and hold a VTK object.
Definition: vtkNew.h:66
#define VTKRENDERINGCORE_EXPORT
static vtkAlgorithm * New()
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69