API Documentation
Loading...
Searching...
No Matches
NDEVRFileImporter.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2021, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: Angle
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#ifndef NDEVR_FILE_IMPORTER_H_INC
33#define NDEVR_FILE_IMPORTER_H_INC
34#include "DLLInfo.h"
35#ifndef ASSIMP_BUILD_NO_NDV_IMPORTER
36#include <assimp/BaseImporter.h>
37
38struct aiMesh;
39struct aiNode;
40
41namespace Assimp {
42
43 namespace ObjFile {
44 struct Object;
45 struct Model;
46 } // namespace ObjFile
47
48 /**------------------------------------------------------------------------------------------------
49 \brief Helper class to import a given scene to an NDV file.
50 To Add to Assimp, add the following line to Common/ImporterRegistry.cpp,
51
52 at top of file:
53 #include <[path to this file]>
54
55 In function 'GetImporterInstanceList(std::vector<BaseImporter*>&)'
56 add the following line:
57
58 out.push_back(new NDEVRFileImporter());
59 */
60 // ------------------------------------------------------------------------------------------------
61 class NDEVRFileImporter : public BaseImporter {
62 public:
63 /// \brief Default constructor
65
66 /// \brief Destructor
68
69 public:
70 /// \brief Returns whether the class can handle the format of the given file.
71 /// \remark See BaseImporter::CanRead() for details.
72 bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override;
73
74 private:
75 //! \brief Appends the supported extension.
76 const aiImporterDesc* GetInfo() const override;
77
78 // -------------------------------------------------------------------
79 /** Imports the given file into the given scene structure. The
80 * function is expected to throw an ImportErrorException if there is
81 * an error. If it terminates normally, the data in aiScene is
82 * expected to be correct. Override this function to implement the
83 * actual importing.
84 * <br>
85 * The output scene must meet the following requirements:<br>
86 * <ul>
87 * <li>At least a root node must be there, even if its only purpose
88 * is to reference one mesh.</li>
89 * <li>aiMesh::mPrimitiveTypes may be 0. The types of primitives
90 * in the mesh are determined automatically in this case.</li>
91 * <li>the vertex data is stored in a pseudo-indexed "verbose" format.
92 * In fact this means that every vertex that is referenced by
93 * a face is unique. Or the other way round: a vertex index may
94 * not occur twice in a single aiMesh.</li>
95 * <li>aiAnimation::mDuration may be -1. Assimp determines the length
96 * of the animation automatically in this case as the length of
97 * the longest animation channel.</li>
98 * <li>aiMesh::mBitangents may be NULL if tangents and normals are
99 * given. In this case bitangents are computed as the cross product
100 * between normal and tangent.</li>
101 * <li>There needn't be a material. If none is there a default material
102 * is generated. However, it is recommended practice for loaders
103 * to generate a default material for yourself that matches the
104 * default material setting for the file format better than Assimp's
105 * generic default material. Note that default materials *should*
106 * be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded
107 * or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy)
108 * texture. </li>
109 * </ul>
110 * If the AI_SCENE_FLAGS_INCOMPLETE-Flag is <b>not</b> set:<ul>
111 * <li> at least one mesh must be there</li>
112 * <li> there may be no meshes with 0 vertices or faces</li>
113 * </ul>
114 * This won't be checked (except by the validation step): Assimp will
115 * crash if one of the conditions is not met!
116 *
117 * @param pFile Path of the file to be imported.
118 * @param pScene The scene object to hold the imported data.
119 * NULL is not a valid parameter.
120 * @param pIOHandler The IO handler to use for any file access.
121 * NULL is not a valid parameter. */
122 void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) override;
123
124 };
125
126 // ------------------------------------------------------------------------------------------------
127
128} // Namespace Assimp
129
130#endif
131#endif
#define ASSIMP_INTERFACE_API
Definition DLLInfo.h:78
Helper class to import a given scene to an NDV file. To Add to Assimp, add the following line to Comm...
Definition NDEVRFileImporter.h:61
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const override
Returns whether the class can handle the format of the given file.
Definition NDEVRFileImporter.cpp:87
ASSIMP_INTERFACE_API NDEVRFileImporter()
Default constructor.
Definition NDEVRFileImporter.cpp:75
~NDEVRFileImporter()
Destructor.
Definition NDEVRFileImporter.cpp:81
Definition NDEVRFileExporter.h:46