Merge branch 'master' into refactor/KHR_material_specular

pull/4786/head
Adam Beili 2023-03-24 21:47:19 +01:00 committed by GitHub
commit c9177b7811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
641 changed files with 34719 additions and 5168 deletions

View File

@ -1,2 +0,0 @@
service_name: travis-pro
repo_token: GZXuNlublKFy7HAewHAZLk5ZwgipTFAOA

View File

@ -99,7 +99,7 @@ jobs:
- name: Set Windows specific CMake arguments
if: contains(matrix.name, 'windows')
id: windows_extra_cmake_args
run: echo "::set-output name=args::-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1"
run: echo "::set-output name=args::-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1 -DASSIMP_BUILD_ZLIB=1"
- name: Set Hunter specific CMake arguments
if: contains(matrix.name, 'hunter')

View File

@ -57,3 +57,13 @@ jobs:
- name: test
run: cd build/bin && ./unit
shell: bash
job3:
name: printf-sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: run scan_printf script
run: ./scripts/scan_printf.sh
shell: bash

View File

@ -1,6 +1,6 @@
# Open Asset Import Library (assimp)
# ----------------------------------------------------------------------
# Copyright (c) 2006-2022, assimp team
# Copyright (c) 2006-2023, assimp team
#
# All rights reserved.
#
@ -84,10 +84,6 @@ OPTION( ASSIMP_NO_EXPORT
"Disable Assimp's export functionality."
OFF
)
OPTION( ASSIMP_BUILD_ZLIB
"Build your own zlib"
OFF
)
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
"If the supplementary tools for Assimp are built in addition to the library."
OFF
@ -134,6 +130,18 @@ OPTION ( ASSIMP_IGNORE_GIT_HASH
OFF
)
IF (WIN32)
OPTION( ASSIMP_BUILD_ZLIB
"Build your own zlib"
ON
)
ELSE()
OPTION( ASSIMP_BUILD_ZLIB
"Build your own zlib"
OFF
)
ENDIF()
IF (WIN32)
# Use subset of Windows.h
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
@ -277,13 +285,15 @@ ELSEIF(MSVC)
ELSE() # msvc
ADD_COMPILE_OPTIONS(/MP /bigobj /W4 /WX)
ENDIF()
# disable "elements of array '' will be default initialized" warning on MSVC2013
IF(MSVC12)
ADD_COMPILE_OPTIONS(/wd4351)
ENDIF()
ADD_COMPILE_OPTIONS(/wd4244) #supress warning for double to float conversion if Double precission is activated
# supress warning for double to float conversion if Double precission is activated
ADD_COMPILE_OPTIONS(/wd4244)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
IF(NOT ASSIMP_HUNTER_ENABLED)
@ -388,14 +398,6 @@ IF (NOT TARGET uninstall AND ASSIMP_INSTALL)
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
ENDIF()
# cmake configuration files
if(${BUILD_SHARED_LIBS})
set(BUILD_LIB_TYPE SHARED)
else()
set(BUILD_LIB_TYPE STATIC)
add_definitions(-DDDL_STATIC_LIBRARY=OFF)
endif()
IF( UNIX )
# Use GNUInstallDirs for Unix predefined directories
INCLUDE(GNUInstallDirs)
@ -488,7 +490,11 @@ ELSE()
FIND_PACKAGE(ZLIB)
ENDIF()
IF( NOT ZLIB_FOUND )
IF ( NOT ZLIB_FOUND AND NOT ASSIMP_BUILD_ZLIB )
message( FATAL_ERROR
"Build configured with -DASSIMP_BUILD_ZLIB=OFF but unable to find zlib"
)
ELSEIF( NOT ZLIB_FOUND )
MESSAGE(STATUS "compiling zlib from sources")
INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize)

128
CODE_OF_CONDUCT.md 100644
View File

