Skip to content

Commit ca66aac

Browse files
author
aothms
committed
Increased verbosity in unsupported entity instances
1 parent 9262ea1 commit ca66aac

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/ifcgeom/IfcGeomCurves.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@
8181

8282
bool IfcGeom::convert(const IfcSchema::IfcCircle::ptr l, Handle(Geom_Curve)& curve) {
8383
const double r = l->Radius() * IfcGeom::GetValue(GV_LENGTH_UNIT);
84-
if ( r <= 0.0f ) { return false; }
84+
if ( r < ALMOST_ZERO ) {
85+
Logger::Message(Logger::LOG_ERROR, "Radius not greater than zero for:", l->entity);
86+
return false;
87+
}
8588
gp_Trsf trsf;
8689
IfcSchema::IfcAxis2Placement placement = l->Position();
8790
if (placement->is(IfcSchema::Type::IfcAxis2Placement3D)) {
@@ -98,7 +101,10 @@ bool IfcGeom::convert(const IfcSchema::IfcCircle::ptr l, Handle(Geom_Curve)& cur
98101
bool IfcGeom::convert(const IfcSchema::IfcEllipse::ptr l, Handle(Geom_Curve)& curve) {
99102
double x = l->SemiAxis1() * IfcGeom::GetValue(GV_LENGTH_UNIT);
100103
double y = l->SemiAxis2() * IfcGeom::GetValue(GV_LENGTH_UNIT);
101-
if (x < ALMOST_ZERO || y < ALMOST_ZERO) { return false; }
104+
if (x < ALMOST_ZERO || y < ALMOST_ZERO) {
105+
Logger::Message(Logger::LOG_ERROR, "Radius not greater than zero for:", l->entity);
106+
return false;
107+
}
102108
// Open Cascade does not allow ellipses of which the minor radius
103109
// is greater than the major radius. Hence, in this case, the
104110
// ellipse is rotated. Note that special care needs to be taken

src/ifcgeom/IfcGeomHelpers.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ bool IfcGeom::convert(const IfcSchema::IfcAxis2Placement2D::ptr l, gp_Trsf2d& tr
294294

295295
bool IfcGeom::convert(const IfcSchema::IfcObjectPlacement::ptr l, gp_Trsf& trsf) {
296296
IN_CACHE(IfcObjectPlacement,l,gp_Trsf,trsf)
297-
if ( ! l->is(IfcSchema::Type::IfcLocalPlacement) ) return false;
297+
if ( ! l->is(IfcSchema::Type::IfcLocalPlacement) ) {
298+
Logger::Message(Logger::LOG_ERROR, "Unsupported IfcObjectPlacement:", l->entity);
299+
return false;
300+
}
298301
IfcSchema::IfcLocalPlacement::ptr current = reinterpret_pointer_cast<IfcSchema::IfcObjectPlacement,IfcSchema::IfcLocalPlacement>(l);
299302
while (1) {
300303
gp_Trsf trsf2;

src/ifcgeom/IfcGeomShapes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ bool IfcGeom::convert(const IfcSchema::IfcFaceBasedSurfaceModel::ptr l, IfcRepre
197197
bool IfcGeom::convert(const IfcSchema::IfcHalfSpaceSolid::ptr l, TopoDS_Shape& shape) {
198198
IfcSchema::IfcSurface::ptr surface = l->BaseSurface();
199199
if ( ! surface->is(IfcSchema::Type::IfcPlane) ) {
200-
// Not implemented
200+
Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface->entity);
201201
return false;
202202
}
203203
gp_Pln pln;
@@ -387,6 +387,7 @@ bool IfcGeom::convert(const IfcSchema::IfcMappedItem::ptr l, IfcRepresentationSh
387387
IfcGeom::convert(reinterpret_pointer_cast<IfcSchema::IfcCartesianTransformationOperator,
388388
IfcSchema::IfcCartesianTransformationOperator3DnonUniform>(transform),gtrsf);
389389
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator2DnonUniform) ) {
390+
Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity);
390391
return false;
391392
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator3D) ) {
392393
gp_Trsf trsf;
@@ -548,7 +549,7 @@ bool IfcGeom::convert(const IfcSchema::IfcCurveBoundedPlane::ptr l, TopoDS_Shape
548549

549550
bool IfcGeom::convert(const IfcSchema::IfcRectangularTrimmedSurface::ptr l, TopoDS_Shape& face) {
550551
if (!l->BasisSurface()->is(IfcSchema::Type::IfcPlane)) {
551-
// Not implemented
552+
Logger::Message(Logger::LOG_ERROR, "Unsupported BasisSurface:", l->BasisSurface()->entity);
552553
return false;
553554
}
554555
gp_Pln pln;

0 commit comments

Comments
 (0)