Handle(SelectMgr_Filter) aFilter = anIt.Value();
aValid = aFilter->IsOk(anOwner);
}
- if (!isActivated)
- activateFilters(false);
}
+ if (!isActivated)
+ activateFilters(false);
}
// removes created owner
aResMgr->setValue("Study", "store_positions", false);
// Synchronize displayed objects
- if (mySelector && mySelector->viewer()) {
- Handle(AIS_InteractiveContext) aContext = mySelector->viewer()->getAISContext();
+ Handle(AIS_InteractiveContext) aContext;
+ if (mySelector && mySelector->viewer())
+ aContext = mySelector->viewer()->getAISContext();
+
+ if (!aContext.IsNull()) {
XGUI_Displayer* aDisp = myWorkshop->displayer();
QObjectPtrList aObjList = aDisp->displayedObjects();
// if the operation is panning or rotate or panglobal then do nothing
if ((theTrsfType == 1) || (theTrsfType == 3) || (theTrsfType == 4))
return;
-
ModuleBase_IViewer* aViewer = myWorkshop->viewer();
+ Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+ if (aContext.IsNull())
+ return;
+
//Handle(V3d_View) aView = aViewer->activeView();
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
XGUI_Workshop* aWorkshop = aConnector->workshop();
XGUI_Displayer* aDisplayer = aWorkshop->displayer();
- Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
- if (aContext.IsNull())
- return;
-
Handle(V3d_Viewer) aV3dViewer = aContext->CurrentViewer();
Handle(V3d_View) aView;
double aScale = 0;
{
// z layer is created for all started operations in order to visualize operation AIS presentation
// over the object
- Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
+ Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (aContext.IsNull())
+ return;
+
+ Handle(V3d_Viewer) aViewer = aContext->CurrentViewer();
if (myVisualLayerId == 0) {
if (myVisualLayerId == 0)
aViewer->AddZLayer(myVisualLayerId);
return;
Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
- if (aContext.IsNull())
- return;
- // MoveTo in order to highlight current object
- aContext->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
-
+ if (!aContext.IsNull()) {
+ // MoveTo in order to highlight current object
+ aContext->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
+ }
// Remember highlighted objects for editing
ModuleBase_ISelection* aSelect = aWorkshop->selection();
ModuleBase_IViewer* aViewer = theWorkshop->viewer();
Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
- if (aContext.IsNull())
- return;
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
- XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+ if (!aContext.IsNull()) {
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
+ XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
- std::list<ResultPtr> aResults = theFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt)
- {
- ResultPtr aResult = *aIt;
- AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult);
- if (aAISObj.get() == NULL)
- continue;
- Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+ std::list<ResultPtr> aResults = theFeature->results();
+ std::list<ResultPtr>::const_iterator aIt;
+ for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt)
{
- Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
- if (anOwner->Selectable() != anAISIO)
- continue;
- getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
- aSelectedAttributes, aSelectedResults);
- }
- for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
- Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
- if (anOwner.IsNull())
+ ResultPtr aResult = *aIt;
+ AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult);
+ if (aAISObj.get() == NULL)
continue;
- if (anOwner->Selectable() != anAISIO)
- continue;
- getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
- aSelectedAttributes, aSelectedResults);
+ Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+ {
+ Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
+ if (anOwner->Selectable() != anAISIO)
+ continue;
+ getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
+ aSelectedAttributes, aSelectedResults);
+ }
+ for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
+ Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
+ if (anOwner.IsNull())
+ continue;
+ if (anOwner->Selectable() != anAISIO)
+ continue;
+ getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
+ aSelectedAttributes, aSelectedResults);
+ }
}
}
theSelection[theFeature] = std::make_pair(aSelectedAttributes, aSelectedResults);
const FeaturePtr& theSketch,
ModuleBase_IWorkshop* theWorkshop,
const FeatureToSelectionMap& theSelection,
- SelectMgr_IndexedMapOfOwner& anOwnersToSelect)
+ SelectMgr_IndexedMapOfOwner& theOwnersToSelect)
{
if (theFeature.get() == NULL)
return;
std::set<ResultPtr> aSelectedResults = anIt.value().second;
ModuleBase_IViewer* aViewer = theWorkshop->viewer();
- Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
- if (aContext.IsNull())
- return;
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
for (Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++) {
Handle(SelectMgr_EntityOwner) anOwner = aSelectedOwners(i);
if (!anOwner.IsNull())
- anOwnersToSelect.Add(anOwner);
+ theOwnersToSelect.Add(anOwner);
}
}
AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(theFeature, aShape, theSketch);
if (aPntAttr.get() != NULL &&
aSelectedAttributes.find(aPntAttr) != aSelectedAttributes.end()) {
- anOwnersToSelect.Add(anOwner);
+ theOwnersToSelect.Add(anOwner);
}
}
else if (aShapeType == TopAbs_EDGE) {
bool aFound = aSelectedResults.find(aResult) != aSelectedResults.end();
if (aSelectedResults.find(aResult) != aSelectedResults.end() &&
- anOwnersToSelect.FindIndex(anOwner) <= 0)
- anOwnersToSelect.Add(anOwner);
+ theOwnersToSelect.FindIndex(anOwner) <= 0)
+ theOwnersToSelect.Add(anOwner);
}
}
}
Handle(AIS_InteractiveContext) aContext = AISContext();
if (aContext.IsNull())
return aErased;
+
AISObjectPtr anObject = myResult2AISObjectMap[theObject];
if (anObject) {
Handle(AIS_InteractiveObject) anAIS = anObject->impl<Handle(AIS_InteractiveObject)>();
}
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (!aAISIO.IsNull() && !aContext.IsNull()) {
+ if (!aContext.IsNull() && !aAISIO.IsNull()) {
// Check that the visualized shape is the same and the redisplay is not necessary
// Redisplay of AIS object leads to this object selection compute and the selection
// in the browser is lost
arg(anInfoStr).
toStdString().c_str());
#endif
- if (isVisible(theObject)) {
- Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext.IsNull())
- return;
-
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull() && isVisible(theObject)) {
AISObjectPtr anObj = myResult2AISObjectMap[theObject];
Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theModes)
{
- if (!isVisible(theObject))
- return;
-
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext.IsNull())
+ if (aContext.IsNull() || !isVisible(theObject))
return;
AISObjectPtr aAISObj = getAISObject(theObject);
}
myActiveSelectionModes = aNewModes;
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext.IsNull())
- return;
// Open local context if there is no one
- if (!aContext->HasOpenedContext())
+ if (aContext.IsNull() || !aContext->HasOpenedContext())
return;
//aContext->UseDisplayedObjects();
bool XGUI_Displayer::isActive(ObjectPtr theObject) const
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext.IsNull())
- return false;
- if (!isVisible(theObject))
+ if (aContext.IsNull() || !isVisible(theObject))
return false;
AISObjectPtr anObj = myResult2AISObjectMap[theObject];
void XGUI_Displayer::clearSelected()
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext) {
+ if (!aContext.IsNull()) {
aContext->UnhilightCurrents(false);
aContext->ClearSelected();
}
void XGUI_Displayer::deactivateTrihedron() const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
-
- AIS_ListOfInteractive aList;
- aContext->DisplayedObjects(aList, true);
- AIS_ListIteratorOfListOfInteractive aIt;
- for (aIt.Initialize(aList); aIt.More(); aIt.Next()) {
- Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(aIt.Value());
- if (!aTrihedron.IsNull()) {
- aContext->Deactivate(aTrihedron);
+ if (!aContext.IsNull()) {
+ AIS_ListOfInteractive aList;
+ aContext->DisplayedObjects(aList, true);
+ AIS_ListIteratorOfListOfInteractive aIt;
+ for (aIt.Initialize(aList); aIt.More(); aIt.Next()) {
+ Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(aIt.Value());
+ if (!aTrihedron.IsNull()) {
+ aContext->Deactivate(aTrihedron);
+ }
}
}
}
void XGUI_Displayer::openLocalContext()
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if (aContext.IsNull())
- return;
// Open local context if there is no one
- if (!aContext->HasOpenedContext()) {
+ if (!aContext.IsNull() && !aContext->HasOpenedContext()) {
// Preserve selected objects
//AIS_ListOfInteractive aAisList;
//for (aContext->InitCurrent(); aContext->MoreCurrent(); aContext->NextCurrent())
void XGUI_Displayer::closeLocalContexts(const bool theUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- if ( (!aContext.IsNull()) && (aContext->HasOpenedContext()) ) {
+ if (!aContext.IsNull() && aContext->HasOpenedContext()) {
// Preserve selected objects
//AIS_ListOfInteractive aAisList;
//for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
const int theMode, const bool theUpdateViewer) const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- aContext->Activate(theIO, theMode, theUpdateViewer);
+ if (!aContext.IsNull()) {
+ aContext->Activate(theIO, theMode, theUpdateViewer);
#ifdef DEBUG_ACTIVATE_AIS
- ObjectPtr anObject = getObject(theIO);
- anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
- qDebug(QString("activateAIS: theMode = %1, object = %2").arg(theMode).arg(anInfo).toStdString().c_str());
+ ObjectPtr anObject = getObject(theIO);
+ anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
+ qDebug(QString("activateAIS: theMode = %1, object = %2").arg(theMode).arg(anInfo).toStdString().c_str());
#endif
+ }
}
void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode) const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if (theMode == -1)
- aContext->Deactivate(theIO);
- else
- aContext->Deactivate(theIO, theMode);
+ if (!aContext.IsNull()) {
+ if (theMode == -1)
+ aContext->Deactivate(theIO);
+ else
+ aContext->Deactivate(theIO, theMode);
#ifdef DEBUG_DEACTIVATE_AIS
- ObjectPtr anObject = getObject(theIO);
- anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
- qDebug(QString("deactivateAIS: theMode = %1, object = %2").arg(theMode).arg(anInfo).toStdString().c_str());
+ ObjectPtr anObject = getObject(theIO);
+ anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
+ qDebug(QString("deactivateAIS: theMode = %1, object = %2").arg(theMode).arg(anInfo).toStdString().c_str());
#endif
+ }
}
Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if ((!aContext.IsNull()) && (!aContext->HasOpenedContext())) {
+ if (!aContext.IsNull() && !aContext->HasOpenedContext()) {
aContext->OpenLocalContext();
deactivateTrihedron();
aContext->DefaultDrawer()->VIsoAspect()->SetNumber(0);
Handle(SelectMgr_AndFilter) XGUI_Displayer::GetFilter()
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (myAndFilter.IsNull() && !aContext.IsNull()) {
+ if (!aContext.IsNull() && myAndFilter.IsNull()) {
myAndFilter = new SelectMgr_AndFilter();
aContext->AddFilter(myAndFilter);
}
{
bool aDisplayed = false;
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext.IsNull())
- return aDisplayed;
Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
- if (!anAISIO.IsNull()) {
+ if (!aContext.IsNull() && !anAISIO.IsNull()) {
aContext->Display(anAISIO, 0/*wireframe*/, 0, theUpdateViewer, true, AIS_DS_Displayed);
aDisplayed = true;
aContext->Deactivate(anAISIO);
{
bool aErased = false;
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (aContext.IsNull())
- return aErased;
- Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
- if (!anAISIO.IsNull() && aContext->IsDisplayed(anAISIO)) {
- aContext->Remove(anAISIO, theUpdateViewer);
- aErased = true;
+ if (!aContext.IsNull()) {
+ Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
+ if (!anAISIO.IsNull() && aContext->IsDisplayed(anAISIO)) {
+ aContext->Remove(anAISIO, theUpdateViewer);
+ aErased = true;
+ }
}
return aErased;
}
void XGUI_Displayer::deactivateSelectionFilters()
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (!myAndFilter.IsNull() && !aContext.IsNull()) {
+ if (!aContext.IsNull() && !myAndFilter.IsNull()) {
bool aFound = false;
const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
if (aContext.IsNull() || hasSelectionFilter(theFilter))
return;
- Handle(SelectMgr_CompositionFilter) aCompFilter = GetFilter();
- aCompFilter->Add(theFilter);
+ Handle(SelectMgr_CompositionFilter) aCompositeFilter = GetFilter();
+ if (!aCompositeFilter.IsNull()) {
+ aCompositeFilter->Add(theFilter);
#ifdef DEBUG_SELECTION_FILTERS
- int aCount = GetFilter()->StoredFilters().Extent();
- qDebug(QString("addSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str());
+ int aCount = aCompositeFilter->StoredFilters().Extent();
+ qDebug(QString("addSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str());
#endif
+ }
}
void XGUI_Displayer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
Handle(AIS_InteractiveContext) aContext = AISContext();
if (aContext.IsNull())
return;
+
Handle(SelectMgr_AndFilter) aCompositeFilter = GetFilter();
- if (aCompositeFilter->IsIn(theFilter))
+ if (!aCompositeFilter.IsNull() && aCompositeFilter->IsIn(theFilter)) {
aCompositeFilter->Remove(theFilter);
#ifdef DEBUG_SELECTION_FILTERS
- int aCount = GetFilter()->StoredFilters().Extent();
- qDebug(QString("removeSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str());
+ int aCount = aCompositeFilter->StoredFilters().Extent();
+ qDebug(QString("removeSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str());
#endif
+ }
}
bool XGUI_Displayer::hasSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
if (theFilter.Access() == aIt.Value().Access())
aFilterFound = true;
}
- Handle(SelectMgr_CompositionFilter) aCompFilter = GetFilter();
- const SelectMgr_ListOfFilter& aStoredFilters = aCompFilter->StoredFilters();
- for (aIt.Initialize(aStoredFilters); aIt.More() && !aFilterFound; aIt.Next()) {
- if (theFilter.Access() == aIt.Value().Access())
- aFilterFound = true;
+ Handle(SelectMgr_CompositionFilter) aCompositeFilter = GetFilter();
+ if (!aCompositeFilter.IsNull()) {
+ const SelectMgr_ListOfFilter& aStoredFilters = aCompositeFilter->StoredFilters();
+ for (aIt.Initialize(aStoredFilters); aIt.More() && !aFilterFound; aIt.Next()) {
+ if (theFilter.Access() == aIt.Value().Access())
+ aFilterFound = true;
+ }
}
return aFilterFound;
}
Handle(AIS_InteractiveContext) aContext = AISContext();
if (aContext.IsNull())
return;
- GetFilter()->Clear();
+
+ Handle(SelectMgr_CompositionFilter) aCompositeFilter = GetFilter();
+ if (!aCompositeFilter.IsNull())
+ aCompositeFilter->Clear();
}
void XGUI_Displayer::showOnly(const QObjectPtrList& theList)
void XGUI_Selection::getSelectedInViewer(QList<ModuleBase_ViewerPrs>& thePresentations) const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if (aContext.IsNull())
- return;
-
- if (aContext->HasOpenedContext()) {
+ if (!aContext.IsNull() && aContext->HasOpenedContext()) {
QList<long> aSelectedIds; // Remember of selected address in order to avoid duplicates
for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
ModuleBase_ViewerPrs aPrs;
QList<ModuleBase_ViewerPrs> XGUI_Selection::getHighlighted() const
{
- QList<long> aSelectedIds; // Remember of selected address in order to avoid duplicates
QList<ModuleBase_ViewerPrs> aPresentations;
- XGUI_Displayer* aDisplayer = myWorkshop->displayer();
-
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (aContext.IsNull())
+ return aPresentations;
+
+ QList<long> aSelectedIds; // Remember of selected address in order to avoid duplicates
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
ModuleBase_ViewerPrs aPrs;
Handle(AIS_InteractiveObject) anIO = aContext->DetectedInteractive();
//**************************************************************
void XGUI_Selection::selectedAISObjects(AIS_ListOfInteractive& theList) const
{
- Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
theList.Clear();
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
- theList.Append(aContext->SelectedInteractive());
+
+ Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (!aContext.IsNull()) {
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+ theList.Append(aContext->SelectedInteractive());
+ }
}
//**************************************************************
{
theList.Clear();
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (aContext.IsNull())
+ return;
+
for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
TopoDS_Shape aShape = aContext->SelectedShape();
if (!aShape.IsNull()) {
void XGUI_Selection::selectedOwners(SelectMgr_IndexedMapOfOwner& theSelectedOwners) const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
-
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
- theSelectedOwners.Add(aContext->SelectedOwner());
+ if (!aContext.IsNull()) {
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+ theSelectedOwners.Add(aContext->SelectedOwner());
+ }
}
}
SelectMgr_IndexedMapOfOwner& theOwners) const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
-
- if (theObject.IsNull() || aContext.IsNull())
+ if (aContext.IsNull() || theObject.IsNull())
return;
TColStd_ListOfInteger aModes;
selection()->selectedOwners(aSelectedOwners);
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- for (Standard_Integer i = 1, n = theSelectedOwners.Extent(); i <= n; i++) {
- Handle(SelectMgr_EntityOwner) anOwner = theSelectedOwners(i);
- if (aSelectedOwners.FindIndex(anOwner) > 0)
- continue;
+ if (!aContext.IsNull()) {
+ for (Standard_Integer i = 1, n = theSelectedOwners.Extent(); i <= n; i++) {
+ Handle(SelectMgr_EntityOwner) anOwner = theSelectedOwners(i);
+ if (aSelectedOwners.FindIndex(anOwner) > 0)
+ continue;
- aContext->AddOrRemoveSelected(anOwner, isUpdateViewer);
+ aContext->AddOrRemoveSelected(anOwner, isUpdateViewer);
+ }
}
}
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;
{
QObjectPtrList aFeatures;
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
- Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
- ObjectPtr aResult = myWorkshop->displayer()->getObject(anIO);
- if (aResult)
- aFeatures.append(aResult);
+ if (!aContext.IsNull()) {
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+ Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
+ ObjectPtr aResult = myWorkshop->displayer()->getObject(anIO);
+ if (aResult)
+ aFeatures.append(aResult);
+ }
}
bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
myWorkshop->objectBrowser()->setObjectsSelected(aFeatures);