00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkActor.h 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 vtkTypeMacro(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 RenderTranslucentPolygonalGeometry(vtkViewport *viewport); 00070 00072 virtual int HasTranslucentPolygonalGeometry(); 00073 00079 virtual void Render(vtkRenderer *, vtkMapper *) {} 00080 00082 void ShallowCopy(vtkProp *prop); 00083 00087 void ReleaseGraphicsResources(vtkWindow *); 00088 00090 00095 void SetProperty(vtkProperty *lut); 00096 vtkProperty *GetProperty(); 00098 00102 virtual vtkProperty* MakeProperty(); 00103 00105 00109 void SetBackfaceProperty(vtkProperty *lut); 00110 vtkGetObjectMacro(BackfaceProperty,vtkProperty); 00112 00114 00117 virtual void SetTexture(vtkTexture*); 00118 vtkGetObjectMacro(Texture,vtkTexture); 00120 00125 virtual void SetMapper(vtkMapper *); 00126 00128 00129 vtkGetObjectMacro(Mapper,vtkMapper); 00131 00133 00136 void GetBounds(double bounds[6]) {this->vtkProp3D::GetBounds( bounds );} 00137 double *GetBounds(); 00139 00146 virtual void ApplyProperties() {} 00147 00149 unsigned long int GetMTime(); 00150 00155 virtual unsigned long GetRedrawMTime(); 00156 00158 00162 VTK_LEGACY(virtual void InitPartTraversal()); 00163 VTK_LEGACY(virtual vtkActor *GetNextPart()); 00164 VTK_LEGACY(virtual int GetNumberOfParts()); 00166 00171 virtual bool GetSupportsSelection(); 00172 00173 protected: 00174 vtkActor(); 00175 ~vtkActor(); 00176 00177 vtkProperty *Property; 00178 vtkProperty *BackfaceProperty; 00179 vtkTexture *Texture; 00180 vtkMapper *Mapper; 00181 00182 // is this actor opaque 00183 int GetIsOpaque(); 00184 00185 // Bounds are cached in an actor - the MapperBounds are also cache to 00186 // help know when the Bounds need to be recomputed. 00187 double MapperBounds[6]; 00188 vtkTimeStamp BoundsMTime; 00189 00190 private: 00191 vtkActor(const vtkActor&); // Not implemented. 00192 void operator=(const vtkActor&); // Not implemented. 00193 }; 00194 00195 #endif 00196