]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Migration to VC9 and boost::shared_ptr with connection to SALOME
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 23 Apr 2014 13:27:25 +0000 (17:27 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 23 Apr 2014 13:27:25 +0000 (17:27 +0400)
54 files changed:
CMakeCommon/FindSalome.cmake [new file with mode: 0644]
CMakeLists.txt
build_vc9_Salome_deb.bat [new file with mode: 0644]
msvc10_env.bat
msvc9_env_Salome.bat [new file with mode: 0644]
src/ConstructionPlugin/ConstructionPlugin_Plugin.cxx
src/ConstructionPlugin/ConstructionPlugin_Plugin.h
src/Model/CMakeLists.txt
src/Model/Model_Application.cxx
src/Model/Model_Application.h
src/Model/Model_AttributeDocRef.cxx
src/Model/Model_AttributeDocRef.h
src/Model/Model_Data.cxx
src/Model/Model_Data.h
src/Model/Model_Document.cxx
src/Model/Model_Document.h
src/Model/Model_Events.cxx
src/Model/Model_Events.h
src/Model/Model_Iterator.cxx
src/Model/Model_Iterator.h
src/Model/Model_PluginManager.cxx
src/Model/Model_PluginManager.h
src/ModelAPI/ModelAPI.i
src/ModelAPI/ModelAPI_AttributeDocRef.h
src/ModelAPI/ModelAPI_Data.h
src/ModelAPI/ModelAPI_Document.h
src/ModelAPI/ModelAPI_Feature.h
src/ModelAPI/ModelAPI_Iterator.h
src/ModelAPI/ModelAPI_Plugin.h
src/ModelAPI/ModelAPI_PluginManager.cxx
src/ModelAPI/ModelAPI_PluginManager.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h
src/PartSet/PartSet_OperationSketchBase.cpp
src/PartSetPlugin/PartSetPlugin_Part.cxx
src/PartSetPlugin/PartSetPlugin_Part.h
src/PartSetPlugin/PartSetPlugin_Plugin.cxx
src/PartSetPlugin/PartSetPlugin_Plugin.h
src/SalomeModule/CMakeLists.txt [new file with mode: 0644]
src/SalomeModule/SalomeModule.h [new file with mode: 0644]
src/SalomeModule/SalomeModule_Module.cpp [new file with mode: 0644]
src/SalomeModule/SalomeModule_Module.h [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Plugin.h
src/XGUI/XGUI_Constants.h
src/XGUI/XGUI_DataTreeModel.h
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h
src/XGUI/XGUI_DocumentDataModel.cpp
src/XGUI/XGUI_DocumentDataModel.h
src/XGUI/XGUI_PartDataModel.cpp
src/XGUI/XGUI_PartDataModel.h
src/XGUI/XGUI_SelectionMgr.cpp
src/XGUI/XGUI_Workshop.cpp

diff --git a/CMakeCommon/FindSalome.cmake b/CMakeCommon/FindSalome.cmake
new file mode 100644 (file)
index 0000000..bf82cde
--- /dev/null
@@ -0,0 +1,12 @@
+
+
+SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI directory")
+IF(EXISTS ${GUI_ROOT_DIR})
+       SET(HAVE_SALOME YES)
+  
+       FIND_LIBRARY(LightApp LightApp ${GUI_ROOT_DIR}/lib/salome)
+       FIND_LIBRARY(OCCViewer OCCViewer ${GUI_ROOT_DIR}/lib/salome)
+  
+       SET(SALOME_GUI_INCLUDE ${GUI_ROOT_DIR}/include/salome)
+       ADD_DEFINITIONS( -DHAVE_SALOME )
+ENDIF(EXISTS ${GUI_ROOT_DIR})
index dc4b8fd191e0706ff1d6fbfeffaf69c846558569..2d5d0d479cfaa33d78102ecc817a0255ba96c3d0 100644 (file)
@@ -6,7 +6,9 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
 
 INCLUDE(Common)
 INCLUDE(FindQt)
+INCLUDE(FindBoost)
 INCLUDE(FindPython)
+INCLUDE(FindSalome)
 
 IF(UNIX)
     IF(CMAKE_COMPILER_IS_GNUCC)
@@ -32,3 +34,7 @@ ADD_SUBDIRECTORY (src/PyEvent)
 ADD_SUBDIRECTORY (src/PyInterp)
 ADD_SUBDIRECTORY (src/XGUI)
 ADD_SUBDIRECTORY (src/GeomApp)
+
+#IF(${HAVE_SALOME})
+#      ADD_SUBDIRECTORY (src/SalomeModule)
+#ENDIF(${HAVE_SALOME})
diff --git a/build_vc9_Salome_deb.bat b/build_vc9_Salome_deb.bat
new file mode 100644 (file)
index 0000000..cbf4e49
--- /dev/null
@@ -0,0 +1,19 @@
+@ECHO OFF
+
+REM Find absolute path to ROOT_DIR 
+@SET PARENT_DIR=%~dp0..
+@SET ROOT_DIR=
+pushd %PARENT_DIR%
+@SET ROOT_DIR=%CD%
+popd
+
+@SET SRC_DIR=%ROOT_DIR%\sources
+@SET OCC_LIB_PREFIX=d
+
+call %SRC_DIR%\msvc9_env_Salome.bat
+mkdir %ROOT_DIR%\build
+cd %ROOT_DIR%\build
+
+cmake %SRC_DIR% -G "Visual Studio 9 2008" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+
+start "" %MSVC_EXE% NewGEOM.sln
index ac0173ad4150e08ad1089b103ba366cbe1a7195f..7717e8047d9d515e66827a98b2cb650e8085dc98 100644 (file)
@@ -121,7 +121,6 @@ set PATH=%CMAKEDIR%\bin;%PATH%
 @SET PATH=%PDIR%\swig-2.0.9\bin;%PATH%
 @REM -------------------------
 
-@REM -------------------------
 @REM BOOST
 @SET BOOST_ROOT_DIR=%PDIR%\boost-1.52.0
 @SET PATH=%BOOST_ROOT_DIR%\lib;%PATH%
@@ -130,6 +129,13 @@ set PATH=%CMAKEDIR%\bin;%PATH%
 @SET NEW_GEOM_CONFIG_FILE=%ROOT_DIR%\install\plugins
 @SET PATH=%ROOT_DIR%\install\plugins;%PATH%
 
+@REM -------------------------
+if "%GUI_ROOT_DIR%" == "" (
+  @SET GUI_ROOT_DIR=%ROOT_DIR%\SALOME\GUI\DEBUG\GUI_INSTALL
+)
+@REM -------------------------
+
+
 rem -------- Visual Studio --------------------
 rem Detect Visual Studio (either commercial or Express edition)
 if "%VS100COMNTOOLS%" == "" (
diff --git a/msvc9_env_Salome.bat b/msvc9_env_Salome.bat
new file mode 100644 (file)
index 0000000..44f6dd3
--- /dev/null
@@ -0,0 +1,71 @@
+@echo off
+
+IF NOT EXIST "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" GOTO ERROR1
+
+@REM Load local settings from file localenv.bat that should be located in the root directory
+if "%ROOT_DIR%" == "" (
+  set ROOT_DIR=%~dp0..
+)
+
+if exist "%ROOT_DIR%\localenv.bat" (
+  echo Setting local environment from %ROOT_DIR%\localenv.bat
+  call "%ROOT_DIR%\localenv.bat"
+) else (
+  echo Warning: file %ROOT_DIR%\localenv.bat does not exist; using default environment
+)
+
+if "%SALOME_ROOT_DIR%" == "" (
+  set SALOME_ROOT_DIR=%ROOT_DIR%\SALOME
+)
+
+call "%SALOME_ROOT_DIR%\WORK\set_env.bat"
+call "%PDIR%\env_compile.bat"
+
+@REM -------------------------
+@REM Python
+@SET PYTHON_LIB_DIR=%PYTHON_ROOT_DIR%\libs
+@SET PYTHON_INC_DIR=%PYTHON_ROOT_DIR%\include
+@REM -------------------------
+
+@REM -------------------------
+@REM CASCADE
+@SET PATH=%CASROOT%;%CASROOT%\win32\bin%OCC_LIB_PREFIX%;%PATH%
+@SET LIB=%CASROOT%\win32\lib%OCC_LIB_PREFIX%;%LIB%
+@set CSF_MDTVFontDirectory=%CASROOT%\src\FontMFT
+@set CSF_LANGUAGE=us
+@set MMGT_CLEAR=1
+@set CSF_EXCEPTION_PROMPT=1
+@set CSF_SHMessage=%CASROOT%\src\SHMessage
+@set CSF_MDTVTexturesDirectory=%CASROOT%\src\Textures
+@set CSF_XSMessage=%CASROOT%\src\XSMessage
+@set CSF_StandardDefaults=%CASROOT%\src\StdResource
+@set CSF_PluginDefaults=%CASROOT%\src\StdResource
+@set CSF_XCAFDefaults=%CASROOT%\src\StdResource
+@set CSF_StandardLiteDefaults=%CASROOT%\src\StdResource
+@set CSF_UnitsLexicon=%CASROOT%\src\UnitsAPI\Lexi_Expr.dat
+@set CSF_UnitsDefinition=%CASROOT%\src\UnitsAPI\Units.dat
+@set CSF_IGESDefaults=%CASROOT%\src\XSTEPResource
+@set CSF_STEPDefaults=%CASROOT%\src\XSTEPResource
+@set CSF_XmlOcafResource=%CASROOT%\src\XmlOcafResource
+@REM -------------------------
+
+@REM -------------------------
+@REM Create launch path
+@SET PATH=%LIBXML2_ROOT_DIR%\bin;%PATH%
+@SET PATH=%PDIR%\tbb\bin;%PATH%
+@SET PATH=%PDIR%\freeimage-3.15.4\bin;%PATH%
+@SET PATH=%PDIR%\ftgl-2.1.3\bin;%PATH%
+@SET PATH=%PDIR%\freetype-2.4.11\bin;%PATH%
+@SET PATH=%PDIR%\gl2ps-1.3.8\bin;%PATH%
+@REM -------------------------
+
+IF "%ARCH%" == "Win64" (
+  call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x64
+) ELSE (
+  IF "%ARCH%" == "Win32" (
+    call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x86
+  ) ELSE (
+    echo Wrong architecture is used. Win32 or Win64 architecture is allowed only.
+    echo Refer to the set_env.bat script.
+  )
+)
index c433491f9f5a0e9fffd7b4dd10e94f9636a2f745..5c1f39f2f8de2dfc5bc87f1df52371d2fbb9dff3 100644 (file)
@@ -14,11 +14,11 @@ ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
   ModelAPI_PluginManager::get()->registerPlugin(this);
 }
 
-shared_ptr<ModelAPI_Feature> ConstructionPlugin_Plugin::createFeature(string theFeatureID)
+boost::shared_ptr<ModelAPI_Feature> ConstructionPlugin_Plugin::createFeature(string theFeatureID)
 {
   if (theFeatureID == "Point") {
-    return shared_ptr<ModelAPI_Feature>(new ConstructionPlugin_Point);
+    return boost::shared_ptr<ModelAPI_Feature>(new ConstructionPlugin_Point);
   }
   // feature of such kind is not found
-  return shared_ptr<ModelAPI_Feature>();
+  return boost::shared_ptr<ModelAPI_Feature>();
 }
index 91875f362d130012bd6087e22971f10546f01b42..0201b40a36715f6cc468e03bc2eaed4e7706c1d4 100644 (file)
@@ -13,7 +13,7 @@ class CONSTRUCTIONPLUGIN_EXPORT ConstructionPlugin_Plugin: public ModelAPI_Plugi
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
 
 public:
   /// Is needed for python wrapping by swig
index 1d56def92f083d5a2b9b87a24002378e0e427514..53f1ec956eef3537a14856c1f92268ea24832ef6 100644 (file)
@@ -24,7 +24,7 @@ SET(PROJECT_SOURCES
     Model_Events.cxx
 )
 
-ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
 ADD_LIBRARY(Model SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES} ${CAS_OCAF} ModelAPI Event Config)
 
index 40704967e8de9cef5e8a568dac24330bd0fc5f37..166b4e1a173f3812013eabdce23d4aec14c8f8f2 100644 (file)
@@ -19,12 +19,12 @@ Handle(Model_Application) Model_Application::getApplication()
 }
 
 //=======================================================================
