VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/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 class vtkInformationIntegerKey;
00050 class vtkInformationDoubleVectorKey;
00051 
00052 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
00053 {
00054 public:
00055   vtkTypeMacro(vtkProp, vtkObject);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00062   virtual void GetActors(vtkPropCollection *) {}
00063   virtual void GetActors2D(vtkPropCollection *) {}
00064   virtual void GetVolumes(vtkPropCollection *) {}
00066 
00068 
00069   vtkSetMacro(Visibility, int);
00070   vtkGetMacro(Visibility, int);
00071   vtkBooleanMacro(Visibility, int);
00073 
00075 
00078   vtkSetMacro(Pickable, int);
00079   vtkGetMacro(Pickable, int);
00080   vtkBooleanMacro(Pickable, int);
00082 
00084   virtual void Pick();
00085 
00087 
00093   vtkSetMacro(Dragable, int);
00094   vtkGetMacro(Dragable, int);
00095   vtkBooleanMacro(Dragable, int);
00097 
00099 
00103   virtual unsigned long GetRedrawMTime()
00104     { return this->GetMTime(); }
00106 
00108 
00112   vtkSetMacro(UseBounds, bool);
00113   vtkGetMacro(UseBounds, bool);
00114   vtkBooleanMacro(UseBounds, bool);
00116 
00118 
00120   virtual double *GetBounds()
00121     { return NULL; }
00123 
00125   virtual void ShallowCopy(vtkProp *prop);
00126 
00128 
00139   virtual void InitPathTraversal();
00140   virtual vtkAssemblyPath *GetNextPath();
00141   virtual int GetNumberOfPaths()
00142     { return 1; }
00144 
00146 
00149   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00150   virtual vtkMatrix4x4 *GetMatrix()
00151     { return NULL; }
00153 
00155 
00159   vtkGetObjectMacro(PropertyKeys,vtkInformation);
00160   virtual void SetPropertyKeys(vtkInformation *keys);
00162 
00165   virtual bool HasKeys(vtkInformation *requiredKeys);
00166 
00168 
00171   virtual vtkIdType GetConvertedPickValue(vtkIdType idIn,
00172       int vtkNotUsed(fieldassociation)) { return idIn; }
00174 
00181   static vtkInformationIntegerKey *GeneralTextureUnit();
00182 
00189   static vtkInformationDoubleVectorKey *GeneralTextureTransform();
00190 
00191 //BTX
00193 
00206   virtual int RenderOpaqueGeometry(vtkViewport *)
00207     { return 0; }
00208   virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
00209     { return 0; }
00210   virtual int RenderVolumetricGeometry(vtkViewport *)
00211     { return 0; }
00212   virtual int RenderOverlay(vtkViewport *)
00213     { return 0; }
00215 
00217 
00223   virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
00224                                             vtkInformation *requiredKeys);
00226 
00228 
00234   virtual bool RenderFilteredTranslucentPolygonalGeometry(
00235     vtkViewport *v,
00236     vtkInformation *requiredKeys);
00238 
00240 
00246   virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
00247                                                 vtkInformation *requiredKeys);
00249 
00251 
00257   virtual bool RenderFilteredOverlay(vtkViewport *v,
00258                                      vtkInformation *requiredKeys);
00260 
00262 
00270   virtual int HasTranslucentPolygonalGeometry()
00271     { return 0; }
00273 
00278   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00279 
00281 
00291   virtual double GetEstimatedRenderTime( vtkViewport * )
00292     { return this->EstimatedRenderTime; }
00293   virtual double GetEstimatedRenderTime()
00294     { return this->EstimatedRenderTime; }
00296 
00298 
00302   virtual void SetEstimatedRenderTime(double t)
00303     { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
00305 
00307 
00312   virtual void RestoreEstimatedRenderTime()
00313     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00315 
00316 
00318 
00328   virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
00329     { this->EstimatedRenderTime += t; }
00331 
00333 
00340   virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
00341     {
00342     this->AllocatedRenderTime = t;
00343     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00344     this->EstimatedRenderTime = 0.0;
00345     }
00347 
00349 
00351   vtkGetMacro(AllocatedRenderTime, double);
00353 
00355 
00359   void SetRenderTimeMultiplier( double t )
00360     { this->RenderTimeMultiplier = t; }
00361   vtkGetMacro(RenderTimeMultiplier, double);
00363 
00367   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
00368 
00370 
00374   virtual bool GetSupportsSelection()
00375     { return false; }
00377 
00379 
00380   vtkGetMacro(NumberOfConsumers,int);
00382 
00384 
00385   void AddConsumer(vtkObject *c);
00386   void RemoveConsumer(vtkObject *c);
00387   vtkObject *GetConsumer(int i);
00388   int IsConsumer(vtkObject *c);
00390 
00391 //ETX
00392 
00393 protected:
00394   vtkProp();
00395   ~vtkProp();
00396 
00397   int Visibility;
00398   int Pickable;
00399   int Dragable;
00400   bool UseBounds;
00401 
00402   double AllocatedRenderTime;
00403   double EstimatedRenderTime;
00404   double SavedEstimatedRenderTime;
00405   double RenderTimeMultiplier;
00406 
00407   // how many consumers does this object have
00408   int NumberOfConsumers;
00409   vtkObject **Consumers;
00410 
00411   // support multi-part props and access to paths of prop
00412   // stuff that follows is used to build the assembly hierarchy
00413   vtkAssemblyPaths *Paths;
00414 
00415   vtkInformation *PropertyKeys;
00416 
00417 private:
00418   vtkProp(const vtkProp&);  // Not implemented.
00419   void operator=(const vtkProp&);  // Not implemented.
00420 };
00421 
00422 #endif