]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Connection to SALOME (Issue #31)
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 24 Apr 2014 13:39:17 +0000 (17:39 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 24 Apr 2014 13:39:17 +0000 (17:39 +0400)
src/NewGeom/CMakeLists.txt
src/NewGeom/NewGeom_DataModel.cpp [new file with mode: 0644]
src/NewGeom/NewGeom_DataModel.h [new file with mode: 0644]
src/NewGeom/NewGeom_Module.cpp
src/NewGeom/NewGeom_Module.h

index 4d908a2592240587cc52f810abc1f9bf70310d89..c2c71aae16b469330de7d40ababa167d101129d5 100644 (file)
@@ -6,14 +6,16 @@ SET(CMAKE_AUTOMOC ON)
 SET(PROJECT_HEADERS
        NewGeom.h
        NewGeom_Module.h
+       NewGeom_DataModel.h
 )
 
 SET(PROJECT_AUTOMOC 
-    ${CMAKE_CURRENT_BINARY_DIR}/XGUI_automoc.cpp
+    ${CMAKE_CURRENT_BINARY_DIR}/NewGeom_automoc.cpp
 )
 
 SET(PROJECT_SOURCES
        NewGeom_Module.cpp
+       NewGeom_DataModel.cpp
 )
 
 SET(PROJECT_RESOURCES
diff --git a/src/NewGeom/NewGeom_DataModel.cpp b/src/NewGeom/NewGeom_DataModel.cpp
new file mode 100644 (file)
index 0000000..371fe7a
--- /dev/null
@@ -0,0 +1,52 @@
+
+#include "NewGeom_DataModel.h"
+
+
+NewGeom_DataModel::NewGeom_DataModel( CAM_Module* theModule )
+  : LightApp_DataModel(theModule)
+{
+}
+  
+NewGeom_DataModel::~NewGeom_DataModel()
+{
+}
+
+bool NewGeom_DataModel::open( const QString& thePath, CAM_Study* theStudy, QStringList theFiles )
+{
+  return true;
+}
+
+bool NewGeom_DataModel::save( QStringList& theFiles )
+{
+  return true;
+}
+
+bool NewGeom_DataModel::saveAs( const QString& thePath, CAM_Study* theStudy, QStringList& theFiles )
+{
+  myStudyPath = thePath;
+  return save( theFiles );
+}
+
+bool NewGeom_DataModel::close()
+{
+  return LightApp_DataModel::close();
+}
+
+bool NewGeom_DataModel::create( CAM_Study* theStudy )
+{
+  return true;
+}
+
+bool NewGeom_DataModel::isModified() const
+{
+  return false;
+}
+
+bool NewGeom_DataModel::isSaved() const
+{
+  return true;
+}
+
+void NewGeom_DataModel::update( LightApp_DataObject* theObj, LightApp_Study* theStudy )
+{
+}
diff --git a/src/NewGeom/NewGeom_DataModel.h b/src/NewGeom/NewGeom_DataModel.h
new file mode 100644 (file)
index 0000000..66c6bf8
--- /dev/null
@@ -0,0 +1,32 @@
+
+
+#ifndef NEWGEOM_DATAMODEL_H
+#define NEWGEOM_DATAMODEL_H
+
+#include "NewGeom.h"
+#include <LightApp_DataModel.h>
+
+class NewGeom_EXPORT NewGeom_DataModel : public LightApp_DataModel
+{
+  Q_OBJECT
+public:
+  NewGeom_DataModel( CAM_Module* theModule );
+  virtual ~NewGeom_DataModel();
+
+  virtual bool open( const QString& thePath, CAM_Study* theStudy, QStringList theFiles );
+  virtual bool save( QStringList& theFiles );
+  virtual bool saveAs( const QString& thePath, CAM_Study* theStudy, QStringList& theFiles );
+  virtual bool close();
+  virtual bool create( CAM_Study* theStudy );
+
+  virtual bool isModified() const;
+  virtual bool isSaved() const;
+
+  virtual void update( LightApp_DataObject* theObj = 0, LightApp_Study* theStudy = 0 );
+
+private:
+  QString myStudyPath;
+
+};
+
+#endif
\ No newline at end of file
index 4fe5e15a761b4260d3e1d4c92fa07ebc4fc6011b..e5f2ec1eeb223a42391b41a644be77117bf28988 100644 (file)
@@ -1,11 +1,23 @@
 
 
 #include "NewGeom_Module.h"
+#include "NewGeom_DataModel.h"
 
 #include <LightApp_Application.h>
 #include <OCCViewer_ViewModel.h>
 
 
+extern "C" {
+  NewGeom_EXPORT CAM_Module* createModule() {
+    return new NewGeom_Module();
+  }
+  
+  NewGeom_EXPORT char* getModuleVersion() {
+    return "0.0";
+  }
+}
+
+
 
 NewGeom_Module::NewGeom_Module()
 : LightApp_Module( "NewGeom" )
@@ -19,6 +31,7 @@ NewGeom_Module::~NewGeom_Module()
 
 void NewGeom_Module::initialize(CAM_Application* theApp)
 {
+  LightApp_Module::initialize(theApp);
 }
 
 void NewGeom_Module::windows(QMap<int, int>& theWndMap) const
@@ -41,4 +54,8 @@ bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy)
   return LightApp_Module::deactivateModule(theStudy);
 }
 
+CAM_DataModel* NewGeom_Module::createDataModel()
+{
+  return new NewGeom_DataModel(this);
+}
 
index bd6886e0f5052903f4893f5ff36c57a2727a4811..b18ff6606c7f321ea35efecc3982a82e609ffb31 100644 (file)
@@ -21,6 +21,10 @@ public slots:
   bool activateModule( SUIT_Study* theStudy);
   bool deactivateModule( SUIT_Study* theStudy);
 
+protected:
+  CAM_DataModel* createDataModel();
+
+
 private:
 
 };