Salome HOME
Merge from V6_main_20120808 08Aug12
[samples/light.git] / src / LIGHTGUI / LIGHTGUI_DataModel.cxx
index 73653bac1372f4d56fc00abe6c2cfb12a43421ac..00a812bb843329e8b59bf30d5873fb4523e78819 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2005-2008  OPEN CASCADE
+// Copyright (C) 2005-2012  OPEN CASCADE
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // LIGHT : sample (no-corba-engine) SALOME module
 // File   : LIGHTGUI_DataModel.cxx
 // Author : Julia DOROVSKIKH
@@ -323,7 +324,7 @@ bool LIGHTGUI_DataModel::insertLineBefore( const int id, const QString& txt )
 {
   // Insert new line before the item at position in the list,
   // or at the end() if position is out of range
-  LightApp_ModuleObject* modelRoot = dynamic_cast<LightApp_ModuleObject*>( root() );
+  LightApp_DataObject* modelRoot = dynamic_cast<LightApp_DataObject*>( root() );
   LightApp_Study* study = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy() );
   if ( id > 0 ) {
     if ( !modelRoot )
@@ -382,7 +383,7 @@ bool LIGHTGUI_DataModel::insertLineBefore( const int id, const QString& txt )
 */
 bool LIGHTGUI_DataModel::deleteTextLine( const int id )
 {
-  LightApp_ModuleObject* modelRoot = dynamic_cast<LightApp_ModuleObject*>( root() );
+  LightApp_DataObject* modelRoot = dynamic_cast<LightApp_DataObject*>( root() );
 
   if ( !modelRoot )
     return false;
@@ -498,7 +499,7 @@ void LIGHTGUI_DataModel::buildTree( SUIT_DataObject* studyRoot, const QStringLis
   if ( !studyRoot )
     return;
 
-  LightApp_ModuleObject* modelRoot = new LightApp_ModuleObject( this, studyRoot );
+  CAM_ModuleObject* modelRoot = createModuleObject( studyRoot );
   LIGHTGUI_DataObject* aParaObject;
   LIGHTGUI_DataObject* aLineObject;