From ca66aac1c1ffd1567ef312ec36a781b20f091ea0 Mon Sep 17 00:00:00 2001 From: aothms Date: Wed, 2 Apr 2014 15:28:04 +0000 Subject: [PATCH] Increased verbosity in unsupported entity instances --- src/ifcgeom/IfcGeomCurves.cpp | 10 ++++++++-- src/ifcgeom/IfcGeomHelpers.cpp | 5 ++++- src/ifcgeom/IfcGeomShapes.cpp | 5 +++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ifcgeom/IfcGeomCurves.cpp b/src/ifcgeom/IfcGeomCurves.cpp index 0c5580be06..1f1877ab0d 100644 --- a/src/ifcgeom/IfcGeomCurves.cpp +++ b/src/ifcgeom/IfcGeomCurves.cpp @@ -81,7 +81,10 @@ bool IfcGeom::convert(const IfcSchema::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; IfcSchema::IfcAxis2Placement placement = l->Position(); if (placement->is(IfcSchema::Type::IfcAxis2Placement3D)) { @@ -98,7 +101,10 @@ bool IfcGeom::convert(const IfcSchema::IfcCircle::ptr l, Handle(Geom_Curve)& cur bool IfcGeom::convert(const IfcSchema::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 < ALMOST_ZERO || y < ALMOST_ZERO) { return false; } + if (x < ALMOST_ZERO || y < ALMOST_ZERO) { + Logger::Message(Logger::LOG_ERROR, "Radius not greater than zero for:", l->entity); + return false; + } // Open Cascade does not allow ellipses of which the minor radius // is greater than the major radius. Hence, in this case, the // ellipse is rotated. Note that special care needs to be taken diff --git a/src/ifcgeom/IfcGeomHelpers.cpp b/src/ifcgeom/IfcGeomHelpers.cpp index d76ba2600b..ee3508df6f 100644 --- a/src/ifcgeom/IfcGeomHelpers.cpp +++ b/src/ifcgeom/IfcGeomHelpers.cpp @@ -294,7 +294,10 @@ bool IfcGeom::convert(const IfcSchema::IfcAxis2Placement2D::ptr l, gp_Trsf2d& tr bool IfcGeom::convert(const IfcSchema::IfcObjectPlacement::ptr l, gp_Trsf& trsf) { IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf) - if ( ! l->is(IfcSchema::Type::IfcLocalPlacement) ) return false; + if ( ! l->is(IfcSchema::Type::IfcLocalPlacement) ) { + Logger::Message(Logger::LOG_ERROR, "Unsupported IfcObjectPlacement:", l->entity); + return false; + } IfcSchema::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 5552dbd412..86ffb4c6af 100644 --- a/src/ifcgeom/IfcGeomShapes.cpp +++ b/src/ifcgeom/IfcGeomShapes.cpp @@ -197,7 +197,7 @@ bool IfcGeom::convert(const IfcSchema::IfcFaceBasedSurfaceModel::ptr l, IfcRepre bool IfcGeom::convert(const IfcSchema::IfcHalfSpaceSolid::ptr l, TopoDS_Shape& shape) { IfcSchema::IfcSurface::ptr surface = l->BaseSurface(); if ( ! surface->is(IfcSchema::Type::IfcPlane) ) { - // Not implemented + Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface->entity); return false; } gp_Pln pln; @@ -387,6 +387,7 @@ bool IfcGeom::convert(const IfcSchema::IfcMappedItem::ptr l, IfcRepresentationSh IfcGeom::convert(reinterpret_pointer_cast(transform),gtrsf); } else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator2DnonUniform) ) { + Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity); return false; } else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator3D) ) { gp_Trsf trsf; @@ -548,7 +549,7 @@ bool IfcGeom::convert(const IfcSchema::IfcCurveBoundedPlane::ptr l, TopoDS_Shape bool IfcGeom::convert(const IfcSchema::IfcRectangularTrimmedSurface::ptr l, TopoDS_Shape& face) { if (!l->BasisSurface()->is(IfcSchema::Type::IfcPlane)) { - // Not implemented + Logger::Message(Logger::LOG_ERROR, "Unsupported BasisSurface:", l->BasisSurface()->entity); return false; } gp_Pln pln;