Correct a regression in matrix multiplication order

This commit is contained in:
Thomas Krijnen
2013-07-20 22:12:40 +00:00
parent 063f498066
commit 14a3f80c59
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr entity, const Ifc2x
const unsigned int current_size = (const unsigned int) opening_shapes.size(); const unsigned int current_size = (const unsigned int) opening_shapes.size();
for ( unsigned int i = last_size; i < current_size; ++ i ) { for ( unsigned int i = last_size; i < current_size; ++ i ) {
opening_shapes[i].move(opening_trsf); opening_shapes[i].prepend(opening_trsf);
} }
last_size = current_size; last_size = current_size;
} }
+2 -2
View File
@@ -442,14 +442,14 @@ IfcGeomObjects::IfcGeomShapeModelObject* create_shape_model_for_next_entity() {
} }
if ( use_world_coords ) { if ( use_world_coords ) {
for ( IfcGeom::IfcRepresentationShapeItems::iterator it = opened_shapes.begin(); it != opened_shapes.end(); ++ it ) { for ( IfcGeom::IfcRepresentationShapeItems::iterator it = opened_shapes.begin(); it != opened_shapes.end(); ++ it ) {
it->move(trsf); it->prepend(trsf);
} }
trsf = gp_Trsf(); trsf = gp_Trsf();
} }
shape = new IfcGeomObjects::IfcRepresentationShapeModel(shaperep->entity->id(),opened_shapes); shape = new IfcGeomObjects::IfcRepresentationShapeModel(shaperep->entity->id(),opened_shapes);
} else if ( use_world_coords ) { } else if ( use_world_coords ) {
for ( IfcGeom::IfcRepresentationShapeItems::iterator it = shapes.begin(); it != shapes.end(); ++ it ) { for ( IfcGeom::IfcRepresentationShapeItems::iterator it = shapes.begin(); it != shapes.end(); ++ it ) {
it->move(trsf); it->prepend(trsf);
} }
trsf = gp_Trsf(); trsf = gp_Trsf();
shape = new IfcGeomObjects::IfcRepresentationShapeModel(shaperep->entity->id(),shapes); shape = new IfcGeomObjects::IfcRepresentationShapeModel(shaperep->entity->id(),shapes);
+1 -1
View File
@@ -374,7 +374,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr l, IfcRepresentationShape
const unsigned int previous_size = (const unsigned int) shapes.size(); const unsigned int previous_size = (const unsigned int) shapes.size();
bool b = IfcGeom::convert_shapes(map->MappedRepresentation(),shapes); bool b = IfcGeom::convert_shapes(map->MappedRepresentation(),shapes);
for ( unsigned int i = previous_size; i < shapes.size(); ++ i ) { for ( unsigned int i = previous_size; i < shapes.size(); ++ i ) {
shapes[i].move(gtrsf); shapes[i].append(gtrsf);
} }
return b; return b;
} }
+2 -1
View File
@@ -40,7 +40,8 @@ namespace IfcGeom {
: shape(shape), style(style) {} : shape(shape), style(style) {}
IfcRepresentationShapeItem(const TopoDS_Shape& shape) IfcRepresentationShapeItem(const TopoDS_Shape& shape)
: shape(shape), style(0) {} : shape(shape), style(0) {}
void move(const gp_GTrsf& trsf) { placement.Multiply(trsf); } void append(const gp_GTrsf& trsf) { placement.Multiply(trsf); }
void prepend(const gp_GTrsf& trsf) { placement.PreMultiply(trsf); }
const TopoDS_Shape& Shape() const { return shape; } const TopoDS_Shape& Shape() const { return shape; }
const gp_GTrsf& Placement() const { return placement; } const gp_GTrsf& Placement() const { return placement; }
bool hasStyle() const { return style != 0; } bool hasStyle() const { return style != 0; }