using namespace std;
using namespace HEXABLOCK::GUI;
-int HEXABLOCKGUI::_oldStudyId = -1;
-
// HEXABLOCK_ORB::HEXABLOCK_Gen_var HEXABLOCKGUI::_hexaEngine = HEXABLOCK_ORB::HEXABLOCK_Gen::_nil();
//
VtkDocumentGraphicView* HEXABLOCKGUI::currentDocGView = NULL;
createActions();
createMenus();
createTools();
- studyActivated();
}
void HEXABLOCKGUI::viewManagers( QStringList& list ) const
return bOk;
}
-SALOMEDS::Study_var HEXABLOCKGUI::ClientStudyToStudy (_PTR(Study) theStudy)
+SALOMEDS::Study_var HEXABLOCKGUI::ClientStudy()
{
SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
- CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
- int aStudyID = theStudy->StudyId();
- SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(aStudyID);
+ CORBA::Object_var aSMObject = aNamingService->Resolve("/Study");
+ SALOMEDS::Study_var aDSStudy = SALOMEDS::Study::_narrow(aSMObject);
return aDSStudy._retn();
}
SalomeApp_Study* appStudy = HEXABLOCKGUI::activeStudy();
if(!appStudy) return;
- _PTR(Study) aStudy = appStudy->studyDS();
- SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( aStudy );
+ SALOMEDS::Study_var aDSStudy = ClientStudy();
SALOMEDS::StudyBuilder_var aBuilder (aDSStudy->NewBuilder());
QString entry = currentDocGView->getDocumentModel()->documentEntry();
SALOMEDS::SObject_var aFatherSO = aDSStudy->FindObjectID( qPrintable(entry) );
// _genericGui->getCatalogWidget()->addCatalogFromFile(Resource::userCatalog.toStdString());
}
-void HEXABLOCKGUI::studyActivated() //CS_TODO
-{
- int newStudyId = getApp()->activeStudy()->id();
- DEBTRACE("HEXABLOCKGUI::studyActivated " << _oldStudyId << " " << newStudyId);
-// if (_oldStudyId != -1)
-// {
-// _studyContextMap[_oldStudyId] = QtGuiContext::getQtCurrent();
-// if (_studyContextMap.count(newStudyId))
-// {
-// DEBTRACE("switch to valid context " << QtGuiContext::getQtCurrent() << " " << _studyContextMap[newStudyId]);
-// QtGuiContext::setQtCurrent(_studyContextMap[newStudyId]);
-// }
-// else
-// {
-// DEBTRACE("no switch to null context");
-// }
-// }
- _oldStudyId = newStudyId;
-}
-
void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition)
{
QModelIndex currentIndex = _patternDataTreeView->currentIndex();
if (app_study == NULL)
return docEntry;
- _PTR(Study) study = app_study->studyDS();
- SALOMEDS::Study_var ds_study = ClientStudyToStudy (study);
+ SALOMEDS::Study_var ds_study = ClientStudy();
SALOMEDS::StudyBuilder_var aBuilder (ds_study->NewBuilder());
QString entry = app_study->centry("HEXABLOCK");
SALOMEDS::SObject_var aFatherSO = ds_study->FindObjectID( qPrintable(entry) );
// static HEXABLOCK_ORB::HEXABLOCK_Gen_ptr InitHEXABLOCKGen( SalomeApp_Application* );
static LightApp_SelectionMgr* selectionMgr();
- static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
+ static SALOMEDS::Study_var ClientStudy();
static ViewType getActiveViewType();
static HEXABLOCKGUI* getInstance();
virtual void setResource(SUIT_ResourceMgr* r);
virtual void createPreferences();
virtual void preferencesChanged( const QString& sect, const QString& name );
- virtual void studyActivated();
///Returns a new HEXA_NS::Document and it's entry in the study
std::pair <QString, HEXA_NS::Document*> newHexaDocument();
HEXABLOCK::GUI::VtkDocumentGraphicView* lastVtkDocGView;
HEXABLOCKGUI_Resource* _myresource;
- static int _oldStudyId;
// static HEXABLOCK_ORB::HEXABLOCK_Gen_var _hexaEngine; // Hexa6 TODo
private slots: