VTK
|
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 "vtkRenderingCoreModule.h" // For export macro 00041 #include "vtkProp3D.h" 00042 00043 class vtkRenderer; 00044 class vtkPropCollection; 00045 class vtkActorCollection; 00046 class vtkTexture; 00047 class vtkMapper; 00048 class vtkProperty; 00049 00050 class VTKRENDERINGCORE_EXPORT vtkActor : public vtkProp3D 00051 { 00052 public: 00053 vtkTypeMacro(vtkActor, vtkProp3D); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00059 static vtkActor *New(); 00060 00064 virtual void GetActors(vtkPropCollection *); 00065 00067 00068 virtual int RenderOpaqueGeometry(vtkViewport *viewport); 00069 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); 00071 00073 virtual int HasTranslucentPolygonalGeometry(); 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 vtkGetObjectMacro(BackfaceProperty,vtkProperty); 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(double bounds[6]) {this->vtkProp3D::GetBounds( bounds );} 00138 double *GetBounds(); 00140 00147 virtual void ApplyProperties() {} 00148 00150 unsigned long int GetMTime(); 00151 00156 virtual unsigned long GetRedrawMTime(); 00157 00162 virtual bool GetSupportsSelection(); 00163 00164 protected: 00165 vtkActor(); 00166 ~vtkActor(); 00167 00168 // is this actor opaque 00169 int GetIsOpaque(); 00170 00171 vtkProperty *Property; 00172 vtkProperty *BackfaceProperty; 00173 vtkTexture *Texture; 00174 vtkMapper *Mapper; 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