-const std::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
+const boost::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
 {
   if (myDocs.find(theDocID) != myDocs.end())
     return myDocs[theDocID];
 
-  std::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
+  boost::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
   myDocs[theDocID] = aNew;
   return myDocs[theDocID];
 }
index 3865434796cad755f7869adb96677e18fb41d2f4..ddd3155bd0ed9e599b34ebca545df95da6eca10c 100644 (file)
@@ -30,7 +30,7 @@ public:
   //! Retuns the application: one per process    
   MODEL_EXPORT static Handle_Model_Application getApplication();
   //! Returns the main document (on first call creates it) by the string identifier
-  MODEL_EXPORT const std::shared_ptr<Model_Document>& getDocument(std::string theDocID);
+  MODEL_EXPORT const boost::shared_ptr<Model_Document>& getDocument(std::string theDocID);
   //! Returns true if document has been created
   MODEL_EXPORT bool hasDocument(std::string theDocID);
   //! Deletes the document from the application
@@ -50,7 +50,7 @@ public:
 
 private:
   /// Map from string identifiers to created documents of an application
-  std::map<std::string, std::shared_ptr<Model_Document> > myDocs;
+  std::map<std::string, boost::shared_ptr<Model_Document> > myDocs;
 };
 
 #endif
index 07712d0b6a568a12559ac8bd058abfd3680f3c4a..9df9c22190611371b1cd80357fc9de7b3de3fa14 100644 (file)
@@ -7,18 +7,18 @@
 
 using namespace std;
 
-void Model_AttributeDocRef::setValue(std::shared_ptr<ModelAPI_Document> theDoc)
+void Model_AttributeDocRef::setValue(boost::shared_ptr<ModelAPI_Document> theDoc)
 {
   myComment->Set(TCollection_ExtendedString(theDoc->id().c_str()));
 }
 
-std::shared_ptr<ModelAPI_Document> Model_AttributeDocRef::value()
+boost::shared_ptr<ModelAPI_Document> Model_AttributeDocRef::value()
 {
   if (myComment->Get().Length())
     return Model_Application::getApplication()->getDocument(
       TCollection_AsciiString(myComment->Get()).ToCString());
   // not initialized
-  return std::shared_ptr<ModelAPI_Document>();
+  return boost::shared_ptr<ModelAPI_Document>();
 }
 
 Model_AttributeDocRef::Model_AttributeDocRef(TDF_Label& theLabel)
index 778ed316bd0eceda4ef02932193287ca0b35bfb6..f3a3fcf899110239e308ce23c33abdb2098d7bc9 100644 (file)
@@ -20,10 +20,10 @@ class Model_AttributeDocRef : public ModelAPI_AttributeDocRef
   Handle_TDataStd_Comment myComment; ///< reference to document is identified as string-id
 public:
   /// Defines the document referenced from this attribute
-  MODEL_EXPORT virtual void setValue(std::shared_ptr<ModelAPI_Document> theDoc);
+  MODEL_EXPORT virtual void setValue(boost::shared_ptr<ModelAPI_Document> theDoc);
 
   /// Returns document referenced from this attribute
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> value();
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> value();
 
 protected:
   /// Initializes attibutes
index a9ac29bf05dc6d9303df6c33972a99b63a89fb58..87c7be8672fda2dfa7b0a6b7c95ad461598d2bbc 100644 (file)
@@ -41,35 +41,35 @@ void Model_Data::addAttribute(string theID, string theAttrType)
     anAttr = new Model_AttributeDouble(anAttrLab);
 
   if (anAttr)
-    myAttrs[theID] = std::shared_ptr<ModelAPI_Attribute>(anAttr);
+    myAttrs[theID] = boost::shared_ptr<ModelAPI_Attribute>(anAttr);
   else
     ; // TODO: generate error on unknown attribute request and/or add mechanism for customization
 }
 
-shared_ptr<ModelAPI_AttributeDocRef> Model_Data::docRef(const string theID)
+boost::shared_ptr<ModelAPI_AttributeDocRef> Model_Data::docRef(const string theID)
 {
-  map<string, shared_ptr<ModelAPI_Attribute> >::iterator aFound = myAttrs.find(theID);
+  map<string, boost::shared_ptr<ModelAPI_Attribute> >::iterator aFound = myAttrs.find(theID);
   if (aFound == myAttrs.end()) {
     // TODO: generate error on unknown attribute request and/or add mechanism for customization
-    return std::shared_ptr<ModelAPI_AttributeDocRef>();
+    return boost::shared_ptr<ModelAPI_AttributeDocRef>();
   }
-  shared_ptr<ModelAPI_AttributeDocRef> aRes = 
-    dynamic_pointer_cast<ModelAPI_AttributeDocRef>(aFound->second);
+  boost::shared_ptr<ModelAPI_AttributeDocRef> aRes = 
+    boost::dynamic_pointer_cast<ModelAPI_AttributeDocRef>(aFound->second);
   if (!aRes) {
     // TODO: generate error on invalid attribute type request
   }
   return aRes;
 }
 
-shared_ptr<ModelAPI_AttributeDouble> Model_Data::real(const string theID)
+boost::shared_ptr<ModelAPI_AttributeDouble> Model_Data::real(const string theID)
 {
-  map<string, shared_ptr<ModelAPI_Attribute> >::iterator aFound = myAttrs.find(theID);
+  map<string, boost::shared_ptr<ModelAPI_Attribute> >::iterator aFound = myAttrs.find(theID);
   if (aFound == myAttrs.end()) {
     // TODO: generate error on unknown attribute request and/or add mechanism for customization
-    return std::shared_ptr<ModelAPI_AttributeDouble>();
+    return boost::shared_ptr<ModelAPI_AttributeDouble>();
   }
-  shared_ptr<ModelAPI_AttributeDouble> aRes = 
-    dynamic_pointer_cast<ModelAPI_AttributeDouble>(aFound->second);
+  boost::shared_ptr<ModelAPI_AttributeDouble> aRes = 
+    boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(aFound->second);
   if (!aRes) {
     // TODO: generate error on invalid attribute type request
   }
index d33819a8fb50ba6d8038e4ba6667b07e140440c1..5c3ffdf2ff66eb6105c92c829070792870712c36 100644 (file)
@@ -23,9 +23,9 @@ class Model_Data: public ModelAPI_Data
 {
   TDF_Label myLab; ///< label of the feature in the document
   /// All attributes of the object identified by the attribute ID
-  std::map<std::string, std::shared_ptr<ModelAPI_Attribute> > myAttrs;
+  std::map<std::string, boost::shared_ptr<ModelAPI_Attribute> > myAttrs;
 
-  std::shared_ptr<ModelAPI_Document> myDoc; ///< document this feature belongs to
+  boost::shared_ptr<ModelAPI_Document> myDoc; ///< document this feature belongs to
 
   Model_Data();
 
@@ -40,9 +40,9 @@ public:
   /// Defines the name of the feature visible by the user in the object browser
   MODEL_EXPORT virtual void setName(std::string theName);
   /// Returns the attribute that references to another document
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID);
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID);
   /// Returns the attribute that contains real value with double precision
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID);
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID);
 
   /// Initializes object by the attributes: must be called just after the object is created
   /// for each attribute of the object
@@ -51,13 +51,13 @@ public:
   MODEL_EXPORT virtual void addAttribute(std::string theID, std::string theAttrType);
 
   /// Returns the document of this data
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> document() {return myDoc;}
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> document() {return myDoc;}
 
   /// Puts feature to the document data sub-structure
   MODEL_EXPORT void setLabel(TDF_Label& theLab);
 
   /// Sets the document of this data
-  MODEL_EXPORT virtual void setDocument(const std::shared_ptr<ModelAPI_Document>& theDoc) {myDoc = theDoc;}
+  MODEL_EXPORT virtual void setDocument(const boost::shared_ptr<ModelAPI_Document>& theDoc) {myDoc = theDoc;}
 };
 
 #endif
index 22641f4b3d7665376060fb4f3221448119503efd..c022362e82d372f38824e1f6b4d6a26724fad4ee 100644 (file)
@@ -206,25 +206,25 @@ void Model_Document::redo()
     subDocument(*aSubIter)->redo();
 }
 
