VTK
dox/Rendering/Core/vtkProp.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkProp.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00036 #ifndef __vtkProp_h
00037 #define __vtkProp_h
00038 
00039 #include "vtkRenderingCoreModule.h" // For export macro
00040 #include "vtkObject.h"
00041 
00042 class vtkAssemblyPath;
00043 class vtkAssemblyPaths;
00044 class vtkMatrix4x4;
00045 class vtkPropCollection;
00046 class vtkViewport;
00047 class vtkWindow;
00048 class vtkInformation;
00049 
00050 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
00051 {
00052 public:
00053   vtkTypeMacro(vtkProp, vtkObject);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057 
00060   virtual void GetActors(vtkPropCollection *) {}
00061   virtual void GetActors2D(vtkPropCollection *) {}
00062   virtual void GetVolumes(vtkPropCollection *) {}
00064 
00066 
00067   vtkSetMacro(Visibility, int);
00068   vtkGetMacro(Visibility, int);
00069   vtkBooleanMacro(Visibility, int);
00071 
00073 
00076   vtkSetMacro(Pickable, int);
00077   vtkGetMacro(Pickable, int);
00078   vtkBooleanMacro(Pickable, int);
00080 
00082   virtual void Pick();
00083 
00085 
00091   vtkSetMacro(Dragable, int);
00092   vtkGetMacro(Dragable, int);
00093   vtkBooleanMacro(Dragable, int);
00095 
00097 
00101   virtual unsigned long GetRedrawMTime()
00102     { return this->GetMTime(); }
00104 
00106 
00110   vtkSetMacro(UseBounds, bool);
00111   vtkGetMacro(UseBounds, bool);
00112   vtkBooleanMacro(UseBounds, bool);
00114 
00116 
00118   virtual double *GetBounds()
00119     { return NULL; }
00121 
00123   virtual void ShallowCopy(vtkProp *prop);
00124 
00126 
00137   virtual void InitPathTraversal();
00138   virtual vtkAssemblyPath *GetNextPath();
00139   virtual int GetNumberOfPaths()
00140     { return 1; }
00142 
00144 
00147   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00148   virtual vtkMatrix4x4 *GetMatrix()
00149     { return NULL; }
00151 
00153 
00157   vtkGetObjectMacro(PropertyKeys,vtkInformation);
00158   virtual void SetPropertyKeys(vtkInformation *keys);
00160 
00163   virtual bool HasKeys(vtkInformation *requiredKeys);
00164 
00165 //BTX
00167 
00180   virtual int RenderOpaqueGeometry(vtkViewport *)
00181     { return 0; }
00182   virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
00183     { return 0; }
00184   virtual int RenderVolumetricGeometry(vtkViewport *)
00185     { return 0; }
00186   virtual int RenderOverlay(vtkViewport *)
00187     { return 0; }
00189 
00191 
00197   virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
00198                                             vtkInformation *requiredKeys);
00200 
00202 
00208   virtual bool RenderFilteredTranslucentPolygonalGeometry(
00209     vtkViewport *v,
00210     vtkInformation *requiredKeys);
00212 
00214 
00220   virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
00221                                                 vtkInformation *requiredKeys);
00223 
00225 
00231   virtual bool RenderFilteredOverlay(vtkViewport *v,
00232                                      vtkInformation *requiredKeys);
00234 
00236 
00244   virtual int HasTranslucentPolygonalGeometry()
00245     { return 0; }
00247 
00252   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00253 
00255 
00265   virtual double GetEstimatedRenderTime( vtkViewport * )
00266     { return this->EstimatedRenderTime; }
00267   virtual double GetEstimatedRenderTime()
00268     { return this->EstimatedRenderTime; }
00270 
00272 
00276   virtual void SetEstimatedRenderTime(double t)
00277     { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
00279 
00281 
00286   virtual void RestoreEstimatedRenderTime()
00287     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00289 
00290 
00292 
00302   virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
00303     { this->EstimatedRenderTime += t; }
00305 
00307 
00314   virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
00315     {
00316     this->AllocatedRenderTime = t;
00317     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00318     this->EstimatedRenderTime = 0.0;
00319     }
00321 
00323 
00325   vtkGetMacro(AllocatedRenderTime, double);
00327 
00329 
00333   void SetRenderTimeMultiplier( double t )
00334     { this->RenderTimeMultiplier = t; }
00335   vtkGetMacro(RenderTimeMultiplier, double);
00337 
00341   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
00342 
00344 
00348   virtual bool GetSupportsSelection()
00349     { return false; }
00351 
00353 
00354   vtkGetMacro(NumberOfConsumers,int);
00356 
00358 
00359   void AddConsumer(vtkObject *c);
00360   void RemoveConsumer(vtkObject *c);
00361   vtkObject *GetConsumer(int i);
00362   int IsConsumer(vtkObject *c);
00364 
00365 //ETX
00366 
00367 protected:
00368   vtkProp();
00369   ~vtkProp();
00370 
00371   int Visibility;
00372   int Pickable;
00373   int Dragable;
00374   bool UseBounds;
00375 
00376   double AllocatedRenderTime;
00377   double EstimatedRenderTime;
00378   double SavedEstimatedRenderTime;
00379   double RenderTimeMultiplier;
00380 
00381   // how many consumers does this object have
00382   int NumberOfConsumers;
00383   vtkObject **Consumers;
00384 
00385   // support multi-part props and access to paths of prop
00386   // stuff that follows is used to build the assembly hierarchy
00387   vtkAssemblyPaths *Paths;
00388 
00389   vtkInformation *PropertyKeys;
00390 
00391 private:
00392   vtkProp(const vtkProp&);  // Not implemented.
00393   void operator=(const vtkProp&);  // Not implemented.
00394 };
00395 
00396 #endif