00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkActor.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 =========================================================================*/ 00041 #ifndef __vtkActor_h 00042 #define __vtkActor_h 00043 00044 #include "vtkProp3D.h" 00045 00046 class vtkRenderer; 00047 class vtkPropCollection; 00048 class vtkActorCollection; 00049 class vtkTexture; 00050 class vtkMapper; 00051 class vtkProperty; 00052 00053 class VTK_RENDERING_EXPORT vtkActor : public vtkProp3D 00054 { 00055 public: 00056 vtkTypeRevisionMacro(vtkActor,vtkProp3D); 00057 void PrintSelf(ostream& os, vtkIndent indent); 00058 00062 static vtkActor *New(); 00063 00067 virtual void GetActors(vtkPropCollection *); 00068 00070 00071 virtual int RenderOpaqueGeometry(vtkViewport *viewport); 00072 virtual int RenderTranslucentGeometry(vtkViewport *viewport); 00074 00080 virtual void Render(vtkRenderer *, vtkMapper *) {}; 00081 00083 void ShallowCopy(vtkProp *prop); 00084 00088 void ReleaseGraphicsResources(vtkWindow *); 00089 00091 00096 void SetProperty(vtkProperty *lut); 00097 vtkProperty *GetProperty(); 00099 00103 virtual vtkProperty* MakeProperty(); 00104 00106 00110 void SetBackfaceProperty(vtkProperty *lut); 00111 vtkProperty *GetBackfaceProperty(); 00113 00115 00118 virtual void SetTexture(vtkTexture*); 00119 vtkGetObjectMacro(Texture,vtkTexture); 00121 00126 virtual void SetMapper(vtkMapper *); 00127 00129 00130 vtkGetObjectMacro(Mapper,vtkMapper); 00132 00134 00137 void GetBounds(float bounds[6]) {this->vtkProp3D::GetBounds( bounds );}; 00138 float *GetBounds(); 00140 00147 virtual void ApplyProperties() {return;}; 00148 00150 unsigned long int GetMTime(); 00151 00156 virtual unsigned long GetRedrawMTime(); 00157 00159 00163 virtual void InitPartTraversal(); 00164 virtual vtkActor *GetNextPart(); 00165 virtual int GetNumberOfParts(); 00167 00168 protected: 00169 vtkActor(); 00170 ~vtkActor(); 00171 00172 vtkProperty *Property; 00173 vtkProperty *BackfaceProperty; 00174 vtkTexture *Texture; 00175 vtkMapper *Mapper; 00176 00177 // is this actor opaque 00178 int GetIsOpaque(); 00179 00180 // Bounds are cached in an actor - the MapperBounds are also cache to 00181 // help know when the Bounds need to be recomputed. 00182 float MapperBounds[6]; 00183 vtkTimeStamp BoundsMTime; 00184 00185 private: 00186 vtkActor(const vtkActor&); // Not implemented. 00187 void operator=(const vtkActor&); // Not implemented. 00188 }; 00189 00190 #endif 00191