mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
update assimp lib
This commit is contained in:
parent
03a348deb7
commit
d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
|
|
@ -38,9 +38,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCBoolean.cpp
|
||||
* @brief Implements a subset of Ifc boolean operations
|
||||
*/
|
||||
/// @file IFCBoolean.cpp
|
||||
/// @brief Implements a subset of Ifc boolean operations
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
||||
|
|
@ -48,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "Common/PolyTools.h"
|
||||
#include "PostProcessing/ProcessHelper.h"
|
||||
|
||||
|
||||
#include <iterator>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
namespace Assimp {
|
||||
namespace IFC {
|
||||
|
|
@ -66,8 +65,9 @@ bool IntersectSegmentPlane(const IfcVector3 &p, const IfcVector3 &n, const IfcVe
|
|||
|
||||
// if segment ends on plane, do not report a hit. We stay on that side until a following segment starting at this
|
||||
// point leaves the plane through the other side
|
||||
if (std::abs(dotOne + dotTwo) < ai_epsilon)
|
||||
if (std::abs(dotOne + dotTwo) < ai_epsilon) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// if segment starts on the plane, report a hit only if the end lies on the *other* side
|
||||
if (std::abs(dotTwo) < ai_epsilon) {
|
||||
|
|
@ -81,13 +81,15 @@ bool IntersectSegmentPlane(const IfcVector3 &p, const IfcVector3 &n, const IfcVe
|
|||
|
||||
// ignore if segment is parallel to plane and far away from it on either side
|
||||
// Warning: if there's a few thousand of such segments which slowly accumulate beyond the epsilon, no hit would be registered
|
||||
if (std::abs(dotOne) < ai_epsilon)
|
||||
if (std::abs(dotOne) < ai_epsilon) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// t must be in [0..1] if the intersection point is within the given segment
|
||||
const IfcFloat t = dotTwo / dotOne;
|
||||
if (t > 1.0 || t < 0.0)
|
||||
if (t > 1.0 || t < 0.0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
out = e0 + t * seg;
|
||||
return true;
|
||||
|
|
@ -109,11 +111,13 @@ void FilterPolygon(std::vector<IfcVector3> &resultpoly) {
|
|||
FuzzyVectorCompare fz(epsilon);
|
||||
std::vector<IfcVector3>::iterator e = std::unique(resultpoly.begin(), resultpoly.end(), fz);
|
||||
|
||||
if (e != resultpoly.end())
|
||||
if (e != resultpoly.end()) {
|
||||
resultpoly.erase(e, resultpoly.end());
|
||||
}
|
||||
|
||||
if (!resultpoly.empty() && fz(resultpoly.front(), resultpoly.back()))
|
||||
if (!resultpoly.empty() && fz(resultpoly.front(), resultpoly.back())) {
|
||||
resultpoly.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
@ -290,8 +294,9 @@ bool IntersectsBoundaryProfile(const IfcVector3 &e0, const IfcVector3 &e1, const
|
|||
}
|
||||
|
||||
// Line segment ends at boundary -> ignore any hit, it will be handled by possibly following segments
|
||||
if (endsAtSegment && !halfOpen)
|
||||
if (endsAtSegment && !halfOpen) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Line segment starts at boundary -> generate a hit only if following that line would change the INSIDE/OUTSIDE
|
||||
// state. This should catch the case where a connected set of segments has a point directly on the boundary,
|
||||
|
|
@ -300,15 +305,17 @@ bool IntersectsBoundaryProfile(const IfcVector3 &e0, const IfcVector3 &e1, const
|
|||
if (startsAtSegment) {
|
||||
IfcVector3 inside_dir = IfcVector3(b.y, -b.x, 0.0) * windingOrder;
|
||||
bool isGoingInside = (inside_dir * e) > 0.0;
|
||||
if (isGoingInside == isStartAssumedInside)
|
||||
if (isGoingInside == isStartAssumedInside) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// only insert the point into the list if it is sufficiently far away from the previous intersection point.
|
||||
// This way, we avoid duplicate detection if the intersection is directly on the vertex between two segments.
|
||||
if (!intersect_results.empty() && intersect_results.back().first == i - 1) {
|
||||
const IfcVector3 diff = intersect_results.back().second - e0;
|
||||
if (IfcVector2(diff.x, diff.y).SquareLength() < 1e-10)
|
||||
if (IfcVector2(diff.x, diff.y).SquareLength() < 1e-10) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
intersect_results.emplace_back(i, e0);
|
||||
continue;
|
||||
|
|
@ -321,8 +328,9 @@ bool IntersectsBoundaryProfile(const IfcVector3 &e0, const IfcVector3 &e1, const
|
|||
// This way, we avoid duplicate detection if the intersection is directly on the vertex between two segments.
|
||||
if (!intersect_results.empty() && intersect_results.back().first == i - 1) {
|
||||
const IfcVector3 diff = intersect_results.back().second - p;
|
||||
if (IfcVector2(diff.x, diff.y).SquareLength() < 1e-10)
|
||||
if (IfcVector2(diff.x, diff.y).SquareLength() < 1e-10) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
intersect_results.emplace_back(i, p);
|
||||
}
|
||||
|
|
@ -387,8 +395,8 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPoly
|
|||
n.Normalize();
|
||||
|
||||
// obtain the polygonal bounding volume
|
||||
std::shared_ptr<TempMesh> profile = std::shared_ptr<TempMesh>(new TempMesh());
|
||||
if (!ProcessCurve(hs->PolygonalBoundary, *profile.get(), conv)) {
|
||||
std::shared_ptr<TempMesh> profile = std::make_shared<TempMesh>();
|
||||
if (!ProcessCurve(hs->PolygonalBoundary, *profile, conv)) {
|
||||
IFCImporter::LogError("expected valid polyline for boundary of boolean halfspace");
|
||||
return;
|
||||
}
|
||||
|
|
@ -661,7 +669,8 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPoly
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedAreaSolid *as, TempMesh &result,
|
||||
void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedAreaSolid *as,
|
||||
TempMesh &result,
|
||||
const TempMesh &first_operand,
|
||||
ConversionData &conv) {
|
||||
ai_assert(as != nullptr);
|
||||
|
|
@ -671,10 +680,10 @@ void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedArea
|
|||
// operand should be near-planar. Luckily, this is usually the case in Ifc
|
||||
// buildings.
|
||||
|
||||
std::shared_ptr<TempMesh> meshtmp = std::shared_ptr<TempMesh>(new TempMesh());
|
||||
std::shared_ptr<TempMesh> meshtmp = std::make_shared<TempMesh>();
|
||||
ProcessExtrudedAreaSolid(*as, *meshtmp, conv, false);
|
||||
|
||||
std::vector<TempOpening> openings(1, TempOpening(as, IfcVector3(0, 0, 0), meshtmp, std::shared_ptr<TempMesh>()));
|
||||
std::vector<TempOpening> openings(1, TempOpening(as, IfcVector3(0, 0, 0), std::move(meshtmp), std::shared_ptr<TempMesh>()));
|
||||
|
||||
result = first_operand;
|
||||
|
||||
|
|
@ -762,4 +771,4 @@ void ProcessBoolean(const Schema_2x3::IfcBooleanResult &boolean, TempMesh &resul
|
|||
} // namespace IFC
|
||||
} // namespace Assimp
|
||||
|
||||
#endif
|
||||
#endif // ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -39,15 +39,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCProfile.cpp
|
||||
* @brief Read profile and curves entities from IFC files
|
||||
*/
|
||||
/// @file IFCProfile.cpp
|
||||
/// @brief Read profile and curves entities from IFC files
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
#include "IFCUtil.h"
|
||||
|
||||
namespace Assimp {
|
||||
namespace IFC {
|
||||
|
||||
namespace {
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
|
@ -56,8 +56,7 @@ namespace {
|
|||
class Conic : public Curve {
|
||||
public:
|
||||
// --------------------------------------------------
|
||||
Conic(const Schema_2x3::IfcConic& entity, ConversionData& conv)
|
||||
: Curve(entity,conv) {
|
||||
Conic(const Schema_2x3::IfcConic& entity, ConversionData& conv) : Curve(entity,conv) {
|
||||
IfcMatrix4 trafo;
|
||||
ConvertAxisPlacement(trafo,*entity.Position,conv);
|
||||
|
||||
|
|
@ -69,12 +68,12 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
bool IsClosed() const {
|
||||
bool IsClosed() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
|
||||
|
|
@ -88,7 +87,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
ParamRange GetParametricRange() const {
|
||||
ParamRange GetParametricRange() const override {
|
||||
return std::make_pair(static_cast<IfcFloat>( 0. ), static_cast<IfcFloat>( AI_MATH_TWO_PI / conv.angle_scale ));
|
||||
}
|
||||
|
||||
|
|
@ -102,14 +101,13 @@ protected:
|
|||
class Circle : public Conic {
|
||||
public:
|
||||
// --------------------------------------------------
|
||||
Circle(const Schema_2x3::IfcCircle& entity, ConversionData& conv)
|
||||
: Conic(entity,conv)
|
||||
, entity(entity)
|
||||
{
|
||||
}
|
||||
|
||||
Circle(const Schema_2x3::IfcCircle& entity, ConversionData& conv) : Conic(entity,conv) , entity(entity) {}
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat u) const {
|
||||
~Circle() override = default;
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat u) const override {
|
||||
u = -conv.angle_scale * u;
|
||||
return location + static_cast<IfcFloat>(entity.Radius)*(static_cast<IfcFloat>(std::cos(u))*p[0] +
|
||||
static_cast<IfcFloat>(std::sin(u))*p[1]);
|
||||
|
|
@ -132,7 +130,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat u) const {
|
||||
IfcVector3 Eval(IfcFloat u) const override {
|
||||
u = -conv.angle_scale * u;
|
||||
return location + static_cast<IfcFloat>(entity.SemiAxis1)*static_cast<IfcFloat>(std::cos(u))*p[0] +
|
||||
static_cast<IfcFloat>(entity.SemiAxis2)*static_cast<IfcFloat>(std::sin(u))*p[1];
|
||||
|
|
@ -155,17 +153,17 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
bool IsClosed() const {
|
||||
bool IsClosed() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat u) const {
|
||||
IfcVector3 Eval(IfcFloat u) const override {
|
||||
return p + u*v;
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
// two points are always sufficient for a line segment
|
||||
|
|
@ -174,7 +172,7 @@ public:
|
|||
|
||||
|
||||
// --------------------------------------------------
|
||||
void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const {
|
||||
void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
|
||||
|
|
@ -188,7 +186,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
ParamRange GetParametricRange() const {
|
||||
ParamRange GetParametricRange() const override {
|
||||
const IfcFloat inf = std::numeric_limits<IfcFloat>::infinity();
|
||||
|
||||
return std::make_pair(-inf,+inf);
|
||||
|
|
@ -234,7 +232,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat u) const {
|
||||
IfcVector3 Eval(IfcFloat u) const override {
|
||||
if (curves.empty()) {
|
||||
return IfcVector3();
|
||||
}
|
||||
|
|
@ -254,7 +252,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
size_t cnt = 0;
|
||||
|
|
@ -275,7 +273,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const {
|
||||
void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
|
||||
|
|
@ -293,7 +291,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
ParamRange GetParametricRange() const {
|
||||
ParamRange GetParametricRange() const override {
|
||||
return std::make_pair(static_cast<IfcFloat>( 0. ),total);
|
||||
}
|
||||
|
||||
|
|
@ -373,27 +371,27 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat p) const {
|
||||
IfcVector3 Eval(IfcFloat p) const override {
|
||||
ai_assert(InRange(p));
|
||||
return base->Eval( TrimParam(p) );
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
return base->EstimateSampleCount(TrimParam(a),TrimParam(b));
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
void SampleDiscrete(TempMesh& out,IfcFloat a,IfcFloat b) const {
|
||||
void SampleDiscrete(TempMesh& out,IfcFloat a,IfcFloat b) const override {
|
||||
ai_assert(InRange(a));
|
||||
ai_assert(InRange(b));
|
||||
return base->SampleDiscrete(out,TrimParam(a),TrimParam(b));
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
ParamRange GetParametricRange() const {
|
||||
ParamRange GetParametricRange() const override {
|
||||
return std::make_pair(static_cast<IfcFloat>( 0. ),maxval);
|
||||
}
|
||||
|
||||
|
|
@ -431,7 +429,7 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
IfcVector3 Eval(IfcFloat p) const {
|
||||
IfcVector3 Eval(IfcFloat p) const override {
|
||||
ai_assert(InRange(p));
|
||||
|
||||
const size_t b = static_cast<size_t>(std::floor(p));
|
||||
|
|
@ -444,14 +442,14 @@ public:
|
|||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
|
||||
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const override {
|
||||
ai_assert(InRange(a));
|
||||
ai_assert(InRange(b));
|
||||
return static_cast<size_t>( std::ceil(b) - std::floor(a) );
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
ParamRange GetParametricRange() const {
|
||||
ParamRange GetParametricRange() const override {
|
||||
return std::make_pair(static_cast<IfcFloat>( 0. ),static_cast<IfcFloat>(points.size()-1));
|
||||
}
|
||||
|
||||
|
|
@ -516,7 +514,7 @@ size_t Curve::EstimateSampleCount(IfcFloat a, IfcFloat b) const {
|
|||
ai_assert( InRange( a ) );
|
||||
ai_assert( InRange( b ) );
|
||||
|
||||
// arbitrary default value, deriving classes should supply better suited values
|
||||
// arbitrary default value, deriving classes should supply better-suited values
|
||||
return 16;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
|
|
@ -38,34 +38,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCGeometry.cpp
|
||||
* @brief Geometry conversion and synthesis for IFC
|
||||
*/
|
||||
|
||||
|
||||
/// @file IFCGeometry.cpp
|
||||
/// @brief Geometry conversion and synthesis for IFC
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
#include "IFCUtil.h"
|
||||
#include "Common/PolyTools.h"
|
||||
#include "PostProcessing/ProcessHelper.h"
|
||||
#include "contrib/poly2tri/poly2tri/poly2tri.h"
|
||||
#include "contrib/clipper/clipper.hpp"
|
||||
|
||||
#ifdef ASSIMP_USE_HUNTER
|
||||
# include <poly2tri/poly2tri.h>
|
||||
# include <polyclipping/clipper.hpp>
|
||||
#else
|
||||
# include "../contrib/poly2tri/poly2tri/poly2tri.h"
|
||||
# include "../contrib/clipper/clipper.hpp"
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
namespace Assimp {
|
||||
namespace IFC {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool ProcessPolyloop(const Schema_2x3::IfcPolyLoop& loop, TempMesh& meshout, ConversionData& /*conv*/)
|
||||
{
|
||||
bool ProcessPolyloop(const Schema_2x3::IfcPolyLoop& loop, TempMesh& meshout, ConversionData& /*conv*/) {
|
||||
size_t cnt = 0;
|
||||
for(const Schema_2x3::IfcCartesianPoint& c : loop.Polygon) {
|
||||
IfcVector3 tmp;
|
||||
|
|
@ -90,8 +81,7 @@ bool ProcessPolyloop(const Schema_2x3::IfcPolyLoop& loop, TempMesh& meshout, Con
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t master_bounds = (size_t)-1)
|
||||
{
|
||||
void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t master_bounds = (size_t)-1) {
|
||||
// handle all trivial cases
|
||||
if(inmesh.mVertcnt.empty()) {
|
||||
return;
|
||||
|
|
@ -126,8 +116,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m
|
|||
if (master_bounds != (size_t)-1) {
|
||||
ai_assert(master_bounds < inmesh.mVertcnt.size());
|
||||
outer_polygon_it = begin + master_bounds;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for(iit = begin; iit != end; ++iit) {
|
||||
// find the polygon with the largest area and take it as the outer bound.
|
||||
IfcVector3& n = normals[std::distance(begin,iit)];
|
||||
|
|
@ -138,7 +127,8 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m
|
|||
}
|
||||
}
|
||||
}
|
||||
if (outer_polygon_it == end) {
|
||||
|
||||
if (outer_polygon_it == end) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -204,40 +194,20 @@ void ProcessConnectedFaceSet(const Schema_2x3::IfcConnectedFaceSet& fset, TempMe
|
|||
|
||||
if(const Schema_2x3::IfcPolyLoop* const polyloop = bound.Bound->ToPtr<Schema_2x3::IfcPolyLoop>()) {
|
||||
if(ProcessPolyloop(*polyloop, meshout,conv)) {
|
||||
|
||||
// The outer boundary is better determined by checking which
|
||||
// polygon covers the largest area.
|
||||
|
||||
//if(bound.ToPtr<IfcFaceOuterBound>()) {
|
||||
// ob = cnt;
|
||||
//}
|
||||
//++cnt;
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogWarn("skipping unknown IfcFaceBound entity, type is ", bound.Bound->GetClassName());
|
||||
continue;
|
||||
}
|
||||
|
||||
// And this, even though it is sometimes TRUE and sometimes FALSE,
|
||||
// does not really improve results.
|
||||
|
||||
/*if(!IsTrue(bound.Orientation)) {
|
||||
size_t c = 0;
|
||||
for(unsigned int& c : meshout.vertcnt) {
|
||||
std::reverse(result.verts.begin() + cnt,result.verts.begin() + cnt + c);
|
||||
cnt += c;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
ProcessPolygonBoundaries(result, meshout);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessRevolvedAreaSolid(const Schema_2x3::IfcRevolvedAreaSolid& solid, TempMesh& result, ConversionData& conv)
|
||||
{
|
||||
void ProcessRevolvedAreaSolid(const Schema_2x3::IfcRevolvedAreaSolid& solid, TempMesh& result, ConversionData& conv) {
|
||||
TempMesh meshout;
|
||||
|
||||
// first read the profile description
|
||||
|
|
@ -264,7 +234,8 @@ void ProcessRevolvedAreaSolid(const Schema_2x3::IfcRevolvedAreaSolid& solid, Tem
|
|||
return;
|
||||
}
|
||||
|
||||
const unsigned int cnt_segments = std::max(2u,static_cast<unsigned int>(conv.settings.cylindricalTessellation * std::fabs(max_angle)/AI_MATH_HALF_PI_F));
|
||||
const unsigned int cnt_segments =
|
||||
std::max(2u,static_cast<unsigned int>(conv.settings.cylindricalTessellation * std::fabs(max_angle)/AI_MATH_HALF_PI_F));
|
||||
const IfcFloat delta = max_angle/cnt_segments;
|
||||
|
||||
has_area = has_area && std::fabs(max_angle) < AI_MATH_TWO_PI_F*0.99;
|
||||
|
|
@ -323,8 +294,9 @@ void ProcessRevolvedAreaSolid(const Schema_2x3::IfcRevolvedAreaSolid& solid, Tem
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessSweptDiskSolid(const Schema_2x3::IfcSweptDiskSolid &solid, TempMesh& result, ConversionData& conv)
|
||||
{
|
||||
void ProcessSweptDiskSolid(const Schema_2x3::IfcSweptDiskSolid &solid,
|
||||
TempMesh& result,
|
||||
ConversionData& conv) {
|
||||
const Curve* const curve = Curve::Convert(*solid.Directrix, conv);
|
||||
if(!curve) {
|
||||
IFCImporter::LogError("failed to convert Directrix curve (IfcSweptDiskSolid)");
|
||||
|
|
@ -459,8 +431,7 @@ void ProcessSweptDiskSolid(const Schema_2x3::IfcSweptDiskSolid &solid, TempMesh&
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVector3& norOut)
|
||||
{
|
||||
IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVector3& norOut) {
|
||||
const std::vector<IfcVector3>& out = curmesh.mVerts;
|
||||
IfcMatrix3 m;
|
||||
|
||||
|
|
@ -503,10 +474,6 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVect
|
|||
IfcVector3 r = (out[idx]-any_point);
|
||||
r.Normalize();
|
||||
|
||||
//if(d) {
|
||||
// *d = -any_point * nor;
|
||||
//}
|
||||
|
||||
// Reconstruct orthonormal basis
|
||||
// XXX use Gram Schmidt for increased robustness
|
||||
IfcVector3 u = r ^ nor;
|
||||
|
|
@ -530,8 +497,7 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVect
|
|||
const auto closeDistance = ai_epsilon;
|
||||
|
||||
bool areClose(Schema_2x3::IfcCartesianPoint pt1,Schema_2x3::IfcCartesianPoint pt2) {
|
||||
if(pt1.Coordinates.size() != pt2.Coordinates.size())
|
||||
{
|
||||
if(pt1.Coordinates.size() != pt2.Coordinates.size()) {
|
||||
IFCImporter::LogWarn("unable to compare differently-dimensioned points");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -539,10 +505,10 @@ bool areClose(Schema_2x3::IfcCartesianPoint pt1,Schema_2x3::IfcCartesianPoint pt
|
|||
auto coord2 = pt2.Coordinates.begin();
|
||||
// we're just testing each dimension separately rather than doing euclidean distance, as we're
|
||||
// looking for very close coordinates
|
||||
for(; coord1 != pt1.Coordinates.end(); coord1++,coord2++)
|
||||
{
|
||||
if(std::fabs(*coord1 - *coord2) > closeDistance)
|
||||
for(; coord1 != pt1.Coordinates.end(); coord1++,coord2++) {
|
||||
if(std::fabs(*coord1 - *coord2) > closeDistance) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -552,6 +518,7 @@ bool areClose(IfcVector3 pt1,IfcVector3 pt2) {
|
|||
std::fabs(pt1.y - pt2.y) < closeDistance &&
|
||||
std::fabs(pt1.z - pt2.z) < closeDistance);
|
||||
}
|
||||
|
||||
// Extrudes the given polygon along the direction, converts it into an opening or applies all openings as necessary.
|
||||
void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const TempMesh& curve,
|
||||
const IfcVector3& extrusionDir, TempMesh& result, ConversionData &conv, bool collect_openings)
|
||||
|
|
@ -589,8 +556,9 @@ void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const Te
|
|||
|
||||
// reverse profile polygon if it's winded in the wrong direction in relation to the extrusion direction
|
||||
IfcVector3 profileNormal = TempMesh::ComputePolygonNormal(in.data(), in.size());
|
||||
if( profileNormal * dir < 0.0 )
|
||||
if( profileNormal * dir < 0.0 ) {
|
||||
std::reverse(in.begin(), in.end());
|
||||
}
|
||||
|
||||
std::vector<IfcVector3> nors;
|
||||
const bool openings = !!conv.apply_openings && conv.apply_openings->size();
|
||||
|
|
@ -609,7 +577,7 @@ void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const Te
|
|||
|
||||
nors.reserve(conv.apply_openings->size());
|
||||
for(TempOpening& t : *conv.apply_openings) {
|
||||
TempMesh& bounds = *t.profileMesh.get();
|
||||
TempMesh &bounds = *t.profileMesh;
|
||||
|
||||
if( bounds.mVerts.size() <= 2 ) {
|
||||
nors.emplace_back();
|
||||
|
|
@ -677,8 +645,7 @@ void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const Te
|
|||
if(n > 0) {
|
||||
for(size_t i = 0; i < in.size(); ++i)
|
||||
out.push_back(in[i] + dir);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for(size_t i = in.size(); i--; )
|
||||
out.push_back(in[i]);
|
||||
}
|
||||
|
|
@ -713,16 +680,17 @@ void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const Te
|
|||
std::shared_ptr<TempMesh> profile2D = std::shared_ptr<TempMesh>(new TempMesh());
|
||||
profile2D->mVerts.insert(profile2D->mVerts.end(), in.begin(), in.end());
|
||||
profile2D->mVertcnt.push_back(static_cast<unsigned int>(in.size()));
|
||||
conv.collect_openings->push_back(TempOpening(&solid, dir, profile, profile2D));
|
||||
conv.collect_openings->push_back(TempOpening(&solid, dir, std::move(profile), std::move(profile2D)));
|
||||
|
||||
ai_assert(result.IsEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessExtrudedAreaSolid(const Schema_2x3::IfcExtrudedAreaSolid& solid, TempMesh& result,
|
||||
ConversionData& conv, bool collect_openings)
|
||||
{
|
||||
void ProcessExtrudedAreaSolid(const Schema_2x3::IfcExtrudedAreaSolid& solid,
|
||||
TempMesh& result,
|
||||
ConversionData& conv,
|
||||
bool collect_openings) {
|
||||
TempMesh meshout;
|
||||
|
||||
// First read the profile description.
|
||||
|
|
@ -760,24 +728,23 @@ void ProcessExtrudedAreaSolid(const Schema_2x3::IfcExtrudedAreaSolid& solid, Tem
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessSweptAreaSolid(const Schema_2x3::IfcSweptAreaSolid& swept, TempMesh& meshout,
|
||||
ConversionData& conv)
|
||||
{
|
||||
void ProcessSweptAreaSolid(const Schema_2x3::IfcSweptAreaSolid& swept,
|
||||
TempMesh& meshout,
|
||||
ConversionData& conv) {
|
||||
if(const Schema_2x3::IfcExtrudedAreaSolid* const solid = swept.ToPtr<Schema_2x3::IfcExtrudedAreaSolid>()) {
|
||||
ProcessExtrudedAreaSolid(*solid,meshout,conv, !!conv.collect_openings);
|
||||
}
|
||||
else if(const Schema_2x3::IfcRevolvedAreaSolid* const rev = swept.ToPtr<Schema_2x3::IfcRevolvedAreaSolid>()) {
|
||||
} else if(const Schema_2x3::IfcRevolvedAreaSolid* const rev = swept.ToPtr<Schema_2x3::IfcRevolvedAreaSolid>()) {
|
||||
ProcessRevolvedAreaSolid(*rev,meshout,conv);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogWarn("skipping unknown IfcSweptAreaSolid entity, type is ", swept.GetClassName());
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned int matid, std::set<unsigned int>& mesh_indices,
|
||||
ConversionData& conv)
|
||||
{
|
||||
bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo,
|
||||
unsigned int matid,
|
||||
std::set<unsigned int>& mesh_indices,
|
||||
ConversionData& conv) {
|
||||
bool fix_orientation = false;
|
||||
std::shared_ptr< TempMesh > meshtmp = std::make_shared<TempMesh>();
|
||||
if(const Schema_2x3::IfcShellBasedSurfaceModel* shellmod = geo.ToPtr<Schema_2x3::IfcShellBasedSurfaceModel>()) {
|
||||
|
|
@ -786,42 +753,33 @@ bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned
|
|||
const ::Assimp::STEP::EXPRESS::ENTITY& e = shell->To<::Assimp::STEP::EXPRESS::ENTITY>();
|
||||
const Schema_2x3::IfcConnectedFaceSet& fs = conv.db.MustGetObject(e).To<Schema_2x3::IfcConnectedFaceSet>();
|
||||
|
||||
ProcessConnectedFaceSet(fs,*meshtmp.get(),conv);
|
||||
}
|
||||
catch(std::bad_cast&) {
|
||||
ProcessConnectedFaceSet(fs, *meshtmp, conv);
|
||||
} catch(std::bad_cast&) {
|
||||
IFCImporter::LogWarn("unexpected type error, IfcShell ought to inherit from IfcConnectedFaceSet");
|
||||
}
|
||||
}
|
||||
fix_orientation = true;
|
||||
}
|
||||
else if(const Schema_2x3::IfcConnectedFaceSet* fset = geo.ToPtr<Schema_2x3::IfcConnectedFaceSet>()) {
|
||||
ProcessConnectedFaceSet(*fset,*meshtmp.get(),conv);
|
||||
} else if(const Schema_2x3::IfcConnectedFaceSet* fset = geo.ToPtr<Schema_2x3::IfcConnectedFaceSet>()) {
|
||||
ProcessConnectedFaceSet(*fset, *meshtmp, conv);
|
||||
fix_orientation = true;
|
||||
}
|
||||
else if(const Schema_2x3::IfcSweptAreaSolid* swept = geo.ToPtr<Schema_2x3::IfcSweptAreaSolid>()) {
|
||||
ProcessSweptAreaSolid(*swept,*meshtmp.get(),conv);
|
||||
}
|
||||
else if(const Schema_2x3::IfcSweptDiskSolid* disk = geo.ToPtr<Schema_2x3::IfcSweptDiskSolid>()) {
|
||||
ProcessSweptDiskSolid(*disk,*meshtmp.get(),conv);
|
||||
}
|
||||
else if(const Schema_2x3::IfcManifoldSolidBrep* brep = geo.ToPtr<Schema_2x3::IfcManifoldSolidBrep>()) {
|
||||
ProcessConnectedFaceSet(brep->Outer,*meshtmp.get(),conv);
|
||||
} else if(const Schema_2x3::IfcSweptAreaSolid* swept = geo.ToPtr<Schema_2x3::IfcSweptAreaSolid>()) {
|
||||
ProcessSweptAreaSolid(*swept, *meshtmp, conv);
|
||||
} else if(const Schema_2x3::IfcSweptDiskSolid* disk = geo.ToPtr<Schema_2x3::IfcSweptDiskSolid>()) {
|
||||
ProcessSweptDiskSolid(*disk, *meshtmp, conv);
|
||||
} else if(const Schema_2x3::IfcManifoldSolidBrep* brep = geo.ToPtr<Schema_2x3::IfcManifoldSolidBrep>()) {
|
||||
ProcessConnectedFaceSet(brep->Outer, *meshtmp, conv);
|
||||
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) {
|
||||
ProcessConnectedFaceSet(fc,*meshtmp.get(),conv);
|
||||
ProcessConnectedFaceSet(fc, *meshtmp, conv);
|
||||
}
|
||||
fix_orientation = true;
|
||||
}
|
||||
else if(const Schema_2x3::IfcBooleanResult* boolean = geo.ToPtr<Schema_2x3::IfcBooleanResult>()) {
|
||||
ProcessBoolean(*boolean,*meshtmp.get(),conv);
|
||||
}
|
||||
else if(geo.ToPtr<Schema_2x3::IfcBoundingBox>()) {
|
||||
} else if(const Schema_2x3::IfcBooleanResult* boolean = geo.ToPtr<Schema_2x3::IfcBooleanResult>()) {
|
||||
ProcessBoolean(*boolean, *meshtmp, conv);
|
||||
} else if(geo.ToPtr<Schema_2x3::IfcBoundingBox>()) {
|
||||
// silently skip over bounding boxes
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
std::stringstream toLog;
|
||||
toLog << "skipping unknown IfcGeometricRepresentationItem entity, type is " << geo.GetClassName() << " id is " << geo.GetID();
|
||||
IFCImporter::LogWarn(toLog.str().c_str());
|
||||
|
|
@ -839,7 +797,7 @@ bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned
|
|||
if (!meshtmp->IsEmpty()) {
|
||||
conv.collect_openings->push_back(TempOpening(geo.ToPtr<Schema_2x3::IfcSolidModel>(),
|
||||
IfcVector3(0,0,0),
|
||||
meshtmp,
|
||||
std::move(meshtmp),
|
||||
std::shared_ptr<TempMesh>()));
|
||||
}
|
||||
return true;
|
||||
|
|
@ -867,9 +825,7 @@ bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void AssignAddedMeshes(std::set<unsigned int>& mesh_indices,aiNode* nd,
|
||||
ConversionData& /*conv*/)
|
||||
{
|
||||
void AssignAddedMeshes(std::set<unsigned int>& mesh_indices,aiNode* nd, ConversionData& /*conv*/) {
|
||||
if (!mesh_indices.empty()) {
|
||||
std::set<unsigned int>::const_iterator it = mesh_indices.cbegin();
|
||||
std::set<unsigned int>::const_iterator end = mesh_indices.cend();
|
||||
|
|
@ -885,9 +841,9 @@ void AssignAddedMeshes(std::set<unsigned int>& mesh_indices,aiNode* nd,
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool TryQueryMeshCache(const Schema_2x3::IfcRepresentationItem& item,
|
||||
std::set<unsigned int>& mesh_indices, unsigned int mat_index,
|
||||
ConversionData& conv)
|
||||
{
|
||||
std::set<unsigned int>& mesh_indices,
|
||||
unsigned int mat_index,
|
||||
ConversionData& conv) {
|
||||
ConversionData::MeshCacheIndex idx(&item, mat_index);
|
||||
ConversionData::MeshCache::const_iterator it = conv.cached_meshes.find(idx);
|
||||
if (it != conv.cached_meshes.end()) {
|
||||
|
|
@ -899,18 +855,18 @@ bool TryQueryMeshCache(const Schema_2x3::IfcRepresentationItem& item,
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void PopulateMeshCache(const Schema_2x3::IfcRepresentationItem& item,
|
||||
const std::set<unsigned int>& mesh_indices, unsigned int mat_index,
|
||||
ConversionData& conv)
|
||||
{
|
||||
const std::set<unsigned int>& mesh_indices,
|
||||
unsigned int mat_index,
|
||||
ConversionData& conv) {
|
||||
ConversionData::MeshCacheIndex idx(&item, mat_index);
|
||||
conv.cached_meshes[idx] = mesh_indices;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool ProcessRepresentationItem(const Schema_2x3::IfcRepresentationItem& item, unsigned int matid,
|
||||
std::set<unsigned int>& mesh_indices,
|
||||
ConversionData& conv)
|
||||
{
|
||||
bool ProcessRepresentationItem(const Schema_2x3::IfcRepresentationItem& item,
|
||||
unsigned int matid,
|
||||
std::set<unsigned int>& mesh_indices,
|
||||
ConversionData& conv) {
|
||||
// determine material
|
||||
unsigned int localmatid = ProcessMaterials(item.GetID(), matid, conv, true);
|
||||
|
||||
|
|
@ -919,8 +875,9 @@ bool ProcessRepresentationItem(const Schema_2x3::IfcRepresentationItem& item, un
|
|||
if(mesh_indices.size()) {
|
||||
PopulateMeshCache(item,mesh_indices,localmatid,conv);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -929,4 +886,4 @@ bool ProcessRepresentationItem(const Schema_2x3::IfcRepresentationItem& item, un
|
|||
} // ! IFC
|
||||
} // ! Assimp
|
||||
|
||||
#endif
|
||||
#endif // ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -40,14 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCLoad.cpp
|
||||
* @brief Implementation of the Industry Foundation Classes loader.
|
||||
*/
|
||||
/// @file IFCLoad.cpp
|
||||
/// @brief Implementation of the Industry Foundation Classes loader.
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||
|
|
@ -67,12 +66,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/importerdesc.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace Assimp {
|
||||
template <>
|
||||
const char *LogFunctions<IFCImporter>::Prefix() {
|
||||
static auto prefix = "IFC: ";
|
||||
return prefix;
|
||||
return "IFC: ";
|
||||
}
|
||||
} // namespace Assimp
|
||||
|
||||
|
|
@ -91,7 +90,6 @@ using namespace Assimp::IFC;
|
|||
IfcUnitAssignment
|
||||
IfcClosedShell
|
||||
IfcDoor
|
||||
|
||||
*/
|
||||
|
||||
namespace {
|
||||
|
|
@ -105,7 +103,7 @@ void ConvertUnit(const ::Assimp::STEP::EXPRESS::DataType &dt, ConversionData &co
|
|||
|
||||
} // namespace
|
||||
|
||||
static const aiImporterDesc desc = {
|
||||
static constexpr aiImporterDesc desc = {
|
||||
"Industry Foundation Classes (IFC) Importer",
|
||||
"",
|
||||
"",
|
||||
|
|
@ -118,14 +116,6 @@ static const aiImporterDesc desc = {
|
|||
"ifc ifczip step stp"
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor to be privately used by Importer
|
||||
IFCImporter::IFCImporter() = default;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Destructor, private as well
|
||||
IFCImporter::~IFCImporter() = default;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns whether the class can handle the format of the given file.
|
||||
bool IFCImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
||||
|
|
@ -185,7 +175,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
// get file size, etc.
|
||||
unz_file_info fileInfo;
|
||||
char filename[256];
|
||||
unzGetCurrentFileInfo(zip, &fileInfo, filename, sizeof(filename), 0, 0, 0, 0);
|
||||
unzGetCurrentFileInfo(zip, &fileInfo, filename, sizeof(filename), nullptr, 0, nullptr, 0);
|
||||
if (GetExtension(filename) != "ifc") {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -195,7 +185,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
size_t total = 0;
|
||||
int read = 0;
|
||||
do {
|
||||
int bufferSize = fileInfo.uncompressed_size < INT16_MAX ? fileInfo.uncompressed_size : INT16_MAX;
|
||||
unsigned bufferSize = fileInfo.uncompressed_size < INT16_MAX ? static_cast<unsigned>(fileInfo.uncompressed_size) : INT16_MAX;
|
||||
void *buffer = malloc(bufferSize);
|
||||
read = unzReadCurrentFile(zip, buffer, bufferSize);
|
||||
if (read > 0) {
|
||||
|
|
@ -210,7 +200,7 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
ThrowException("Failed to decompress IFC ZIP file");
|
||||
}
|
||||
unzCloseCurrentFile(zip);
|
||||
stream.reset(new MemoryIOStream(buff, fileInfo.uncompressed_size, true));
|
||||
stream = std::make_shared<MemoryIOStream>(buff, fileInfo.uncompressed_size, true);
|
||||
if (unzGoToNextFile(zip) == UNZ_END_OF_LIST_OF_FILE) {
|
||||
ThrowException("Found no IFC file member in IFCZIP file (1)");
|
||||
}
|
||||
|
|
@ -227,10 +217,10 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
|
||||
std::unique_ptr<STEP::DB> db(STEP::ReadFileHeader(std::move(stream)));
|
||||
const STEP::HeaderInfo &head = static_cast<const STEP::DB &>(*db).GetHeader();
|
||||
|
||||
if (!head.fileSchema.size() || head.fileSchema.substr(0, 3) != "IFC") {
|
||||
if (!head.fileSchema.size() || head.fileSchema.substr(0, 4) != "IFC2") {
|
||||
ThrowException("Unrecognized file schema: " + head.fileSchema);
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +245,12 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
|
||||
// tell the reader for which types we need to simulate STEPs reverse indices
|
||||
static const char *const inverse_indices_to_track[] = {
|
||||
"ifcrelcontainedinspatialstructure", "ifcrelaggregates", "ifcrelvoidselement", "ifcreldefinesbyproperties", "ifcpropertyset", "ifcstyleditem"
|
||||
"ifcrelcontainedinspatialstructure",
|
||||
"ifcrelaggregates",
|
||||
"ifcrelvoidselement",
|
||||
"ifcreldefinesbyproperties",
|
||||
"ifcpropertyset",
|
||||
"ifcstyleditem"
|
||||
};
|
||||
|
||||
// feed the IFC schema into the reader and pre-parse all lines
|
||||
|
|
@ -265,6 +260,8 @@ void IFCImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
|||
ThrowException("missing IfcProject entity");
|
||||
}
|
||||
|
||||
|
||||
|
||||
ConversionData conv(*db, proj->To<Schema_2x3::IfcProject>(), pScene, settings);
|
||||
SetUnits(conv);
|
||||
SetCoordinateSpace(conv);
|
||||
|
|
@ -357,6 +354,11 @@ void ConvertUnit(const ::Assimp::STEP::EXPRESS::DataType &dt, ConversionData &co
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetUnits(ConversionData &conv) {
|
||||
if (conv.proj.UnitsInContext == nullptr) {
|
||||
IFCImporter::LogError("Skipping conversion data, nullptr.");
|
||||
return;
|
||||
}
|
||||
|
||||
// see if we can determine the coordinate space used to express.
|
||||
for (size_t i = 0; i < conv.proj.UnitsInContext->Units.size(); ++i) {
|
||||
ConvertUnit(*conv.proj.UnitsInContext->Units[i], conv);
|
||||
|
|
@ -927,4 +929,4 @@ void MakeTreeRelative(ConversionData &conv) {
|
|||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
#endif // ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
@ -87,8 +87,8 @@ public:
|
|||
int cylindricalTessellation;
|
||||
};
|
||||
|
||||
IFCImporter();
|
||||
~IFCImporter() override;
|
||||
IFCImporter() = default;
|
||||
~IFCImporter() override = default;
|
||||
|
||||
// --------------------
|
||||
bool CanRead(const std::string &pFile,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -40,9 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCMaterial.cpp
|
||||
* @brief Implementation of conversion routines to convert IFC materials to aiMaterial
|
||||
*/
|
||||
/// @file IFCMaterial.cpp
|
||||
/// @brief Implementation of conversion routines to convert IFC materials to aiMaterial
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
||||
|
|
@ -174,7 +172,6 @@ unsigned int ProcessMaterials(uint64_t id, unsigned int prevMatId, ConversionDat
|
|||
|
||||
aiString name;
|
||||
name.Set("<IFCDefault>");
|
||||
// ConvertColorToString( color, name);
|
||||
|
||||
// look if there's already a default material with this base color
|
||||
for( size_t a = 0; a < conv.materials.size(); ++a ) {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2,8 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -40,9 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCProfile.cpp
|
||||
* @brief Read profile and curves entities from IFC files
|
||||
*/
|
||||
/// @file IFCProfile.cpp
|
||||
/// @brief Read profile and curves entities from IFC files
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
||||
|
|
@ -52,8 +50,9 @@ namespace Assimp {
|
|||
namespace IFC {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessPolyLine(const Schema_2x3::IfcPolyline& def, TempMesh& meshout, ConversionData& /*conv*/)
|
||||
{
|
||||
void ProcessPolyLine(const Schema_2x3::IfcPolyline& def,
|
||||
TempMesh& meshout,
|
||||
ConversionData& /*conv*/) {
|
||||
// this won't produce a valid mesh, it just spits out a list of vertices
|
||||
IfcVector3 t;
|
||||
for(const Schema_2x3::IfcCartesianPoint& cp : def.Points) {
|
||||
|
|
@ -64,8 +63,9 @@ void ProcessPolyLine(const Schema_2x3::IfcPolyline& def, TempMesh& meshout, Conv
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool ProcessCurve(const Schema_2x3::IfcCurve& curve, TempMesh& meshout, ConversionData& conv)
|
||||
{
|
||||
bool ProcessCurve(const Schema_2x3::IfcCurve& curve,
|
||||
TempMesh& meshout,
|
||||
ConversionData& conv) {
|
||||
std::unique_ptr<const Curve> cv(Curve::Convert(curve,conv));
|
||||
if (!cv) {
|
||||
IFCImporter::LogWarn("skipping unknown IfcCurve entity, type is ", curve.GetClassName());
|
||||
|
|
@ -90,20 +90,23 @@ bool ProcessCurve(const Schema_2x3::IfcCurve& curve, TempMesh& meshout, Convers
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessClosedProfile(const Schema_2x3::IfcArbitraryClosedProfileDef& def, TempMesh& meshout, ConversionData& conv)
|
||||
{
|
||||
void ProcessClosedProfile(const Schema_2x3::IfcArbitraryClosedProfileDef& def,
|
||||
TempMesh& meshout,
|
||||
ConversionData& conv) {
|
||||
ProcessCurve(def.OuterCurve,meshout,conv);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessOpenProfile(const Schema_2x3::IfcArbitraryOpenProfileDef& def, TempMesh& meshout, ConversionData& conv)
|
||||
{
|
||||
void ProcessOpenProfile(const Schema_2x3::IfcArbitraryOpenProfileDef& def,
|
||||
TempMesh& meshout,
|
||||
ConversionData& conv) {
|
||||
ProcessCurve(def.Curve,meshout,conv);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& def, TempMesh& meshout, ConversionData& conv)
|
||||
{
|
||||
void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& def,
|
||||
TempMesh& meshout,
|
||||
ConversionData& conv) {
|
||||
if(const Schema_2x3::IfcRectangleProfileDef* const cprofile = def.ToPtr<Schema_2x3::IfcRectangleProfileDef>()) {
|
||||
const IfcFloat x = cprofile->XDim*0.5f, y = cprofile->YDim*0.5f;
|
||||
|
||||
|
|
@ -113,8 +116,7 @@ void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& de
|
|||
meshout.mVerts.emplace_back(-x,-y, 0.f );
|
||||
meshout.mVerts.emplace_back( x,-y, 0.f );
|
||||
meshout.mVertcnt.push_back(4);
|
||||
}
|
||||
else if( const Schema_2x3::IfcCircleProfileDef* const circle = def.ToPtr<Schema_2x3::IfcCircleProfileDef>()) {
|
||||
} else if( const Schema_2x3::IfcCircleProfileDef* const circle = def.ToPtr<Schema_2x3::IfcCircleProfileDef>()) {
|
||||
if(def.ToPtr<Schema_2x3::IfcCircleHollowProfileDef>()) {
|
||||
// TODO
|
||||
}
|
||||
|
|
@ -129,8 +131,7 @@ void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& de
|
|||
}
|
||||
|
||||
meshout.mVertcnt.push_back(static_cast<unsigned int>(segments));
|
||||
}
|
||||
else if( const Schema_2x3::IfcIShapeProfileDef* const ishape = def.ToPtr<Schema_2x3::IfcIShapeProfileDef>()) {
|
||||
} else if( const Schema_2x3::IfcIShapeProfileDef* const ishape = def.ToPtr<Schema_2x3::IfcIShapeProfileDef>()) {
|
||||
// construct simplified IBeam shape
|
||||
const IfcFloat offset = (ishape->OverallWidth - ishape->WebThickness) / 2;
|
||||
const IfcFloat inner_height = ishape->OverallDepth - ishape->FlangeThickness * 2;
|
||||
|
|
@ -150,8 +151,7 @@ void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& de
|
|||
meshout.mVerts.emplace_back(ishape->OverallWidth,0,0);
|
||||
|
||||
meshout.mVertcnt.push_back(12);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogWarn("skipping unknown IfcParameterizedProfileDef entity, type is ", def.GetClassName());
|
||||
return;
|
||||
}
|
||||
|
|
@ -162,18 +162,14 @@ void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& de
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool ProcessProfile(const Schema_2x3::IfcProfileDef& prof, TempMesh& meshout, ConversionData& conv)
|
||||
{
|
||||
bool ProcessProfile(const Schema_2x3::IfcProfileDef& prof, TempMesh& meshout, ConversionData& conv) {
|
||||
if(const Schema_2x3::IfcArbitraryClosedProfileDef* const cprofile = prof.ToPtr<Schema_2x3::IfcArbitraryClosedProfileDef>()) {
|
||||
ProcessClosedProfile(*cprofile,meshout,conv);
|
||||
}
|
||||
else if(const Schema_2x3::IfcArbitraryOpenProfileDef* const copen = prof.ToPtr<Schema_2x3::IfcArbitraryOpenProfileDef>()) {
|
||||
} else if(const Schema_2x3::IfcArbitraryOpenProfileDef* const copen = prof.ToPtr<Schema_2x3::IfcArbitraryOpenProfileDef>()) {
|
||||
ProcessOpenProfile(*copen,meshout,conv);
|
||||
}
|
||||
else if(const Schema_2x3::IfcParameterizedProfileDef* const cparam = prof.ToPtr<Schema_2x3::IfcParameterizedProfileDef>()) {
|
||||
} else if(const Schema_2x3::IfcParameterizedProfileDef* const cparam = prof.ToPtr<Schema_2x3::IfcParameterizedProfileDef>()) {
|
||||
ProcessParametrizedProfile(*cparam,meshout,conv);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogWarn("skipping unknown IfcProfileDef entity, type is ", prof.GetClassName());
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
try { GenericConvert( in->GlobalId, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRoot to be a `IfcGloballyUniqueId`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'OwnerHistory' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->OwnerHistory, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRoot to be a `IfcOwnerHistory`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Name' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[2]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRoot to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Description' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRoot,4>::aux_is_derived[3]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Description, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRoot to be a `IfcText`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->ContextOfItems, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentation to be a `IfcRepresentationContext`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RepresentationIdentifier' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->RepresentationIdentifier, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentation to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RepresentationType' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[2]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->RepresentationType, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRepresentation to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Items' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentation,4>::aux_is_derived[3]=true; break; }
|
||||
try { GenericConvert( in->Items, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRepresentation to be a `SET [1:?] OF IfcRepresentationItem`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->ObjectType, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcObject to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProductRepresentation to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Description' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProductRepresentation,3>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Description, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProductRepresentation to be a `IfcText`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Representations' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProductRepresentation,3>::aux_is_derived[2]=true; break; }
|
||||
try { GenericConvert( in->Representations, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcProductRepresentation to be a `LIST [1:?] OF IfcRepresentation`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->ObjectPlacement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProduct to be a `IfcObjectPlacement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Representation' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProduct,2>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Representation, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProduct to be a `IfcProductRepresentation`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Tag, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcElement to be a `IfcIdentifier`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Segments, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurve to be a `LIST [1:?] OF IfcCompositeCurveSegment`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SelfIntersect' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCompositeCurve,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->SelfIntersect, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurve to be a `LOGICAL`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Axis1, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianTransformationOperator to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Axis2' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Axis2, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCartesianTransformationOperator to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'LocalOrigin' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[2]=true; break; }
|
||||
try { GenericConvert( in->LocalOrigin, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCartesianTransformationOperator to be a `IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Scale' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcCartesianTransformationOperator,4>::aux_is_derived[3]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Scale, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCartesianTransformationOperator to be a `REAL`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Axis3, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCartesianTransformationOperator3D to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProperty to be a `IfcIdentifier`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Description' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProperty,2>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Description, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProperty to be a `IfcText`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Position, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcElementarySurface to be a `IfcAxis2Placement3D`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Operator, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBooleanResult to be a `IfcBooleanOperator`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'FirstOperand' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBooleanResult,3>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->FirstOperand, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBooleanResult to be a `IfcBooleanOperand`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SecondOperand' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBooleanResult,3>::aux_is_derived[2]=true; break; }
|
||||
try { GenericConvert( in->SecondOperand, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBooleanResult to be a `IfcBooleanOperand`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Outer, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcManifoldSolidBrep to be a `IfcClosedShell`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelFillsElement to be a `IfcOpeningElement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RelatedBuildingElement' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelFillsElement to be a `IfcElement`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->RelatedElements, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelContainedInSpatialStructure to be a `SET [1:?] OF IfcProduct`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RelatingStructure' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->RelatingStructure, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelContainedInSpatialStructure to be a `IfcSpatialStructureElement`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->DirectionRatios, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcDirection to be a `LIST [2:3] OF REAL`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->ProfileType, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProfileDef to be a `IfcProfileTypeEnum`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ProfileName' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcProfileDef,2>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->ProfileName, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProfileDef to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Position, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcParameterizedProfileDef to be a `IfcAxis2Placement2D`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Radius, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcCircleProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->WallThickness, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCircleHollowProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Location, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPlacement to be a `IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Axis, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement3D to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RefDirection' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->RefDirection, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcAxis2Placement3D to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyle to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Transition, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurveSegment to be a `IfcTransitionCode`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SameSense' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->SameSense, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurveSegment to be a `BOOLEAN`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ParentCurve' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->ParentCurve, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCompositeCurveSegment to be a `IfcCurve`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->XDim, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'YDim' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRectangleProfileDef,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->YDim, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->PlacementRelTo, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLocalPlacement to be a `IfcObjectPlacement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RelativePlacement' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->RelativePlacement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLocalPlacement to be a `IfcAxis2Placement`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->SweptArea, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptAreaSolid to be a `IfcProfileDef`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Position' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSweptAreaSolid,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->Position, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptAreaSolid to be a `IfcAxis2Placement3D`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Axis, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRevolvedAreaSolid to be a `IfcAxis1Placement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Angle' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Angle, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRevolvedAreaSolid to be a `IfcPlaneAngleMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Directrix, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptDiskSolid to be a `IfcCurve`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Radius' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Radius, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'InnerRadius' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->InnerRadius, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'StartParam' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->StartParam, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSweptDiskSolid to be a `IfcParameterValue`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'EndParam' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->EndParam, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSweptDiskSolid to be a `IfcParameterValue`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->BaseSurface, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcHalfSpaceSolid to be a `IfcSurface`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'AgreementFlag' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcHalfSpaceSolid,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->AgreementFlag, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcHalfSpaceSolid to be a `BOOLEAN`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Position, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPolygonalBoundedHalfSpace to be a `IfcAxis2Placement3D`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'PolygonalBoundary' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->PolygonalBoundary, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPolygonalBoundedHalfSpace to be a `IfcBoundedCurve`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->LongName, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProject to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Phase' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Phase, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProject to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RepresentationContexts' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->RepresentationContexts, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcProject to be a `SET [1:?] OF IfcRepresentationContext`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'UnitsInContext' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->UnitsInContext, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcProject to be a `IfcUnitAssignment`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->BasisCurve, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcTrimmedCurve to be a `IfcCurve`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Trim1' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Trim1, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Trim2' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Trim2, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SenseAgreement' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->SenseAgreement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcTrimmedCurve to be a `BOOLEAN`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'MasterRepresentation' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->MasterRepresentation, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcTrimmedCurve to be a `IfcTrimmingPreference`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->RelatedObjects, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDefines to be a `SET [1:?] OF IfcObject`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->RelatingPropertyDefinition, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDefinesByProperties to be a `IfcPropertySetDefinition`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Curve, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryOpenProfileDef to be a `IfcBoundedCurve`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->RelatingObject, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDecomposes to be a `IfcObjectDefinition`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RelatedObjects' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRelDecomposes,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->RelatedObjects, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDecomposes to be a `SET [1:?] OF IfcObjectDefinition`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Points, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyline to be a `LIST [2:?] OF IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->MappingSource, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMappedItem to be a `IfcRepresentationMap`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'MappingTarget' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->MappingTarget, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMappedItem to be a `IfcCartesianTransformationOperator`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Dimensions, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'UnitType' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcNamedUnit,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->UnitType, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcNamedUnit to be a `IfcUnitEnum`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcContextDependentUnit>(const DB& db, const LIST& params, IfcContextDependentUnit* in)
|
||||
|
|
@ -2721,14 +2721,18 @@ template <> size_t GenericFill<IfcSpatialStructureElement>(const DB& db, const L
|
|||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->LongName, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSpatialStructureElement to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'CompositionType' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSpatialStructureElement,2>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET *>(&*arg)) {
|
||||
// Consider assigning the default value as in->CompositionType = "ELEMENT".
|
||||
break;
|
||||
}
|
||||
try { GenericConvert( in->CompositionType, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcBuilding>(const DB& db, const LIST& params, IfcBuilding* in)
|
||||
|
|
@ -2739,20 +2743,20 @@ template <> size_t GenericFill<IfcBuilding>(const DB& db, const LIST& params, If
|
|||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->ElevationOfRefHeight, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcBuilding to be a `IfcLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ElevationOfTerrain' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->ElevationOfTerrain, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcBuilding to be a `IfcLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'BuildingAddress' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->BuildingAddress, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcBuilding to be a `IfcPostalAddress`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcConnectedFaceSet>(const DB& db, const LIST& params, IfcConnectedFaceSet* in)
|
||||
|
|
@ -2763,8 +2767,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; }
|
||||
try { GenericConvert( in->CfsFaces, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConnectedFaceSet to be a `SET [1:?] OF IfcFace`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcOpenShell>(const DB& db, const LIST& params, IfcOpenShell* in)
|
||||
|
|
@ -2789,8 +2793,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; }
|
||||
try { GenericConvert( in->Position, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConic to be a `IfcAxis2Placement`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcCoveringType>(const DB& db, const LIST& params, IfcCoveringType* in)
|
||||
|
|
@ -2836,33 +2840,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; }
|
||||
try { GenericConvert( in->OverallWidth, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'OverallDepth' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->OverallDepth, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'WebThickness' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[2]=true; break; }
|
||||
try { GenericConvert( in->WebThickness, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'FlangeThickness' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[3]=true; break; }
|
||||
try { GenericConvert( in->FlangeThickness, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'FilletRadius' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcIShapeProfileDef,5>::aux_is_derived[4]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->FilletRadius, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcAsymmetricIShapeProfileDef>(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in)
|
||||
|
|
@ -2935,14 +2939,14 @@ template <> size_t GenericFill<IfcPropertyListValue>(const DB& db, const LIST& p
|
|||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->ListValues, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertyListValue to be a `LIST [1:?] OF IfcValue`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Unit' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Unit, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertyListValue to be a `IfcUnit`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcFurnitureStandard>(const DB& db, const LIST& params, IfcFurnitureStandard* in)
|
||||
|
|
@ -2967,14 +2971,14 @@ template <> size_t GenericFill<IfcDoor>(const DB& db, const LIST& params, IfcDoo
|
|||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->OverallHeight, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcDoor to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'OverallWidth' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->OverallWidth, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcDoor to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcStyledItem>(const DB& db, const LIST& params, IfcStyledItem* in)
|
||||
|
|
@ -2986,21 +2990,21 @@ template <> size_t GenericFill<IfcStyledItem>(const DB& db, const LIST& params,
|
|||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Item, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcStyledItem to be a `IfcRepresentationItem`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Styles' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcStyledItem,3>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->Styles, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcStyledItem to be a `SET [1:?] OF IfcPresentationStyleAssignment`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Name' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcStyledItem,3>::aux_is_derived[2]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcStyledItem to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcAnnotationOccurrence>(const DB& db, const LIST& params, IfcAnnotationOccurrence* in)
|
||||
|
|
@ -3025,8 +3029,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; }
|
||||
try { GenericConvert( in->OuterCurve, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryClosedProfileDef to be a `IfcCurve`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcArbitraryProfileDefWithVoids>(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in)
|
||||
|
|
@ -3043,13 +3047,13 @@ template <> size_t GenericFill<IfcLine>(const DB& db, const LIST& params, IfcLin
|
|||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Pnt, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLine to be a `IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Dir' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Dir, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLine to be a `IfcVector`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcFlowSegmentType>(const DB& db, const LIST& params, IfcFlowSegmentType* in)
|
||||
|
|
@ -3074,14 +3078,14 @@ template <> size_t GenericFill<IfcPropertySingleValue>(const DB& db, const LIST&
|
|||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->NominalValue, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertySingleValue to be a `IfcValue`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Unit' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Unit, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertySingleValue to be a `IfcUnit`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcAlarmType>(const DB& db, const LIST& params, IfcAlarmType* in)
|
||||
|
|
@ -3113,8 +3117,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; }
|
||||
try { GenericConvert( in->SurfaceColour, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleShading to be a `IfcColourRgb`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcPumpType>(const DB& db, const LIST& params, IfcPumpType* in)
|
||||
|
|
|
|||
|
|
@ -61,13 +61,13 @@ template <> size_t GenericFill<IfcSurfaceStyle>(const DB& db, const LIST& params
|
|||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Side, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyle to be a `IfcSurfaceSide`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Styles' argument
|
||||
std::shared_ptr<const DataType> arg = params[ base++ ];
|
||||
try { GenericConvert( in->Styles, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyle to be a `SET [1:5] OF IfcSurfaceStyleElementSelect`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Bounds, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFace to be a `SET [1:?] OF IfcFaceBound`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcColourSpecification to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Orientation, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcVector to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Magnitude' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Magnitude, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcVector to be a `IfcLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Red, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Green' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Green, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Blue' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Blue, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->RefLatitude, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RefLongitude' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->RefLongitude, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RefElevation' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->RefElevation, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcSite to be a `IfcLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'LandTitleNumber' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->LandTitleNumber, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcSite to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SiteAddress' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->SiteAddress, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to IfcSite to be a `IfcPostalAddress`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Degree, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBSplineCurve to be a `INTEGER`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ControlPointsList' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->ControlPointsList, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBSplineCurve to be a `LIST [2:?] OF IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'CurveForm' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[2]=true; break; }
|
||||
try { GenericConvert( in->CurveForm, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBSplineCurve to be a `IfcBSplineCurveForm`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ClosedCurve' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[3]=true; break; }
|
||||
try { GenericConvert( in->ClosedCurve, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBSplineCurve to be a `LOGICAL`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SelfIntersect' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcBSplineCurve,5>::aux_is_derived[4]=true; break; }
|
||||
try { GenericConvert( in->SelfIntersect, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcBSplineCurve to be a `LOGICAL`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->SbsmBoundary, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcShellBasedSurfaceModel to be a `SET [1:?] OF IfcShell`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->ExtrudedDirection, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcExtrudedAreaSolid to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Depth' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Depth, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcExtrudedAreaSolid to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelVoidsElement to be a `IfcElement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'RelatedOpeningElement' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelVoidsElement to be a `IfcFeatureElementSubtraction`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Scale2, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Scale3' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Scale3, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->RefDirection, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement2D to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Coordinates, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianPoint to be a `LIST [1:3] OF IfcLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Polygon, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyLoop to be a `LIST [3:?] OF IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->ContextIdentifier, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationContext to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ContextType' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcRepresentationContext,2>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->ContextType, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationContext to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->CoordinateSpaceDimension, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcGeometricRepresentationContext to be a `IfcDimensionCount`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Precision' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[1]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->Precision, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcGeometricRepresentationContext to be a `REAL`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'WorldCoordinateSystem' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[2]=true; break; }
|
||||
try { GenericConvert( in->WorldCoordinateSystem, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcGeometricRepresentationContext to be a `IfcAxis2Placement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'TrueNorth' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcGeometricRepresentationContext,4>::aux_is_derived[3]=true; break; }
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->TrueNorth, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcGeometricRepresentationContext to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Prefix, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSIUnit to be a `IfcSIPrefix`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Name' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSIUnit to be a `IfcSIUnitName`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Axis, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis1Placement to be a `IfcDirection`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->MappingOrigin, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationMap to be a `IfcAxis2Placement`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'MappedRepresentation' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->MappedRepresentation, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationMap to be a `IfcRepresentation`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->ValueComponent, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMeasureWithUnit to be a `IfcValue`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'UnitComponent' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->UnitComponent, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMeasureWithUnit to be a `IfcUnit`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->FbsmFaces, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBasedSurfaceModel to be a `SET [1:?] OF IfcConnectedFaceSet`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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; }
|
||||
try { GenericConvert( in->Bound, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBound to be a `IfcLoop`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Orientation' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcFaceBound,2>::aux_is_derived[1]=true; break; }
|
||||
try { GenericConvert( in->Orientation, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcFaceBound to be a `BOOLEAN`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->UsageName, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcComplexProperty to be a `IfcIdentifier`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'HasProperties' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->HasProperties, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcComplexProperty to be a `SET [1:?] OF IfcProperty`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Units, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcUnitAssignment to be a `SET [1:?] OF IfcUnit`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->MethodOfMeasurement, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcElementQuantity to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'Quantities' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->Quantities, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcElementQuantity to be a `SET [1:?] OF IfcPhysicalQuantity`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Styles, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyleAssignment to be a `SET [1:?] OF IfcPresentationStyleSelect`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->InteriorOrExteriorSpace, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSpace to be a `IfcInternalOrExternalEnum`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ElevationWithFlooring' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->ElevationWithFlooring, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSpace to be a `IfcLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Textures, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleWithTextures to be a `LIST [1:?] OF IfcSurfaceTexture`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Corner, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBoundingBox to be a `IfcCartesianPoint`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'XDim' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->XDim, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'YDim' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->YDim, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ZDim' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->ZDim, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Radius, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCircle to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->Name, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcConversionBasedUnit to be a `IfcLabel`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ConversionFactor' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->ConversionFactor, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcConversionBasedUnit to be a `IfcMeasureWithUnit`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->SemiAxis1, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SemiAxis2' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->SemiAxis2, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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++];
|
||||
try { GenericConvert( in->HasProperties, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcPropertySet to be a `SET [1:?] OF IfcProperty`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
try { GenericConvert( in->Transparency, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyleRendering to be a `IfcNormalisedRatioMeasure`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'DiffuseColour' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->DiffuseColour, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'TransmissionColour' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->TransmissionColour, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'DiffuseTransmissionColour' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ReflectionColour' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->ReflectionColour, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SpecularColour' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->SpecularColour, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'SpecularHighlight' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
if (dynamic_cast<const UNSET*>(&*arg)) break;
|
||||
try { GenericConvert( in->SpecularHighlight, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSurfaceStyleRendering to be a `IfcSpecularHighlightSelect`")); }
|
||||
} while(0);
|
||||
} while (false);
|
||||
do { // convert the 'ReflectanceMethod' argument
|
||||
std::shared_ptr<const DataType> arg = params[base++];
|
||||
try { GenericConvert( in->ReflectanceMethod, arg, db ); break; }
|
||||
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSurfaceStyleRendering to be a `IfcReflectanceMethodEnum`")); }
|
||||
} while(0);
|
||||
return base;
|
||||
} while (false);
|
||||
return base;
|
||||
}
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
template <> size_t GenericFill<IfcDistributionPort>(const DB& db, const LIST& params, IfcDistributionPort* in)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -40,14 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IFCUtil.cpp
|
||||
* @brief Implementation of conversion routines for some common Ifc helper entities.
|
||||
*/
|
||||
/// @file IFCUtil.cpp
|
||||
/// @brief Implementation of conversion routines for some common Ifc helper entities.
|
||||
|
||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
||||
#include "AssetLib/IFC/IFCUtil.h"
|
||||
#include "Common/PolyTools.h"
|
||||
#include "Geometry/GeometryUtils.h"
|
||||
#include "PostProcessing/ProcessHelper.h"
|
||||
|
||||
namespace Assimp {
|
||||
|
|
@ -65,8 +64,7 @@ void TempOpening::Transform(const IfcMatrix4& mat) {
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
aiMesh* TempMesh::ToMesh()
|
||||
{
|
||||
aiMesh* TempMesh::ToMesh() {
|
||||
ai_assert(mVerts.size() == std::accumulate(mVertcnt.begin(),mVertcnt.end(),size_t(0)));
|
||||
|
||||
if (mVerts.empty()) {
|
||||
|
|
@ -104,36 +102,31 @@ aiMesh* TempMesh::ToMesh()
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::Clear()
|
||||
{
|
||||
void TempMesh::Clear() {
|
||||
mVerts.clear();
|
||||
mVertcnt.clear();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::Transform(const IfcMatrix4& mat)
|
||||
{
|
||||
void TempMesh::Transform(const IfcMatrix4& mat) {
|
||||
for(IfcVector3& v : mVerts) {
|
||||
v *= mat;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
IfcVector3 TempMesh::Center() const
|
||||
{
|
||||
return (mVerts.size() == 0) ? IfcVector3(0.0f, 0.0f, 0.0f) : (std::accumulate(mVerts.begin(),mVerts.end(),IfcVector3()) / static_cast<IfcFloat>(mVerts.size()));
|
||||
IfcVector3 TempMesh::Center() const {
|
||||
return mVerts.empty() ? IfcVector3(0.0f, 0.0f, 0.0f) : (std::accumulate(mVerts.begin(),mVerts.end(),IfcVector3()) / static_cast<IfcFloat>(mVerts.size()));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::Append(const TempMesh& other)
|
||||
{
|
||||
void TempMesh::Append(const TempMesh& other) {
|
||||
mVerts.insert(mVerts.end(),other.mVerts.begin(),other.mVerts.end());
|
||||
mVertcnt.insert(mVertcnt.end(),other.mVertcnt.begin(),other.mVertcnt.end());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::RemoveDegenerates()
|
||||
{
|
||||
void TempMesh::RemoveDegenerates() {
|
||||
// The strategy is simple: walk the mesh and compute normals using
|
||||
// Newell's algorithm. The length of the normals gives the area
|
||||
// of the polygons, which is close to zero for lines.
|
||||
|
|
@ -166,11 +159,9 @@ void TempMesh::RemoveDegenerates()
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
IfcVector3 TempMesh::ComputePolygonNormal(const IfcVector3* vtcs, size_t cnt, bool normalize)
|
||||
{
|
||||
IfcVector3 TempMesh::ComputePolygonNormal(const IfcVector3* vtcs, size_t cnt, bool normalize) {
|
||||
std::vector<IfcFloat> temp((cnt+2)*3);
|
||||
for( size_t vofs = 0, i = 0; vofs < cnt; ++vofs )
|
||||
{
|
||||
for( size_t vofs = 0, i = 0; vofs < cnt; ++vofs ) {
|
||||
const IfcVector3& v = vtcs[vofs];
|
||||
temp[i++] = v.x;
|
||||
temp[i++] = v.y;
|
||||
|
|
@ -184,9 +175,8 @@ IfcVector3 TempMesh::ComputePolygonNormal(const IfcVector3* vtcs, size_t cnt, bo
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::ComputePolygonNormals(std::vector<IfcVector3>& normals,
|
||||
bool normalize,
|
||||
size_t ofs) const
|
||||
{
|
||||
bool normalize,
|
||||
size_t ofs) const {
|
||||
size_t max_vcount = 0;
|
||||
std::vector<unsigned int>::const_iterator begin = mVertcnt.begin()+ofs, end = mVertcnt.end(), iit;
|
||||
for(iit = begin; iit != end; ++iit) {
|
||||
|
|
@ -235,7 +225,7 @@ IfcVector3 TempMesh::ComputeLastPolygonNormal(bool normalize) const {
|
|||
struct CompareVector {
|
||||
bool operator () (const IfcVector3& a, const IfcVector3& b) const {
|
||||
IfcVector3 d = a - b;
|
||||
IfcFloat eps = ai_epsilon;
|
||||
constexpr IfcFloat eps = ai_epsilon;
|
||||
return d.x < -eps || (std::abs(d.x) < eps && d.y < -eps) || (std::abs(d.x) < eps && std::abs(d.y) < eps && d.z < -eps);
|
||||
}
|
||||
};
|
||||
|
|
@ -249,29 +239,27 @@ struct FindVector {
|
|||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::FixupFaceOrientation()
|
||||
{
|
||||
void TempMesh::FixupFaceOrientation() {
|
||||
const IfcVector3 vavg = Center();
|
||||
|
||||
// create a list of start indices for all faces to allow random access to faces
|
||||
std::vector<size_t> faceStartIndices(mVertcnt.size());
|
||||
for( size_t i = 0, a = 0; a < mVertcnt.size(); i += mVertcnt[a], ++a )
|
||||
for( size_t i = 0, a = 0; a < mVertcnt.size(); i += mVertcnt[a], ++a ) {
|
||||
faceStartIndices[a] = i;
|
||||
}
|
||||
|
||||
// list all faces on a vertex
|
||||
std::map<IfcVector3, std::vector<size_t>, CompareVector> facesByVertex;
|
||||
for( size_t a = 0; a < mVertcnt.size(); ++a )
|
||||
{
|
||||
for( size_t b = 0; b < mVertcnt[a]; ++b )
|
||||
for( size_t a = 0; a < mVertcnt.size(); ++a ) {
|
||||
for( size_t b = 0; b < mVertcnt[a]; ++b ) {
|
||||
facesByVertex[mVerts[faceStartIndices[a] + b]].push_back(a);
|
||||
}
|
||||
}
|
||||
// determine neighbourhood for all polys
|
||||
std::vector<size_t> neighbour(mVerts.size(), SIZE_MAX);
|
||||
std::vector<size_t> tempIntersect(10);
|
||||
for( size_t a = 0; a < mVertcnt.size(); ++a )
|
||||
{
|
||||
for( size_t b = 0; b < mVertcnt[a]; ++b )
|
||||
{
|
||||
for( size_t a = 0; a < mVertcnt.size(); ++a ) {
|
||||
for( size_t b = 0; b < mVertcnt[a]; ++b ) {
|
||||
size_t ib = faceStartIndices[a] + b, nib = faceStartIndices[a] + (b + 1) % mVertcnt[a];
|
||||
const std::vector<size_t>& facesOnB = facesByVertex[mVerts[ib]];
|
||||
const std::vector<size_t>& facesOnNB = facesByVertex[mVerts[nib]];
|
||||
|
|
@ -280,10 +268,12 @@ void TempMesh::FixupFaceOrientation()
|
|||
std::vector<size_t>::iterator sectend = std::set_intersection(
|
||||
facesOnB.begin(), facesOnB.end(), facesOnNB.begin(), facesOnNB.end(), sectstart);
|
||||
|
||||
if( std::distance(sectstart, sectend) != 2 )
|
||||
if( std::distance(sectstart, sectend) != 2 ) {
|
||||
continue;
|
||||
if( *sectstart == a )
|
||||
}
|
||||
if( *sectstart == a ) {
|
||||
++sectstart;
|
||||
}
|
||||
neighbour[ib] = *sectstart;
|
||||
}
|
||||
}
|
||||
|
|
@ -292,15 +282,14 @@ void TempMesh::FixupFaceOrientation()
|
|||
// facing outwards. So we reverse this face to point outwards in relation to the center. Then we adapt neighbouring
|
||||
// faces to have the same winding until all faces have been tested.
|
||||
std::vector<bool> faceDone(mVertcnt.size(), false);
|
||||
while( std::count(faceDone.begin(), faceDone.end(), false) != 0 )
|
||||
{
|
||||
while( std::count(faceDone.begin(), faceDone.end(), false) != 0 ) {
|
||||
// find the farthest of the remaining faces
|
||||
size_t farthestIndex = SIZE_MAX;
|
||||
IfcFloat farthestDistance = -1.0;
|
||||
for( size_t a = 0; a < mVertcnt.size(); ++a )
|
||||
{
|
||||
if( faceDone[a] )
|
||||
for( size_t a = 0; a < mVertcnt.size(); ++a ) {
|
||||
if( faceDone[a] ) {
|
||||
continue;
|
||||
}
|
||||
IfcVector3 faceCenter = std::accumulate(mVerts.begin() + faceStartIndices[a],
|
||||
mVerts.begin() + faceStartIndices[a] + mVertcnt[a], IfcVector3(0.0)) / IfcFloat(mVertcnt[a]);
|
||||
IfcFloat dst = (faceCenter - vavg).SquareLength();
|
||||
|
|
@ -314,8 +303,7 @@ void TempMesh::FixupFaceOrientation()
|
|||
/ IfcFloat(mVertcnt[farthestIndex]);
|
||||
// We accept a bit of negative orientation without reversing. In case of doubt, prefer the orientation given in
|
||||
// the file.
|
||||
if( (farthestNormal * (farthestCenter - vavg).Normalize()) < -0.4 )
|
||||
{
|
||||
if( (farthestNormal * (farthestCenter - vavg).Normalize()) < -0.4 ) {
|
||||
size_t fsi = faceStartIndices[farthestIndex], fvc = mVertcnt[farthestIndex];
|
||||
std::reverse(mVerts.begin() + fsi, mVerts.begin() + fsi + fvc);
|
||||
std::reverse(neighbour.begin() + fsi, neighbour.begin() + fsi + fvc);
|
||||
|
|
@ -332,19 +320,18 @@ void TempMesh::FixupFaceOrientation()
|
|||
todo.push_back(farthestIndex);
|
||||
|
||||
// go over its neighbour faces recursively and adapt their winding order to match the farthest face
|
||||
while( !todo.empty() )
|
||||
{
|
||||
while( !todo.empty() ) {
|
||||
size_t tdf = todo.back();
|
||||
size_t vsi = faceStartIndices[tdf], vc = mVertcnt[tdf];
|
||||
todo.pop_back();
|
||||
|
||||
// check its neighbours
|
||||
for( size_t a = 0; a < vc; ++a )
|
||||
{
|
||||
for( size_t a = 0; a < vc; ++a ) {
|
||||
// ignore neighbours if we already checked them
|
||||
size_t nbi = neighbour[vsi + a];
|
||||
if( nbi == SIZE_MAX || faceDone[nbi] )
|
||||
if( nbi == SIZE_MAX || faceDone[nbi] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const IfcVector3& vp = mVerts[vsi + a];
|
||||
size_t nbvsi = faceStartIndices[nbi], nbvc = mVertcnt[nbi];
|
||||
|
|
@ -387,32 +374,8 @@ void TempMesh::RemoveAdjacentDuplicates() {
|
|||
IfcVector3 vmin,vmax;
|
||||
ArrayBounds(&*base, cnt ,vmin,vmax);
|
||||
|
||||
|
||||
const IfcFloat epsilon = (vmax-vmin).SquareLength() / static_cast<IfcFloat>(1e9);
|
||||
//const IfcFloat dotepsilon = 1e-9;
|
||||
|
||||
//// look for vertices that lie directly on the line between their predecessor and their
|
||||
//// successor and replace them with either of them.
|
||||
|
||||
//for(size_t i = 0; i < cnt; ++i) {
|
||||
// IfcVector3& v1 = *(base+i), &v0 = *(base+(i?i-1:cnt-1)), &v2 = *(base+(i+1)%cnt);
|
||||
// const IfcVector3& d0 = (v1-v0), &d1 = (v2-v1);
|
||||
// const IfcFloat l0 = d0.SquareLength(), l1 = d1.SquareLength();
|
||||
// if (!l0 || !l1) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// const IfcFloat d = (d0/std::sqrt(l0))*(d1/std::sqrt(l1));
|
||||
|
||||
// if ( d >= 1.f-dotepsilon ) {
|
||||
// v1 = v0;
|
||||
// }
|
||||
// else if ( d < -1.f+dotepsilon ) {
|
||||
// v2 = v1;
|
||||
// continue;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// drop any identical, adjacent vertices. this pass will collect the dropouts
|
||||
// of the previous pass as a side-effect.
|
||||
FuzzyVectorCompare fz(epsilon);
|
||||
|
|
@ -439,78 +402,58 @@ void TempMesh::RemoveAdjacentDuplicates() {
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TempMesh::Swap(TempMesh& other)
|
||||
{
|
||||
void TempMesh::Swap(TempMesh& other) {
|
||||
mVertcnt.swap(other.mVertcnt);
|
||||
mVerts.swap(other.mVerts);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsTrue(const ::Assimp::STEP::EXPRESS::BOOLEAN& in)
|
||||
{
|
||||
bool IsTrue(const ::Assimp::STEP::EXPRESS::BOOLEAN& in) {
|
||||
return (std::string)in == "TRUE" || (std::string)in == "T";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
IfcFloat ConvertSIPrefix(const std::string& prefix)
|
||||
{
|
||||
IfcFloat ConvertSIPrefix(const std::string& prefix) {
|
||||
if (prefix == "EXA") {
|
||||
return 1e18f;
|
||||
}
|
||||
else if (prefix == "PETA") {
|
||||
} else if (prefix == "PETA") {
|
||||
return 1e15f;
|
||||
}
|
||||
else if (prefix == "TERA") {
|
||||
} else if (prefix == "TERA") {
|
||||
return 1e12f;
|
||||
}
|
||||
else if (prefix == "GIGA") {
|
||||
} else if (prefix == "GIGA") {
|
||||
return 1e9f;
|
||||
}
|
||||
else if (prefix == "MEGA") {
|
||||
} else if (prefix == "MEGA") {
|
||||
return 1e6f;
|
||||
}
|
||||
else if (prefix == "KILO") {
|
||||
} else if (prefix == "KILO") {
|
||||
return 1e3f;
|
||||
}
|
||||
else if (prefix == "HECTO") {
|
||||
} else if (prefix == "HECTO") {
|
||||
return 1e2f;
|
||||
}
|
||||
else if (prefix == "DECA") {
|
||||
} else if (prefix == "DECA") {
|
||||
return 1e-0f;
|
||||
}
|
||||
else if (prefix == "DECI") {
|
||||
} else if (prefix == "DECI") {
|
||||
return 1e-1f;
|
||||
}
|
||||
else if (prefix == "CENTI") {
|
||||
} else if (prefix == "CENTI") {
|
||||
return 1e-2f;
|
||||
}
|
||||
else if (prefix == "MILLI") {
|
||||
} else if (prefix == "MILLI") {
|
||||
return 1e-3f;
|
||||
}
|
||||
else if (prefix == "MICRO") {
|
||||
} else if (prefix == "MICRO") {
|
||||
return 1e-6f;
|
||||
}
|
||||
else if (prefix == "NANO") {
|
||||
} else if (prefix == "NANO") {
|
||||
return 1e-9f;
|
||||
}
|
||||
else if (prefix == "PICO") {
|
||||
} else if (prefix == "PICO") {
|
||||
return 1e-12f;
|
||||
}
|
||||
else if (prefix == "FEMTO") {
|
||||
} else if (prefix == "FEMTO") {
|
||||
return 1e-15f;
|
||||
}
|
||||
else if (prefix == "ATTO") {
|
||||
} else if (prefix == "ATTO") {
|
||||
return 1e-18f;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogError("Unrecognized SI prefix: ", prefix);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourRgb& in)
|
||||
{
|
||||
void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourRgb& in) {
|
||||
out.r = static_cast<float>( in.Red );
|
||||
out.g = static_cast<float>( in.Green );
|
||||
out.b = static_cast<float>( in.Blue );
|
||||
|
|
@ -518,8 +461,10 @@ void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourRgb& in)
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourOrFactor& in,ConversionData& conv,const aiColor4D* base)
|
||||
{
|
||||
void ConvertColor(aiColor4D& out,
|
||||
const Schema_2x3::IfcColourOrFactor& in,
|
||||
ConversionData& conv,
|
||||
const aiColor4D* base) {
|
||||
if (const ::Assimp::STEP::EXPRESS::REAL* const r = in.ToPtr<::Assimp::STEP::EXPRESS::REAL>()) {
|
||||
out.r = out.g = out.b = static_cast<float>(*r);
|
||||
if(base) {
|
||||
|
|
@ -527,20 +472,18 @@ void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourOrFactor& in,Conver
|
|||
out.g *= static_cast<float>( base->g );
|
||||
out.b *= static_cast<float>( base->b );
|
||||
out.a = static_cast<float>( base->a );
|
||||
} else {
|
||||
out.a = 1.0;
|
||||
}
|
||||
else out.a = 1.0;
|
||||
}
|
||||
else if (const Schema_2x3::IfcColourRgb* const rgb = in.ResolveSelectPtr<Schema_2x3::IfcColourRgb>(conv.db)) {
|
||||
} else if (const Schema_2x3::IfcColourRgb* const rgb = in.ResolveSelectPtr<Schema_2x3::IfcColourRgb>(conv.db)) {
|
||||
ConvertColor(out,*rgb);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogWarn("skipping unknown IfcColourOrFactor entity");
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertCartesianPoint(IfcVector3& out, const Schema_2x3::IfcCartesianPoint& in)
|
||||
{
|
||||
void ConvertCartesianPoint(IfcVector3& out, const Schema_2x3::IfcCartesianPoint& in) {
|
||||
out = IfcVector3();
|
||||
for(size_t i = 0; i < in.Coordinates.size(); ++i) {
|
||||
out[static_cast<unsigned int>(i)] = in.Coordinates[i];
|
||||
|
|
@ -548,15 +491,13 @@ void ConvertCartesianPoint(IfcVector3& out, const Schema_2x3::IfcCartesianPoint&
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertVector(IfcVector3& out, const Schema_2x3::IfcVector& in)
|
||||
{
|
||||
void ConvertVector(IfcVector3& out, const Schema_2x3::IfcVector& in) {
|
||||
ConvertDirection(out,in.Orientation);
|
||||
out *= in.Magnitude;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertDirection(IfcVector3& out, const Schema_2x3::IfcDirection& in)
|
||||
{
|
||||
void ConvertDirection(IfcVector3& out, const Schema_2x3::IfcDirection& in) {
|
||||
out = IfcVector3();
|
||||
for(size_t i = 0; i < in.DirectionRatios.size(); ++i) {
|
||||
out[static_cast<unsigned int>(i)] = in.DirectionRatios[i];
|
||||
|
|
@ -570,8 +511,7 @@ void ConvertDirection(IfcVector3& out, const Schema_2x3::IfcDirection& in)
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y, const IfcVector3& z)
|
||||
{
|
||||
void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y, const IfcVector3& z) {
|
||||
out.a1 = x.x;
|
||||
out.b1 = x.y;
|
||||
out.c1 = x.z;
|
||||
|
|
@ -586,8 +526,7 @@ void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y,
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement3D& in)
|
||||
{
|
||||
void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement3D& in) {
|
||||
IfcVector3 loc;
|
||||
ConvertCartesianPoint(loc,in.Location);
|
||||
|
||||
|
|
@ -611,8 +550,7 @@ void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement3D
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement2D& in)
|
||||
{
|
||||
void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement2D& in) {
|
||||
IfcVector3 loc;
|
||||
ConvertCartesianPoint(loc,in.Location);
|
||||
|
||||
|
|
@ -628,34 +566,28 @@ void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement2D
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertAxisPlacement(IfcVector3& axis, IfcVector3& pos, const Schema_2x3::IfcAxis1Placement& in)
|
||||
{
|
||||
void ConvertAxisPlacement(IfcVector3& axis, IfcVector3& pos, const Schema_2x3::IfcAxis1Placement& in) {
|
||||
ConvertCartesianPoint(pos,in.Location);
|
||||
if (in.Axis) {
|
||||
ConvertDirection(axis,in.Axis.Get());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
axis = IfcVector3(0.f,0.f,1.f);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement& in, ConversionData& conv)
|
||||
{
|
||||
void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement& in, ConversionData& conv) {
|
||||
if(const Schema_2x3::IfcAxis2Placement3D* pl3 = in.ResolveSelectPtr<Schema_2x3::IfcAxis2Placement3D>(conv.db)) {
|
||||
ConvertAxisPlacement(out,*pl3);
|
||||
}
|
||||
else if(const Schema_2x3::IfcAxis2Placement2D* pl2 = in.ResolveSelectPtr<Schema_2x3::IfcAxis2Placement2D>(conv.db)) {
|
||||
} else if(const Schema_2x3::IfcAxis2Placement2D* pl2 = in.ResolveSelectPtr<Schema_2x3::IfcAxis2Placement2D>(conv.db)) {
|
||||
ConvertAxisPlacement(out,*pl2);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
IFCImporter::LogWarn("skipping unknown IfcAxis2Placement entity");
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ConvertTransformOperator(IfcMatrix4& out, const Schema_2x3::IfcCartesianTransformationOperator& op)
|
||||
{
|
||||
void ConvertTransformOperator(IfcMatrix4& out, const Schema_2x3::IfcCartesianTransformationOperator& op) {
|
||||
IfcVector3 loc;
|
||||
ConvertCartesianPoint(loc,op.LocalOrigin);
|
||||
|
||||
|
|
@ -676,14 +608,12 @@ void ConvertTransformOperator(IfcMatrix4& out, const Schema_2x3::IfcCartesianTra
|
|||
IfcMatrix4::Translation(loc,locm);
|
||||
AssignMatrixAxes(out,x,y,z);
|
||||
|
||||
|
||||
IfcVector3 vscale;
|
||||
if (const Schema_2x3::IfcCartesianTransformationOperator3DnonUniform* nuni = op.ToPtr<Schema_2x3::IfcCartesianTransformationOperator3DnonUniform>()) {
|
||||
vscale.x = nuni->Scale?op.Scale.Get():1.f;
|
||||
vscale.y = nuni->Scale2?nuni->Scale2.Get():1.f;
|
||||
vscale.z = nuni->Scale3?nuni->Scale3.Get():1.f;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const IfcFloat sc = op.Scale?op.Scale.Get():1.f;
|
||||
vscale = IfcVector3(sc,sc,sc);
|
||||
}
|
||||
|
|
@ -694,8 +624,7 @@ void ConvertTransformOperator(IfcMatrix4& out, const Schema_2x3::IfcCartesianTra
|
|||
out = locm * out * s;
|
||||
}
|
||||
|
||||
|
||||
} // ! IFC
|
||||
} // ! Assimp
|
||||
|
||||
#endif
|
||||
#endif // ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue