SET(_JUSTPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${SUIT_LIB_DIR};$ENV{PATH}")
STRING(REPLACE "\\" "/" _JUSTPATH "${_JUSTPATH}")
STRING(REPLACE ";" "\\;" _JUSTPATH "${_JUSTPATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PYTHON_API};$ENV{PYTHONPATH}")
+ SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS};$ENV{PYTHONPATH}")
STRING(REPLACE "\\" "/" _PYTHONPATH "${_PYTHONPATH}")
STRING(REPLACE ";" "\\;" _PYTHONPATH "${_PYTHONPATH}")
else()
SET(_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${SUIT_LIB_DIR}:$ENV{LD_LIBRARY_PATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PYTHON_API}:$ENV{PYTHONPATH}")
+ SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS}:$ENV{PYTHONPATH}")
endif()
foreach(eachFileName ${ARGN})
# It could be called only once
FIND_PACKAGE(LibXml2 REQUIRED)
+SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome)
+SET(SHAPER_INSTALL_PYTHON_API ${_pydir}/salome/shaper CACHE INTERNAL "" FORCE)
+SET(SHAPER_INSTALL_SWIG ${_pydir} CACHE INTERNAL "" FORCE)
IF(${HAVE_SALOME})
SET(SHAPER_INSTALL_ADDONS bin/salome CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_BIN lib/salome CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_PLUGIN_FILES lib/salome CACHE INTERNAL "" FORCE)
- SET(SHAPER_INSTALL_PYTHON_API bin/salome CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_PYTHON_FILES bin/salome CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
- SET(SHAPER_INSTALL_SWIG bin/salome CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_QM_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_XML_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_GUI_DOC share/doc/salome/gui/SHAPER CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_ADDONS addons CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_BIN bin CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_PLUGIN_FILES plugins CACHE INTERNAL "" FORCE)
- SET(SHAPER_INSTALL_PYTHON_API PythonAPI CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_PYTHON_FILES plugins CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_RESOURCES resources CACHE INTERNAL "" FORCE)
- SET(SHAPER_INSTALL_SWIG swig CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_QM_RESOURCES bin CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_XML_RESOURCES plugins CACHE INTERNAL "" FORCE)
SET(SHAPER_INSTALL_GUI_DOC doc CACHE INTERNAL "" FORCE)
@SET SHAPER_ROOT_DIR=%ROOT_DIR%\install
@SET PATH=%SHAPER_ROOT_DIR%\lib\salome;%PATH%
-@SET PYTHONPATH=%SHAPER_ROOT_DIR%\bin\salome;%PYTHONPATH%
+REM @SET PYTHONPATH=%SHAPER_ROOT_DIR%\lib\python2.7\site-packages\salome\salome;%PYTHONPATH%
+REM @SET PYTHONPATH=%SHAPER_ROOT_DIR%\bin\salome;%PYTHONPATH%
@SET LightAppConfig=%SHAPER_ROOT_DIR%\share\salome\resources\shaper;%GUI_ROOT_DIR%\share\salome\resources\gui
@SET SHAPER_ROOT_DIR=%ROOT_DIR%\install
@SET SalomeAppConfig=%SHAPER_ROOT_DIR%\share\salome\resources\shaper;%GUI_ROOT_DIR%\share\salome\resources\gui
+echo %PYTHONPATH%
start %PYTHONBIN% "%KERNEL_ROOT_DIR%\bin\salome\envSalome.py" "%PYTHONBIN%" "%KERNEL_ROOT_DIR%\bin\salome\runSalome.py" %*
# Test results
assert (len(anEdgeFeature.results()) == aNumOfLines)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aFaceFeature.results()) > 0)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aShellFeature.results()) > 0)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aSubShapesFeature.results()) > 0)
-import model
+from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
# Test results
assert (len(aVertexFeature.results()) == aNumOfPoints)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aWireFeature.results()) > 0)
-import model
+from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
aFieldResult = aField.firstResult()
assert(aFieldResult)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
-import model
+from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
import ModelAPI
import ConstructionAPI
-import model
+from salome.shaper import model
class AxisTestCase(unittest.TestCase):
import ModelAPI
import ConstructionAPI
-import model
+from salome.shaper import model
class PointTestCase(unittest.TestCase):
import math
from ModelAPI import *
-import model
+from salome.shaper import model
aSession = ModelAPI_Session.get()
aDocument = aSession.moduleDocument()
aSession.finishOperation()
assert (len(anAxis.results()) > 0)
-import model
assert(model.checkPythonDump())
from ModelAPI import *
from GeomAPI import *
-import model
+from salome.shaper import model
# Get session
aSession = ModelAPI_Session.get()
aSession.finishOperation()
assert (len(aPlane.results()) > 0)
-import model
assert(model.checkPythonDump())
from ModelAPI import *
from GeomAPI import *
-import model
+from salome.shaper import model
# Get session
aSession = ModelAPI_Session.get()
assert (aFeatureName == aFeature1Name)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
import ModelAPI
import ExchangeAPI
-import model
+from salome.shaper import model
class ExchangeTestCase(unittest.TestCase):
void ExchangePlugin_Dump::dump(const std::string& theFileName)
{
// load DumpAssistant from Python side
- Config_ModuleReader::loadScript("model.dump");
+ Config_ModuleReader::loadScript("salome.shaper.model.dump");
ModelHighAPI_Dumper* aDumper = ModelHighAPI_Dumper::getInstance();
aDumper->clear();
from TestImport import testImport
-import model
+from salome.shaper import model
__updated__ = "2015-05-22"
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
from ModelAPI import *
from GeomAPI import *
-import model
+from salome.shaper import model
# Get session
aSession = ModelAPI_Session.get()
# End of test
#=========================================================================
-import model
+from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
from ModelAPI import *
from GeomAPI import *
-import model
+from salome.shaper import model
# Get session
aSession = ModelAPI_Session.get()
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aCurrentResult = modelAPI_ResultBody(anRevolutionFuseFt.firstResult())
assert (aCurrentResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aCurrentResult = modelAPI_ResultBody(anExtrusionCutFt.firstResult())
assert (aCurrentResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aCurrentResult = modelAPI_ResultBody(anExtrusionFuseFt.firstResult())
assert (aCurrentResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
anItersectionResult = modelAPI_ResultBody(anIntersectionFt.firstResult())
assert (anItersectionResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aPartitionResult = modelAPI_ResultBody(aPartitionFt.firstResult())
assert (aPartitionResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aPipeFeature.results()) > 0)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
assert (aPlacementResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# Test made with high level API
# -----------------------------
-import model
+from salome.shaper import model
# Initialisation
-import model
+from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
anUnionResult = modelAPI_ResultCompSolid(modelAPI_ResultBody(aRemoveSubShapesFeature.firstResult()))
assert (anUnionResult.numberOfSubs() == 2)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aRevolResult = modelAPI_ResultBody(aRevolFt.firstResult())
assert (aRevolResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aCurrentResult = modelAPI_ResultBody(anRevolutionCutFt.firstResult())
assert (aCurrentResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aCurrentResult = modelAPI_ResultBody(anRevolutionFuseFt.firstResult())
assert (aCurrentResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aMoveResult = modelAPI_ResultBody(aRotateFt.firstResult())
assert (aMoveResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aMoveResult = modelAPI_ResultBody(aMoveFt.firstResult())
assert (aMoveResult is not None)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
anUnionResult = modelAPI_ResultCompSolid(modelAPI_ResultBody(aUnionFeature.firstResult()))
assert (anUnionResult.numberOfSubs() == 0)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
"""
-import model
+from salome.shaper import model
#=========================================================================
# Initialize a part
assert(aSession.moduleDocument().size("Parts") == 0)
assert(aSession.activeDocument())
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
assert(aColors.value(2) == 250)
aSession.finishOperation()
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
assert(aSession.canUndo())
assert(not aSession.canRedo())
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
aSession = ModelAPI_Session.get()
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
if (!myModules.empty())
aFile << std::endl;
- aFile << "import model" << std::endl << std::endl;
+ aFile << "from salome.shaper import model" << std::endl << std::endl;
aFile << "model.begin()" << std::endl;
// dump collected data
-import model
+from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
import ModelAPI
import ModelHighAPI
-import model
+from salome.shaper import model
class FeaturesFixture(unittest.TestCase):
import ModelAPI
import ModelHighAPI
-import model
+from salome.shaper import model
class FeaturesFixture(unittest.TestCase):
#=========================================================================
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
from ModelAPI import *
import math
import unittest
-import model
+from salome.shaper import model
__updated__ = "2015-04-27"
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
from ModelAPI import *
import math
import unittest
-import model
+from salome.shaper import model
__updated__ = "2015-04-27"
# Created a Part Remove/Duplicate API functionality since from low level and python dump it is not
# tested: feature history infor is not stored.
-import model
+from salome.shaper import model
# prepare axis created by PartSet and Part points
model.begin()
from ModelAPI import *
from GeomAPI import *
-import model
+from salome.shaper import model
# Get session
aSession = ModelAPI_Session.get()
## Copyright (C) 2014-20xx OPEN CASCADE
INSTALL(DIRECTORY geom model examples DESTINATION ${SHAPER_INSTALL_PYTHON_API})
-INSTALL(FILES shaper.py DESTINATION ${SHAPER_INSTALL_PYTHON_API})
+INSTALL(FILES __init__.py DESTINATION ${SHAPER_INSTALL_PYTHON_API})
# --------- Unit tests -----------
INCLUDE(UnitTest)
import ModelAPI
-import model
+from salome.shaper import model
#-----------------------------------------------------------------------------
# Fixtures
import ModelAPI
-import model
+from salome.shaper import model
#-----------------------------------------------------------------------------
# Fixtures
import ModelAPI
-import model
+from salome.shaper import model
#-----------------------------------------------------------------------------
# Fixtures
import unittest
-import examples.MakeBrick1
+import salome.shaper.examples.MakeBrick1
if __name__ == "__main__":
unittest.main()
import unittest
-import examples.MakeBrick2
+import salome.shaper.examples.MakeBrick2
if __name__ == "__main__":
unittest.main()
import unittest
-import model
+from salome.shaper import model
class ModelTestCase(unittest.TestCase):
def setUp(self):
import unittest
-import examples.Platine
+import salome.shaper.examples.Platine
if __name__ == "__main__":
unittest.main()
import ModelAPI
-import model
+from salome.shaper import model
class PrimitivesAddBox(unittest.TestCase):
import unittest
-import model
-import geom
+from salome.shaper import model
+from salome.shaper import geom
if __name__ == "__main__":
unittest.main()
import unittest
-import model
+from salome.shaper import model
# Delta value for almost equal comparisons
DELTA = 1e-10
import unittest
-import model
-import geom
+from salome.shaper import model
+from salome.shaper import geom
from TestSketcher import SketcherTestCase
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherAddCircle(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherAddLine(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
from ModelAPI import *
from GeomDataAPI import geomDataAPI_Point2D
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherAddPoint(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
import math
import TestSketcher
from TestSketcher import SketcherTestCase
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetCoincident(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
import math
import TestSketcher
from TestSketcher import SketcherTestCase
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetFillet(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetFixed(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetHorizontal(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
import math
import TestSketcher
from TestSketcher import SketcherTestCase
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetParallel(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
import TestSketcher
from TestSketcher import SketcherTestCase
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetRadius(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetTangent(SketcherTestCase):
import unittest
-import model
+from salome.shaper import model
from TestSketcher import SketcherTestCase
class SketcherSetVertical(SketcherTestCase):
.. doctest::
- >>> import model
+ >>> from salome.shaper import model
>>> model.begin()
>>> partset = model.moduleDocument()
>>> part = model.addPart(partset).document()
.. testsetup::
- import model
+ from salome.shaper import model
model.begin()
partset = model.moduleDocument()
part = model.addPart(partset).document()
# Author: Daniel Brunier-Coulin
# -----------------------------
-import model
+from salome.shaper import model
# Initialisation
# Author: Daniel Brunier-Coulin
# -----------------------------
-import model
-import geom
+from salome.shaper import model
+from salome.shaper import geom
# Initialisation
# Author: Sergey POKHODENKO
# -----------------------------
-import geom
-import model
+from salome.shaper import geom
+from salome.shaper import model
# START DEBUG PURPOSES
# Should be removed
+++ /dev/null
-"""This package defines the Python API of the Shaper.
-"""
-
-# Main packages
-
-import geom
-import model
-import model
-import geom
+from salome.shaper import model
+from salome.shaper import geom
model.begin()
partSet = model.moduleDocument()
Copyright (C) 2014-20xx CEA/DEN, EDF R&D
"""
-import model
-import geom
+from salome.shaper import model
+from salome.shaper import geom
class BoxFeature(model.Feature):
Copyright (C) 2016-20xx CEA/DEN, EDF R&D
"""
-import model
+from salome.shaper import model
import ModelAPI
import GeomDataAPI
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
assert (aRefListC.size() == 1)
checkMirror(aRefListB, aRefListC, aMirrorLine)
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
assert (aShape is not None)
assert (not aShape.isNull())
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
# End of test
#=========================================================================
-import model
+from salome.shaper import model
assert(model.checkPythonDump())
-import model
+from salome.shaper import model
from ModelAPI import *