OSG3DSSceneFileType.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038
00039 #ifndef _OSG3DSSCENEFILETYPE_H_
00040 #define _OSG3DSSCENEFILETYPE_H_
00041 #ifdef  __sgi
00042 #pragma  once
00043 #endif
00044 
00045 #include "OSGFileIODef.h"
00046 #include "OSGAction.h"
00047 #include "OSGBaseTypes.h"
00048 #include "OSGGeoPositionsFields.h"
00049 #include "OSGGeometry.h"
00050 #include "OSGNode.h"
00051 #include "OSGSceneFileType.h"
00052 #include "OSGMaterial.h"
00053
00054 #include "OSG3DSLoader.h"
00055
00056 OSG_BEGIN_NAMESPACE
00057
00062 class OSG_FILEIO_DLLMAPPING A3DSSceneFileType : public SceneFileType
00063 {
00064 public:
00065
00066     static A3DSSceneFileType &the(void);
00067
00068     virtual ~A3DSSceneFileType(void);
00069
00070     virtual const Char8 *getName(void) const;
00071
00072     virtual NodeTransitPtr read(      std::istream &is,
00073                                 const Char8        *fileNameOrExtension,
00074                                       Resolver      resolver  = NULL   ) const;
00075
00076 protected:
00077
00078     static const Char8            *_suffixA[];
00079     static       A3DSSceneFileType  _the;
00080
00081     A3DSSceneFileType(const Char8  *suffixArray[],
00082                             UInt16  suffixByteCount,
00083                             bool    override,
00084                             UInt32  overridePriority,
00085                             UInt32  flags);
00086
00087     A3DSSceneFileType(const A3DSSceneFileType &obj);
00088
00089 private:
00090
00091     NodeTransitPtr     createMesh    (L3DS &scene, LMesh  &mesh) const;
00092     MaterialTransitPtr createMaterial(L3DS &scene, UInt32  id  ) const;
00093
00094     mutable std::map<UInt32, MaterialUnrecPtr> _materials;
00095     typedef std::map<UInt32, MaterialUnrecPtr>::iterator materialIt;
00096 };
00097
00098 typedef A3DSSceneFileType* A3DSSceneFileTypeP;
00099
00100 OSG_END_NAMESPACE
00101
00102 #endif // _OSG3DSSCENEFILETYPE_H_