Reconstruct the form of the transformation to improve the output of the OpenCascade-based serializers

This commit is contained in:
Thomas Krijnen
2014-11-04 12:36:59 +00:00
parent d28871e7fc
commit 5fdefceddd
+10 -7
View File
@@ -38,14 +38,17 @@ void OpenCascadeBasedSerializer::writeShapeModel(const IfcGeomObjects::IfcGeomSh
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->mesh().begin(); it != o->mesh().end(); ++ it) { for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->mesh().begin(); it != o->mesh().end(); ++ it) {
gp_GTrsf gtrsf = it->Placement(); gp_GTrsf gtrsf = it->Placement();
// TODO: // Convert the matrix back into a transformation object. The tolerance values
gp_GTrsf o_trsf; // are taken into consideration to reconstruct the form of the transformation.
int k = 0; gp_Trsf o_trsf;
for( int i = 1; i < 5; ++ i ) o_trsf.SetValues(
for ( int j = 1; j < 4; ++ j ) o->matrix()[0], o->matrix()[3], o->matrix()[6], o->matrix()[ 9],
o_trsf.SetValue(j, i, o->matrix()[k++]); o->matrix()[1], o->matrix()[4], o->matrix()[7], o->matrix()[10],
o->matrix()[2], o->matrix()[5], o->matrix()[8], o->matrix()[11],
1e-5, 1e-5
);
gtrsf.PreMultiply(o_trsf); gtrsf.PreMultiply(o_trsf);
const TopoDS_Shape& s = it->Shape(); const TopoDS_Shape& s = it->Shape();
bool trsf_valid = false; bool trsf_valid = false;