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 =========================================================================*/
00056 #ifndef __vtkProp_h
00057 #define __vtkProp_h
00058 
00059 #include "vtkObject.h"
00060 #include "vtkRayCastStructures.h"
00061 #include "vtkAssemblyPaths.h"
00062 
00063 class vtkViewport;
00064 class vtkPropCollection;
00065 class vtkWindow;
00066 class vtkMatrix4x4;
00067 
00068 class VTK_EXPORT vtkProp : public vtkObject
00069 {
00070 public:
00072   static vtkProp* New();
00073 
00074   vtkTypeMacro(vtkProp,vtkObject);
00075   void PrintSelf(ostream& os, vtkIndent indent);
00076 
00080   virtual void GetActors(vtkPropCollection *) {}
00081   virtual void GetActors2D(vtkPropCollection *) {}
00082   virtual void GetVolumes(vtkPropCollection *) {}
00083 
00085   vtkSetMacro(Visibility, int);
00086   vtkGetMacro(Visibility, int);
00087   vtkBooleanMacro(Visibility, int);
00088 
00091   vtkSetMacro(Pickable,int);
00092   vtkGetMacro(Pickable,int);
00093   vtkBooleanMacro(Pickable,int);
00094 
00097   void SetPickMethod(void (*f)(void *), void *arg);
00098   void SetPickMethodArgDelete(void (*f)(void *));
00099 
00101   virtual void Pick();
00102 
00109   vtkSetMacro(Dragable,int);
00110   vtkGetMacro(Dragable,int);
00111   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 
00137   virtual void InitPathTraversal();
00138   virtual vtkAssemblyPath *GetNextPath();
00139   virtual int GetNumberOfPaths() {return 1;}
00140 
00144   virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00145   virtual vtkMatrix4x4 *GetMatrix() {return NULL;}
00146 
00147 //BTX  
00154   virtual int RequiresRayCasting() { return 0; }
00155 
00162   virtual int RequiresRenderingIntoImage() { return 0; }
00163 
00186   virtual int RenderOpaqueGeometry(      vtkViewport *) { return 0; }
00187   virtual int RenderTranslucentGeometry( vtkViewport *) { return 0; }
00188   virtual int InitializeRayCasting(      vtkViewport *) { return 0; }
00189   virtual int CastViewRay(         VTKRayCastRayInfo *) { return 0; }
00190   virtual int RenderIntoImage(           vtkViewport *) { return 0; }
00191   virtual float *GetRGBAImage()                         { return NULL; }
00192   virtual float *GetZImage()                            { return NULL; }
00193   virtual int RenderOverlay(             vtkViewport *) { return 0; }
00194 
00199   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00200 
00211   virtual float GetEstimatedRenderTime( vtkViewport * )
00212     { return this->EstimatedRenderTime; }
00213   virtual float GetEstimatedRenderTime(){ return this->EstimatedRenderTime; }
00214   
00219   virtual void SetEstimatedRenderTime(float t) 
00220     {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;}
00221     
00227   virtual void RestoreEstimatedRenderTime()
00228     { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00229   
00230   
00241   virtual void AddEstimatedRenderTime(float t, vtkViewport *vtkNotUsed(vp))
00242     {this->EstimatedRenderTime+=t;}
00243 
00251   virtual void SetAllocatedRenderTime(float t, vtkViewport *vtkNotUsed(v)) 
00252     {
00253     this->AllocatedRenderTime = t;
00254     this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00255     this->EstimatedRenderTime = 0.0;
00256     }
00257 
00260   vtkGetMacro(AllocatedRenderTime, float);
00261 
00266   void SetRenderTimeMultiplier( float t ) { this->RenderTimeMultiplier = t; }
00267   vtkGetMacro(RenderTimeMultiplier, float);
00268 
00272   virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
00273 
00274 //ETX
00275 
00276 #ifndef VTK_REMOVE_LEGACY_CODE
00277   virtual vtkMatrix4x4 *GetMatrixPointer() 
00278     {VTK_LEGACY_METHOD(GetMatrixPointer,"3.2"); return NULL;}
00279 #endif
00280 
00281 protected:
00282   vtkProp();
00283   ~vtkProp();
00284   vtkProp(const vtkProp&) {};
00285   void operator=(const vtkProp&) {};
00286 
00287   int Visibility;
00288   int Pickable;
00289   unsigned long PickTag;
00290   int Dragable;
00291 
00292   float AllocatedRenderTime;
00293   float EstimatedRenderTime;
00294   float SavedEstimatedRenderTime;
00295   float RenderTimeMultiplier;
00296 
00297   // support multi-part props and access to paths of prop
00298   // stuff that follows is used to build the assembly hierarchy
00299   vtkAssemblyPaths *Paths;
00300   
00301 };
00302 
00303 #endif
00304 
00305 

Generated on Wed Nov 21 12:26:53 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001