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-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00060 #ifndef __vtkProp_h
00061 #define __vtkProp_h
00062 
00063 #include "vtkObject.h"
00064 #include "vtkAssemblyPaths.h"
00065 
00066 class vtkViewport;
00067 class vtkPropCollection;
00068 class vtkWindow;
00069 class vtkMatrix4x4;
00070 
00071 class VTK_COMMON_EXPORT vtkProp : public vtkObject
00072 {
00073 public:
00075   static vtkProp* New();
00076 
00077   vtkTypeMacro(vtkProp,vtkObject);
00078   void PrintSelf(ostream& os, vtkIndent indent);
00079 
00081 
00084   virtual void GetActors(vtkPropCollection *) {}
00085   virtual void GetActors2D(vtkPropCollection *) {}
00086   virtual void GetVolumes(vtkPropCollection *) {}
00088 
00090 
00091   vtkSetMacro(Visibility, int);
00092   vtkGetMacro(Visibility, int);
00093   vtkBooleanMacro(Visibility, int);
00095 
00097 
00099   vtkSetMacro(Pickable,int);
00100   vtkGetMacro(Pickable,int);
00101   vtkBooleanMacro(Pickable,int);
00103 
00105 
00107   void SetPickMethod(void (*f)(void *), void *arg);
00108   void SetPickMethodArgDelete(void (*f)(void *));
00110 
00112   virtual void Pick();
00113 
00115 
00121   vtkSetMacro(Dragable,int);
00122   vtkGetMacro(Dragable,int);
00123   vtkBooleanMacro(Dragable,int);
00125 
00130   virtual unsigned long GetRedrawMTime() {return this->GetMTime();}
00131   
00134   virtual float *GetBounds() {return NULL;}
00135 
00137   virtual void ShallowCopy(vtkProp *prop);
00138 
00140 
00151   virtual void InitPathTraversal();
00152   virtual vtkAssemblyPath *GetNextPath();
00153   virtual int GetNumberOfPaths() {return 1;}
00155 
00157 
00160   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00161   virtual vtkMatrix4x4 *GetMatrix() {return NULL;}
00163 
00164 //BTX  
00166   /*! WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE
00167       THESE METHODS OUTSIDE OF THE RENDERING PROCESS All concrete
00168       subclasses must be able to render themselves. There are three key
00169       render methods in vtk and they correspond to three different points
00170       in the rendering cycle. Any given prop may implement one or more of
00171       these methods. The first method is intended for rendering all opaque
00172       geometry. The second method is intended for rendering all translucent
00173       geometry. Most volume rendering mappers draw their results during
00174       this second method. The last method is to render any 2D annotation or
00175       overlays. Each of these methods return an integer value indicating
00176       whether or not this render method was applied to this data. */
00177   virtual int RenderOpaqueGeometry(      vtkViewport *) { return 0; }
00178   virtual int RenderTranslucentGeometry( vtkViewport *) { return 0; }
00179   virtual int RenderOverlay(             vtkViewport *) { return 0; }
00181 
00186   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00187 
00189 
00199   virtual float GetEstimatedRenderTime( vtkViewport * )
00200     { return this->EstimatedRenderTime; }
00201   virtual float GetEstimatedRenderTime(){ return this->EstimatedRenderTime; }
00203   
00205 
00209   virtual void SetEstimatedRenderTime(float t) 
00210     {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;}
00212     
00214 
00219   virtual void RestoreEstimatedRenderTime()
00220     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00222   
00223   
00225 
00235   virtual void AddEstimatedRenderTime(float t, vtkViewport *vtkNotUsed(vp))
00236     {this->EstimatedRenderTime+=t;}
00238 
00240 
00247   virtual void SetAllocatedRenderTime(float t, vtkViewport *vtkNotUsed(v)) 
00248     {
00249     this->AllocatedRenderTime = t;
00250     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00251     this->EstimatedRenderTime = 0.0;
00252     }
00254 
00256 
00258   vtkGetMacro(AllocatedRenderTime, float);
00260 
00262 
00266   void SetRenderTimeMultiplier( float t ) { this->RenderTimeMultiplier = t; }
00267   vtkGetMacro(RenderTimeMultiplier, float);
00269 
00273   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
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   // support multi-part props and access to paths of prop
00292   // stuff that follows is used to build the assembly hierarchy
00293   vtkAssemblyPaths *Paths;
00294   
00295 private:
00296   vtkProp(const vtkProp&);  // Not implemented.
00297   void operator=(const vtkProp&);  // Not implemented.
00298 };
00299 
00300 #endif
00301 
00302 

Generated on Thu Mar 28 14:19:16 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001