- QList<ModuleBase_ViewerPrsPtr> aList =
- theSelection->getSelected(ModuleBase_ISelection::Viewer);
- int aCount = 0;
- foreach (ModuleBase_ViewerPrsPtr aPrs, aList) {
- const GeomShapePtr& aShape = aPrs->shape();
- if (aShape.get() && !aShape->isNull()) {
- if (aShape->shapeType() == GeomAPI_Shape::EDGE) {
- const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
- TopoDS_Edge aEdge = TopoDS::Edge(aTDShape);
- Standard_Real aStart, aEnd;
- Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, aStart, aEnd);
- GeomAdaptor_Curve aAdaptor(aCurve);
- if (aAdaptor.GetType() == GeomAbs_Circle)
- aCount++;
- }
- }
- }
- return (aCount == 1);
+ int aNbPoints = shapesNbPoints(theSelection);
+ ShapeQuantity aShapes;
+ int aNbEdges = shapesNbEdges(theSelection, aShapes);
+ return aNbPoints == 0 && (aShapes[GeomAbs_Circle] == aNbEdges && aNbEdges == 1);