-shared_ptr<ModelAPI_Feature> Model_Document::addFeature(string theID)
+boost::shared_ptr<ModelAPI_Feature> Model_Document::addFeature(string theID)
 {
-  shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_PluginManager::get()->createFeature(theID);
+  boost::shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_PluginManager::get()->createFeature(theID);
   if (aFeature) {
-    dynamic_pointer_cast<Model_Document>(aFeature->documentToAdd())->addFeature(aFeature);
+    boost::dynamic_pointer_cast<Model_Document>(aFeature->documentToAdd())->addFeature(aFeature);
   } else {
     // TODO: generate error that feature is not created
   }
   return aFeature;
 }
 
-void Model_Document::addFeature(const std::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_Document::addFeature(const boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   const std::string& aGroup = theFeature->getGroup();
   TDF_Label aGroupLab = groupLabel(aGroup);
   TDF_Label anObjLab = aGroupLab.NewChild();
-  std::shared_ptr<Model_Data> aData(new Model_Data);
+  boost::shared_ptr<Model_Data> aData(new Model_Data);
   aData->setLabel(anObjLab);
-  shared_ptr<ModelAPI_Document> aThis = Model_Application::getApplication()->getDocument(myID);
+  boost::shared_ptr<ModelAPI_Document> aThis = Model_Application::getApplication()->getDocument(myID);
   aData->setDocument(aThis);
   theFeature->setData(aData);
   setUniqueName(theFeature);
@@ -241,7 +241,7 @@ void Model_Document::addFeature(const std::shared_ptr<ModelAPI_Feature> theFeatu
   Event_Loop::loop()->send(aMsg);
 }
 
-shared_ptr<ModelAPI_Feature> Model_Document::feature(TDF_Label& theLabel)
+boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(TDF_Label& theLabel)
 {
   Handle(TDataStd_Integer) aFeatureIndex;
   if (theLabel.FindAttribute(TDataStd_Integer::GetID(), aFeatureIndex)) {
@@ -251,15 +251,15 @@ shared_ptr<ModelAPI_Feature> Model_Document::feature(TDF_Label& theLabel)
       return myFeatures[aGroup][aFeatureIndex->Get()];
     }
   }
-  return std::shared_ptr<ModelAPI_Feature>(); // not found
+  return boost::shared_ptr<ModelAPI_Feature>(); // not found
 }
 
-int Model_Document::featureIndex(shared_ptr<ModelAPI_Feature> theFeature)
+int Model_Document::featureIndex(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   if (theFeature->data()->document().get() != this) {
     return theFeature->data()->document()->featureIndex(theFeature);
   }
-  shared_ptr<Model_Data> aData = dynamic_pointer_cast<Model_Data>(theFeature->data());
+  boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>(theFeature->data());
   Handle(TDataStd_Integer) aFeatureIndex;
   if (aData->label().FindAttribute(TDataStd_Integer::GetID(), aFeatureIndex)) {
     return aFeatureIndex->Get();
@@ -267,7 +267,7 @@ int Model_Document::featureIndex(shared_ptr<ModelAPI_Feature> theFeature)
   return -1; // not found
 }
 
-shared_ptr<ModelAPI_Document> Model_Document::subDocument(string theDocID)
+boost::shared_ptr<ModelAPI_Document> Model_Document::subDocument(string theDocID)
 {
   // just store sub-document identifier here to manage it later
   if (mySubs.find(theDocID) == mySubs.end())
@@ -275,22 +275,22 @@ shared_ptr<ModelAPI_Document> Model_Document::subDocument(string theDocID)
   return Model_Application::getApplication()->getDocument(theDocID);
 }
 
-shared_ptr<ModelAPI_Iterator> Model_Document::featuresIterator(const string theGroup)
+boost::shared_ptr<ModelAPI_Iterator> Model_Document::featuresIterator(const string theGroup)
 {
-  shared_ptr<Model_Document> aThis(Model_Application::getApplication()->getDocument(myID));
+  boost::shared_ptr<Model_Document> aThis(Model_Application::getApplication()->getDocument(myID));
   // create an empty iterator for not existing group 
   // (to avoidance of attributes management outside the transaction)
   if (myGroups.find(theGroup) == myGroups.end())
-    return shared_ptr<ModelAPI_Iterator>(new Model_Iterator());
-  return shared_ptr<ModelAPI_Iterator>(new Model_Iterator(aThis, groupLabel(theGroup)));
+    return boost::shared_ptr<ModelAPI_Iterator>(new Model_Iterator());
+  return boost::shared_ptr<ModelAPI_Iterator>(new Model_Iterator(aThis, groupLabel(theGroup)));
 }
 
-shared_ptr<ModelAPI_Feature> Model_Document::feature(const string& theGroupID, const int theIndex)
+boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(const string& theGroupID, const int theIndex)
 {
   // TODO: optimize this method
-  shared_ptr<ModelAPI_Iterator>  anIter = featuresIterator(theGroupID);
+  boost::shared_ptr<ModelAPI_Iterator>  anIter = featuresIterator(theGroupID);
   for(int a = 0; a != theIndex && anIter->more(); anIter->next()) a++;
-  return anIter->more() ? anIter->current() : shared_ptr<ModelAPI_Feature>();
+  return anIter->more() ? anIter->current() : boost::shared_ptr<ModelAPI_Feature>();
 }
 
 const vector<string>& Model_Document::getGroups() const
@@ -317,17 +317,16 @@ TDF_Label Model_Document::groupLabel(const string theGroup)
     myGroupsNames.push_back(theGroup);
     // set to the group label the group idntifier to restore on "open"
     TDataStd_Comment::Set(myGroups[theGroup], theGroup.c_str());
-    myFeatures[theGroup] = vector<shared_ptr<ModelAPI_Feature> >();
+    myFeatures[theGroup] = vector<boost::shared_ptr<ModelAPI_Feature> >();
   }
   return myGroups[theGroup];
 }
 
