Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkProp.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkProp.h,v $
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 =========================================================================*/
00045 #ifndef __vtkProp_h
00046 #define __vtkProp_h
00047 
00048 #include "vtkObject.h"
00049 
00050 class vtkAssemblyPath;
00051 class vtkAssemblyPaths;
00052 class vtkMatrix4x4;
00053 class vtkPropCollection;
00054 class vtkViewport;
00055 class vtkWindow;
00056 
00057 class VTK_COMMON_EXPORT vtkProp : public vtkObject
00058 {
00059 public:
00060   vtkTypeRevisionMacro(vtkProp,vtkObject);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00064 
00067   virtual void GetActors(vtkPropCollection *) {}
00068   virtual void GetActors2D(vtkPropCollection *) {}
00069   virtual void GetVolumes(vtkPropCollection *) {}
00071 
00073 
00074   vtkSetMacro(Visibility, int);
00075   vtkGetMacro(Visibility, int);
00076   vtkBooleanMacro(Visibility, int);
00078 
00080 
00082   vtkSetMacro(Pickable,int);
00083   vtkGetMacro(Pickable,int);
00084   vtkBooleanMacro(Pickable,int);
00086 
00088   virtual void Pick();
00089 
00091 
00097   vtkSetMacro(Dragable,int);
00098   vtkGetMacro(Dragable,int);
00099   vtkBooleanMacro(Dragable,int);
00101 
00106   virtual unsigned long GetRedrawMTime() {return this->GetMTime();}
00107   
00110   virtual double *GetBounds() {return NULL;}
00111 
00113   virtual void ShallowCopy(vtkProp *prop);
00114 
00116 
00127   virtual void InitPathTraversal();
00128   virtual vtkAssemblyPath *GetNextPath();
00129   virtual int GetNumberOfPaths() {return 1;}
00131 
00133 
00136   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00137   virtual vtkMatrix4x4 *GetMatrix() {return NULL;}
00139 
00140 //BTX  
00142 
00153   virtual int RenderOpaqueGeometry(      vtkViewport *) { return 0; }
00154   virtual int RenderTranslucentGeometry( vtkViewport *) { return 0; }
00155   virtual int RenderOverlay(             vtkViewport *) { return 0; }
00157 
00162   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00163 
00165 
00175   virtual double GetEstimatedRenderTime( vtkViewport * )
00176     { return this->EstimatedRenderTime; }
00177   virtual double GetEstimatedRenderTime(){ return this->EstimatedRenderTime; }
00179   
00181 
00185   virtual void SetEstimatedRenderTime(double t) 
00186     {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;}
00188     
00190 
00195   virtual void RestoreEstimatedRenderTime()
00196     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00198   
00199   
00201 
00211   virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
00212     {this->EstimatedRenderTime+=t;}
00214 
00216 
00223   virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v)) 
00224     {
00225     this->AllocatedRenderTime = t;
00226     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00227     this->EstimatedRenderTime = 0.0;
00228     }
00230 
00232 
00234   vtkGetMacro(AllocatedRenderTime, double);
00236 
00238 
00242   void SetRenderTimeMultiplier( double t ) { this->RenderTimeMultiplier = t; }
00243   vtkGetMacro(RenderTimeMultiplier, double);
00245 
00249   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
00250 
00252 
00253   vtkGetMacro(NumberOfConsumers,int);
00255   
00257 
00258   void AddConsumer(vtkObject *c);
00259   void RemoveConsumer(vtkObject *c);
00260   vtkObject *GetConsumer(int i);
00261   int IsConsumer(vtkObject *c);
00263 
00264 //ETX
00265 
00266 protected:
00267   vtkProp();
00268   ~vtkProp();
00269 
00270   int Visibility;
00271   int Pickable;
00272   int Dragable;
00273 
00274   double AllocatedRenderTime;
00275   double EstimatedRenderTime;
00276   double SavedEstimatedRenderTime;
00277   double RenderTimeMultiplier;
00278 
00279   // how many consumers does this object have
00280   int NumberOfConsumers;
00281   vtkObject **Consumers;
00282 
00283   // support multi-part props and access to paths of prop
00284   // stuff that follows is used to build the assembly hierarchy
00285   vtkAssemblyPaths *Paths;
00286   
00287 private:
00288   vtkProp(const vtkProp&);  // Not implemented.
00289   void operator=(const vtkProp&);  // Not implemented.
00290 };
00291 
00292 #endif
00293 
00294