# Directories
# (default values taken from KERNEL)
# ===========
-SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries")
-SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
-SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
-SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
+SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: executables")
+SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: libraries")
+SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: IDL files")
+SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: headers")
SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
- "Install path: SALOME scripts")
+ "Install path: scripts")
SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
- "Install path: SALOME script data")
+ "Install path: script data")
SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
- "Install path: SALOME Python scripts")
-SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
-SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
- "Install path: SALOME Python shared modules")
-SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: SALOME CMake files")
+ "Install path: Python modules")
+SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: Python stuff")
+SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: CMake files")
SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
- "Install path: local SALOME CMake files")
+ "Install path: local CMake files")
SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH
- "Install path: local SALOME config files (obsolete, to be removed)")
+ "Install config files (obsolete, to be removed)")
-SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources")
-SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
+SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: resources")
+SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: documentation")
# Specific to GEOM:
SET(SALOME_GEOM_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/geom" CACHE PATH
MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
-MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
-MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
+MARK_AS_ADVANCED(SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
+MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON)
MARK_AS_ADVANCED(SALOME_GEOM_INSTALL_RES_DATA SALOME_GEOM_INSTALL_RES_SCRIPTS SALOME_GEOM_INSTALL_PLUGINS)
MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
# Accumulate environment variables for GEOM module
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
- ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
- ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
+ ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
# Sources
ADD_SUBDIRECTORY(resources)
ADD_SUBDIRECTORY(bin)
ADD_SUBDIRECTORY(src)
-IF(SALOME_BUILD_DOC)
- ADD_SUBDIRECTORY(doc)
-ENDIF()
+ADD_SUBDIRECTORY(doc)
# Header configuration
# ====================
INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)
-# Application tests
-INSTALL(FILES CTestTestfileInstall.cmake
- DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test
- RENAME CTestTestfile.cmake)
+IF(SALOME_BUILD_TESTS)
+ # Application tests
+ INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test
+ RENAME CTestTestfile.cmake)
+ENDIF()
SUBDIRS(examples)
SUBDIRS(xao)
+SUBDIRS(t_shape)
\ No newline at end of file
SET(SALOME_INSTALL_CMAKE "@SALOME_INSTALL_CMAKE@")
SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
-SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-ADD_SUBDIRECTORY(tui)
-ADD_SUBDIRECTORY(gui)
-ADD_SUBDIRECTORY(examples)
\ No newline at end of file
+ADD_SUBDIRECTORY(examples)
+IF(SALOME_BUILD_DOC)
+ ADD_SUBDIRECTORY(tui)
+ ADD_SUBDIRECTORY(gui)
+ENDIF()
INCLUDE(tests.set)
-SET(TEST_REINIT_SALOME "False")
SALOME_CONFIGURE_FILE(tests.py.in tests.py)
-SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+# Install examples
-IF(GEOM_JOIN_TESTS)
- ADD_TEST(NAME GEOM_examples COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py tests.py)
-ELSE(GEOM_JOIN_TESTS)
- FOREACH(test ${GOOD_TESTS})
- GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
- ADD_TEST(NAME ${testname}
- COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${CMAKE_CURRENT_SOURCE_DIR}/${test})
- SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
- ENDFOREACH()
-ENDIF(GEOM_JOIN_TESTS)
-
-# install Python scripts
+SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS})
SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/GEOM)
-# Application tests
+# Tests
+
+IF(SALOME_BUILD_TESTS)
+
+ SET(TEST_REINIT_SALOME "False")
+ SET(TEST_HELPER ${KERNEL_ROOT_DIR}/bin/salome/test_helper.py)
+
+ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
+ IF(GEOM_JOIN_TESTS)
+ ADD_TEST(NAME all_examples COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} tests.py)
+ ELSE(GEOM_JOIN_TESTS)
+ FOREACH(test ${GOOD_TESTS})
+ GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
+ ADD_TEST(NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} ${CMAKE_CURRENT_SOURCE_DIR}/${test})
+ SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+ ENDFOREACH()
+ ENDIF(GEOM_JOIN_TESTS)
+
+ # Application tests
+ # Note: we don't install test scripts as they are already installed to the documentation folder
+
+ SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/examples)
-SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/examples)
-INSTALL(FILES ${GOOD_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
+ CONFIGURE_FILE(CTestTestfileInstall.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
+ DESTINATION ${TEST_INSTALL_DIRECTORY}
+ RENAME CTestTestfile.cmake)
+ INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
-INSTALL(FILES CTestTestfileInstall.cmake
- DESTINATION ${TEST_INSTALL_DIRECTORY}
- RENAME CTestTestfile.cmake)
-INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
+ENDIF(SALOME_BUILD_TESTS)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+SET(TESTS_DIR "$ENV{GEOM_ROOT_DIR}/@SALOME_INSTALL_DOC@/examples/GEOM")
+
INCLUDE(tests.set)
FOREACH(tfile ${GOOD_TESTS})
GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
SET(TEST_NAME GEOM_${BASE_NAME})
- ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile})
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${TESTS_DIR}/${tfile})
SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
ENDFOREACH()
+++ /dev/null
-# Geom Field
-
-import salome
-salome.salome_init()
-import GEOM
-from salome.geom import geomBuilder
-geompy = geomBuilder.New()
-gg = salome.ImportComponentGUI("GEOM")
-
-# a box
-shape = geompy.MakeBoxDXDYDZ( 1, 1, 1, theName="box")
-
-# Create fields holding sub-shape IDs as strings,
-# which can be useful to see sub-shape IDs in the Viewer
-
-componentNames = ['ID']
-fieldDataType = GEOM.FDT_String
-stepID = 0
-stamp = 0
-
-dim = 0 # == vertices
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["VERTEX"] )]
-f0 = geompy.CreateField( shape, "vertices", fieldDataType, dim, componentNames )
-s0 = f0.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f0, f0.GetName() )
-s0id = geompy.addToStudyInFather( f0, s0, s0.GetName() )
-
-dim = 1 # == edges
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["EDGE"] )]
-f1 = geompy.CreateField( shape, "edges", fieldDataType, dim, componentNames )
-s1 = f1.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f1, f1.GetName() )
-geompy.addToStudyInFather( f1, s1, s1.GetName() )
-
-dim = 2 # == faces
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["FACE"] )]
-f2 = geompy.CreateField( shape, "faces", fieldDataType, dim, componentNames )
-s2 = f2.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f2, f2.GetName() )
-geompy.addToStudyInFather( f2, s2, s2.GetName() )
-
-dim = 3 # == solids
-values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["SOLID"] )]
-f3 = geompy.CreateField( shape, "solids", fieldDataType, dim, componentNames )
-s3 = f3.addStep( stepID, stamp, values )
-geompy.addToStudyInFather( shape, f3, f3.GetName() )
-geompy.addToStudyInFather( f3, s3, s3.GetName() )
-
-dim = -1 # == whole shape
-f_1 = geompy.CreateField( shape, "whole shape", fieldDataType, dim, componentNames )
-s_1 = f_1.addStep(stepID, stamp, ["1"])
-geompy.addToStudyInFather( shape, f_1, f_1.GetName() )
-geompy.addToStudyInFather( f_1, s_1, s_1.GetName() )
-
-# display
-gg.createAndDisplayGO( s0id )
+++ /dev/null
-# --- salome initialization
-import salome
-salome.salome_init()
-
-# --- geom Python interface
-import GEOM
-from salome.geom import geomBuilder
-geompy = geomBuilder.New()
-
-# --- Create a box and publish it into the salome study
-Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
-geompy.addToStudy( Box_1, 'Box_1' )
-
-# --- update the study object browser
-if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser()
--- /dev/null
+# --- salome initialization
+import salome
+salome.salome_init()
+
+# --- geom Python interface
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+
+# --- Create a box and publish it into the salome study
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+geompy.addToStudy( Box_1, 'Box_1' )
+
+# --- update the study object browser
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser()
--- /dev/null
+# Geom Field
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+gg = salome.ImportComponentGUI("GEOM")
+
+# a box
+shape = geompy.MakeBoxDXDYDZ( 1, 1, 1, theName="box")
+
+# Create fields holding sub-shape IDs as strings,
+# which can be useful to see sub-shape IDs in the Viewer
+
+componentNames = ['ID']
+fieldDataType = GEOM.FDT_String
+stepID = 0
+stamp = 0
+
+dim = 0 # == vertices
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["VERTEX"] )]
+f0 = geompy.CreateField( shape, "vertices", fieldDataType, dim, componentNames )
+s0 = f0.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f0, f0.GetName() )
+s0id = geompy.addToStudyInFather( f0, s0, s0.GetName() )
+
+dim = 1 # == edges
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["EDGE"] )]
+f1 = geompy.CreateField( shape, "edges", fieldDataType, dim, componentNames )
+s1 = f1.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f1, f1.GetName() )
+geompy.addToStudyInFather( f1, s1, s1.GetName() )
+
+dim = 2 # == faces
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["FACE"] )]
+f2 = geompy.CreateField( shape, "faces", fieldDataType, dim, componentNames )
+s2 = f2.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f2, f2.GetName() )
+geompy.addToStudyInFather( f2, s2, s2.GetName() )
+
+dim = 3 # == solids
+values = [str(i) for i in geompy.SubShapeAllIDs( shape, geompy.ShapeType["SOLID"] )]
+f3 = geompy.CreateField( shape, "solids", fieldDataType, dim, componentNames )
+s3 = f3.addStep( stepID, stamp, values )
+geompy.addToStudyInFather( shape, f3, f3.GetName() )
+geompy.addToStudyInFather( f3, s3, s3.GetName() )
+
+dim = -1 # == whole shape
+f_1 = geompy.CreateField( shape, "whole shape", fieldDataType, dim, componentNames )
+s_1 = f_1.addStep(stepID, stamp, ["1"])
+geompy.addToStudyInFather( shape, f_1, f_1.GetName() )
+geompy.addToStudyInFather( f_1, s_1, s_1.GetName() )
+
+# display
+gg.createAndDisplayGO( s0id )
+++ /dev/null
-#!/usr/bin/env python3
-# Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-
-import unittest, sys, os
-
-class SalomeSession(object):
- def __init__(self, script):
- import runSalome
- run_script = "runSalome.py"
- if sys.platform == 'win32':
- module_dir = os.getenv("KERNEL_ROOT_DIR")
- if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script)
- pass
- sys.argv = [run_script]
- sys.argv += ["--terminal"]
- sys.argv += ["--modules=GEOM"]
- sys.argv += ["%s" % script]
- if sys.platform == 'win32':
- main_module_path = sys.modules['__main__'].__file__
- sys.modules['__main__'].__file__ = ''
- clt, d = runSalome.main()
- if sys.platform == 'win32':
- sys.modules['__main__'].__file__ = main_module_path
- return
-
- def __del__(self):
- port = os.getenv('NSPORT')
- import killSalomeWithPort
- killSalomeWithPort.killMyPort(port)
- return
- pass
-
-class MyTest(unittest.TestCase):
- def testFunction(self):
- SalomeSession(sys.argv[1])
- pass
-
-unittest.main(argv=sys.argv[:1])
advanced_geom_objs_ex01.py
advanced_geom_objs_ex02.py
advanced_geom_objs_ex03.py
+ advanced_geom_objs_smoothingsurface.py
angle.py
arranging_study_objects.py
basic_geom_objs_ex01.py
boolean_operations_ex03.py
boolean_operations_ex04.py
bounding_box.py
+ box.py
building_by_blocks_ex01.py
building_by_blocks_ex02.py
center_of_mass.py
check_compound_of_blocks.py
check_self_intersections.py
+ check_self_intersections_fast.py
check_shape.py
complex_objs_ex01.py
complex_objs_ex02.py
complex_objs_ex10.py
complex_objs_ex11.py
fast_intersection.py
+ field.py
free_boundaries.py
free_faces.py
- GEOM_box.py
get_non_blocks.py
import_export.py
inertia.py
min_distance.py
normal_face.py
notebook_geom.py
- polyline.py
point_coordinates.py
+ polyline.py
primitives_ex01.py
primitives_ex02.py
primitives_ex03.py
topological_geom_objs_ex04.py
topological_geom_objs_ex05.py
topological_geom_objs_ex06.py
+ topological_geom_objs_ex07.py
transformation_operations_ex01.py
transformation_operations_ex02.py
transformation_operations_ex03.py
working_with_groups_ex04.py
working_with_groups_ex05.py
working_with_groups_ex06.py
- GEOM_Field.py
- check_self_intersections_fast.py # OCC > 6.9.0
)
-
-SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py)
\n
\anchor tui_sample_geom_script
<br><h2>GEOM Python script example</h2>
-\tui_script{GEOM_box.py}
+\tui_script{box.py}
\n By the links below you can find sample scripts for all operations
provided by Geometry module.
/*!
\page tui_geom_field_page Geometrical Fields
-\tui_script{GEOM_Field.py}
+\tui_script{field.py}
*/
# scripts / shared
-SET(_shared_SCRIPTS
- GEOM_shared_modules.py
- )
-
# --- rules ---
SALOME_INSTALL_SCRIPTS("${_other_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA} DEF_PERMS)
-SALOME_INSTALL_SCRIPTS("${_shared_SCRIPTS}" ${SALOME_INSTALL_PYTHON_SHARED} DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${_python_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom DEF_PERMS)
# Install plugin scripts
+++ /dev/null
-# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-"""
-
-"""
-
-# force GEOM importation at interpretor initialization
-# see salome_shared_modules.py
-# (avoids incomplete import at run time)
-
-from launchConfigureParser import verbose
-
-if verbose(): print("============== import GEOM =======================")
-
-import GEOM
-
-# this function is required
-
-def init_shared_modules():
- """
- This function initializes shared modules that need to be
- """
- pass
# to avoid races problems when compiling in parallel
ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
ENDIF()
+
+IF(SALOME_BUILD_TESTS)
+ SET(TEST_HELPER ${KERNEL_ROOT_DIR}/bin/salome/test_helper.py)
+ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+ ADD_TEST(NAME t_shape_builder
+ COMMAND ${PYTHON_EXECUTABLE} -B ${TEST_HELPER} ${CMAKE_CURRENT_SOURCE_DIR}/test_t_shape_builder.py)
+
+ SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/t_shape)
+ INSTALL(FILES test_t_shape_builder.py DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+ INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${TEST_INSTALL_DIRECTORY}
+ RENAME CTestTestfile.cmake)
+ENDIF()
--- /dev/null
+# Copyright (C) 2015-2020 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(TESTS test_t_shape_builder.py)
+
+FOREACH(tfile ${TESTS})
+ GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
+ SET(TEST_NAME GEOM_${BASE_NAME})
+ ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} 1000 ${tfile})
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
faci.append(geompy.MakeFaceWires([ed90[3], ed90[7], ed90[4], lord90[2]], 0))
return faci, sect45, arc1, l1, lord90, lord45, edges, arcextru
-
-def test_t_shape_builder():
- """For testing purpose"""
- salome.salome_init()
- geompy = geomBuilder.New()
- for r1 in [1., 100.]:
- for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]:
- for thickness in [r1/100., r1/10., r1/2.]:
- print(r1, r2, thickness)
- h1 = r1 * 2.0
- h2 = h1
- try:
- res = build_shape(r1, r2, h1, h2, thickness)
- geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness))
- except:
- print("problem with res_%f_%f_%f"%(r1,r2, thickness))
-
-if __name__=="__main__":
- """For testing purpose"""
- test_t_shape_builder()
--- /dev/null
+import salome
+salome.salome_init()
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+
+from salome.geom.t_shape.t_shape_builder import build_shape
+num_errors = 0
+
+for r1 in [1., 100.]:
+ for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]:
+ for thickness in [r1/100., r1/10., r1/2.]:
+ print(r1, r2, thickness)
+ h1 = r1 * 2.0
+ h2 = h1
+ try:
+ res = build_shape(r1, r2, h1, h2, thickness)
+ geompy.addToStudy(res, "res_%f_%f_%f"%(r1, r2, thickness))
+ except:
+ print("problem with res_%f_%f_%f"%(r1, r2, thickness))
+ num_errors += 1
+if num_errors > 0:
+ raise RuntimeError("Error: 1 or more test cases failed!")
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-ADD_SUBDIRECTORY(data)
-
# additional include directories
INCLUDE_DIRECTORIES(
${PTHREAD_INCLUDE_DIR}
# --- rules ---
+SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/xao)
+
ADD_EXECUTABLE(TestXAO ${TestXAO_SOURCES})
TARGET_LINK_LIBRARIES(TestXAO ${_link_LIBRARIES})
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/xao)
-
ADD_TEST(TestXAO TestXAO)
SET_TESTS_PROPERTIES(TestXAO PROPERTIES ENVIRONMENT "XAO_DATA_DIR=${CMAKE_CURRENT_SOURCE_DIR}/data;${tests_env}")
-INSTALL(TARGETS TestXAO DESTINATION ${SALOME_INSTALL_BINS})
-
# Application tests
INSTALL(TARGETS TestXAO RUNTIME DESTINATION ${TEST_INSTALL_DIRECTORY})
+INSTALL(DIRECTORY data DESTINATION ${TEST_INSTALL_DIRECTORY})
INSTALL(FILES CTestTestfileInstall.cmake
DESTINATION ${TEST_INSTALL_DIRECTORY}
+++ /dev/null
-# Copyright (C) 2012-2020 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-SET(XAO_DATA_FILES
- Box_1.brep
- Box_2.brep
- Cut_2.brep
- test.xao
- )
-
-# --- rules ---
-SET(XAO_DATA_DIR ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/xao/data)
-INSTALL(FILES ${XAO_DATA_FILES} DESTINATION ${XAO_DATA_DIR})