@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@ -14,7 +14,6 @@ A library to import and export various 3d-model-formats including scene-post-pro
[![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Percentage of issues still open")
[![Total alerts](https://img.shields.io/lgtm/alerts/g/assimp/assimp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/assimp/assimp/alerts/)
<br>
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS.
@ -76,10 +75,13 @@ The source code is organized in the following way:
code/AssetLib/<FormatName> Implementation for import and export for the format
### Where to get help ###
For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format.
(CHMs for Windows are included in some release packages and should be located right here in the root folder).
To find our documentation, visit [our website](https://assimp.org/) or check out [Wiki](https://github.com/assimp/assimp/wiki)
If the docs don't solve your problem, ask on [StackOverflow with the assimp-tag](http://stackoverflow.com/questions/tagged/assimp?sort=newest). If you think you found a bug, please open an issue on Github.
If the docs don't solve your problem, you can:
- Ask on [StackOverflow with the assimp-tag](http://stackoverflow.com/questions/tagged/assimp?sort=newest).
- Ask on [Assimp-Community on Reddit](https://www.reddit.com/r/Assimp/)
- Ask a question at [The Assimp-Discussion Board](https://github.com/assimp/assimp/discussions)
- Nothing has worked? File a question or an issue-report at [The Assimp-Issue Tracker](https://github.com/assimp/assimp/issues)
Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.

View File

@ -322,7 +322,6 @@ struct Texture {
//! Default constructor
Texture() AI_NO_EXCEPT
: mTextureBlend(0.0f),
mMapName(),
mOffsetU(0.0),
mOffsetV(0.0),
mScaleU(1.0),
@ -334,51 +333,11 @@ struct Texture {
mTextureBlend = get_qnan();
}
Texture(const Texture &other) :
mTextureBlend(other.mTextureBlend),
mMapName(other.mMapName),
mOffsetU(other.mOffsetU),
mOffsetV(other.mOffsetV),
mScaleU(other.mScaleU),
mScaleV(other.mScaleV),
mRotation(other.mRotation),
mMapMode(other.mMapMode),
bPrivate(other.bPrivate),
iUVSrc(other.iUVSrc) {
// empty
}
Texture(const Texture &other) = default;
Texture(Texture &&other) AI_NO_EXCEPT : mTextureBlend(other.mTextureBlend),
mMapName(std::move(other.mMapName)),
mOffsetU(other.mOffsetU),
mOffsetV(other.mOffsetV),
mScaleU(other.mScaleU),
mScaleV(other.mScaleV),
mRotation(other.mRotation),
mMapMode(other.mMapMode),
bPrivate(other.bPrivate),
iUVSrc(other.iUVSrc) {
// empty
}
Texture(Texture &&other) AI_NO_EXCEPT = default;
Texture &operator=(Texture &&other) AI_NO_EXCEPT {
if (this == &other) {
return *this;
}
mTextureBlend = other.mTextureBlend;
mMapName = std::move(other.mMapName);
mOffsetU = other.mOffsetU;
mOffsetV = other.mOffsetV;
mScaleU = other.mScaleU;
mScaleV = other.mScaleV;
mRotation = other.mRotation;
mMapMode = other.mMapMode;
bPrivate = other.bPrivate;
iUVSrc = other.iUVSrc;
return *this;
}
Texture &operator=(Texture &&other) AI_NO_EXCEPT = default;
//! Specifies the blend factor for the texture
ai_real mTextureBlend;
@ -436,83 +395,13 @@ struct Material {
// empty
}
Material(const Material &other) :
mName(other.mName),
mDiffuse(other.mDiffuse),
mSpecularExponent(other.mSpecularExponent),
mShininessStrength(other.mShininessStrength),
mSpecular(other.mSpecular),
mAmbient(other.mAmbient),
mShading(other.mShading),
mTransparency(other.mTransparency),
sTexDiffuse(other.sTexDiffuse),
sTexOpacity(other.sTexOpacity),
sTexSpecular(other.sTexSpecular),
sTexReflective(other.sTexReflective),
sTexBump(other.sTexBump),
sTexEmissive(other.sTexEmissive),
sTexShininess(other.sTexShininess),
mBumpHeight(other.mBumpHeight),
mEmissive(other.mEmissive),
sTexAmbient(other.sTexAmbient),
mTwoSided(other.mTwoSided) {
// empty
}
Material(const Material &other) = default;
//! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
Material(Material &&other) AI_NO_EXCEPT : mName(std::move(other.mName)),
mDiffuse(other.mDiffuse),
mSpecularExponent(other.mSpecularExponent),
mShininessStrength(other.mShininessStrength),
mSpecular(other.mSpecular),
mAmbient(other.mAmbient),
mShading(other.mShading),
mTransparency(other.mTransparency),
sTexDiffuse(std::move(other.sTexDiffuse)),
sTexOpacity(std::move(other.sTexOpacity)),
sTexSpecular(std::move(other.sTexSpecular)),
sTexReflective(std::move(other.sTexReflective)),
sTexBump(std::move(other.sTexBump)),
sTexEmissive(std::move(other.sTexEmissive)),
sTexShininess(std::move(other.sTexShininess)),
mBumpHeight(other.mBumpHeight),
mEmissive(other.mEmissive),
sTexAmbient(std::move(other.sTexAmbient)),
mTwoSided(other.mTwoSided) {
// empty
}
Material(Material &&other) AI_NO_EXCEPT = default;
Material &operator=(Material &&other) AI_NO_EXCEPT {
if (this == &other) {
return *this;
}
Material &operator=(Material &&other) AI_NO_EXCEPT = default;
mName = std::move(other.mName);
mDiffuse = other.mDiffuse;
mSpecularExponent = other.mSpecularExponent;
mShininessStrength = other.mShininessStrength,
mSpecular = other.mSpecular;
mAmbient = other.mAmbient;
mShading = other.mShading;
mTransparency = other.mTransparency;
sTexDiffuse = std::move(other.sTexDiffuse);
sTexOpacity = std::move(other.sTexOpacity);
sTexSpecular = std::move(other.sTexSpecular);
sTexReflective = std::move(other.sTexReflective);
sTexBump = std::move(other.sTexBump);
sTexEmissive = std::move(other.sTexEmissive);
sTexShininess = std::move(other.sTexShininess);
mBumpHeight = other.mBumpHeight;
mEmissive = other.mEmissive;
sTexAmbient = std::move(other.sTexAmbient);
mTwoSided = other.mTwoSided;
return *this;
}
virtual ~Material() {
// empty
}
virtual ~Material() = default;
//! Name of the material
std::string mName;

View File

@ -69,9 +69,7 @@ public:
// empty
}
virtual ~Resource() {
// empty
}
virtual ~Resource() = default;
virtual ResourceType getType() const {
return ResourceType::RT_Unknown;

View File

@ -83,7 +83,7 @@ void ExportScene3MF(const char *pFile, IOSystem *pIOSystem, const aiScene *pScen
namespace D3MF {
D3MFExporter::D3MFExporter(const char *pFile, const aiScene *pScene) :
mArchiveName(pFile), m_zipArchive(nullptr), mScene(pScene), mModelOutput(), mRelOutput(), mContentOutput(), mBuildItems(), mRelations() {
mArchiveName(pFile), m_zipArchive(nullptr), mScene(pScene) {
// empty
}

View File

@ -227,7 +227,9 @@ void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
}
} else if (TokenMatch(buffer, "texture", 7)) {
SkipSpaces(&buffer);
buffer = AcGetString(buffer, obj.texture);
std::string texture;
buffer = AcGetString(buffer, texture);
obj.textures.push_back(texture);
} else if (TokenMatch(buffer, "texrep", 6)) {
SkipSpaces(&buffer);
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 2, &obj.texRepeat);
@ -295,7 +297,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
Surface &surf = obj.surfaces.back();
surf.flags = strtoul_cppstyle(buffer);
while (1) {
while (true) {
if (!GetNextLine()) {
throw DeadlyImportError("AC3D: Unexpected EOF: surface is incomplete");
}
@ -351,8 +353,8 @@ void AC3DImporter::ConvertMaterial(const Object &object,
s.Set(matSrc.name);
matDest.AddProperty(&s, AI_MATKEY_NAME);
}
if (object.texture.length()) {
s.Set(object.texture);
if (!object.textures.empty()) {
s.Set(object.textures[0]);
matDest.AddProperty(&s, AI_MATKEY_TEXTURE_DIFFUSE(0));
// UV transformation
@ -532,7 +534,7 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
// allocate UV coordinates, but only if the texture name for the
// surface is not empty
aiVector3D *uv = nullptr;
if (object.texture.length()) {
if (!object.textures.empty()) {
uv = mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
mesh->mNumUVComponents[0] = 2;
}
@ -750,7 +752,7 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open AC3D file ", pFile, ".");
}

View File

@ -125,7 +125,6 @@ public:
type(World),
name(),
children(),
texture(),
texRepeat(1.f, 1.f),
texOffset(0.0f, 0.0f),
rotation(),
@ -151,7 +150,8 @@ public:
std::vector<Object> children;
// texture to be assigned to all surfaces of the object
std::string texture;
// the .acc format supports up to 4 textures
std::vector<std::string> textures;
// texture repat factors (scaling for all coordinates)
aiVector2D texRepeat, texOffset;

View File

@ -83,11 +83,7 @@ void AMFImporter::Clear() {
AMFImporter::AMFImporter() AI_NO_EXCEPT :
mNodeElement_Cur(nullptr),
mXmlParser(nullptr),
mUnit(),
mVersion(),
mMaterial_Converted(),
mTexture_Converted() {
mXmlParser(nullptr) {
// empty
}
@ -261,7 +257,7 @@ void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open AMF file ", pFile, ".");
}

View File

@ -88,9 +88,7 @@ public:
std::list<AMFNodeElementBase *> Child; ///< Child elements.
public: /// Destructor, virtual..
virtual ~AMFNodeElementBase() {
// empty
}
virtual ~AMFNodeElementBase() = default;
/// Disabled copy constructor and co.
AMFNodeElementBase(const AMFNodeElementBase &pNodeElement) = delete;
@ -103,7 +101,7 @@ protected:
/// \param [in] pType - element type.
/// \param [in] pParent - parent element.
AMFNodeElementBase(const EType pType, AMFNodeElementBase *pParent) :
Type(pType), ID(), Parent(pParent), Child() {
Type(pType), Parent(pParent) {
// empty
}
}; // class IAMFImporter_NodeElement
@ -174,7 +172,7 @@ struct AMFColor : public AMFNodeElementBase {
/// @brief Constructor.
/// @param [in] pParent - pointer to parent node.
AMFColor(AMFNodeElementBase *pParent) :
AMFNodeElementBase(ENET_Color, pParent), Composed(false), Color(), Profile() {
AMFNodeElementBase(ENET_Color, pParent), Composed(false), Color() {
// empty
}
};
@ -270,7 +268,7 @@ struct AMFTexMap : public AMFNodeElementBase {
/// Constructor.
/// \param [in] pParent - pointer to parent node.
AMFTexMap(AMFNodeElementBase *pParent) :
AMFNodeElementBase(ENET_TexMap, pParent), TextureCoordinate{}, TextureID_R(), TextureID_G(), TextureID_B(), TextureID_A() {
AMFNodeElementBase(ENET_TexMap, pParent), TextureCoordinate{} {
// empty
}
};

View File

@ -815,6 +815,7 @@ nl_clean_loop:
for (; next_it != nodeArray.end(); ++next_it) {
if ((*next_it)->FindNode((*nl_it)->mName) != nullptr) {
// if current top node(nl_it) found in another top node then erase it from node_list and restart search loop.
// FIXME: this leaks memory on test models test8.amf and test9.amf
nodeArray.erase(nl_it);
goto nl_clean_loop;

View File

@ -87,10 +87,6 @@ ASEImporter::ASEImporter() :
// empty
}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
ASEImporter::~ASEImporter() = default;
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
bool ASEImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
@ -122,7 +118,7 @@ void ASEImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open ASE file ", pFile, ".");
}

View File

@ -62,7 +62,7 @@ namespace Assimp {
class ASEImporter : public BaseImporter {
public:
ASEImporter();
~ASEImporter() override;
~ASEImporter() override = default;
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.

View File

@ -1774,7 +1774,13 @@ void Parser::ParseLV4MeshFace(ASE::Face &out) {
// FIX: There needn't always be a value, sad but true
while (true) {
if (*filePtr < '9' && *filePtr >= '0') {
uint32_t value = strtoul10(filePtr, &filePtr);
if (value < 32) {
out.iSmoothGroup |= (1 << strtoul10(filePtr, &filePtr));
} else {
const std::string message = std::string("Unable to set smooth group, value with ") + ai_to_string(value) + std::string(" out of range");
LogWarning(message.c_str());
}
}
SkipSpaces(&filePtr);
if (',' != *filePtr) {

View File

@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -385,12 +384,10 @@ struct Dummy : public BaseNode {
/** \brief Class to parse ASE files
*/
class Parser {
private:
Parser() AI_NO_EXCEPT {
// empty
}
public:
/// @brief No default constructor.
Parser() = delete;
// -------------------------------------------------------------------
//! Construct a parser from a given input file which is
//! guaranteed to be terminated with zero.

View File

@ -652,7 +652,7 @@ void DumpSceneToAssxml(
const char *pFile, const char *cmd, IOSystem *pIOSystem,
const aiScene *pScene, bool shortened) {
std::unique_ptr<IOStream> file(pIOSystem->Open(pFile, "wt"));
if (!file.get()) {
if (!file) {
throw std::runtime_error("Unable to open output file " + std::string(pFile) + '\n');
}

View File

@ -116,7 +116,7 @@ void B3DImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open B3D file ", pFile, ".");
}
@ -150,7 +150,7 @@ AI_WONT_RETURN void B3DImporter::Fail(const string &str) {
// ------------------------------------------------------------------------------------------------
int B3DImporter::ReadByte() {
if (_pos > _buf.size()) {
if (_pos >= _buf.size()) {
Fail("EOF");
}
@ -253,7 +253,7 @@ size_t B3DImporter::ChunkSize() {
template <class T>
T *B3DImporter::to_array(const vector<T> &v) {
if (v.empty()) {
return 0;
return nullptr;
}
T *p = new T[v.size()];
for (size_t i = 0; i < v.size(); ++i) {
@ -266,7 +266,7 @@ T *B3DImporter::to_array(const vector<T> &v) {
template <class T>
T **unique_to_array(vector<std::unique_ptr<T>> &v) {
if (v.empty()) {
return 0;
return nullptr;
}
T **p = new T *[v.size()];
for (size_t i = 0; i < v.size(); ++i) {
@ -617,7 +617,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
} else if (chunk == "BRUS") {
ReadBRUS();
} else if (chunk == "NODE") {
ReadNODE(0);
ReadNODE(nullptr);
}
ExitChunk();
}
@ -642,7 +642,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
int n_tris = mesh->mNumFaces;
int n_verts = mesh->mNumVertices = n_tris * 3;
aiVector3D *mv = mesh->mVertices = new aiVector3D[n_verts], *mn = 0, *mc = 0;
aiVector3D *mv = mesh->mVertices = new aiVector3D[n_verts], *mn = nullptr, *mc = nullptr;
if (_vflags & 1) {
mn = mesh->mNormals = new aiVector3D[n_verts];
}

View File

@ -115,7 +115,7 @@ void BVHLoader::InternReadFile(const std::string &pFile, aiScene *pScene, IOSyst
// read file into memory
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open file ", pFile, ".");
}
@ -191,7 +191,7 @@ aiNode *BVHLoader::ReadNode() {
// now read the node's contents
std::string siteToken;
while (1) {
while (true) {
std::string token = GetNextToken();
// node offset to parent node
@ -247,7 +247,7 @@ aiNode *BVHLoader::ReadEndSite(const std::string &pParentName) {
// now read the node's contents. Only possible entry is "OFFSET"
std::string token;
while (1) {
while (true) {
token.clear();
token = GetNextToken();

View File

@ -52,8 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
template <>
const char *LogFunctions<BlenderBMeshConverter>::Prefix() {
static auto prefix = "BLEND_BMESH: ";
return prefix;
return "BLEND_BMESH: ";
}
} // namespace Assimp
@ -140,7 +139,7 @@ void BlenderBMeshConverter::ConvertPolyToFaces(const MPoly &poly) {
ThrowException("BMesh uv loop array has incorrect size");
}
const MLoopUV *loopUV = &BMesh->mloopuv[poly.loopstart];
AddTFace(loopUV[0].uv, loopUV[1].uv, loopUV[2].uv, poly.totloop == 4 ? loopUV[3].uv : 0);
AddTFace(loopUV[0].uv, loopUV[1].uv, loopUV[2].uv, poly.totloop == 4 ? loopUV[3].uv : nullptr);
}
} else if (poly.totloop > 4) {
#if ASSIMP_BLEND_WITH_GLU_TESSELLATE

View File

@ -80,7 +80,7 @@ namespace Assimp
void DestroyTriMesh( );
void ConvertPolyToFaces( const Blender::MPoly& poly );
void AddFace( int v1, int v2, int v3, int v4 = 0 );
void AddTFace( const float* uv1, const float* uv2, const float *uv3, const float* uv4 = 0 );
void AddTFace(const float *uv1, const float *uv2, const float *uv3, const float *uv4 = nullptr);
const Blender::Mesh* BMesh;
Blender::Mesh* triMesh;

View File

@ -72,7 +72,7 @@ struct Type {
// ------------------------------------------------------------------------------------------------
void DNAParser::Parse() {
StreamReaderAny &stream = *db.reader.get();
StreamReaderAny &stream = *db.reader;
DNA &dna = db.dna;
if (!match4(stream, "SDNA")) {

View File

@ -106,9 +106,7 @@ struct ElemBase {
// empty
}
virtual ~ElemBase() {
// empty
}
virtual ~ElemBase() = default;
/** Type name of the element. The type
* string points is the `c_str` of the `name` attribute of the
@ -431,6 +429,17 @@ inline bool Structure ::ResolvePointer<std::shared_ptr, ElemBase>(std::shared_pt
const Field &f,
bool) const;
template <> bool Structure :: ResolvePointer<std::shared_ptr,ElemBase>(
std::shared_ptr<ElemBase>& out, const Pointer & ptrval,
const FileDatabase& db, const Field&, bool) const;
template <> inline void Structure :: Convert<int> (int& dest,const FileDatabase& db) const;
template<> inline void Structure :: Convert<short> (short& dest,const FileDatabase& db) const;
template <> inline void Structure :: Convert<char> (char& dest,const FileDatabase& db) const;
template <> inline void Structure::Convert<unsigned char>(unsigned char& dest, const FileDatabase& db) const;
template <> inline void Structure :: Convert<float> (float& dest,const FileDatabase& db) const;
template <> inline void Structure :: Convert<double> (double& dest,const FileDatabase& db) const;
template <> inline void Structure :: Convert<Pointer> (Pointer& dest,const FileDatabase& db) const;
// -------------------------------------------------------------------------------
/** Represents the full data structure information for a single BLEND file.
* This data is extracted from the DNA1 chunk in the file.

View File

@ -63,6 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/StringComparison.h>
#include <cctype>
#include <memory>
#include <utility>
// zlib is needed for compressed blend files
@ -79,8 +80,7 @@ namespace Assimp {
template <>
const char *LogFunctions<BlenderImporter>::Prefix() {
static auto prefix = "BLEND: ";
return prefix;
return "BLEND: ";
}
} // namespace Assimp
@ -182,7 +182,7 @@ void BlenderImporter::InternReadFile(const std::string &pFile,
}
// replace the input stream with a memory stream
stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t *>(uncompressed.data()), total));
stream = std::make_shared<MemoryIOStream>(reinterpret_cast<uint8_t *>(uncompressed.data()), total);
// .. and retry
stream->Read(magic, 7, 1);
@ -219,7 +219,7 @@ void BlenderImporter::ParseBlendFile(FileDatabase &out, std::shared_ptr<IOStream
out.entries.reserve(128);
{ // even small BLEND files tend to consist of many file blocks
SectionParser parser(*out.reader.get(), out.i64bit);
SectionParser parser(*out.reader, out.i64bit);
// first parse the file in search for the DNA and insert all other sections into the database
while ((parser.Next(), 1)) {

View File

@ -62,9 +62,7 @@ public:
/**
* The class destructor, virtual.
*/
virtual ~BlenderModifier() {
// empty
}
virtual ~BlenderModifier() = default;
// --------------------
/**

View File

@ -569,7 +569,7 @@ void Structure ::Convert<MVert>(
const FileDatabase &db) const {
ReadFieldArray<ErrorPolicy_Fail>(dest.co, "co", db);
ReadFieldArray<ErrorPolicy_Fail>(dest.no, "no", db);
ReadFieldArray<ErrorPolicy_Warn>(dest.no, "no", db);
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
//ReadField<ErrorPolicy_Warn>(dest.mat_nr,"mat_nr",db);
ReadField<ErrorPolicy_Igno>(dest.bweight, "bweight", db);

View File

@ -182,7 +182,7 @@ struct MVert : ElemBase {
int bweight;
MVert() :
ElemBase(), flag(0), mat_nr(0), bweight(0) {}
flag(0), mat_nr(0), bweight(0) {}
};
// -------------------------------------------------------------------------------
@ -417,7 +417,6 @@ struct CustomDataLayer : ElemBase {
std::shared_ptr<ElemBase> data; // must be converted to real type according type member
CustomDataLayer() :
ElemBase(),
type(0),
offset(0),
flag(0),
@ -729,7 +728,7 @@ struct Object : ElemBase {
ListBase modifiers;
Object() :
ElemBase(), type(Type_EMPTY), parent(nullptr), track(), proxy(), proxy_from(), data() {
type(Type_EMPTY), parent(nullptr) {
// empty
}
};
@ -741,8 +740,7 @@ struct Base : ElemBase {
std::shared_ptr<Object> object WARN;
Base() :
ElemBase(), prev(nullptr), next(), object() {
// empty
prev(nullptr) {
// empty
}
};
@ -758,10 +756,7 @@ struct Scene : ElemBase {
ListBase base;
Scene() :
ElemBase(), camera(), world(), basact(), master_collection() {
// empty
}
Scene() = default;
};
// -------------------------------------------------------------------------------
@ -791,10 +786,7 @@ struct Image : ElemBase {
short gen_x, gen_y, gen_type;
Image() :
ElemBase() {
// empty
}
Image() = default;
};
// -------------------------------------------------------------------------------
@ -884,7 +876,7 @@ struct Tex : ElemBase {
//char use_nodes;
Tex() :
ElemBase(), imaflag(ImageFlags_INTERPOL), type(Type_CLOUDS), ima() {
imaflag(ImageFlags_INTERPOL), type(Type_CLOUDS) {
// empty
}
};
@ -976,10 +968,7 @@ struct MTex : ElemBase {
//float shadowfac;
//float zenupfac, zendownfac, blendfac;
MTex() :
ElemBase() {
// empty
}
MTex() = default;
};
} // namespace Blender

View File

@ -62,8 +62,7 @@ namspace Assimp
{
template< > const char* LogFunctions< BlenderTessellatorGL >::Prefix()
{
static auto prefix = "BLEND_TESS_GL: ";
return prefix;
return "BLEND_TESS_GL: ";
}
}
@ -81,9 +80,7 @@ BlenderTessellatorGL::BlenderTessellatorGL( BlenderBMeshConverter& converter ):
}
// ------------------------------------------------------------------------------------------------
BlenderTessellatorGL::~BlenderTessellatorGL( )
{
}
BlenderTessellatorGL::~BlenderTessellatorGL() = default;
// ------------------------------------------------------------------------------------------------
void BlenderTessellatorGL::Tessellate( const MLoop* polyLoop, int vertexCount, const std::vector< MVert >& vertices )
@ -259,8 +256,7 @@ namespace Assimp
{
template< > const char* LogFunctions< BlenderTessellatorP2T >::Prefix()
{
static auto prefix = "BLEND_TESS_P2T: ";
return prefix;
return "BLEND_TESS_P2T: ";
}
}

View File

@ -86,8 +86,7 @@ void GetWriterInfo(int &id, String &appname) {
namespace Assimp {
template<> const char* LogFunctions<C4DImporter>::Prefix() {
static auto prefix = "C4D: ";
return prefix;
return "C4D: ";
}
}
@ -106,15 +105,10 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
C4DImporter::C4DImporter()
: BaseImporter() {
// empty
}
C4DImporter::C4DImporter() = default;
// ------------------------------------------------------------------------------------------------
C4DImporter::~C4DImporter() {
// empty
}
C4DImporter::~C4DImporter() = default;
// ------------------------------------------------------------------------------------------------
bool C4DImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, bool /*checkSig*/) const {

View File

@ -158,7 +158,7 @@ void COBImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// sort faces by material indices
for (std::shared_ptr<Node> &n : scene.nodes) {
if (n->type == Node::TYPE_MESH) {
Mesh &mesh = (Mesh &)(*n.get());
Mesh &mesh = (Mesh &)(*n);
for (Face &f : mesh.faces) {
mesh.temp_map[f.material].push_back(&f);
}
@ -168,7 +168,7 @@ void COBImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// count meshes
for (std::shared_ptr<Node> &n : scene.nodes) {
if (n->type == Node::TYPE_MESH) {
Mesh &mesh = (Mesh &)(*n.get());
Mesh &mesh = (Mesh &)(*n);
if (mesh.vertex_positions.size() && mesh.texture_coords.size()) {
pScene->mNumMeshes += static_cast<unsigned int>(mesh.temp_map.size());
}
@ -211,7 +211,7 @@ void COBImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
}
}
pScene->mRootNode = BuildNodes(*root.get(), scene, pScene);
pScene->mRootNode = BuildNodes(*root, scene, pScene);
//flip normals after import
FlipWindingOrderProcess flip;
flip.Execute(pScene);
@ -868,7 +868,7 @@ void COBImporter::ReadBinaryFile(Scene &out, StreamReaderLE *reader) {
return;
}
while (1) {
while (true) {
std::string type;
type += reader->GetI1();
type += reader->GetI1();
@ -1054,7 +1054,7 @@ void COBImporter::ReadMat1_Binary(COB::Scene &out, StreamReaderLE &reader, const
id[0] = reader.GetI1(), id[1] = reader.GetI1();
if (id[0] == 'e' && id[1] == ':') {
mat.tex_env.reset(new Texture());
mat.tex_env = std::make_shared<Texture>();
reader.GetI1();
ReadString_Binary(mat.tex_env->path, reader);
@ -1064,7 +1064,7 @@ void COBImporter::ReadMat1_Binary(COB::Scene &out, StreamReaderLE &reader, const
}
if (id[0] == 't' && id[1] == ':') {
mat.tex_color.reset(new Texture());
mat.tex_color = std::make_shared<Texture>();
reader.GetI1();
ReadString_Binary(mat.tex_color->path, reader);
@ -1080,7 +1080,7 @@ void COBImporter::ReadMat1_Binary(COB::Scene &out, StreamReaderLE &reader, const
}
if (id[0] == 'b' && id[1] == ':') {
mat.tex_bump.reset(new Texture());
mat.tex_bump = std::make_shared<Texture>();
reader.GetI1();
ReadString_Binary(mat.tex_bump->path, reader);

View File

@ -117,7 +117,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError( "Failed to open CSM file ", pFile, ".");
}
@ -130,7 +130,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
int first = 0, last = 0x00ffffff;
// now process the file and look out for '$' sections
while (1) {
while (true) {
SkipSpaces(&buffer);
if ('\0' == *buffer)
break;
@ -154,7 +154,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
else if (TokenMatchI(buffer,"order",5)) {
std::vector< aiNodeAnim* > anims_temp;
anims_temp.reserve(30);
while (1) {
while (true) {
SkipSpaces(&buffer);
if (IsLineEnd(*buffer) && SkipSpacesAndLineEnd(&buffer) && *buffer == '$')
break; // next section
@ -196,7 +196,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
unsigned int filled = 0;
// Now read all point data.
while (1) {
while (true) {
SkipSpaces(&buffer);
if (IsLineEnd(*buffer) && (!SkipSpacesAndLineEnd(&buffer) || *buffer == '$')) {
break; // next section

View File

@ -246,7 +246,7 @@ void ColladaExporter::WriteHeader() {
}
// Assimp root nodes can have meshes, Collada Scenes cannot
if (mScene->mRootNode->mNumChildren == 0 || mScene->mRootNode->mMeshes != 0) {
if (mScene->mRootNode->mNumChildren == 0 || mScene->mRootNode->mMeshes != nullptr) {
mAdd_root_node = true;
}
@ -448,7 +448,7 @@ void ColladaExporter::WriteLight(size_t pIndex) {
PushTag();
switch (light->mType) {
case aiLightSource_AMBIENT:
WriteAmbienttLight(light);
WriteAmbientLight(light);
break;
case aiLightSource_DIRECTIONAL:
WriteDirectionalLight(light);
@ -543,7 +543,7 @@ void ColladaExporter::WriteSpotLight(const aiLight *const light) {
mOutput << startstr << "</spot>" << endstr;
}
void ColladaExporter::WriteAmbienttLight(const aiLight *const light) {
void ColladaExporter::WriteAmbientLight(const aiLight *const light) {
const aiColor3D &color = light->mColorAmbient;
mOutput << startstr << "<ambient>" << endstr;

View File

@ -101,7 +101,7 @@ protected:
void WritePointLight(const aiLight *const light);
void WriteDirectionalLight(const aiLight *const light);
void WriteSpotLight(const aiLight *const light);
void WriteAmbienttLight(const aiLight *const light);
void WriteAmbientLight(const aiLight *const light);
/// Writes the controller library
void WriteControllerLibrary();

View File

@ -666,7 +666,7 @@ struct ChannelEntry {
const Collada::Accessor *mTimeAccessor; ///> Collada accessor to the time values
const Collada::Data *mTimeData; ///> Source data array for the time values
const Collada::Accessor *mValueAccessor; ///> Collada accessor to the key value values
const Collada::Data *mValueData; ///> Source datat array for the key value values
const Collada::Data *mValueData; ///> Source data array for the key value values
ChannelEntry() :
mChannel(),

View File

@ -92,15 +92,6 @@ inline void AddNodeMetaData(aiNode *node, const std::string &key, const T &value
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
ColladaLoader::ColladaLoader() :
mFileName(),
mMeshIndexByID(),
mMaterialIndexByName(),
mMeshes(),
newMats(),
mCameras(),
mLights(),
mTextures(),
mAnims(),
noSkeletonMesh(false),
removeEmptyBones(false),
ignoreUpDirection(false),
@ -1264,12 +1255,12 @@ void ColladaLoader::CreateAnimation(aiScene *pScene, const ColladaParser &pParse
// now for every unique point in time, find or interpolate the key values for that time
// and apply them to the transform chain. Then the node's present transformation can be calculated.
ai_real time = startTime;
while (1) {
while (true) {
for (ChannelEntry & e : entries) {
// find the keyframe behind the current point in time
size_t pos = 0;
ai_real postTime = 0.0;
while (1) {
while (true) {
if (pos >= e.mTimeAccessor->mCount) {
break;
}
@ -1680,7 +1671,7 @@ aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser &pParse
// recurse through the param references until we end up at an image
std::string name = pName;
while (1) {
while (true) {
// the given string is a param entry. Find it
Effect::ParamLibrary::const_iterator it = pEffect.mParams.find(name);
// if not found, we're at the end of the recursion. The resulting string should be the image ID

View File

@ -145,7 +145,7 @@ ColladaParser::ColladaParser(IOSystem *pIOHandler, const std::string &pFile) :
} else {
// attempt to open the file directly
daefile.reset(pIOHandler->Open(pFile));
if (daefile.get() == nullptr) {
if (daefile == nullptr) {
throw DeadlyImportError("Failed to open file '", pFile, "'.");
}
}
@ -759,9 +759,10 @@ void ColladaParser::ReadControllerWeights(XmlNode &node, Collada::Controller &pC
XmlParser::getValueAsString(currentNode, stdText);
const char *text = stdText.c_str();
for (std::vector<std::pair<size_t, size_t>>::iterator it = pController.mWeights.begin(); it != pController.mWeights.end(); ++it) {
if (text == 0) {
if (text == nullptr) {
throw DeadlyImportError("Out of data while reading <vertex_weights>");
}
SkipSpacesAndLineEnd(&text);
it->first = strtoul10(text, &text);
SkipSpacesAndLineEnd(&text);
if (*text == 0) {

View File

@ -65,7 +65,6 @@ public:
LineReader(StreamReaderLE& reader)
: splitter(reader,false,true)
, groupcode( 0 )
, value()
, end() {
// empty
}
@ -186,8 +185,7 @@ struct InsertBlock {
InsertBlock()
: pos()
, scale(1.f,1.f,1.f)
, angle()
, name() {
, angle() {
// empty
}

View File

@ -136,7 +136,7 @@ void DXFImporter::InternReadFile( const std::string& filename, aiScene* pScene,
std::shared_ptr<IOStream> file = std::shared_ptr<IOStream>( pIOHandler->Open( filename) );
// Check whether we can read the file
if( file.get() == nullptr ) {
if (file == nullptr) {
throw DeadlyImportError( "Failed to open DXF file ", filename, "");
}

View File

@ -55,6 +55,7 @@ const char NULL_RECORD[NumNullRecords] = { // 25 null bytes in 64-bit and 13 nul
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
}; // who knows why, it looks like two integers 32/64 bit (compressed and uncompressed sizes?) + 1 byte (might be compression type?)
static std::string NULL_RECORD_STRING(NumNullRecords, '\0');
const std::string SEPARATOR = { '\x00', '\x01' }; // for use inside strings
const std::string MAGIC_NODE_TAG = "_$AssimpFbx$"; // from import
const int64_t SECOND = 46186158000; // FBX's kTime unit

View File

@ -119,7 +119,7 @@ FBXConverter::FBXConverter(aiScene *out, const Document &doc, bool removeEmptyBo
if (mat) {
if (materials_converted.find(mat) == materials_converted.end()) {
ConvertMaterial(*mat, 0);
ConvertMaterial(*mat, nullptr);
}
}
}
@ -873,8 +873,12 @@ void FBXConverter::SetupNodeMetadata(const Model &model, aiNode &nd) {
data->Set(index++, prop.first, interpretedBool->Value());
} else if (const TypedProperty<int> *interpretedInt = prop.second->As<TypedProperty<int>>()) {
data->Set(index++, prop.first, interpretedInt->Value());
} else if (const TypedProperty<uint32_t> *interpretedUInt = prop.second->As<TypedProperty<uint32_t>>()) {
data->Set(index++, prop.first, interpretedUInt->Value());
} else if (const TypedProperty<uint64_t> *interpretedUint64 = prop.second->As<TypedProperty<uint64_t>>()) {
data->Set(index++, prop.first, interpretedUint64->Value());
} else if (const TypedProperty<int64_t> *interpretedint64 = prop.second->As<TypedProperty<int64_t>>()) {
data->Set(index++, prop.first, interpretedint64->Value());
} else if (const TypedProperty<float> *interpretedFloat = prop.second->As<TypedProperty<float>>()) {
data->Set(index++, prop.first, interpretedFloat->Value());
} else if (const TypedProperty<std::string> *interpretedString = prop.second->As<TypedProperty<std::string>>()) {
@ -1176,15 +1180,23 @@ unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry &mesh, c
std::vector<aiAnimMesh *> animMeshes;
for (const BlendShape *blendShape : mesh.GetBlendShapes()) {
for (const BlendShapeChannel *blendShapeChannel : blendShape->BlendShapeChannels()) {
const std::vector<const ShapeGeometry *> &shapeGeometries = blendShapeChannel->GetShapeGeometries();
for (size_t i = 0; i < shapeGeometries.size(); i++) {
const auto& shapeGeometries = blendShapeChannel->GetShapeGeometries();
for (const ShapeGeometry *shapeGeometry : shapeGeometries) {
aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh);
const ShapeGeometry *shapeGeometry = shapeGeometries.at(i);
const std::vector<aiVector3D> &curVertices = shapeGeometry->GetVertices();
const std::vector<aiVector3D> &curNormals = shapeGeometry->GetNormals();
const std::vector<unsigned int> &curIndices = shapeGeometry->GetIndices();
const auto &curVertices = shapeGeometry->GetVertices();
const auto &curNormals = shapeGeometry->GetNormals();
const auto &curIndices = shapeGeometry->GetIndices();
//losing channel name if using shapeGeometry->Name()
animMesh->mName.Set(FixAnimMeshName(blendShapeChannel->Name()));
// if blendShapeChannel Name is empty or don't have a ".", add geoMetryName;
auto aniName = FixAnimMeshName(blendShapeChannel->Name());
auto geoMetryName = FixAnimMeshName(shapeGeometry->Name());
if (aniName.empty()) {
aniName = geoMetryName;
}
else if (aniName.find('.') == aniName.npos) {
aniName += "." + geoMetryName;
}
animMesh->mName.Set(aniName);
for (size_t j = 0; j < curIndices.size(); j++) {
const unsigned int curIndex = curIndices.at(j);
aiVector3D vertex = curVertices.at(j);
@ -1406,13 +1418,12 @@ unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry &mesh, co
std::vector<aiAnimMesh *> animMeshes;
for (const BlendShape *blendShape : mesh.GetBlendShapes()) {
for (const BlendShapeChannel *blendShapeChannel : blendShape->BlendShapeChannels()) {
const std::vector<const ShapeGeometry *> &shapeGeometries = blendShapeChannel->GetShapeGeometries();
for (size_t i = 0; i < shapeGeometries.size(); i++) {
const auto& shapeGeometries = blendShapeChannel->GetShapeGeometries();
for (const ShapeGeometry *shapeGeometry : shapeGeometries) {
aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh);
const ShapeGeometry *shapeGeometry = shapeGeometries.at(i);
const std::vector<aiVector3D> &curVertices = shapeGeometry->GetVertices();
const std::vector<aiVector3D> &curNormals = shapeGeometry->GetNormals();
const std::vector<unsigned int> &curIndices = shapeGeometry->GetIndices();
const auto& curVertices = shapeGeometry->GetVertices();
const auto& curNormals = shapeGeometry->GetNormals();
const auto& curIndices = shapeGeometry->GetIndices();
animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name()));
for (size_t j = 0; j < curIndices.size(); j++) {
unsigned int curIndex = curIndices.at(j);
@ -1455,7 +1466,9 @@ static void copyBoneToSkeletonBone(aiMesh *mesh, aiBone *bone, aiSkeletonBone *s
skeletonBone->mWeights = bone->mWeights;
skeletonBone->mOffsetMatrix = bone->mOffsetMatrix;
skeletonBone->mMeshId = mesh;
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
skeletonBone->mNode = bone->mNode;
#endif
skeletonBone->mParent = -1;
}

View File

@ -154,8 +154,10 @@ BlendShape::BlendShape(uint64_t id, const Element& element, const Document& doc,
for (const Connection* con : conns) {
const BlendShapeChannel* const bspc = ProcessSimpleConnection<BlendShapeChannel>(*con, false, "BlendShapeChannel -> BlendShape", element);
if (bspc) {
blendShapeChannels.push_back(bspc);
continue;
auto pr = blendShapeChannels.insert(bspc);
if (!pr.second) {
FBXImporter::LogWarn("there is the same blendShapeChannel id ", bspc->ID());
}
}
}
}
@ -179,8 +181,10 @@ BlendShapeChannel::BlendShapeChannel(uint64_t id, const Element& element, const
for (const Connection* con : conns) {
const ShapeGeometry* const sg = ProcessSimpleConnection<ShapeGeometry>(*con, false, "Shape -> BlendShapeChannel", element);
if (sg) {
shapeGeometries.push_back(sg);
continue;
auto pr = shapeGeometries.insert(sg);
if (!pr.second) {
FBXImporter::LogWarn("there is the same shapeGeometrie id ", sg->ID());
}
}
}
}

View File

@ -78,7 +78,7 @@ const Object* LazyObject::Get(bool dieOnError) {
return nullptr;
}
if (object.get()) {
if (object) {
return object.get();
}
@ -222,7 +222,7 @@ const Object* LazyObject::Get(bool dieOnError) {
return nullptr;
}
if (!object.get()) {
if (!object) {
//DOMError("failed to convert element to DOM object, class: " + classtag + ", name: " + name,&element);
}
@ -381,8 +381,10 @@ void Document::ReadObjects() {
DOMError("encountered object with implicitly defined id 0",el.second);
}
if(objects.find(id) != objects.end()) {
const auto foundObject = objects.find(id);
if(foundObject != objects.end()) {
DOMWarning("encountered duplicate object id, ignoring first occurrence",el.second);
delete foundObject->second;
}
objects[id] = new LazyObject(id, *el.second, *this);

View File

@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define INCLUDED_AI_FBX_DOCUMENT_H
#include <numeric>
#include <unordered_set>
#include <stdint.h>
#include <assimp/mesh.h>
#include "FBXProperties.h"
@ -168,7 +169,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
private:
@ -432,7 +433,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
/** Get material links */
@ -503,7 +504,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
// return a 4-tuple
@ -618,7 +619,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
const uint8_t* Content() const {
@ -632,7 +633,7 @@ public:
uint8_t* RelinquishContent() {
uint8_t* ptr = content;
content = 0;
content = nullptr;
return ptr;
}
@ -663,7 +664,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
const TextureMap& Textures() const {
@ -735,7 +736,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
@ -780,7 +781,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
/* the optional white list specifies a list of property names for which the caller
@ -808,7 +809,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
const AnimationLayerList& Layers() const {
@ -829,7 +830,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
private:
@ -855,14 +856,14 @@ public:
return fullWeights;
}
const std::vector<const ShapeGeometry*>& GetShapeGeometries() const {
const std::unordered_set<const ShapeGeometry*>& GetShapeGeometries() const {
return shapeGeometries;
}
private:
float percent;
WeightArray fullWeights;
std::vector<const ShapeGeometry*> shapeGeometries;
std::unordered_set<const ShapeGeometry*> shapeGeometries;
};
/** DOM class for BlendShape deformers */
@ -872,12 +873,12 @@ public:
virtual ~BlendShape();
const std::vector<const BlendShapeChannel*>& BlendShapeChannels() const {
const std::unordered_set<const BlendShapeChannel*>& BlendShapeChannels() const {
return blendShapeChannels;
}
private:
std::vector<const BlendShapeChannel*> blendShapeChannels;
std::unordered_set<const BlendShapeChannel*> blendShapeChannels;
};
/** DOM class for skin deformer clusters (aka sub-deformers) */
@ -1018,7 +1019,7 @@ public:
const PropertyTable& Props() const {
ai_assert(props.get());
return *props.get();
return *props;
}
const Document& GetDocument() const {
@ -1097,7 +1098,7 @@ public:
const FileGlobalSettings& GlobalSettings() const {
ai_assert(globals.get());
return *globals.get();
return *globals;
}
const PropertyTemplateMap& Templates() const {

View File

@ -58,12 +58,11 @@ namespace Util {
/* DOM/Parse error reporting - does not return */
AI_WONT_RETURN void DOMError(const std::string& message, const Token& token) AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void DOMError(const std::string& message, const Element* element = NULL) AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void DOMError(const std::string &message, const Element *element = nullptr) AI_WONT_RETURN_SUFFIX;
// does return
void DOMWarning(const std::string& message, const Token& token);
void DOMWarning(const std::string& message, const Element* element = NULL);
void DOMWarning(const std::string &message, const Element *element = nullptr);
// fetch a property table and the corresponding property template
std::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,

View File

@ -360,7 +360,7 @@ void FBX::Node::EndBinary(
bool has_children
) {
// if there were children, add a null record
if (has_children) { s.PutString(Assimp::FBX::NULL_RECORD); }
if (has_children) { s.PutString(Assimp::FBX::NULL_RECORD_STRING); }
// now go back and write initial pos
this->end_pos = s.Tell();

View File

@ -77,8 +77,6 @@ public: // constructors
/// The class constructor with the name.
Node(const std::string& n)
: name(n)
, properties()
, children()
, force_has_children( false ) {
// empty
}
@ -87,8 +85,6 @@ public: // constructors
template <typename... More>
Node(const std::string& n, More&&... more)
: name(n)
, properties()
, children()
, force_has_children(false) {
AddProperties(std::forward<More>(more)...);
}

View File

@ -681,9 +681,9 @@ void FBXExporter::WriteDefinitions ()
pt = FBX::Node("PropertyTemplate", "FBXAnimLayer");
p = FBX::Node("Properties70");
p.AddP70("Weight", "Number", "", "A", double(100));
p.AddP70bool("Mute", 0);
p.AddP70bool("Solo", 0);
p.AddP70bool("Lock", 0);
p.AddP70bool("Mute", false);
p.AddP70bool("Solo", false);
p.AddP70bool("Lock", false);
p.AddP70color("Color", 0.8, 0.8, 0.8);
p.AddP70("BlendMode", "enum", "", "", int32_t(0));
p.AddP70("RotationAccumulationMode", "enum", "", "", int32_t(0));
@ -733,42 +733,42 @@ void FBXExporter::WriteDefinitions ()
p.AddP70vector("RotationPivot", 0.0, 0.0, 0.0);
p.AddP70vector("ScalingOffset", 0.0, 0.0, 0.0);
p.AddP70vector("ScalingPivot", 0.0, 0.0, 0.0);
p.AddP70bool("TranslationActive", 0);
p.AddP70bool("TranslationActive", false);
p.AddP70vector("TranslationMin", 0.0, 0.0, 0.0);
p.AddP70vector("TranslationMax", 0.0, 0.0, 0.0);
p.AddP70bool("TranslationMinX", 0);
p.AddP70bool("TranslationMinY", 0);
p.AddP70bool("TranslationMinZ", 0);
p.AddP70bool("TranslationMaxX", 0);
p.AddP70bool("TranslationMaxY", 0);
p.AddP70bool("TranslationMaxZ", 0);
p.AddP70bool("TranslationMinX", false);
p.AddP70bool("TranslationMinY", false);
p.AddP70bool("TranslationMinZ", false);
p.AddP70bool("TranslationMaxX", false);
p.AddP70bool("TranslationMaxY", false);
p.AddP70bool("TranslationMaxZ", false);
p.AddP70enum("RotationOrder", 0);
p.AddP70bool("RotationSpaceForLimitOnly", 0);
p.AddP70bool("RotationSpaceForLimitOnly", false);
p.AddP70double("RotationStiffnessX", 0.0);
p.AddP70double("RotationStiffnessY", 0.0);
p.AddP70double("RotationStiffnessZ", 0.0);
p.AddP70double("AxisLen", 10.0);
p.AddP70vector("PreRotation", 0.0, 0.0, 0.0);
p.AddP70vector("PostRotation", 0.0, 0.0, 0.0);
p.AddP70bool("RotationActive", 0);
p.AddP70bool("RotationActive", false);
p.AddP70vector("RotationMin", 0.0, 0.0, 0.0);
p.AddP70vector("RotationMax", 0.0, 0.0, 0.0);
p.AddP70bool("RotationMinX", 0);
p.AddP70bool("RotationMinY", 0);
p.AddP70bool("RotationMinZ", 0);
p.AddP70bool("RotationMaxX", 0);
p.AddP70bool("RotationMaxY", 0);
p.AddP70bool("RotationMaxZ", 0);
p.AddP70bool("RotationMinX", false);
p.AddP70bool("RotationMinY", false);
p.AddP70bool("RotationMinZ", false);
p.AddP70bool("RotationMaxX", false);
p.AddP70bool("RotationMaxY", false);
p.AddP70bool("RotationMaxZ", false);
p.AddP70enum("InheritType", 0);
p.AddP70bool("ScalingActive", 0);
p.AddP70bool("ScalingActive", false);
p.AddP70vector("ScalingMin", 0.0, 0.0, 0.0);
p.AddP70vector("ScalingMax", 1.0, 1.0, 1.0);
p.AddP70bool("ScalingMinX", 0);
p.AddP70bool("ScalingMinY", 0);
p.AddP70bool("ScalingMinZ", 0);
p.AddP70bool("ScalingMaxX", 0);
p.AddP70bool("ScalingMaxY", 0);
p.AddP70bool("ScalingMaxZ", 0);
p.AddP70bool("ScalingMinX", false);
p.AddP70bool("ScalingMinY", false);
p.AddP70bool("ScalingMinZ", false);
p.AddP70bool("ScalingMaxX", false);
p.AddP70bool("ScalingMaxY", false);
p.AddP70bool("ScalingMaxZ", false);
p.AddP70vector("GeometricTranslation", 0.0, 0.0, 0.0);
p.AddP70vector("GeometricRotation", 0.0, 0.0, 0.0);
p.AddP70vector("GeometricScaling", 1.0, 1.0, 1.0);
@ -789,11 +789,11 @@ void FBXExporter::WriteDefinitions ()
p.AddP70double("PreferedAngleZ", 0.0);
p.AddP70("LookAtProperty", "object", "", "");
p.AddP70("UpVectorProperty", "object", "", "");
p.AddP70bool("Show", 1);
p.AddP70bool("NegativePercentShapeSupport", 1);
p.AddP70bool("Show", true);
p.AddP70bool("NegativePercentShapeSupport", true);
p.AddP70int("DefaultAttributeIndex", -1);
p.AddP70bool("Freeze", 0);
p.AddP70bool("LODBox", 0);
p.AddP70bool("Freeze", false);
p.AddP70bool("LODBox", false);
p.AddP70(
"Lcl Translation", "Lcl Translation", "", "A",
double(0), double(0), double(0)
@ -840,9 +840,9 @@ void FBXExporter::WriteDefinitions ()
p.AddP70color("Color", 0, 0, 0);
p.AddP70vector("BBoxMin", 0, 0, 0);
p.AddP70vector("BBoxMax", 0, 0, 0);
p.AddP70bool("Primary Visibility", 1);
p.AddP70bool("Casts Shadows", 1);
p.AddP70bool("Receive Shadows", 1);
p.AddP70bool("Primary Visibility", true);
p.AddP70bool("Casts Shadows", true);
p.AddP70bool("Receive Shadows", true);
pt.AddChild(p);
n.AddChild(pt);
object_nodes.push_back(n);
@ -873,7 +873,7 @@ void FBXExporter::WriteDefinitions ()
} else {
p.AddP70string("ShadingModel", "Lambert");
}
p.AddP70bool("MultiLayer", 0);
p.AddP70bool("MultiLayer", false);
p.AddP70colorA("EmissiveColor", 0.0, 0.0, 0.0);
p.AddP70numberA("EmissiveFactor", 1.0);
p.AddP70colorA("AmbientColor", 0.2, 0.2, 0.2);
@ -910,7 +910,7 @@ void FBXExporter::WriteDefinitions ()
n.AddChild("Count", count);
pt = FBX::Node("PropertyTemplate", "FbxVideo");
p = FBX::Node("Properties70");
p.AddP70bool("ImageSequence", 0);
p.AddP70bool("ImageSequence", false);
p.AddP70int("ImageSequenceOffset", 0);
p.AddP70double("FrameRate", 0.0);
p.AddP70int("LastFrame", 0);
@ -922,8 +922,8 @@ void FBXExporter::WriteDefinitions ()
p.AddP70double("PlaySpeed", 0.0);
p.AddP70time("Offset", 0);
p.AddP70enum("InterlaceMode", 0);
p.AddP70bool("FreeRunning", 0);
p.AddP70bool("Loop", 0);
p.AddP70bool("FreeRunning", false);
p.AddP70bool("Loop", false);
p.AddP70enum("AccessMode", 0);
pt.AddChild(p);
n.AddChild(pt);
@ -944,8 +944,8 @@ void FBXExporter::WriteDefinitions ()
p.AddP70enum("CurrentMappingType", 0);
p.AddP70enum("WrapModeU", 0);
p.AddP70enum("WrapModeV", 0);
p.AddP70bool("UVSwap", 0);
p.AddP70bool("PremultiplyAlpha", 1);
p.AddP70bool("UVSwap", false);
p.AddP70bool("PremultiplyAlpha", true);
p.AddP70vectorA("Translation", 0.0, 0.0, 0.0);
p.AddP70vectorA("Rotation", 0.0, 0.0, 0.0);
p.AddP70vectorA("Scaling", 1.0, 1.0, 1.0);
@ -953,8 +953,8 @@ void FBXExporter::WriteDefinitions ()
p.AddP70vector("TextureScalingPivot", 0.0, 0.0, 0.0);
p.AddP70enum("CurrentTextureBlendMode", 1);
p.AddP70string("UVSet", "default");
p.AddP70bool("UseMaterial", 0);
p.AddP70bool("UseMipMap", 0);
p.AddP70bool("UseMaterial", false);
p.AddP70bool("UseMipMap", false);
pt.AddChild(p);
n.AddChild(pt);
object_nodes.push_back(n);
@ -1708,7 +1708,7 @@ void FBXExporter::WriteObjects ()
p.AddP70vectorA("Scaling", trafo.mScaling[0], trafo.mScaling[1], 0.0);
p.AddP70enum("CurrentTextureBlendMode", 0); // TODO: verify
//p.AddP70string("UVSet", ""); // TODO: how should this work?
p.AddP70bool("UseMaterial", 1);
p.AddP70bool("UseMaterial", true);
tnode.AddChild(p);
// can't easily determine which texture path will be correct,
// so just store what we have in every field.
@ -2501,7 +2501,7 @@ void FBXExporter::WriteModelNode(
m.AddProperties(node_uid, std::move(name), type);
m.AddChild("Version", int32_t(232));
FBX::Node p("Properties70");
p.AddP70bool("RotationActive", 1);
p.AddP70bool("RotationActive", true);
p.AddP70int("DefaultAttributeIndex", 0);
p.AddP70enum("InheritType", inherit_type);
if (transform_chain.empty()) {

View File

@ -62,8 +62,7 @@ namespace Assimp {
template <>
const char *LogFunctions<FBXImporter>::Prefix() {
static auto prefix = "FBX: ";
return prefix;
return "FBX: ";
}
} // namespace Assimp
@ -90,10 +89,7 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by #Importer
FBXImporter::FBXImporter() :
mSettings() {
// empty
}
FBXImporter::FBXImporter() = default;
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.

View File

@ -292,10 +292,10 @@ void LayeredTexture::fillTexture(const Document& doc) {
}
// ------------------------------------------------------------------------------------------------
Video::Video(uint64_t id, const Element& element, const Document& doc, const std::string& name) :
Object(id,element,name),
Video::Video(uint64_t id, const Element &element, const Document &doc, const std::string &name) :
Object(id, element, name),
contentLength(0),
content(0) {
content(nullptr) {
const Scope& sc = GetRequiredScope(element);
const Element* const Type = sc["Type"];
@ -380,7 +380,6 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std
props = GetPropertyTable(doc,"Video.FbxVideo",element,sc);
}
Video::~Video() {
delete[] content;
}

View File

@ -69,13 +69,16 @@ Geometry::Geometry(uint64_t id, const Element& element, const std::string& name,
}
const BlendShape* const bsp = ProcessSimpleConnection<BlendShape>(*con, false, "BlendShape -> Geometry", element);
if (bsp) {
blendShapes.push_back(bsp);
auto pr = blendShapes.insert(bsp);
if (!pr.second) {
FBXImporter::LogWarn("there is the same blendShape id ", bsp->ID());
}
}
}
}
// ------------------------------------------------------------------------------------------------
const std::vector<const BlendShape*>& Geometry::GetBlendShapes() const {
const std::unordered_set<const BlendShape*>& Geometry::GetBlendShapes() const {
return blendShapes;
}

View File

@ -2,8 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2022, assimp team
Copyright (c) 2006-2023, assimp team
All rights reserved.
@ -53,84 +52,101 @@ namespace Assimp {
namespace FBX {
/**
* DOM base class for all kinds of FBX geometry
* @brief DOM base class for all kinds of FBX geometry
*/
class Geometry : public Object {
public:
/// @brief The class constructor with all parameters.
/// @param id The id.
/// @param element
/// @param name
/// @param doc
/// @param element The element instance
/// @param name The name instance
/// @param doc The document instance
Geometry( uint64_t id, const Element& element, const std::string& name, const Document& doc );
/// @brief The class destructor, default.
virtual ~Geometry() = default;
/// Get the Skin attached to this geometry or nullptr
/// @brief Get the Skin attached to this geometry or nullptr.
/// @return The deformer skip instance as a pointer, nullptr if none.
const Skin* DeformerSkin() const;
/// Get the BlendShape attached to this geometry or nullptr
const std::vector<const BlendShape*>& GetBlendShapes() const;
/// @brief Get the BlendShape attached to this geometry or nullptr
/// @return The blendshape arrays.
const std::unordered_set<const BlendShape*>& GetBlendShapes() const;
private:
const Skin* skin;
std::vector<const BlendShape*> blendShapes;
std::unordered_set<const BlendShape*> blendShapes;
};
typedef std::vector<int> MatIndexArray;
/**
* DOM class for FBX geometry of type "Mesh"
* @brief DOM class for FBX geometry of type "Mesh"
*/
class MeshGeometry : public Geometry {
public:
/** The class constructor */
/// @brief The class constructor
/// @param id The id.
/// @param element The element instance
/// @param name The name instance
/// @param doc The document instance
MeshGeometry( uint64_t id, const Element& element, const std::string& name, const Document& doc );
/** The class destructor */
/// @brief The class destructor, default.
virtual ~MeshGeometry() = default;
/** Get a list of all vertex points, non-unique*/
/// brief Get a vector of all vertex points, non-unique.
/// @return The vertices vector.
const std::vector<aiVector3D>& GetVertices() const;
/** Get a list of all vertex normals or an empty array if
* no normals are specified. */
/// @brief Get a vector of all vertex normals or an empty array if no normals are specified.
/// @return The normal vector.
const std::vector<aiVector3D>& GetNormals() const;
/** Get a list of all vertex tangents or an empty array
* if no tangents are specified */
/// @brief Get a vector of all vertex tangents or an empty array if no tangents are specified.
/// @return The vertex tangents vector.
const std::vector<aiVector3D>& GetTangents() const;
/** Get a list of all vertex bi-normals or an empty array
* if no bi-normals are specified */
/// @brief Get a vector of all vertex bi-normals or an empty array if no bi-normals are specified.
/// @return The binomal vector.
const std::vector<aiVector3D>& GetBinormals() const;
/** Return list of faces - each entry denotes a face and specifies
* how many vertices it has. Vertices are taken from the
* vertex data arrays in sequential order. */
/// @brief Return list of faces - each entry denotes a face and specifies how many vertices it has.
/// Vertices are taken from the vertex data arrays in sequential order.
/// @return The face indices vector.
const std::vector<unsigned int>& GetFaceIndexCounts() const;
/** Get a UV coordinate slot, returns an empty array if
* the requested slot does not exist. */
/// @brief Get a UV coordinate slot, returns an empty array if the requested slot does not exist.
/// @param index The requested texture coordinate slot.
/// @return The texture coordinates.
const std::vector<aiVector2D>& GetTextureCoords( unsigned int index ) const;
/** Get a UV coordinate slot, returns an empty array if
* the requested slot does not exist. */
/// @brief Get a UV coordinate slot, returns an empty array if the requested slot does not exist.
/// @param index The requested texture coordinate slot.
/// @return The texture coordinate channel name.
std::string GetTextureCoordChannelName( unsigned int index ) const;
/** Get a vertex color coordinate slot, returns an empty array if
* the requested slot does not exist. */
/// @brief Get a vertex color coordinate slot, returns an empty array if the requested slot does not exist.
/// @param index The requested texture coordinate slot.
/// @return The vertex color vector.
const std::vector<aiColor4D>& GetVertexColors( unsigned int index ) const;
/** Get per-face-vertex material assignments */
/// @brief Get per-face-vertex material assignments.
/// @return The Material indices Array.
const MatIndexArray& GetMaterialIndices() const;
/** Convert from a fbx file vertex index (for example from a #Cluster weight) or nullptr
* if the vertex index is not valid. */
/// @brief Convert from a fbx file vertex index (for example from a #Cluster weight) or nullptr if the vertex index is not valid.
/// @param in_index The requested input index.
/// @param count The number of indices.
/// @return The indices.
const unsigned int* ToOutputVertexIndex( unsigned int in_index, unsigned int& count ) const;
/** Determine the face to which a particular output vertex index belongs.
* This mapping is always unique. */
/// @brief Determine the face to which a particular output vertex index belongs.
/// This mapping is always unique.
/// @param in_index The requested input index.
/// @return The face-to-vertex index.
unsigned int FaceForVertexIndex( unsigned int in_index ) const;
private:

View File

@ -163,7 +163,7 @@ public:
~Parser() = default;
const Scope& GetRootScope() const {
return *root.get();
return *root;
}
bool IsBinary() const {

View File

@ -154,7 +154,6 @@ private:
const unsigned int column;
};
// XXX should use C++11's unique_ptr - but assimp's need to keep working with 03
typedef const Token* TokenPtr;
typedef std::vector< TokenPtr > TokenList;

View File

@ -104,7 +104,7 @@ void HMPImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(mIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open HMP file ", pFile, ".");
}

View File

@ -388,8 +388,8 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPoly
n.Normalize();
// obtain the polygonal bounding volume
std::shared_ptr<TempMesh> profile = std::shared_ptr<TempMesh>(new TempMesh());
if (!ProcessCurve(hs->PolygonalBoundary, *profile.get(), conv)) {
std::shared_ptr<TempMesh> profile = std::make_shared<TempMesh>();
if (!ProcessCurve(hs->PolygonalBoundary, *profile, conv)) {
IFCImporter::LogError("expected valid polyline for boundary of boolean halfspace");
return;
}
@ -672,7 +672,7 @@ void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedArea
// operand should be near-planar. Luckily, this is usually the case in Ifc
// buildings.
std::shared_ptr<TempMesh> meshtmp = std::shared_ptr<TempMesh>(new TempMesh());
std::shared_ptr<TempMesh> meshtmp = std::make_shared<TempMesh>();
ProcessExtrudedAreaSolid(*as, *meshtmp, conv, false);
std::vector<TempOpening> openings(1, TempOpening(as, IfcVector3(0, 0, 0), std::move(meshtmp), std::shared_ptr<TempMesh>()));

View File

@ -610,7 +610,7 @@ void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const Te
nors.reserve(conv.apply_openings->size());
for(TempOpening& t : *conv.apply_openings) {
TempMesh& bounds = *t.profileMesh.get();
TempMesh &bounds = *t.profileMesh;
if( bounds.mVerts.size() <= 2 ) {
nors.emplace_back();
@ -787,7 +787,7 @@ bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned
const ::Assimp::STEP::EXPRESS::ENTITY& e = shell->To<::Assimp::STEP::EXPRESS::ENTITY>();
const Schema_2x3::IfcConnectedFaceSet& fs = conv.db.MustGetObject(e).To<Schema_2x3::IfcConnectedFaceSet>();
ProcessConnectedFaceSet(fs,*meshtmp.get(),conv);
ProcessConnectedFaceSet(fs, *meshtmp, conv);
}
catch(std::bad_cast&) {
IFCImporter::LogWarn("unexpected type error, IfcShell ought to inherit from IfcConnectedFaceSet");
@ -796,27 +796,27 @@ bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned
fix_orientation = true;
}
else if(const Schema_2x3::IfcConnectedFaceSet* fset = geo.ToPtr<Schema_2x3::IfcConnectedFaceSet>()) {
ProcessConnectedFaceSet(*fset,*meshtmp.get(),conv);
ProcessConnectedFaceSet(*fset, *meshtmp, conv);
fix_orientation = true;
}
else if(const Schema_2x3::IfcSweptAreaSolid* swept = geo.ToPtr<Schema_2x3::IfcSweptAreaSolid>()) {
ProcessSweptAreaSolid(*swept,*meshtmp.get(),conv);
ProcessSweptAreaSolid(*swept, *meshtmp, conv);
}
else if(const Schema_2x3::IfcSweptDiskSolid* disk = geo.ToPtr<Schema_2x3::IfcSweptDiskSolid>()) {
ProcessSweptDiskSolid(*disk,*meshtmp.get(),conv);
ProcessSweptDiskSolid(*disk, *meshtmp, conv);
}
else if(const Schema_2x3::IfcManifoldSolidBrep* brep = geo.ToPtr<Schema_2x3::IfcManifoldSolidBrep>()) {
ProcessConnectedFaceSet(brep->Outer,*meshtmp.get(),conv);
ProcessConnectedFaceSet(brep->Outer, *meshtmp, conv);
fix_orientation = true;
}
else if(const Schema_2x3::IfcFaceBasedSurfaceModel* surf = geo.ToPtr<Schema_2x3::IfcFaceBasedSurfaceModel>()) {
for(const Schema_2x3::IfcConnectedFaceSet& fc : surf->FbsmFaces) {
ProcessConnectedFaceSet(fc,*meshtmp.get(),conv);
ProcessConnectedFaceSet(fc, *meshtmp, conv);
}
fix_orientation = true;
}
else if(const Schema_2x3::IfcBooleanResult* boolean = geo.ToPtr<Schema_2x3::IfcBooleanResult>()) {
ProcessBoolean(*boolean,*meshtmp.get(),conv);
ProcessBoolean(*boolean, *meshtmp, conv);
}
else if(geo.ToPtr<Schema_2x3::IfcBoundingBox>()) {
// silently skip over bounding boxes

View File

@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <iterator>
#include <limits>
#include <memory>
#include <tuple>
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
@ -72,8 +73,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
template <>
const char *LogFunctions<IFCImporter>::Prefix() {
static auto prefix = "IFC: ";
return prefix;
return "IFC: ";
}
} // namespace Assimp
@ -186,7 +186,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// get file size, etc.
unz_file_info fileInfo;
char filename[256];
unzGetCurrentFileInfo(zip, &fileInfo, filename, sizeof(filename), 0, 0, 0, 0);
unzGetCurrentFileInfo(zip, &fileInfo, filename, sizeof(filename), nullptr, 0, nullptr, 0);
if (GetExtension(filename) != "ifc") {
continue;
}
@ -211,7 +211,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
ThrowException("Failed to decompress IFC ZIP file");
}
unzCloseCurrentFile(zip);
stream.reset(new MemoryIOStream(buff, fileInfo.uncompressed_size, true));
stream = std::make_shared<MemoryIOStream>(buff, fileInfo.uncompressed_size, true);
if (unzGoToNextFile(zip) == UNZ_END_OF_LIST_OF_FILE) {
ThrowException("Found no IFC file member in IFCZIP file (1)");
}

View File

@ -1065,27 +1065,27 @@ template <> size_t GenericFill<IfcRoot>(const DB& db, const LIST& params, IfcRoo
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->GlobalId, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRoot to be a `IfcGloballyUniqueId`")); }
} while(0);
} while (false);
do { // convert the 'OwnerHistory' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->OwnerHistory, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRoot to be a `IfcOwnerHistory`")); }
} while(0);
} while (false);
do { // convert the 'Name' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[2]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRoot to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'Description' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[3]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Description, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRoot to be a `IfcText`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1152,27 +1152,27 @@ template <> size_t GenericFill<IfcRepresentation>(const DB& db, const LIST& para
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->ContextOfItems, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentation to be a `IfcRepresentationContext`")); }
} while(0);
} while (false);
do { // convert the 'RepresentationIdentifier' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RepresentationIdentifier, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentation to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'RepresentationType' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[2]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RepresentationType, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRepresentation to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'Items' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[3]=true; break; }
try { GenericConvert( in->Items, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRepresentation to be a `SET [1:?] OF IfcRepresentationItem`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1239,7 +1239,7 @@ template <> size_t GenericFill<IfcObject>(const DB& db, const LIST& params, IfcO
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ObjectType, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcObject to be a `IfcLabel`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1292,20 +1292,20 @@ template <> size_t GenericFill<IfcProductRepresentation>(const DB& db, const LIS
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProductRepresentation to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'Description' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProductRepresentation,3>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Description, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProductRepresentation to be a `IfcText`")); }
} while(0);
} while (false);
do { // convert the 'Representations' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProductRepresentation,3>::aux_is_derived[2]=true; break; }
try { GenericConvert( in->Representations, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcProductRepresentation to be a `LIST [1:?] OF IfcRepresentation`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1318,14 +1318,14 @@ template <> size_t GenericFill<IfcProduct>(const DB& db, const LIST& params, Ifc
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ObjectPlacement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProduct to be a `IfcObjectPlacement`")); }
} while(0);
} while (false);
do { // convert the 'Representation' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProduct,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Representation, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProduct to be a `IfcProductRepresentation`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1338,7 +1338,7 @@ template <> size_t GenericFill<IfcElement>(const DB& db, const LIST& params, Ifc
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Tag, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcElement to be a `IfcIdentifier`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1376,13 +1376,13 @@ template <> size_t GenericFill<IfcCompositeCurve>(const DB& db, const LIST& para
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCompositeCurve,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Segments, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurve to be a `LIST [1:?] OF IfcCompositeCurveSegment`")); }
} while(0);
} while (false);
do { // convert the 'SelfIntersect' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCompositeCurve,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->SelfIntersect, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurve to be a `LOGICAL`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1402,27 +1402,27 @@ template <> size_t GenericFill<IfcCartesianTransformationOperator>(const DB& db,
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis1, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianTransformationOperator to be a `IfcDirection`")); }
} while(0);
} while (false);
do { // convert the 'Axis2' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis2, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCartesianTransformationOperator to be a `IfcDirection`")); }
} while(0);
} while (false);
do { // convert the 'LocalOrigin' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[2]=true; break; }
try { GenericConvert( in->LocalOrigin, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCartesianTransformationOperator to be a `IfcCartesianPoint`")); }
} while(0);
} while (false);
do { // convert the 'Scale' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[3]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Scale, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCartesianTransformationOperator to be a `REAL`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1435,7 +1435,7 @@ template <> size_t GenericFill<IfcCartesianTransformationOperator3D>(const DB& d
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis3, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCartesianTransformationOperator3D to be a `IfcDirection`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1447,14 +1447,14 @@ template <> size_t GenericFill<IfcProperty>(const DB& db, const LIST& params, If
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProperty,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProperty to be a `IfcIdentifier`")); }
} while(0);
} while (false);
do { // convert the 'Description' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProperty,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Description, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProperty to be a `IfcText`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1499,7 +1499,7 @@ template <> size_t GenericFill<IfcElementarySurface>(const DB& db, const LIST& p
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcElementarySurface,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Position, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcElementarySurface to be a `IfcAxis2Placement3D`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1517,19 +1517,19 @@ template <> size_t GenericFill<IfcBooleanResult>(const DB& db, const LIST& param
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBooleanResult,3>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Operator, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBooleanResult to be a `IfcBooleanOperator`")); }
} while(0);
} while (false);
do { // convert the 'FirstOperand' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBooleanResult,3>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->FirstOperand, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBooleanResult to be a `IfcBooleanOperand`")); }
} while(0);
} while (false);
do { // convert the 'SecondOperand' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBooleanResult,3>::aux_is_derived[2]=true; break; }
try { GenericConvert( in->SecondOperand, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBooleanResult to be a `IfcBooleanOperand`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1553,7 +1553,7 @@ template <> size_t GenericFill<IfcManifoldSolidBrep>(const DB& db, const LIST& p
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcManifoldSolidBrep,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Outer, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcManifoldSolidBrep to be a `IfcClosedShell`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1632,12 +1632,12 @@ template <> size_t GenericFill<IfcRelFillsElement>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelFillsElement to be a `IfcOpeningElement`")); }
} while(0);
} while (false);
do { // convert the 'RelatedBuildingElement' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelFillsElement to be a `IfcElement`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1683,12 +1683,12 @@ template <> size_t GenericFill<IfcRelContainedInSpatialStructure>(const DB& db,
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatedElements, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelContainedInSpatialStructure to be a `SET [1:?] OF IfcProduct`")); }
} while(0);
} while (false);
do { // convert the 'RelatingStructure' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatingStructure, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelContainedInSpatialStructure to be a `IfcSpatialStructureElement`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1774,7 +1774,7 @@ template <> size_t GenericFill<IfcDirection>(const DB& db, const LIST& params, I
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->DirectionRatios, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcDirection to be a `LIST [2:3] OF REAL`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1786,14 +1786,14 @@ template <> size_t GenericFill<IfcProfileDef>(const DB& db, const LIST& params,
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProfileDef,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->ProfileType, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProfileDef to be a `IfcProfileTypeEnum`")); }
} while(0);
} while (false);
do { // convert the 'ProfileName' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProfileDef,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ProfileName, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProfileDef to be a `IfcLabel`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1805,7 +1805,7 @@ template <> size_t GenericFill<IfcParameterizedProfileDef>(const DB& db, const L
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcParameterizedProfileDef,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Position, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcParameterizedProfileDef to be a `IfcAxis2Placement2D`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1912,7 +1912,7 @@ template <> size_t GenericFill<IfcCircleProfileDef>(const DB& db, const LIST& pa
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCircleProfileDef,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Radius, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCircleProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1923,7 +1923,7 @@ template <> size_t GenericFill<IfcCircleHollowProfileDef>(const DB& db, const LI
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->WallThickness, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCircleHollowProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1935,7 +1935,7 @@ template <> size_t GenericFill<IfcPlacement>(const DB& db, const LIST& params, I
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcPlacement,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Location, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPlacement to be a `IfcCartesianPoint`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1947,13 +1947,13 @@ template <> size_t GenericFill<IfcAxis2Placement3D>(const DB& db, const LIST& pa
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement3D to be a `IfcDirection`")); }
} while(0);
} while (false);
do { // convert the 'RefDirection' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefDirection, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcAxis2Placement3D to be a `IfcDirection`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1966,7 +1966,7 @@ template <> size_t GenericFill<IfcPresentationStyle>(const DB& db, const LIST& p
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyle to be a `IfcLabel`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1984,17 +1984,17 @@ template <> size_t GenericFill<IfcCompositeCurveSegment>(const DB& db, const LIS
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Transition, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurveSegment to be a `IfcTransitionCode`")); }
} while(0);
} while (false);
do { // convert the 'SameSense' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SameSense, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurveSegment to be a `BOOLEAN`")); }
} while(0);
} while (false);
do { // convert the 'ParentCurve' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ParentCurve, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCompositeCurveSegment to be a `IfcCurve`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2006,13 +2006,13 @@ template <> size_t GenericFill<IfcRectangleProfileDef>(const DB& db, const LIST&
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRectangleProfileDef,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->XDim, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'YDim' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRectangleProfileDef,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->YDim, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2108,12 +2108,12 @@ template <> size_t GenericFill<IfcLocalPlacement>(const DB& db, const LIST& para
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->PlacementRelTo, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLocalPlacement to be a `IfcObjectPlacement`")); }
} while(0);
} while (false);
do { // convert the 'RelativePlacement' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelativePlacement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLocalPlacement to be a `IfcAxis2Placement`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2125,13 +2125,13 @@ template <> size_t GenericFill<IfcSweptAreaSolid>(const DB& db, const LIST& para
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSweptAreaSolid,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->SweptArea, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptAreaSolid to be a `IfcProfileDef`")); }
} while(0);
} while (false);
do { // convert the 'Position' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSweptAreaSolid,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->Position, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptAreaSolid to be a `IfcAxis2Placement3D`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2142,12 +2142,12 @@ template <> size_t GenericFill<IfcRevolvedAreaSolid>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Axis, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRevolvedAreaSolid to be a `IfcAxis1Placement`")); }
} while(0);
} while (false);
do { // convert the 'Angle' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Angle, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRevolvedAreaSolid to be a `IfcPlaneAngleMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2172,28 +2172,28 @@ template <> size_t GenericFill<IfcSweptDiskSolid>(const DB& db, const LIST& para
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Directrix, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptDiskSolid to be a `IfcCurve`")); }
} while(0);
} while (false);
do { // convert the 'Radius' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Radius, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'InnerRadius' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->InnerRadius, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'StartParam' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->StartParam, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSweptDiskSolid to be a `IfcParameterValue`")); }
} while(0);
} while (false);
do { // convert the 'EndParam' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->EndParam, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSweptDiskSolid to be a `IfcParameterValue`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2205,13 +2205,13 @@ template <> size_t GenericFill<IfcHalfSpaceSolid>(const DB& db, const LIST& para
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcHalfSpaceSolid,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->BaseSurface, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcHalfSpaceSolid to be a `IfcSurface`")); }
} while(0);
} while (false);
do { // convert the 'AgreementFlag' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcHalfSpaceSolid,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->AgreementFlag, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcHalfSpaceSolid to be a `BOOLEAN`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2222,12 +2222,12 @@ template <> size_t GenericFill<IfcPolygonalBoundedHalfSpace>(const DB& db, const
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Position, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPolygonalBoundedHalfSpace to be a `IfcAxis2Placement3D`")); }
} while(0);
} while (false);
do { // convert the 'PolygonalBoundary' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->PolygonalBoundary, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPolygonalBoundedHalfSpace to be a `IfcBoundedCurve`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2253,23 +2253,23 @@ template <> size_t GenericFill<IfcProject>(const DB& db, const LIST& params, Ifc
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->LongName, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProject to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'Phase' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Phase, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProject to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'RepresentationContexts' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RepresentationContexts, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcProject to be a `SET [1:?] OF IfcRepresentationContext`")); }
} while(0);
} while (false);
do { // convert the 'UnitsInContext' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->UnitsInContext, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcProject to be a `IfcUnitAssignment`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2329,27 +2329,27 @@ template <> size_t GenericFill<IfcTrimmedCurve>(const DB& db, const LIST& params
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->BasisCurve, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcTrimmedCurve to be a `IfcCurve`")); }
} while(0);
} while (false);
do { // convert the 'Trim1' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Trim1, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); }
} while(0);
} while (false);
do { // convert the 'Trim2' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Trim2, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); }
} while(0);
} while (false);
do { // convert the 'SenseAgreement' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SenseAgreement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcTrimmedCurve to be a `BOOLEAN`")); }
} while(0);
} while (false);
do { // convert the 'MasterRepresentation' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MasterRepresentation, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcTrimmedCurve to be a `IfcTrimmingPreference`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2361,7 +2361,7 @@ template <> size_t GenericFill<IfcRelDefines>(const DB& db, const LIST& params,
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRelDefines,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->RelatedObjects, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDefines to be a `SET [1:?] OF IfcObject`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2373,7 +2373,7 @@ template <> size_t GenericFill<IfcRelDefinesByProperties>(const DB& db, const LI
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRelDefinesByProperties,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->RelatingPropertyDefinition, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDefinesByProperties to be a `IfcPropertySetDefinition`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2406,7 +2406,7 @@ template <> size_t GenericFill<IfcArbitraryOpenProfileDef>(const DB& db, const L
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcArbitraryOpenProfileDef,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Curve, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryOpenProfileDef to be a `IfcBoundedCurve`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2572,13 +2572,13 @@ template <> size_t GenericFill<IfcRelDecomposes>(const DB& db, const LIST& param
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRelDecomposes,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->RelatingObject, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDecomposes to be a `IfcObjectDefinition`")); }
} while(0);
} while (false);
do { // convert the 'RelatedObjects' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRelDecomposes,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->RelatedObjects, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDecomposes to be a `SET [1:?] OF IfcObjectDefinition`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2596,7 +2596,7 @@ template <> size_t GenericFill<IfcPolyline>(const DB& db, const LIST& params, If
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Points, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyline to be a `LIST [2:?] OF IfcCartesianPoint`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2628,12 +2628,12 @@ template <> size_t GenericFill<IfcMappedItem>(const DB& db, const LIST& params,
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappingSource, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMappedItem to be a `IfcRepresentationMap`")); }
} while(0);
} while (false);
do { // convert the 'MappingTarget' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappingTarget, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMappedItem to be a `IfcCartesianTransformationOperator`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2660,13 +2660,13 @@ template <> size_t GenericFill<IfcNamedUnit>(const DB& db, const LIST& params, I
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcNamedUnit,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Dimensions, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); }
} while(0);
} while (false);
do { // convert the 'UnitType' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcNamedUnit,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->UnitType, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcNamedUnit to be a `IfcUnitEnum`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2721,13 +2721,13 @@ template <> size_t GenericFill<IfcSpatialStructureElement>(const DB& db, const L
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->LongName, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSpatialStructureElement to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'CompositionType' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSpatialStructureElement,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->CompositionType, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2739,19 +2739,19 @@ template <> size_t GenericFill<IfcBuilding>(const DB& db, const LIST& params, If
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ElevationOfRefHeight, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcBuilding to be a `IfcLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'ElevationOfTerrain' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ElevationOfTerrain, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcBuilding to be a `IfcLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'BuildingAddress' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->BuildingAddress, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcBuilding to be a `IfcPostalAddress`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2763,7 +2763,7 @@ template <> size_t GenericFill<IfcConnectedFaceSet>(const DB& db, const LIST& pa
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcConnectedFaceSet,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->CfsFaces, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConnectedFaceSet to be a `SET [1:?] OF IfcFace`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2789,7 +2789,7 @@ template <> size_t GenericFill<IfcConic>(const DB& db, const LIST& params, IfcCo
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcConic,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Position, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConic to be a `IfcAxis2Placement`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2836,32 +2836,32 @@ template <> size_t GenericFill<IfcIShapeProfileDef>(const DB& db, const LIST& pa
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->OverallWidth, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'OverallDepth' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->OverallDepth, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'WebThickness' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[2]=true; break; }
try { GenericConvert( in->WebThickness, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'FlangeThickness' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[3]=true; break; }
try { GenericConvert( in->FlangeThickness, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'FilletRadius' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[4]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->FilletRadius, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2935,13 +2935,13 @@ template <> size_t GenericFill<IfcPropertyListValue>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ListValues, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertyListValue to be a `LIST [1:?] OF IfcValue`")); }
} while(0);
} while (false);
do { // convert the 'Unit' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Unit, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertyListValue to be a `IfcUnit`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2967,13 +2967,13 @@ template <> size_t GenericFill<IfcDoor>(const DB& db, const LIST& params, IfcDoo
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->OverallHeight, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcDoor to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'OverallWidth' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->OverallWidth, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcDoor to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -2986,20 +2986,20 @@ template <> size_t GenericFill<IfcStyledItem>(const DB& db, const LIST& params,
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Item, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcStyledItem to be a `IfcRepresentationItem`")); }
} while(0);
} while (false);
do { // convert the 'Styles' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcStyledItem,3>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->Styles, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcStyledItem to be a `SET [1:?] OF IfcPresentationStyleAssignment`")); }
} while(0);
} while (false);
do { // convert the 'Name' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcStyledItem,3>::aux_is_derived[2]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcStyledItem to be a `IfcLabel`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -3025,7 +3025,7 @@ template <> size_t GenericFill<IfcArbitraryClosedProfileDef>(const DB& db, const
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcArbitraryClosedProfileDef,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->OuterCurve, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryClosedProfileDef to be a `IfcCurve`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -3043,12 +3043,12 @@ template <> size_t GenericFill<IfcLine>(const DB& db, const LIST& params, IfcLin
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Pnt, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLine to be a `IfcCartesianPoint`")); }
} while(0);
} while (false);
do { // convert the 'Dir' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Dir, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLine to be a `IfcVector`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -3074,13 +3074,13 @@ template <> size_t GenericFill<IfcPropertySingleValue>(const DB& db, const LIST&
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->NominalValue, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertySingleValue to be a `IfcValue`")); }
} while(0);
} while (false);
do { // convert the 'Unit' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Unit, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertySingleValue to be a `IfcUnit`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -3113,7 +3113,7 @@ template <> size_t GenericFill<IfcSurfaceStyleShading>(const DB& db, const LIST&
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSurfaceStyleShading,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->SurfaceColour, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleShading to be a `IfcColourRgb`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------

View File

@ -61,12 +61,12 @@ template <> size_t GenericFill<IfcSurfaceStyle>(const DB& db, const LIST& params
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Side, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyle to be a `IfcSurfaceSide`")); }
} while(0);
} while (false);
do { // convert the 'Styles' argument
std::shared_ptr<const DataType> arg = params[ base++ ];
try { GenericConvert( in->Styles, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyle to be a `SET [1:5] OF IfcSurfaceStyleElementSelect`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -120,7 +120,7 @@ template <> size_t GenericFill<IfcFace>(const DB& db, const LIST& params, IfcFac
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcFace,1>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Bounds, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFace to be a `SET [1:?] OF IfcFaceBound`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -175,7 +175,7 @@ template <> size_t GenericFill<IfcColourSpecification>(const DB& db, const LIST&
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcColourSpecification to be a `IfcLabel`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -186,12 +186,12 @@ template <> size_t GenericFill<IfcVector>(const DB& db, const LIST& params, IfcV
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Orientation, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcVector to be a `IfcDirection`")); }
} while(0);
} while (false);
do { // convert the 'Magnitude' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Magnitude, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcVector to be a `IfcLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -209,17 +209,17 @@ template <> size_t GenericFill<IfcColourRgb>(const DB& db, const LIST& params, I
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Red, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); }
} while(0);
} while (false);
do { // convert the 'Green' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Green, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); }
} while(0);
} while (false);
do { // convert the 'Blue' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Blue, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -245,31 +245,31 @@ template <> size_t GenericFill<IfcSite>(const DB& db, const LIST& params, IfcSit
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefLatitude, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); }
} while(0);
} while (false);
do { // convert the 'RefLongitude' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefLongitude, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); }
} while(0);
} while (false);
do { // convert the 'RefElevation' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefElevation, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcSite to be a `IfcLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'LandTitleNumber' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->LandTitleNumber, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcSite to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'SiteAddress' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->SiteAddress, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to IfcSite to be a `IfcPostalAddress`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -414,31 +414,31 @@ template <> size_t GenericFill<IfcBSplineCurve>(const DB& db, const LIST& params
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Degree, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBSplineCurve to be a `INTEGER`")); }
} while(0);
} while (false);
do { // convert the 'ControlPointsList' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->ControlPointsList, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBSplineCurve to be a `LIST [2:?] OF IfcCartesianPoint`")); }
} while(0);
} while (false);
do { // convert the 'CurveForm' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[2]=true; break; }
try { GenericConvert( in->CurveForm, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBSplineCurve to be a `IfcBSplineCurveForm`")); }
} while(0);
} while (false);
do { // convert the 'ClosedCurve' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[3]=true; break; }
try { GenericConvert( in->ClosedCurve, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBSplineCurve to be a `LOGICAL`")); }
} while(0);
} while (false);
do { // convert the 'SelfIntersect' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[4]=true; break; }
try { GenericConvert( in->SelfIntersect, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcBSplineCurve to be a `LOGICAL`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -476,7 +476,7 @@ template <> size_t GenericFill<IfcShellBasedSurfaceModel>(const DB& db, const LI
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SbsmBoundary, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcShellBasedSurfaceModel to be a `SET [1:?] OF IfcShell`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -494,12 +494,12 @@ template <> size_t GenericFill<IfcExtrudedAreaSolid>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ExtrudedDirection, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcExtrudedAreaSolid to be a `IfcDirection`")); }
} while(0);
} while (false);
do { // convert the 'Depth' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Depth, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcExtrudedAreaSolid to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -524,12 +524,12 @@ template <> size_t GenericFill<IfcRelVoidsElement>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelVoidsElement to be a `IfcElement`")); }
} while(0);
} while (false);
do { // convert the 'RelatedOpeningElement' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelVoidsElement to be a `IfcFeatureElementSubtraction`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -548,13 +548,13 @@ template <> size_t GenericFill<IfcCartesianTransformationOperator3DnonUniform>(c
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Scale2, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); }
} while(0);
} while (false);
do { // convert the 'Scale3' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Scale3, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -636,7 +636,7 @@ template <> size_t GenericFill<IfcAxis2Placement2D>(const DB& db, const LIST& pa
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefDirection, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement2D to be a `IfcDirection`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -660,7 +660,7 @@ template <> size_t GenericFill<IfcCartesianPoint>(const DB& db, const LIST& para
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Coordinates, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianPoint to be a `LIST [1:3] OF IfcLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -684,7 +684,7 @@ template <> size_t GenericFill<IfcPolyLoop>(const DB& db, const LIST& params, If
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Polygon, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyLoop to be a `LIST [3:?] OF IfcCartesianPoint`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -718,14 +718,14 @@ template <> size_t GenericFill<IfcRepresentationContext>(const DB& db, const LIS
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ContextIdentifier, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationContext to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'ContextType' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentationContext,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ContextType, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationContext to be a `IfcLabel`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -737,27 +737,27 @@ template <> size_t GenericFill<IfcGeometricRepresentationContext>(const DB& db,
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->CoordinateSpaceDimension, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcGeometricRepresentationContext to be a `IfcDimensionCount`")); }
} while(0);
} while (false);
do { // convert the 'Precision' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Precision, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcGeometricRepresentationContext to be a `REAL`")); }
} while(0);
} while (false);
do { // convert the 'WorldCoordinateSystem' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[2]=true; break; }
try { GenericConvert( in->WorldCoordinateSystem, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcGeometricRepresentationContext to be a `IfcAxis2Placement`")); }
} while(0);
} while (false);
do { // convert the 'TrueNorth' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[3]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->TrueNorth, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcGeometricRepresentationContext to be a `IfcDirection`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -776,12 +776,12 @@ template <> size_t GenericFill<IfcSIUnit>(const DB& db, const LIST& params, IfcS
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Prefix, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSIUnit to be a `IfcSIPrefix`")); }
} while(0);
} while (false);
do { // convert the 'Name' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSIUnit to be a `IfcSIUnitName`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -807,7 +807,7 @@ template <> size_t GenericFill<IfcAxis1Placement>(const DB& db, const LIST& para
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis1Placement to be a `IfcDirection`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -860,12 +860,12 @@ template <> size_t GenericFill<IfcRepresentationMap>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappingOrigin, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationMap to be a `IfcAxis2Placement`")); }
} while(0);
} while (false);
do { // convert the 'MappedRepresentation' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappedRepresentation, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationMap to be a `IfcRepresentation`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1014,12 +1014,12 @@ template <> size_t GenericFill<IfcMeasureWithUnit>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ValueComponent, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMeasureWithUnit to be a `IfcValue`")); }
} while(0);
} while (false);
do { // convert the 'UnitComponent' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->UnitComponent, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMeasureWithUnit to be a `IfcUnit`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1127,7 +1127,7 @@ template <> size_t GenericFill<IfcFaceBasedSurfaceModel>(const DB& db, const LIS
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->FbsmFaces, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBasedSurfaceModel to be a `SET [1:?] OF IfcConnectedFaceSet`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1174,13 +1174,13 @@ template <> size_t GenericFill<IfcFaceBound>(const DB& db, const LIST& params, I
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcFaceBound,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Bound, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBound to be a `IfcLoop`")); }
} while(0);
} while (false);
do { // convert the 'Orientation' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcFaceBound,2>::aux_is_derived[1]=true; break; }
try { GenericConvert( in->Orientation, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcFaceBound to be a `BOOLEAN`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1218,12 +1218,12 @@ template <> size_t GenericFill<IfcComplexProperty>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->UsageName, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcComplexProperty to be a `IfcIdentifier`")); }
} while(0);
} while (false);
do { // convert the 'HasProperties' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->HasProperties, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcComplexProperty to be a `SET [1:?] OF IfcProperty`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1276,7 +1276,7 @@ template <> size_t GenericFill<IfcUnitAssignment>(const DB& db, const LIST& para
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Units, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcUnitAssignment to be a `SET [1:?] OF IfcUnit`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1309,12 +1309,12 @@ template <> size_t GenericFill<IfcElementQuantity>(const DB& db, const LIST& par
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->MethodOfMeasurement, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcElementQuantity to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'Quantities' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Quantities, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcElementQuantity to be a `SET [1:?] OF IfcPhysicalQuantity`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1381,7 +1381,7 @@ template <> size_t GenericFill<IfcPresentationStyleAssignment>(const DB& db, con
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Styles, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyleAssignment to be a `SET [1:?] OF IfcPresentationStyleSelect`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1420,13 +1420,13 @@ template <> size_t GenericFill<IfcSpace>(const DB& db, const LIST& params, IfcSp
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->InteriorOrExteriorSpace, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSpace to be a `IfcInternalOrExternalEnum`")); }
} while(0);
} while (false);
do { // convert the 'ElevationWithFlooring' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ElevationWithFlooring, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSpace to be a `IfcLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1486,7 +1486,7 @@ template <> size_t GenericFill<IfcSurfaceStyleWithTextures>(const DB& db, const
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Textures, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleWithTextures to be a `LIST [1:?] OF IfcSurfaceTexture`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1497,22 +1497,22 @@ template <> size_t GenericFill<IfcBoundingBox>(const DB& db, const LIST& params,
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Corner, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBoundingBox to be a `IfcCartesianPoint`")); }
} while(0);
} while (false);
do { // convert the 'XDim' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->XDim, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'YDim' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->YDim, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'ZDim' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ZDim, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1537,7 +1537,7 @@ template <> size_t GenericFill<IfcCircle>(const DB& db, const LIST& params, IfcC
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Radius, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCircle to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1625,12 +1625,12 @@ template <> size_t GenericFill<IfcConversionBasedUnit>(const DB& db, const LIST&
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Name, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcConversionBasedUnit to be a `IfcLabel`")); }
} while(0);
} while (false);
do { // convert the 'ConversionFactor' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ConversionFactor, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcConversionBasedUnit to be a `IfcMeasureWithUnit`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1746,12 +1746,12 @@ template <> size_t GenericFill<IfcEllipse>(const DB& db, const LIST& params, Ifc
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SemiAxis1, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
do { // convert the 'SemiAxis2' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SemiAxis2, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1818,7 +1818,7 @@ template <> size_t GenericFill<IfcPropertySet>(const DB& db, const LIST& params,
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->HasProperties, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcPropertySet to be a `SET [1:?] OF IfcProperty`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------
@ -1830,48 +1830,48 @@ template <> size_t GenericFill<IfcSurfaceStyleRendering>(const DB& db, const LIS
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Transparency, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyleRendering to be a `IfcNormalisedRatioMeasure`")); }
} while(0);
} while (false);
do { // convert the 'DiffuseColour' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->DiffuseColour, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
} while(0);
} while (false);
do { // convert the 'TransmissionColour' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->TransmissionColour, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
} while(0);
} while (false);
do { // convert the 'DiffuseTransmissionColour' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
} while(0);
} while (false);
do { // convert the 'ReflectionColour' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ReflectionColour, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
} while(0);
} while (false);
do { // convert the 'SpecularColour' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->SpecularColour, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
} while(0);
} while (false);
do { // convert the 'SpecularHighlight' argument
std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->SpecularHighlight, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSurfaceStyleRendering to be a `IfcSpecularHighlightSelect`")); }
} while(0);
} while (false);
do { // convert the 'ReflectanceMethod' argument
std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ReflectanceMethod, arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSurfaceStyleRendering to be a `IfcReflectanceMethodEnum`")); }
} while(0);
} while (false);
return base;
}
// -----------------------------------------------------------------------------------------------------------

View File

@ -127,7 +127,7 @@ const aiImporterDesc *IQMImporter::GetInfo() const {
void IQMImporter::InternReadFile(const std::string &file, aiScene *pScene, IOSystem *pIOHandler) {
// Read file into memory
std::unique_ptr<IOStream> pStream(pIOHandler->Open(file, "rb"));
if (!pStream.get()) {
if (!pStream) {
throw DeadlyImportError("Failed to open file ", file, ".");
}

View File

@ -842,7 +842,7 @@ void IRRImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open IRR file ", pFile);
}

View File

@ -71,11 +71,7 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
IRRMeshImporter::IRRMeshImporter() :
BaseImporter(),
IrrlichtBase() {
// empty
}
IRRMeshImporter::IRRMeshImporter() = default;
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
@ -120,7 +116,7 @@ void IRRMeshImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == NULL)
if (file == nullptr)
throw DeadlyImportError("Failed to open IRRMESH file ", pFile);
// Construct the irrXML parser

View File

@ -63,9 +63,7 @@ protected:
// empty
}
~IrrlichtBase() {
// empty
}
~IrrlichtBase() = default;
/** @brief Data structure for a simple name-value property
*/

View File

@ -162,8 +162,11 @@ void AnimResolver::UpdateAnimRangeSetup() {
const double my_last = (*it).keys.back().time;
const double delta = my_last - my_first;
const size_t old_size = (*it).keys.size();
if (delta == 0.0) {
continue;
}
const size_t old_size = (*it).keys.size();
const float value_delta = (*it).keys.back().value - (*it).keys.front().value;
// NOTE: We won't handle reset, linear and constant here.
@ -176,8 +179,7 @@ void AnimResolver::UpdateAnimRangeSetup() {
case LWO::PrePostBehaviour_Oscillate: {
const double start_time = delta - std::fmod(my_first - first, delta);
std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(), (*it).keys.end(),
[start_time](double t) { return start_time > t; }),
m;
[start_time](double t) { return start_time > t; }), m;
size_t ofs = 0;
if (n != (*it).keys.end()) {
@ -463,7 +465,7 @@ void AnimResolver::GetKeys(std::vector<aiVectorKey> &out,
cur_z = envl_z->keys.begin();
end_x = end_y = end_z = false;
while (1) {
while (true) {
aiVectorKey fill;

View File

@ -135,7 +135,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open LWO file ", pFile, ".");
}
@ -178,7 +178,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
mLayers->push_back(Layer());
mCurLayer = &mLayers->back();
mCurLayer->mName = "<LWODefault>";
mCurLayer->mIndex = (uint16_t) -1;
mCurLayer->mIndex = 1;
// old lightwave file format (prior to v6)
mIsLWO2 = false;
@ -398,14 +398,6 @@ void LWOImporter::InternReadFile(const std::string &pFile,
pvVC[w]++;
}
#if 0
// process vertex weights. We can't properly reconstruct the whole skeleton for now,
// but we can create dummy bones for all weight channels which we have.
for (unsigned int w = 0; w < layer.mWeightChannels.size();++w)
{
}
#endif
face.mIndices[q] = vert;
}
pf->mIndices = face.mIndices;
@ -429,7 +421,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
// Generate nodes to render the mesh. Store the source layer in the mParent member of the nodes
unsigned int num = static_cast<unsigned int>(apcMeshes.size() - meshStart);
if (layer.mName != "<LWODefault>" || num > 0) {
aiNode *pcNode = new aiNode();
std::unique_ptr<aiNode> pcNode(new aiNode());
pcNode->mName.Set(layer.mName);
pcNode->mParent = (aiNode *)&layer;
pcNode->mNumMeshes = num;
@ -439,7 +431,8 @@ void LWOImporter::InternReadFile(const std::string &pFile,
for (unsigned int p = 0; p < pcNode->mNumMeshes; ++p)
pcNode->mMeshes[p] = p + meshStart;
}
apcNodes[layer.mIndex] = pcNode;
ASSIMP_LOG_DEBUG("insert apcNode for layer ", layer.mIndex, " \"", layer.mName, "\"");
apcNodes[layer.mIndex] = pcNode.release();
}
}
@ -572,7 +565,13 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
aiNode *root = mScene->mRootNode = new aiNode();
root->mName.Set("<LWORoot>");
ASSIMP_LOG_DEBUG("apcNodes initial size: ", apcNodes.size());
if (!apcNodes.empty()) {
ASSIMP_LOG_DEBUG("first apcNode is: ", apcNodes.begin()->first, " \"", apcNodes.begin()->second->mName.C_Str(), "\"");
}
//Set parent of all children, inserting pivots
{
std::map<uint16_t, aiNode *> mapPivot;
for (auto itapcNodes = apcNodes.begin(); itapcNodes != apcNodes.end(); ++itapcNodes) {
@ -581,9 +580,9 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
uint16_t parentIndex = nodeLayer->mParent;
//Create pivot node, store it into the pivot map, and set the parent as the pivot
aiNode *pivotNode = new aiNode();
std::unique_ptr<aiNode> pivotNode(new aiNode());
pivotNode->mName.Set("Pivot-" + std::string(itapcNodes->second->mName.data));
itapcNodes->second->mParent = pivotNode;
itapcNodes->second->mParent = pivotNode.get();
//Look for the parent node to attach the pivot to
if (apcNodes.find(parentIndex) != apcNodes.end()) {
@ -600,12 +599,30 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
pivotNode->mTransformation.a4 = nodeLayer->mPivot.x;
pivotNode->mTransformation.b4 = nodeLayer->mPivot.y;
pivotNode->mTransformation.c4 = nodeLayer->mPivot.z;
mapPivot[-(itapcNodes->first + 2)] = pivotNode;
uint16_t pivotNodeId = static_cast<uint16_t>(-(itapcNodes->first + 2));
ASSIMP_LOG_DEBUG("insert pivot node: ", pivotNodeId);
auto oldNodeIt = mapPivot.find(pivotNodeId);
if (oldNodeIt != mapPivot.end()) {
ASSIMP_LOG_ERROR("attempted to insert pivot node which already exists in pivot map ", pivotNodeId, " \"", pivotNode->mName.C_Str(), "\"");
} else {
mapPivot.emplace(pivotNodeId, pivotNode.release());
}
}
ASSIMP_LOG_DEBUG("pivot nodes: ", mapPivot.size());
//Merge pivot map into node map
for (auto itMapPivot = mapPivot.begin(); itMapPivot != mapPivot.end(); ++itMapPivot) {
apcNodes[itMapPivot->first] = itMapPivot->second;
for (auto itMapPivot = mapPivot.begin(); itMapPivot != mapPivot.end();) {
uint16_t pivotNodeId = itMapPivot->first;
auto oldApcNodeIt = apcNodes.find(pivotNodeId);
if (oldApcNodeIt != apcNodes.end()) {
ASSIMP_LOG_ERROR("attempted to insert pivot node which already exists in apc nodes ", pivotNodeId, " \"", itMapPivot->second->mName.C_Str(), "\"");
} else {
apcNodes.emplace(pivotNodeId, itMapPivot->second);
}
itMapPivot->second = nullptr;
itMapPivot = mapPivot.erase(itMapPivot);
}
ASSIMP_LOG_DEBUG("total nodes: ", apcNodes.size());
}
//Set children of all parents
@ -627,8 +644,15 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
}
}
if (!mScene->mRootNode->mNumChildren)
if (!mScene->mRootNode->mNumChildren) {
ASSIMP_LOG_DEBUG("All apcNodes:");
for (auto nodeIt = apcNodes.begin(); nodeIt != apcNodes.end(); ) {
ASSIMP_LOG_DEBUG("Node ", nodeIt->first, " \"", nodeIt->second->mName.C_Str(), "\"");
nodeIt->second = nullptr;
nodeIt = apcNodes.erase(nodeIt);
}
throw DeadlyImportError("LWO: Unable to build a valid node graph");
}
// Remove a single root node with no meshes assigned to it ...
if (1 == mScene->mRootNode->mNumChildren) {

View File

@ -494,7 +494,7 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open LWS file ", pFile, ".");
}

View File

@ -65,7 +65,7 @@ class M3DImporter : public BaseImporter {
public:
/// \brief Default constructor
M3DImporter();
~M3DImporter() override {}
~M3DImporter() override = default;
/// \brief Returns whether the class can handle the format of the given file.
/// \remark See BaseImporter::CanRead() for details.

View File

@ -39,8 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
#if !defined ASSIMP_BUILD_NO_M3D_IMPORTER || !(defined ASSIMP_BUILD_NO_EXPORT || defined ASSIMP_BUILD_NO_M3D_EXPORTER)
#include "M3DWrapper.h"
@ -149,4 +148,3 @@ void M3DWrapper::ClearSave() {
} // namespace Assimp
#endif
#endif

View File

@ -47,8 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_M3DWRAPPER_H_INC
#define AI_M3DWRAPPER_H_INC
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
#if !defined ASSIMP_BUILD_NO_M3D_IMPORTER || !(defined ASSIMP_BUILD_NO_EXPORT || defined ASSIMP_BUILD_NO_M3D_EXPORTER)
#include <memory>
#include <vector>
@ -126,7 +125,6 @@ inline m3d_t *M3DWrapper::M3D() const {
} // namespace Assimp
#endif
#endif // ASSIMP_BUILD_NO_M3D_IMPORTER
#endif // AI_M3DWRAPPER_H_INC

View File

@ -205,7 +205,7 @@ void MD2Importer::InternReadFile( const std::string& pFile,
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open MD2 file ", pFile, "");
}

View File

@ -109,7 +109,7 @@ Q3Shader::BlendFunc StringToBlendFunc(const std::string &m) {
// Load a Quake 3 shader
bool Q3Shader::LoadShader(ShaderData &fill, const std::string &pFile, IOSystem *io) {
std::unique_ptr<IOStream> file(io->Open(pFile, "rt"));
if (!file.get())
if (!file)
return false; // if we can't access the file, don't worry and return
ASSIMP_LOG_INFO("Loading Quake3 shader file ", pFile);
@ -223,7 +223,7 @@ bool Q3Shader::LoadShader(ShaderData &fill, const std::string &pFile, IOSystem *
// Load a Quake 3 skin
bool Q3Shader::LoadSkin(SkinData &fill, const std::string &pFile, IOSystem *io) {
std::unique_ptr<IOStream> file(io->Open(pFile, "rt"));
if (!file.get())
if (!file)
return false; // if we can't access the file, don't worry and return
ASSIMP_LOG_INFO("Loading Quake3 skin file ", pFile);
@ -709,7 +709,7 @@ void MD3Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open MD3 file ", pFile, ".");
}

View File

@ -331,7 +331,7 @@ void MD5Importer::LoadMD5MeshFile() {
std::unique_ptr<IOStream> file(mIOHandler->Open(filename, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr || !file->FileSize()) {
if (file == nullptr || !file->FileSize()) {
ASSIMP_LOG_WARN("Failed to access MD5MESH file: ", filename);
return;
}
@ -553,7 +553,7 @@ void MD5Importer::LoadMD5AnimFile() {
std::unique_ptr<IOStream> file(mIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (!file.get() || !file->FileSize()) {
if (!file || !file->FileSize()) {
ASSIMP_LOG_WARN("Failed to read MD5ANIM file: ", pFile);
return;
}
@ -661,7 +661,7 @@ void MD5Importer::LoadMD5CameraFile() {
std::unique_ptr<IOStream> file(mIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (!file.get() || !file->FileSize()) {
if (!file || !file->FileSize()) {
throw DeadlyImportError("Failed to read MD5CAMERA file: ", pFile);
}
mHadMD5Camera = true;

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -117,6 +115,9 @@ void MD5Parser::ParseHeader() {
ReportError("MD5 version tag is unknown (10 is expected)");
}
SkipLine();
if (buffer == bufferEnd) {
return;
}
// print the command line options to the console
// FIX: can break the log length limit, so we need to be careful
@ -135,8 +136,9 @@ bool MD5Parser::ParseSection(Section &out) {
// first parse the name of the section
char *sz = buffer;
while (!IsSpaceOrNewLine(*buffer))
buffer++;
while (!IsSpaceOrNewLine(*buffer)) {
++buffer;
}
out.mName = std::string(sz, (uintptr_t)(buffer - sz));
SkipSpaces();
@ -144,14 +146,14 @@ bool MD5Parser::ParseSection(Section &out) {
while (running) {
if ('{' == *buffer) {
// it is a normal section so read all lines
buffer++;
++buffer;
bool run = true;
while (run) {
if (!SkipSpacesAndLineEnd()) {
return false; // seems this was the last section
}
if ('}' == *buffer) {
buffer++;
++buffer;
break;
}
@ -163,7 +165,7 @@ bool MD5Parser::ParseSection(Section &out) {
// terminate the line with zero
while (!IsLineEnd(*buffer))
buffer++;
++buffer;
if (*buffer) {
++lineNumber;
*buffer++ = '\0';

View File

@ -199,7 +199,7 @@ void MDCImporter::InternReadFile(
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open MDC file ", pFile, ".");
}

View File

@ -470,14 +470,16 @@ void HL1MDLLoader::read_bones() {
temp_bones_.resize(header_->numbones);
// Create the main 'bones' node that will contain all MDL root bones.
aiNode *bones_node = new aiNode(AI_MDL_HL1_NODE_BONES);
rootnode_children_.push_back(bones_node);
bones_node->mNumChildren = static_cast<unsigned int>(header_->numbones);
bones_node->mChildren = new aiNode *[bones_node->mNumChildren];
// Store roots bones IDs temporarily.
std::vector<int> roots;
// Create bone matrices in local space.
for (int i = 0; i < header_->numbones; ++i) {
aiNode *bone_node = temp_bones_[i].node = bones_node->mChildren[i] = new aiNode(unique_bones_names[i]);
aiNode *bone_node = temp_bones_[i].node = new aiNode(unique_bones_names[i]);
aiVector3D angles(pbone[i].value[3], pbone[i].value[4], pbone[i].value[5]);
temp_bones_[i].absolute_transform = bone_node->mTransformation =
@ -485,9 +487,11 @@ void HL1MDLLoader::read_bones() {
aiVector3D(pbone[i].value[0], pbone[i].value[1], pbone[i].value[2]));
if (pbone[i].parent == -1) {
bone_node->mParent = scene_->mRootNode;
bone_node->mParent = bones_node;
roots.push_back(i); // This bone has no parent. Add it to the roots list.
} else {
bone_node->mParent = bones_node->mChildren[pbone[i].parent];
bone_node->mParent = temp_bones_[pbone[i].parent].node;
temp_bones_[pbone[i].parent].children.push_back(i); // Add this bone to the parent bone's children list.
temp_bones_[i].absolute_transform =
temp_bones_[pbone[i].parent].absolute_transform * bone_node->mTransformation;
@ -496,6 +500,36 @@ void HL1MDLLoader::read_bones() {
temp_bones_[i].offset_matrix = temp_bones_[i].absolute_transform;
temp_bones_[i].offset_matrix.Inverse();
}
// Allocate memory for each MDL root bone.
bones_node->mNumChildren = static_cast<unsigned int>(roots.size());
bones_node->mChildren = new aiNode *[bones_node->mNumChildren];
// Build all bones children hierarchy starting from each MDL root bone.
for (size_t i = 0; i < roots.size(); ++i)
{
const TempBone &root_bone = temp_bones_[roots[i]];
bones_node->mChildren[i] = root_bone.node;
build_bone_children_hierarchy(root_bone);
}
}
void HL1MDLLoader::build_bone_children_hierarchy(const TempBone &bone)
{
if (bone.children.empty())
return;
aiNode* bone_node = bone.node;
bone_node->mNumChildren = static_cast<unsigned int>(bone.children.size());
bone_node->mChildren = new aiNode *[bone_node->mNumChildren];
// Build each child bone's hierarchy recursively.
for (size_t i = 0; i < bone.children.size(); ++i)
{
const TempBone &child_bone = temp_bones_[bone.children[i]];
bone_node->mChildren[i] = child_bone.node;
build_bone_children_hierarchy(child_bone);
}
}
// ------------------------------------------------------------------------------------------------

View File

@ -143,6 +143,14 @@ private:
*/
static bool get_num_blend_controllers(const int num_blend_animations, int &num_blend_controllers);
/**
* \brief Build a bone's node children hierarchy.
*
* \param[in] bone The bone for which we must build all children hierarchy.
*/
struct TempBone;
void build_bone_children_hierarchy(const TempBone& bone);
/** Output scene to be filled */
aiScene *scene_;
@ -198,11 +206,13 @@ private:
TempBone() :
node(nullptr),
absolute_transform(),
offset_matrix() {}
offset_matrix(),
children() {}
aiNode *node;
aiMatrix4x4 absolute_transform;
aiMatrix4x4 offset_matrix;
std::vector<int> children; // Bone children
};
std::vector<TempBone> temp_bones_;
@ -222,7 +232,7 @@ void HL1MDLLoader::load_file_into_buffer(const std::string &file_path, unsigned
std::unique_ptr<IOStream> file(io_->Open(file_path));
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open MDL file ", DefaultIOSystem::fileName(file_path), ".");
}

View File

@ -159,7 +159,7 @@ void MDLImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open MDL file ", pFile, ".");
}
@ -405,6 +405,7 @@ void MDLImporter::InternReadFile_Quake1() {
}
// go to the end of the skin section / the beginning of the next skin
bool overflow = false;
if (pcHeader->skinwidth != 0 || pcHeader->skinheight != 0) {
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
overflow = true;
}
@ -412,6 +413,7 @@ void MDLImporter::InternReadFile_Quake1() {
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages;
}
}
}
} else {
szCurrent += sizeof(uint32_t);
unsigned int iSkip = i ? UINT_MAX : 0;
@ -973,7 +975,7 @@ void MDLImporter::CalcAbsBoneMatrices_3DGS_MDL7(MDL::IntBone_MDL7 **apcOutBones)
}
// store the name of the bone
pcOutBone->mName.length = (size_t)iMaxLen;
pcOutBone->mName.length = static_cast<ai_uint32>(iMaxLen);
::memcpy(pcOutBone->mName.data, pcBone->name, pcOutBone->mName.length);
pcOutBone->mName.data[pcOutBone->mName.length] = '\0';
}

View File

@ -269,7 +269,7 @@ aiMesh *MMDImporter::CreateMesh(const pmx::PmxModel *pModel,
dynamic_cast<pmx::PmxVertexSkinningSDEF *>(v->skinning.get());
switch (v->skinning_type) {
case pmx::PmxVertexSkinningType::BDEF1:
bone_vertex_map[vsBDEF1_ptr->bone_index].emplace_back(index, 1.0);
bone_vertex_map[vsBDEF1_ptr->bone_index].emplace_back(index, static_cast<ai_real>(1));
break;
case pmx::PmxVertexSkinningType::BDEF2:
bone_vertex_map[vsBDEF2_ptr->bone_index1].emplace_back(index, vsBDEF2_ptr->bone_weight);

View File

@ -486,7 +486,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
for (unsigned int j = 0,n = 0; j < m->mNumFaces; ++j) {
aiFace& f = m->mFaces[j];
if (g.triangles[j]>triangles.size()) {
if (g.triangles[j] >= triangles.size()) {
throw DeadlyImportError("MS3D: Encountered invalid triangle index, file is malformed");
}
@ -494,7 +494,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
f.mIndices = new unsigned int[f.mNumIndices=3];
for (unsigned int k = 0; k < 3; ++k,++n) {
if (t.indices[k]>vertices.size()) {
if (t.indices[k] >= vertices.size()) {
throw DeadlyImportError("MS3D: Encountered invalid vertex index, file is malformed");
}

View File

@ -268,7 +268,7 @@ void NDOImporter::InternReadFile( const std::string& pFile,
const unsigned int key = v.first;
unsigned int cur_edge = v.second;
while (1) {
while (true) {
unsigned int next_edge, next_vert;
if (key == obj.edges[cur_edge].edge[3]) {
next_edge = obj.edges[cur_edge].edge[5];

View File

@ -129,7 +129,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo> &output,
std::unique_ptr<IOStream> file(pIOHandler->Open(path, "rb"));
// Check whether we can read from the file
if (!file.get()) {
if (!file) {
ASSIMP_LOG_ERROR("NFF2: Unable to open material library ", path, ".");
return;
}
@ -211,7 +211,7 @@ void NFFImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (!file.get())
if (!file)
throw DeadlyImportError("Failed to open NFF file ", pFile, ".");
// allocate storage and copy the contents of the file to a memory buffer

View File

@ -109,8 +109,8 @@ void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == nullptr) {
throw DeadlyImportError( "Failed to open OFF file ", pFile, ".");
if (file == nullptr) {
throw DeadlyImportError("Failed to open OFF file ", pFile, ".");
}
// allocate storage and copy the contents of the file to a memory buffer
@ -292,6 +292,7 @@ void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
if(!idx || idx > 9) {
ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed");
--mesh->mNumFaces;
++i;
continue;
}
faces->mNumIndices = idx;

View File

@ -108,7 +108,7 @@ void ObjFileImporter::InternReadFile(const std::string &file, aiScene *pScene, I
pIOHandler->Close(pStream);
};
std::unique_ptr<IOStream, decltype(streamCloser)> fileStream(pIOHandler->Open(file, mode), streamCloser);
if (!fileStream.get()) {
if (!fileStream) {
throw DeadlyImportError("Failed to open file ", file, ".");
}

View File

@ -440,7 +440,7 @@ void ObjFileParser::getFace(aiPrimitiveType type) {
const bool vt = (!m_pModel->mTextureCoord.empty());
const bool vn = (!m_pModel->mNormals.empty());
int iPos = 0;
while (m_DataIt != m_DataItEnd) {
while (m_DataIt < m_DataItEnd) {
int iStep = 1;
if (IsLineEnd(*m_DataIt)) {

View File

@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2021, assimp team
Copyright (c) 2006-2022, assimp team
All rights reserved.
@ -111,6 +111,10 @@ inline Char_T getNextToken(Char_T pBuffer, Char_T pEnd) {
*/
template <class char_t>
inline char_t skipLine(char_t it, char_t end, unsigned int &uiLine) {
if (it >= end) {
return it;
}
while (!isEndOfBuffer(it, end) && !IsLineEnd(*it)) {
++it;
}

View File

@ -60,17 +60,17 @@ namespace Ogre {
class OgreImporter : public BaseImporter {
public:
/// BaseImporter override.
virtual bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const override;
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const override;
protected:
/// BaseImporter override.
virtual void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) override;
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) override;
/// BaseImporter override.
virtual const aiImporterDesc *GetInfo() const override;
const aiImporterDesc *GetInfo() const override;
/// BaseImporter override.
virtual void SetupProperties(const Importer *pImp) override;
void SetupProperties(const Importer *pImp) override;
private:
/// Read materials referenced by the @c mesh to @c pScene.

View File

@ -111,7 +111,7 @@ void OgreImporter::AssignMaterials(aiScene *pScene, std::vector<aiMaterial *> &m
aiMaterial *OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSystem *pIOHandler, const std::string &materialName) {
if (materialName.empty()) {
return 0;
return nullptr;
}
// Full reference and examples of Ogre Material Script
@ -154,7 +154,7 @@ aiMaterial *OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste
if (!m_userDefinedMaterialLibFile.empty())
potentialFiles.push_back(m_userDefinedMaterialLibFile);
IOStream *materialFile = 0;
IOStream *materialFile = nullptr;
for (size_t i = 0; i < potentialFiles.size(); ++i) {
materialFile = pIOHandler->Open(potentialFiles[i]);
if (materialFile) {
@ -164,13 +164,13 @@ aiMaterial *OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste
}
if (!materialFile) {
ASSIMP_LOG_ERROR("Failed to find source file for material '", materialName, "'");
return 0;
return nullptr;
}
std::unique_ptr<IOStream> stream(materialFile);
if (stream->FileSize() == 0) {
ASSIMP_LOG_WARN("Source file for material '", materialName, "' is empty (size is 0 bytes)");
return 0;
return nullptr;
}
// Read bytes

View File

@ -296,7 +296,7 @@ uint32_t VertexData::VertexSize(uint16_t source) const {
MemoryStream *VertexData::VertexBuffer(uint16_t source) {
if (vertexBindings.find(source) != vertexBindings.end())
return vertexBindings[source].get();
return 0;
return nullptr;
}
VertexElement *VertexData::GetVertexElement(VertexElement::Semantic semantic, uint16_t index) {
@ -304,7 +304,7 @@ VertexElement *VertexData::GetVertexElement(VertexElement::Semantic semantic, ui
if (element.semantic == semantic && element.index == index)
return &element;
}
return 0;
return nullptr;
}
// VertexDataXml
@ -399,7 +399,7 @@ SubMesh *Mesh::GetSubMesh(size_t index) const {
return subMeshes[i];
}
}
return 0;
return nullptr;
}
void Mesh::ConvertToAssimpScene(aiScene *dest) {
@ -459,7 +459,7 @@ ISubMesh::ISubMesh() :
// SubMesh
SubMesh::SubMesh() :
vertexData(0),
vertexData(nullptr),
indexData(new IndexData()) {
}
@ -515,9 +515,9 @@ aiMesh *SubMesh::ConvertToAssimpMesh(Mesh *parent) {
// Source streams
MemoryStream *positions = src->VertexBuffer(positionsElement->source);
MemoryStream *normals = (normalsElement ? src->VertexBuffer(normalsElement->source) : 0);
MemoryStream *uv1 = (uv1Element ? src->VertexBuffer(uv1Element->source) : 0);
MemoryStream *uv2 = (uv2Element ? src->VertexBuffer(uv2Element->source) : 0);
MemoryStream *normals = (normalsElement ? src->VertexBuffer(normalsElement->source) : nullptr);
MemoryStream *uv1 = (uv1Element ? src->VertexBuffer(uv1Element->source) : nullptr);
MemoryStream *uv2 = (uv2Element ? src->VertexBuffer(uv2Element->source) : nullptr);
// Element size
const size_t sizePosition = positionsElement->Size();
@ -544,7 +544,7 @@ aiMesh *SubMesh::ConvertToAssimpMesh(Mesh *parent) {
dest->mTextureCoords[0] = new aiVector3D[dest->mNumVertices];
} else {
ASSIMP_LOG_WARN("Ogre imported UV0 type ", uv1Element->TypeToString(), " is not compatible with Assimp. Ignoring UV.");
uv1 = 0;
uv1 = nullptr;
}
}
if (uv2) {
@ -553,12 +553,12 @@ aiMesh *SubMesh::ConvertToAssimpMesh(Mesh *parent) {
dest->mTextureCoords[1] = new aiVector3D[dest->mNumVertices];
} else {
ASSIMP_LOG_WARN("Ogre imported UV0 type ", uv2Element->TypeToString(), " is not compatible with Assimp. Ignoring UV.");
uv2 = 0;
uv2 = nullptr;
}
}
aiVector3D *uv1Dest = (uv1 ? dest->mTextureCoords[0] : 0);
aiVector3D *uv2Dest = (uv2 ? dest->mTextureCoords[1] : 0);
aiVector3D *uv1Dest = (uv1 ? dest->mTextureCoords[0] : nullptr);
aiVector3D *uv2Dest = (uv2 ? dest->mTextureCoords[1] : nullptr);
MemoryStream *faces = indexData->buffer.get();
for (size_t fi = 0, isize = indexData->IndexSize(), fsize = indexData->FaceSize();
@ -640,8 +640,8 @@ aiMesh *SubMesh::ConvertToAssimpMesh(Mesh *parent) {
// MeshXml
MeshXml::MeshXml() :
skeleton(0),
sharedVertexData(0) {
skeleton(nullptr),
sharedVertexData(nullptr) {
}
MeshXml::~MeshXml() {
@ -666,7 +666,7 @@ SubMeshXml *MeshXml::GetSubMesh(uint16_t index) const {
for (size_t i = 0; i < subMeshes.size(); ++i)
if (subMeshes[i]->index == index)
return subMeshes[i];
return 0;
return nullptr;
}
void MeshXml::ConvertToAssimpScene(aiScene *dest) {
@ -714,7 +714,7 @@ void MeshXml::ConvertToAssimpScene(aiScene *dest) {
SubMeshXml::SubMeshXml() :
indexData(new IndexDataXml()),
vertexData(0) {
vertexData(nullptr) {
}
SubMeshXml::~SubMeshXml() {
@ -827,7 +827,7 @@ Animation::Animation(Skeleton *parent) :
Animation::Animation(Mesh *parent) :
parentMesh(parent),
parentSkeleton(0),
parentSkeleton(nullptr),
length(0.0f),
baseTime(-1.0f) {
// empty
@ -910,7 +910,7 @@ Bone *Skeleton::BoneByName(const std::string &name) const {
if ((*iter)->name == name)
return (*iter);
}
return 0;
return nullptr;
}
Bone *Skeleton::BoneById(uint16_t id) const {
@ -918,20 +918,20 @@ Bone *Skeleton::BoneById(uint16_t id) const {
if ((*iter)->id == id)
return (*iter);
}
return 0;
return nullptr;
}
// Bone
Bone::Bone() :
id(0),
parent(0),
parent(nullptr),
parentId(-1),
scale(1.0f, 1.0f, 1.0f) {
}
bool Bone::IsParented() const {
return (parentId != -1 && parent != 0);
return (parentId != -1 && parent != nullptr);
}
uint16_t Bone::ParentId() const {

View File

@ -437,7 +437,7 @@ public:
void CalculateWorldMatrixAndDefaultPose(Skeleton *skeleton);
/// Convert to Assimp node (animation nodes).
aiNode *ConvertToAssimpNode(Skeleton *parent, aiNode *parentNode = 0);
aiNode *ConvertToAssimpNode(Skeleton *parent, aiNode *parentNode = nullptr);
/// Convert to Assimp bone (mesh bones).
aiBone *ConvertToAssimpBone(Skeleton *parent, const std::vector<aiVertexWeight> &boneWeights);

View File

@ -490,7 +490,7 @@ bool OgreXmlSerializer::ImportSkeleton(Assimp::IOSystem *pIOHandler, MeshXml *me
OgreXmlSerializer serializer(xmlParser.get());
XmlNode root = xmlParser->getRootNode();
if (std::string(root.name()) != nnSkeleton) {
printf("\nSkeleton is not a valid root: %s\n", root.name());
ASSIMP_LOG_VERBOSE_DEBUG("nSkeleton is not a valid root: ", root.name(), ".");
for (auto &a : root.children()) {
if (std::string(a.name()) == nnSkeleton) {
root = a;
@ -535,7 +535,7 @@ XmlParserPtr OgreXmlSerializer::OpenXmlParser(Assimp::IOSystem *pIOHandler, cons
}
std::unique_ptr<IOStream> file(pIOHandler->Open(filename));
if (!file.get()) {
if (!file) {
throw DeadlyImportError("Failed to open skeleton file ", filename);
}

View File

@ -261,7 +261,6 @@ OpenGEXImporter::RefInfo::RefInfo(aiNode *node, Type type, std::vector<std::stri
OpenGEXImporter::OpenGEXImporter() :
m_root(nullptr),
m_nodeChildMap(),
m_meshCache(),
m_mesh2refMap(),
m_material2refMap(),
m_ctx(nullptr),

View File

@ -133,7 +133,7 @@ static bool isBigEndian(const char *szMe) {
void PLYImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
const std::string mode = "rb";
std::unique_ptr<IOStream> fileStream(pIOHandler->Open(pFile, mode));
if (!fileStream.get()) {
if (!fileStream) {
throw DeadlyImportError("Failed to open file ", pFile, ".");
}

View File

@ -308,8 +308,8 @@ bool PLY::Element::ParseElement(IOStreamBuffer<char> &streamBuffer, std::vector<
streamBuffer.getNextLine(buffer);
pCur = (char *)&buffer[0];
// skip all comments
PLY::DOM::SkipComments(buffer);
// skip all comments and go to next line
if (PLY::DOM::SkipComments(buffer)) continue;
PLY::Property prop;
if (!PLY::Property::ParseProperty(buffer, &prop))
@ -420,7 +420,7 @@ bool PLY::DOM::ParseHeader(IOStreamBuffer<char> &streamBuffer, std::vector<char>
if (PLY::Element::ParseElement(streamBuffer, buffer, &out)) {
// add the element to the list of elements
alElements.push_back(out);
} else if (TokenMatch(buffer, "end_header", 10)) { //checks for /n ending, if it doesn't end with /r/n
} else if (TokenMatch(buffer, "end_header", 10)) {
// we have reached the end of the header
break;
} else {

View File

@ -296,9 +296,7 @@ class PropertyInstance
public:
//! Default constructor
PropertyInstance() AI_NO_EXCEPT {
// empty
}
PropertyInstance() AI_NO_EXCEPT = default;
union ValueUnion
{
@ -359,10 +357,7 @@ public:
class ElementInstance {
public:
//! Default constructor
ElementInstance() AI_NO_EXCEPT
: alProperties() {
// empty
}
ElementInstance() AI_NO_EXCEPT = default;
//! List of all parsed properties
std::vector< PropertyInstance > alProperties;
@ -386,10 +381,7 @@ class ElementInstanceList
public:
//! Default constructor
ElementInstanceList() AI_NO_EXCEPT
: alInstances() {
// empty
}
ElementInstanceList() AI_NO_EXCEPT = default;
//! List of all element instances
std::vector< ElementInstance > alInstances;
@ -413,11 +405,7 @@ class DOM
public:
//! Default constructor
DOM() AI_NO_EXCEPT
: alElements()
, alElementData() {
}
DOM() AI_NO_EXCEPT = default;
//! Contains all elements of the file format

View File

@ -169,19 +169,7 @@ struct Q3BSPModel {
std::vector<char> m_EntityData;
std::string m_ModelName;
Q3BSPModel() :
m_Data(),
m_Lumps(),
m_Vertices(),
m_Faces(),
m_Indices(),
m_Textures(),
m_Lightmaps(),
m_EntityData(),
m_ModelName()
{
// empty
}
Q3BSPModel() = default;
~Q3BSPModel() {
for ( unsigned int i=0; i<m_Lumps.size(); i++ ) {

View File

@ -139,7 +139,7 @@ static void normalizePathName(const std::string &rPath, std::string &normalizedP
// ------------------------------------------------------------------------------------------------
// Constructor.
Q3BSPFileImporter::Q3BSPFileImporter() :
m_pCurrentMesh(nullptr), m_pCurrentFace(nullptr), m_MaterialLookupMap(), mTextures() {
m_pCurrentMesh(nullptr), m_pCurrentFace(nullptr) {
// empty
}

View File

@ -96,7 +96,7 @@ void RAWImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open RAW file ", pFile, ".");
}

View File

@ -83,7 +83,6 @@ static const aiImporterDesc desc = {
// Constructor to be privately used by Importer
SMDImporter::SMDImporter() :
configFrameID(),
mBuffer(),
pScene( nullptr ),
iFileSize( 0 ),
iSmallestFrame( INT_MAX ),
@ -535,7 +534,7 @@ void SMDImporter::GetAnimationFileList(const std::string &pFile, IOSystem* pIOHa
auto path = base + "/" + name + "_animation.txt";
std::unique_ptr<IOStream> file(pIOHandler->Open(path.c_str(), "rb"));
if (file.get() == nullptr) {
if (file == nullptr) {
return;
}
@ -591,7 +590,7 @@ void SMDImporter::CreateOutputMaterials() {
pScene->mMaterials[iMat] = pcMat;
aiString szName;
szName.length = (size_t)ai_snprintf(szName.data,MAXLEN,"Texture_%u",iMat);
szName.length = static_cast<ai_uint32>(ai_snprintf(szName.data,MAXLEN,"Texture_%u",iMat));
pcMat->AddProperty(&szName,AI_MATKEY_NAME);
if (aszTextures[iMat].length())
@ -675,7 +674,7 @@ void SMDImporter::ReadSmd(const std::string &pFile, IOSystem* pIOHandler) {
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file
if (file.get() == nullptr) {
if (file == nullptr) {
throw DeadlyImportError("Failed to open SMD/VTA file ", pFile, ".");
}

Some files were not shown because too many files have changed in this diff Show More