-void Model_Document::setUniqueName(
-  shared_ptr<ModelAPI_Feature> theFeature)
+void Model_Document::setUniqueName(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   // first count all objects of such kind to start with index = count + 1
   int aNumObjects = 0;
-  shared_ptr<ModelAPI_Iterator> anIter = featuresIterator(theFeature->getGroup());
+  boost::shared_ptr<ModelAPI_Iterator> anIter = featuresIterator(theFeature->getGroup());
   for(; anIter->more(); anIter->next()) {
     if (anIter->currentKind() == theFeature->getKind())
       aNumObjects++;
@@ -352,7 +351,7 @@ void Model_Document::setUniqueName(
 
 void Model_Document::synchronizeFeatures()
 {
-  shared_ptr<ModelAPI_Document> aThis = Model_Application::getApplication()->getDocument(myID);
+  boost::shared_ptr<ModelAPI_Document> aThis = Model_Application::getApplication()->getDocument(myID);
   // iterate groups labels
   TDF_ChildIDIterator aGroupsIter(myDoc->Main().FindChild(TAG_OBJECTS),
     TDataStd_Comment::GetID(), Standard_False);
@@ -380,7 +379,7 @@ void Model_Document::synchronizeFeatures()
       aGroupsIter.Value())->Get()).ToCString();
     myGroupsNames.push_back(aGroupName);
     myGroups[aGroupName] = aGroupsIter.Value()->Label();
-    myFeatures[aGroupName] = vector<shared_ptr<ModelAPI_Feature> >();
+    myFeatures[aGroupName] = vector<boost::shared_ptr<ModelAPI_Feature> >();
   }
   // update features group by group
   aGroupsIter.Initialize(myDoc->Main().FindChild(TAG_OBJECTS),
@@ -389,8 +388,8 @@ void Model_Document::synchronizeFeatures()
     string aGroupName = TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(
       aGroupsIter.Value())->Get()).ToCString();
     // iterate features in internal container
-    vector<shared_ptr<ModelAPI_Feature> >& aFeatures = myFeatures[aGroupName];
-    vector<shared_ptr<ModelAPI_Feature> >::iterator aFIter = aFeatures.begin();
+    vector<boost::shared_ptr<ModelAPI_Feature> >& aFeatures = myFeatures[aGroupName];
+    vector<boost::shared_ptr<ModelAPI_Feature> >::iterator aFIter = aFeatures.begin();
     // and in parallel iterate labels of features
     TDF_ChildIDIterator aFLabIter(
       aGroupsIter.Value()->Label(), TDataStd_Comment::GetID(), Standard_False);
@@ -398,7 +397,7 @@ void Model_Document::synchronizeFeatures()
       static const int INFINITE_TAG = INT_MAX; // no label means that it exists somwhere in infinite
       int aFeatureTag = INFINITE_TAG; 
       if (aFIter != aFeatures.end()) { // existing tag for feature
-        shared_ptr<Model_Data> aData = dynamic_pointer_cast<Model_Data>((*aFIter)->data());
+        boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>((*aFIter)->data());
         aFeatureTag = aData->label().Tag();
       }
       int aDSTag = INFINITE_TAG; 
@@ -412,11 +411,11 @@ void Model_Document::synchronizeFeatures()
         Event_Loop::loop()->send(aMsg);
       } else if (aDSTag < aFeatureTag) { // a new feature is inserted
         // create a feature
-        shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_PluginManager::get()->createFeature(
+        boost::shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_PluginManager::get()->createFeature(
           TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(
           aFLabIter.Value())->Get()).ToCString());
 
-        std::shared_ptr<Model_Data> aData(new Model_Data);
+        boost::shared_ptr<Model_Data> aData(new Model_Data);
         TDF_Label aLab = aFLabIter.Value()->Label();
         aData->setLabel(aLab);
         aData->setDocument(Model_Application::getApplication()->getDocument(myID));
index 3b2477c32a4f0d5ec5237f89cf0a73f84ed6de61..f98788c5ec8c3f802a5bde4228a8350ad7712c68 100644 (file)
@@ -61,23 +61,23 @@ public:
 
   //! Adds to the document the new feature of the given feature id
   //! \param creates feature and puts it in the document
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
 
   //! Returns the existing feature by the label
   //! \param theLabel base label of the feature
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> feature(TDF_Label& theLabel);
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> feature(TDF_Label& theLabel);
 
   //! Adds a new sub-document by the identifier, or returns existing one if it is already exist
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID);
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID);
 
   //! Creates an iterator of the features by the specific groups
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Iterator> featuresIterator(
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Iterator> featuresIterator(
     const std::string theGroup);
 
   MODEL_EXPORT virtual const std::string& id() const {return myID;}
 
   //! Returns the feature in the group by the index (started from zero)
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> 
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> 
     feature(const std::string& theGroupID, const int theIndex);
 
   ///! Returns the vector of groups already added to the document
@@ -85,7 +85,7 @@ public:
 
   //! Returns the index of feature in the group (zero based)
   //! \retruns -1 if not found
-  MODEL_EXPORT virtual int featureIndex(std::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual int featureIndex(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
 protected:
 
@@ -94,10 +94,10 @@ protected:
 
   //! Initializes feature with a unique name in this group (unique name is generated as 
   //! feature type + "_" + index
-  void setUniqueName(std::shared_ptr<ModelAPI_Feature> theFeature);
+  void setUniqueName(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
   //! Adds to the document the new feature
-  void addFeature(const std::shared_ptr<ModelAPI_Feature> theFeature);
+  void addFeature(const boost::shared_ptr<ModelAPI_Feature> theFeature);
 
   //! Synchronizes myGroups, myGroupsNames, myFeatures and mySubs list with the updated document
   void synchronizeFeatures();
@@ -116,7 +116,7 @@ private:
   std::map<std::string, TDF_Label> myGroups;
   std::vector<std::string> myGroupsNames; ///< names of added groups to the document
   /// Features managed by this document: by group name
-  std::map<std::string, std::vector<std::shared_ptr<ModelAPI_Feature> > > myFeatures;
+  std::map<std::string, std::vector<boost::shared_ptr<ModelAPI_Feature> > > myFeatures;
   std::set<std::string> mySubs; ///< set of identifiers of sub-documents of this document
   /// transaction indexes (related to myTransactionsAfterSave) which were empty in this doc
   std::map<int, bool> myIsEmptyTr;
index dc35573ebae8a405ab2eab7f77800ebcdb2d41f0..a83e9cabd738ea63e2a1a3728e01c432ee44c6f0 100644 (file)
@@ -6,13 +6,13 @@
 #include <Event_Loop.h>
 
 ModelAPI_FeatureUpdatedMessage::ModelAPI_FeatureUpdatedMessage(
-  const std::shared_ptr<ModelAPI_Document>& theDoc,
-  const std::shared_ptr<ModelAPI_Feature>& theFeature, const Event_ID& theEvent)
+  const boost::shared_ptr<ModelAPI_Document>& theDoc,
+  const boost::shared_ptr<ModelAPI_Feature>& theFeature, const Event_ID& theEvent)
   : Event_Message(theEvent, 0), myFeature(theFeature), myDoc(theDoc)
 {}
 
 ModelAPI_FeatureDeletedMessage::ModelAPI_FeatureDeletedMessage(
-  const std::shared_ptr<ModelAPI_Document>& theDoc, const std::string& theGroup)
+  const boost::shared_ptr<ModelAPI_Document>& theDoc, const std::string& theGroup)
   : Event_Message(messageId(), 0), myDoc(theDoc), myGroup(theGroup)
 
 {
index c4af9f5279248d6423bec10de83b7d63eb638cfc..81828bf308e78d252ad75045d4433a711f02ab3a 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <Model.h>
 #include <Event_Message.h>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 #include <string>
 
 class ModelAPI_Feature;
@@ -22,35 +22,35 @@ static const char * EVENT_FEATURE_DELETED = "FeatureDeleted";
 
 /// Message that feature was changed (used for Object Browser update)
 class ModelAPI_FeatureUpdatedMessage : public Event_Message {
-  std::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
-  std::shared_ptr<ModelAPI_Feature> myFeature; ///< which feature is changed
+  boost::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
+  boost::shared_ptr<ModelAPI_Feature> myFeature; ///< which feature is changed
 public:
   /// sender is not important, all information is located in the feature
   ModelAPI_FeatureUpdatedMessage(
-    const std::shared_ptr<ModelAPI_Document>& theDoc,
-    const std::shared_ptr<ModelAPI_Feature>& theFeature,
+    const boost::shared_ptr<ModelAPI_Document>& theDoc,
+    const boost::shared_ptr<ModelAPI_Feature>& theFeature,
     const Event_ID& theEvent);
 
   /// Returns the feature that has been updated
-  std::shared_ptr<ModelAPI_Feature> feature() const {return myFeature;}
+  boost::shared_ptr<ModelAPI_Feature> feature() const {return myFeature;}
   /// Returns the document that has been updated
-  std::shared_ptr<ModelAPI_Document> document() const {return myDoc;}
+  boost::shared_ptr<ModelAPI_Document> document() const {return myDoc;}
 };
 
 /// Message that feature was deleted (used for Object Browser update)
 class ModelAPI_FeatureDeletedMessage : public Event_Message {
-  std::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
+  boost::shared_ptr<ModelAPI_Document> myDoc; ///< document owner of the feature
   std::string myGroup; ///< group identifier that contained the deleted feature
 public:
   /// creates a message by initialization of fields
-  ModelAPI_FeatureDeletedMessage(const std::shared_ptr<ModelAPI_Document>& theDoc,
+  ModelAPI_FeatureDeletedMessage(const boost::shared_ptr<ModelAPI_Document>& theDoc,
     const std::string& theGroup);
 
   /// Returns the ID of this message (EVENT_FEATURE_DELETED)
   static const Event_ID messageId();
 
   /// Returns the feature that has been updated
-  std::shared_ptr<ModelAPI_Document> document() const {return myDoc;}
+  boost::shared_ptr<ModelAPI_Document> document() const {return myDoc;}
 
   /// Returns the group where the feature was deleted
   const std::string& group() const {return myGroup;}
index 001ebdff8146c3d2bab6e71cc80cbca487696fa2..ba59cdf75aadf63089514734eff3f0b5b9744928 100644 (file)
@@ -21,7 +21,7 @@ bool Model_Iterator::more()
   return myIter.More() == Standard_True;
 }
 
-shared_ptr<ModelAPI_Feature> Model_Iterator::current()
+boost::shared_ptr<ModelAPI_Feature> Model_Iterator::current()
 {
   TDF_Label aLab = myIter.Value()->Label();
   return myDoc->feature(aLab);
@@ -51,10 +51,10 @@ int Model_Iterator::numIterationsLeft()
   return aResult;
 }
 
-bool Model_Iterator::isEqual(std::shared_ptr<ModelAPI_Feature> theFeature)
+bool Model_Iterator::isEqual(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   return (myIter.Value()->Label() == 
-    dynamic_pointer_cast<Model_Data>(theFeature->data())->label()) == Standard_True;
+    boost::dynamic_pointer_cast<Model_Data>(theFeature->data())->label()) == Standard_True;
 
 }
 
@@ -62,6 +62,6 @@ Model_Iterator::Model_Iterator()
 {
 }
 
-Model_Iterator::Model_Iterator(std::shared_ptr<Model_Document> theDoc, TDF_Label theLab)
+Model_Iterator::Model_Iterator(boost::shared_ptr<Model_Document> theDoc, TDF_Label theLab)
   : myDoc(theDoc), myIter(theLab, TDataStd_Comment::GetID(), Standard_False)
 {}
index 5d8c61baec0c7a8fbb413d1e6a414c04da3d0ecb..ff116605dee753c35d7c888e62b87cad63ab066b 100644 (file)
@@ -20,7 +20,7 @@ class Model_Document;
 
 class Model_Iterator : public ModelAPI_Iterator
 {
-  std::shared_ptr<Model_Document> myDoc; ///< the document of iterated objects
+  boost::shared_ptr<Model_Document> myDoc; ///< the document of iterated objects
   TDF_ChildIDIterator myIter; ///< iterator of the features-labels
 public:
   /// Iterates to the next feature
@@ -28,7 +28,7 @@ public:
   /// Returns true if the current iteration is valid and next iteration is possible
   MODEL_EXPORT virtual bool more();
   /// Returns the currently iterated feature
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> current();
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> current();
   /// Returns the kind of the current feature (faster than Current()->getKind())
   MODEL_EXPORT virtual std::string currentKind();
   /// Returns the name of the current feature (faster than Current()->getName())
@@ -39,7 +39,7 @@ public:
 
   /// Compares the current feature with the given one
   /// \returns true if given feature equals to the current one
-  MODEL_EXPORT virtual bool isEqual(std::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual bool isEqual(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
 protected:
   /// Creates an empty iterator that alway returns More false
@@ -47,7 +47,7 @@ protected:
   /// Initializes iterator
   /// \param theDoc document where the iteration is performed
   /// \param theLab label of the features group to iterate
-  Model_Iterator(std::shared_ptr<Model_Document> theDoc, TDF_Label theLab);
+  Model_Iterator(boost::shared_ptr<Model_Document> theDoc, TDF_Label theLab);
 
   friend class Model_Document;
 };
index eb279208afff32ba365016d136eac30c71cb7297..435ba3f50bb0124d7d2e25dce7d8ddc048cc4aa7 100644 (file)
@@ -16,7 +16,7 @@ using namespace std;
 
 static Model_PluginManager* myImpl = new Model_PluginManager();
 
-shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string theFeatureID)
+boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string theFeatureID)
 {
   if (this != myImpl) return myImpl->createFeature(theFeatureID);
 
@@ -28,18 +28,18 @@ shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string theFeatur
       loadLibrary(myCurrentPluginName);
     }
     if (myPluginObjs.find(myCurrentPluginName) != myPluginObjs.end()) {
-      std::shared_ptr<ModelAPI_Feature> aCreated = 
+      boost::shared_ptr<ModelAPI_Feature> aCreated = 
         myPluginObjs[myCurrentPluginName]->createFeature(theFeatureID);
       return aCreated;
     }
   }
 
-  return std::shared_ptr<ModelAPI_Feature>(); // return nothing
+  return boost::shared_ptr<ModelAPI_Feature>(); // return nothing
 }
 
-std::shared_ptr<ModelAPI_Document> Model_PluginManager::rootDocument()
+boost::shared_ptr<ModelAPI_Document> Model_PluginManager::rootDocument()
 {
-  return std::shared_ptr<ModelAPI_Document>(
+  return boost::shared_ptr<ModelAPI_Document>(
     Model_Application::getApplication()->getDocument("root"));
 }
 
@@ -48,14 +48,14 @@ bool Model_PluginManager::hasRootDocument()
   return Model_Application::getApplication()->hasDocument("root");
 }
 
-shared_ptr<ModelAPI_Document> Model_PluginManager::currentDocument()
+boost::shared_ptr<ModelAPI_Document> Model_PluginManager::currentDocument()
 {
   if (!myCurrentDoc)
     myCurrentDoc = rootDocument();
   return myCurrentDoc;
 }
 
-void Model_PluginManager::setCurrentDocument(shared_ptr<ModelAPI_Document> theDoc)
+void Model_PluginManager::setCurrentDocument(boost::shared_ptr<ModelAPI_Document> theDoc)
 {
   myCurrentDoc = theDoc;
 }
@@ -66,7 +66,7 @@ Model_PluginManager::Model_PluginManager()
   //TODO(sbh): Implement static method to extract event id [SEID]
   static Event_ID aFeatureEvent = Event_Loop::eventByName("FeatureRegisterEvent");
 
-  ModelAPI_PluginManager::SetPluginManager(std::shared_ptr<ModelAPI_PluginManager>(this));
+  ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager>(this));
   // register the configuration reading listener
   Event_Loop* aLoop = Event_Loop::loop();
   aLoop->registerListener(this, aFeatureEvent);
