return;
}
- aPathWire.Move(getPathToBaseTranslation(aBaseShape, aPathWire));
+ aPathWire.Move(getPathToBaseTranslation(theBaseShape->impl<TopoDS_Shape>(), aPathWire));
// Getting Bi-Normal.
if(!theBiNormal.get()) {
return;
}
- bool aHasLocations = false;
- if(!theLocations.empty()) {
- aHasLocations = true;
- }
-
// Getting path.
TopoDS_Shape aBaseShape;
TopAbs_ShapeEnum aBaseShapeType;
return;
}
- gp_Trsf aTrsf = getPathToBaseTranslation(aBaseShape, aPathWire);
+ TopoDS_Shape aReallyBase = theBaseShapes.front()->impl<TopoDS_Shape>();
+ gp_Trsf aTrsf = getPathToBaseTranslation(aReallyBase, aPathWire);
aPathWire.Move(aTrsf);
+ // Get locations after moving path shape.
+ std::list<TopoDS_Vertex> aLocations;
+ for (ListOfShape::const_iterator aLocIt = theLocations.cbegin();
+ aLocIt != theLocations.cend();
+ ++aLocIt)
+ {
+ GeomShapePtr aLocation = *aLocIt;
+ if (!aLocation.get() || aLocation->shapeType() != GeomAPI_Shape::VERTEX) {
+ return;
+ }
+
+ TopoDS_Vertex aLocationVertex = aLocation->impl<TopoDS_Vertex>();
+ TopoDS_Vertex aMovedVertex;
+ for (TopExp_Explorer anExp(aPathWire, TopAbs_VERTEX); anExp.More(); anExp.Next()) {
+ if (anExp.Current().IsPartner(aLocationVertex)) {
+ aMovedVertex = TopoDS::Vertex(anExp.Current());
+ aLocations.push_back(aMovedVertex);
+ break;
+ }
+ }
+ if (aMovedVertex.IsNull()) {
+ return;
+ }
+ }
+
+ if (theLocations.size() != aLocations.size()) {
+ return;
+ }
+
+ bool aHasLocations = !aLocations.empty();
+
// Making pipe.
Standard_Boolean isDone = Standard_False;
bool anIsSolidNeeded = false;
return;
}
ListOfShape::const_iterator aBaseIt = theBaseShapes.cbegin();
- ListOfShape::const_iterator aLocIt = theLocations.cbegin();
+ std::list<TopoDS_Vertex>::const_iterator aLocationsIt = aLocations.cbegin();
while(aBaseIt != theBaseShapes.cend()) {
GeomShapePtr aBase = *aBaseIt;
if(!getBase(aBaseShape, aBaseShapeType, aBase)) {
}
if(aHasLocations) {
- GeomShapePtr aLocation = *aLocIt;
- if(!aLocation.get() || aLocation->shapeType() != GeomAPI_Shape::VERTEX) {
- delete aPipeBuilder;
- return;
- }
- TopoDS_Vertex aLocationVertex = aLocation->impl<TopoDS_Vertex>();
- aLocationVertex.Move(aTrsf);
- ++aLocIt;
- aPipeBuilder->Add(aBaseShape, aLocationVertex);
+ aPipeBuilder->Add(aBaseShape, *aLocationsIt);
+ ++aLocationsIt;
} else {
aPipeBuilder->Add(aBaseShape);
}
GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
aFromShape->setImpl(new TopoDS_Shape(aPipeBuilder->FirstShape()));
aToShape->setImpl(new TopoDS_Shape(aPipeBuilder->LastShape()));
+ fixOrientation(aFromShape);
+ fixOrientation(aToShape);
this->addFromShape(aFromShape);
this->addToShape(aToShape);