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 "vtkProp3D.h"
42 
43 class vtkRenderer;
44 class vtkMapper;
47 class vtkProperty;
48 class vtkVolumeProperty;
49 class vtkTexture;
50 class vtkLODProp3DCallback;
51 
52 typedef struct
53 {
56  int ID;
57  double EstimatedTime;
58  int State;
59  double Level;
61 
63 {
64 public:
66  static vtkLODProp3D *New();
67 
68  vtkTypeMacro(vtkLODProp3D,vtkProp3D);
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
73  double *GetBounds();
74  void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
76 
78 
85  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back,
86  vtkTexture *t, double time );
87  int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
88  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
89  int AddLOD( vtkMapper *m, vtkProperty *p, double time );
90  int AddLOD( vtkMapper *m, vtkTexture *t, double time );
91  int AddLOD( vtkMapper *m, double time );
92  int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
93  int AddLOD( vtkAbstractVolumeMapper *m, double time );
95 
97 
98  vtkGetMacro(NumberOfLODs, int);
100 
102 
106  vtkGetMacro(CurrentIndex, int);
108 
111  void RemoveLOD( int id );
112 
114 
118  void SetLODProperty( int id, vtkProperty *p );
119  void GetLODProperty( int id, vtkProperty **p );
120  void SetLODProperty( int id, vtkVolumeProperty *p );
121  void GetLODProperty( int id, vtkVolumeProperty **p );
123 
125 
129  void SetLODMapper( int id, vtkMapper *m );
130  void GetLODMapper( int id, vtkMapper **m );
131  void SetLODMapper( int id, vtkAbstractVolumeMapper *m );
132  void GetLODMapper( int id, vtkAbstractVolumeMapper **m );
134 
138  vtkAbstractMapper3D *GetLODMapper(int id);
139 
141 
143  void SetLODBackfaceProperty( int id, vtkProperty *t );
144  void GetLODBackfaceProperty( int id, vtkProperty **t );
146 
148 
150  void SetLODTexture( int id, vtkTexture *t );
151  void GetLODTexture( int id, vtkTexture **t );
153 
155 
158  void EnableLOD( int id );
159  void DisableLOD( int id );
160  int IsLODEnabled( int id );
162 
164 
169  void SetLODLevel( int id, double level );
170  double GetLODLevel( int id );
171  double GetLODIndexLevel( int index );
173 
175 
178  double GetLODEstimatedRenderTime( int id );
179  double GetLODIndexEstimatedRenderTime( int index );
181 
183 
186  vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
187  vtkGetMacro( AutomaticLODSelection, int );
188  vtkBooleanMacro( AutomaticLODSelection, int );
190 
192 
194  vtkSetMacro( SelectedLODID, int );
195  vtkGetMacro( SelectedLODID, int );
197 
200  int GetLastRenderedLODID();
201 
203  int GetPickLODID(void);
204 
206 
209  virtual void GetActors(vtkPropCollection *);
210  virtual void GetVolumes(vtkPropCollection *);
212 
214 
216  void SetSelectedPickLODID(int id);
217  vtkGetMacro( SelectedPickLODID, int );
219 
221 
224  vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
225  vtkGetMacro( AutomaticPickLODSelection, int );
226  vtkBooleanMacro( AutomaticPickLODSelection, int );
228 
230  void ShallowCopy(vtkProp *prop);
231 
232 //BTX
233 
235 
236  int RenderOpaqueGeometry(vtkViewport *viewport);
238  virtual int RenderVolumetricGeometry( vtkViewport *ren);
240 
242  virtual int HasTranslucentPolygonalGeometry();
243 
248 
252  void SetAllocatedRenderTime( double t, vtkViewport *vp );
253 
259 
262  virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
263 
264 //ETX
265 
266 protected:
267  vtkLODProp3D();
268  ~vtkLODProp3D();
269 
270  int GetAutomaticPickPropIndex(void);
271 
276 
277  int GetNextEntryIndex();
278  int ConvertIDToIndex( int id );
280 
285  vtkLODProp3DCallback *PickCallback;
286 
287 private:
288  vtkLODProp3D(const vtkLODProp3D&); // Not implemented.
289  void operator=(const vtkLODProp3D&); // Not implemented.
290 };
291 
292 #endif
293