From 0585d70db3ef47a9199910c3a05489a7b727782b Mon Sep 17 00:00:00 2001 From: sbh Date: Thu, 24 Jul 2014 16:26:27 +0400 Subject: [PATCH] Checking a Shape from the ResultConstruction in python scripts --- src/ModelAPI/CMakeLists.txt | 3 ++- src/ModelAPI/ModelAPI.i | 7 +++++++ src/SketchPlugin/Test/TestSketchBasics.py | 3 +-- 3 files changed, 10 insertions(+), 3 deletions(-) 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()) #============================================================================== -- 2.39.2