index 8fc49bdf2c6e9ccb84c136360b34c33a91bd933b..018f705b1451ea409efcef61abd9b94491bddab3 100644 (file)
@@ -25,19 +25,19 @@ class Model_PluginManager : public ModelAPI_PluginManager, public Event_Listener
   std::map<std::string, std::string> myPlugins;
   std::map<std::string, ModelAPI_Plugin*> myPluginObjs; ///< instances of the already plugins
   std::string myCurrentPluginName; ///< name of the plugin that must be loaded currently
-  std::shared_ptr<ModelAPI_Document> myCurrentDoc; ///< current working document
+  boost::shared_ptr<ModelAPI_Document> myCurrentDoc; ///< current working document
 public:
   /// Returns the root document of the application (that may contains sub-documents)
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> rootDocument();
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> rootDocument();
 
   /// Return true if root document has been already created
   MODEL_EXPORT virtual bool hasRootDocument();
 
   /// Returns the current document that used for current work in the application
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> currentDocument();
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> currentDocument();
 
   /// Defines the current document that used for current work in the application
-  MODEL_EXPORT virtual void setCurrentDocument(std::shared_ptr<ModelAPI_Document> theDoc);
+  MODEL_EXPORT virtual void setCurrentDocument(boost::shared_ptr<ModelAPI_Document> theDoc);
 
   /// Registers the plugin that creates features.
   /// It is obligatory for each plugin to call this function on loading to be found by 
@@ -55,7 +55,7 @@ protected:
   void LoadPluginsInfo();
 
   /// Creates the feature object using plugins functionality
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
 };
 
 #endif
index c0bcc3221d3c186a51164f82070c41ebce399ece..19be24d4d21dd4e5ba1798ebf2b8178892fabdbc 100644 (file)
 // standard definitions
 %include "typemaps.i"
 %include "std_string.i"
-%include <std_shared_ptr.i>
+//%include <std_shared_ptr.i>
 
 // boost pointers
-// %include <boost_shared_ptr.i>
+%include <boost_shared_ptr.i>
 %shared_ptr(ModelAPI_Document)
 %shared_ptr(ModelAPI_PluginManager)
 %shared_ptr(ModelAPI_Feature)
index 9b0a6c2956a592f7d0c321d0a9ee5ae87dd6aa0f..473db7a44782e1784f28eb575a964bd61a2837e5 100644 (file)
@@ -17,10 +17,10 @@ class MODELAPI_EXPORT ModelAPI_AttributeDocRef : public ModelAPI_Attribute
 {
 public:
   /// Defines the document referenced from this attribute
-  virtual void setValue(std::shared_ptr<ModelAPI_Document> theDoc) = 0;
+  virtual void setValue(boost::shared_ptr<ModelAPI_Document> theDoc) = 0;
 
   /// Returns document referenced from this attribute
-  virtual std::shared_ptr<ModelAPI_Document> value() = 0;
+  virtual boost::shared_ptr<ModelAPI_Document> value() = 0;
 
   /// Returns the type of this class of attributes
   static std::string type() {return "DocRef";}
index c8f006ea5a8a7258049dbe032119832a24bbe238..73fe3d7ded337819b4e5ca8dbfbb7aa69755ac32 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "ModelAPI.h"
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class ModelAPI_AttributeDocRef;
 class ModelAPI_AttributeDouble;
@@ -30,9 +30,9 @@ public:
   virtual void setName(std::string theName) = 0;
 
   /// Returns the attribute that references to another document
-  virtual std::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID) = 0;
+  virtual boost::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID) = 0;
   /// Returns the attribute that contains real value with double precision
-  virtual std::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID) = 0;
+  virtual boost::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID) = 0;
 
   /// Initializes object by the attributes: must be called just after the object is created
   /// for each attribute of the object
@@ -41,7 +41,7 @@ public:
   virtual void addAttribute(std::string theID, std::string theAttrType) = 0;
 
   /// Returns the document of this data
-  virtual std::shared_ptr<ModelAPI_Document> document() = 0;
+  virtual boost::shared_ptr<ModelAPI_Document> document() = 0;
 
   /// To virtually destroy the fields of successors
   virtual ~ModelAPI_Data() {}
index 378915c639ee65d153e5b4ea76235348def95b70..efc85b2756a317c37849e096aa522b286b0749a2 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <ModelAPI.h>
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 #include <vector>
 
 class ModelAPI_Feature;
