Compare commits

...

2 Commits

Author SHA1 Message Date
Kim Kulling 3a78db66a5 fix some doc-strings. 2020-12-24 09:10:20 +01:00
Kim Kulling 88fa7a0611 fix fixes of docs + update doxygen config. 2020-12-14 19:33:37 +01:00
11 changed files with 82 additions and 86 deletions

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team Copyright (c) 2006-2020, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -85,7 +83,11 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer // Constructor to be privately used by Importer
ASEImporter::ASEImporter() : ASEImporter::ASEImporter() :
mParser(), mBuffer(), pcScene(), configRecomputeNormals(), noSkeletonMesh() { mParser(),
mBuffer(),
pcScene(),
configRecomputeNormals(),
noSkeletonMesh() {
// empty // empty
} }

View File

@ -56,20 +56,20 @@ namespace Assimp {
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
/** Importer class for the 3DS ASE ASCII format. /// @brief Importer class for the 3DS ASE ASCII format.
* // --------------------------------------------------------------------------------
*/ class ASEImporter final : public BaseImporter {
class ASEImporter : public BaseImporter {
public: public:
/// @brief The default class constructor.
ASEImporter(); ASEImporter();
~ASEImporter();
/// @brief The class destructor.
~ASEImporter() override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file. /// @brief Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details. /// See BaseImporter::CanRead() for details.
*/ bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override;
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool checkSig) const;
protected: protected:
@ -77,15 +77,14 @@ protected:
/** Return importer meta information. /** Return importer meta information.
* See #BaseImporter::GetInfo for the details * See #BaseImporter::GetInfo for the details
*/ */
const aiImporterDesc* GetInfo () const; const aiImporterDesc* GetInfo () const override;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Imports the given file into the given scene structure. /** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details * See BaseImporter::InternReadFile() for details
*/ */
void InternReadFile( const std::string& pFile, aiScene* pScene, void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) override;
IOSystem* pIOHandler);
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -93,11 +92,10 @@ protected:
* The function is a request to the importer to update its configuration * The function is a request to the importer to update its configuration
* basing on the Importer's configuration property list. * basing on the Importer's configuration property list.
*/ */
void SetupProperties(const Importer* pImp); void SetupProperties(const Importer* pImp) override;
private: private:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Generate normal vectors basing on smoothing groups /** Generate normal vectors basing on smoothing groups
* (in some cases the normal are already contained in the file) * (in some cases the normal are already contained in the file)
@ -117,8 +115,8 @@ private:
/** Create one-material-per-mesh meshes ;-) /** Create one-material-per-mesh meshes ;-)
* \param mesh Mesh to work with * \param mesh Mesh to work with
* \param Receives the list of all created meshes * \param avOut Receives the list of all created meshes
*/ */
void ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOut); void ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOut);
@ -183,18 +181,9 @@ private:
void GenerateDefaultMaterial(); void GenerateDefaultMaterial();
protected: protected:
/** Parser instance */
ASE::Parser* mParser; ASE::Parser* mParser;
/** Buffer to hold the loaded file */
char* mBuffer; char* mBuffer;
/** Scene to be filled */
aiScene* pcScene; aiScene* pcScene;
/** Config options: Recompute the normals in every case - WA
for 3DS Max broken ASE normal export */
bool configRecomputeNormals; bool configRecomputeNormals;
bool noSkeletonMesh; bool noSkeletonMesh;
}; };

View File

