-// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <iterator>
#ifdef TINSPECTOR
-#include <CDF_Session.hxx>
-#include <CDF_Application.hxx>
+#include <TDocStd_Application.hxx>
#include <inspector/TInspector_Communicator.hxx>
#include <inspector/VInspector_CallBack.hxx>
static TInspector_Communicator* MyTCommunicator;
static Handle(VInspector_CallBack) MyVCallBack;
-
#endif
#ifdef _DEBUG
#ifdef WIN32
#include <windows.h>
+#pragma warning(disable : 4456) // for nested foreach
+#pragma warning(disable : 4189) // for declaration of unused variables (MAYBE_UNUSED)
#else
#include <dlfcn.h>
#endif
#endif
QString aFileName = aDocDir + aSep + thePage;
if (QFile::exists(aFileName)) {
+#ifdef HAVE_SALOME
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if (app)
app->onHelpContextModule("SHAPER", aFileName);
QUrl aUrl = QUrl::fromLocalFile(aFileName);
QDesktopServices::openUrl(aUrl);
}
+#else
+ QUrl aUrl = QUrl::fromLocalFile(aFileName);
+ QDesktopServices::openUrl(aUrl);
+#endif
}
}
}
}
#endif
+ int anActivationId =
+ ModuleBase_Preferences::resourceMgr()->integerValue("General", "part_activation_study", -1);
+ int aSize = aRootDoc->size(ModelAPI_ResultPart::group());
+
+ if (anActivationId == 0 && aSize > 0) {
+ ObjectPtr anObject = aRootDoc->object(ModelAPI_ResultPart::group(), aSize - 1);
+ ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(anObject);
+ if (aPart.get()) {
+ aPart->activate();
+ ModuleBase_Tools::setDisplaying(aPart);
+ }
+ }
+ else if (anActivationId == 1) {
+ for (int anIndex = 0; anIndex < aSize; ++anIndex) {
+ ObjectPtr anObject = aRootDoc->object(ModelAPI_ResultPart::group(), anIndex);
+ ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(anObject);
+ if (aPart.get()) {
+ aPart->activate();
+ ModuleBase_Tools::setDisplaying(aPart);
+
+ if (anIndex < aSize - 1) {
+ SessionPtr aMgr = ModelAPI_Session::get();
+ aMgr->startOperation("Activation");
+ aMgr->setActiveDocument(aMgr->moduleDocument());
+ aMgr->finishOperation();
+ updateCommandStatus();
+ viewer()->update();
+ }
+ }
+ }
+ }
QApplication::restoreOverrideCursor();
}
}
#ifdef TINSPECTOR
else if (theId == "TINSPECTOR_VIEW") {
- Handle(CDF_Application) anApplication = CDF_Session::CurrentSession()->CurrentApplication();
+ Handle(TDocStd_Application) anApplication = ModelAPI_Session::get()->application();
if (!anApplication.IsNull())
{
if (!MyTCommunicator)
QString aDescription = contextMenuMgr()->action("AUTOCOLOR_CMD")->text();
aMgr->startOperation(aDescription.toStdString());
- Config_Prop* aProp = Config_PropManager::findProp("Visualization", "result_group_auto_color");
-
- if (aProp) {
- bool anIsAutoColor = Config_PropManager::boolean("Visualization", "result_group_auto_color");
-
- if (anIsAutoColor) {
+ if (Config_PropManager::getAutoColorStatus()) {
contextMenuMgr()->action("AUTOCOLOR_CMD")->setText(tr("Auto color"));
- aProp->setValue("false");
+ Config_PropManager::setAutoColorStatus(false);
ModelAPI_Tools::findRandomColor(aColor, true);
} else {
// set the value to all results
updateCommandStatus();
myViewerProxy->update();
contextMenuMgr()->action("AUTOCOLOR_CMD")->setText(tr("Disable auto color"));
- aProp->setValue("true");
+ Config_PropManager::setAutoColorStatus(true);
}
- }
}
//**************************************************************