vrshoot
view libs/assimp/DXFLoader.h @ 2:334d17aed7de
visual studio project files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 02 Feb 2014 18:36:38 +0200 |
parents | |
children |
line source
1 /*
2 Open Asset Import Library (assimp)
3 ----------------------------------------------------------------------
5 Copyright (c) 2006-2012, assimp team
6 All rights reserved.
8 Redistribution and use of this software in source and binary forms,
9 with or without modification, are permitted provided that the
10 following conditions are met:
12 * Redistributions of source code must retain the above
13 copyright notice, this list of conditions and the
14 following disclaimer.
16 * Redistributions in binary form must reproduce the above
17 copyright notice, this list of conditions and the
18 following disclaimer in the documentation and/or other
19 materials provided with the distribution.
21 * Neither the name of the assimp team, nor the names of its
22 contributors may be used to endorse or promote products
23 derived from this software without specific prior
24 written permission of the assimp team.
26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 ----------------------------------------------------------------------
39 */
41 /** @file DXFLoader.h
42 * @brief Declaration of the .dxf importer class.
43 */
44 #ifndef AI_DXFLOADER_H_INCLUDED
45 #define AI_DXFLOADER_H_INCLUDED
47 #include "BaseImporter.h"
49 namespace Assimp {
50 namespace DXF {
52 class LineReader;
53 struct FileData;
54 struct PolyLine;
55 struct Block;
56 struct InsertBlock;
58 typedef std::map<std::string, const DXF::Block*> BlockMap;
59 }
62 // ---------------------------------------------------------------------------
63 /** DXF importer implementation.
64 *
65 */
66 class DXFImporter : public BaseImporter
67 {
68 public:
69 DXFImporter();
70 ~DXFImporter();
74 public:
76 // -------------------------------------------------------------------
77 /** Returns whether the class can handle the format of the given file.
78 * See BaseImporter::CanRead() for details. */
79 bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
80 bool checkSig) const;
82 protected:
84 // -------------------------------------------------------------------
85 /** Return importer meta information.
86 * See #BaseImporter::GetInfo for the details*/
87 const aiImporterDesc* GetInfo () const;
89 // -------------------------------------------------------------------
90 /** Imports the given file into the given scene structure.
91 * See BaseImporter::InternReadFile() for details */
92 void InternReadFile( const std::string& pFile,
93 aiScene* pScene,
94 IOSystem* pIOHandler);
96 private:
98 // -----------------------------------------------------
99 void SkipSection(DXF::LineReader& reader);
101 // -----------------------------------------------------
102 void ParseHeader(DXF::LineReader& reader,
103 DXF::FileData& output);
105 // -----------------------------------------------------
106 void ParseEntities(DXF::LineReader& reader,
107 DXF::FileData& output);
109 // -----------------------------------------------------
110 void ParseBlocks(DXF::LineReader& reader,
111 DXF::FileData& output);
113 // -----------------------------------------------------
114 void ParseBlock(DXF::LineReader& reader,
115 DXF::FileData& output);
117 // -----------------------------------------------------
118 void ParseInsertion(DXF::LineReader& reader,
119 DXF::FileData& output);
121 // -----------------------------------------------------
122 void ParsePolyLine(DXF::LineReader& reader,
123 DXF::FileData& output);
125 // -----------------------------------------------------
126 void ParsePolyLineVertex(DXF::LineReader& reader,
127 DXF::PolyLine& line);
129 // -----------------------------------------------------
130 void Parse3DFace(DXF::LineReader& reader,
131 DXF::FileData& output);
133 // -----------------------------------------------------
134 void ConvertMeshes(aiScene* pScene,
135 DXF::FileData& output);
137 // -----------------------------------------------------
138 void GenerateHierarchy(aiScene* pScene,
139 DXF::FileData& output);
141 // -----------------------------------------------------
142 void GenerateMaterials(aiScene* pScene,
143 DXF::FileData& output);
145 // -----------------------------------------------------
146 void ExpandBlockReferences(DXF::Block& bl,
147 const DXF::BlockMap& blocks_by_name);
148 };
150 } // end of namespace Assimp
152 #endif // AI_3DSIMPORTER_H_INC