anAIS = aPrs->getAISObject(anAIS);
if (anAIS.get()) {
// correct deviation coefficient for
- Handle(AIS_InteractiveObject) anAISPrs = anAIS->impl<Handle(AIS_InteractiveObject)>();
+ /*Handle(AIS_InteractiveObject) anAISPrs = anAIS->impl<Handle(AIS_InteractiveObject)>();
if (!anAISPrs.IsNull()) {
Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISPrs);
if (!aShapePrs.IsNull()) {
TopoDS_Shape aShape = aShapePrs->Shape();
if (!aShape.IsNull())
- ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, anAISPrs->Attributes());
+ //ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, anAISPrs->Attributes());
}
- }
+ }*/
}
} else {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
updateViewer();
}
-void XGUI_Displayer::clearSelected()
+void XGUI_Displayer::clearSelected(const bool theUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
aContext->UnhilightCurrents(false);
- aContext->ClearSelected();
+ aContext->ClearSelected(theUpdateViewer);
}
}
const int theMode, const bool theUpdateViewer) const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (!theIO.IsNull() && theIO == getTrihedron()) {
+ if (theMode != AIS_Shape::SelectionType(TopAbs_EDGE) &&
+ theMode != AIS_Shape::SelectionType(TopAbs_VERTEX))
+ return;
+ }
if (!aContext.IsNull()) {
if (myWorkshop->module()) {
int aMode = (theMode > 8)? theMode : AIS_Shape::SelectionType(theMode);
aLContext->MainSelector()->ActiveOwners(anActiveOwners);
NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (anActiveOwners);
Handle(SelectMgr_EntityOwner) anOwner;
+
+ /// It is very important to check that the owner is processed only once and has a map of
+ /// processed owners because SetSelected works as a switch.
+ /// If count of calls setSelectec is even, the object stays in the previous state
+ /// (selected, deselected)
+ /// OCCT: to write about the problem that active owners method returns one owner several times
+ QList<long> aSelectedIds; // Remember of selected address in order to avoid duplicates
for (; anOwnersIt.More(); anOwnersIt.Next()) {
anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
+ if (aSelectedIds.contains((long)anOwner.Access()))
+ continue;
+ aSelectedIds.append((long)anOwner.Access());
+
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner);
if (!BROwnr.IsNull() && BROwnr->HasShape()) {
const TopoDS_Shape& aShape = BROwnr->Shape();