From 56170e45fcb9100726ee9b58323186d01dab2cf2 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 7 Nov 2011 14:52:15 +0000 Subject: [PATCH] 0021419: [CEA 516] Invalid tree representation of ATOMIC light-component --- src/ATOMICGUI/ATOMICGUI_DataModel.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ATOMICGUI/ATOMICGUI_DataModel.cxx b/src/ATOMICGUI/ATOMICGUI_DataModel.cxx index aab2485..19a45cd 100644 --- a/src/ATOMICGUI/ATOMICGUI_DataModel.cxx +++ b/src/ATOMICGUI/ATOMICGUI_DataModel.cxx @@ -62,6 +62,8 @@ ATOMICGUI_DataModel::~ATOMICGUI_DataModel() /*! Open Data Model. Build data structure from the given list of files. */ bool ATOMICGUI_DataModel::open( const QString& URL, CAM_Study* study, QStringList listOfFiles ) { + myMolecules.clear(); + LightApp_Study* aDoc = dynamic_cast( study ); if ( !aDoc ) return false; @@ -118,13 +120,14 @@ bool ATOMICGUI_DataModel::saveAs ( const QString& URL, CAM_Study* study, QString bool ATOMICGUI_DataModel::close() { myStudyURL = ""; - myMolecules.clear(); + //myMolecules.clear(); return LightApp_DataModel::close(); } /*! Called on Study creation */ bool ATOMICGUI_DataModel::create( CAM_Study* study ) { + myMolecules.clear(); return true; } @@ -143,9 +146,14 @@ bool ATOMICGUI_DataModel::isSaved() const /*! Called on update of the structure of Data Objects */ void ATOMICGUI_DataModel::build() { - ATOMICGUI_ModuleObject* modelRoot = dynamic_cast( root() ); + //VSR: module object should be created in a different way for "full" and "light" SALOME + //ATOMICGUI_ModuleObject* modelRoot = dynamic_cast( root() ); + CAM_ModuleObject* modelRoot = dynamic_cast( root() ); if( !modelRoot ) { // root is not set yet - modelRoot = new ATOMICGUI_ModuleObject( this, 0 ); + //VSR: module object should be created in a different way for "full" and "light" SALOME + //modelRoot = new ATOMICGUI_ModuleObject( this, 0 ); + LightApp_Study* study = dynamic_cast( module()->application()->activeStudy() ); + modelRoot = createModuleObject( study->root() ); setRoot( modelRoot ); } -- 2.30.2