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 vtkImageMapper3D;
48 class vtkProperty;
49 class vtkVolumeProperty;
50 class vtkImageProperty;
51 class vtkTexture;
52 class vtkLODProp3DCallback;
53 
54 typedef struct
55 {
58  int ID;
59  double EstimatedTime;
60  int State;
61  double Level;
63 
65 {
66 public:
68  static vtkLODProp3D *New();
69 
70  vtkTypeMacro(vtkLODProp3D,vtkProp3D);
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
74 
75  double *GetBounds();
76  void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
78 
80 
87  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back,
88  vtkTexture *t, double time );
89  int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
90  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
91  int AddLOD( vtkMapper *m, vtkProperty *p, double time );
92  int AddLOD( vtkMapper *m, vtkTexture *t, double time );
93  int AddLOD( vtkMapper *m, double time );
94  int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
95  int AddLOD( vtkAbstractVolumeMapper *m, double time );
96  int AddLOD( vtkImageMapper3D *m, vtkImageProperty *p, double time );
97  int AddLOD( vtkImageMapper3D *m, double time );
99 
101 
102  vtkGetMacro(NumberOfLODs, int);
104 
106 
110  vtkGetMacro(CurrentIndex, int);
112 
115  void RemoveLOD( int id );
116 
118 
122  void SetLODProperty( int id, vtkProperty *p );
123  void GetLODProperty( int id, vtkProperty **p );
124  void SetLODProperty( int id, vtkVolumeProperty *p );
125  void GetLODProperty( int id, vtkVolumeProperty **p );
126  void SetLODProperty( int id, vtkImageProperty *p );
127  void GetLODProperty( int id, vtkImageProperty **p );
129 
131 
135  void SetLODMapper( int id, vtkMapper *m );
136  void GetLODMapper( int id, vtkMapper **m );
137  void SetLODMapper( int id, vtkAbstractVolumeMapper *m );
138  void GetLODMapper( int id, vtkAbstractVolumeMapper **m );
139  void SetLODMapper( int id, vtkImageMapper3D *m );
140  void GetLODMapper( int id, vtkImageMapper3D **m );
142 
146  vtkAbstractMapper3D *GetLODMapper(int id);
147 
149 
151  void SetLODBackfaceProperty( int id, vtkProperty *t );
152  void GetLODBackfaceProperty( int id, vtkProperty **t );
154 
156 
158  void SetLODTexture( int id, vtkTexture *t );
159  void GetLODTexture( int id, vtkTexture **t );
161 
163 
166  void EnableLOD( int id );
167  void DisableLOD( int id );
168  int IsLODEnabled( int id );
170 
172 
177  void SetLODLevel( int id, double level );
178  double GetLODLevel( int id );
179  double GetLODIndexLevel( int index );
181 
183 
186  double GetLODEstimatedRenderTime( int id );
187  double GetLODIndexEstimatedRenderTime( int index );
189 
191 
194  vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
195  vtkGetMacro( AutomaticLODSelection, int );
196  vtkBooleanMacro( AutomaticLODSelection, int );
198 
200 
202  vtkSetMacro( SelectedLODID, int );
203  vtkGetMacro( SelectedLODID, int );
205 
208  int GetLastRenderedLODID();
209 
211  int GetPickLODID(void);
212 
214 
217  virtual void GetActors(vtkPropCollection *);
218  virtual void GetVolumes(vtkPropCollection *);
220 
222 
224  void SetSelectedPickLODID(int id);
225  vtkGetMacro( SelectedPickLODID, int );
227 
229 
232  vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
233  vtkGetMacro( AutomaticPickLODSelection, int );
234  vtkBooleanMacro( AutomaticPickLODSelection, int );
236 
238  void ShallowCopy(vtkProp *prop);
239 
240 //BTX
241 
243 
244  int RenderOpaqueGeometry(vtkViewport *viewport);
246  virtual int RenderVolumetricGeometry( vtkViewport *ren);
248 
250  virtual int HasTranslucentPolygonalGeometry();
251 
256 
260  void SetAllocatedRenderTime( double t, vtkViewport *vp );
261 
267 
270  virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
271 
272 //ETX
273 
274 protected:
275  vtkLODProp3D();
276  ~vtkLODProp3D();
277 
278  int GetAutomaticPickPropIndex(void);
279 
284 
285  int GetNextEntryIndex();
286  int ConvertIDToIndex( int id );
288 
293  vtkLODProp3DCallback *PickCallback;
294 
295 private:
296  vtkLODProp3D(const vtkLODProp3D&); // Not implemented.
297  void operator=(const vtkLODProp3D&); // Not implemented.
298 };
299 
300 #endif
301