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 
65 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
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]) { this->vtkProp3D::GetBounds( bounds ); };
79 
81 
88  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back,
89  vtkTexture *t, double time );
90  int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
91  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
92  int AddLOD( vtkMapper *m, vtkProperty *p, double time );
93  int AddLOD( vtkMapper *m, vtkTexture *t, double time );
94  int AddLOD( vtkMapper *m, double time );
95  int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
96  int AddLOD( vtkAbstractVolumeMapper *m, double time );
97  int AddLOD( vtkImageMapper3D *m, vtkImageProperty *p, double time );
98  int AddLOD( vtkImageMapper3D *m, double time );
100 
102 
103  vtkGetMacro(NumberOfLODs, int);
105 
107 
111  vtkGetMacro(CurrentIndex, int);
113 
116  void RemoveLOD( int id );
117 
119 
123  void SetLODProperty( int id, vtkProperty *p );
124  void GetLODProperty( int id, vtkProperty **p );
125  void SetLODProperty( int id, vtkVolumeProperty *p );
126  void GetLODProperty( int id, vtkVolumeProperty **p );
127  void SetLODProperty( int id, vtkImageProperty *p );
128  void GetLODProperty( int id, vtkImageProperty **p );
130 
132 
136  void SetLODMapper( int id, vtkMapper *m );
137  void GetLODMapper( int id, vtkMapper **m );
138  void SetLODMapper( int id, vtkAbstractVolumeMapper *m );
139  void GetLODMapper( int id, vtkAbstractVolumeMapper **m );
140  void SetLODMapper( int id, vtkImageMapper3D *m );
141  void GetLODMapper( int id, vtkImageMapper3D **m );
143 
147  vtkAbstractMapper3D *GetLODMapper(int id);
148 
150 
152  void SetLODBackfaceProperty( int id, vtkProperty *t );
153  void GetLODBackfaceProperty( int id, vtkProperty **t );
155 
157 
159  void SetLODTexture( int id, vtkTexture *t );
160  void GetLODTexture( int id, vtkTexture **t );
162 
164 
167  void EnableLOD( int id );
168  void DisableLOD( int id );
169  int IsLODEnabled( int id );
171 
173 
178  void SetLODLevel( int id, double level );
179  double GetLODLevel( int id );
180  double GetLODIndexLevel( int index );
182 
184 
187  double GetLODEstimatedRenderTime( int id );
188  double GetLODIndexEstimatedRenderTime( int index );
190 
192 
195  vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
196  vtkGetMacro( AutomaticLODSelection, int );
197  vtkBooleanMacro( AutomaticLODSelection, int );
199 
201 
203  vtkSetMacro( SelectedLODID, int );
204  vtkGetMacro( SelectedLODID, int );
206 
209  int GetLastRenderedLODID();
210 
212  int GetPickLODID(void);
213 
215 
218  virtual void GetActors(vtkPropCollection *);
219  virtual void GetVolumes(vtkPropCollection *);
221 
223 
225  void SetSelectedPickLODID(int id);
226  vtkGetMacro( SelectedPickLODID, int );
228 
230 
233  vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
234  vtkGetMacro( AutomaticPickLODSelection, int );
235  vtkBooleanMacro( AutomaticPickLODSelection, int );
237 
239  void ShallowCopy(vtkProp *prop);
240 
241 //BTX
242 
244 
245  int RenderOpaqueGeometry(vtkViewport *viewport);
247  virtual int RenderVolumetricGeometry( vtkViewport *ren);
249 
251  virtual int HasTranslucentPolygonalGeometry();
252 
257 
261  void SetAllocatedRenderTime( double t, vtkViewport *vp );
262 
268 
271  virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
272 
273 //ETX
274 
275 protected:
276  vtkLODProp3D();
277  ~vtkLODProp3D();
278 
279  int GetAutomaticPickPropIndex(void);
280 
285 
286  int GetNextEntryIndex();
287  int ConvertIDToIndex( int id );
289 
294  vtkLODProp3DCallback *PickCallback;
295 
296 private:
297  vtkLODProp3D(const vtkLODProp3D&); // Not implemented.
298  void operator=(const vtkLODProp3D&); // Not implemented.
299 };
300 
301 #endif
302