mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 10:43:46 +00:00
Increased verbosity in unsupported entity instances
This commit is contained in:
@@ -81,7 +81,10 @@
|
|||||||
|
|
||||||
bool IfcGeom::convert(const IfcSchema::IfcCircle::ptr l, Handle(Geom_Curve)& curve) {
|
bool IfcGeom::convert(const IfcSchema::IfcCircle::ptr l, Handle(Geom_Curve)& curve) {
|
||||||
const double r = l->Radius() * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
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;
|
gp_Trsf trsf;
|
||||||
IfcSchema::IfcAxis2Placement placement = l->Position();
|
IfcSchema::IfcAxis2Placement placement = l->Position();
|
||||||
if (placement->is(IfcSchema::Type::IfcAxis2Placement3D)) {
|
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) {
|
bool IfcGeom::convert(const IfcSchema::IfcEllipse::ptr l, Handle(Geom_Curve)& curve) {
|
||||||
double x = l->SemiAxis1() * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
double x = l->SemiAxis1() * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
||||||
double y = l->SemiAxis2() * 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
|
// Open Cascade does not allow ellipses of which the minor radius
|
||||||
// is greater than the major radius. Hence, in this case, the
|
// is greater than the major radius. Hence, in this case, the
|
||||||
// ellipse is rotated. Note that special care needs to be taken
|
// ellipse is rotated. Note that special care needs to be taken
|
||||||
|
|||||||
@@ -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) {
|
bool IfcGeom::convert(const IfcSchema::IfcObjectPlacement::ptr l, gp_Trsf& trsf) {
|
||||||
IN_CACHE(IfcObjectPlacement,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<IfcSchema::IfcObjectPlacement,IfcSchema::IfcLocalPlacement>(l);
|
IfcSchema::IfcLocalPlacement::ptr current = reinterpret_pointer_cast<IfcSchema::IfcObjectPlacement,IfcSchema::IfcLocalPlacement>(l);
|
||||||
while (1) {
|
while (1) {
|
||||||
gp_Trsf trsf2;
|
gp_Trsf trsf2;
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ bool IfcGeom::convert(const IfcSchema::IfcFaceBasedSurfaceModel::ptr l, IfcRepre
|
|||||||
bool IfcGeom::convert(const IfcSchema::IfcHalfSpaceSolid::ptr l, TopoDS_Shape& shape) {
|
bool IfcGeom::convert(const IfcSchema::IfcHalfSpaceSolid::ptr l, TopoDS_Shape& shape) {
|
||||||
IfcSchema::IfcSurface::ptr surface = l->BaseSurface();
|
IfcSchema::IfcSurface::ptr surface = l->BaseSurface();
|
||||||
if ( ! surface->is(IfcSchema::Type::IfcPlane) ) {
|
if ( ! surface->is(IfcSchema::Type::IfcPlane) ) {
|
||||||
// Not implemented
|
Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface->entity);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
gp_Pln pln;
|
gp_Pln pln;
|
||||||
@@ -387,6 +387,7 @@ bool IfcGeom::convert(const IfcSchema::IfcMappedItem::ptr l, IfcRepresentationSh
|
|||||||
IfcGeom::convert(reinterpret_pointer_cast<IfcSchema::IfcCartesianTransformationOperator,
|
IfcGeom::convert(reinterpret_pointer_cast<IfcSchema::IfcCartesianTransformationOperator,
|
||||||
IfcSchema::IfcCartesianTransformationOperator3DnonUniform>(transform),gtrsf);
|
IfcSchema::IfcCartesianTransformationOperator3DnonUniform>(transform),gtrsf);
|
||||||
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator2DnonUniform) ) {
|
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator2DnonUniform) ) {
|
||||||
|
Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity);
|
||||||
return false;
|
return false;
|
||||||
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator3D) ) {
|
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator3D) ) {
|
||||||
gp_Trsf trsf;
|
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) {
|
bool IfcGeom::convert(const IfcSchema::IfcRectangularTrimmedSurface::ptr l, TopoDS_Shape& face) {
|
||||||
if (!l->BasisSurface()->is(IfcSchema::Type::IfcPlane)) {
|
if (!l->BasisSurface()->is(IfcSchema::Type::IfcPlane)) {
|
||||||
// Not implemented
|
Logger::Message(Logger::LOG_ERROR, "Unsupported BasisSurface:", l->BasisSurface()->entity);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
gp_Pln pln;
|
gp_Pln pln;
|
||||||
|
|||||||
Reference in New Issue
Block a user