00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkAssembly.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 =========================================================================*/ 00062 #ifndef __vtkAssembly_h 00063 #define __vtkAssembly_h 00064 00065 #include "vtkProp3D.h" 00066 00067 class vtkAssemblyPaths; 00068 class vtkProp3DCollection; 00069 class vtkMapper; 00070 class vtkProperty; 00071 class vtkActor; 00072 00073 class VTK_RENDERING_EXPORT vtkAssembly : public vtkProp3D 00074 { 00075 public: 00076 static vtkAssembly *New(); 00077 00078 vtkTypeMacro(vtkAssembly,vtkProp3D); 00079 void PrintSelf(ostream& os, vtkIndent indent); 00080 00082 void AddPart(vtkProp3D *); 00083 00085 void RemovePart(vtkProp3D *); 00086 00088 vtkProp3DCollection *GetParts(); 00089 00091 00094 void GetActors(vtkPropCollection *); 00095 void GetVolumes(vtkPropCollection *); 00097 00099 00104 int RenderOpaqueGeometry(vtkViewport *ren); 00105 virtual int RenderTranslucentPolygonalGeometry( vtkViewport *ren); 00106 virtual int RenderVolumetricGeometry( vtkViewport *ren); 00108 00110 virtual int HasTranslucentPolygonalGeometry(); 00111 00115 void ReleaseGraphicsResources(vtkWindow *); 00116 00118 00128 void InitPathTraversal(); 00129 vtkAssemblyPath *GetNextPath(); 00130 int GetNumberOfPaths(); 00132 00134 00135 void GetBounds(double bounds[6]) {this->vtkProp3D::GetBounds( bounds );}; 00136 double *GetBounds(); 00138 00141 unsigned long int GetMTime(); 00142 00144 void ShallowCopy(vtkProp *prop); 00145 00146 //BTX 00151 void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path); 00152 //ETX 00153 00154 protected: 00155 vtkAssembly(); 00156 ~vtkAssembly(); 00157 00158 // Keep a list of direct descendants of the assembly hierarchy 00159 vtkProp3DCollection *Parts; 00160 00161 // Support the BuildPaths() method. Caches last paths built for 00162 // performance. 00163 vtkTimeStamp PathTime; 00164 virtual void UpdatePaths(); //apply transformations and properties recursively 00165 00166 private: 00167 vtkAssembly(const vtkAssembly&); // Not implemented. 00168 void operator=(const vtkAssembly&); // Not implemented. 00169 }; 00170 00172 inline vtkProp3DCollection *vtkAssembly::GetParts() {return this->Parts;} 00173 00174 #endif 00175 00176 00177 00178