VTK
vtkLODProp3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLODProp3D.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 =========================================================================*/
38 #ifndef vtkLODProp3D_h
39 #define vtkLODProp3D_h
40 
41 #include "vtkRenderingCoreModule.h" // For export macro
42 #include "vtkProp3D.h"
43 
44 class vtkRenderer;
45 class vtkMapper;
48 class vtkImageMapper3D;
49 class vtkProperty;
50 class vtkVolumeProperty;
51 class vtkImageProperty;
52 class vtkTexture;
53 class vtkLODProp3DCallback;
54 
55 typedef struct
56 {
59  int ID;
60  double EstimatedTime;
61  int State;
62  double Level;
64 
66 {
67 public:
69  static vtkLODProp3D *New();
70 
71  vtkTypeMacro(vtkLODProp3D, vtkProp3D);
72  void PrintSelf(ostream& os, vtkIndent indent);
73 
75 
76  double *GetBounds();
77  void GetBounds(double bounds[6])
78  { this->vtkProp3D::GetBounds( bounds ); }
80 
82 
89  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back,
90  vtkTexture *t, double time );
91  int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
92  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
93  int AddLOD( vtkMapper *m, vtkProperty *p, double time );
94  int AddLOD( vtkMapper *m, vtkTexture *t, double time );
95  int AddLOD( vtkMapper *m, double time );
96  int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
97  int AddLOD( vtkAbstractVolumeMapper *m, double time );
98  int AddLOD( vtkImageMapper3D *m, vtkImageProperty *p, double time );
99  int AddLOD( vtkImageMapper3D *m, double time );
101 
103 
104  vtkGetMacro(NumberOfLODs, int);
106 
108 
112  vtkGetMacro(CurrentIndex, int);
114 
117  void RemoveLOD(int id);
118 
120 
124  void SetLODProperty(int id, vtkProperty *p);
125  void GetLODProperty(int id, vtkProperty **p);
126  void SetLODProperty(int id, vtkVolumeProperty *p);
127  void GetLODProperty(int id, vtkVolumeProperty **p);
128  void SetLODProperty(int id, vtkImageProperty *p);
129  void GetLODProperty(int id, vtkImageProperty **p);
131 
133 
137  void SetLODMapper(int id, vtkMapper *m);
138  void GetLODMapper(int id, vtkMapper **m);
139  void SetLODMapper(int id, vtkAbstractVolumeMapper *m);
140  void GetLODMapper(int id, vtkAbstractVolumeMapper **m);
141  void SetLODMapper(int id, vtkImageMapper3D *m);
142  void GetLODMapper(int id, vtkImageMapper3D **m);
144 
148  vtkAbstractMapper3D *GetLODMapper(int id);
149 
151 
153  void SetLODBackfaceProperty(int id, vtkProperty *t);
154  void GetLODBackfaceProperty(int id, vtkProperty **t);
156 
158 
160  void SetLODTexture(int id, vtkTexture *t);
161  void GetLODTexture(int id, vtkTexture **t);
163 
165 
168  void EnableLOD(int id);
169  void DisableLOD(int id);
170  int IsLODEnabled(int id);
172 
174 
179  void SetLODLevel(int id, double level);
180  double GetLODLevel(int id );
181  double GetLODIndexLevel(int index);
183 
185 
188  double GetLODEstimatedRenderTime(int id);
189  double GetLODIndexEstimatedRenderTime(int index);
191 
193 
196  vtkSetClampMacro(AutomaticLODSelection, int, 0, 1);
197  vtkGetMacro(AutomaticLODSelection, int);
198  vtkBooleanMacro(AutomaticLODSelection, int);
200 
202 
204  vtkSetMacro(SelectedLODID, int);
205  vtkGetMacro(SelectedLODID, int);
207 
210  int GetLastRenderedLODID();
211 
213  int GetPickLODID(void);
214 
216 
219  virtual void GetActors(vtkPropCollection *);
220  virtual void GetVolumes(vtkPropCollection *);
222 
224 
226  void SetSelectedPickLODID(int id);
227  vtkGetMacro(SelectedPickLODID, int);
229 
231 
234  vtkSetClampMacro(AutomaticPickLODSelection, int, 0, 1);
235  vtkGetMacro(AutomaticPickLODSelection, int);
236  vtkBooleanMacro(AutomaticPickLODSelection, int);
238 
240  void ShallowCopy(vtkProp *prop);
241 
242 //BTX
243 
245 
246  int RenderOpaqueGeometry(vtkViewport *viewport);
248  virtual int RenderVolumetricGeometry( vtkViewport *ren);
250 
252  virtual int HasTranslucentPolygonalGeometry();
253 
258 
262  void SetAllocatedRenderTime( double t, vtkViewport *vp );
263 
269 
272  virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
273 
274 //ETX
275 
276 protected:
277  vtkLODProp3D();
278  ~vtkLODProp3D();
279 
280  int GetAutomaticPickPropIndex(void);
281 
286 
287  int GetNextEntryIndex();
288  int ConvertIDToIndex( int id );
290 
295  vtkLODProp3DCallback *PickCallback;
296 
297 private:
298  vtkLODProp3D(const vtkLODProp3D&); // Not implemented.
299  void operator=(const vtkLODProp3D&); // Not implemented.
300 };
301 
302 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
int AutomaticPickLODSelection
Definition: vtkLODProp3D.h:294
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:57
abstract specification for Viewports
Definition: vtkViewport.h:46
represent surface properties of a geometric object
Definition: vtkProperty.h:63
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:282
virtual int RenderOpaqueGeometry(vtkViewport *)
Definition: vtkProp.h:198
virtual int HasTranslucentPolygonalGeometry()
Definition: vtkProp.h:262
void GetBounds(double bounds[6])
Definition: vtkLODProp3D.h:77
virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
Definition: vtkProp.h:332
image display properties
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:62
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:42
int AutomaticLODSelection
Definition: vtkLODProp3D.h:291
virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
Definition: vtkProp.h:320
int SelectedPickLODID
Definition: vtkLODProp3D.h:293
a list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkProp.h:270
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:295
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:202
void ShallowCopy(vtkProp *prop)
int SelectedLODIndex
Definition: vtkLODProp3D.h:289
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract class for mapping images to the screen
void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:64
handles properties associated with a texture map
Definition: vtkTexture.h:69
abstract class specifies interface to map 3D data
represents the common properties for rendering a volume.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:89
#define VTKRENDERINGCORE_EXPORT
level of detail 3D prop
Definition: vtkLODProp3D.h:65
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:200
virtual void RestoreEstimatedRenderTime()
Definition: vtkProp.h:304
virtual double * GetBounds()=0
static vtkObject * New()
virtual void GetActors(vtkPropCollection *)
Definition: vtkProp.h:62