// of redisplay is called. This modification is made in order to have the line is updated
// by creation of a horizontal constraint on the line by preselection
myDisplayer->redisplay(aObj, false);
- if (myOperationMgr->hasOperation()) {
- ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
- if (!aOperation->isEditOperation() &&
- aOperation->hasObject(aObj) && myDisplayer->isActive(aObj))
+ //if (myOperationMgr->hasOperation()) {
+ // ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
+ // if (!aOperation->isEditOperation() &&
+ // aOperation->hasObject(aObj) && myDisplayer->isActive(aObj))
+ if (!myModule->canActivateSelection(aObj)) {
+ if (myDisplayer->isActive(aObj))
myDisplayer->deactivate(aObj);
}
} else { // display object if the current operation has it
if (displayObject(aObj)) {
- ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
- if (aOperation && aOperation->hasObject(aObj)) {
- ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
+ //ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
+ //if (aOperation && aOperation->hasObject(aObj)) {
+ if (!myModule->canActivateSelection(aObj)) {
#ifdef DEBUG_FEATURE_REDISPLAY
QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
qDebug(QString(" display object = %1").arg(anObjInfo).toStdString().c_str());
// the validity of the data should be checked here in order to avoid display of the objects,
// which were created, then deleted, but flush for the creation event happens after that
// we should not display disabled objects
- if (!anObject->data() || !anObject->data()->isValid() || anObject->isDisabled())
- continue;
- //ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aIt);
- //if (aPart) {
- //aHasPart = true;
- // If a feature is created from the aplication's python console
- // it doesn't stored in the operation mgr and doesn't displayed
- //} else {
- isDisplayed = displayObject(*aIt);
- //}
+ bool aHide = !anObject->data() || !anObject->data()->isValid() ||
+ anObject->isDisabled() || (!anObject->isDisplayed());
+ if (!aHide) {
+ // setDisplayed has to be called in order to synchronize internal state of the object
+ // with list of displayed objects
+ if (myModule->canDisplayObject(anObject)) {
+ anObject->setDisplayed(true);
+ isDisplayed = displayObject(*aIt);
+ } else
+ anObject->setDisplayed(false);
+ }
}
//if (myObjectBrowser)
// myObjectBrowser->processEvent(theMsg);
aSession->closeAll();
aSession->load(myCurrentDir.toLatin1().constData());
myObjectBrowser->rebuildDataTree();
- displayAllResults();
+ //displayAllResults();
updateCommandStatus();
myIsLoadingData = false;
QApplication::restoreOverrideCursor();
aDescription += tr(" %1");
QStringList aObjectNames;
foreach (ObjectPtr aObj, anObjects) {
- if (!aObj->data().get())
+ if (!aObj->data()->isValid())
continue;
aObjectNames << QString::fromStdString(aObj->data()->name());
}
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->closeAll();
- objectBrowser()->clearContent();
}
//**************************************************************