VTK
vtkLabeledDataMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLabeledDataMapper.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 =========================================================================*/
51 #ifndef __vtkLabeledDataMapper_h
52 #define __vtkLabeledDataMapper_h
53 
54 #include "vtkMapper2D.h"
55 
56 class vtkDataObject;
57 class vtkDataSet;
58 class vtkTextMapper;
59 class vtkTextProperty;
60 class vtkTransform;
61 
62 #define VTK_LABEL_IDS 0
63 #define VTK_LABEL_SCALARS 1
64 #define VTK_LABEL_VECTORS 2
65 #define VTK_LABEL_NORMALS 3
66 #define VTK_LABEL_TCOORDS 4
67 #define VTK_LABEL_TENSORS 5
68 #define VTK_LABEL_FIELD_DATA 6
69 
71 {
72 public:
75  static vtkLabeledDataMapper *New();
76 
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
81 
89  vtkSetStringMacro(LabelFormat);
90  vtkGetStringMacro(LabelFormat);
92 
94 
99  vtkSetMacro(LabeledComponent,int);
100  vtkGetMacro(LabeledComponent,int);
102 
104 
107  void SetFieldDataArray(int arrayIndex);
108  vtkGetMacro(FieldDataArray,int);
110 
112 
115  void SetFieldDataName(const char *arrayName);
116  vtkGetStringMacro(FieldDataName);
118 
121  virtual void SetInput(vtkDataObject*);
122 
125  vtkDataSet *GetInput();
126 
128 
132  vtkSetMacro(LabelMode, int);
133  vtkGetMacro(LabelMode, int);
134  void SetLabelModeToLabelIds() {this->SetLabelMode(VTK_LABEL_IDS);};
135  void SetLabelModeToLabelScalars() {this->SetLabelMode(VTK_LABEL_SCALARS);};
136  void SetLabelModeToLabelVectors() {this->SetLabelMode(VTK_LABEL_VECTORS);};
137  void SetLabelModeToLabelNormals() {this->SetLabelMode(VTK_LABEL_NORMALS);};
138  void SetLabelModeToLabelTCoords() {this->SetLabelMode(VTK_LABEL_TCOORDS);};
139  void SetLabelModeToLabelTensors() {this->SetLabelMode(VTK_LABEL_TENSORS);};
141  {this->SetLabelMode(VTK_LABEL_FIELD_DATA);};
143 
145 
149  { this->SetLabelTextProperty(p, 0); }
151  { return this->GetLabelTextProperty(0); }
152  virtual void SetLabelTextProperty(vtkTextProperty *p, int type);
153  virtual vtkTextProperty* GetLabelTextProperty(int type);
155 
157 
158  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
159  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
161 
163  virtual void ReleaseGraphicsResources(vtkWindow *);
164 
166 
167  vtkGetObjectMacro(Transform, vtkTransform);
168  void SetTransform(vtkTransform* t);
170 
171  //BTX
174  {
175  WORLD=0,
176  DISPLAY=1
177  };
178  //ETX
179 
181 
184  vtkGetMacro(CoordinateSystem,int);
185  vtkSetClampMacro(CoordinateSystem,int,WORLD,DISPLAY);
186  void CoordinateSystemWorld() { this->SetCoordinateSystem( vtkLabeledDataMapper::WORLD ); }
187  void CoordinateSystemDisplay() { this->SetCoordinateSystem( vtkLabeledDataMapper::DISPLAY ); }
189 
191  virtual unsigned long GetMTime();
192 
193 protected:
196 
198 
199  char *LabelFormat;
205 
207 
211  double* LabelPositions;
213 
214  virtual int FillInputPortInformation(int, vtkInformation*);
215 
216  void AllocateLabels(int numLabels);
217  void BuildLabels();
218  void BuildLabelsInternal(vtkDataSet*);
219 
220  //BTX
221  class Internals;
222  Internals* Implementation;
223  //ETX
224 
225 private:
226  vtkLabeledDataMapper(const vtkLabeledDataMapper&); // Not implemented.
227  void operator=(const vtkLabeledDataMapper&); // Not implemented.
228 };
229 
230 #endif
231 
virtual unsigned long GetMTime()
#define VTK_LABEL_NORMALS
#define VTK_LABEL_VECTORS
Store vtkAlgorithm input/output information.
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:39
abstract specification for Viewports
Definition: vtkViewport.h:45
Output 3-D world-space coordinates for each label anchor.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
#define VTK_LABEL_IDS
vtkTextMapper ** TextMappers
a actor that draws 2D data
Definition: vtkActor2D.h:43
record modification and/or execution time
Definition: vtkTimeStamp.h:33
Coordinates
Coordinate systems that output dataset may use.
#define VTK_LABEL_SCALARS
#define VTK_LABEL_TCOORDS
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
2D text annotation
Definition: vtkTextMapper.h:43
draw text labels at dataset points
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
a simple class to control print indentation
Definition: vtkIndent.h:37
void PrintSelf(ostream &os, vtkIndent indent)
represent text properties.
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTK_LABEL_TENSORS
#define VTK_RENDERING_EXPORT
#define VTK_LABEL_FIELD_DATA
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual vtkTextProperty * GetLabelTextProperty()
static vtkAlgorithm * New()
virtual void RenderOpaqueGeometry(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:40
general representation of visualization data
Definition: vtkDataObject.h:70
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:33
virtual void SetLabelTextProperty(vtkTextProperty *p)
Output 2-D display coordinates for each label anchor (3 components but only 2 are significant)...