/*! 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<LightApp_Study*>( study );
if ( !aDoc )
return false;
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;
}
/*! Called on update of the structure of Data Objects */
void ATOMICGUI_DataModel::build()
{
- ATOMICGUI_ModuleObject* modelRoot = dynamic_cast<ATOMICGUI_ModuleObject*>( root() );
+ //VSR: module object should be created in a different way for "full" and "light" SALOME
+ //ATOMICGUI_ModuleObject* modelRoot = dynamic_cast<ATOMICGUI_ModuleObject*>( root() );
+ CAM_ModuleObject* modelRoot = dynamic_cast<CAM_ModuleObject*>( 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<LightApp_Study*>( module()->application()->activeStudy() );
+ modelRoot = createModuleObject( study->root() );
setRoot( modelRoot );
}