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 - name: Set Windows specific CMake arguments
if: contains(matrix.name, 'windows') if: contains(matrix.name, 'windows')
id: windows_extra_cmake_args 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 - name: Set Hunter specific CMake arguments
if: contains(matrix.name, 'hunter') if: contains(matrix.name, 'hunter')

View File

@ -57,3 +57,13 @@ jobs:
- name: test - name: test
run: cd build/bin && ./unit run: cd build/bin && ./unit
shell: bash 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) # Open Asset Import Library (assimp)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Copyright (c) 2006-2022, assimp team # Copyright (c) 2006-2023, assimp team
# #
# All rights reserved. # All rights reserved.
# #
@ -84,10 +84,6 @@ OPTION( ASSIMP_NO_EXPORT
"Disable Assimp's export functionality." "Disable Assimp's export functionality."
OFF OFF
) )
OPTION( ASSIMP_BUILD_ZLIB
"Build your own zlib"
OFF
)
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
"If the supplementary tools for Assimp are built in addition to the library." "If the supplementary tools for Assimp are built in addition to the library."
OFF OFF
@ -134,6 +130,18 @@ OPTION ( ASSIMP_IGNORE_GIT_HASH
OFF 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) IF (WIN32)
# Use subset of Windows.h # Use subset of Windows.h
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
@ -262,13 +270,13 @@ IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT MINGW)
ENDIF() ENDIF()
# hide all not-exported symbols # hide all not-exported symbols
IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" ) IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" )
SET(CMAKE_CXX_FLAGS "-mxgot -fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") SET(CMAKE_CXX_FLAGS "-mxgot -fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}") SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
SET(LIBSTDC++_LIBRARIES -lstdc++) SET(LIBSTDC++_LIBRARIES -lstdc++)
ELSE() ELSE()
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}") SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
SET(LIBSTDC++_LIBRARIES -lstdc++) SET(LIBSTDC++_LIBRARIES -lstdc++)
ENDIF() ENDIF()
ELSEIF(MSVC) ELSEIF(MSVC)
# enable multi-core compilation with MSVC # enable multi-core compilation with MSVC
@ -277,13 +285,15 @@ ELSEIF(MSVC)
ELSE() # msvc ELSE() # msvc
ADD_COMPILE_OPTIONS(/MP /bigobj /W4 /WX) ADD_COMPILE_OPTIONS(/MP /bigobj /W4 /WX)
ENDIF() ENDIF()
# disable "elements of array '' will be default initialized" warning on MSVC2013 # disable "elements of array '' will be default initialized" warning on MSVC2013
IF(MSVC12) IF(MSVC12)
ADD_COMPILE_OPTIONS(/wd4351) ADD_COMPILE_OPTIONS(/wd4351)
ENDIF() 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_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") 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" ) ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
IF(NOT ASSIMP_HUNTER_ENABLED) 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") ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
ENDIF() 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 ) IF( UNIX )
# Use GNUInstallDirs for Unix predefined directories # Use GNUInstallDirs for Unix predefined directories
INCLUDE(GNUInstallDirs) INCLUDE(GNUInstallDirs)
@ -488,7 +490,11 @@ ELSE()
FIND_PACKAGE(ZLIB) FIND_PACKAGE(ZLIB)
ENDIF() 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") MESSAGE(STATUS "compiling zlib from sources")
INCLUDE(CheckIncludeFile) INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize) 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) [![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") [![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") [![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> <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. 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 code/AssetLib/<FormatName> Implementation for import and export for the format
### Where to get help ### ### 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. To find our documentation, visit [our website](https://assimp.org/) or check out [Wiki](https://github.com/assimp/assimp/wiki)
(CHMs for Windows are included in some release packages and should be located right here in the root folder).
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. 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 //! Default constructor
Texture() AI_NO_EXCEPT Texture() AI_NO_EXCEPT
: mTextureBlend(0.0f), : mTextureBlend(0.0f),
mMapName(),
mOffsetU(0.0), mOffsetU(0.0),
mOffsetV(0.0), mOffsetV(0.0),
mScaleU(1.0), mScaleU(1.0),
@ -334,51 +333,11 @@ struct Texture {
mTextureBlend = get_qnan(); mTextureBlend = get_qnan();
} }
Texture(const Texture &other) : Texture(const Texture &other) = default;
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(Texture &&other) AI_NO_EXCEPT : mTextureBlend(other.mTextureBlend), Texture(Texture &&other) AI_NO_EXCEPT = default;
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 &operator=(Texture &&other) AI_NO_EXCEPT { Texture &operator=(Texture &&other) AI_NO_EXCEPT = default;
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;
}
//! Specifies the blend factor for the texture //! Specifies the blend factor for the texture
ai_real mTextureBlend; ai_real mTextureBlend;
@ -436,83 +395,13 @@ struct Material {
// empty // empty
} }
Material(const Material &other) : Material(const Material &other) = default;
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
}
//! Move constructor. This is explicitly written because MSVC doesn't support defaulting it Material(Material &&other) AI_NO_EXCEPT = default;
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 &operator=(Material &&other) AI_NO_EXCEPT { Material &operator=(Material &&other) AI_NO_EXCEPT = default;
if (this == &other) {
return *this;
}
mName = std::move(other.mName); virtual ~Material() = default;
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
}
//! Name of the material //! Name of the material
std::string mName; std::string mName;

View File

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

View File

