// the fix from VPA for more suitable selection of sketcher lines
if(anAISIO->Width() > 1) {
for(int aModeIdx = 0; aModeIdx < myActiveSelectionModes.length(); ++aModeIdx) {
- aContext->SetSelectionSensitivity(anAISIO,
- myActiveSelectionModes.value(aModeIdx), anAISIO->Width() + 2);
+ int aMode = myActiveSelectionModes.value(aModeIdx);
+ double aPrecision = (aMode == getSelectionMode(TopAbs_VERTEX))? 15 :
+ (anAISIO->Width() + 2);
+ aContext->SetSelectionSensitivity(anAISIO, aMode, aPrecision);
}
}
}
}
}
+int XGUI_Displayer::getSelectionMode(int theShapeType)
+{
+ return (theShapeType >= TopAbs_SHAPE)? theShapeType :
+ AIS_Shape::SelectionMode((TopAbs_ShapeEnum)theShapeType);
+}
+
void XGUI_Displayer::activateObjects(const QIntList& theModes, const QObjectPtrList& theObjList,
const bool theUpdateViewer)
{
// Convert shape types to selection types
QIntList aModes;
foreach(int aType, theModes) {
- if (aType >= TopAbs_SHAPE)
- aModes.append(aType);
- else
- aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum)aType));
+ aModes.append(getSelectionMode(aType));
}
#ifdef DEBUG_ACTIVATE_OBJECTS
/// \param theUpdateViewer update viewer flag
/// \return previously defined color on the object
QColor setObjectColor(ObjectPtr theObject, const QColor& theColor, bool theUpdateViewer = true);
+
+ /// Converts shape type (TopAbs_ShapeEnum) to selection mode
+ /// \param theShapeType a shape type from TopAbs_ShapeEnum
+ static int getSelectionMode(int theShapeType);
signals:
/// Signal on object display