@@ -68,24 +68,24 @@ public:
 
   //! Adds to the document the new feature of the given feature id
   //! \param creates feature and puts it in the document
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
+  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
 
   ///! Adds a new sub-document by the identifier, or returns existing one if it is already exist
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID) = 0;
+  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID) = 0;
 
   ///! Creates an iterator of the features by the specific groups
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Iterator> featuresIterator(
+  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Iterator> featuresIterator(
     const std::string theGroup) = 0;
 
   ///! Returns the id of hte document
   MODELAPI_EXPORT virtual const std::string& id() const = 0;
 
   //! Returns the feature in the group by the index (started from zero)
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Feature> 
+  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> 
     feature(const std::string& theGroupID, const int theIndex) = 0;
 
   //! Returns the index of feature in the group (zero based)
-  MODELAPI_EXPORT virtual int featureIndex(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  MODELAPI_EXPORT virtual int featureIndex(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
 
   ///! Returns the vector of groups already added to the document
   MODELAPI_EXPORT virtual const std::vector<std::string>& getGroups() const = 0;
index 7cb9256a08874c3c8e609625020ba2c5bcec78b3..8c1a82e75e2a3a22380065e42dab13463cba0662 100644 (file)
@@ -9,7 +9,7 @@
 #include "ModelAPI_PluginManager.h"
 
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class ModelAPI_Data;
 class ModelAPI_Document;
@@ -21,7 +21,7 @@ class ModelAPI_Document;
  */
 class ModelAPI_Feature
 {
-  std::shared_ptr<ModelAPI_Data> myData; ///< manager of the data model of a feature
+  boost::shared_ptr<ModelAPI_Data> myData; ///< manager of the data model of a feature
 
 public:
   /// Returns the kind of a feature (like "Point")
@@ -37,11 +37,11 @@ public:
   MODELAPI_EXPORT virtual void execute() = 0;
 
   /// Returns the data manager of this feature
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Data> data() {return myData;}
+  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Data> data() {return myData;}
 
   /// Must return document where the new feature must be added to
   /// By default it is current document
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> documentToAdd()
+  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Document> documentToAdd()
   {return ModelAPI_PluginManager::get()->currentDocument();}
 
   /// To virtually destroy the fields of successors
@@ -54,7 +54,7 @@ protected:
   {}
 
   /// Sets the data manager of an object (document does)
-  MODELAPI_EXPORT void setData(std::shared_ptr<ModelAPI_Data> theData) {myData = theData;}
+  MODELAPI_EXPORT void setData(boost::shared_ptr<ModelAPI_Data> theData) {myData = theData;}
   friend class Model_Document;
 };
 
index 8a128a59db5bc1e19536f06873aef01cd5ffada1..db4a5d1195cf037501cf87cb9381ae3a7e091e51 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "ModelAPI.h"
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class ModelAPI_Feature;
 class ModelAPI_Document;
@@ -26,7 +26,7 @@ public:
   /// Returns true if the current iteration is valid and next iteration is possible
   virtual bool more() = 0;
   /// Returns the currently iterated feature
-  virtual std::shared_ptr<ModelAPI_Feature> current() = 0;
+  virtual boost::shared_ptr<ModelAPI_Feature> current() = 0;
   /// Returns the kind of the current feature (faster than Current()->getKind())
   virtual std::string currentKind() = 0;
   /// Returns the name of the current feature (faster than Current()->getName())
@@ -36,7 +36,7 @@ public:
   virtual int numIterationsLeft() = 0;
   /// Compares the current feature with the given one
   /// \returns true if given feature equals to the current one
-  virtual bool isEqual(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  virtual bool isEqual(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
 
   /// To virtually destroy the fields of successors
   virtual ~ModelAPI_Iterator() {}
index fb084002ccf9aba58f93ab3326c6b6fba10e470e..fb65e0b142ecf3426cfd3094a94ac7b8b8b0f87e 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "ModelAPI.h"
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class ModelAPI_Feature;
 
@@ -20,7 +20,7 @@ class MODELAPI_EXPORT ModelAPI_Plugin
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
 
   /// To virtually destroy the fields of successors
   virtual ~ModelAPI_Plugin() {}
index f3e7e9b9d5f13b377247169f802d41162eed67bb..772ac8d9888b4ea4ac3893c5ca1e1c4cebf20d7c 100644 (file)
@@ -31,19 +31,19 @@ using namespace std;
 string library(const string& theLibName);
 
 /// Manager that will be initialized from Model package, one per application
-std::shared_ptr<ModelAPI_PluginManager> MY_MANAGER;
+boost::shared_ptr<ModelAPI_PluginManager> MY_MANAGER;
 
 ModelAPI_PluginManager::ModelAPI_PluginManager()
 {
 }
 
 void ModelAPI_PluginManager::SetPluginManager(
-  std::shared_ptr<ModelAPI_PluginManager> theManager)
+  boost::shared_ptr<ModelAPI_PluginManager> theManager)
 {
   MY_MANAGER = theManager;
 }
 
-std::shared_ptr<ModelAPI_PluginManager> ModelAPI_PluginManager::get()
+boost::shared_ptr<ModelAPI_PluginManager> ModelAPI_PluginManager::get()
 {
   if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
     loadLibrary("Model");
index 2b2f2fc277f002c79bc46b0d669a8ea86aeb3f41..ce89be8cb6eceff0cbe5c3086831b9917359fb86 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "ModelAPI.h"
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class ModelAPI_Feature;
 class ModelAPI_Plugin;
@@ -24,7 +24,7 @@ class MODELAPI_EXPORT ModelAPI_PluginManager
 {
 public:
   /// Returns the real implementation (the alone instance per application) of the plugin manager
-  static std::shared_ptr<ModelAPI_PluginManager> get();
+  static boost::shared_ptr<ModelAPI_PluginManager> get();
 
   /// Registers the plugin that creates features.
   /// It is obligatory for each plugin to call this function on loading to be found by 
@@ -32,16 +32,16 @@ public:
   virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0;
 
   /// Returns the root document of the application (that may contains sub-documents)
-  virtual std::shared_ptr<ModelAPI_Document> rootDocument() = 0;
+  virtual boost::shared_ptr<ModelAPI_Document> rootDocument() = 0;
 
   /// Return true if root document has been already created
   virtual bool hasRootDocument() = 0;
 
   /// Returns the current document that used for current work in the application
-  virtual std::shared_ptr<ModelAPI_Document> currentDocument() = 0;
+  virtual boost::shared_ptr<ModelAPI_Document> currentDocument() = 0;
 
   /// Defines the current document that used for current work in the application
-  virtual void setCurrentDocument(std::shared_ptr<ModelAPI_Document> theDoc) = 0;
+  virtual void setCurrentDocument(boost::shared_ptr<ModelAPI_Document> theDoc) = 0;
 
   /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
   static void loadLibrary(const std::string theLibName);
@@ -54,9 +54,9 @@ public:
 
 protected:
   /// Creates the feature object using plugins functionality
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
 
-  static void SetPluginManager(std::shared_ptr<ModelAPI_PluginManager> theManager);
+  static void SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager> theManager);
 
   friend class Model_Document;
 };
index e2e6891c4084ab79244b1899eb4ef1da73a217e5..6d1dac2cccc2d6510842415eeb0a8c778d187122 100644 (file)
@@ -54,7 +54,7 @@ QString ModuleBase_Operation::operationId() const
   return myOperationId;
 }
 
-std::shared_ptr<ModelAPI_Feature> ModuleBase_Operation::feature() const
+boost::shared_ptr<ModelAPI_Feature> ModuleBase_Operation::feature() const
 {
   return myFeature;
 }
@@ -112,7 +112,7 @@ bool ModuleBase_Operation::isGranted() const
 /*
  * Returns pointer to the root document.
  */
-std::shared_ptr<ModelAPI_Document> ModuleBase_Operation::document() const
+boost::shared_ptr<ModelAPI_Document> ModuleBase_Operation::document() const
 {
   return ModelAPI_PluginManager::get()->rootDocument();
 }
@@ -268,8 +268,8 @@ void ModuleBase_Operation::storeReal(double theValue)
     return;
   }
   QString anId = sender()->objectName();
-  std::shared_ptr<ModelAPI_Data> aData = myFeature->data();
-  std::shared_ptr<ModelAPI_AttributeDouble> aReal = aData->real(anId.toStdString());
+  boost::shared_ptr<ModelAPI_Data> aData = myFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeDouble> aReal = aData->real(anId.toStdString());
   aReal->setValue(theValue);
 }
 
@@ -292,7 +292,7 @@ bool ModuleBase_Operation::isReadyToStart() const
  */
 void ModuleBase_Operation::startOperation()
 {
-  std::shared_ptr<ModelAPI_Document> aDoc = ModelAPI_PluginManager::get()->rootDocument();
+  boost::shared_ptr<ModelAPI_Document> aDoc = ModelAPI_PluginManager::get()->rootDocument();
   myFeature = aDoc->addFeature(myOperationId.toStdString());
   if (myFeature) // TODO: generate an error if feature was not created
     myFeature->execute();
index a3c0c40c18aa4925a9be7995f7fe6acfd5d38e5f..d7441c339f5acad50cace04bf61e82de73b6a307 100644 (file)
@@ -14,7 +14,7 @@
 #include <QObject>
 #include <QString>
 
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class SUIT_Study;
 class XGUI_Workshop;
@@ -76,7 +76,7 @@ public:
   // Operation processing.
   virtual QString operationId() const;
 
-  std::shared_ptr<ModelAPI_Feature> feature() const;
+  boost::shared_ptr<ModelAPI_Feature> feature() const;
 
   OperationState state() const;
   bool isRunning() const;
@@ -122,7 +122,7 @@ protected:
   void setExecStatus(const int);
   void setState(const OperationState);
 
-  std::shared_ptr<ModelAPI_Document> document() const;
+  boost::shared_ptr<ModelAPI_Document> document() const;
 
 private:
   int myFlags;               //!< Operation flags
@@ -132,7 +132,7 @@ private:
   //!< Next fields could be extracted into a subclass;
   QString myOperationId;
   QString myXmlRepr;
-  std::shared_ptr<ModelAPI_Feature> myFeature;
+  boost::shared_ptr<ModelAPI_Feature> myFeature;
 };
 
 #endif
index c5b70b0e00d49e2615606c9a9b790d522b6685bb..69bbe52dce430078739c7e84f908e9bc99f61e78 100644 (file)
@@ -31,7 +31,7 @@ PartSet_OperationSketchBase::~PartSet_OperationSketchBase()
  */
 const TopoDS_Shape& PartSet_OperationSketchBase::preview() const
 {
-  shared_ptr<SketchPlugin_Feature> aFeature = dynamic_pointer_cast<SketchPlugin_Feature>(feature());
+  boost::shared_ptr<SketchPlugin_Feature> aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(feature());
   return aFeature->preview();
 }
 
index 440eb6f2596322c2ed2f98a6e840a6115904db14..144411717f28f3fc8de381777c41e5a3bc97407d 100644 (file)
@@ -22,13 +22,13 @@ void PartSetPlugin_Part::initAttributes()
 
 void PartSetPlugin_Part::execute() 
 {
-  shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->docRef(PART_ATTR_DOC_REF);
+  boost::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->docRef(PART_ATTR_DOC_REF);
   if (!aDocRef->value()) { // create a document if not yet created
-    shared_ptr<ModelAPI_Document> aPartSetDoc = ModelAPI_PluginManager::get()->rootDocument();
+    boost::shared_ptr<ModelAPI_Document> aPartSetDoc = ModelAPI_PluginManager::get()->rootDocument();
     aDocRef->setValue(aPartSetDoc->subDocument(data()->getName()));
   }
 }
 
-shared_ptr<ModelAPI_Document> PartSetPlugin_Part::documentToAdd() {
+boost::shared_ptr<ModelAPI_Document> PartSetPlugin_Part::documentToAdd() {
   return ModelAPI_PluginManager::get()->rootDocument();
 }
index f1ee4306421704bdbd9ddf2af2a055113f15e9b9..25af3bea7bb586245b7c1def4c684911e9630114 100644 (file)
@@ -32,7 +32,7 @@ public:
   /// Request for initialization of data model of the feature: adding all attributes
   PARTSETPLUGIN_EXPORT virtual void initAttributes();
 
-  PARTSETPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Document> documentToAdd();
+  PARTSETPLUGIN_EXPORT virtual boost::shared_ptr<ModelAPI_Document> documentToAdd();
 
   /// Use plugin manager for features creation
   PartSetPlugin_Part();
index 7ef8f66e1e4d657f2a11e35d0108b5057535b8a6..85ea1c37eacf527337a523ae115b3684134ef227 100644 (file)
@@ -14,11 +14,11 @@ PartSetPlugin_Plugin::PartSetPlugin_Plugin()
   ModelAPI_PluginManager::get()->registerPlugin(this);
 }
 
-shared_ptr<ModelAPI_Feature> PartSetPlugin_Plugin::createFeature(string theFeatureID)
+boost::shared_ptr<ModelAPI_Feature> PartSetPlugin_Plugin::createFeature(string theFeatureID)
 {
   if (theFeatureID == "Part") {
-    return shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Part);
+    return boost::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Part);
   }
   // feature of such kind is not found
-  return shared_ptr<ModelAPI_Feature>();
+  return boost::shared_ptr<ModelAPI_Feature>();
 }
index 74f6e73c02d90caa136d918152b0ce52d2f5c650..ff577f79a3adec8e2003a43ece502a805e536255 100644 (file)
@@ -13,7 +13,7 @@ class PARTSETPLUGIN_EXPORT PartSetPlugin_Plugin: public ModelAPI_Plugin
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
 
 public:
   /// Is needed for python wrapping by swig
