00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkActor.h,v $ 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 =========================================================================*/ 00037 #ifndef __vtkActor_h 00038 #define __vtkActor_h 00039 00040 #include "vtkProp3D.h" 00041 00042 class vtkRenderer; 00043 class vtkPropCollection; 00044 class vtkActorCollection; 00045 class vtkTexture; 00046 class vtkMapper; 00047 class vtkProperty; 00048 00049 class VTK_RENDERING_EXPORT vtkActor : public vtkProp3D 00050 { 00051 public: 00052 vtkTypeRevisionMacro(vtkActor,vtkProp3D); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00058 static vtkActor *New(); 00059 00063 virtual void GetActors(vtkPropCollection *); 00064 00066 00067 virtual int RenderOpaqueGeometry(vtkViewport *viewport); 00068 virtual int RenderTranslucentGeometry(vtkViewport *viewport); 00070 00076 virtual void Render(vtkRenderer *, vtkMapper *) {}; 00077 00079 void ShallowCopy(vtkProp *prop); 00080 00084 void ReleaseGraphicsResources(vtkWindow *); 00085 00087 00092 void SetProperty(vtkProperty *lut); 00093 vtkProperty *GetProperty(); 00095 00099 virtual vtkProperty* MakeProperty(); 00100 00102 00106 void SetBackfaceProperty(vtkProperty *lut); 00107 vtkProperty *GetBackfaceProperty(); 00109 00111 00114 virtual void SetTexture(vtkTexture*); 00115 vtkGetObjectMacro(Texture,vtkTexture); 00117 00122 virtual void SetMapper(vtkMapper *); 00123 00125 00126 vtkGetObjectMacro(Mapper,vtkMapper); 00128 00130 00133 void GetBounds(double bounds[6]) {this->vtkProp3D::GetBounds( bounds );}; 00134 double *GetBounds(); 00136 00143 virtual void ApplyProperties() {return;}; 00144 00146 unsigned long int GetMTime(); 00147 00152 virtual unsigned long GetRedrawMTime(); 00153 00155 00159 virtual void InitPartTraversal(); 00160 virtual vtkActor *GetNextPart(); 00161 virtual int GetNumberOfParts(); 00163 00164 protected: 00165 vtkActor(); 00166 ~vtkActor(); 00167 00168 vtkProperty *Property; 00169 vtkProperty *BackfaceProperty; 00170 vtkTexture *Texture; 00171 vtkMapper *Mapper; 00172 00173 // is this actor opaque 00174 int GetIsOpaque(); 00175 00176 // Bounds are cached in an actor - the MapperBounds are also cache to 00177 // help know when the Bounds need to be recomputed. 00178 double MapperBounds[6]; 00179 vtkTimeStamp BoundsMTime; 00180 00181 private: 00182 vtkActor(const vtkActor&); // Not implemented. 00183 void operator=(const vtkActor&); // Not implemented. 00184 }; 00185 00186 #endif 00187