}
GeomShapePtr aBaseShape = aBaseObjectSelection->value();
if(aBaseShape.get() && !aBaseShape->isNull()) {
- aBaseShape->shapeType() == GeomAPI_Shape::FACE ? aBaseFacesList.push_back(aBaseShape) :
- theBaseShapesList.push_back(aBaseShape);
+ GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType();
+ 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.");
+ return;
+ }
+ aST == GeomAPI_Shape::FACE ? aBaseFacesList.push_back(aBaseShape) :
+ theBaseShapesList.push_back(aBaseShape);
} else {
// This may be the whole sketch result selected, check and get faces.
ResultConstructionPtr aConstruction =
// Probably it can be construction.
aBaseShape = aConstruction->shape();
if(aBaseShape.get() && !aBaseShape->isNull()) {
- aBaseShape->shapeType() == GeomAPI_Shape::FACE ? aBaseFacesList.push_back(aBaseShape) :
- theBaseShapesList.push_back(aBaseShape);
+ GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType();
+ 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.");
+ return;
+ }
+ aST == GeomAPI_Shape::FACE ? aBaseFacesList.push_back(aBaseShape) :
+ theBaseShapesList.push_back(aBaseShape);
}
} else {
for(int aFaceIndex = 0; aFaceIndex < aFacesNum; aFaceIndex++) {
MyShapeTypes["circle"] = Circle;
MyShapeTypes["wire"] = Wire;
MyShapeTypes["face"] = Face;
- MyShapeTypes["solid"] = Solid;
MyShapeTypes["plane"] = Plane;
MyShapeTypes["shell"] = Shell;
+ MyShapeTypes["solid"] = Solid;
}
std::string aType = std::string(theType.c_str());
if (MyShapeTypes.find(aType) != MyShapeTypes.end())
return MyShapeTypes[aType];
-
+
Events_Error::send("Shape type defined in XML is not implemented!");
return AnyShape;
}
case Face:
aValid = theShape->isFace();
break;
+ case Shell:
+ aValid = theShape->shapeType() == GeomAPI_Shape::SHELL;
+ break;
case Solid:
aValid = theShape->isSolid() || theShape->isCompSolid() ||
theShape->isCompoundOfSolids();
break;
- case Shell:
- aValid = theShape->shapeType() == GeomAPI_Shape::SHELL;
case Compound:
aValid = theShape->isCompound();
break;