Common/vtkProp.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Common/vtkProp.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkProp.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00049 #ifndef __vtkProp_h
    00050 #define __vtkProp_h
    00051
    00052 #include "vtkObject.h"
    00053
    00054 class vtkAssemblyPath;
    00055 class vtkAssemblyPaths;
    00056 class vtkMatrix4x4;
    00057 class vtkPropCollection;
    00058 class vtkViewport;
    00059 class vtkWindow;
    00060
    00061 class VTK_COMMON_EXPORT vtkProp : public vtkObject
    00062 {
    00063 public:
    00064   vtkTypeRevisionMacro(vtkProp,vtkObject);
    00065   void PrintSelf(ostream& os, vtkIndent indent);
    00066
    00068
    00071   virtual void GetActors(vtkPropCollection *) {}
    00072   virtual void GetActors2D(vtkPropCollection *) {}
    00073   virtual void GetVolumes(vtkPropCollection *) {}
    00075
    00077
    00078   vtkSetMacro(Visibility, int);
    00079   vtkGetMacro(Visibility, int);
    00080   vtkBooleanMacro(Visibility, int);
    00082
    00084
    00086   vtkSetMacro(Pickable,int);
    00087   vtkGetMacro(Pickable,int);
    00088   vtkBooleanMacro(Pickable,int);
    00090
    00092
    00094   void SetPickMethod(void (*f)(void *), void *arg);
    00095   void SetPickMethodArgDelete(void (*f)(void *));
    00097
    00099   virtual void Pick();
    00100
    00102
    00108   vtkSetMacro(Dragable,int);
    00109   vtkGetMacro(Dragable,int);
    00110   vtkBooleanMacro(Dragable,int);
    00112
    00117   virtual unsigned long GetRedrawMTime() {return this->GetMTime();}
    00118
    00121   virtual float *GetBounds() {return NULL;}
    00122
    00124   virtual void ShallowCopy(vtkProp *prop);
    00125
    00127
    00138   virtual void InitPathTraversal();
    00139   virtual vtkAssemblyPath *GetNextPath();
    00140   virtual int GetNumberOfPaths() {return 1;}
    00142
    00144
    00147   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
    00148   virtual vtkMatrix4x4 *GetMatrix() {return NULL;}
    00150
    00151 //BTX
    00153   /*! WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE
    00154       THESE METHODS OUTSIDE OF THE RENDERING PROCESS All concrete
    00155       subclasses must be able to render themselves. There are three key
    00156       render methods in vtk and they correspond to three different points
    00157       in the rendering cycle. Any given prop may implement one or more of
    00158       these methods. The first method is intended for rendering all opaque
    00159       geometry. The second method is intended for rendering all translucent
    00160       geometry. Most volume rendering mappers draw their results during
    00161       this second method. The last method is to render any 2D annotation or
    00162       overlays. Each of these methods return an integer value indicating
    00163       whether or not this render method was applied to this data. */
    00164   virtual int RenderOpaqueGeometry(      vtkViewport *) { return 0; }
    00165   virtual int RenderTranslucentGeometry( vtkViewport *) { return 0; }
    00166   virtual int RenderOverlay(             vtkViewport *) { return 0; }
    00168
    00173   virtual void ReleaseGraphicsResources(vtkWindow *) {}
    00174
    00176
    00186   virtual float GetEstimatedRenderTime( vtkViewport * )
    00187     { return this->EstimatedRenderTime; }
    00188   virtual float GetEstimatedRenderTime(){ return this->EstimatedRenderTime; }
    00190
    00192
    00196   virtual void SetEstimatedRenderTime(float t)
    00197     {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;}
    00199
    00201
    00206   virtual void RestoreEstimatedRenderTime()
    00207     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
    00209
    00210
    00212
    00222   virtual void AddEstimatedRenderTime(float t, vtkViewport *vtkNotUsed(vp))
    00223     {this->EstimatedRenderTime+=t;}
    00225
    00227
    00234   virtual void SetAllocatedRenderTime(float t, vtkViewport *vtkNotUsed(v))
    00235     {
    00236     this->AllocatedRenderTime = t;
    00237     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
    00238     this->EstimatedRenderTime = 0.0;
    00239     }
    00241
    00243
    00245   vtkGetMacro(AllocatedRenderTime, float);
    00247
    00249
    00253   void SetRenderTimeMultiplier( float t ) { this->RenderTimeMultiplier = t; }
    00254   vtkGetMacro(RenderTimeMultiplier, float);
    00256
    00260   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
    00261
    00263
    00264   vtkGetMacro(NumberOfConsumers,int);
    00266
    00268
    00269   void AddConsumer(vtkObject *c);
    00270   void RemoveConsumer(vtkObject *c);
    00271   vtkObject *GetConsumer(int i);
    00272   int IsConsumer(vtkObject *c);
    00274
    00275 //ETX
    00276
    00277 protected:
    00278   vtkProp();
    00279   ~vtkProp();
    00280
    00281   int Visibility;
    00282   int Pickable;
    00283   unsigned long PickTag;
    00284   int Dragable;
    00285
    00286   float AllocatedRenderTime;
    00287   float EstimatedRenderTime;
    00288   float SavedEstimatedRenderTime;
    00289   float RenderTimeMultiplier;
    00290
    00291   // how many consumers does this object have
    00292   int NumberOfConsumers;
    00293   vtkObject **Consumers;
    00294
    00295   // support multi-part props and access to paths of prop
    00296   // stuff that follows is used to build the assembly hierarchy
    00297   vtkAssemblyPaths *Paths;
    00298
    00299 private:
    00300   vtkProp(const vtkProp&);  // Not implemented.
    00301   void operator=(const vtkProp&);  // Not implemented.
    00302 };
    00303
    00304 #endif
    00305
    00306