Use the precision from the IfcGeometricRepresentationContext to dictate OCC modeler tolerances

This commit is contained in:
Thomas Krijnen
2013-11-24 15:44:27 +00:00
parent 0f53a877c7
commit bffb19a92f
7 changed files with 74 additions and 123 deletions
+10 -2
View File
@@ -42,11 +42,19 @@ bool IfcGeom::is_shape_collection(const IfcBaseClass* l) {
}
bool IfcGeom::convert_shape(const IfcBaseClass* l, TopoDS_Shape& r) {
const unsigned int id = l->entity->id();
bool success = false;
bool processed = false;
std::map<int,TopoDS_Shape>::const_iterator it = Cache::Shape.find(id);
if ( it != Cache::Shape.end() ) { r = it->second; return true; }
#include "IfcRegisterConvertShape.h"
Logger::Message(Logger::LOG_ERROR,"No operation defined for:",l->entity);
return 0;
if ( processed ) {
const double precision = IfcGeom::GetValue(GV_PRECISION);
IfcGeom::apply_tolerance(r, precision);
Cache::Shape[id] = r;
} else {
Logger::Message(Logger::LOG_ERROR,"No operation defined for:",l->entity);
}
return success;
}
bool IfcGeom::convert_wire(const IfcBaseClass* l, TopoDS_Wire& r) {
#include "IfcRegisterConvertWire.h"