ASEParser.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2020, assimp team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the assimp team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the assimp team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file Defines the helper data structures for importing ASE files */
  34. #ifndef AI_ASEFILEHELPER_H_INC
  35. #define AI_ASEFILEHELPER_H_INC
  36. // public ASSIMP headers
  37. #include <assimp/types.h>
  38. #include <assimp/mesh.h>
  39. #include <assimp/anim.h>
  40. #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
  41. // for some helper routines like IsSpace()
  42. #include <assimp/ParsingUtils.h>
  43. #include <assimp/qnan.h>
  44. // ASE is quite similar to 3ds. We can reuse some structures
  45. #include "AssetLib/3DS/3DSLoader.h"
  46. namespace Assimp {
  47. namespace ASE {
  48. using namespace D3DS;
  49. // ---------------------------------------------------------------------------
  50. /** Helper structure representing an ASE material */
  51. struct Material : public D3DS::Material
  52. {
  53. //! Default constructor has been deleted
  54. Material() = delete;
  55. //! Constructor with explicit name
  56. explicit Material(const std::string &name)
  57. : D3DS::Material(name)
  58. , pcInstance(NULL)
  59. , bNeed (false) {
  60. // empty
  61. }
  62. Material(const Material &other) = default;
  63. Material &operator=(const Material &other) {
  64. if (this == &other) {
  65. return *this;
  66. }
  67. avSubMaterials = other.avSubMaterials;
  68. pcInstance = other.pcInstance;
  69. bNeed = other.bNeed;
  70. return *this;
  71. }
  72. //! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
  73. Material(Material &&other) AI_NO_EXCEPT
  74. : D3DS::Material(std::move(other))
  75. , avSubMaterials(std::move(other.avSubMaterials))
  76. , pcInstance(std::move(other.pcInstance))
  77. , bNeed(std::move(other.bNeed))
  78. {
  79. other.pcInstance = nullptr;
  80. }
  81. Material &operator=( Material &&other) AI_NO_EXCEPT {
  82. if (this == &other) {
  83. return *this;
  84. }
  85. //D3DS::Material::operator=(std::move(other));
  86. avSubMaterials = std::move(other.avSubMaterials);
  87. pcInstance = std::move(other.pcInstance);
  88. bNeed = std::move(other.bNeed);
  89. other.pcInstance = nullptr;
  90. return *this;
  91. }
  92. ~Material() {}
  93. //! Contains all sub materials of this material
  94. std::vector<Material> avSubMaterials;
  95. //! aiMaterial object
  96. aiMaterial* pcInstance;
  97. //! Can we remove this material?
  98. bool bNeed;
  99. };
  100. // ---------------------------------------------------------------------------
  101. /** Helper structure to represent an ASE file face */
  102. struct Face : public FaceWithSmoothingGroup {
  103. //! Default constructor. Initializes everything with 0
  104. Face() AI_NO_EXCEPT
  105. : iMaterial(DEFAULT_MATINDEX)
  106. , iFace(0) {
  107. // empty
  108. }
  109. //! special value to indicate that no material index has
  110. //! been assigned to a face. The default material index
  111. //! will replace this value later.
  112. static const unsigned int DEFAULT_MATINDEX = 0xFFFFFFFF;
  113. //! Indices into each list of texture coordinates
  114. unsigned int amUVIndices[AI_MAX_NUMBER_OF_TEXTURECOORDS][3];
  115. //! Index into the list of vertex colors
  116. unsigned int mColorIndices[3];
  117. //! (Sub)Material index to be assigned to this face
  118. unsigned int iMaterial;
  119. //! Index of the face. It is not specified whether it is
  120. //! a requirement of the file format that all faces are
  121. //! written in sequential order, so we have to expect this case
  122. unsigned int iFace;
  123. };
  124. // ---------------------------------------------------------------------------
  125. /** Helper structure to represent an ASE file bone */
  126. struct Bone {
  127. //! Constructor
  128. Bone() = delete;
  129. //! Construction from an existing name
  130. explicit Bone( const std::string& name)
  131. : mName(name) {
  132. // empty
  133. }
  134. //! Name of the bone
  135. std::string mName;
  136. };
  137. // ---------------------------------------------------------------------------
  138. /** Helper structure to represent an ASE file bone vertex */
  139. struct BoneVertex {
  140. //! Bone and corresponding vertex weight.
  141. //! -1 for unrequired bones ....
  142. std::vector<std::pair<int,float> > mBoneWeights;
  143. };
  144. // ---------------------------------------------------------------------------
  145. /** Helper structure to represent an ASE file animation */
  146. struct Animation {
  147. enum Type {
  148. TRACK = 0x0,
  149. BEZIER = 0x1,
  150. TCB = 0x2
  151. } mRotationType, mScalingType, mPositionType;
  152. Animation() AI_NO_EXCEPT
  153. : mRotationType (TRACK)
  154. , mScalingType (TRACK)
  155. , mPositionType (TRACK) {
  156. // empty
  157. }
  158. //! List of track rotation keyframes
  159. std::vector< aiQuatKey > akeyRotations;
  160. //! List of track position keyframes
  161. std::vector< aiVectorKey > akeyPositions;
  162. //! List of track scaling keyframes
  163. std::vector< aiVectorKey > akeyScaling;
  164. };
  165. // ---------------------------------------------------------------------------
  166. /** Helper structure to represent the inheritance information of an ASE node */
  167. struct InheritanceInfo {
  168. //! Default constructor
  169. InheritanceInfo() AI_NO_EXCEPT {
  170. for ( size_t i=0; i<3; ++i ) {
  171. abInheritPosition[i] = abInheritRotation[i] = abInheritScaling[i] = true;
  172. }
  173. }
  174. //! Inherit the parent's position?, axis order is x,y,z
  175. bool abInheritPosition[3];
  176. //! Inherit the parent's rotation?, axis order is x,y,z
  177. bool abInheritRotation[3];
  178. //! Inherit the parent's scaling?, axis order is x,y,z
  179. bool abInheritScaling[3];
  180. };
  181. // ---------------------------------------------------------------------------
  182. /** Represents an ASE file node. Base class for mesh, light and cameras */
  183. struct BaseNode {
  184. enum Type {
  185. Light,
  186. Camera,
  187. Mesh,
  188. Dummy
  189. } mType;
  190. //! Construction from an existing name
  191. BaseNode(Type _mType, const std::string &name)
  192. : mType (_mType)
  193. , mName (name)
  194. , mProcessed (false) {
  195. // Set mTargetPosition to qnan
  196. const ai_real qnan = get_qnan();
  197. mTargetPosition.x = qnan;
  198. }
  199. //! Name of the mesh
  200. std::string mName;
  201. //! Name of the parent of the node
  202. //! "" if there is no parent ...
  203. std::string mParent;
  204. //! Transformation matrix of the node
  205. aiMatrix4x4 mTransform;
  206. //! Target position (target lights and cameras)
  207. aiVector3D mTargetPosition;
  208. //! Specifies which axes transformations a node inherits
  209. //! from its parent ...
  210. InheritanceInfo inherit;
  211. //! Animation channels for the node
  212. Animation mAnim;
  213. //! Needed for lights and cameras: target animation channel
  214. //! Should contain position keys only.
  215. Animation mTargetAnim;
  216. bool mProcessed;
  217. };
  218. // ---------------------------------------------------------------------------
  219. /** Helper structure to represent an ASE file mesh */
  220. struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode {
  221. //! Default constructor has been deleted
  222. Mesh() = delete;
  223. //! Construction from an existing name
  224. explicit Mesh(const std::string &name)
  225. : BaseNode( BaseNode::Mesh, name )
  226. , mVertexColors()
  227. , mBoneVertices()
  228. , mBones()
  229. , iMaterialIndex(Face::DEFAULT_MATINDEX)
  230. , bSkip (false) {
  231. for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) {
  232. this->mNumUVComponents[c] = 2;
  233. }
  234. }
  235. //! List of all texture coordinate sets
  236. std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
  237. //! List of all vertex color sets.
  238. std::vector<aiColor4D> mVertexColors;
  239. //! List of all bone vertices
  240. std::vector<BoneVertex> mBoneVertices;
  241. //! List of all bones
  242. std::vector<Bone> mBones;
  243. //! Material index of the mesh
  244. unsigned int iMaterialIndex;
  245. //! Number of vertex components for each UVW set
  246. unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];
  247. //! used internally
  248. bool bSkip;
  249. };
  250. // ---------------------------------------------------------------------------
  251. /** Helper structure to represent an ASE light source */
  252. struct Light : public BaseNode
  253. {
  254. enum LightType
  255. {
  256. OMNI,
  257. TARGET,
  258. FREE,
  259. DIRECTIONAL
  260. };
  261. //! Default constructor has been deleted
  262. Light() = delete;
  263. //! Construction from an existing name
  264. explicit Light(const std::string &name)
  265. : BaseNode (BaseNode::Light, name)
  266. , mLightType (OMNI)
  267. , mColor (1.f,1.f,1.f)
  268. , mIntensity (1.f) // light is white by default
  269. , mAngle (45.f)
  270. , mFalloff (0.f)
  271. {
  272. }
  273. LightType mLightType;
  274. aiColor3D mColor;
  275. ai_real mIntensity;
  276. ai_real mAngle; // in degrees
  277. ai_real mFalloff;
  278. };
  279. // ---------------------------------------------------------------------------
  280. /** Helper structure to represent an ASE camera */
  281. struct Camera : public BaseNode
  282. {
  283. enum CameraType
  284. {
  285. FREE,
  286. TARGET
  287. };
  288. //! Default constructor has been deleted
  289. Camera() = delete;
  290. //! Construction from an existing name
  291. explicit Camera(const std::string &name)
  292. : BaseNode (BaseNode::Camera, name)
  293. , mFOV (0.75f) // in radians
  294. , mNear (0.1f)
  295. , mFar (1000.f) // could be zero
  296. , mCameraType (FREE)
  297. {
  298. }
  299. ai_real mFOV, mNear, mFar;
  300. CameraType mCameraType;
  301. };
  302. // ---------------------------------------------------------------------------
  303. /** Helper structure to represent an ASE helper object (dummy) */
  304. struct Dummy : public BaseNode {
  305. //! Constructor
  306. Dummy() AI_NO_EXCEPT
  307. : BaseNode (BaseNode::Dummy, "DUMMY") {
  308. // empty
  309. }
  310. };
  311. // Parameters to Parser::Parse()
  312. #define AI_ASE_NEW_FILE_FORMAT 200
  313. #define AI_ASE_OLD_FILE_FORMAT 110
  314. // Internally we're a little bit more tolerant
  315. #define AI_ASE_IS_NEW_FILE_FORMAT() (iFileFormat >= 200)
  316. #define AI_ASE_IS_OLD_FILE_FORMAT() (iFileFormat < 200)
  317. // -------------------------------------------------------------------------------
  318. /** \brief Class to parse ASE files
  319. */
  320. class Parser {
  321. private:
  322. Parser() AI_NO_EXCEPT {
  323. // empty
  324. }
  325. public:
  326. // -------------------------------------------------------------------
  327. //! Construct a parser from a given input file which is
  328. //! guaranteed to be terminated with zero.
  329. //! @param szFile Input file
  330. //! @param fileFormatDefault Assumed file format version. If the
  331. //! file format is specified in the file the new value replaces
  332. //! the default value.
  333. Parser (const char* szFile, unsigned int fileFormatDefault);
  334. // -------------------------------------------------------------------
  335. //! Parses the file into the parsers internal representation
  336. void Parse();
  337. private:
  338. // -------------------------------------------------------------------
  339. //! Parse the *SCENE block in a file
  340. void ParseLV1SceneBlock();
  341. // -------------------------------------------------------------------
  342. //! Parse the *MESH_SOFTSKINVERTS block in a file
  343. void ParseLV1SoftSkinBlock();
  344. // -------------------------------------------------------------------
  345. //! Parse the *MATERIAL_LIST block in a file
  346. void ParseLV1MaterialListBlock();
  347. // -------------------------------------------------------------------
  348. //! Parse a *<xxx>OBJECT block in a file
  349. //! \param mesh Node to be filled
  350. void ParseLV1ObjectBlock(BaseNode& mesh);
  351. // -------------------------------------------------------------------
  352. //! Parse a *MATERIAL blocks in a material list
  353. //! \param mat Material structure to be filled
  354. void ParseLV2MaterialBlock(Material& mat);
  355. // -------------------------------------------------------------------
  356. //! Parse a *NODE_TM block in a file
  357. //! \param mesh Node (!) object to be filled
  358. void ParseLV2NodeTransformBlock(BaseNode& mesh);
  359. // -------------------------------------------------------------------
  360. //! Parse a *TM_ANIMATION block in a file
  361. //! \param mesh Mesh object to be filled
  362. void ParseLV2AnimationBlock(BaseNode& mesh);
  363. void ParseLV3PosAnimationBlock(ASE::Animation& anim);
  364. void ParseLV3ScaleAnimationBlock(ASE::Animation& anim);
  365. void ParseLV3RotAnimationBlock(ASE::Animation& anim);
  366. // -------------------------------------------------------------------
  367. //! Parse a *MESH block in a file
  368. //! \param mesh Mesh object to be filled
  369. void ParseLV2MeshBlock(Mesh& mesh);
  370. // -------------------------------------------------------------------
  371. //! Parse a *LIGHT_SETTINGS block in a file
  372. //! \param light Light object to be filled
  373. void ParseLV2LightSettingsBlock(Light& light);
  374. // -------------------------------------------------------------------
  375. //! Parse a *CAMERA_SETTINGS block in a file
  376. //! \param cam Camera object to be filled
  377. void ParseLV2CameraSettingsBlock(Camera& cam);
  378. // -------------------------------------------------------------------
  379. //! Parse the *MAP_XXXXXX blocks in a material
  380. //! \param map Texture structure to be filled
  381. void ParseLV3MapBlock(Texture& map);
  382. // -------------------------------------------------------------------
  383. //! Parse a *MESH_VERTEX_LIST block in a file
  384. //! \param iNumVertices Value of *MESH_NUMVERTEX, if present.
  385. //! Otherwise zero. This is used to check the consistency of the file.
  386. //! A warning is sent to the logger if the validations fails.
  387. //! \param mesh Mesh object to be filled
  388. void ParseLV3MeshVertexListBlock(
  389. unsigned int iNumVertices,Mesh& mesh);
  390. // -------------------------------------------------------------------
  391. //! Parse a *MESH_FACE_LIST block in a file
  392. //! \param iNumFaces Value of *MESH_NUMFACES, if present.
  393. //! Otherwise zero. This is used to check the consistency of the file.
  394. //! A warning is sent to the logger if the validations fails.
  395. //! \param mesh Mesh object to be filled
  396. void ParseLV3MeshFaceListBlock(
  397. unsigned int iNumFaces,Mesh& mesh);
  398. // -------------------------------------------------------------------
  399. //! Parse a *MESH_TVERT_LIST block in a file
  400. //! \param iNumVertices Value of *MESH_NUMTVERTEX, if present.
  401. //! Otherwise zero. This is used to check the consistency of the file.
  402. //! A warning is sent to the logger if the validations fails.
  403. //! \param mesh Mesh object to be filled
  404. //! \param iChannel Output UVW channel
  405. void ParseLV3MeshTListBlock(
  406. unsigned int iNumVertices,Mesh& mesh, unsigned int iChannel = 0);
  407. // -------------------------------------------------------------------
  408. //! Parse a *MESH_TFACELIST block in a file
  409. //! \param iNumFaces Value of *MESH_NUMTVFACES, if present.
  410. //! Otherwise zero. This is used to check the consistency of the file.
  411. //! A warning is sent to the logger if the validations fails.
  412. //! \param mesh Mesh object to be filled
  413. //! \param iChannel Output UVW channel
  414. void ParseLV3MeshTFaceListBlock(
  415. unsigned int iNumFaces,Mesh& mesh, unsigned int iChannel = 0);
  416. // -------------------------------------------------------------------
  417. //! Parse an additional mapping channel
  418. //! (specified via *MESH_MAPPINGCHANNEL)
  419. //! \param iChannel Channel index to be filled
  420. //! \param mesh Mesh object to be filled
  421. void ParseLV3MappingChannel(
  422. unsigned int iChannel, Mesh& mesh);
  423. // -------------------------------------------------------------------
  424. //! Parse a *MESH_CVERTLIST block in a file
  425. //! \param iNumVertices Value of *MESH_NUMCVERTEX, if present.
  426. //! Otherwise zero. This is used to check the consistency of the file.
  427. //! A warning is sent to the logger if the validations fails.
  428. //! \param mesh Mesh object to be filled
  429. void ParseLV3MeshCListBlock(
  430. unsigned int iNumVertices, Mesh& mesh);
  431. // -------------------------------------------------------------------
  432. //! Parse a *MESH_CFACELIST block in a file
  433. //! \param iNumFaces Value of *MESH_NUMCVFACES, if present.
  434. //! Otherwise zero. This is used to check the consistency of the file.
  435. //! A warning is sent to the logger if the validations fails.
  436. //! \param mesh Mesh object to be filled
  437. void ParseLV3MeshCFaceListBlock(
  438. unsigned int iNumFaces, Mesh& mesh);
  439. // -------------------------------------------------------------------
  440. //! Parse a *MESH_NORMALS block in a file
  441. //! \param mesh Mesh object to be filled
  442. void ParseLV3MeshNormalListBlock(Mesh& mesh);
  443. // -------------------------------------------------------------------
  444. //! Parse a *MESH_WEIGHTSblock in a file
  445. //! \param mesh Mesh object to be filled
  446. void ParseLV3MeshWeightsBlock(Mesh& mesh);
  447. // -------------------------------------------------------------------
  448. //! Parse the bone list of a file
  449. //! \param mesh Mesh object to be filled
  450. //! \param iNumBones Number of bones in the mesh
  451. void ParseLV4MeshBones(unsigned int iNumBones,Mesh& mesh);
  452. // -------------------------------------------------------------------
  453. //! Parse the bone vertices list of a file
  454. //! \param mesh Mesh object to be filled
  455. //! \param iNumVertices Number of vertices to be parsed
  456. void ParseLV4MeshBonesVertices(unsigned int iNumVertices,Mesh& mesh);
  457. // -------------------------------------------------------------------
  458. //! Parse a *MESH_FACE block in a file
  459. //! \param out receive the face data
  460. void ParseLV4MeshFace(ASE::Face& out);
  461. // -------------------------------------------------------------------
  462. //! Parse a *MESH_VERT block in a file
  463. //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
  464. //! \param apOut Output buffer (3 floats)
  465. //! \param rIndexOut Output index
  466. void ParseLV4MeshFloatTriple(ai_real* apOut, unsigned int& rIndexOut);
  467. // -------------------------------------------------------------------
  468. //! Parse a *MESH_VERT block in a file
  469. //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
  470. //! \param apOut Output buffer (3 floats)
  471. void ParseLV4MeshFloatTriple(ai_real* apOut);
  472. // -------------------------------------------------------------------
  473. //! Parse a *MESH_TFACE block in a file
  474. //! (also works for MESH_CFACE)
  475. //! \param apOut Output buffer (3 ints)
  476. //! \param rIndexOut Output index
  477. void ParseLV4MeshLongTriple(unsigned int* apOut, unsigned int& rIndexOut);
  478. // -------------------------------------------------------------------
  479. //! Parse a *MESH_TFACE block in a file
  480. //! (also works for MESH_CFACE)
  481. //! \param apOut Output buffer (3 ints)
  482. void ParseLV4MeshLongTriple(unsigned int* apOut);
  483. // -------------------------------------------------------------------
  484. //! Parse a single float element
  485. //! \param fOut Output float
  486. void ParseLV4MeshFloat(ai_real& fOut);
  487. // -------------------------------------------------------------------
  488. //! Parse a single int element
  489. //! \param iOut Output integer
  490. void ParseLV4MeshLong(unsigned int& iOut);
  491. // -------------------------------------------------------------------
  492. //! Skip everything to the next: '*' or '\0'
  493. bool SkipToNextToken();
  494. // -------------------------------------------------------------------
  495. //! Skip the current section until the token after the closing }.
  496. //! This function handles embedded subsections correctly
  497. bool SkipSection();
  498. // -------------------------------------------------------------------
  499. //! Output a warning to the logger
  500. //! \param szWarn Warn message
  501. void LogWarning(const char* szWarn);
  502. // -------------------------------------------------------------------
  503. //! Output a message to the logger
  504. //! \param szWarn Message
  505. void LogInfo(const char* szWarn);
  506. // -------------------------------------------------------------------
  507. //! Output an error to the logger
  508. //! \param szWarn Error message
  509. AI_WONT_RETURN void LogError(const char* szWarn) AI_WONT_RETURN_SUFFIX;
  510. // -------------------------------------------------------------------
  511. //! Parse a string, enclosed in double quotation marks
  512. //! \param out Output string
  513. //! \param szName Name of the enclosing element -> used in error
  514. //! messages.
  515. //! \return false if an error occurred
  516. bool ParseString(std::string& out,const char* szName);
  517. public:
  518. //! Pointer to current data
  519. const char* filePtr;
  520. //! background color to be passed to the viewer
  521. //! QNAN if none was found
  522. aiColor3D m_clrBackground;
  523. //! Base ambient color to be passed to all materials
  524. //! QNAN if none was found
  525. aiColor3D m_clrAmbient;
  526. //! List of all materials found in the file
  527. std::vector<Material> m_vMaterials;
  528. //! List of all meshes found in the file
  529. std::vector<Mesh> m_vMeshes;
  530. //! List of all dummies found in the file
  531. std::vector<Dummy> m_vDummies;
  532. //! List of all lights found in the file
  533. std::vector<Light> m_vLights;
  534. //! List of all cameras found in the file
  535. std::vector<Camera> m_vCameras;
  536. //! Current line in the file
  537. unsigned int iLineNumber;
  538. //! First frame
  539. unsigned int iFirstFrame;
  540. //! Last frame
  541. unsigned int iLastFrame;
  542. //! Frame speed - frames per second
  543. unsigned int iFrameSpeed;
  544. //! Ticks per frame
  545. unsigned int iTicksPerFrame;
  546. //! true if the last character read was an end-line character
  547. bool bLastWasEndLine;
  548. //! File format version
  549. unsigned int iFileFormat;
  550. };
  551. } // Namespace ASE
  552. } // Namespace ASSIMP
  553. #endif // ASSIMP_BUILD_NO_3DS_IMPORTER
  554. #endif // !! include guard