STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
ELSE(EXISTS ${KERNEL_ROOT_DIR})
# Local macros:
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
+# Find GEOM
+# ===========
+SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the Salome GEOM")
+IF(EXISTS ${GEOM_ROOT_DIR})
+ LIST(APPEND CMAKE_MODULE_PATH "${GEOM_ROOT_DIR}/adm_local/cmake_files")
+ FIND_PACKAGE(SalomeGEOM REQUIRED)
+ ADD_DEFINITIONS(${GEOM_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${GEOM_INCLUDE_DIRS})
+ELSE(EXISTS ${GEOM_ROOT_DIR})
+ MESSAGE(FATAL_ERROR "We absolutely need a Salome GEOM, please define GEOM_ROOT_DIR")
+ENDIF(EXISTS ${GEOM_ROOT_DIR})
+
+SET(SALOME_BUILD_GUI ${SALOME_GEOM_BUILD_GUI})
+
+# Find GUI(optional)
+IF(SALOME_BUILD_GUI)
+ SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
+ IF(EXISTS ${GUI_ROOT_DIR})
+ LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
+ FIND_PACKAGE(SalomeGUI)
+ FULL_GUI(FALSE) #check whether GUI builded in full mode and with CORBA
+ ADD_DEFINITIONS(${GUI_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
+ ELSE(EXISTS ${GUI_ROOT_DIR})
+ MESSAGE(STATUS "GUI_ROOT_DIR is not well defined, ACISPLUGIN will be built without GUI!!!")
+ ENDIF(EXISTS ${GUI_ROOT_DIR})
+ SALOME_LOG_OPTIONAL_PACKAGE(SalomeGUI SALOME_BUILD_GUI)
+ENDIF(SALOME_BUILD_GUI)
+
# User options
# ============
-#OPTION(SALOME_BUILD_DOC "Generate SALOME ACISPLUGIN documentation" ON) #for use in the future
+OPTION(SALOME_BUILD_DOC "Generate SALOME ACISPLUGIN documentation" ON)
OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
IF(SALOME_BUILD_TESTS)
IF(ACIS_READ_LICENSE OR ACIS_WRITE_LICENSE)
IF(NOT ACIS_READ_LICENSE)
- MESSAGE(WARNING "ACIS read license keys are not specified! Runtime license will be required!")
+ MESSAGE(WARNING "ACIS read license key is not specified! Runtime license will be required!")
ELSEIF(NOT ACIS_WRITE_LICENSE)
MESSAGE(WARNING "ACIS write license key is not specified! Runtime license will be required!")
ENDIF()
## ACISPLUGIN specifics
##
+FIND_PACKAGE(SalomePython REQUIRED)
FIND_PACKAGE(SalomeCAS REQUIRED)
FIND_PACKAGE(SalomeACIS REQUIRED)
+FIND_PACKAGE(SalomeOmniORB REQUIRED)
+FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
+IF(SALOME_BUILD_GUI)
+ FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
+ENDIF()
+IF(SALOME_BUILD_DOC)
+ FIND_PACKAGE(SalomeDoxygen)
+ SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC)
+ENDIF()
# Directories
# ===========
"Install path: local SALOME CMake files")
SET(SALOME_INSTALL_RES share/salome/resources CACHE PATH "Install path: SALOME resources")
SET(SALOME_INSTALL_DOC share/doc/salome CACHE PATH "Install path: SALOME documentation")
+SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
# Specific to ACISPLUGIN:
SET(SALOME_ACISPLUGIN_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/acisplugin" CACHE PATH.
MARK_AS_ADVANCED(SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES SALOME_INSTALL_DOC)
# Accumulate environment variables for ACISPLUGIN module
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
# Sources
# ========
-
+ADD_SUBDIRECTORY(idl)
ADD_SUBDIRECTORY(adm_local)
ADD_SUBDIRECTORY(resources)
ADD_SUBDIRECTORY(src)
+IF(SALOME_BUILD_DOC)
+ ADD_SUBDIRECTORY(doc)
+ENDIF()
# Header configuration
# ====================
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
SET(_${PROJECT_NAME}_exposed_targets
- ACISExport ACISImport
+ SalomeIDLACISPlugin ACISPluginEngine
)
+IF(SALOME_BUILD_GUI)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ ACISPluginGUI
+ )
+ENDIF()
+
# Add all targets to the build-tree export set
EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
# Ensure the variables are always defined for the configure:
SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
+SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
+SET(GEOM_ROOT_DIR "${GEOM_ROOT_DIR}")
SET(ACIS_ROOT_DIR "${ACIS_ROOT_DIR}")
SET(OCCLICENSE_ROOT_DIR "${OCCLICENSE_ROOT_DIR}")
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
- KERNEL_ROOT_DIR ACIS_ROOT_DIR OCCLICENSE_ROOT_DIR)
+ KERNEL_ROOT_DIR GUI_ROOT_DIR GEOM_ROOT_DIR ACIS_ROOT_DIR OCCLICENSE_ROOT_DIR)
WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME_UC}_VERSION}
Installation Instructions
*************************
-Copyright (C) 2014-2015 Open CASCADE S.A.S.
+Copyright (C) 2014-2015 OPEN CASCADE
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
# Load the dependencies for the libraries of @PROJECT_NAME@
# (contains definitions for IMPORTED targets). This is only
# imported if we are not built as a subproject (in this case targets are already there)
-IF(NOT TARGET ACISExport AND NOT @PROJECT_NAME@_BINARY_DIR)
+IF(NOT TARGET ACISPluginEngine AND NOT @PROJECT_NAME@_BINARY_DIR)
INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake")
ENDIF()
#### Now the specificities
# Options exported by the package:
-#SET(SALOME_ACISPLUGIN_BUILD_DOC @SALOME_BUILD_DOC@)
+SET(SALOME_ACISPLUGIN_BUILD_DOC @SALOME_BUILD_DOC@)
SET(SALOME_ACISPLUGIN_BUILD_TESTS @SALOME_BUILD_TESTS@)
# Level 1 prerequisites:
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
+SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@")
+SET_AND_CHECK(GEOM_ROOT_DIR_EXP "@PACKAGE_GEOM_ROOT_DIR@")
SET_AND_CHECK(ACIS_ROOT_DIR_EXP "@PACKAGE_ACIS_ROOT_DIR@")
SET_AND_CHECK(OCCLICENSE_ROOT_DIR_EXP "@PACKAGE_OCCLICENSE_ROOT_DIR@")
SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
# Exposed ACISPLUGIN targets:
-SET(ACISPLUGIN_ACISExport ACISExport)
-SET(ACISPLUGIN_ACISImport ACISImport)
\ No newline at end of file
+SET(ACISPLUGIN_SalomeIDLACISPlugin SalomeIDLACISPlugin)
+SET(ACISPLUGIN_ACISPluginEngine ACISPluginEngine)
+SET(ACISPLUGIN_ACISPluginGUI ACISPluginGUI)
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+ADD_SUBDIRECTORY(salome)
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+ADD_SUBDIRECTORY(examples)
+ADD_SUBDIRECTORY(gui)
\ No newline at end of file
--- /dev/null
+# Import/Export ACIS
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+# Example of import from ACIS
+
+# get a path to SAMPLES_SRC
+import os
+thePath = os.getenv("DATA_DIR")
+# create filenames
+theFileName = thePath + "/Shapes/Sat/Bug841_Robot01_ACIS_15_Volumique.sat"
+
+# import shape
+Shape1 = geompy.ImportACIS(theFileName)
+geompy.addToStudy(Shape1, "Robot01_1")
+
+# It is possible also to use next format of importing and publishing in study
+
+Shape2 = geompy.ImportACIS(theFileName,"Robot01_2")
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
+INSTALL(FILES ${files} DESTINATION ${SALOME_INSTALL_DOC}/examples/ACISPLUGIN)
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
+SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
+SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
+SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
+
+SET(kernel_file "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
+IF(WIN32)
+ STRING(REPLACE "/" "\\" kernel_file ${kernel_file})
+ENDIF(WIN32)
+
+ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
+ COMMAND ${PYTHON_EXECUTABLE} ${kernel_file} -o tmp/ACISPluginBuilder.py ${CMAKE_SOURCE_DIR}/src/ACISPluginBuilder.py
+ COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
+ COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
+ COMMAND ${CMAKE_COMMAND} -E remove_directory tmp
+ VERBATIM
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ACISPLUGIN DESTINATION ${SALOME_INSTALL_DOC}/gui)
+INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/ACISPLUGIN)
+INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/ACISPLUGIN/acispluginpy_doc)
+
+SET(make_clean_files ACISPLUGIN acispluginpy_doc.tag)
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "SALOME ACISPLUGIN User's Guide"
+OUTPUT_DIRECTORY = ACISPLUGIN
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+TAB_SIZE = 5
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+
+#---------------------------------------------------------------------------
+#Input related options
+#---------------------------------------------------------------------------
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@/input
+FILE_PATTERNS = *.doc
+EXCLUDE =
+IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images
+EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/salome/examples
+
+#---------------------------------------------------------------------------
+#HTML related options
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = .
+HTML_HEADER = @CMAKE_CURRENT_BINARY_DIR@/static/header.html
+HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/static/footer.html
+HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/static/salome_extra.css
+TOC_EXPAND = YES
+DISABLE_INDEX = NO
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 300
+
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool...
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+HIDE_UNDOC_RELATIONS = NO
+HAVE_DOT = NO
+CLASS_GRAPH = NO
+COLLABORATION_GRAPH = NO
+GROUP_GRAPHS = NO
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = NO
+INCLUDED_BY_GRAPH = NO
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = NO
+DIRECTORY_GRAPH = NO
+DOT_IMAGE_FORMAT = jpg
+DOT_FONTNAME = Arial
+DOT_PATH =.
+DOTFILE_DIRS =.
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1200
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+
+
+GENERATE_LEGEND = NO
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+#SORT related options
+#---------------------------------------------------------------------------
+SORT_GROUP_NAMES = NO
+
+#---------------------------------------------------------------------------
+#LaTeX related option
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+EXTRA_PACKAGES = amsmath
+
+#---------------------------------------------------------------------------
+#RTF related options
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+
+#---------------------------------------------------------------------------
+#External reference options
+#---------------------------------------------------------------------------
+
+TAGFILES = acispluginpy_doc.tag=../ACISPLUGIN/acispluginpy_doc
+SEARCHENGINE = YES
+
+#---------------------------------------------------------------------------
+#Custom commands
+#---------------------------------------------------------------------------
+ALIASES += tui_script{1}="\include \1 <a href=\"../../examples/ACISPLUGIN/\1\">Download this script</a>"
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "SALOME ACISPLUGIN User's Guide"
+OUTPUT_DIRECTORY = ACISPLUGIN
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = YES
+INLINE_INHERITED_MEMB = YES
+FULL_PATH_NAMES = NO
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 5
+OPTIMIZE_OUTPUT_FOR_C = YES
+OPTIMIZE_OUTPUT_JAVA = YES
+BUILTIN_STL_SUPPORT = NO
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = YES
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = YES
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = NO
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+MAX_INITIALIZER_LINES = 25
+SHOW_USED_FILES = NO
+SHOW_DIRECTORIES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+EXCLUDE_SYMLINKS = NO
+EXAMPLE_RECURSIVE = NO
+
+#---------------------------------------------------------------------------
+#Input related options
+#---------------------------------------------------------------------------
+INPUT = tmp @CMAKE_SOURCE_DIR@/idl/ACISPlugin_Gen.idl
+FILE_PATTERNS =
+IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images
+RECURSIVE = NO
+EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/src/
+
+#---------------------------------------------------------------------------
+#HTML related options
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = acispluginpy_doc
+HTML_HEADER = @CMAKE_CURRENT_BINARY_DIR@/static/header_py.html
+HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/static/footer.html
+HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/static/salome_extra.css
+TOC_EXPAND = YES
+DISABLE_INDEX = NO
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 300
+
+#---------------------------------------------------------------------------
+#LaTeX related option
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+
+#---------------------------------------------------------------------------
+#RTF related options
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+HIDE_UNDOC_RELATIONS = NO
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = NO
+GROUP_GRAPHS = NO
+UML_LOOK = NO
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_FONTNAME = Arial
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 1000
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = NO
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+#External reference options
+#---------------------------------------------------------------------------
+GENERATE_TAGFILE = acispluginpy_doc.tag
+SEARCHENGINE = YES
--- /dev/null
+/*!
+
+\page acisplugin_importexport_page Import/Export ACIS
+
+For using ACISPLUGIN functionalities in SALOME:
+
+- Run SALOME and activate Geometry module.
+
+- Import the ACIS file from menu <b>File/Import/ACIS</b>.
+
+ \image html import_acis.png
+
+ Browse and select the file and click "Open" button. New object (shape)
+ will appears in the SALOME object browser.
+
+ \note If a plugin supports import of named shapes, it will be asked whether
+ to group or not these shapes corresponding to the type (see the picture below).
+
+ \image html group_acis.png
+
+ \par
+
+ \note It is possible to re-open from the initial file a previously imported shape if
+ the file has been changed on disk. For this, select <b>Reload From Disk</b>
+ in the context menu of the imported shape. The reloaded shape will have the same
+ representation parameters as before this operation.
+
+ \image html reopen_acis.png
+
+- Export to the ACIS file selecting a shape in the SALOME object browser and
+ calling menu <b>File/Export/ACIS</b>.
+
+ \image html export_acis.png
+
+ Enter the file name and click "Save" button.
+
+*/
--- /dev/null
+/*!
+
+\page acisplugin_python_interface_page Python Interface
+
+Python package ACISPluginBuilder defines several classes, destined for
+import and export CAD models in ACIS format (*.sat files).
+
+ACISPLUGIN dynamically adds several methods to the geomBuilder.
+
+Below you can see an example of usage of the ACISPluginBuilder package for
+import and export CAD models:
+
+\anchor example_ACISPlugin
+<h2>Example of import CAD model stored in ACIS format (*.sat files) with ACISPLUGIN:</h2>
+\tui_script{ACISPlugindemo.py}
+
+*/
+
+
--- /dev/null
+/*!
+
+\mainpage Introduction to ACISPLUGIN
+
+<b> ACIS SAT </b> interface to be used as plugin for SALOME Geometry
+module.
+It is destined for:
+- Importing CAD models stored in ACIS format (*.sat files) into
+SALOME study;
+- Exporting CAD models from SALOME to the *.sat files.
+
+To manage parameters of the ACISPLUGIN use \subpage acisplugin_importexport_page.
+
+Also all ACISPLUGIN functionalities are accessible via
+\subpage acisplugin_python_interface_page "ACISPLUGIN Python interface".
+
+*/
--- /dev/null
+<!-- HTML footer for doxygen 1.8.3.1-->
+<!--BEGIN GENERATE_TREEVIEW-->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ $navpath
+ <li class="footer">
+ Copyright © 2014-2015 OPEN CASCADE<br>
+ </li>
+ </ul>
+</div>
+<!--END GENERATE_TREEVIEW-->
+</body>
+</html>
--- /dev/null
+<!-- HTML header for doxygen 1.8.3.1-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen $doxygenversion"/>
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
+<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
+$treeview
+$search
+$mathjax
+<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
+$extrastylesheet
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+
+<div id="titlearea"><div align="right"><div class="version">Version: @SALOMEACISPLUGIN_VERSION@</div></div></div>
+<!-- end header part -->
--- /dev/null
+<!-- HTML header for doxygen 1.8.3.1-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen $doxygenversion"/>
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
+<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
+$treeview
+$search
+$mathjax
+<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
+$extrastylesheet
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+
+<div id="titlearea"><div align="right"><div class="version">Version: @SALOMEACISPLUGIN_VERSION@</div></div></div>
+<div align="bottom-left"><a href=../index.html>Home</a></div>
+<!-- end header part -->
--- /dev/null
+/* The extra CSS for doxygen 1.8.3.1 */
+
+#titlearea {
+ background-image:url('head.png');
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ padding: 0px;
+ margin: 0px;
+ width: 99.9%;
+ border-bottom: 1px solid #5373B4;
+}
+
+div.version {
+ border:1px solid #0000FF;
+ color: #CCCCCC;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ margin: 5px;
+}
+
+.navpath li.footer {
+ line-height:15px;
+ text-align: right;
+}
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+ADD_SUBDIRECTORY(ACISPLUGIN)
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef __ACISPlugin_IDL__
+#define __ACISPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module ACISPlugin
+{
+ /*!
+ * \brief Interface for ACISPlugin modeling functions.
+ */
+ interface IACISOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in ACIS format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ */
+ void ExportACIS( in GEOM::GEOM_Object theObject,
+ in string theFileName );
+
+ /*!
+ * \brief Import a shape from the ACIS file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportACIS( in string theFileName );
+ };
+};
+
+#endif // __ACISPlugin_IDL__
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+INCLUDE(UseOmniORB)
+
+INCLUDE_DIRECTORIES(
+ ${KERNEL_INCLUDE_DIRS}
+ ${GEOM_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+SET(SalomeIDLACISPlugin_IDLSOURCES
+ ACISPlugin.idl
+)
+
+SET(IDL_INCLUDE_DIRS
+ ${KERNEL_ROOT_DIR}/idl/salome
+ ${GEOM_ROOT_DIR}/idl/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+SET(IDL_LINK_FLAGS
+ ${KERNEL_SalomeIDLKernel}
+ ${GEOM_SalomeIDLGEOM}
+)
+
+OMNIORB_ADD_MODULE(SalomeIDLACISPlugin "${SalomeIDLACISPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}")
+ADD_DEPENDENCIES(SalomeIDLACISPlugin ${GEOM_SalomeIDLGEOM})
+INSTALL(TARGETS SalomeIDLACISPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014-2015 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
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="ACISPlugin"
+ server-lib="ACISPluginEngine"
+ gui-lib="ACISPluginGUI">
+ <actions>
+ <action label="Import_ACIS"
+ menu="FILE/IMPORT:10/IMPORTACIS"
+ status-bar="IMPORTACIS">
+ </action>
+ <action label="Export_ACIS"
+ menu="FILE/EXPORT:10/EXPORTACIS"
+ status-bar="EXPORTACIS">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
#
SET(ACISPLUGIN_RESOURCES_FILES
- ImportExport
+ SalomeApp.xml
+ ACISPlugin.xml
)
INSTALL(FILES ${ACISPLUGIN_RESOURCES_FILES} DESTINATION ${SALOME_ACISPLUGIN_INSTALL_RES_DATA})
+++ /dev/null
-Import: ACIS
-Export: ACIS
-
-ACIS.Import: ACISImport
-ACIS.Export: ACISExport
-ACIS.Pattern: ACIS Files ( *.sat )
--- /dev/null
+<!--
+ Copyright (C) 2014-2015 OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License.
+
+ This library is 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
+
+-->
+<document>
+ <section name="resources">
+ <parameter name="ACISPlugin" value="${ACISPLUGIN_ROOT_DIR}/share/salome/resources/acisplugin"/>
+ </section>
+ <section name="GEOM">
+ <!-- Default GEOM module plugins -->
+ <parameter name="plugins" value="ACISPlugin"/>
+ </section>
+ <section name="geom_help" >
+ <parameter name="Plug-ins/ACIS plugin User's Guide" value="${ACISPLUGIN_ROOT_DIR}/share/doc/salome/gui/ACISPLUGIN/index.html"/>
+ </section>
+</document>
+++ /dev/null
-// Copyright (C) 2014-2015 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
-//
-
-#include <ACISPLUGIN_exports.h>
-#include <ACISPLUGIN_version.h>
-
-#include <Basics_Utils.hxx>
-
-#include <IFSelect_ReturnStatus.hxx>
-#include <SatControl_Writer.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-
-#ifdef ACIS_HASLICENSE
-#include <ACISPLUGIN_license.h>
-
-#include <OCCLicense_Activate.hxx>
-#include <Standard_LicenseError.hxx>
-#endif // ACIS_HASLICENSE
-
-extern "C"
-{
- /*!
- \brief Get version of the plugin.
- \return the version of the plugin
- */
- ACISPLUGIN_EXPORT
- int GetVersion()
- {
- return ACISPLUGIN_VERSION;
- }
-
- /*!
- \brief Get version of the plugin.
- \return the string representation of the plugin's version
- */
- ACISPLUGIN_EXPORT
- char* GetVersionStr()
- {
- return (char*)ACISPLUGIN_VERSION_STR;
- }
-
- /*!
- \brief Export shape to the ACIS format.
- \param theShape shape being exported
- \param theFileName file path
- \param theFormatName file format signature
- \return error status (0 in case of success)
- */
- ACISPLUGIN_EXPORT
- int Export(const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
- {
-#ifdef ACIS_HASLICENSE
- try {
- OCCLicense_Activate("SAT-W-"OCC_VERSION_STRING, ACIS_WRITE_LICENSE);
- }
- catch (Standard_LicenseError) {
- return 1;
- }
-#endif // ACIS_HASLICENSE
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- SatControl_Writer aWriter;
-
- try {
- IFSelect_ReturnStatus status ;
- status = aWriter.TransferShape(theShape);
- if ( status == IFSelect_RetDone )
- status = aWriter.WriteFile( theFileName.ToCString() ) ;
- if ( status == IFSelect_RetDone )
- return 1;
- }
- catch(Standard_Failure) {
- return 1;
- }
- return 0;
- }
-} // end of extern "C"
+++ /dev/null
-# Copyright (C) 2014-2015 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(
- ${CAS_INCLUDE_DIRS}
- ${ACIS_INCLUDE_DIRS}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/src/common
- ${CMAKE_SOURCE_DIR}/src/common
-)
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
-)
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKernel}
- ${CAS_TKXSBase}
- ${ACIS_LIBRARIES}
- ${KERNEL_SALOMEBasics}
-)
-
-# --- sources ---
-
-# sources / static
-SET(ACISExport_SOURCES
- ACISExport.cxx
-)
-
-# --- rules ---
-
-ADD_LIBRARY(ACISExport ${ACISExport_SOURCES})
-TARGET_LINK_LIBRARIES(ACISExport ${_link_LIBRARIES} )
-INSTALL(TARGETS ACISExport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+++ /dev/null
-// Copyright (C) 2014-2015 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
-//
-
-#include <ACISPLUGIN_exports.h>
-#include <ACISPLUGIN_version.h>
-
-#include <Basics_Utils.hxx>
-
-#include <AcisAttr_AttribGenName.hxx>
-#include <AcisEnt_Attrib.hxx>
-#include <IFSelect_ReturnStatus.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <SatControl_Reader.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDF_Label.hxx>
-#include <TNaming_Builder.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TransferBRep.hxx>
-#include <Transfer_Binder.hxx>
-#include <Transfer_TransientProcess.hxx>
-#include <XSControl_TransferReader.hxx>
-#include <XSControl_WorkSession.hxx>
-
-#ifdef ACIS_HASLICENSE
-#include <ACISPLUGIN_license.h>
-
-#include <OCCLicense_Activate.hxx>
-#include <Standard_LicenseError.hxx>
-#endif // ACIS_HASLICENSE
-
-extern "C"
-{
- /*!
- \brief Get version of the plugin.
- \return the version of the plugin
- */
- ACISPLUGIN_EXPORT
- int GetVersion()
- {
- return ACISPLUGIN_VERSION;
- }
-
- /*!
- \brief Get version of the plugin.
- \return the string representation of the plugin's version
- */
- ACISPLUGIN_EXPORT
- char* GetVersionStr()
- {
- return (char*)ACISPLUGIN_VERSION_STR;
- }
-
- /*!
- \brief Import shape from the ACIS format.
- \param theFileName file path
- \param theFormatName file format signature
- \param theError error description, if there's any, is returned via this parameter
- \param theShapeLabel a label in the CAF tree where shape attributes are set to
- \return imported shape
- */
- ACISPLUGIN_EXPORT
- TopoDS_Shape Import(const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& /*theFormatName*/,
- TCollection_AsciiString& theError,
- const TDF_Label& theShapeLabel)
- {
- TopoDS_Shape aResShape;
-
-#ifdef ACIS_HASLICENSE
- try {
- OCCLicense_Activate( "SAT-R-"OCC_VERSION_STRING, ACIS_READ_LICENSE);
- }
- catch (Standard_LicenseError) {
- return aResShape;
- }
-#endif // ACIS_HASLICENSE
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- SatControl_Reader aReader;
-
- try {
- IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
- if (status == IFSelect_RetDone) {
- aReader.TransferRoots();
- aResShape = aReader.OneShape();
- Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
- Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
- if( !TR.IsNull() ) {
- Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
- Standard_Integer nb = Model->NbEntities();
- for (Standard_Integer i = 1; i <= nb; i ++) {
- Handle(AcisEnt_Attrib) attr = Handle(AcisEnt_Attrib)::DownCast ( Model->Value(i) );
- if ( attr.IsNull() ) continue; //not only Entity Label (f.18) but Name Property also
-
- TCollection_AsciiString aName;
- if ( attr->IsKind(STANDARD_TYPE(AcisAttr_AttribGenName)) ) {
- Handle(AcisAttr_AttribGenName) attrname = Handle(AcisAttr_AttribGenName)::DownCast ( attr );
- aName = attrname->myNameAttr;
- }
- else continue; // no name assigned
-
- // find target entity
- Handle(AcisEnt_Entity) ent;
- do {
- ent = attr->myEntity;
- attr = Handle(AcisEnt_Attrib)::DownCast ( ent );
- } while ( ! attr.IsNull() );
- if ( ent.IsNull() ) continue; // strange - no normal entity found ?
-
- // find target shape
- Handle(Transfer_Binder) binder = TP->Find ( ent );
- if ( binder.IsNull() ) continue;
- TopoDS_Shape S = TransferBRep::ShapeResult (binder);
- if ( S.IsNull() ) continue;
-
- //if( S.IsEqual(aResShape) ) continue;
-
- // create label and set shape
- TDF_Label L;
- TDF_TagSource aTag;
- L = aTag.NewChild(theShapeLabel);
- TNaming_Builder tnBuild(L);
- tnBuild.Generated(S);
-
- // set a name
- TCollection_ExtendedString str(aName);
- TDataStd_Name::Set(L,str);
- }
- }
- }
- else {
- theError = "Wrong format of the imported file. Can't import file.";
- aResShape.Nullify();
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
- aResShape.Nullify();
- }
- return aResShape;
- }
-} // end of extern "C"
-
+++ /dev/null
-# Copyright (C) 2014-2015 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(
- ${CAS_INCLUDE_DIRS}
- ${ACIS_INCLUDE_DIRS}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/src/common
- ${CMAKE_SOURCE_DIR}/src/common
-)
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
-)
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKernel}
- ${CAS_TKXSBase}
- ${CAS_TKCAF}
- ${CAS_TKLCAF}
- ${CAS_TKMath}
- ${CAS_TKBRep}
- ${ACIS_LIBRARIES}
- ${KERNEL_SALOMEBasics}
-)
-
-# --- sources ---
-
-# sources / static
-SET(ACISImport_SOURCES
- ACISImport.cxx
-)
-
-# --- rules ---
-
-ADD_LIBRARY(ACISImport ${ACISImport_SOURCES})
-TARGET_LINK_LIBRARIES(ACISImport ${_link_LIBRARIES} )
-INSTALL(TARGETS ACISImport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014-2015 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
+#
+
+from ACISPlugin import IACISOperations
+
+# Engine Library Name
+__libraryName__ = "ACISPluginEngine"
+
+def GetACISPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(IACISOperations)
+
+## Export the given shape into a file with given name in ACIS format.
+# @param theObject Shape to be stored in the file.
+# @param theFileName Name of the file to store the given shape in.
+def ExportACIS(self, theObject, theFileName):
+ """
+ Export the given shape into a file with given name in ACIS format.
+
+ Parameters:
+ theObject Shape to be stored in the file.
+ theFileName Name of the file to store the given shape in.
+ """
+ anOp = GetACISPluginOperations(self)
+ anOp.ExportACIS(theObject, theFileName)
+ if anOp.IsDone() == 0:
+ raise RuntimeError, "Export : " + anOp.GetErrorCode()
+ pass
+ pass
+
+
+## Import a shape from the ACIS file
+# @param theFileName The file, containing the shape.
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM.GEOM_Object, containing the imported shape.
+# If material names are imported it returns the list of
+# objects. The first one is the imported object followed by
+# material groups.
+# @note Auto publishing is allowed for the shape itself. Imported
+# material groups are not automatically published.
+def ImportACIS(self, theFileName, theName=None):
+ """
+ Import a shape from the ACIS file
+
+ Parameters:
+ theFileName The file, containing the shape.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the imported shape.
+ If material names are imported it returns the list of
+ objects. The first one is the imported object followed by
+ material groups.
+ Note:
+ Auto publishing is allowed for the shape itself. Imported
+ material groups are not automatically published.
+ """
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetACISPluginOperations(self)
+ aListObj = anOp.ImportACIS(theFileName)
+ RaiseIfFailed("ImportACIS", anOp)
+ aNbObj = len(aListObj)
+ if aNbObj > 0:
+ self._autoPublish(aListObj[0], theName, "imported")
+ if aNbObj == 1:
+ return aListObj[0]
+ return aListObj
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+#include "ACISPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ ACISPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new ACISPlugin_OperationsCreator();
+ }
+}
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPLUGIN_ENGINE_HXX_
+#define _ACISPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined ACISPLUGINENGINE_EXPORTS || defined ACISPluginEngine_EXPORTS
+ #define ACISPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define ACISPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define ACISPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_ExportDriver.hxx"
+#include "ACISPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <Basics_Utils.hxx>
+#include <utilities.h>
+
+// GEOM includes
+#include <GEOM_Function.hxx>
+
+// OOCT includes
+#include <IFSelect_ReturnStatus.hxx>
+#include <SatControl_Writer.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TopoDS_Shape.hxx>
+
+#ifdef ACIS_HASLICENSE
+#include "ACISPlugin_license.h"
+
+#include <OCCLicense_Activate.hxx>
+#include <Standard_LicenseError.hxx>
+#endif // ACIS_HASLICENSE
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& ACISPlugin_ExportDriver::GetID()
+{
+ static Standard_GUID aGUID("4a0b4b3f-e3c7-4a7a-91c3-1f004baa0813");
+ return aGUID;
+}
+
+//=======================================================================
+//function : ACISPlugin_ExportDriver
+//purpose :
+//=======================================================================
+ACISPlugin_ExportDriver::ACISPlugin_ExportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer ACISPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+{
+#ifdef ACIS_HASLICENSE
+ try {
+ OCCLicense_Activate("SAT-W-"OCC_VERSION_STRING, ACIS_WRITE_LICENSE);
+ }
+ catch (Standard_LicenseError) {
+ return 1;
+ }
+#endif // ACIS_HASLICENSE
+
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ ACISPlugin_IExport aData (aFunction);
+
+ // retrieve the being exported shape
+ TopoDS_Shape aShape;
+ Handle(GEOM_Function) aRefFunction = aData.GetOriginal();
+ if( aRefFunction.IsNull() ) return 0;
+ aShape = aRefFunction->GetValue();
+ if( aShape.IsNull() ) return 0;
+ // set the result of function to be used by next operations
+ aFunction->SetValue( aShape );
+
+ TCollection_AsciiString aFileName = aData.GetFileName();
+
+ MESSAGE("Export ACIS into file " << aFileName.ToCString());
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ SatControl_Writer aWriter;
+
+ IFSelect_ReturnStatus status;
+ status = aWriter.TransferShape( aShape );
+ if ( status == IFSelect_RetDone )
+ status = aWriter.WriteFile( aFileName.ToCString() ) ;
+ if ( status == IFSelect_RetDone )
+ return 1;
+ else
+ return 0;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean ACISPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+bool ACISPlugin_ExportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ return false;
+}
+
+IMPLEMENT_STANDARD_HANDLE( ACISPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( ACISPlugin_ExportDriver,GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPlugin_ExportDriver_HXX
+#define _ACISPlugin_ExportDriver_HXX
+
+// GEOM includes
+#include <GEOM_BaseDriver.hxx>
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( ACISPlugin_ExportDriver, GEOM_BaseDriver );
+
+class ACISPlugin_ExportDriver : public GEOM_BaseDriver
+{
+public:
+ ACISPlugin_ExportDriver();
+ ~ACISPlugin_ExportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& heOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( ACISPlugin_ExportDriver )
+};
+
+#endif // _ACISPlugin_ExportDriver_HXX
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_GUI.h"
+#include "ACISPlugin_IOperations_i.hh"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Tools.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(ACISPlugin)
+
+//=======================================================================
+// function : ACISPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+ACISPlugin_GUI::ACISPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~ACISPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+ACISPlugin_GUI::~ACISPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_ACIS";
+ case 2:
+ cmd = "Import_ACIS";
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if ( theCommandID == "Export_ACIS" )
+ {
+ result = exportACIS( parent );
+ }
+ else if ( theCommandID == "Import_ACIS" )
+ {
+ result = importACIS( parent );
+ }
+ else
+ {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+ return result;
+}
+
+//=======================================================================
+// function : importACIS
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::importACIS( SUIT_Desktop* parent )
+{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
+ if ( !study ) return false;
+
+ SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "ACISPluginEngine" );
+ ACISPlugin::IACISOperations_var acisOp = ACISPlugin::IACISOperations::_narrow( op );
+ if ( CORBA::is_nil( acisOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "ACIS_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+
+ SUIT_MessageBox::StandardButton acisAnswer = SUIT_MessageBox::NoButton;
+
+ foreach( QString fileName, fileNames )
+ {
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, acisOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) );
+ transaction.start();
+
+ if ( acisAnswer != SUIT_MessageBox::YesToAll && acisAnswer != SUIT_MessageBox::NoToAll ) {
+ SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
+ btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
+ acisAnswer = SUIT_MessageBox::question( app->desktop(),
+ "Question",
+ tr("GEOM_PUBLISH_NAMED_SHAPES"),
+ btns | SUIT_MessageBox::Cancel,
+ SUIT_MessageBox::No );
+ if ( acisAnswer == SUIT_MessageBox::Cancel ) {
+ acisOp->SetErrorCode(OK);
+ return true; // cancel (break) import operation
+ }
+ }
+ GEOM::ListOfGO_var result = acisOp->ImportACIS( fileName.toUtf8().constData() );
+
+ if ( result->length() > 0 && acisOp->IsDone() ) {
+ GEOM::GEOM_Object_var main = result[0];
+ QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
+ main.in()->SetName( publishName.toStdString().c_str() );
+ SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
+ SALOMEDS::SObject::_nil(),
+ main.in(),
+ publishName.toUtf8().constData() );
+ if ( acisAnswer == SUIT_MessageBox::Yes || acisAnswer == SUIT_MessageBox::YesToAll )
+ GeometryGUI::GetGeomGen()->PublishNamedShapesInStudy( dsStudy, main.in() );
+
+ entryList.append( so->GetID() );
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( acisOp->GetErrorCode() ) );
+ }
+ }
+ catch( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ }
+ }
+ getGeometryGUI()->updateObjBrowser( true );
+ app->browseObjects( entryList );
+
+ if ( errors.count() > 0 )
+ {
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ }
+ }
+ return fileNames.count() > 0;
+}
+
+//=======================================================================
+// function : exportACIS
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::exportACIS( SUIT_Desktop* parent )
+{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
+ if ( !study ) return false;
+
+ SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "ACISPluginEngine" );
+ ACISPlugin::IACISOperations_var acisOp = ACISPlugin::IACISOperations::_narrow( op );
+ if ( CORBA::is_nil( acisOp ) ) return false;
+
+ LightApp_SelectionMgr* sm = app->selectionMgr();
+ if ( !sm ) return false;
+
+ SALOME_ListIO selectedObjects;
+ sm->selectedObjects( selectedObjects );
+ bool ok = false;
+
+ SALOME_ListIteratorOfListIO it( selectedObjects );
+ for ( ; it.More(); it.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = it.Value();
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+
+ if ( CORBA::is_nil( obj ) ) continue;
+
+ QString fileName = app->getFileName( false,
+ QString( io->getName() ),
+ tr( "ACIS_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, acisOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ acisOp->ExportACIS( obj, fileName.toUtf8().constData() );
+
+ if ( acisOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( acisOp->GetErrorCode() ) );
+ return false;
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ return false;
+ }
+ ok = true;
+ }
+
+ if ( !ok )
+ {
+ SUIT_MessageBox::warning( parent,
+ tr( "WRN_WARNING" ),
+ tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) );
+ }
+ return ok;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new ACISPlugin_GUI( parent );
+ }
+}
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef ACISPlugin_GUI_H
+#define ACISPlugin_GUI_H
+
+#include <GEOMPluginGUI.h>
+
+class ACISPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ ACISPlugin_GUI( GeometryGUI* parent );
+ ~ACISPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importACIS( SUIT_Desktop* );
+ bool exportACIS( SUIT_Desktop* );
+};
+
+#endif // ACISPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_IECallBack.hxx"
+#include "ACISPlugin_IOperations.hxx"
+#include "ACISPlugin_OperationsCreator.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+ACISPlugin_IECallBack::ACISPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+ACISPlugin_IECallBack::~ACISPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool ACISPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ ACISPlugin_IOperations* aPluginOperations = ACISPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ aPluginOperations->ExportACIS( theOriginal, theFileName );
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+ACISPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
+{
+ ACISPlugin_IOperations* aPluginOperations = ACISPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ImportACIS( theFileName );
+}
+
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPlugin_IECallBack_HXX_
+#define _ACISPlugin_IECallBack_HXX_
+
+// internal includes
+#include "ACISPlugin_IOperations.hxx"
+
+// GEOM includes
+#include <GEOM_Object.hxx>
+#include <GEOMImpl_IECallBack.hxx>
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class ACISPLUGINENGINE_EXPORT ACISPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ ACISPlugin_IECallBack();
+ ~ACISPlugin_IECallBack();
+
+ bool Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
+
+ Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPlugin_IExport_HXX_
+#define _ACISPlugin_IExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define EXPORTACIS_ARG_ORIGINAL 1
+#define EXPORTACIS_ARG_FILENAME 2
+
+class ACISPlugin_IExport
+{
+public:
+ ACISPlugin_IExport( Handle(GEOM_Function) theFunction )
+ : _func(theFunction) {}
+
+ void SetOriginal( Handle( GEOM_Function ) theOriginal)
+ { _func->SetReference( EXPORTACIS_ARG_ORIGINAL, theOriginal ); }
+ Handle( GEOM_Function ) GetOriginal()
+ { return _func->GetReference( EXPORTACIS_ARG_ORIGINAL ); }
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( EXPORTACIS_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( EXPORTACIS_ARG_FILENAME ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _ACISPlugin_IExport_HXX_
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPlugin_IImport_HXX_
+#define _ACISPlugin_IImport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define IMPORTACIS_ARG_FILENAME 1
+
+class ACISPlugin_IImport
+{
+public:
+ ACISPlugin_IImport( Handle(GEOM_Function) theFunction)
+ : _func(theFunction) {}
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( IMPORTACIS_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( IMPORTACIS_ARG_FILENAME ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _ACISPlugin_IImport_HXX_
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_IOperations.hxx"
+#include "ACISPlugin_ExportDriver.hxx"
+#include "ACISPlugin_ImportDriver.hxx"
+#include "ACISPlugin_IExport.hxx"
+#include "ACISPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+// GEOM includes
+#include <GEOM_PythonDump.hxx>
+#include <GEOMImpl_Types.hxx>
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+ACISPlugin_IOperations::ACISPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "ACISPlugin_IOperations::ACISPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+ACISPlugin_IOperations::~ACISPlugin_IOperations()
+{
+ MESSAGE( "ACISPlugin_IOperations::~ACISPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * ExportACIS
+ * Export a shape to ACIS format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the file to exported
+ */
+//=============================================================================
+void ACISPlugin_IOperations::ExportACIS( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName )
+{
+ SetErrorCode(KO);
+ if( theOriginal.IsNull() ) return;
+
+ Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
+ if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
+
+ //Add a new result object
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+
+ //Add an Export function
+ Handle(GEOM_Function) aFunction = result->AddFunction( ACISPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
+ if( aFunction.IsNull() ) return;
+
+ //Check if the function is set correctly
+ if( aFunction->GetDriverGUID() != ACISPlugin_ExportDriver::GetID() ) return;
+
+ //Set parameters
+ ACISPlugin_IExport aCI( aFunction );
+ aCI.SetOriginal( aRefFunction );
+ aCI.SetFileName( theFileName );
+
+ //Perform the Export
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" );
+ return;
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "geompy.ExportACIS(" << theOriginal << ", \""
+ << theFileName.ToCString() << "\" )";
+
+ SetErrorCode(OK);
+}
+
+//=============================================================================
+/*!
+ * ImportACIS
+ * Import a shape from ACIS format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+ACISPlugin_IOperations::ImportACIS( const TCollection_AsciiString& theFileName )
+{
+ SetErrorCode(KO);
+ if( theFileName.IsEmpty() ) return NULL;
+
+ //Add a new result object
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+
+ //Add an Import function
+ Handle(GEOM_Function) aFunction =
+ anImported->AddFunction( ACISPlugin_ImportDriver::GetID(), IMPORT_SHAPE);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != ACISPlugin_ImportDriver::GetID()) return NULL;
+
+ //Set parameters
+ ACISPlugin_IImport aCI( aFunction );
+ aCI.SetFileName( theFileName );
+
+ //Perform the Import
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Import driver failed" );
+ return NULL;
+ }
+ aSeq->Append(anImported);
+
+ // Greate material groups.
+ //MakeMaterialGroups( anImported, aSeq );
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ pd << aSeq << " = geompy.ImportACIS(\"" << theFileName.ToCString() << "\" )";
+ SetErrorCode(OK);
+
+ return aSeq;
+}
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+// File : ACISPlugin_IOperations.hxx
+
+#ifndef _ACISPlugin_IOperations_HXX_
+#define _ACISPlugin_IOperations_HXX_
+
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+
+// GEOM includes
+#include <GEOMImpl_IBaseIEOperations.hxx>
+
+class ACISPLUGINENGINE_EXPORT ACISPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ ACISPlugin_IOperations( GEOM_Engine*, int );
+ ~ACISPlugin_IOperations();
+
+ void ExportACIS( const Handle(GEOM_Object),
+ const TCollection_AsciiString& );
+
+ Handle(TColStd_HSequenceOfTransient) ImportACIS( const TCollection_AsciiString& );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_IOperations_i.hh"
+#include "ACISPlugin_IOperations.hxx"
+#include <ACISPLUGIN_version.h>
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+ACISPlugin_IOperations_i::ACISPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::ACISPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "ACISPlugin_Operations_i::ACISPlugin_Operations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+ACISPlugin_IOperations_i::~ACISPlugin_IOperations_i()
+{
+ MESSAGE( "ACISPlugin_Operations_i::~ACISPlugin_Operations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportACIS
+ * Export a shape to ACIS format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the exported file
+ */
+//=============================================================================
+void ACISPlugin_IOperations_i::ExportACIS( GEOM::GEOM_Object_ptr theOriginal,
+ const char* theFileName )
+{
+ // duplicate the original shape
+ GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference shape
+ Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
+ if (anOriginal.IsNull()) return;
+
+ //Export the shape to the file
+ GetOperations()->ExportACIS( anOriginal, theFileName );
+}
+
+//=============================================================================
+/*!
+ * ImportACIS
+ * Import a shape from ACIS format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* ACISPlugin_IOperations_i::ImportACIS( const char* theFileName )
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Import the shape from the file
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportACIS( theFileName );
+
+ if( !GetOperations()->IsDone() || aHSeq.IsNull() )
+ return aSeq._retn();
+
+ // Copy created objects.
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length( aLength );
+ for( Standard_Integer i = 1; i <= aLength; i++ )
+ aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) );
+
+ return aSeq._retn();
+}
+
+ACISPlugin_IOperations* ACISPlugin_IOperations_i::GetOperations()
+{
+ return (ACISPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPlugin_IOperations_i_HeaderFile
+#define _ACISPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( ACISPlugin )
+
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+
+// GEOM includes
+#include <GEOM_IOperations_i.hh>
+
+class ACISPlugin_IOperations;
+
+class ACISPLUGINENGINE_EXPORT ACISPlugin_IOperations_i :
+ public virtual POA_ACISPlugin::IACISOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ ACISPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ACISPlugin_IOperations* theImpl );
+ ~ACISPlugin_IOperations_i();
+
+ void ExportACIS( GEOM::GEOM_Object_ptr, const char* );
+ GEOM::ListOfGO* ImportACIS( const char* );
+
+ ACISPlugin_IOperations* GetOperations();
+};
+
+#endif // _ACISPlugin_IOperations_i_HeaderFile
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_ImportDriver.hxx"
+#include "ACISPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <Basics_Utils.hxx>
+#include <utilities.h>
+
+// GEOM includes
+#include <GEOM_Function.hxx>
+#include <GEOMImpl_Types.hxx>
+
+// OOCT includes
+#include <AcisAttr_AttribGenName.hxx>
+#include <AcisEnt_Attrib.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <SatControl_Reader.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDF_Label.hxx>
+#include <TNaming_Builder.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TransferBRep.hxx>
+#include <Transfer_Binder.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XSControl_WorkSession.hxx>
+
+#include <StdFail_NotDone.hxx>
+
+#ifdef ACIS_HASLICENSE
+#include "ACISPlugin_license.h"
+
+#include <OCCLicense_Activate.hxx>
+#include <Standard_LicenseError.hxx>
+#endif // ACIS_HASLICENSE
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& ACISPlugin_ImportDriver::GetID()
+{
+ static Standard_GUID aGUID("4e2fea67-84bc-44fe-9a32-ac52a246154c");
+ return aGUID;
+}
+
+//=======================================================================
+//function : ACISPlugin_ImportDriver
+//purpose :
+//=======================================================================
+ACISPlugin_ImportDriver::ACISPlugin_ImportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer ACISPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ ACISPlugin_IImport aData( aFunction );
+
+ TCollection_AsciiString aFileName = aData.GetFileName().ToCString();
+
+ MESSAGE("Import ACIS from file " << aFileName);
+ TopoDS_Shape aResShape;
+
+#ifdef ACIS_HASLICENSE
+ try {
+ OCCLicense_Activate( "SAT-R-"OCC_VERSION_STRING, ACIS_READ_LICENSE);
+ }
+ catch (Standard_LicenseError) {
+ return aResShape;
+ }
+#endif // ACIS_HASLICENSE
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ SatControl_Reader aReader;
+
+ IFSelect_ReturnStatus status = aReader.ReadFile( aFileName.ToCString() );
+ if (status == IFSelect_RetDone) {
+ aReader.TransferRoots();
+ aResShape = aReader.OneShape();
+ Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
+ Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
+ if( !TR.IsNull() ) {
+ Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
+ Standard_Integer nb = Model->NbEntities();
+ for (Standard_Integer i = 1; i <= nb; i ++) {
+ Handle(AcisEnt_Attrib) attr = Handle(AcisEnt_Attrib)::DownCast ( Model->Value(i) );
+ if ( attr.IsNull() ) continue; //not only Entity Label (f.18) but Name Property also
+
+ TCollection_AsciiString aName;
+ if( attr->IsKind(STANDARD_TYPE(AcisAttr_AttribGenName)) ) {
+ Handle(AcisAttr_AttribGenName) attrname = Handle(AcisAttr_AttribGenName)::DownCast ( attr );
+ aName = attrname->myNameAttr;
+ }
+ else continue; // no name assigned
+
+ // find target entity
+ Handle(AcisEnt_Entity) ent;
+ do {
+ ent = attr->myEntity;
+ attr = Handle(AcisEnt_Attrib)::DownCast ( ent );
+ } while ( ! attr.IsNull() );
+ if ( ent.IsNull() ) continue; // strange - no normal entity found ?
+
+ // find target shape
+ Handle(Transfer_Binder) binder = TP->Find ( ent );
+ if( binder.IsNull() ) continue;
+ TopoDS_Shape S = TransferBRep::ShapeResult (binder);
+ if( S.IsNull() ) continue;
+
+ // create label and set shape
+ TDF_Label L;
+ TDF_TagSource aTag;
+ L = aTag.NewChild(aFunction->GetNamingEntry());
+ TNaming_Builder tnBuild(L);
+ tnBuild.Generated(S);
+
+ // set a name
+ TCollection_ExtendedString str(aName);
+ TDataStd_Name::Set(L,str);
+ }
+ }
+ }
+ else {
+ TCollection_AsciiString anError = "Wrong format of the imported file. Can't import file.";
+ StdFail_NotDone::Raise( anError.ToCString() );
+ aResShape.Nullify();
+ }
+
+ if( aResShape.IsNull() ) return 0;
+
+ aFunction->SetValue( aResShape );
+
+ log.SetTouched( Label() );
+
+ return 1;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean ACISPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool ACISPlugin_ImportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction( Label() );
+
+ ACISPlugin_IImport aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "ImportACIS";
+
+ switch ( aType ) {
+ case IMPORT_SHAPE:
+ AddParam( theParams, "File name", aCI.GetFileName() );
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE( ACISPlugin_ImportDriver, GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( ACISPlugin_ImportDriver, GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _ACISPlugin_ImportDriver_HXX
+#define _ACISPlugin_ImportDriver_HXX
+
+// GEOM includes
+#include <GEOM_BaseDriver.hxx>
+
+// OCCT includes
+#ifndef _TFunction_Logbook_HeaderFile
+#include <TFunction_Logbook.hxx>
+#endif
+
+DEFINE_STANDARD_HANDLE( ACISPlugin_ImportDriver, GEOM_BaseDriver );
+
+class ACISPlugin_ImportDriver : public GEOM_BaseDriver
+{
+public:
+ ACISPlugin_ImportDriver();
+ ~ACISPlugin_ImportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( ACISPlugin_ImportDriver )
+};
+
+#endif // _ACISPlugin_ImportDriver_HXX
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+// internal includes
+#include "ACISPlugin_OperationsCreator.hxx"
+#include "ACISPlugin_IOperations_i.hh"
+#include "ACISPlugin_ExportDriver.hxx"
+#include "ACISPlugin_ImportDriver.hxx"
+#include "ACISPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// GEOM includes
+#include <GEOMImpl_IECallBack.hxx>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, ACISPlugin_IOperations*> ACISPlugin_OperationsCreator::_mapOfOperations;
+
+ACISPlugin_OperationsCreator::ACISPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( ACISPlugin_ExportDriver::GetID(),
+ new ACISPlugin_ExportDriver() );
+ TFunction_DriverTable::Get()->AddDriver( ACISPlugin_ImportDriver::GetID(),
+ new ACISPlugin_ImportDriver() );
+ // Register callback
+ ACISPlugin_IECallBack* callback = new ACISPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "ACIS", callback );
+}
+
+ACISPlugin_OperationsCreator::~ACISPlugin_OperationsCreator()
+{
+}
+
+GEOM_IOperations_i* ACISPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl )
+{
+ Unexpect aCatch( SALOME_SalomeException );
+ MESSAGE( "ACISPlugin_OperationsCreator::Create" );
+ return new ACISPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+}
+
+ACISPlugin_IOperations* ACISPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new ACISPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#ifndef _GEOM_ACISPlugin_OperationsCreator_HXX_
+#define _GEOM_ACISPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class ACISPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class ACISPLUGINENGINE_EXPORT ACISPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ ACISPlugin_OperationsCreator();
+ ~ACISPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+
+private:
+ static ACISPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+ static std::map <int, ACISPlugin_IOperations*> _mapOfOperations;
+
+ friend class ACISPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2015 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
+//
+
+#if !defined(__ACISPLUGIN_LICENSE_H)
+#define __ACISPLUGIN_LICENSE_H
+
+#define ACIS_READ_LICENSE "@ACIS_READ_LICENSE@"
+#define ACIS_WRITE_LICENSE "@ACIS_WRITE_LICENSE@"
+
+#endif // __ACISPLUGIN_LICENSE_H
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-ADD_SUBDIRECTORY(common)
-ADD_SUBDIRECTORY(ACISExport)
-ADD_SUBDIRECTORY(ACISImport)
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${ACIS_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}
+ ${PROJECT_BINARY_DIR}/idl
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${GEOM_INCLUDE_DIRS}
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ )
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKXSBase}
+ ${ACIS_LIBRARIES}
+ ${KERNEL_SALOMEBasics}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ ${GEOM_SalomeIDLGEOM}
+ ${GEOM_GEOMEngine}
+ ${GEOM_GEOMImpl}
+ ${GEOM_GEOMClient}
+ SalomeIDLACISPlugin
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLACISPlugin
+ ${GEOM_GEOMObject}
+ ${GEOM_GEOMBase}
+ ${GEOM_GEOMBase}
+ )
+ENDIF()
+
+
+# --- headers ---
+
+SET(ACISPluginEngine_HEADERS
+ ACISPlugin_IOperations_i.hh
+ ACISPlugin_Engine.hxx
+ ACISPlugin_OperationsCreator.hxx
+ ACISPlugin_IOperations.hxx
+ ACISPlugin_IExport.hxx
+ ACISPlugin_IImport.hxx
+ ACISPlugin_ImportDriver.hxx
+ ACISPlugin_ExportDriver.hxx
+ ACISPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ ACISPlugin_GUI.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(ACISPluginGUI_SOURCES
+ ACISPlugin_GUI.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(ACISPluginEngine_SOURCES
+ ACISPlugin_Engine.cxx
+ ACISPlugin_OperationsCreator.cxx
+ ACISPlugin_IOperations_i.cc
+ ACISPlugin_IOperations.cxx
+ ACISPlugin_ExportDriver.cxx
+ ACISPlugin_ImportDriver.cxx
+ ACISPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(ACISPlugin_RESOURCES
+ resources/ACISPlugin_msg_en.ts
+ resources/ACISPlugin_msg_fr.ts
+ resources/ACISPlugin_msg_ja.ts
+ )
+
+# ACIS plugin scripts
+SET(_python_ACIS_SCRIPTS
+ ACISPluginBuilder.py
+ __init__.py
+)
+
+# --- rules ---
+
+# install Engine library
+ADD_LIBRARY(ACISPluginEngine ${ACISPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(ACISPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS ACISPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+# install GUI library
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(ACISPluginGUI ${ACISPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(ACISPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS ACISPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+ # install resources
+ QT4_INSTALL_TS_RESOURCES("${ACISPlugin_RESOURCES}" "${SALOME_ACISPLUGIN_INSTALL_RES_DATA}")
+ENDIF()
+
+# install headers
+INSTALL(FILES ${ACISPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+
+# install python scripts
+SALOME_INSTALL_SCRIPTS("${_python_ACIS_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/ACISPlugin DEF_PERMS)
+
+# configure license file
+CONFIGURE_FILE(ACISPlugin_license.h.in ACISPlugin_license.h)
--- /dev/null
+# Copyright (C) 2014-2015 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
+#
+
+# ACISPLUGIN : binding of C++ implementation with Python
+# File : __init__.py
+#
+++ /dev/null
-// Copyright (C) 2014-2015 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
-//
-
-#if !defined (__ACISPLUGIN_EXPORTS_H)
-#define __ACISPLUGIN_EXPORTS_H
-
-#ifdef WIN32
-# if defined ACISExport_EXPORTS || defined ACISEXPORTS_EXPORTS || defined ACISImport_EXPORTS || defined ACISIMPORT_EXPORTS
-# define ACISPLUGIN_EXPORT __declspec(dllexport)
-# else
-# define ACISPLUGIN_EXPORT __declspec(dllimport)
-# endif
-#else // WIN32
-# define ACISPLUGIN_EXPORT
-#endif // WIN32
-
-#endif // __ACISPLUGIN_EXPORTS_H
+++ /dev/null
-// Copyright (C) 2014-2015 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
-//
-
-#if !defined(__ACISPLUGIN_LICENSE_H)
-#define __ACISPLUGIN_LICENSE_H
-
-#define ACIS_READ_LICENSE "@ACIS_READ_LICENSE@"
-#define ACIS_WRITE_LICENSE "@ACIS_WRITE_LICENSE@"
-
-#endif // __ACISPLUGIN_LICENSE_H
+++ /dev/null
-# Copyright (C) 2014-2015 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
-#
-
-CONFIGURE_FILE(ACISPLUGIN_license.h.in ACISPLUGIN_license.h)
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTACIS</source>
+ <translation>ACIS</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTACIS</source>
+ <translation>Export ACIS</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTACIS</source>
+ <translation>Export ACIS</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTACIS</source>
+ <translation>ACIS</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTACIS</source>
+ <translation>Import ACIS</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTACIS</source>
+ <translation>Import ACIS</translation>
+ </message>
+</context>
+<context>
+ <name>ACISPlugin_GUI</name>
+ <message>
+ <source>ACIS_FILES</source>
+ <translation>ACIS files( *.sat )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Export ACIS</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Import ACIS</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTACIS</source>
+ <translation>ACIS</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTACIS</source>
+ <translation>Exporter ACIS</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTACIS</source>
+ <translation>Exporter ACIS</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTACIS</source>
+ <translation>ACIS</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTACIS</source>
+ <translation>Importer ACIS</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTACIS</source>
+ <translation>Importer ACIS</translation>
+ </message>
+</context>
+<context>
+ <name>ACISPlugin_GUI</name>
+ <message>
+ <source>ACIS_FILES</source>
+ <translation>ACIS Fichiers( *.sat )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Exporter ACIS</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Importer ACIS</translation>
+ </message>
+</context>
+</TS>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTACIS</source>
+ <translation type="unfinished">ACIS</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTACIS</source>
+ <translation type="unfinished">Export ACIS</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTACIS</source>
+ <translation type="unfinished">Export ACIS</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTACIS</source>
+ <translation type="unfinished">ACIS</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTACIS</source>
+ <translation type="unfinished">Import ACIS</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTACIS</source>
+ <translation type="unfinished">Import ACIS</translation>
+ </message>
+</context>
+<context>
+ <name>ACISPlugin_GUI</name>
+ <message>
+ <source>ACIS_FILES</source>
+ <translation type="unfinished">ACIS files( *.sat )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation type="unfinished">Export ACIS</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation type="unfinished">Import ACIS</translation>
+ </message>
+</context>
+</TS>
\ No newline at end of file