- // Transform the shape with copying it
- BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true);
- if(aBuilder) {
- setImpl(aBuilder);
- myDone = aBuilder->IsDone() == Standard_True;
- if (myDone) {
- TopoDS_Shape aResult = aBuilder->Shape();
- // fill data map to keep correct orientation of sub-shapes
- for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) {
- std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
- aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
- myMap.bind(aCurrentShape, aCurrentShape);
- }
-#ifdef DEB_PLACEMENT
- int aNum = myMap.size();
- cout << "MAP of Oriented shapes =" << aNum <<endl;
-
-#endif
-
- myShape->setImpl(new TopoDS_Shape(aResult));
- myMkShape = new GeomAlgoAPI_MakeShape (aBuilder);
+ if (theSimpleTransform) { // just add transformation
+ TopLoc_Location aDelta(aTrsf);
+ // store the accumulated information about the result and this delta
+ //myTrsf = std::shared_ptr<GeomAPI_Trsf>(new GeomAPI_Trsf(new gp_Trsf(aTrsf * aSourceShape.Location().Transformation())));
+ myTrsf.reset(new GeomAPI_Trsf(new gp_Trsf(aTrsf)));
+ TopoDS_Shape aResult = aSourceShape.Moved(aDelta);
+ std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+ aShape->setImpl(new TopoDS_Shape(aResult));
+ this->setShape(aShape);
+ this->setDone(true); // it is allways true for simple transformation generation
+ } else { // internal rebuild of the shape
+ // Transform the shape with copying it
+ BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true);
+ if(!aBuilder) {
+ return;