diff --git a/src/SalomeModule/CMakeLists.txt b/src/SalomeModule/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2749ccf
--- /dev/null
@@ -0,0 +1,41 @@
+SET(CMAKE_AUTOMOC ON)
+
+SET(PROJECT_HEADERS
+       SalomeModule.h
+       SalomeModule_Module.h
+)
+
+SET(PROJECT_AUTOMOC 
+    ${CMAKE_CURRENT_BINARY_DIR}/XGUI_automoc.cpp
+)
+
+SET(PROJECT_SOURCES
+       SalomeModule_Module.cpp
+)
+
+
+SET(PROJECT_LIBRARIES
+    Event
+    Config
+       ${QT_LIBRARIES}
+       XGUI
+)
+
+ADD_DEFINITIONS( -DSalomeModule_EXPORTS ${CAS_DEFINITIONS} )
+
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/XGUI
+                                       ${SALOME_GUI_INCLUDE}
+                    ${CAS_INCLUDE_DIRS}
+)
+
+ADD_LIBRARY(SalomeModule SHARED 
+       ${PROJECT_SOURCES} 
+       ${PROJECT_HEADERS} 
+)
+
+ADD_DEPENDENCIES(SalomeModule XGUI)
+
+# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
+TARGET_LINK_LIBRARIES(SalomeModule ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS SalomeModule DESTINATION bin)
diff --git a/src/SalomeModule/SalomeModule.h b/src/SalomeModule/SalomeModule.h
new file mode 100644 (file)
index 0000000..e8977e5
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef SalomeModule_H
+#define SalomeModule_H
+
+#if defined SalomeModule_EXPORTS
+#if defined WIN32
+#define SalomeModule_EXPORT     __declspec( dllexport )
+#else
+#define SalomeModule_EXPORT
+#endif
+#else
+#if defined WIN32
+#define SalomeModule_EXPORT     __declspec( dllimport )
+#else
+#define SalomeModule_EXPORT
+#endif
+#endif
+
+#endif
+
+
+
diff --git a/src/SalomeModule/SalomeModule_Module.cpp b/src/SalomeModule/SalomeModule_Module.cpp
new file mode 100644 (file)
index 0000000..1190e77
--- /dev/null
@@ -0,0 +1,44 @@
+
+
+#include "SalomeModule_Module.h"
+
+#include <LightApp_Application.h>
+#include <OCCViewer_ViewModel.h>
+
+
+
+SalomeModule_Module::SalomeModule_Module()
+: LightApp_Module( "NewGeom" )
+{
+}
+
+
+SalomeModule_Module::~SalomeModule_Module()
+{
+}
+
+void SalomeModule_Module::initialize(CAM_Application* theApp)
+{
+}
+
+void SalomeModule_Module::windows(QMap<int, int>& theWndMap) const
+{
+  theWndMap.insert( LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+}
+
+void SalomeModule_Module::viewManagers(QStringList& theList) const
+{
+  theList.append( OCCViewer_Viewer::Type() );
+}
+
+bool SalomeModule_Module::activateModule(SUIT_Study* theStudy)
+{
+  return LightApp_Module::activateModule(theStudy);
+}
+
+bool SalomeModule_Module::deactivateModule(SUIT_Study* theStudy)
+{
+  return LightApp_Module::deactivateModule(theStudy);
+}
+
+
diff --git a/src/SalomeModule/SalomeModule_Module.h b/src/SalomeModule/SalomeModule_Module.h
new file mode 100644 (file)
index 0000000..d4acd27
--- /dev/null
@@ -0,0 +1,27 @@
+
+
+#ifndef SalomeModule_Module_H
+#define SalomeModule_Module_H
+
+#include <LightApp_Module.h>
+
+class SalomeModule_Module: public LightApp_Module
+{
+  Q_OBJECT
+public:
+  SalomeModule_Module();
+  virtual ~SalomeModule_Module();
+
+  virtual void initialize( CAM_Application* theApp);
+  virtual void windows( QMap<int, int>& theWndMap) const;
+  virtual void viewManagers( QStringList& theList) const;
+
+public slots:
+  bool activateModule( SUIT_Study* theStudy);
+  bool deactivateModule( SUIT_Study* theStudy);
+
+private:
+
+};
+
+#endif
index 56f3b20e7f890f043aafb27e077d5bc4f8286744..1149409813a5645b6b24018d974e55aa79b3f29b 100644 (file)
@@ -14,14 +14,14 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
   ModelAPI_PluginManager::get()->registerPlugin(this);
 }
 
-shared_ptr<ModelAPI_Feature> SketchPlugin_Plugin::createFeature(string theFeatureID)
+boost::shared_ptr<ModelAPI_Feature> SketchPlugin_Plugin::createFeature(string theFeatureID)
 {
   if (theFeatureID == "Sketch") {
-    return shared_ptr<ModelAPI_Feature>(new SketchPlugin_Sketch);
+    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Sketch);
   }
   /*else if (theFeatureID == "Point") {
     return shared_ptr<ModelAPI_Feature>(new SketchPlugin_Point);
   }*/
   // feature of such kind is not found
-  return shared_ptr<ModelAPI_Feature>();
+  return boost::shared_ptr<ModelAPI_Feature>();
 }
index 2b26663504d1a8668fbcef2cecde7f639205e3ac..f232b68fac26fdfdd6d38e824cae6f624aa520fb 100644 (file)
@@ -13,7 +13,7 @@ class SKETCHPLUGIN_EXPORT SketchPlugin_Plugin: public ModelAPI_Plugin
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
 
 public:
   /// Is needed for python wrapping by swig
index f523c3ed8c2bca38370c1a8cbd8afeafdd73c3df..f228e092e9daf37a54bd9bcd4d213d970a74b155 100644 (file)
@@ -12,7 +12,7 @@ typedef QList<short> QShortList;     //!< list of short int values
 typedef QList<double> QDoubleList;    //!< list of double values
 
 //! Pointer on feature object
-typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
+typedef boost::shared_ptr<ModelAPI_Feature> FeaturePtr;
 typedef QList<FeaturePtr> QFeatureList; //!< List of features
 
 namespace XGUI
index c602d02c10a26db4bce4dec559d4f4f49f480a95..676c9d8fdf98e249441ae195287e952f57e4d033 100644 (file)
@@ -15,7 +15,7 @@
 class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
 {
 public:
-  XGUI_FeaturesModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
+  XGUI_FeaturesModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
       QAbstractItemModel(theParent), myDocument(theDocument) {}
 
   //! Returns Feature object by the given Model index.
@@ -23,13 +23,13 @@ public:
   virtual FeaturePtr feature(const QModelIndex& theIndex) const = 0;
 
   //! Returns parent index of the given feature
-  virtual QModelIndex findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const = 0;
+  virtual QModelIndex findParent(const boost::shared_ptr<ModelAPI_Feature>& theFeature) const = 0;
 
   //! Returns index corresponded to the group
   virtual QModelIndex findGroup(const std::string& theGroup) const = 0;
 
 protected:
-  std::shared_ptr<ModelAPI_Document> myDocument;
+  boost::shared_ptr<ModelAPI_Document> myDocument;
 };
 
 
@@ -40,13 +40,13 @@ protected:
 class XGUI_PartModel : public XGUI_FeaturesModel
 {
 public:
-  XGUI_PartModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
+  XGUI_PartModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
       XGUI_FeaturesModel(theDocument, theParent) {}
 
   void setPartId(int theId) { myId = theId; }
 
   //! Returns true if the given document is a sub-document of this tree
-  virtual bool hasDocument(const std::shared_ptr<ModelAPI_Document>& theDoc) const = 0;
+  virtual bool hasDocument(const boost::shared_ptr<ModelAPI_Document>& theDoc) const = 0;
 
 protected:
   //! Id of the current part object in the document
index 1df32917011497fda656630e3987b3b61bd6ef6f..5300fe5c15a66b68775e2ef721a074c41628659a 100644 (file)
@@ -26,7 +26,7 @@ XGUI_Displayer::~XGUI_Displayer()
  * Display the feature
  * \param theFeature a feature instance
  */
-void XGUI_Displayer::Display(std::shared_ptr<ModelAPI_Feature> theFeature)
+void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
 }
 
@@ -35,7 +35,7 @@ void XGUI_Displayer::Display(std::shared_ptr<ModelAPI_Feature> theFeature)
  * \param theFeature a feature instance
  * \param theFeature a shape
  */