@ -116,7 +116,7 @@ struct Material : public D3DS::Material {
return *this; return *this;
} }
~Material() {} ~Material() = default;
//! Contains all sub materials of this material //! Contains all sub materials of this material
std::vector<Material> avSubMaterials; std::vector<Material> avSubMaterials;
@ -178,7 +178,7 @@ struct Bone {
/** Helper structure to represent an ASE file bone vertex */ /** Helper structure to represent an ASE file bone vertex */
struct BoneVertex { struct BoneVertex {
//! Bone and corresponding vertex weight. //! Bone and corresponding vertex weight.
//! -1 for unrequired bones .... //! -1 for not required bones ....
std::vector<std::pair<int, float>> mBoneWeights; std::vector<std::pair<int, float>> mBoneWeights;
}; };
@ -239,9 +239,13 @@ struct BaseNode {
Dummy Dummy
} mType; } mType;
//! Construction from an existing name /// Construction from an existing name
BaseNode(Type _mType, const std::string &name) : /// @param type The node type
mType(_mType), mName(name), mProcessed(false) { /// @param name The node name
BaseNode(Type type, const std::string &name) :
mType(type),
mName(name),
mProcessed(false) {
// Set mTargetPosition to qnan // Set mTargetPosition to qnan
const ai_real qnan = get_qnan(); const ai_real qnan = get_qnan();
mTargetPosition.x = qnan; mTargetPosition.x = qnan;

Binary file not shown.

View File

@ -197,7 +197,7 @@ SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. # The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments. # Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8 TAB_SIZE = 4
# This tag can be used to specify a number of aliases that acts # This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value". # as commands in the documentation. An alias has the form "name=value".
@ -381,7 +381,7 @@ EXTRACT_STATIC = YES
# defined locally in source files will be included in the documentation. # defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included. # If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_CLASSES = NO
# This flag is only useful for Objective-C code. When set to YES local # This flag is only useful for Objective-C code. When set to YES local
# methods, which are defined in the implementation section but not in # methods, which are defined in the implementation section but not in
@ -663,8 +663,6 @@ WARN_LOGFILE =
# with spaces. # with spaces.
INPUT = @doxy_main_page@ \ INPUT = @doxy_main_page@ \
@PROJECT_SOURCE_DIR@ \
@PROJECT_BINARY_DIR@ \
@PROJECT_SOURCE_DIR@/include/ \ @PROJECT_SOURCE_DIR@/include/ \
@PROJECT_SOURCE_DIR@/doc/dox.h \ @PROJECT_SOURCE_DIR@/doc/dox.h \
@PROJECT_SOURCE_DIR@/code/BaseImporter.h @PROJECT_SOURCE_DIR@/code/BaseImporter.h
@ -725,7 +723,8 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is # Note that relative paths are relative to the directory from which doxygen is
# run. # run.
EXCLUDE = irrXML.h EXCLUDE = irrXML.h \
@PROJECT_SOURCE_DIR@/contrib/*
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded # directories that are symbolic links (a Unix file system feature) are excluded
@ -740,7 +739,8 @@ EXCLUDE_SYMLINKS = NO
# for example use the pattern */test/* # for example use the pattern */test/*
EXCLUDE_PATTERNS = */.svn/* \ EXCLUDE_PATTERNS = */.svn/* \
*/.svn */.svn \
*/.git
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the # (namespaces, classes, functions, etc.) that should be excluded from the

View File

@ -5,8 +5,6 @@
/** /**
@mainpage assimp - Open Asset Import Library @mainpage assimp - Open Asset Import Library
<img src="dragonsplash.png"></img>
@section intro Introduction @section intro Introduction
assimp is a library to load and process geometric scenes from various data formats. It is tailored at typical game assimp is a library to load and process geometric scenes from various data formats. It is tailored at typical game
@ -85,7 +83,7 @@ as long as you retain the license information and take own responsibility for wh
the LICENSE file. the LICENSE file.
You can find test models for almost all formats in the <assimp_root>/test/models directory. Beware, they're *free*, You can find test models for almost all formats in the <assimp_root>/test/models directory. Beware, they're *free*,
but not all of them are *open-source*. If there's an accompagning '<file>\source.txt' file don't forget to read it. but not all of them are *open-source*. If there's an accompagning '<file>\\source.txt' file don't forget to read it.
@section main_install Installation @section main_install Installation

View File

@ -70,7 +70,7 @@ class ProgressHandler;
* The interface is modeled after the importer interface and mostly * The interface is modeled after the importer interface and mostly
* symmetric. The same rules for threading etc. apply. * symmetric. The same rules for threading etc. apply.
* *
* In a nutshell, there are two export interfaces: #Export, which writes the * In a nutshell, there are two export interfaces: #aiExportScene, which writes the
* output file(s) either to the regular file system or to a user-supplied * output file(s) either to the regular file system or to a user-supplied
* #IOSystem, and #ExportToBlob which returns a linked list of memory * #IOSystem, and #ExportToBlob which returns a linked list of memory
* buffers (blob), each referring to one output file (in most cases * buffers (blob), each referring to one output file (in most cases

View File

@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team Copyright (c) 2006-2020, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -55,8 +54,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/ai_assert.h> #include <assimp/ai_assert.h>
#include <assimp/types.h> #include <assimp/types.h>
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <cstdint>
#include <list> #include <list>
#include <set> #include <set>
#include <vector> #include <vector>
@ -141,7 +140,7 @@ struct NodeAttachmentInfo {
*/ */
#define AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY 0x10 #define AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY 0x10
typedef std::pair<aiBone *, unsigned int> BoneSrcIndex; using BoneSrcIndex = std::pair<aiBone *, unsigned int>;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** @brief Helper data structure for SceneCombiner::MergeBones. /** @brief Helper data structure for SceneCombiner::MergeBones.
@ -187,7 +186,7 @@ struct SceneHelper {
* scenes. It is intended as internal utility and NOT for use by * scenes. It is intended as internal utility and NOT for use by
* applications. * applications.
* *
* The class is currently being used by various postprocessing steps * The class is currently being used by various post-processing steps
* and loaders (ie. LWS). * and loaders (ie. LWS).
*/ */
class ASSIMP_API SceneCombiner { class ASSIMP_API SceneCombiner {
@ -241,10 +240,10 @@ public:
* meshes should have the same material indices, too. The output * meshes should have the same material indices, too. The output
* material index is always the material index of the first mesh. * material index is always the material index of the first mesh.
* *
* @param dest Destination mesh. Must be empty. * @param dest Destination mesh. Must be empty.
* @param flags Currently no parameters * @param flags Currently no parameters
* @param begin First mesh to be processed * @param begin First mesh to be processed
* @param end Points to the mesh after the last mesh to be processed * @param end Points to the mesh after the last mesh to be processed
*/ */
static void MergeMeshes(aiMesh **dest, unsigned int flags, static void MergeMeshes(aiMesh **dest, unsigned int flags,
std::vector<aiMesh *>::const_iterator begin, std::vector<aiMesh *>::const_iterator begin,
@ -253,12 +252,12 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Merges two or more bones /** Merges two or more bones
* *
* @param out Mesh to receive the output bone list * @param out Mesh to receive the output bone list
* @param flags Currently no parameters * @param flags Currently no parameters
* @param begin First mesh to be processed * @param begin First mesh to be processed
* @param end Points to the mesh after the last mesh to be processed * @param end Points to the mesh after the last mesh to be processed
*/ */
static void MergeBones(aiMesh *out, std::vector<aiMesh *>::const_iterator it, static void MergeBones(aiMesh *out, std::vector<aiMesh *>::const_iterator begin,
std::vector<aiMesh *>::const_iterator end); std::vector<aiMesh *>::const_iterator end);
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -268,9 +267,9 @@ public:
* of a property present in different materials, the first occurrence * of a property present in different materials, the first occurrence
* is used. * is used.
* *
* @param dest Destination material. Must be empty. * @param dest Destination material. Must be empty.
* @param begin First material to be processed * @param begin First material to be processed
* @param end Points to the material after the last material to be processed * @param end Points to the material after the last material to be processed
*/ */
static void MergeMaterials(aiMaterial **dest, static void MergeMaterials(aiMaterial **dest,
std::vector<aiMaterial *>::const_iterator begin, std::vector<aiMaterial *>::const_iterator begin,
@ -279,12 +278,12 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Builds a list of uniquely named bones in a mesh list /** Builds a list of uniquely named bones in a mesh list
* *
* @param asBones Receives the output list * @param asBones Receives the output list
* @param it First mesh to be processed * @param begin First mesh to be processed
* @param end Last mesh to be processed * @param end Last mesh to be processed
*/ */
static void BuildUniqueBoneList(std::list<BoneWithHash> &asBones, static void BuildUniqueBoneList(std::list<BoneWithHash> &asBones,
std::vector<aiMesh *>::const_iterator it, std::vector<aiMesh *>::const_iterator begin,
std::vector<aiMesh *>::const_iterator end); std::vector<aiMesh *>::const_iterator end);
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View File

@ -64,8 +64,7 @@ namespace Assimp {
* little and big endian format. Don't attempt to instance the template directly. Use * little and big endian format. Don't attempt to instance the template directly. Use
* StreamReaderLE to read from a little-endian stream and StreamReaderBE to read from a * StreamReaderLE to read from a little-endian stream and StreamReaderBE to read from a
* BE stream. The class expects that the endianness of any input data is known at * BE stream. The class expects that the endianness of any input data is known at
* compile-time, which should usually be true (#BaseImporter::ConvertToUTF8 implements * compile-time, which should usually be true.
* runtime endianness conversions for text files).
* *
* XXX switch from unsigned int for size types to size_t? or ptrdiff_t?*/ * XXX switch from unsigned int for size types to size_t? or ptrdiff_t?*/
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
@ -76,7 +75,8 @@ public:
using pos = size_t; using pos = size_t;
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
/** Construction from a given stream with a well-defined endianness. /**
* @brief Construction from a given stream with a well-defined endianness.
* *
* The StreamReader holds a permanent strong reference to the * The StreamReader holds a permanent strong reference to the
* stream, which is released upon destruction. * stream, which is released upon destruction.
@ -99,6 +99,10 @@ public:
} }
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
/// @brief The class constructor with the steam and the endian working
/// mode.
/// @param stream The input stream to read from.
/// @param The endian working mode.
StreamReader(IOStream *stream, bool le = false) : StreamReader(IOStream *stream, bool le = false) :
mStream(std::shared_ptr<IOStream>(stream)), mStream(std::shared_ptr<IOStream>(stream)),
mBuffer(nullptr), mBuffer(nullptr),
@ -111,6 +115,7 @@ public:
} }
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
/// @brief The class destructor.
~StreamReader() { ~StreamReader() {
delete[] mBuffer; delete[] mBuffer;
} }
@ -332,13 +337,13 @@ private:
typedef StreamReader<true> StreamReaderLE; typedef StreamReader<true> StreamReaderLE;
typedef StreamReader<false> StreamReaderBE; typedef StreamReader<false> StreamReaderBE;
#else #else
typedef StreamReader<true> StreamReaderBE; using StreamReaderBE = StreamReader<true>;
typedef StreamReader<false> StreamReaderLE; using StreamReaderLE = StreamReader<false>;
#endif #endif
// `dynamic` StreamReader. The byte order of the input data is specified in the // `dynamic` StreamReader. The byte order of the input data is specified in the
// c'tor. This involves runtime branching and might be a little bit slower. // c'tor. This involves runtime branching and might be a little bit slower.
typedef StreamReader<true, true> StreamReaderAny; using StreamReaderAny = StreamReader<true, true>;
} // end namespace Assimp } // end namespace Assimp

View File

@ -60,7 +60,7 @@ extern "C" {
struct aiScene; struct aiScene;
struct aiFileIO; struct aiFileIO;
typedef void (*aiLogStreamCallback)(const char * /* message */, char * /* user */); using aiLogStreamCallback = void (*)(const char * /* message */, char * /* user */);
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
/** C-API: Represents a log stream. A log stream receives all log messages and /** C-API: Represents a log stream. A log stream receives all log messages and
@ -93,7 +93,7 @@ struct aiPropertyStore {
}; };
/** Our own C boolean type */ /** Our own C boolean type */
typedef int aiBool; using aiBool = int;
#define AI_FALSE 0 #define AI_FALSE 0
#define AI_TRUE 1 #define AI_TRUE 1
@ -706,7 +706,6 @@ ASSIMP_API int aiVector3AreEqualEpsilon(
/** Check if vector \p a is less than vector \p b. /** Check if vector \p a is less than vector \p b.
* @param a First vector to compare * @param a First vector to compare
* @param b Second vector to compare * @param b Second vector to compare
* @param epsilon Epsilon
* @return 1 if \p a is less than \p b * @return 1 if \p a is less than \p b
* @return 0 if \p a is equal or greater than \p b * @return 0 if \p a is equal or greater than \p b
*/ */
@ -1031,11 +1030,11 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingEulerAnglesPosition(
* rotational split into an axis and rotational angle, * rotational split into an axis and rotational angle,
* and it's translational components. * and it's translational components.
* *
* @param mat Matrix to decompose * @param mat Matrix to decompose
* @param rotation Receives the rotational component * @param scaling Receives the scaling component
* @param axis Receives the output rotation axis * @param axis Receives the output rotation axis
* @param angle Receives the output rotation angle * @param angle Receives the output rotation angle
* @param position Receives the output position for the x,y,z axes. * @param position Receives the output position for the x,y,z axes.
*/ */
ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition( ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition(
const C_STRUCT aiMatrix4x4 *mat, const C_STRUCT aiMatrix4x4 *mat,

View File

@ -410,11 +410,11 @@ struct aiMetadata {
return Get(aiString(key), value); return Get(aiString(key), value);
} }
/// Return metadata entry for analyzing it by user. /// @brief Return metadata entry for analyzing it by user.
/// \param [in] pIndex - index of the entry. /// @param index [in] index of the entry.
/// \param [out] pKey - pointer to the key value. /// @param key [out] pointer to the key value.
/// \param [out] pEntry - pointer to the entry: type and value. /// @param entry [out] pointer to the entry: type and value.
/// \return false - if pIndex is out of range, else - true. /// @return false - if pIndex is out of range, else - true.
inline bool Get(size_t index, const aiString *&key, const aiMetadataEntry *&entry) const { inline bool Get(size_t index, const aiString *&key, const aiMetadataEntry *&entry) const {
if (index >= mNumProperties) { if (index >= mNumProperties) {
return false; return false;
@ -426,8 +426,8 @@ struct aiMetadata {
return true; return true;
} }
/// Check whether there is a metadata entry for the given key. /// @brief Check whether there is a metadata entry for the given key.
/// \param [in] Key - the key value value to check for. /// @param key [in] the key value value to check for.
inline bool HasKey(const char *key) { inline bool HasKey(const char *key) {
if (nullptr == key) { if (nullptr == key) {
return false; return false;