VTK
dox/Common/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 "vtkObject.h"
00040 
00041 class vtkAssemblyPath;
00042 class vtkAssemblyPaths;
00043 class vtkMatrix4x4;
00044 class vtkPropCollection;
00045 class vtkViewport;
00046 class vtkWindow;
00047 class vtkInformation;
00048 
00049 class VTK_COMMON_EXPORT vtkProp : public vtkObject
00050 {
00051 public:
00052   vtkTypeMacro(vtkProp,vtkObject);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056 
00059   virtual void GetActors(vtkPropCollection *) {}
00060   virtual void GetActors2D(vtkPropCollection *) {}
00061   virtual void GetVolumes(vtkPropCollection *) {}
00063 
00065 
00066   vtkSetMacro(Visibility, int);
00067   vtkGetMacro(Visibility, int);
00068   vtkBooleanMacro(Visibility, int);
00070 
00072 
00075   vtkSetMacro(Pickable,int);
00076   vtkGetMacro(Pickable,int);
00077   vtkBooleanMacro(Pickable,int);
00079 
00081   virtual void Pick();
00082 
00084 
00090   vtkSetMacro(Dragable,int);
00091   vtkGetMacro(Dragable,int);
00092   vtkBooleanMacro(Dragable,int);
00094 
00099   virtual unsigned long GetRedrawMTime() {return this->GetMTime();}
00100   
00102 
00106   vtkSetMacro(UseBounds,bool);
00107   vtkGetMacro(UseBounds,bool);
00108   vtkBooleanMacro(UseBounds,bool);
00110 
00113   virtual double *GetBounds() {return NULL;}
00114   
00116   virtual void ShallowCopy(vtkProp *prop);
00117 
00119 
00130   virtual void InitPathTraversal();
00131   virtual vtkAssemblyPath *GetNextPath();
00132   virtual int GetNumberOfPaths() {return 1;}
00134 
00136 
00139   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00140   virtual vtkMatrix4x4 *GetMatrix() {return NULL;}
00142 
00144 
00148   vtkGetObjectMacro(PropertyKeys,vtkInformation);
00149   virtual void SetPropertyKeys(vtkInformation *keys);
00151   
00154   virtual bool HasKeys(vtkInformation *requiredKeys);
00155   
00156 //BTX  
00158 
00171   virtual int RenderOpaqueGeometry(      vtkViewport *) { return 0; }
00172   virtual int RenderTranslucentPolygonalGeometry( vtkViewport *) { return 0; }
00173   virtual int RenderVolumetricGeometry( vtkViewport *) { return 0; }
00174   virtual int RenderOverlay(             vtkViewport *) { return 0; }
00176 
00178 
00184   virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
00185                                             vtkInformation *requiredKeys);
00187   
00189 
00195   virtual bool RenderFilteredTranslucentPolygonalGeometry(
00196     vtkViewport *v,
00197     vtkInformation *requiredKeys);
00199   
00201 
00207   virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
00208                                                 vtkInformation *requiredKeys);
00210   
00212 
00218   virtual bool RenderFilteredOverlay(vtkViewport *v,
00219                                      vtkInformation *requiredKeys);
00221   
00230   virtual int HasTranslucentPolygonalGeometry() { return 0; }
00231   
00236   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00237 
00239 
00249   virtual double GetEstimatedRenderTime( vtkViewport * )
00250     { return this->EstimatedRenderTime; }
00251   virtual double GetEstimatedRenderTime(){ return this->EstimatedRenderTime; }
00253   
00255 
00259   virtual void SetEstimatedRenderTime(double t) 
00260     {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;}
00262     
00264 
00269   virtual void RestoreEstimatedRenderTime()
00270     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00272   
00273   
00275 
00285   virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
00286     {this->EstimatedRenderTime+=t;}
00288 
00290 
00297   virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v)) 
00298     {
00299     this->AllocatedRenderTime = t;
00300     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00301     this->EstimatedRenderTime = 0.0;
00302     }
00304 
00306 
00308   vtkGetMacro(AllocatedRenderTime, double);
00310 
00312 
00316   void SetRenderTimeMultiplier( double t ) { this->RenderTimeMultiplier = t; }
00317   vtkGetMacro(RenderTimeMultiplier, double);
00319 
00323   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
00324 
00326 
00330   virtual bool GetSupportsSelection()
00331     { return false; }
00333 
00335 
00336   vtkGetMacro(NumberOfConsumers,int);
00338   
00340 
00341   void AddConsumer(vtkObject *c);
00342   void RemoveConsumer(vtkObject *c);
00343   vtkObject *GetConsumer(int i);
00344   int IsConsumer(vtkObject *c);
00346 
00347 //ETX
00348 
00349 protected:
00350   vtkProp();
00351   ~vtkProp();
00352 
00353   int Visibility;
00354   int Pickable;
00355   int Dragable;
00356   bool UseBounds;
00357   
00358   double AllocatedRenderTime;
00359   double EstimatedRenderTime;
00360   double SavedEstimatedRenderTime;
00361   double RenderTimeMultiplier;
00362 
00363   // how many consumers does this object have
00364   int NumberOfConsumers;
00365   vtkObject **Consumers;
00366 
00367   // support multi-part props and access to paths of prop
00368   // stuff that follows is used to build the assembly hierarchy
00369   vtkAssemblyPaths *Paths;
00370   
00371   vtkInformation *PropertyKeys;
00372   
00373 private:
00374   vtkProp(const vtkProp&);  // Not implemented.
00375   void operator=(const vtkProp&);  // Not implemented.
00376 };
00377 
00378 #endif
00379 
00380