@ -83,7 +83,7 @@ void ExportScene3MF(const char *pFile, IOSystem *pIOSystem, const aiScene *pScen
namespace D3MF { namespace D3MF {
D3MFExporter::D3MFExporter(const char *pFile, const aiScene *pScene) : 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 // empty
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -815,6 +815,7 @@ nl_clean_loop:
for (; next_it != nodeArray.end(); ++next_it) { for (; next_it != nodeArray.end(); ++next_it) {
if ((*next_it)->FindNode((*nl_it)->mName) != nullptr) { 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. // 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); nodeArray.erase(nl_it);
goto nl_clean_loop; goto nl_clean_loop;

View File

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

View File

@ -62,7 +62,7 @@ namespace Assimp {
class ASEImporter : public BaseImporter { class ASEImporter : public BaseImporter {
public: public:
ASEImporter(); ASEImporter();
~ASEImporter() override; ~ASEImporter() override = default;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file. /** 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 // FIX: There needn't always be a value, sad but true
while (true) { while (true) {
if (*filePtr < '9' && *filePtr >= '0') { if (*filePtr < '9' && *filePtr >= '0') {
out.iSmoothGroup |= (1 << strtoul10(filePtr, &filePtr)); 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); SkipSpaces(&filePtr);
if (',' != *filePtr) { if (',' != *filePtr) {

View File

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

View File

@ -652,7 +652,7 @@ void DumpSceneToAssxml(
const char *pFile, const char *cmd, IOSystem *pIOSystem, const char *pFile, const char *cmd, IOSystem *pIOSystem,
const aiScene *pScene, bool shortened) { const aiScene *pScene, bool shortened) {
std::unique_ptr<IOStream> file(pIOSystem->Open(pFile, "wt")); 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'); 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)); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open B3D file ", pFile, "."); throw DeadlyImportError("Failed to open B3D file ", pFile, ".");
} }
@ -150,7 +150,7 @@ AI_WONT_RETURN void B3DImporter::Fail(const string &str) {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
int B3DImporter::ReadByte() { int B3DImporter::ReadByte() {
if (_pos > _buf.size()) { if (_pos >= _buf.size()) {
Fail("EOF"); Fail("EOF");
} }
@ -253,7 +253,7 @@ size_t B3DImporter::ChunkSize() {
template <class T> template <class T>
T *B3DImporter::to_array(const vector<T> &v) { T *B3DImporter::to_array(const vector<T> &v) {
if (v.empty()) { if (v.empty()) {
return 0; return nullptr;
} }
T *p = new T[v.size()]; T *p = new T[v.size()];
for (size_t i = 0; i < v.size(); ++i) { for (size_t i = 0; i < v.size(); ++i) {
@ -266,7 +266,7 @@ T *B3DImporter::to_array(const vector<T> &v) {
template <class T> template <class T>
T **unique_to_array(vector<std::unique_ptr<T>> &v) { T **unique_to_array(vector<std::unique_ptr<T>> &v) {
if (v.empty()) { if (v.empty()) {
return 0; return nullptr;
} }
T **p = new T *[v.size()]; T **p = new T *[v.size()];
for (size_t i = 0; i < v.size(); ++i) { for (size_t i = 0; i < v.size(); ++i) {
@ -617,7 +617,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
} else if (chunk == "BRUS") { } else if (chunk == "BRUS") {
ReadBRUS(); ReadBRUS();
} else if (chunk == "NODE") { } else if (chunk == "NODE") {
ReadNODE(0); ReadNODE(nullptr);
} }
ExitChunk(); ExitChunk();
} }
@ -642,7 +642,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
int n_tris = mesh->mNumFaces; int n_tris = mesh->mNumFaces;
int n_verts = mesh->mNumVertices = n_tris * 3; 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) { if (_vflags & 1) {
mn = mesh->mNormals = new aiVector3D[n_verts]; 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 // read file into memory
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile)); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open file ", pFile, "."); throw DeadlyImportError("Failed to open file ", pFile, ".");
} }
@ -191,7 +191,7 @@ aiNode *BVHLoader::ReadNode() {
// now read the node's contents // now read the node's contents
std::string siteToken; std::string siteToken;
while (1) { while (true) {
std::string token = GetNextToken(); std::string token = GetNextToken();
// node offset to parent node // 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" // now read the node's contents. Only possible entry is "OFFSET"
std::string token; std::string token;
while (1) { while (true) {
token.clear(); token.clear();
token = GetNextToken(); token = GetNextToken();

View File

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

View File

@ -80,7 +80,7 @@ namespace Assimp
void DestroyTriMesh( ); void DestroyTriMesh( );
void ConvertPolyToFaces( const Blender::MPoly& poly ); void ConvertPolyToFaces( const Blender::MPoly& poly );
void AddFace( int v1, int v2, int v3, int v4 = 0 ); 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; const Blender::Mesh* BMesh;
Blender::Mesh* triMesh; Blender::Mesh* triMesh;

View File

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

View File

@ -106,9 +106,7 @@ struct ElemBase {
// empty // empty
} }
virtual ~ElemBase() { virtual ~ElemBase() = default;
// empty
}
/** Type name of the element. The type /** Type name of the element. The type
* string points is the `c_str` of the `name` attribute of the * 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, const Field &f,
bool) const; 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. /** Represents the full data structure information for a single BLEND file.
* This data is extracted from the DNA1 chunk in the 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 <assimp/StringComparison.h>
#include <cctype> #include <cctype>
#include <memory>
#include <utility> #include <utility>
// zlib is needed for compressed blend files // zlib is needed for compressed blend files
@ -79,8 +80,7 @@ namespace Assimp {
template <> template <>
const char *LogFunctions<BlenderImporter>::Prefix() { const char *LogFunctions<BlenderImporter>::Prefix() {
static auto prefix = "BLEND: "; return "BLEND: ";
return prefix;
} }
} // namespace Assimp } // namespace Assimp
@ -182,7 +182,7 @@ void BlenderImporter::InternReadFile(const std::string &pFile,
} }
// replace the input stream with a memory stream // 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 // .. and retry
stream->Read(magic, 7, 1); stream->Read(magic, 7, 1);
@ -219,7 +219,7 @@ void BlenderImporter::ParseBlendFile(FileDatabase &out, std::shared_ptr<IOStream
out.entries.reserve(128); out.entries.reserve(128);
{ // even small BLEND files tend to consist of many file blocks { // 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 // first parse the file in search for the DNA and insert all other sections into the database
while ((parser.Next(), 1)) { while ((parser.Next(), 1)) {

View File

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

View File

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

View File

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

View File

@ -62,8 +62,7 @@ namspace Assimp
{ {
template< > const char* LogFunctions< BlenderTessellatorGL >::Prefix() template< > const char* LogFunctions< BlenderTessellatorGL >::Prefix()
{ {
static auto prefix = "BLEND_TESS_GL: "; return "BLEND_TESS_GL: ";
return prefix;
} }
} }
@ -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 ) 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() template< > const char* LogFunctions< BlenderTessellatorP2T >::Prefix()
{ {
static auto prefix = "BLEND_TESS_P2T: "; return "BLEND_TESS_P2T: ";
return prefix;
} }
} }

View File

@ -86,8 +86,7 @@ void GetWriterInfo(int &id, String &appname) {
namespace Assimp { namespace Assimp {
template<> const char* LogFunctions<C4DImporter>::Prefix() { template<> const char* LogFunctions<C4DImporter>::Prefix() {
static auto prefix = "C4D: "; return "C4D: ";
return prefix;
} }
} }
@ -106,15 +105,10 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
C4DImporter::C4DImporter() C4DImporter::C4DImporter() = default;
: BaseImporter() {
// empty
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
C4DImporter::~C4DImporter() { C4DImporter::~C4DImporter() = default;
// empty
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
bool C4DImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, bool /*checkSig*/) const { 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 // sort faces by material indices
for (std::shared_ptr<Node> &n : scene.nodes) { for (std::shared_ptr<Node> &n : scene.nodes) {
if (n->type == Node::TYPE_MESH) { if (n->type == Node::TYPE_MESH) {
Mesh &mesh = (Mesh &)(*n.get()); Mesh &mesh = (Mesh &)(*n);
for (Face &f : mesh.faces) { for (Face &f : mesh.faces) {
mesh.temp_map[f.material].push_back(&f); mesh.temp_map[f.material].push_back(&f);
} }
@ -168,7 +168,7 @@ void COBImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// count meshes // count meshes
for (std::shared_ptr<Node> &n : scene.nodes) { for (std::shared_ptr<Node> &n : scene.nodes) {
if (n->type == Node::TYPE_MESH) { if (n->type == Node::TYPE_MESH) {
Mesh &mesh = (Mesh &)(*n.get()); Mesh &mesh = (Mesh &)(*n);
if (mesh.vertex_positions.size() && mesh.texture_coords.size()) { if (mesh.vertex_positions.size() && mesh.texture_coords.size()) {
pScene->mNumMeshes += static_cast<unsigned int>(mesh.temp_map.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 //flip normals after import
FlipWindingOrderProcess flip; FlipWindingOrderProcess flip;
flip.Execute(pScene); flip.Execute(pScene);
@ -868,7 +868,7 @@ void COBImporter::ReadBinaryFile(Scene &out, StreamReaderLE *reader) {
return; return;
} }
while (1) { while (true) {
std::string type; std::string type;
type += reader->GetI1(); type += reader->GetI1();
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(); id[0] = reader.GetI1(), id[1] = reader.GetI1();
if (id[0] == 'e' && id[1] == ':') { if (id[0] == 'e' && id[1] == ':') {
mat.tex_env.reset(new Texture()); mat.tex_env = std::make_shared<Texture>();
reader.GetI1(); reader.GetI1();
ReadString_Binary(mat.tex_env->path, reader); 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] == ':') { if (id[0] == 't' && id[1] == ':') {
mat.tex_color.reset(new Texture()); mat.tex_color = std::make_shared<Texture>();
reader.GetI1(); reader.GetI1();
ReadString_Binary(mat.tex_color->path, reader); 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] == ':') { if (id[0] == 'b' && id[1] == ':') {
mat.tex_bump.reset(new Texture()); mat.tex_bump = std::make_shared<Texture>();
reader.GetI1(); reader.GetI1();
ReadString_Binary(mat.tex_bump->path, reader); 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")); std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if( file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError( "Failed to open CSM file ", pFile, "."); throw DeadlyImportError( "Failed to open CSM file ", pFile, ".");
} }
@ -130,7 +130,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
int first = 0, last = 0x00ffffff; int first = 0, last = 0x00ffffff;
// now process the file and look out for '$' sections // now process the file and look out for '$' sections
while (1) { while (true) {
SkipSpaces(&buffer); SkipSpaces(&buffer);
if ('\0' == *buffer) if ('\0' == *buffer)
break; break;
@ -154,7 +154,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
else if (TokenMatchI(buffer,"order",5)) { else if (TokenMatchI(buffer,"order",5)) {
std::vector< aiNodeAnim* > anims_temp; std::vector< aiNodeAnim* > anims_temp;
anims_temp.reserve(30); anims_temp.reserve(30);
while (1) { while (true) {
SkipSpaces(&buffer); SkipSpaces(&buffer);
if (IsLineEnd(*buffer) && SkipSpacesAndLineEnd(&buffer) && *buffer == '$') if (IsLineEnd(*buffer) && SkipSpacesAndLineEnd(&buffer) && *buffer == '$')
break; // next section break; // next section
@ -196,7 +196,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
unsigned int filled = 0; unsigned int filled = 0;
// Now read all point data. // Now read all point data.
while (1) { while (true) {
SkipSpaces(&buffer); SkipSpaces(&buffer);
if (IsLineEnd(*buffer) && (!SkipSpacesAndLineEnd(&buffer) || *buffer == '$')) { if (IsLineEnd(*buffer) && (!SkipSpacesAndLineEnd(&buffer) || *buffer == '$')) {
break; // next section break; // next section

View File

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

View File

@ -101,7 +101,7 @@ protected:
void WritePointLight(const aiLight *const light); void WritePointLight(const aiLight *const light);
void WriteDirectionalLight(const aiLight *const light); void WriteDirectionalLight(const aiLight *const light);
void WriteSpotLight(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 /// Writes the controller library
void WriteControllerLibrary(); void WriteControllerLibrary();

View File

@ -666,7 +666,7 @@ struct ChannelEntry {
const Collada::Accessor *mTimeAccessor; ///> Collada accessor to the time values const Collada::Accessor *mTimeAccessor; ///> Collada accessor to the time values
const Collada::Data *mTimeData; ///> Source data array for 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::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() : ChannelEntry() :
mChannel(), 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 // Constructor to be privately used by Importer
ColladaLoader::ColladaLoader() : ColladaLoader::ColladaLoader() :
mFileName(),
mMeshIndexByID(),
mMaterialIndexByName(),
mMeshes(),
newMats(),
mCameras(),
mLights(),
mTextures(),
mAnims(),
noSkeletonMesh(false), noSkeletonMesh(false),
removeEmptyBones(false), removeEmptyBones(false),
ignoreUpDirection(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 // 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. // and apply them to the transform chain. Then the node's present transformation can be calculated.
ai_real time = startTime; ai_real time = startTime;
while (1) { while (true) {
for (ChannelEntry & e : entries) { for (ChannelEntry & e : entries) {
// find the keyframe behind the current point in time // find the keyframe behind the current point in time
size_t pos = 0; size_t pos = 0;
ai_real postTime = 0.0; ai_real postTime = 0.0;
while (1) { while (true) {
if (pos >= e.mTimeAccessor->mCount) { if (pos >= e.mTimeAccessor->mCount) {
break; break;
} }
@ -1680,7 +1671,7 @@ aiString ColladaLoader::FindFilenameForEffectTexture(const ColladaParser &pParse
// recurse through the param references until we end up at an image // recurse through the param references until we end up at an image
std::string name = pName; std::string name = pName;
while (1) { while (true) {
// the given string is a param entry. Find it // the given string is a param entry. Find it
Effect::ParamLibrary::const_iterator it = pEffect.mParams.find(name); 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 // 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 { } else {
// attempt to open the file directly // attempt to open the file directly
daefile.reset(pIOHandler->Open(pFile)); daefile.reset(pIOHandler->Open(pFile));
if (daefile.get() == nullptr) { if (daefile == nullptr) {
throw DeadlyImportError("Failed to open file '", pFile, "'."); throw DeadlyImportError("Failed to open file '", pFile, "'.");
} }
} }
@ -759,9 +759,10 @@ void ColladaParser::ReadControllerWeights(XmlNode &node, Collada::Controller &pC
XmlParser::getValueAsString(currentNode, stdText); XmlParser::getValueAsString(currentNode, stdText);
const char *text = stdText.c_str(); 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) { 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>"); throw DeadlyImportError("Out of data while reading <vertex_weights>");
} }
SkipSpacesAndLineEnd(&text);
it->first = strtoul10(text, &text); it->first = strtoul10(text, &text);
SkipSpacesAndLineEnd(&text); SkipSpacesAndLineEnd(&text);
if (*text == 0) { if (*text == 0) {

View File

@ -65,7 +65,6 @@ public:
LineReader(StreamReaderLE& reader) LineReader(StreamReaderLE& reader)
: splitter(reader,false,true) : splitter(reader,false,true)
, groupcode( 0 ) , groupcode( 0 )
, value()
, end() { , end() {
// empty // empty
} }
@ -186,8 +185,7 @@ struct InsertBlock {
InsertBlock() InsertBlock()
: pos() : pos()
, scale(1.f,1.f,1.f) , scale(1.f,1.f,1.f)
, angle() , angle() {
, name() {
// empty // 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) ); std::shared_ptr<IOStream> file = std::shared_ptr<IOStream>( pIOHandler->Open( filename) );
// Check whether we can read the file // Check whether we can read the file
if( file.get() == nullptr ) { if (file == nullptr) {
throw DeadlyImportError( "Failed to open DXF file ", filename, ""); 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', '\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?) }; // 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 SEPARATOR = { '\x00', '\x01' }; // for use inside strings
const std::string MAGIC_NODE_TAG = "_$AssimpFbx$"; // from import const std::string MAGIC_NODE_TAG = "_$AssimpFbx$"; // from import
const int64_t SECOND = 46186158000; // FBX's kTime unit 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 (mat) {
if (materials_converted.find(mat) == materials_converted.end()) { 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()); data->Set(index++, prop.first, interpretedBool->Value());
} else if (const TypedProperty<int> *interpretedInt = prop.second->As<TypedProperty<int>>()) { } else if (const TypedProperty<int> *interpretedInt = prop.second->As<TypedProperty<int>>()) {
data->Set(index++, prop.first, interpretedInt->Value()); 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>>()) { } else if (const TypedProperty<uint64_t> *interpretedUint64 = prop.second->As<TypedProperty<uint64_t>>()) {
data->Set(index++, prop.first, interpretedUint64->Value()); 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>>()) { } else if (const TypedProperty<float> *interpretedFloat = prop.second->As<TypedProperty<float>>()) {
data->Set(index++, prop.first, interpretedFloat->Value()); data->Set(index++, prop.first, interpretedFloat->Value());
} else if (const TypedProperty<std::string> *interpretedString = prop.second->As<TypedProperty<std::string>>()) { } 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; std::vector<aiAnimMesh *> animMeshes;
for (const BlendShape *blendShape : mesh.GetBlendShapes()) { for (const BlendShape *blendShape : mesh.GetBlendShapes()) {
for (const BlendShapeChannel *blendShapeChannel : blendShape->BlendShapeChannels()) { for (const BlendShapeChannel *blendShapeChannel : blendShape->BlendShapeChannels()) {
const std::vector<const ShapeGeometry *> &shapeGeometries = blendShapeChannel->GetShapeGeometries(); const auto& shapeGeometries = blendShapeChannel->GetShapeGeometries();
for (size_t i = 0; i < shapeGeometries.size(); i++) { for (const ShapeGeometry *shapeGeometry : shapeGeometries) {
aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh); aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh);
const ShapeGeometry *shapeGeometry = shapeGeometries.at(i); const auto &curVertices = shapeGeometry->GetVertices();
const std::vector<aiVector3D> &curVertices = shapeGeometry->GetVertices(); const auto &curNormals = shapeGeometry->GetNormals();
const std::vector<aiVector3D> &curNormals = shapeGeometry->GetNormals(); const auto &curIndices = shapeGeometry->GetIndices();
const std::vector<unsigned int> &curIndices = shapeGeometry->GetIndices();
//losing channel name if using shapeGeometry->Name() //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++) { for (size_t j = 0; j < curIndices.size(); j++) {
const unsigned int curIndex = curIndices.at(j); const unsigned int curIndex = curIndices.at(j);
aiVector3D vertex = curVertices.at(j); aiVector3D vertex = curVertices.at(j);
@ -1406,13 +1418,12 @@ unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry &mesh, co
std::vector<aiAnimMesh *> animMeshes; std::vector<aiAnimMesh *> animMeshes;
for (const BlendShape *blendShape : mesh.GetBlendShapes()) { for (const BlendShape *blendShape : mesh.GetBlendShapes()) {
for (const BlendShapeChannel *blendShapeChannel : blendShape->BlendShapeChannels()) { for (const BlendShapeChannel *blendShapeChannel : blendShape->BlendShapeChannels()) {
const std::vector<const ShapeGeometry *> &shapeGeometries = blendShapeChannel->GetShapeGeometries(); const auto& shapeGeometries = blendShapeChannel->GetShapeGeometries();
for (size_t i = 0; i < shapeGeometries.size(); i++) { for (const ShapeGeometry *shapeGeometry : shapeGeometries) {
aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh); aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh);
const ShapeGeometry *shapeGeometry = shapeGeometries.at(i); const auto& curVertices = shapeGeometry->GetVertices();
const std::vector<aiVector3D> &curVertices = shapeGeometry->GetVertices(); const auto& curNormals = shapeGeometry->GetNormals();
const std::vector<aiVector3D> &curNormals = shapeGeometry->GetNormals(); const auto& curIndices = shapeGeometry->GetIndices();
const std::vector<unsigned int> &curIndices = shapeGeometry->GetIndices();
animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name())); animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name()));
for (size_t j = 0; j < curIndices.size(); j++) { for (size_t j = 0; j < curIndices.size(); j++) {
unsigned int curIndex = curIndices.at(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->mWeights = bone->mWeights;
skeletonBone->mOffsetMatrix = bone->mOffsetMatrix; skeletonBone->mOffsetMatrix = bone->mOffsetMatrix;
skeletonBone->mMeshId = mesh; skeletonBone->mMeshId = mesh;
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
skeletonBone->mNode = bone->mNode; skeletonBone->mNode = bone->mNode;
#endif
skeletonBone->mParent = -1; 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) { for (const Connection* con : conns) {
const BlendShapeChannel* const bspc = ProcessSimpleConnection<BlendShapeChannel>(*con, false, "BlendShapeChannel -> BlendShape", element); const BlendShapeChannel* const bspc = ProcessSimpleConnection<BlendShapeChannel>(*con, false, "BlendShapeChannel -> BlendShape", element);
if (bspc) { if (bspc) {
blendShapeChannels.push_back(bspc); auto pr = blendShapeChannels.insert(bspc);
continue; 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) { for (const Connection* con : conns) {
const ShapeGeometry* const sg = ProcessSimpleConnection<ShapeGeometry>(*con, false, "Shape -> BlendShapeChannel", element); const ShapeGeometry* const sg = ProcessSimpleConnection<ShapeGeometry>(*con, false, "Shape -> BlendShapeChannel", element);
if (sg) { if (sg) {
shapeGeometries.push_back(sg); auto pr = shapeGeometries.insert(sg);
continue; 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; return nullptr;
} }
if (object.get()) { if (object) {
return object.get(); return object.get();
} }
@ -222,7 +222,7 @@ const Object* LazyObject::Get(bool dieOnError) {
return nullptr; return nullptr;
} }
if (!object.get()) { if (!object) {
//DOMError("failed to convert element to DOM object, class: " + classtag + ", name: " + name,&element); //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); 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); DOMWarning("encountered duplicate object id, ignoring first occurrence",el.second);
delete foundObject->second;
} }
objects[id] = new LazyObject(id, *el.second, *this); 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 #define INCLUDED_AI_FBX_DOCUMENT_H
#include <numeric> #include <numeric>
#include <unordered_set>
#include <stdint.h> #include <stdint.h>
#include <assimp/mesh.h> #include <assimp/mesh.h>
#include "FBXProperties.h" #include "FBXProperties.h"
@ -168,7 +169,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
private: private:
@ -432,7 +433,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
/** Get material links */ /** Get material links */
@ -503,7 +504,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
// return a 4-tuple // return a 4-tuple
@ -618,7 +619,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
const uint8_t* Content() const { const uint8_t* Content() const {
@ -632,7 +633,7 @@ public:
uint8_t* RelinquishContent() { uint8_t* RelinquishContent() {
uint8_t* ptr = content; uint8_t* ptr = content;
content = 0; content = nullptr;
return ptr; return ptr;
} }
@ -663,7 +664,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
const TextureMap& Textures() const { const TextureMap& Textures() const {
@ -735,7 +736,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
@ -780,7 +781,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
/* the optional white list specifies a list of property names for which the caller /* the optional white list specifies a list of property names for which the caller
@ -808,7 +809,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
const AnimationLayerList& Layers() const { const AnimationLayerList& Layers() const {
@ -829,7 +830,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
private: private:
@ -855,14 +856,14 @@ public:
return fullWeights; return fullWeights;
} }
const std::vector<const ShapeGeometry*>& GetShapeGeometries() const { const std::unordered_set<const ShapeGeometry*>& GetShapeGeometries() const {
return shapeGeometries; return shapeGeometries;
} }
private: private:
float percent; float percent;
WeightArray fullWeights; WeightArray fullWeights;
std::vector<const ShapeGeometry*> shapeGeometries; std::unordered_set<const ShapeGeometry*> shapeGeometries;
}; };
/** DOM class for BlendShape deformers */ /** DOM class for BlendShape deformers */
@ -872,12 +873,12 @@ public:
virtual ~BlendShape(); virtual ~BlendShape();
const std::vector<const BlendShapeChannel*>& BlendShapeChannels() const { const std::unordered_set<const BlendShapeChannel*>& BlendShapeChannels() const {
return blendShapeChannels; return blendShapeChannels;
} }
private: private:
std::vector<const BlendShapeChannel*> blendShapeChannels; std::unordered_set<const BlendShapeChannel*> blendShapeChannels;
}; };
/** DOM class for skin deformer clusters (aka sub-deformers) */ /** DOM class for skin deformer clusters (aka sub-deformers) */
@ -1018,7 +1019,7 @@ public:
const PropertyTable& Props() const { const PropertyTable& Props() const {
ai_assert(props.get()); ai_assert(props.get());
return *props.get(); return *props;
} }
const Document& GetDocument() const { const Document& GetDocument() const {
@ -1097,7 +1098,7 @@ public:
const FileGlobalSettings& GlobalSettings() const { const FileGlobalSettings& GlobalSettings() const {
ai_assert(globals.get()); ai_assert(globals.get());
return *globals.get(); return *globals;
} }
const PropertyTemplateMap& Templates() const { const PropertyTemplateMap& Templates() const {

View File

@ -58,12 +58,11 @@ namespace Util {
/* DOM/Parse error reporting - does not return */ /* 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 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 // does return
void DOMWarning(const std::string& message, const Token& token); 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 // fetch a property table and the corresponding property template
std::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc, std::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,

View File

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

View File

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

View File

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

View File

@ -62,8 +62,7 @@ namespace Assimp {
template <> template <>
const char *LogFunctions<FBXImporter>::Prefix() { const char *LogFunctions<FBXImporter>::Prefix() {
static auto prefix = "FBX: "; return "FBX: ";
return prefix;
} }
} // namespace Assimp } // namespace Assimp
@ -90,10 +89,7 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Constructor to be privately used by #Importer // Constructor to be privately used by #Importer
FBXImporter::FBXImporter() : FBXImporter::FBXImporter() = default;
mSettings() {
// empty
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file. // 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) : Video::Video(uint64_t id, const Element &element, const Document &doc, const std::string &name) :
Object(id,element,name), Object(id, element, name),
contentLength(0), contentLength(0),
content(0) { content(nullptr) {
const Scope& sc = GetRequiredScope(element); const Scope& sc = GetRequiredScope(element);
const Element* const Type = sc["Type"]; 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); props = GetPropertyTable(doc,"Video.FbxVideo",element,sc);
} }
Video::~Video() { Video::~Video() {
delete[] content; 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); const BlendShape* const bsp = ProcessSimpleConnection<BlendShape>(*con, false, "BlendShape -> Geometry", element);
if (bsp) { 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; return blendShapes;
} }

View File

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

View File

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

View File

@ -154,7 +154,6 @@ private:
const unsigned int column; 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 const Token* TokenPtr;
typedef std::vector< TokenPtr > TokenList; 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)); std::unique_ptr<IOStream> file(mIOHandler->Open(pFile));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open HMP file ", pFile, "."); throw DeadlyImportError("Failed to open HMP file ", pFile, ".");
} }

View File

@ -388,8 +388,8 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPoly
n.Normalize(); n.Normalize();
// obtain the polygonal bounding volume // obtain the polygonal bounding volume
std::shared_ptr<TempMesh> profile = std::shared_ptr<TempMesh>(new TempMesh()); std::shared_ptr<TempMesh> profile = std::make_shared<TempMesh>();
if (!ProcessCurve(hs->PolygonalBoundary, *profile.get(), conv)) { if (!ProcessCurve(hs->PolygonalBoundary, *profile, conv)) {
IFCImporter::LogError("expected valid polyline for boundary of boolean halfspace"); IFCImporter::LogError("expected valid polyline for boundary of boolean halfspace");
return; return;
} }
@ -672,7 +672,7 @@ void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedArea
// operand should be near-planar. Luckily, this is usually the case in Ifc // operand should be near-planar. Luckily, this is usually the case in Ifc
// buildings. // 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); ProcessExtrudedAreaSolid(*as, *meshtmp, conv, false);
std::vector<TempOpening> openings(1, TempOpening(as, IfcVector3(0, 0, 0), std::move(meshtmp), std::shared_ptr<TempMesh>())); 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()); nors.reserve(conv.apply_openings->size());
for(TempOpening& t : *conv.apply_openings) { for(TempOpening& t : *conv.apply_openings) {
TempMesh& bounds = *t.profileMesh.get(); TempMesh &bounds = *t.profileMesh;
if( bounds.mVerts.size() <= 2 ) { if( bounds.mVerts.size() <= 2 ) {
nors.emplace_back(); 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 ::Assimp::STEP::EXPRESS::ENTITY& e = shell->To<::Assimp::STEP::EXPRESS::ENTITY>();
const Schema_2x3::IfcConnectedFaceSet& fs = conv.db.MustGetObject(e).To<Schema_2x3::IfcConnectedFaceSet>(); 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&) { catch(std::bad_cast&) {
IFCImporter::LogWarn("unexpected type error, IfcShell ought to inherit from IfcConnectedFaceSet"); 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; fix_orientation = true;
} }
else if(const Schema_2x3::IfcConnectedFaceSet* fset = geo.ToPtr<Schema_2x3::IfcConnectedFaceSet>()) { else if(const Schema_2x3::IfcConnectedFaceSet* fset = geo.ToPtr<Schema_2x3::IfcConnectedFaceSet>()) {
ProcessConnectedFaceSet(*fset,*meshtmp.get(),conv); ProcessConnectedFaceSet(*fset, *meshtmp, conv);
fix_orientation = true; fix_orientation = true;
} }
else if(const Schema_2x3::IfcSweptAreaSolid* swept = geo.ToPtr<Schema_2x3::IfcSweptAreaSolid>()) { 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>()) { 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>()) { 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; fix_orientation = true;
} }
else if(const Schema_2x3::IfcFaceBasedSurfaceModel* surf = geo.ToPtr<Schema_2x3::IfcFaceBasedSurfaceModel>()) { else if(const Schema_2x3::IfcFaceBasedSurfaceModel* surf = geo.ToPtr<Schema_2x3::IfcFaceBasedSurfaceModel>()) {
for(const Schema_2x3::IfcConnectedFaceSet& fc : surf->FbsmFaces) { for(const Schema_2x3::IfcConnectedFaceSet& fc : surf->FbsmFaces) {
ProcessConnectedFaceSet(fc,*meshtmp.get(),conv); ProcessConnectedFaceSet(fc, *meshtmp, conv);
} }
fix_orientation = true; fix_orientation = true;
} }
else if(const Schema_2x3::IfcBooleanResult* boolean = geo.ToPtr<Schema_2x3::IfcBooleanResult>()) { 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>()) { else if(geo.ToPtr<Schema_2x3::IfcBoundingBox>()) {
// silently skip over bounding boxes // 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 <iterator>
#include <limits> #include <limits>
#include <memory>
#include <tuple> #include <tuple>
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC #ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
@ -72,8 +73,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp { namespace Assimp {
template <> template <>
const char *LogFunctions<IFCImporter>::Prefix() { const char *LogFunctions<IFCImporter>::Prefix() {
static auto prefix = "IFC: "; return "IFC: ";
return prefix;
} }
} // namespace Assimp } // namespace Assimp
@ -186,7 +186,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
// get file size, etc. // get file size, etc.
unz_file_info fileInfo; unz_file_info fileInfo;
char filename[256]; 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") { if (GetExtension(filename) != "ifc") {
continue; continue;
} }
@ -211,7 +211,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
ThrowException("Failed to decompress IFC ZIP file"); ThrowException("Failed to decompress IFC ZIP file");
} }
unzCloseCurrentFile(zip); 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) { if (unzGoToNextFile(zip) == UNZ_END_OF_LIST_OF_FILE) {
ThrowException("Found no IFC file member in IFCZIP file (1)"); ThrowException("Found no IFC file member in IFCZIP file (1)");
} }

View File

@ -1065,28 +1065,28 @@ 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; } 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; } 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`")); } 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 do { // convert the 'OwnerHistory' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'Name' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[2]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); 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`")); } 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 do { // convert the 'Description' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[3]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Description, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcObjectDefinition>(const DB& db, const LIST& params, IfcObjectDefinition* in) template <> size_t GenericFill<IfcObjectDefinition>(const DB& db, const LIST& params, IfcObjectDefinition* in)
@ -1152,28 +1152,28 @@ 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; } 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; } 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`")); } 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 do { // convert the 'RepresentationIdentifier' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RepresentationIdentifier, arg, db ); 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`")); } 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 do { // convert the 'RepresentationType' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[2]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RepresentationType, arg, db ); 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`")); } 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 do { // convert the 'Items' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcShapeModel>(const DB& db, const LIST& params, IfcShapeModel* in) template <> size_t GenericFill<IfcShapeModel>(const DB& db, const LIST& params, IfcShapeModel* in)
@ -1239,8 +1239,8 @@ template <> size_t GenericFill<IfcObject>(const DB& db, const LIST& params, IfcO
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ObjectType, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcControl>(const DB& db, const LIST& params, IfcControl* in) template <> size_t GenericFill<IfcControl>(const DB& db, const LIST& params, IfcControl* in)
@ -1292,21 +1292,21 @@ template <> size_t GenericFill<IfcProductRepresentation>(const DB& db, const LIS
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); 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`")); } 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 do { // convert the 'Description' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProductRepresentation,3>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Description, arg, db ); 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`")); } 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 do { // convert the 'Representations' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcProduct>(const DB& db, const LIST& params, IfcProduct* in) template <> size_t GenericFill<IfcProduct>(const DB& db, const LIST& params, IfcProduct* in)
@ -1318,15 +1318,15 @@ template <> size_t GenericFill<IfcProduct>(const DB& db, const LIST& params, Ifc
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ObjectPlacement, arg, db ); 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`")); } 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 do { // convert the 'Representation' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProduct,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Representation, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcElement>(const DB& db, const LIST& params, IfcElement* in) template <> size_t GenericFill<IfcElement>(const DB& db, const LIST& params, IfcElement* in)
@ -1338,8 +1338,8 @@ template <> size_t GenericFill<IfcElement>(const DB& db, const LIST& params, Ifc
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Tag, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcDistributionElement>(const DB& db, const LIST& params, IfcDistributionElement* in) template <> size_t GenericFill<IfcDistributionElement>(const DB& db, const LIST& params, IfcDistributionElement* in)
@ -1376,14 +1376,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'SelfIntersect' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<Ifc2DCompositeCurve>(const DB& db, const LIST& params, Ifc2DCompositeCurve* in) template <> size_t GenericFill<Ifc2DCompositeCurve>(const DB& db, const LIST& params, Ifc2DCompositeCurve* in)
@ -1402,28 +1402,28 @@ template <> size_t GenericFill<IfcCartesianTransformationOperator>(const DB& db,
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis1, arg, db ); 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`")); } 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 do { // convert the 'Axis2' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis2, arg, db ); 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`")); } 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 do { // convert the 'LocalOrigin' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'Scale' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[3]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Scale, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCartesianTransformationOperator3D>(const DB& db, const LIST& params, IfcCartesianTransformationOperator3D* in) template <> size_t GenericFill<IfcCartesianTransformationOperator3D>(const DB& db, const LIST& params, IfcCartesianTransformationOperator3D* in)
@ -1435,8 +1435,8 @@ template <> size_t GenericFill<IfcCartesianTransformationOperator3D>(const DB& d
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis3, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcProperty>(const DB& db, const LIST& params, IfcProperty* in) template <> size_t GenericFill<IfcProperty>(const DB& db, const LIST& params, IfcProperty* in)
@ -1447,15 +1447,15 @@ 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; } 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; } 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`")); } 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 do { // convert the 'Description' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProperty,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Description, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSimpleProperty>(const DB& db, const LIST& params, IfcSimpleProperty* in) template <> size_t GenericFill<IfcSimpleProperty>(const DB& db, const LIST& params, IfcSimpleProperty* in)
@ -1499,8 +1499,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPlane>(const DB& db, const LIST& params, IfcPlane* in) template <> size_t GenericFill<IfcPlane>(const DB& db, const LIST& params, IfcPlane* in)
@ -1517,20 +1517,20 @@ 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; } 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; } 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`")); } 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 do { // convert the 'FirstOperand' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'SecondOperand' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBooleanClippingResult>(const DB& db, const LIST& params, IfcBooleanClippingResult* in) template <> size_t GenericFill<IfcBooleanClippingResult>(const DB& db, const LIST& params, IfcBooleanClippingResult* in)
@ -1553,8 +1553,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcFlowTerminalType>(const DB& db, const LIST& params, IfcFlowTerminalType* in) template <> size_t GenericFill<IfcFlowTerminalType>(const DB& db, const LIST& params, IfcFlowTerminalType* in)
@ -1632,13 +1632,13 @@ template <> size_t GenericFill<IfcRelFillsElement>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; } 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`")); } 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 do { // convert the 'RelatedBuildingElement' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcProcedure>(const DB& db, const LIST& params, IfcProcedure* in) template <> size_t GenericFill<IfcProcedure>(const DB& db, const LIST& params, IfcProcedure* in)
@ -1683,13 +1683,13 @@ template <> size_t GenericFill<IfcRelContainedInSpatialStructure>(const DB& db,
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatedElements, arg, db ); break; } 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`")); } 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 do { // convert the 'RelatingStructure' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatingStructure, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcTopologicalRepresentationItem>(const DB& db, const LIST& params, IfcTopologicalRepresentationItem* in) template <> size_t GenericFill<IfcTopologicalRepresentationItem>(const DB& db, const LIST& params, IfcTopologicalRepresentationItem* in)
@ -1774,8 +1774,8 @@ template <> size_t GenericFill<IfcDirection>(const DB& db, const LIST& params, I
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->DirectionRatios, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcProfileDef>(const DB& db, const LIST& params, IfcProfileDef* in) template <> size_t GenericFill<IfcProfileDef>(const DB& db, const LIST& params, IfcProfileDef* in)
@ -1786,15 +1786,15 @@ 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; } 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; } 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`")); } 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 do { // convert the 'ProfileName' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProfileDef,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ProfileName, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcParameterizedProfileDef>(const DB& db, const LIST& params, IfcParameterizedProfileDef* in) template <> size_t GenericFill<IfcParameterizedProfileDef>(const DB& db, const LIST& params, IfcParameterizedProfileDef* in)
@ -1805,8 +1805,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCShapeProfileDef>(const DB& db, const LIST& params, IfcCShapeProfileDef* in) template <> size_t GenericFill<IfcCShapeProfileDef>(const DB& db, const LIST& params, IfcCShapeProfileDef* in)
@ -1912,8 +1912,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCircleHollowProfileDef>(const DB& db, const LIST& params, IfcCircleHollowProfileDef* in) template <> size_t GenericFill<IfcCircleHollowProfileDef>(const DB& db, const LIST& params, IfcCircleHollowProfileDef* in)
@ -1923,8 +1923,8 @@ template <> size_t GenericFill<IfcCircleHollowProfileDef>(const DB& db, const LI
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->WallThickness, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPlacement>(const DB& db, const LIST& params, IfcPlacement* in) template <> size_t GenericFill<IfcPlacement>(const DB& db, const LIST& params, IfcPlacement* in)
@ -1935,8 +1935,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcAxis2Placement3D>(const DB& db, const LIST& params, IfcAxis2Placement3D* in) template <> size_t GenericFill<IfcAxis2Placement3D>(const DB& db, const LIST& params, IfcAxis2Placement3D* in)
@ -1947,14 +1947,14 @@ template <> size_t GenericFill<IfcAxis2Placement3D>(const DB& db, const LIST& pa
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis, arg, db ); 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`")); } 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 do { // convert the 'RefDirection' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefDirection, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPresentationStyle>(const DB& db, const LIST& params, IfcPresentationStyle* in) template <> size_t GenericFill<IfcPresentationStyle>(const DB& db, const LIST& params, IfcPresentationStyle* in)
@ -1966,8 +1966,8 @@ template <> size_t GenericFill<IfcPresentationStyle>(const DB& db, const LIST& p
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcEquipmentElement>(const DB& db, const LIST& params, IfcEquipmentElement* in) template <> size_t GenericFill<IfcEquipmentElement>(const DB& db, const LIST& params, IfcEquipmentElement* in)
@ -1984,18 +1984,18 @@ template <> size_t GenericFill<IfcCompositeCurveSegment>(const DB& db, const LIS
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Transition, arg, db ); break; } 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`")); } 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 do { // convert the 'SameSense' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SameSense, arg, db ); break; } 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`")); } 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 do { // convert the 'ParentCurve' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ParentCurve, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcRectangleProfileDef>(const DB& db, const LIST& params, IfcRectangleProfileDef* in) template <> size_t GenericFill<IfcRectangleProfileDef>(const DB& db, const LIST& params, IfcRectangleProfileDef* in)
@ -2006,14 +2006,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'YDim' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBuildingElementProxy>(const DB& db, const LIST& params, IfcBuildingElementProxy* in) template <> size_t GenericFill<IfcBuildingElementProxy>(const DB& db, const LIST& params, IfcBuildingElementProxy* in)
@ -2108,13 +2108,13 @@ template <> size_t GenericFill<IfcLocalPlacement>(const DB& db, const LIST& para
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->PlacementRelTo, arg, db ); 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`")); } 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 do { // convert the 'RelativePlacement' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelativePlacement, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSweptAreaSolid>(const DB& db, const LIST& params, IfcSweptAreaSolid* in) template <> size_t GenericFill<IfcSweptAreaSolid>(const DB& db, const LIST& params, IfcSweptAreaSolid* in)
@ -2125,14 +2125,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'Position' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcRevolvedAreaSolid>(const DB& db, const LIST& params, IfcRevolvedAreaSolid* in) template <> size_t GenericFill<IfcRevolvedAreaSolid>(const DB& db, const LIST& params, IfcRevolvedAreaSolid* in)
@ -2142,13 +2142,13 @@ template <> size_t GenericFill<IfcRevolvedAreaSolid>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Axis, arg, db ); break; } 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`")); } 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 do { // convert the 'Angle' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Angle, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcStructuralSurfaceConnection>(const DB& db, const LIST& params, IfcStructuralSurfaceConnection* in) template <> size_t GenericFill<IfcStructuralSurfaceConnection>(const DB& db, const LIST& params, IfcStructuralSurfaceConnection* in)
@ -2172,29 +2172,29 @@ template <> size_t GenericFill<IfcSweptDiskSolid>(const DB& db, const LIST& para
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Directrix, arg, db ); break; } 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`")); } 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 do { // convert the 'Radius' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Radius, arg, db ); break; } 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`")); } 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 do { // convert the 'InnerRadius' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->InnerRadius, arg, db ); 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`")); } 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 do { // convert the 'StartParam' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->StartParam, arg, db ); break; } 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`")); } 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 do { // convert the 'EndParam' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->EndParam, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcHalfSpaceSolid>(const DB& db, const LIST& params, IfcHalfSpaceSolid* in) template <> size_t GenericFill<IfcHalfSpaceSolid>(const DB& db, const LIST& params, IfcHalfSpaceSolid* in)
@ -2205,14 +2205,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'AgreementFlag' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPolygonalBoundedHalfSpace>(const DB& db, const LIST& params, IfcPolygonalBoundedHalfSpace* in) template <> size_t GenericFill<IfcPolygonalBoundedHalfSpace>(const DB& db, const LIST& params, IfcPolygonalBoundedHalfSpace* in)
@ -2222,13 +2222,13 @@ template <> size_t GenericFill<IfcPolygonalBoundedHalfSpace>(const DB& db, const
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Position, arg, db ); break; } 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`")); } 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 do { // convert the 'PolygonalBoundary' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->PolygonalBoundary, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcTimeSeriesSchedule>(const DB& db, const LIST& params, IfcTimeSeriesSchedule* in) template <> size_t GenericFill<IfcTimeSeriesSchedule>(const DB& db, const LIST& params, IfcTimeSeriesSchedule* in)
@ -2253,24 +2253,24 @@ template <> size_t GenericFill<IfcProject>(const DB& db, const LIST& params, Ifc
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->LongName, arg, db ); 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`")); } 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 do { // convert the 'Phase' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Phase, arg, db ); 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`")); } 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 do { // convert the 'RepresentationContexts' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RepresentationContexts, arg, db ); break; } 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`")); } 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 do { // convert the 'UnitsInContext' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->UnitsInContext, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcEvaporatorType>(const DB& db, const LIST& params, IfcEvaporatorType* in) template <> size_t GenericFill<IfcEvaporatorType>(const DB& db, const LIST& params, IfcEvaporatorType* in)
@ -2329,28 +2329,28 @@ template <> size_t GenericFill<IfcTrimmedCurve>(const DB& db, const LIST& params
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->BasisCurve, arg, db ); break; } 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`")); } 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 do { // convert the 'Trim1' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Trim1, arg, db ); break; } 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`")); } 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 do { // convert the 'Trim2' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Trim2, arg, db ); break; } 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`")); } 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 do { // convert the 'SenseAgreement' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SenseAgreement, arg, db ); break; } 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`")); } 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 do { // convert the 'MasterRepresentation' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MasterRepresentation, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcRelDefines>(const DB& db, const LIST& params, IfcRelDefines* in) template <> size_t GenericFill<IfcRelDefines>(const DB& db, const LIST& params, IfcRelDefines* in)
@ -2361,8 +2361,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcRelDefinesByProperties>(const DB& db, const LIST& params, IfcRelDefinesByProperties* in) template <> size_t GenericFill<IfcRelDefinesByProperties>(const DB& db, const LIST& params, IfcRelDefinesByProperties* in)
@ -2373,8 +2373,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcActor>(const DB& db, const LIST& params, IfcActor* in) template <> size_t GenericFill<IfcActor>(const DB& db, const LIST& params, IfcActor* in)
@ -2406,8 +2406,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPermit>(const DB& db, const LIST& params, IfcPermit* in) template <> size_t GenericFill<IfcPermit>(const DB& db, const LIST& params, IfcPermit* in)
@ -2572,14 +2572,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'RelatedObjects' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCovering>(const DB& db, const LIST& params, IfcCovering* in) template <> size_t GenericFill<IfcCovering>(const DB& db, const LIST& params, IfcCovering* in)
@ -2596,8 +2596,8 @@ template <> size_t GenericFill<IfcPolyline>(const DB& db, const LIST& params, If
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Points, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPath>(const DB& db, const LIST& params, IfcPath* in) template <> size_t GenericFill<IfcPath>(const DB& db, const LIST& params, IfcPath* in)
@ -2628,13 +2628,13 @@ template <> size_t GenericFill<IfcMappedItem>(const DB& db, const LIST& params,
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappingSource, arg, db ); break; } 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`")); } 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 do { // convert the 'MappingTarget' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappingTarget, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcRectangularPyramid>(const DB& db, const LIST& params, IfcRectangularPyramid* in) template <> size_t GenericFill<IfcRectangularPyramid>(const DB& db, const LIST& params, IfcRectangularPyramid* in)
@ -2660,14 +2660,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'UnitType' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcContextDependentUnit>(const DB& db, const LIST& params, IfcContextDependentUnit* in) template <> size_t GenericFill<IfcContextDependentUnit>(const DB& db, const LIST& params, IfcContextDependentUnit* in)
@ -2721,14 +2721,14 @@ template <> size_t GenericFill<IfcSpatialStructureElement>(const DB& db, const L
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->LongName, arg, db ); 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`")); } 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 do { // convert the 'CompositionType' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBuilding>(const DB& db, const LIST& params, IfcBuilding* in) template <> size_t GenericFill<IfcBuilding>(const DB& db, const LIST& params, IfcBuilding* in)
@ -2739,20 +2739,20 @@ template <> size_t GenericFill<IfcBuilding>(const DB& db, const LIST& params, If
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ElevationOfRefHeight, arg, db ); 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`")); } 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 do { // convert the 'ElevationOfTerrain' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ElevationOfTerrain, arg, db ); 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`")); } 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 do { // convert the 'BuildingAddress' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->BuildingAddress, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcConnectedFaceSet>(const DB& db, const LIST& params, IfcConnectedFaceSet* in) template <> size_t GenericFill<IfcConnectedFaceSet>(const DB& db, const LIST& params, IfcConnectedFaceSet* in)
@ -2763,8 +2763,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcOpenShell>(const DB& db, const LIST& params, IfcOpenShell* in) template <> size_t GenericFill<IfcOpenShell>(const DB& db, const LIST& params, IfcOpenShell* in)
@ -2789,8 +2789,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCoveringType>(const DB& db, const LIST& params, IfcCoveringType* in) template <> size_t GenericFill<IfcCoveringType>(const DB& db, const LIST& params, IfcCoveringType* in)
@ -2836,33 +2836,33 @@ 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; } 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; } 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`")); } 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 do { // convert the 'OverallDepth' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'WebThickness' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'FlangeThickness' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'FilletRadius' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[4]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->FilletRadius, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcAsymmetricIShapeProfileDef>(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in) template <> size_t GenericFill<IfcAsymmetricIShapeProfileDef>(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in)
@ -2935,14 +2935,14 @@ template <> size_t GenericFill<IfcPropertyListValue>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ListValues, arg, db ); break; } 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`")); } 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 do { // convert the 'Unit' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Unit, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcFurnitureStandard>(const DB& db, const LIST& params, IfcFurnitureStandard* in) template <> size_t GenericFill<IfcFurnitureStandard>(const DB& db, const LIST& params, IfcFurnitureStandard* in)
@ -2967,14 +2967,14 @@ template <> size_t GenericFill<IfcDoor>(const DB& db, const LIST& params, IfcDoo
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->OverallHeight, arg, db ); 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`")); } 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 do { // convert the 'OverallWidth' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->OverallWidth, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcStyledItem>(const DB& db, const LIST& params, IfcStyledItem* in) template <> size_t GenericFill<IfcStyledItem>(const DB& db, const LIST& params, IfcStyledItem* in)
@ -2986,21 +2986,21 @@ template <> size_t GenericFill<IfcStyledItem>(const DB& db, const LIST& params,
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Item, arg, db ); 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`")); } 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 do { // convert the 'Styles' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'Name' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcStyledItem,3>::aux_is_derived[2]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcAnnotationOccurrence>(const DB& db, const LIST& params, IfcAnnotationOccurrence* in) template <> size_t GenericFill<IfcAnnotationOccurrence>(const DB& db, const LIST& params, IfcAnnotationOccurrence* in)
@ -3025,8 +3025,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcArbitraryProfileDefWithVoids>(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in) template <> size_t GenericFill<IfcArbitraryProfileDefWithVoids>(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in)
@ -3043,13 +3043,13 @@ template <> size_t GenericFill<IfcLine>(const DB& db, const LIST& params, IfcLin
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Pnt, arg, db ); break; } 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`")); } 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 do { // convert the 'Dir' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Dir, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcFlowSegmentType>(const DB& db, const LIST& params, IfcFlowSegmentType* in) template <> size_t GenericFill<IfcFlowSegmentType>(const DB& db, const LIST& params, IfcFlowSegmentType* in)
@ -3074,14 +3074,14 @@ template <> size_t GenericFill<IfcPropertySingleValue>(const DB& db, const LIST&
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->NominalValue, arg, db ); 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`")); } 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 do { // convert the 'Unit' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Unit, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcAlarmType>(const DB& db, const LIST& params, IfcAlarmType* in) template <> size_t GenericFill<IfcAlarmType>(const DB& db, const LIST& params, IfcAlarmType* in)
@ -3113,8 +3113,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcPumpType>(const DB& db, const LIST& params, IfcPumpType* in) template <> size_t GenericFill<IfcPumpType>(const DB& db, const LIST& params, IfcPumpType* in)

View File

@ -61,13 +61,13 @@ template <> size_t GenericFill<IfcSurfaceStyle>(const DB& db, const LIST& params
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Side, arg, db ); break; } 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`")); } 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 do { // convert the 'Styles' argument
std::shared_ptr<const DataType> arg = params[ base++ ]; std::shared_ptr<const DataType> arg = params[ base++ ];
try { GenericConvert( in->Styles, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcAnnotationSurface>(const DB& db, const LIST& params, IfcAnnotationSurface* in) template <> size_t GenericFill<IfcAnnotationSurface>(const DB& db, const LIST& params, IfcAnnotationSurface* in)
@ -120,8 +120,8 @@ 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcStructuralSurfaceMember>(const DB& db, const LIST& params, IfcStructuralSurfaceMember* in) template <> size_t GenericFill<IfcStructuralSurfaceMember>(const DB& db, const LIST& params, IfcStructuralSurfaceMember* in)
@ -175,8 +175,8 @@ template <> size_t GenericFill<IfcColourSpecification>(const DB& db, const LIST&
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Name, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcVector>(const DB& db, const LIST& params, IfcVector* in) template <> size_t GenericFill<IfcVector>(const DB& db, const LIST& params, IfcVector* in)
@ -186,13 +186,13 @@ template <> size_t GenericFill<IfcVector>(const DB& db, const LIST& params, IfcV
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Orientation, arg, db ); break; } 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`")); } 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 do { // convert the 'Magnitude' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Magnitude, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBeam>(const DB& db, const LIST& params, IfcBeam* in) template <> size_t GenericFill<IfcBeam>(const DB& db, const LIST& params, IfcBeam* in)
@ -209,18 +209,18 @@ template <> size_t GenericFill<IfcColourRgb>(const DB& db, const LIST& params, I
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Red, arg, db ); break; } 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`")); } 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 do { // convert the 'Green' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Green, arg, db ); break; } 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`")); } 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 do { // convert the 'Blue' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Blue, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcStructuralPlanarAction>(const DB& db, const LIST& params, IfcStructuralPlanarAction* in) template <> size_t GenericFill<IfcStructuralPlanarAction>(const DB& db, const LIST& params, IfcStructuralPlanarAction* in)
@ -245,32 +245,32 @@ template <> size_t GenericFill<IfcSite>(const DB& db, const LIST& params, IfcSit
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefLatitude, arg, db ); 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`")); } 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 do { // convert the 'RefLongitude' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefLongitude, arg, db ); 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`")); } 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 do { // convert the 'RefElevation' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefElevation, arg, db ); 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`")); } 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 do { // convert the 'LandTitleNumber' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->LandTitleNumber, arg, db ); 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`")); } 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 do { // convert the 'SiteAddress' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->SiteAddress, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcDiscreteAccessoryType>(const DB& db, const LIST& params, IfcDiscreteAccessoryType* in) template <> size_t GenericFill<IfcDiscreteAccessoryType>(const DB& db, const LIST& params, IfcDiscreteAccessoryType* in)
@ -414,32 +414,32 @@ 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; } 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; } 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`")); } 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 do { // convert the 'ControlPointsList' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'CurveForm' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'ClosedCurve' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'SelfIntersect' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBezierCurve>(const DB& db, const LIST& params, IfcBezierCurve* in) template <> size_t GenericFill<IfcBezierCurve>(const DB& db, const LIST& params, IfcBezierCurve* in)
@ -476,8 +476,8 @@ template <> size_t GenericFill<IfcShellBasedSurfaceModel>(const DB& db, const LI
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SbsmBoundary, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcActionRequest>(const DB& db, const LIST& params, IfcActionRequest* in) template <> size_t GenericFill<IfcActionRequest>(const DB& db, const LIST& params, IfcActionRequest* in)
@ -494,13 +494,13 @@ template <> size_t GenericFill<IfcExtrudedAreaSolid>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ExtrudedDirection, arg, db ); break; } 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`")); } 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 do { // convert the 'Depth' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Depth, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSystem>(const DB& db, const LIST& params, IfcSystem* in) template <> size_t GenericFill<IfcSystem>(const DB& db, const LIST& params, IfcSystem* in)
@ -524,13 +524,13 @@ template <> size_t GenericFill<IfcRelVoidsElement>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; } 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`")); } 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 do { // convert the 'RelatedOpeningElement' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSurfaceCurveSweptAreaSolid>(const DB& db, const LIST& params, IfcSurfaceCurveSweptAreaSolid* in) template <> size_t GenericFill<IfcSurfaceCurveSweptAreaSolid>(const DB& db, const LIST& params, IfcSurfaceCurveSweptAreaSolid* in)
@ -548,14 +548,14 @@ template <> size_t GenericFill<IfcCartesianTransformationOperator3DnonUniform>(c
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Scale2, arg, db ); 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`")); } 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 do { // convert the 'Scale3' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Scale3, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCurtainWallType>(const DB& db, const LIST& params, IfcCurtainWallType* in) template <> size_t GenericFill<IfcCurtainWallType>(const DB& db, const LIST& params, IfcCurtainWallType* in)
@ -636,8 +636,8 @@ template <> size_t GenericFill<IfcAxis2Placement2D>(const DB& db, const LIST& pa
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->RefDirection, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSpaceProgram>(const DB& db, const LIST& params, IfcSpaceProgram* in) template <> size_t GenericFill<IfcSpaceProgram>(const DB& db, const LIST& params, IfcSpaceProgram* in)
@ -660,8 +660,8 @@ template <> size_t GenericFill<IfcCartesianPoint>(const DB& db, const LIST& para
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Coordinates, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBoundedSurface>(const DB& db, const LIST& params, IfcBoundedSurface* in) template <> size_t GenericFill<IfcBoundedSurface>(const DB& db, const LIST& params, IfcBoundedSurface* in)
@ -684,8 +684,8 @@ template <> size_t GenericFill<IfcPolyLoop>(const DB& db, const LIST& params, If
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Polygon, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcTerminatorSymbol>(const DB& db, const LIST& params, IfcTerminatorSymbol* in) template <> size_t GenericFill<IfcTerminatorSymbol>(const DB& db, const LIST& params, IfcTerminatorSymbol* in)
@ -718,15 +718,15 @@ template <> size_t GenericFill<IfcRepresentationContext>(const DB& db, const LIS
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ContextIdentifier, arg, db ); 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`")); } 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 do { // convert the 'ContextType' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentationContext,2>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ContextType, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcGeometricRepresentationContext>(const DB& db, const LIST& params, IfcGeometricRepresentationContext* in) template <> size_t GenericFill<IfcGeometricRepresentationContext>(const DB& db, const LIST& params, IfcGeometricRepresentationContext* in)
@ -737,28 +737,28 @@ 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; } 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; } 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`")); } 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 do { // convert the 'Precision' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[1]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Precision, arg, db ); 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`")); } 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 do { // convert the 'WorldCoordinateSystem' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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 do { // convert the 'TrueNorth' argument
std::shared_ptr<const DataType> arg = params[base++]; 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 ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[3]=true; break; }
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->TrueNorth, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCurveBoundedPlane>(const DB& db, const LIST& params, IfcCurveBoundedPlane* in) template <> size_t GenericFill<IfcCurveBoundedPlane>(const DB& db, const LIST& params, IfcCurveBoundedPlane* in)
@ -776,13 +776,13 @@ template <> size_t GenericFill<IfcSIUnit>(const DB& db, const LIST& params, IfcS
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Prefix, arg, db ); 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`")); } 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 do { // convert the 'Name' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Name, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcStructuralReaction>(const DB& db, const LIST& params, IfcStructuralReaction* in) template <> size_t GenericFill<IfcStructuralReaction>(const DB& db, const LIST& params, IfcStructuralReaction* in)
@ -807,8 +807,8 @@ template <> size_t GenericFill<IfcAxis1Placement>(const DB& db, const LIST& para
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Axis, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcElectricApplianceType>(const DB& db, const LIST& params, IfcElectricApplianceType* in) template <> size_t GenericFill<IfcElectricApplianceType>(const DB& db, const LIST& params, IfcElectricApplianceType* in)
@ -860,13 +860,13 @@ template <> size_t GenericFill<IfcRepresentationMap>(const DB& db, const LIST& p
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappingOrigin, arg, db ); break; } 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`")); } 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 do { // convert the 'MappedRepresentation' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->MappedRepresentation, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcClosedShell>(const DB& db, const LIST& params, IfcClosedShell* in) template <> size_t GenericFill<IfcClosedShell>(const DB& db, const LIST& params, IfcClosedShell* in)
@ -1014,13 +1014,13 @@ template <> size_t GenericFill<IfcMeasureWithUnit>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ValueComponent, arg, db ); break; } 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`")); } 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 do { // convert the 'UnitComponent' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->UnitComponent, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSlabType>(const DB& db, const LIST& params, IfcSlabType* in) template <> size_t GenericFill<IfcSlabType>(const DB& db, const LIST& params, IfcSlabType* in)
@ -1127,8 +1127,8 @@ template <> size_t GenericFill<IfcFaceBasedSurfaceModel>(const DB& db, const LIS
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->FbsmFaces, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcEnergyConversionDevice>(const DB& db, const LIST& params, IfcEnergyConversionDevice* in) template <> size_t GenericFill<IfcEnergyConversionDevice>(const DB& db, const LIST& params, IfcEnergyConversionDevice* in)
@ -1174,14 +1174,14 @@ 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; } 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; } 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`")); } 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 do { // convert the 'Orientation' argument
std::shared_ptr<const DataType> arg = params[base++]; 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; } 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; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcFaceOuterBound>(const DB& db, const LIST& params, IfcFaceOuterBound* in) template <> size_t GenericFill<IfcFaceOuterBound>(const DB& db, const LIST& params, IfcFaceOuterBound* in)
@ -1218,13 +1218,13 @@ template <> size_t GenericFill<IfcComplexProperty>(const DB& db, const LIST& par
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->UsageName, arg, db ); break; } 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`")); } 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 do { // convert the 'HasProperties' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->HasProperties, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcFooting>(const DB& db, const LIST& params, IfcFooting* in) template <> size_t GenericFill<IfcFooting>(const DB& db, const LIST& params, IfcFooting* in)
@ -1276,8 +1276,8 @@ template <> size_t GenericFill<IfcUnitAssignment>(const DB& db, const LIST& para
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Units, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcFlowTerminal>(const DB& db, const LIST& params, IfcFlowTerminal* in) template <> size_t GenericFill<IfcFlowTerminal>(const DB& db, const LIST& params, IfcFlowTerminal* in)
@ -1309,13 +1309,13 @@ template <> size_t GenericFill<IfcElementQuantity>(const DB& db, const LIST& par
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->MethodOfMeasurement, arg, db ); 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`")); } 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 do { // convert the 'Quantities' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Quantities, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcCurtainWall>(const DB& db, const LIST& params, IfcCurtainWall* in) template <> size_t GenericFill<IfcCurtainWall>(const DB& db, const LIST& params, IfcCurtainWall* in)
@ -1381,8 +1381,8 @@ template <> size_t GenericFill<IfcPresentationStyleAssignment>(const DB& db, con
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Styles, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcStructuralCurveMember>(const DB& db, const LIST& params, IfcStructuralCurveMember* in) template <> size_t GenericFill<IfcStructuralCurveMember>(const DB& db, const LIST& params, IfcStructuralCurveMember* in)
@ -1420,14 +1420,14 @@ template <> size_t GenericFill<IfcSpace>(const DB& db, const LIST& params, IfcSp
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->InteriorOrExteriorSpace, arg, db ); break; } 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`")); } 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 do { // convert the 'ElevationWithFlooring' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ElevationWithFlooring, arg, db ); 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcHeatExchangerType>(const DB& db, const LIST& params, IfcHeatExchangerType* in) template <> size_t GenericFill<IfcHeatExchangerType>(const DB& db, const LIST& params, IfcHeatExchangerType* in)
@ -1486,8 +1486,8 @@ template <> size_t GenericFill<IfcSurfaceStyleWithTextures>(const DB& db, const
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Textures, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcBoundingBox>(const DB& db, const LIST& params, IfcBoundingBox* in) template <> size_t GenericFill<IfcBoundingBox>(const DB& db, const LIST& params, IfcBoundingBox* in)
@ -1497,23 +1497,23 @@ template <> size_t GenericFill<IfcBoundingBox>(const DB& db, const LIST& params,
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Corner, arg, db ); break; } 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`")); } 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 do { // convert the 'XDim' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->XDim, arg, db ); break; } 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`")); } 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 do { // convert the 'YDim' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->YDim, arg, db ); break; } 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`")); } 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 do { // convert the 'ZDim' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ZDim, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcWallType>(const DB& db, const LIST& params, IfcWallType* in) template <> size_t GenericFill<IfcWallType>(const DB& db, const LIST& params, IfcWallType* in)
@ -1537,8 +1537,8 @@ template <> size_t GenericFill<IfcCircle>(const DB& db, const LIST& params, IfcC
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Radius, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcOffsetCurve2D>(const DB& db, const LIST& params, IfcOffsetCurve2D* in) template <> size_t GenericFill<IfcOffsetCurve2D>(const DB& db, const LIST& params, IfcOffsetCurve2D* in)
@ -1625,13 +1625,13 @@ template <> size_t GenericFill<IfcConversionBasedUnit>(const DB& db, const LIST&
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->Name, arg, db ); break; } 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`")); } 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 do { // convert the 'ConversionFactor' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ConversionFactor, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcGeometricRepresentationSubContext>(const DB& db, const LIST& params, IfcGeometricRepresentationSubContext* in) template <> size_t GenericFill<IfcGeometricRepresentationSubContext>(const DB& db, const LIST& params, IfcGeometricRepresentationSubContext* in)
@ -1746,13 +1746,13 @@ template <> size_t GenericFill<IfcEllipse>(const DB& db, const LIST& params, Ifc
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SemiAxis1, arg, db ); break; } 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`")); } 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 do { // convert the 'SemiAxis2' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->SemiAxis2, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcProductDefinitionShape>(const DB& db, const LIST& params, IfcProductDefinitionShape* in) template <> size_t GenericFill<IfcProductDefinitionShape>(const DB& db, const LIST& params, IfcProductDefinitionShape* in)
@ -1818,8 +1818,8 @@ template <> size_t GenericFill<IfcPropertySet>(const DB& db, const LIST& params,
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->HasProperties, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcSurfaceStyleRendering>(const DB& db, const LIST& params, IfcSurfaceStyleRendering* in) template <> size_t GenericFill<IfcSurfaceStyleRendering>(const DB& db, const LIST& params, IfcSurfaceStyleRendering* in)
@ -1830,49 +1830,49 @@ template <> size_t GenericFill<IfcSurfaceStyleRendering>(const DB& db, const LIS
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->Transparency, arg, db ); 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`")); } 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 do { // convert the 'DiffuseColour' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->DiffuseColour, arg, db ); 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`")); } 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 do { // convert the 'TransmissionColour' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->TransmissionColour, arg, db ); 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`")); } 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 do { // convert the 'DiffuseTransmissionColour' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); 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`")); } 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 do { // convert the 'ReflectionColour' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->ReflectionColour, arg, db ); 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`")); } 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 do { // convert the 'SpecularColour' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->SpecularColour, arg, db ); 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`")); } 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 do { // convert the 'SpecularHighlight' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
if (dynamic_cast<const UNSET*>(&*arg)) break; if (dynamic_cast<const UNSET*>(&*arg)) break;
try { GenericConvert( in->SpecularHighlight, arg, db ); 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`")); } 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 do { // convert the 'ReflectanceMethod' argument
std::shared_ptr<const DataType> arg = params[base++]; std::shared_ptr<const DataType> arg = params[base++];
try { GenericConvert( in->ReflectanceMethod, arg, db ); break; } 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`")); } 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; return base;
} }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
template <> size_t GenericFill<IfcDistributionPort>(const DB& db, const LIST& params, IfcDistributionPort* in) template <> size_t GenericFill<IfcDistributionPort>(const DB& db, const LIST& params, IfcDistributionPort* in)

View File

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

View File

@ -842,11 +842,11 @@ void IRRImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile)); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open IRR file ", pFile); throw DeadlyImportError("Failed to open IRR file ", pFile);
} }
// Construct the irrXML parser // Construct the irrXML parser
XmlParser st; XmlParser st;
if (!st.parse( file.get() )) { if (!st.parse( file.get() )) {
throw DeadlyImportError("XML parse error while loading IRR file ", pFile); throw DeadlyImportError("XML parse error while loading IRR file ", pFile);

View File

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

View File

@ -63,9 +63,7 @@ protected:
// empty // empty
} }
~IrrlichtBase() { ~IrrlichtBase() = default;
// empty
}
/** @brief Data structure for a simple name-value property /** @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 my_last = (*it).keys.back().time;
const double delta = my_last - my_first; 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; const float value_delta = (*it).keys.back().value - (*it).keys.front().value;
// NOTE: We won't handle reset, linear and constant here. // NOTE: We won't handle reset, linear and constant here.
@ -176,8 +179,7 @@ void AnimResolver::UpdateAnimRangeSetup() {
case LWO::PrePostBehaviour_Oscillate: { case LWO::PrePostBehaviour_Oscillate: {
const double start_time = delta - std::fmod(my_first - first, delta); 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(), std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(), (*it).keys.end(),
[start_time](double t) { return start_time > t; }), [start_time](double t) { return start_time > t; }), m;
m;
size_t ofs = 0; size_t ofs = 0;
if (n != (*it).keys.end()) { if (n != (*it).keys.end()) {
@ -463,7 +465,7 @@ void AnimResolver::GetKeys(std::vector<aiVectorKey> &out,
cur_z = envl_z->keys.begin(); cur_z = envl_z->keys.begin();
end_x = end_y = end_z = false; end_x = end_y = end_z = false;
while (1) { while (true) {
aiVectorKey fill; aiVectorKey fill;

View File

@ -135,7 +135,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb")); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open LWO file ", pFile, "."); throw DeadlyImportError("Failed to open LWO file ", pFile, ".");
} }
@ -178,7 +178,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
mLayers->push_back(Layer()); mLayers->push_back(Layer());
mCurLayer = &mLayers->back(); mCurLayer = &mLayers->back();
mCurLayer->mName = "<LWODefault>"; mCurLayer->mName = "<LWODefault>";
mCurLayer->mIndex = (uint16_t) -1; mCurLayer->mIndex = 1;
// old lightwave file format (prior to v6) // old lightwave file format (prior to v6)
mIsLWO2 = false; mIsLWO2 = false;
@ -398,14 +398,6 @@ void LWOImporter::InternReadFile(const std::string &pFile,
pvVC[w]++; 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; face.mIndices[q] = vert;
} }
pf->mIndices = face.mIndices; 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 // 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); unsigned int num = static_cast<unsigned int>(apcMeshes.size() - meshStart);
if (layer.mName != "<LWODefault>" || num > 0) { if (layer.mName != "<LWODefault>" || num > 0) {
aiNode *pcNode = new aiNode(); std::unique_ptr<aiNode> pcNode(new aiNode());
pcNode->mName.Set(layer.mName); pcNode->mName.Set(layer.mName);
pcNode->mParent = (aiNode *)&layer; pcNode->mParent = (aiNode *)&layer;
pcNode->mNumMeshes = num; pcNode->mNumMeshes = num;
@ -439,7 +431,8 @@ void LWOImporter::InternReadFile(const std::string &pFile,
for (unsigned int p = 0; p < pcNode->mNumMeshes; ++p) for (unsigned int p = 0; p < pcNode->mNumMeshes; ++p)
pcNode->mMeshes[p] = p + meshStart; 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,40 +565,64 @@ void LWOImporter::GenerateNodeGraph(std::map<uint16_t, aiNode *> &apcNodes) {
aiNode *root = mScene->mRootNode = new aiNode(); aiNode *root = mScene->mRootNode = new aiNode();
root->mName.Set("<LWORoot>"); root->mName.Set("<LWORoot>");
//Set parent of all children, inserting pivots ASSIMP_LOG_DEBUG("apcNodes initial size: ", apcNodes.size());
std::map<uint16_t, aiNode *> mapPivot; if (!apcNodes.empty()) {
for (auto itapcNodes = apcNodes.begin(); itapcNodes != apcNodes.end(); ++itapcNodes) { ASSIMP_LOG_DEBUG("first apcNode is: ", apcNodes.begin()->first, " \"", apcNodes.begin()->second->mName.C_Str(), "\"");
//Get the parent index
LWO::Layer *nodeLayer = (LWO::Layer *)(itapcNodes->second->mParent);
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();
pivotNode->mName.Set("Pivot-" + std::string(itapcNodes->second->mName.data));
itapcNodes->second->mParent = pivotNode;
//Look for the parent node to attach the pivot to
if (apcNodes.find(parentIndex) != apcNodes.end()) {
pivotNode->mParent = apcNodes[parentIndex];
} else {
//If not, attach to the root node
pivotNode->mParent = root;
}
//Set the node and the pivot node transformation
itapcNodes->second->mTransformation.a4 = -nodeLayer->mPivot.x;
itapcNodes->second->mTransformation.b4 = -nodeLayer->mPivot.y;
itapcNodes->second->mTransformation.c4 = -nodeLayer->mPivot.z;
pivotNode->mTransformation.a4 = nodeLayer->mPivot.x;
pivotNode->mTransformation.b4 = nodeLayer->mPivot.y;
pivotNode->mTransformation.c4 = nodeLayer->mPivot.z;
mapPivot[-(itapcNodes->first + 2)] = pivotNode;
} }
//Merge pivot map into node map //Set parent of all children, inserting pivots
for (auto itMapPivot = mapPivot.begin(); itMapPivot != mapPivot.end(); ++itMapPivot) { {
apcNodes[itMapPivot->first] = itMapPivot->second; std::map<uint16_t, aiNode *> mapPivot;
for (auto itapcNodes = apcNodes.begin(); itapcNodes != apcNodes.end(); ++itapcNodes) {
//Get the parent index
LWO::Layer *nodeLayer = (LWO::Layer *)(itapcNodes->second->mParent);
uint16_t parentIndex = nodeLayer->mParent;
//Create pivot node, store it into the pivot map, and set the parent as the pivot
std::unique_ptr<aiNode> pivotNode(new aiNode());
pivotNode->mName.Set("Pivot-" + std::string(itapcNodes->second->mName.data));
itapcNodes->second->mParent = pivotNode.get();
//Look for the parent node to attach the pivot to
if (apcNodes.find(parentIndex) != apcNodes.end()) {
pivotNode->mParent = apcNodes[parentIndex];
} else {
//If not, attach to the root node
pivotNode->mParent = root;
}
//Set the node and the pivot node transformation
itapcNodes->second->mTransformation.a4 = -nodeLayer->mPivot.x;
itapcNodes->second->mTransformation.b4 = -nodeLayer->mPivot.y;
itapcNodes->second->mTransformation.c4 = -nodeLayer->mPivot.z;
pivotNode->mTransformation.a4 = nodeLayer->mPivot.x;
pivotNode->mTransformation.b4 = nodeLayer->mPivot.y;
pivotNode->mTransformation.c4 = nodeLayer->mPivot.z;
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();) {
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 //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"); throw DeadlyImportError("LWO: Unable to build a valid node graph");
}
// Remove a single root node with no meshes assigned to it ... // Remove a single root node with no meshes assigned to it ...
if (1 == mScene->mRootNode->mNumChildren) { 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")); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open LWS file ", pFile, "."); throw DeadlyImportError("Failed to open LWS file ", pFile, ".");
} }

View File

@ -65,7 +65,7 @@ class M3DImporter : public BaseImporter {
public: public:
/// \brief Default constructor /// \brief Default constructor
M3DImporter(); M3DImporter();
~M3DImporter() override {} ~M3DImporter() override = default;
/// \brief Returns whether the class can handle the format of the given file. /// \brief Returns whether the class can handle the format of the given file.
/// \remark See BaseImporter::CanRead() for details. /// \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 !defined ASSIMP_BUILD_NO_M3D_IMPORTER || !(defined ASSIMP_BUILD_NO_EXPORT || defined ASSIMP_BUILD_NO_M3D_EXPORTER)
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
#include "M3DWrapper.h" #include "M3DWrapper.h"
@ -149,4 +148,3 @@ void M3DWrapper::ClearSave() {
} // namespace Assimp } // namespace Assimp
#endif #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 #ifndef AI_M3DWRAPPER_H_INC
#define AI_M3DWRAPPER_H_INC #define AI_M3DWRAPPER_H_INC
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER #if !defined ASSIMP_BUILD_NO_M3D_IMPORTER || !(defined ASSIMP_BUILD_NO_EXPORT || defined ASSIMP_BUILD_NO_M3D_EXPORTER)
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
#include <memory> #include <memory>
#include <vector> #include <vector>
@ -126,7 +125,6 @@ inline m3d_t *M3DWrapper::M3D() const {
} // namespace Assimp } // namespace Assimp
#endif
#endif // ASSIMP_BUILD_NO_M3D_IMPORTER #endif // ASSIMP_BUILD_NO_M3D_IMPORTER
#endif // AI_M3DWRAPPER_H_INC #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)); std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open MD2 file ", pFile, ""); 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 // Load a Quake 3 shader
bool Q3Shader::LoadShader(ShaderData &fill, const std::string &pFile, IOSystem *io) { bool Q3Shader::LoadShader(ShaderData &fill, const std::string &pFile, IOSystem *io) {
std::unique_ptr<IOStream> file(io->Open(pFile, "rt")); 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 return false; // if we can't access the file, don't worry and return
ASSIMP_LOG_INFO("Loading Quake3 shader file ", pFile); 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 // Load a Quake 3 skin
bool Q3Shader::LoadSkin(SkinData &fill, const std::string &pFile, IOSystem *io) { bool Q3Shader::LoadSkin(SkinData &fill, const std::string &pFile, IOSystem *io) {
std::unique_ptr<IOStream> file(io->Open(pFile, "rt")); 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 return false; // if we can't access the file, don't worry and return
ASSIMP_LOG_INFO("Loading Quake3 skin file ", pFile); 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)); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open MD3 file ", pFile, "."); 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")); std::unique_ptr<IOStream> file(mIOHandler->Open(filename, "rb"));
// Check whether we can read from the file // 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); ASSIMP_LOG_WARN("Failed to access MD5MESH file: ", filename);
return; return;
} }
@ -553,7 +553,7 @@ void MD5Importer::LoadMD5AnimFile() {
std::unique_ptr<IOStream> file(mIOHandler->Open(pFile, "rb")); std::unique_ptr<IOStream> file(mIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // 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); ASSIMP_LOG_WARN("Failed to read MD5ANIM file: ", pFile);
return; return;
} }
@ -661,7 +661,7 @@ void MD5Importer::LoadMD5CameraFile() {
std::unique_ptr<IOStream> file(mIOHandler->Open(pFile, "rb")); std::unique_ptr<IOStream> file(mIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // 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); throw DeadlyImportError("Failed to read MD5CAMERA file: ", pFile);
} }
mHadMD5Camera = true; mHadMD5Camera = true;

View File

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

View File

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

View File

@ -470,14 +470,16 @@ void HL1MDLLoader::read_bones() {
temp_bones_.resize(header_->numbones); 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); aiNode *bones_node = new aiNode(AI_MDL_HL1_NODE_BONES);
rootnode_children_.push_back(bones_node); 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. // Create bone matrices in local space.
for (int i = 0; i < header_->numbones; ++i) { 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]); aiVector3D angles(pbone[i].value[3], pbone[i].value[4], pbone[i].value[5]);
temp_bones_[i].absolute_transform = bone_node->mTransformation = 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])); aiVector3D(pbone[i].value[0], pbone[i].value[1], pbone[i].value[2]));
if (pbone[i].parent == -1) { 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 { } 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_[i].absolute_transform =
temp_bones_[pbone[i].parent].absolute_transform * bone_node->mTransformation; 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 = temp_bones_[i].absolute_transform;
temp_bones_[i].offset_matrix.Inverse(); 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); 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 */ /** Output scene to be filled */
aiScene *scene_; aiScene *scene_;
@ -198,11 +206,13 @@ private:
TempBone() : TempBone() :
node(nullptr), node(nullptr),
absolute_transform(), absolute_transform(),
offset_matrix() {} offset_matrix(),
children() {}
aiNode *node; aiNode *node;
aiMatrix4x4 absolute_transform; aiMatrix4x4 absolute_transform;
aiMatrix4x4 offset_matrix; aiMatrix4x4 offset_matrix;
std::vector<int> children; // Bone children
}; };
std::vector<TempBone> temp_bones_; 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)); 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), "."); 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)); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open MDL file ", pFile, "."); throw DeadlyImportError("Failed to open MDL file ", pFile, ".");
} }
@ -405,11 +405,13 @@ void MDLImporter::InternReadFile_Quake1() {
} }
// go to the end of the skin section / the beginning of the next skin // go to the end of the skin section / the beginning of the next skin
bool overflow = false; bool overflow = false;
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){ if (pcHeader->skinwidth != 0 || pcHeader->skinheight != 0) {
overflow = true; if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
} overflow = true;
if (!overflow) { }
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages; if (!overflow) {
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages;
}
} }
} }
} else { } else {
@ -973,7 +975,7 @@ void MDLImporter::CalcAbsBoneMatrices_3DGS_MDL7(MDL::IntBone_MDL7 **apcOutBones)
} }
// store the name of the bone // 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); ::memcpy(pcOutBone->mName.data, pcBone->name, pcOutBone->mName.length);
pcOutBone->mName.data[pcOutBone->mName.length] = '\0'; 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()); dynamic_cast<pmx::PmxVertexSkinningSDEF *>(v->skinning.get());
switch (v->skinning_type) { switch (v->skinning_type) {
case pmx::PmxVertexSkinningType::BDEF1: 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; break;
case pmx::PmxVertexSkinningType::BDEF2: case pmx::PmxVertexSkinningType::BDEF2:
bone_vertex_map[vsBDEF2_ptr->bone_index1].emplace_back(index, vsBDEF2_ptr->bone_weight); 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) { for (unsigned int j = 0,n = 0; j < m->mNumFaces; ++j) {
aiFace& f = m->mFaces[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"); 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]; f.mIndices = new unsigned int[f.mNumIndices=3];
for (unsigned int k = 0; k < 3; ++k,++n) { 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"); 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; const unsigned int key = v.first;
unsigned int cur_edge = v.second; unsigned int cur_edge = v.second;
while (1) { while (true) {
unsigned int next_edge, next_vert; unsigned int next_edge, next_vert;
if (key == obj.edges[cur_edge].edge[3]) { if (key == obj.edges[cur_edge].edge[3]) {
next_edge = obj.edges[cur_edge].edge[5]; 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")); std::unique_ptr<IOStream> file(pIOHandler->Open(path, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if (!file.get()) { if (!file) {
ASSIMP_LOG_ERROR("NFF2: Unable to open material library ", path, "."); ASSIMP_LOG_ERROR("NFF2: Unable to open material library ", path, ".");
return; return;
} }
@ -211,7 +211,7 @@ void NFFImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb")); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if (!file.get()) if (!file)
throw DeadlyImportError("Failed to open NFF file ", pFile, "."); throw DeadlyImportError("Failed to open NFF file ", pFile, ".");
// allocate storage and copy the contents of the file to a memory buffer // 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")); std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if( file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError( "Failed to open OFF file ", pFile, "."); throw DeadlyImportError("Failed to open OFF file ", pFile, ".");
} }
// allocate storage and copy the contents of the file to a memory buffer // allocate storage and copy the contents of the file to a memory buffer
@ -290,11 +290,12 @@ void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
sz = line; SkipSpaces(&sz); sz = line; SkipSpaces(&sz);
idx = strtoul10(sz,&sz); idx = strtoul10(sz,&sz);
if(!idx || idx > 9) { if(!idx || idx > 9) {
ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed"); ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed");
--mesh->mNumFaces; --mesh->mNumFaces;
++i;
continue; continue;
} }
faces->mNumIndices = idx; faces->mNumIndices = idx;
faces->mIndices = new unsigned int[faces->mNumIndices]; faces->mIndices = new unsigned int[faces->mNumIndices];
for (unsigned int m = 0; m < faces->mNumIndices;++m) { for (unsigned int m = 0; m < faces->mNumIndices;++m) {
SkipSpaces(&sz); SkipSpaces(&sz);

View File

@ -108,7 +108,7 @@ void ObjFileImporter::InternReadFile(const std::string &file, aiScene *pScene, I
pIOHandler->Close(pStream); pIOHandler->Close(pStream);
}; };
std::unique_ptr<IOStream, decltype(streamCloser)> fileStream(pIOHandler->Open(file, mode), streamCloser); std::unique_ptr<IOStream, decltype(streamCloser)> fileStream(pIOHandler->Open(file, mode), streamCloser);
if (!fileStream.get()) { if (!fileStream) {
throw DeadlyImportError("Failed to open file ", file, "."); 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 vt = (!m_pModel->mTextureCoord.empty());
const bool vn = (!m_pModel->mNormals.empty()); const bool vn = (!m_pModel->mNormals.empty());
int iPos = 0; int iPos = 0;
while (m_DataIt != m_DataItEnd) { while (m_DataIt < m_DataItEnd) {
int iStep = 1; int iStep = 1;
if (IsLineEnd(*m_DataIt)) { if (IsLineEnd(*m_DataIt)) {

View File

@ -2,7 +2,7 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2021, assimp team Copyright (c) 2006-2022, assimp team
All rights reserved. All rights reserved.
@ -111,6 +111,10 @@ inline Char_T getNextToken(Char_T pBuffer, Char_T pEnd) {
*/ */
template <class char_t> template <class char_t>
inline char_t skipLine(char_t it, char_t end, unsigned int &uiLine) { inline char_t skipLine(char_t it, char_t end, unsigned int &uiLine) {
if (it >= end) {
return it;
}
while (!isEndOfBuffer(it, end) && !IsLineEnd(*it)) { while (!isEndOfBuffer(it, end) && !IsLineEnd(*it)) {
++it; ++it;
} }
@ -129,7 +133,7 @@ inline char_t skipLine(char_t it, char_t end, unsigned int &uiLine) {
/** /**
* @brief Get a name from the current line. Preserve space in the middle, * @brief Get a name from the current line. Preserve space in the middle,
* but trim it at the end. * but trim it at the end.
* @param[in] it set to current position * @param[in] it set to current position
* @param[in] end set to end of scratch buffer for readout * @param[in] end set to end of scratch buffer for readout
* @param[out] name Separated name * @param[out] name Separated name

View File

@ -60,17 +60,17 @@ namespace Ogre {
class OgreImporter : public BaseImporter { class OgreImporter : public BaseImporter {
public: public:
/// BaseImporter override. /// 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: protected:
/// BaseImporter override. /// 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. /// BaseImporter override.
virtual const aiImporterDesc *GetInfo() const override; const aiImporterDesc *GetInfo() const override;
/// BaseImporter override. /// BaseImporter override.
virtual void SetupProperties(const Importer *pImp) override; void SetupProperties(const Importer *pImp) override;
private: private:
/// Read materials referenced by the @c mesh to @c pScene. /// 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) { aiMaterial *OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSystem *pIOHandler, const std::string &materialName) {
if (materialName.empty()) { if (materialName.empty()) {
return 0; return nullptr;
} }
// Full reference and examples of Ogre Material Script // 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()) if (!m_userDefinedMaterialLibFile.empty())
potentialFiles.push_back(m_userDefinedMaterialLibFile); potentialFiles.push_back(m_userDefinedMaterialLibFile);
IOStream *materialFile = 0; IOStream *materialFile = nullptr;
for (size_t i = 0; i < potentialFiles.size(); ++i) { for (size_t i = 0; i < potentialFiles.size(); ++i) {
materialFile = pIOHandler->Open(potentialFiles[i]); materialFile = pIOHandler->Open(potentialFiles[i]);
if (materialFile) { if (materialFile) {
@ -164,13 +164,13 @@ aiMaterial *OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste
} }
if (!materialFile) { if (!materialFile) {
ASSIMP_LOG_ERROR("Failed to find source file for material '", materialName, "'"); ASSIMP_LOG_ERROR("Failed to find source file for material '", materialName, "'");
return 0; return nullptr;
} }
std::unique_ptr<IOStream> stream(materialFile); std::unique_ptr<IOStream> stream(materialFile);
if (stream->FileSize() == 0) { if (stream->FileSize() == 0) {
ASSIMP_LOG_WARN("Source file for material '", materialName, "' is empty (size is 0 bytes)"); ASSIMP_LOG_WARN("Source file for material '", materialName, "' is empty (size is 0 bytes)");
return 0; return nullptr;
} }
// Read bytes // Read bytes

View File

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

View File

@ -437,7 +437,7 @@ public:
void CalculateWorldMatrixAndDefaultPose(Skeleton *skeleton); void CalculateWorldMatrixAndDefaultPose(Skeleton *skeleton);
/// Convert to Assimp node (animation nodes). /// 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). /// Convert to Assimp bone (mesh bones).
aiBone *ConvertToAssimpBone(Skeleton *parent, const std::vector<aiVertexWeight> &boneWeights); 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()); OgreXmlSerializer serializer(xmlParser.get());
XmlNode root = xmlParser->getRootNode(); XmlNode root = xmlParser->getRootNode();
if (std::string(root.name()) != nnSkeleton) { 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()) { for (auto &a : root.children()) {
if (std::string(a.name()) == nnSkeleton) { if (std::string(a.name()) == nnSkeleton) {
root = a; root = a;
@ -535,7 +535,7 @@ XmlParserPtr OgreXmlSerializer::OpenXmlParser(Assimp::IOSystem *pIOHandler, cons
} }
std::unique_ptr<IOStream> file(pIOHandler->Open(filename)); std::unique_ptr<IOStream> file(pIOHandler->Open(filename));
if (!file.get()) { if (!file) {
throw DeadlyImportError("Failed to open skeleton file ", filename); 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() : OpenGEXImporter::OpenGEXImporter() :
m_root(nullptr), m_root(nullptr),
m_nodeChildMap(), m_nodeChildMap(),
m_meshCache(),
m_mesh2refMap(), m_mesh2refMap(),
m_material2refMap(), m_material2refMap(),
m_ctx(nullptr), 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) { void PLYImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
const std::string mode = "rb"; const std::string mode = "rb";
std::unique_ptr<IOStream> fileStream(pIOHandler->Open(pFile, mode)); std::unique_ptr<IOStream> fileStream(pIOHandler->Open(pFile, mode));
if (!fileStream.get()) { if (!fileStream) {
throw DeadlyImportError("Failed to open file ", pFile, "."); 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); streamBuffer.getNextLine(buffer);
pCur = (char *)&buffer[0]; pCur = (char *)&buffer[0];
// skip all comments // skip all comments and go to next line
PLY::DOM::SkipComments(buffer); if (PLY::DOM::SkipComments(buffer)) continue;
PLY::Property prop; PLY::Property prop;
if (!PLY::Property::ParseProperty(buffer, &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)) { if (PLY::Element::ParseElement(streamBuffer, buffer, &out)) {
// add the element to the list of elements // add the element to the list of elements
alElements.push_back(out); 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 // we have reached the end of the header
break; break;
} else { } else {

View File

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

View File

@ -169,19 +169,7 @@ struct Q3BSPModel {
std::vector<char> m_EntityData; std::vector<char> m_EntityData;
std::string m_ModelName; std::string m_ModelName;
Q3BSPModel() : Q3BSPModel() = default;
m_Data(),
m_Lumps(),
m_Vertices(),
m_Faces(),
m_Indices(),
m_Textures(),
m_Lightmaps(),
m_EntityData(),
m_ModelName()
{
// empty
}
~Q3BSPModel() { ~Q3BSPModel() {
for ( unsigned int i=0; i<m_Lumps.size(); i++ ) { 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. // Constructor.
Q3BSPFileImporter::Q3BSPFileImporter() : Q3BSPFileImporter::Q3BSPFileImporter() :
m_pCurrentMesh(nullptr), m_pCurrentFace(nullptr), m_MaterialLookupMap(), mTextures() { m_pCurrentMesh(nullptr), m_pCurrentFace(nullptr) {
// empty // empty
} }

View File

@ -96,7 +96,7 @@ void RAWImporter::InternReadFile(const std::string &pFile,
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb")); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open RAW file ", pFile, "."); 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 // Constructor to be privately used by Importer
SMDImporter::SMDImporter() : SMDImporter::SMDImporter() :
configFrameID(), configFrameID(),
mBuffer(),
pScene( nullptr ), pScene( nullptr ),
iFileSize( 0 ), iFileSize( 0 ),
iSmallestFrame( INT_MAX ), iSmallestFrame( INT_MAX ),
@ -535,7 +534,7 @@ void SMDImporter::GetAnimationFileList(const std::string &pFile, IOSystem* pIOHa
auto path = base + "/" + name + "_animation.txt"; auto path = base + "/" + name + "_animation.txt";
std::unique_ptr<IOStream> file(pIOHandler->Open(path.c_str(), "rb")); std::unique_ptr<IOStream> file(pIOHandler->Open(path.c_str(), "rb"));
if (file.get() == nullptr) { if (file == nullptr) {
return; return;
} }
@ -591,7 +590,7 @@ void SMDImporter::CreateOutputMaterials() {
pScene->mMaterials[iMat] = pcMat; pScene->mMaterials[iMat] = pcMat;
aiString szName; 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); pcMat->AddProperty(&szName,AI_MATKEY_NAME);
if (aszTextures[iMat].length()) 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")); std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
// Check whether we can read from the file // Check whether we can read from the file
if (file.get() == nullptr) { if (file == nullptr) {
throw DeadlyImportError("Failed to open SMD/VTA file ", pFile, "."); 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