From 1bbd08f1a4a554399ad044c5d490ebcde4383227 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 2 Apr 2014 15:28:04 +0000 Subject: [PATCH] Increased verbosity in unsupported entity instances --- src/ifcgeom/IfcGeomCurves.cpp | 14 ++++++++++++-- src/ifcgeom/IfcGeomHelpers.cpp | 5 ++++- src/ifcgeom/IfcGeomShapes.cpp | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ifcgeom/IfcGeomCurves.cpp b/src/ifcgeom/IfcGeomCurves.cpp index e32b4b9438..f08917cf03 100644 --- a/src/ifcgeom/IfcGeomCurves.cpp +++ b/src/ifcgeom/IfcGeomCurves.cpp @@ -79,7 +79,10 @@ bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr l, Handle(Geom_Curve)& curve) { const double r = l->Radius() * IfcGeom::GetValue(GV_LENGTH_UNIT); - if ( r <= 0.0f ) { return false; } + if ( r < ALMOST_ZERO ) { + Logger::Message(Logger::LOG_ERROR, "Radius not greater than zero for:", l->entity); + return false; + } gp_Trsf trsf; Ifc2x3::IfcAxis2Placement placement = l->Position(); if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) { @@ -96,7 +99,14 @@ bool IfcGeom::convert(const Ifc2x3::IfcCircle::ptr l, Handle(Geom_Curve)& curve) bool IfcGeom::convert(const Ifc2x3::IfcEllipse::ptr l, Handle(Geom_Curve)& curve) { double x = l->SemiAxis1() * IfcGeom::GetValue(GV_LENGTH_UNIT); double y = l->SemiAxis2() * IfcGeom::GetValue(GV_LENGTH_UNIT); - if ( x == 0.0f || y == 0.0f || y > x ) { return false; } + if (x < ALMOST_ZERO || y < ALMOST_ZERO) { + Logger::Message(Logger::LOG_ERROR, "Radius not greater than zero for:", l->entity); + return false; + } + if (y > x) { + Logger::Message(Logger::LOG_ERROR, "Ellipse with SemiAxis2 larger than SemiAxis1 not supported for:", l->entity); + return false; + } gp_Trsf trsf; Ifc2x3::IfcAxis2Placement placement = l->Position(); if (placement->is(Ifc2x3::Type::IfcAxis2Placement3D)) { diff --git a/src/ifcgeom/IfcGeomHelpers.cpp b/src/ifcgeom/IfcGeomHelpers.cpp index a229c78957..dcfdfa7b98 100644 --- a/src/ifcgeom/IfcGeomHelpers.cpp +++ b/src/ifcgeom/IfcGeomHelpers.cpp @@ -238,7 +238,10 @@ bool IfcGeom::convert(const Ifc2x3::IfcAxis2Placement2D::ptr l, gp_Trsf2d& trsf) } bool IfcGeom::convert(const Ifc2x3::IfcObjectPlacement::ptr l, gp_Trsf& trsf) { IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf) - if ( ! l->is(Ifc2x3::Type::IfcLocalPlacement) ) return false; + if ( ! l->is(Ifc2x3::Type::IfcLocalPlacement) ) { + Logger::Message(Logger::LOG_ERROR, "Unsupported IfcObjectPlacement:", l->entity); + return false; + } Ifc2x3::IfcLocalPlacement::ptr current = reinterpret_pointer_cast(l); while (1) { gp_Trsf trsf2; diff --git a/src/ifcgeom/IfcGeomShapes.cpp b/src/ifcgeom/IfcGeomShapes.cpp index 8e71433b70..22a2e4320f 100644 --- a/src/ifcgeom/IfcGeomShapes.cpp +++ b/src/ifcgeom/IfcGeomShapes.cpp @@ -115,7 +115,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcFaceBasedSurfaceModel::ptr l, IfcRepresen bool IfcGeom::convert(const Ifc2x3::IfcHalfSpaceSolid::ptr l, TopoDS_Shape& shape) { Ifc2x3::IfcSurface::ptr surface = l->BaseSurface(); if ( ! surface->is(Ifc2x3::Type::IfcPlane) ) { - // Not implemented + Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface->entity); return false; } gp_Pln pln; @@ -256,6 +256,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr l, IfcRepresentationShape IfcGeom::convert(reinterpret_pointer_cast(transform),gtrsf); } else if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator2DnonUniform) ) { + Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity); return false; } else if ( transform->is(Ifc2x3::Type::IfcCartesianTransformationOperator3D) ) { gp_Trsf trsf;