-void XGUI_Displayer::Display(std::shared_ptr<ModelAPI_Feature> theFeature,
+void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
                              const TopoDS_Shape& theShape)
 {
   Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
index cf5dbbbd9c177150d15029a1e9f5639ddee97648..10480ef9732bd2fd468f729f7bede378742a0bd1 100644 (file)
@@ -4,6 +4,7 @@
 #include "XGUI.h"
 
 #include <QString>
+#include <boost/shared_ptr.hpp>
 
 #include <TopoDS_Shape.hxx>
 
@@ -20,9 +21,9 @@ public:
   XGUI_Displayer(XGUI_Viewer* theViewer);
   virtual ~XGUI_Displayer();
 
-  void Display(std::shared_ptr<ModelAPI_Feature> theFeature);
+  void Display(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
-  void Display(std::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape);
+  void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape);
 
 protected:
   XGUI_Viewer* myViewer; ///< the viewer
index 9ccc7f643901885c2ec076a5274d3bd6f5e52deb..7fae4b2bd325b10b45585c96b233ef2cd7d62e67 100644 (file)
@@ -19,7 +19,7 @@ XGUI_DocumentDataModel::XGUI_DocumentDataModel(QObject* theParent)
   : QAbstractItemModel(theParent)
 {
   // Find Document object
-  std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+  boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
   myDocument = aMgr->currentDocument();
 
   // Register in event loop
@@ -43,8 +43,8 @@ void XGUI_DocumentDataModel::processEvent(const Event_Message* theMessage)
   // Created object event *******************
   if (QString(theMessage->eventID().eventText()) == EVENT_FEATURE_CREATED) {
     const ModelAPI_FeatureUpdatedMessage* aUpdMsg = dynamic_cast<const ModelAPI_FeatureUpdatedMessage*>(theMessage);
-    std::shared_ptr<ModelAPI_Document> aDoc = aUpdMsg->document();
-    std::shared_ptr<ModelAPI_Feature> aFeature = aUpdMsg->feature();
+    boost::shared_ptr<ModelAPI_Document> aDoc = aUpdMsg->document();
+    boost::shared_ptr<ModelAPI_Feature> aFeature = aUpdMsg->feature();
 
     if (aDoc == myDocument) {  // If root objects
       if (aFeature->getGroup().compare(PARTS_GROUP) == 0) { // Updsate only Parts group
@@ -80,7 +80,7 @@ void XGUI_DocumentDataModel::processEvent(const Event_Message* theMessage)
   // Deteted object event ***********************
   } else if (QString(theMessage->eventID().eventText()) == EVENT_FEATURE_DELETED) {
     const ModelAPI_FeatureDeletedMessage* aUpdMsg = dynamic_cast<const ModelAPI_FeatureDeletedMessage*>(theMessage);
-    std::shared_ptr<ModelAPI_Document> aDoc = aUpdMsg->document();
+    boost::shared_ptr<ModelAPI_Document> aDoc = aUpdMsg->document();
 
     if (aDoc == myDocument) {  // If root objects
       if (aUpdMsg->group().compare(PARTS_GROUP) == 0) { // Updsate only Parts group
index ba7558e0ede450c7800faec333cfb91897d9e17c..592308ae8adcdbcb30e069f62c5a3f05fedb64ae 100644 (file)
@@ -74,7 +74,7 @@ private:
   bool hasSubModel(const QAbstractItemModel* theModel) const;
 
   //! Document
-  std::shared_ptr<ModelAPI_Document> myDocument;
+  boost::shared_ptr<ModelAPI_Document> myDocument;
 
   //! Data model of top part of data tree (not parts object)
   XGUI_TopDataModel* myModel;
index 127c3478f83b339946447f9506afa2adf9f28b6d..ba5bbbea33ddeb56b71e88afd3bc741fe9ec67ff 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <QIcon>
 
-XGUI_TopDataModel::XGUI_TopDataModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
+XGUI_TopDataModel::XGUI_TopDataModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
   : XGUI_FeaturesModel(theDocument, theParent)
 {
 }
@@ -29,7 +29,7 @@ QVariant XGUI_TopDataModel::data(const QModelIndex& theIndex, int theRole) const
       return tr("Parameters");
     case ParamObject:
       {
-        std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row());
+        boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row());
         if (aFeature)
           return aFeature->data()->getName().c_str();
       } 
@@ -37,7 +37,7 @@ QVariant XGUI_TopDataModel::data(const QModelIndex& theIndex, int theRole) const
         return tr("Constructions");
     case ConstructObject:
       {
-        std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+        boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
         if (aFeature)
           return aFeature->data()->getName().c_str();
       }
@@ -141,7 +141,7 @@ FeaturePtr XGUI_TopDataModel::feature(const QModelIndex& theIndex) const
 }
 
 
-QModelIndex XGUI_TopDataModel::findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const
+QModelIndex XGUI_TopDataModel::findParent(const boost::shared_ptr<ModelAPI_Feature>& theFeature) const
 {
   QString aGroup(theFeature->getGroup().c_str());
 
@@ -165,7 +165,7 @@ QModelIndex XGUI_TopDataModel::findGroup(const std::string& theGroup) const
 //******************************************************************
 //******************************************************************
 //******************************************************************
-XGUI_PartDataModel::XGUI_PartDataModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
+XGUI_PartDataModel::XGUI_PartDataModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
   : XGUI_PartModel(theDocument, theParent)
 {
 }
@@ -183,7 +183,7 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons
     switch (theIndex.internalId()) {
     case MyRoot:
       {
-        std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
+        boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
         if (aFeature)
           return aFeature->data()->getName().c_str();
       }
@@ -193,14 +193,14 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons
       return tr("Constructions");
     case ParamObject:
       {
-        std::shared_ptr<ModelAPI_Feature> aFeature = 
+        boost::shared_ptr<ModelAPI_Feature> aFeature = 
           featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
         if (aFeature)
           return aFeature->data()->getName().c_str();
       }
     case ConstructObject:
       {
-        std::shared_ptr<ModelAPI_Feature> aFeature = 
+        boost::shared_ptr<ModelAPI_Feature> aFeature = 
           featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
         if (aFeature)
           return aFeature->data()->getName().c_str();
@@ -299,9 +299,9 @@ bool XGUI_PartDataModel::hasChildren(const QModelIndex& theParent) const
 }
 
 
-std::shared_ptr<ModelAPI_Document> XGUI_PartDataModel::featureDocument() const
+boost::shared_ptr<ModelAPI_Document> XGUI_PartDataModel::featureDocument() const
 {
-  std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
+  boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
   return aFeature->data()->docRef("PartDocument")->value();
 }
 
@@ -321,13 +321,13 @@ FeaturePtr XGUI_PartDataModel::feature(const QModelIndex& theIndex) const
   return FeaturePtr();
 }
 
-bool XGUI_PartDataModel::hasDocument(const std::shared_ptr<ModelAPI_Document>& theDoc) const
+bool XGUI_PartDataModel::hasDocument(const boost::shared_ptr<ModelAPI_Document>& theDoc) const
 {
   return (featureDocument() == theDoc);
 }
 
 
-QModelIndex XGUI_PartDataModel::findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const
+QModelIndex XGUI_PartDataModel::findParent(const boost::shared_ptr<ModelAPI_Feature>& theFeature) const
 {
   QString aGroup(theFeature->getGroup().c_str());
 
index 15c863519bb69f76eed5b8bf05ad4c7277ca3df0..f81f303f40fe36c4fb5611c328f859cf9e81249f 100644 (file)
@@ -14,7 +14,7 @@ class XGUI_EXPORT XGUI_TopDataModel : public XGUI_FeaturesModel
 {
   Q_OBJECT
 public:
-  XGUI_TopDataModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent);
+  XGUI_TopDataModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent);
   virtual ~XGUI_TopDataModel();
 
   // Reimplementation from QAbstractItemModel
@@ -37,7 +37,7 @@ public:
   virtual FeaturePtr feature(const QModelIndex& theIndex) const;
 
   //! Returns parent index of the given feature
-  virtual QModelIndex findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const;
+  virtual QModelIndex findParent(const boost::shared_ptr<ModelAPI_Feature>& theFeature) const;
 
   //! Returns index corresponded to the group
   virtual QModelIndex findGroup(const std::string& theGroup) const;
@@ -63,7 +63,7 @@ class XGUI_PartDataModel : public XGUI_PartModel
 {
   Q_OBJECT
 public:
-  XGUI_PartDataModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent);
+  XGUI_PartDataModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent);
   virtual ~XGUI_PartDataModel();
 
   // Reimplementation from QAbstractItemModel
@@ -86,16 +86,16 @@ public:
   virtual FeaturePtr feature(const QModelIndex& theIndex) const;
 
   //! Returns true if the given document is a sub-document of this tree
-  virtual bool hasDocument(const std::shared_ptr<ModelAPI_Document>& theDoc) const;
+  virtual bool hasDocument(const boost::shared_ptr<ModelAPI_Document>& theDoc) const;
 
   //! Returns parent index of the given feature
-  virtual QModelIndex findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const;
+  virtual QModelIndex findParent(const boost::shared_ptr<ModelAPI_Feature>& theFeature) const;
 
   //! Returns index corresponded to the group
   virtual QModelIndex findGroup(const std::string& theGroup) const;
 
 private: 
-  std::shared_ptr<ModelAPI_Document> featureDocument() const;
+  boost::shared_ptr<ModelAPI_Document> featureDocument() const;
 
   //! Types of QModelIndexes
   enum DataIds {
index 510fb1b4062b2776e50862ecd83e4f812ef8044f..6421d278b62bcd816a9999d6ae99cc485ea1196c 100644 (file)
@@ -34,8 +34,8 @@ void XGUI_SelectionMgr::onSelectionChanged()
   if (mySelectedData.size() > 0) {
     FeaturePtr aFeature = mySelectedData.first();
 
-    std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-    std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
+    boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+    boost::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
     if (aDocRef)
       aMgr->setCurrentDocument(aDocRef->value());
   }
index 8911720284c17af1ebf0042e9dfaff2c9616d893..9e2586a77546b9d3eaa3edc25178848508ad9c08 100644 (file)
@@ -73,12 +73,12 @@ void XGUI_Workshop::startApplication()
   updateCommandStatus();
   onNew();
   // Testing of document creation
-  //std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-  //std::shared_ptr<ModelAPI_Feature> aPoint1 = aMgr->rootDocument()->addFeature("Point");
-  //std::shared_ptr<ModelAPI_Feature> aPart = aMgr->rootDocument()->addFeature("Part");
+  //boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+  //boost::shared_ptr<ModelAPI_Feature> aPoint1 = aMgr->rootDocument()->addFeature("Point");
+  //boost::shared_ptr<ModelAPI_Feature> aPart = aMgr->rootDocument()->addFeature("Part");
   //aPart->execute();
   //aMgr->setCurrentDocument(aPart->data()->docRef("PartDocument")->value());
-  //std::shared_ptr<ModelAPI_Feature> aPoint2 = aMgr->rootDocument()->addFeature("Point");
+  //boost::shared_ptr<ModelAPI_Feature> aPoint2 = aMgr->rootDocument()->addFeature("Point");
   //aPoint2 = aMgr->rootDocument()->addFeature("Point");
 
   //aPart = aMgr->rootDocument()->addFeature("Part");
@@ -296,8 +296,8 @@ void XGUI_Workshop::onSaveAs()
 void XGUI_Workshop::onUndo()
 {
   myMainWindow->objectBrowser()->setCurrentIndex(QModelIndex());
-  std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-  std::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
+  boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+  boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
   aDoc->undo();
   updateCommandStatus();
 }
@@ -306,8 +306,8 @@ void XGUI_Workshop::onUndo()
 void XGUI_Workshop::onRedo()
 {
   myMainWindow->objectBrowser()->setCurrentIndex(QModelIndex());
-  std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-  std::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
+  boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+  boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
   aDoc->redo();
   updateCommandStatus();
 }
@@ -391,7 +391,7 @@ void XGUI_Workshop::updateCommandStatus()
   QList<XGUI_Command*> aCommands = aMenuBar->features();
   QList<XGUI_Command*>::const_iterator aIt;
 
-  std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+  boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
   if (aMgr->hasRootDocument()) {
     XGUI_Command* aUndoCmd;
     XGUI_Command* aRedoCmd;
@@ -403,7 +403,7 @@ void XGUI_Workshop::updateCommandStatus()
       else // Enable all commands
         (*aIt)->enable();
     }
-    std::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
+    boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
     aUndoCmd->setEnabled(aDoc->canUndo());
     aRedoCmd->setEnabled(aDoc->canRedo());
   } else {