}
}
+bool XGUI_Displayer::isActive(ObjectPtr theObject) const
+{
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (aContext.IsNull())
+ return false;
+ if (!isVisible(theObject))
+ return false;
+
+ boost::shared_ptr<GeomAPI_AISObject> anObj = myResult2AISObjectMap.at(theObject);
+ Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
+
+ TColStd_ListOfInteger aModes;
+ aContext->ActivatedModes(anAIS, aModes);
+ return aModes.Extent() > 0;
+}
+
void XGUI_Displayer::stopSelection(const QList<ObjectPtr>& theResults, const bool isStop,
const bool isUpdateViewer)
{
/// \return feature the feature or NULL if it not visualized
ObjectPtr getObject(Handle(AIS_InteractiveObject) theIO) const;
+ /// Deactivates the given object (not allow selection)
void deactivate(ObjectPtr theFeature);
+ /// Activates the given object (it can be selected)
void activate(ObjectPtr theFeature);
+ /// Returns true if the given object can be selected
+ bool isActive(ObjectPtr theObject) const;
+
/// Activates in local context displayed outside of the context.
/// \param theModes - selection modes to activate
/// \param theFilter - filter for selection
if (!aObj->data() || !aObj->data()->isValid() || aObj->document()->isConcealed(aObj))
myDisplayer->erase(aObj, false);
else {
- if (myDisplayer->isVisible(aObj)) // TODO VSV: Correction sketch drawing
+ if (myDisplayer->isVisible(aObj)) {
myDisplayer->display(aObj, false); // In order to update presentation
- else {
+ if (myOperationMgr->hasOperation()) {
+ ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
+ if (!aOperation->hasObject(aObj))
+ if (!myDisplayer->isActive(aObj))
+ myDisplayer->activate(aObj);
+ }
+ } else {
if (myOperationMgr->hasOperation()) {
ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
// Display only current operation results if operation has preview
- if (aOperation->hasObject(aObj) && aOperation->hasPreview())
+ if (aOperation->hasObject(aObj) && aOperation->hasPreview()) {
myDisplayer->display(aObj, false);
+ // Deactivate object of current operation from selection
+ if (myDisplayer->isActive(aObj))
+ myDisplayer->deactivate(aObj);
+ }
}
}
}