const GeomAPI_Shape::ShapeType& theShapeType,
std::list<SubshapeOfResult>& theSelected)
{
- static const double TOLERANCE = 1.e-7;
+ static const double TOLERANCE = 1.e-6;
theSelected.clear();
// next special case: the full sketch is selected
// the selection type is a COMPOUND
- if (aSketchEdges &&
+ if (aSketchEdges && theShapeType == GeomAPI_Shape::COMPOUND &&
aSketchEdges->middlePoint()->distance(thePoint) < TOLERANCE) {
// select whole result
appendSubshapeOfResult(theSelected, *aResIt, GeomShapePtr());
std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(aResults.front()->shape());
if (aSketchEdges && aCF) {
- bool isContinue = true;
int aNbSubs = aCF->numberOfSubs();
- for (int aSubInd = 0; aSubInd < aNbSubs && isContinue; ++aSubInd) {
+ for (int aSubInd = 0; aSubInd < aNbSubs; ++aSubInd) {
FeaturePtr aSub = aCF->subFeature(aSubInd);
const std::list<ResultPtr>& aSubResults = aSub->results();
for (std::list<ResultPtr>::const_iterator aSRIt = aSubResults.begin();
findSubShape(aCurShape, theShapeType, thePoint, TOLERANCE);
if (!aSubshapes.empty()) {
appendSubshapeOfResult(theSelected, aResults.front(), aSubshapes);
- isContinue = false;
break;
}
}
FeaturePtr aSelectedFeature;
if (isDumpByGeom) {
ResultPtr aRes = theAttrSelect->context();
- if (aRes) {
+ if (aRes)
aSelectedFeature = ModelAPI_Feature::feature(aRes->data()->owner());
- if (aSelectedFeature)
- isDumpByGeom = aSelectedFeature->isInHistory();
- }
+ else
+ aSelectedFeature = theAttrSelect->contextFeature();
+
+ if (aSelectedFeature)
+ isDumpByGeom = aSelectedFeature->isInHistory();
}
myDumpBuffer << "\"" << aShape->shapeTypeStr();
// for correct calculation of the middle point
ResultPartPtr aResPart =
std::dynamic_pointer_cast<ModelAPI_ResultPart>(theAttrSelect->context());
- if (aResPart)
+ if (aResPart && aShape->shapeType() == GeomAPI_Shape::COMPOUND)
aShape = aResPart->shape();
GeomPointPtr aMiddlePoint = aShape->middlePoint();
// calculate number of features, which could be selected by the same point