FeatureToSelectionMap::const_iterator aSIt = myCurrentSelection.begin(),
aSLast = myCurrentSelection.end();
SelectMgr_IndexedMapOfOwner anOwnersToSelect;
+ anOwnersToSelect.Clear();
for (; aSIt != aSLast; aSIt++) {
- anOwnersToSelect.Clear();
getSelectionOwners(aSIt.key(), myCurrentSketch, aWorkshop, myCurrentSelection,
anOwnersToSelect);
- aConnector->workshop()->selector()->setSelectedOwners(anOwnersToSelect, false);
}
+ aConnector->workshop()->selector()->setSelectedOwners(anOwnersToSelect, false);
}
void PartSet_SketcherMgr::onShowConstraintsToggle(int theType, bool theState)
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
if (!aContext.IsNull()) {
+ /// previous selection should be cleared, else there will be decomposition of selections:
+ /// as AddOrRemoveSelected inverts current selection
+ aContext->ClearSelected(false);
+
for (Standard_Integer i = 1, n = theSelectedOwners.Extent(); i <= n; i++) {
Handle(SelectMgr_EntityOwner) anOwner = theSelectedOwners(i);
if (aSelectedOwners.FindIndex(anOwner) > 0)
}
}
-//**************************************************************
-void XGUI_SelectionMgr::updateSelectedOwners(bool isUpdateViewer)
-{
- Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if (aContext.IsNull())
- return;
-
- const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
-
- SelectMgr_IndexedMapOfOwner anOwnersToDeselect;
-
- SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
- for (; anIt.More(); anIt.Next()) {
- Handle(SelectMgr_Filter) aFilter = anIt.Value();
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
- Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
- if (!aFilter->IsOk(anOwner))
- anOwnersToDeselect.Add(aContext->SelectedOwner());
- }
- }
-
- setSelectedOwners(anOwnersToDeselect, false);
-
- if (isUpdateViewer)
- aContext->UpdateCurrentViewer();
-}
-
//**************************************************************
void XGUI_SelectionMgr::onObjectBrowserSelection()
{
void setSelectedOwners(const SelectMgr_IndexedMapOfOwner& theSelectedOwners,
bool isUpdateViewer);
- //! Check that the selected owners are valid for the current filters
- /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void updateSelectedOwners(bool isUpdateViewer);
-
//! Clears selection in Viewer and object Browser
void clearSelection();
#ifdef DFBROWSER
#include <CDF_Session.hxx>
+#include <CDF_Application.hxx>
#include <DFBrowserAPI_Communicator.hxx>
static bool DFBrowser_FirstCall = true;
#endif
else if (theId == "DFBROWSER_VIEW") {
if (DFBrowser_FirstCall) {
Handle(CDF_Application) anApplication = CDF_Session::CurrentSession()->CurrentApplication();
-
DFBrowserAPI_Communicator* aCommunicator =
DFBrowserAPI_Communicator::loadPluginLibrary("DFBrowser.dll");
aCommunicator->setApplication(anApplication);