00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtk3DSOurImporter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2001/10/11 13:37:22 $ 00007 Version: $Revision: 1.16 $ 00008 00009 00010 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 00011 All rights reserved. 00012 00013 Redistribution and use in source and binary forms, with or without 00014 modification, are permitted provided that the following conditions are met: 00015 00016 * Redistributions of source code must retain the above copyright notice, 00017 this list of conditions and the following disclaimer. 00018 00019 * Redistributions in binary form must reproduce the above copyright notice, 00020 this list of conditions and the following disclaimer in the documentation 00021 and/or other materials provided with the distribution. 00022 00023 * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names 00024 of any contributors may be used to endorse or promote products derived 00025 from this software without specific prior written permission. 00026 00027 * Modified source versions must be plainly marked as such, and must not be 00028 misrepresented as being the original software. 00029 00030 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 00031 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00032 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00033 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 00034 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00035 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00036 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00037 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00038 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00039 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00040 00041 =========================================================================*/ 00042 // .NAME vtk3DSOurImporter - imports 3D Studio files. 00043 // .SECTION Description 00044 // vtk3DSOurImporter imports 3D Studio files into vtk. 00045 00046 // .SECTION See Also 00047 // vtkOurImporter 00048 00049 00050 #ifndef __vtk3DSOurImporter_h 00051 #define __vtk3DSOurImporter_h 00052 00053 #include <stdio.h> 00054 #include "vtkImporter.h" 00055 #include "vtk3DS.h" 00056 #include "vtkPolyData.h" 00057 00058 class VTK_HYBRID_EXPORT vtk3DSOurImporter : public vtkImporter 00059 { 00060 public: 00061 static vtk3DSOurImporter *New(); 00062 00063 void vtk3DSOurImporter::SetPolys (char* f); 00064 vtkTypeMacro(vtk3DSOurImporter,vtkImporter); 00065 void PrintSelf(ostream& os, vtkIndent indent); 00066 00067 // Description: 00068 // Specify the name of the file to read. 00069 vtkSetStringMacro(FileName); 00070 vtkGetStringMacro(FileName); 00071 00072 // Description: 00073 // Set/Get the computation of normals. If on, imported geometry will 00074 // be run through vtkPolyDataNormals. 00075 vtkSetMacro(ComputeNormals,int); 00076 vtkGetMacro(ComputeNormals,int); 00077 vtkBooleanMacro(ComputeNormals,int); 00078 00079 // Description: 00080 // Return the file pointer to the open file. 00081 FILE *GetFileFD() {return this->FileFD;}; 00082 00083 vtk3DSOmniLight *OmniList; 00084 vtk3DSSpotLight *SpotLightList; 00085 vtk3DSCamera *CameraList; 00086 vtk3DSMesh *MeshList; 00087 vtk3DSMaterial *MaterialList; 00088 vtk3DSMatProp *MatPropList; 00089 00090 protected: 00091 vtk3DSOurImporter(); 00092 ~vtk3DSOurImporter(); 00093 00094 virtual int ImportBegin (); 00095 virtual void ImportEnd (); 00096 virtual void ImportActors (vtkRenderer *renderer); 00097 virtual void ImportCameras (vtkRenderer *renderer); 00098 virtual void ImportLights (vtkRenderer *renderer); 00099 virtual void ImportProperties (vtkRenderer *renderer); 00100 vtkPolyData *GeneratePolyData (vtk3DSMesh *meshPtr); 00101 int Read3DS (); 00102 00103 char *FileName; 00104 FILE *FileFD; 00105 int ComputeNormals; 00106 int flag3; 00107 00108 private: 00109 vtk3DSOurImporter(const vtk3DSOurImporter&); // Not implemented. 00110 void operator=(const vtk3DSOurImporter&); // Not implemented. 00111 }; 00112 00113 #endif 00114