From: sbh Date: Thu, 24 Jul 2014 12:26:27 +0000 (+0400) Subject: Checking a Shape from the ResultConstruction in python scripts X-Git-Tag: V_0.4.4~146^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0585d70db3ef47a9199910c3a05489a7b727782b;p=modules%2Fshaper.git Checking a Shape from the ResultConstruction in python scripts --- diff --git a/src/ModelAPI/CMakeLists.txt b/src/ModelAPI/CMakeLists.txt index 731a449c7..c92f95df6 100644 --- a/src/ModelAPI/CMakeLists.txt +++ b/src/ModelAPI/CMakeLists.txt @@ -61,7 +61,8 @@ SET(SWIG_SCRIPTS ) SET(SWIG_LINK_LIBRARIES - ModelAPI + ModelAPI + GeomAPI ${PYTHON_LIBRARIES} ) diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index 456a52775..31936c53e 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -1,6 +1,8 @@ /* ModelAPI.i */ %module ModelAPI %{ + #include "GeomAPI_Interface.h" + #include "GeomAPI_Shape.h" #include "ModelAPI.h" #include "ModelAPI_Document.h" #include "ModelAPI_PluginManager.h" @@ -36,6 +38,9 @@ // boost pointers %include +// For ModelAPI_ResultConstruction.shape() +%shared_ptr(GeomAPI_Interface) +%shared_ptr(GeomAPI_Shape) %shared_ptr(ModelAPI_Document) %shared_ptr(ModelAPI_PluginManager) %shared_ptr(ModelAPI_Object) @@ -51,6 +56,8 @@ %shared_ptr(ModelAPI_ResultConstruction) // all supported interfaces +%include "GeomAPI_Interface.h" +%include "GeomAPI_Shape.h" %include "ModelAPI_Document.h" %include "ModelAPI_PluginManager.h" %include "ModelAPI_Object.h" diff --git a/src/SketchPlugin/Test/TestSketchBasics.py b/src/SketchPlugin/Test/TestSketchBasics.py index 22df6ce62..b4889ea98 100644 --- a/src/SketchPlugin/Test/TestSketchBasics.py +++ b/src/SketchPlugin/Test/TestSketchBasics.py @@ -121,9 +121,8 @@ aDocument.finishOperation() # Check results #=============================================================================== aResult = aSketchLine.firstResult() -assert (aResult is not None) aResultConstruction = modelAPI_ResultConstruction(aResult) -aShape = aResult.shape() +aShape = aResultConstruction.shape() assert (aShape is not None) assert (not aShape.isNull()) #==============================================================================