}
//=================================================================================================
-std::shared_ptr<ModelAPI_Feature> FeaturesPlugin_CompositeSketch::subFeature(const int theIndex,
+std::shared_ptr<ModelAPI_Feature> FeaturesPlugin_CompositeSketch::subFeature(const int theIndex,
bool forTree)
{
if(theIndex == 0) {
}
ResultConstructionPtr aConstruction =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aBaseObjectSelection->context());
- if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) &&
+ if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) &&
aST == GeomAPI_Shape::WIRE) {
// It is a wire on the sketch, store it to make face later.
aSketchWiresMap[aConstruction].push_back(aBaseShape);
aBaseShape = aConstruction->shape();
if(aBaseShape.get() && !aBaseShape->isNull()) {
GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType();
- if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE &&
+ if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE &&
aST != GeomAPI_Shape::WIRE &&
aST != GeomAPI_Shape::FACE && aST != GeomAPI_Shape::SHELL) {
setError("Error: Selected shapes has unsupported type.");
ListOfShape aShells;
ListOfShape aFreeFaces;
GeomShapePtr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList);
- GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL,
+ GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL,
aShells, aFreeFaces);
theBaseShapesList.insert(theBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end());
theBaseShapesList.insert(theBaseShapesList.end(), aShells.begin(), aShells.end());
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = theMakeShape->mapOfSubShapes();
switch(aBaseShapeType) {
- case GeomAPI_Shape::EDGE:
+ case GeomAPI_Shape::EDGE: {
+ aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
+ break;
+ }
case GeomAPI_Shape::WIRE: {
//std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
//GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2);
//if(!aV2History.empty()) {
// theResultBody->generated(aV2, aV2History.front(), aGenName + "Edge_2", theTag++);
//}
- aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
+ aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
break;
}
case GeomAPI_Shape::FACE:
}
}
- if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
+ if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
+ theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
GeomAPI_Shape::VERTEX,
- theTag++, aGenName + "Edge",
+ theTag++, aGenName + "Edge",
*aMapOfSubShapes.get());
}
- if(aShapeTypeToExplode == GeomAPI_Shape::EDGE ||
+ if(aShapeTypeToExplode == GeomAPI_Shape::EDGE ||
aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(),
+ theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(),
theBaseShape, GeomAPI_Shape::EDGE,
theTag++, aGenName + "Face",
*aMapOfSubShapes.get());
}
- std::shared_ptr<GeomAlgoAPI_MakeSweep> aMakeSweep =
+ std::shared_ptr<GeomAlgoAPI_MakeSweep> aMakeSweep =
std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(theMakeShape);
if(aMakeSweep.get()) {
// Store from shapes.
- storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
+ storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
aMakeSweep->fromShapes(), "From_", theTag);
// Store to shapes.
- storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
+ storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
aMakeSweep->toShapes(), "To_", theTag);
}
}