Salome HOME
StudyData Swig
authorvsv <vsv@opencascade.com>
Tue, 10 Dec 2019 12:51:33 +0000 (15:51 +0300)
committervsv <vsv@opencascade.com>
Tue, 10 Dec 2019 12:52:18 +0000 (15:52 +0300)
src/CMakeLists.txt
src/CXX/CMakeLists.txt [deleted file]
src/SWIG/CMakeLists.txt
src/SWIG/StudyData_Swig.i [new file with mode: 0644]
src/StudyData/CMakeLists.txt [new file with mode: 0644]
src/StudyData/StudyData_Object.cpp [new file with mode: 0644]
src/StudyData/StudyData_Object.h [new file with mode: 0644]

index cb3225bd351c984c804426a3c3b8fb03b4cc7a1a..d50a4eda7ca389d2f7ea83ec4fbae5c2773f2650 100644 (file)
@@ -21,8 +21,8 @@
 # Common packages
 ##
 SET(SUBDIRS_COMMON
-  #CXX
-  #SWIG
+  StudyData
+  SWIG
   PY
 )
 
diff --git a/src/CXX/CMakeLists.txt b/src/CXX/CMakeLists.txt
deleted file mode 100644 (file)
index 23b3d88..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (C) 2012-2019  CEA/DEN, EDF R&D, 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, or (at your option) any later version.
-#
-# 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
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-
-# --- options ---
-# additional include directories
-INCLUDE_DIRECTORIES(
-  ${KERNEL_INCLUDE_DIRS}
-  ${GEOM_INCLUDE_DIRS}
-  ${OpenCASCADE_INCLUDE_DIR}
-  ${SHAPER_INCLUDE_DIRS}
-)
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
-  ${OpenCASCADE_DEFINITIONS}
-)
-
-# libraries to link to
-SET(_link_LIBRARIES
-  # ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
-  # ${OpenCASCADE_ModelingData_LIBRARIES}
-  # ${OpenCASCADE_ApplicationFramework_LIBRARIES}
-  # ${GEOM_NMTTools}
-  # ${GEOM_GEOMUtils}
-)
-
-# --- headers ---
-
-# header files / no moc processing
-SET(SHAPERSTUDYCore_HEADERS
-)
-
-# --- sources ---
-
-# sources / static
-SET(SHAPERSTUDYCore_SOURCES
-)
-
-# --- rules ---
-
-ADD_LIBRARY(SHAPERSTUDYCore ${SHAPERSTUDYCore_SOURCES})
-IF(WIN32)
-  TARGET_COMPILE_OPTIONS(SHAPERSTUDYCore PRIVATE /bigobj) 
-ENDIF(WIN32)
-
-TARGET_LINK_LIBRARIES(SHAPERSTUDYCore ${_link_LIBRARIES} )
-INSTALL(TARGETS SHAPERSTUDYCore EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-INSTALL(FILES ${SHAPERSTUDYCore_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
index c788197bc06d70f6f6c35b995d7e59f8129e6322..4edaf08fa76f916752ac91e8d26364f6a8d41d66 100644 (file)
@@ -28,7 +28,7 @@ INCLUDE_DIRECTORIES(
   ${KERNEL_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${PROJECT_SOURCE_DIR}/src/CXX
+  ${PROJECT_SOURCE_DIR}/src/StudyData
 )
 
 # additional preprocessor / compiler flags
@@ -40,6 +40,8 @@ ADD_DEFINITIONS(
 
 # libraries to link to
 SET(_link_LIBRARIES
+  StudyData
+  ${PYTHON_LIBRARIES}
 )
 
 # --- headers ---
@@ -51,9 +53,9 @@ SET(SHAPERSTUDY_Swig_HEADERS
 # --- sources ---
 
 # sources / static
-SET(SHAPERSTUDY_Swig_SOURCES
-  SHAPERSTUDY_Swig.i
-  ${SHAPERSTUDY_Swig_HEADERS}
+SET(StudyData_Swig_SOURCES
+  StudyData_Swig.i
+  #${SHAPERSTUDY_Swig_HEADERS}
 )
 
 # workaround about SWIG_ADD_MODULE bug: remove duplicates in include directories
@@ -62,33 +64,33 @@ LIST(REMOVE_DUPLICATES _cmake_include_directories)
 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${_cmake_include_directories}")
 
 # swig flags
-SET_SOURCE_FILES_PROPERTIES(SHAPERSTUDY_Swig.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(SHAPERSTUDY_Swig.i PROPERTIES SWIG_FLAGS "-py3")
-SET_SOURCE_FILES_PROPERTIES(SHAPERSTUDY_swig_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
+SET_SOURCE_FILES_PROPERTIES(StudyData_Swig.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(StudyData_Swig.i PROPERTIES SWIG_FLAGS "-py3")
+SET_SOURCE_FILES_PROPERTIES(StudyData_swig_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
 
 # --- scripts ---
 
 # scripts / swig wrappings
 SET(_swig_SCRIPTS
-  ${CMAKE_CURRENT_BINARY_DIR}/SHAPERSTUDY_Swig.py 
+  ${CMAKE_CURRENT_BINARY_DIR}/StudyData_Swig.py 
 )
 
 # --- rules ---
 IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
-  SWIG_ADD_MODULE(SHAPERSTUDY_Swig python ${SHAPERSTUDY_Swig_SOURCES})
+  SWIG_ADD_MODULE(StudyData_Swig python ${StudyData_Swig_SOURCES})
 ELSE()
-  SWIG_ADD_LIBRARY(SHAPERSTUDY_Swig LANGUAGE python SOURCES ${SHAPERSTUDY_Swig_SOURCES})
+  SWIG_ADD_LIBRARY(StudyData_Swig LANGUAGE python SOURCES ${StudyData_Swig_SOURCES})
 ENDIF()
 
 
-SWIG_LINK_LIBRARIES(SHAPERSTUDY_Swig ${_link_LIBRARIES})
-SWIG_CHECK_GENERATION(SHAPERSTUDY_Swig)
+SWIG_LINK_LIBRARIES(StudyData_Swig ${_link_LIBRARIES})
+SWIG_CHECK_GENERATION(StudyData_Swig)
 IF(WIN32)
-  SET_TARGET_PROPERTIES(_SHAPERSTUDY_Swig PROPERTIES DEBUG_OUTPUT_NAME _SHAPERSTUDY_Swig_d)
+  SET_TARGET_PROPERTIES(_StudyData_Swig PROPERTIES DEBUG_OUTPUT_NAME _StudyData_Swig_d)
 ENDIF(WIN32)
 
-INSTALL(TARGETS _SHAPERSTUDY_Swig DESTINATION ${SALOME_INSTALL_LIBS})
+#INSTALL(TARGETS _StudyData_Swig DESTINATION ${SALOME_INSTALL_LIBS})
 
-INSTALL(FILES ${SHAPERSTUDY_Swig_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+#INSTALL(FILES ${StudyData_Swig_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
-SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_SHAPERSTUDY_Swig_REAL_NAME}")
+#SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_SHAPERSTUDY_Swig_REAL_NAME}")
diff --git a/src/SWIG/StudyData_Swig.i b/src/SWIG/StudyData_Swig.i
new file mode 100644 (file)
index 0000000..f74d9d1
--- /dev/null
@@ -0,0 +1,7 @@
+
+
+%module StudyData_Swig
+
+%{
+#include "StudyData_Object.h"
+%}
diff --git a/src/StudyData/CMakeLists.txt b/src/StudyData/CMakeLists.txt
new file mode 100644 (file)
index 0000000..04d7a19
--- /dev/null
@@ -0,0 +1,70 @@
+# Copyright (C) 2012-2019  CEA/DEN, EDF R&D, 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, or (at your option) any later version.
+#
+# 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+
+# --- options ---
+# additional include directories
+INCLUDE_DIRECTORIES(
+  ${KERNEL_INCLUDE_DIRS}
+  ${GEOM_INCLUDE_DIRS}
+  ${OpenCASCADE_INCLUDE_DIR}
+  ${SHAPER_INCLUDE_DIRS}
+)
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+  ${OpenCASCADE_DEFINITIONS}
+  ${OMNIORB_DEFINITIONS}
+)
+
+# libraries to link to
+SET(_link_LIBRARIES
+  SalomeIDLGEOM
+  ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
+  # ${OpenCASCADE_ModelingData_LIBRARIES}
+  # ${OpenCASCADE_ApplicationFramework_LIBRARIES}
+  # ${GEOM_NMTTools}
+  # ${GEOM_GEOMUtils}
+)
+
+# --- headers ---
+
+# header files / no moc processing
+SET(STUDYDATA_HEADERS
+    StudyData_Object.h
+)
+
+# --- sources ---
+
+# sources / static
+SET(STUDYDATA_SOURCES
+    StudyData_Object.cpp
+)
+
+# --- rules ---
+
+ADD_LIBRARY(StudyData ${STUDYDATA_HEADERS} ${STUDYDATA_SOURCES})
+#IF(WIN32)
+#  TARGET_COMPILE_OPTIONS(SudyData PRIVATE /bigobj) 
+#ENDIF(WIN32)
+
+TARGET_LINK_LIBRARIES(StudyData ${_link_LIBRARIES} )
+INSTALL(TARGETS StudyData EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+INSTALL(FILES ${STUDYDATA_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
diff --git a/src/StudyData/StudyData_Object.cpp b/src/StudyData/StudyData_Object.cpp
new file mode 100644 (file)
index 0000000..31e4668
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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, or (at your option) any later version.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "StudyData_Object.h"
+
+#include <BRep_Builder.hxx>
+#include <BRepTools.hxx>
+
+StudyData_Object::StudyData_Object(SALOMEDS::TMPFile_var theFile)
+{
+  int sizebuf = theFile->length();
+  char* aBuf;
+  aBuf = (char*)&theFile[0];
+  std::istringstream streamBrep(aBuf);
+  BRep_Builder aBuilder;
+  BRepTools::Read(myShape, streamBrep, aBuilder);
+}
diff --git a/src/StudyData/StudyData_Object.h b/src/StudyData/StudyData_Object.h
new file mode 100644 (file)
index 0000000..55e7866
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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, or (at your option) any later version.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef StudyData_Object_H
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+
+#include <TopoDS_Shape.hxx>
+
+class StudyData_Object
+{
+public:
+  StudyData_Object(SALOMEDS::TMPFile_var theFile);
+
+
+private:
+  TopoDS_Shape myShape;
+};
+
+#endif // !StudyData_Object_H