From 99e20e519d7b21a9bb2cf3c9c388c31d15ca675c Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 15 Sep 2014 11:42:15 +0400 Subject: [PATCH] Tuning the python console commands execution --- src/Model/Model_Document.cpp | 3 +++ src/ModelAPI/ModelAPI.i | 8 ++++++++ src/ModelAPI/ModelAPI_Validator.h | 7 ------- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 7a2ca8542..cb5d28394 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -417,6 +417,9 @@ FeaturePtr Model_Document::addFeature(std::string theID) // event: feature is added static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED); ModelAPI_EventCreator::get()->sendUpdated(aFeature, anEvent); + } else { // feature must be executed + // no creation event => updater not working, problem with remove part + aFeature->execute(); } } return aFeature; diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index c8fddd2f8..dd78318e0 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -20,6 +20,8 @@ #include "ModelAPI_AttributeRefList.h" #include "ModelAPI_Result.h" #include "ModelAPI_ResultConstruction.h" + #include "ModelAPI_ResultBody.h" + #include "ModelAPI_ResultPart.h" template boost::shared_ptr castTo(boost::shared_ptr theObject) { @@ -58,6 +60,8 @@ %shared_ptr(ModelAPI_AttributeRefList) %shared_ptr(ModelAPI_Result) %shared_ptr(ModelAPI_ResultConstruction) +%shared_ptr(ModelAPI_ResultBody) +%shared_ptr(ModelAPI_ResultPart) // all supported interfaces %include "GeomAPI_Interface.h" @@ -78,9 +82,13 @@ %include "ModelAPI_AttributeRefList.h" %include "ModelAPI_Result.h" %include "ModelAPI_ResultConstruction.h" +%include "ModelAPI_ResultBody.h" +%include "ModelAPI_ResultPart.h" %template(ObjectList) std::list >; %template(ResultList) std::list >; template boost::shared_ptr castTo(boost::shared_ptr theObject); %template(modelAPI_ResultConstruction) castTo; +%template(modelAPI_ResultBody) castTo; +%template(modelAPI_ResultPart) castTo; diff --git a/src/ModelAPI/ModelAPI_Validator.h b/src/ModelAPI/ModelAPI_Validator.h index f4ecd1923..9c83a9d7e 100644 --- a/src/ModelAPI/ModelAPI_Validator.h +++ b/src/ModelAPI/ModelAPI_Validator.h @@ -29,13 +29,6 @@ class MODELAPI_EXPORT ModelAPI_Validator virtual ~ModelAPI_Validator() { } - - /// Returns true if feature and/or attributes are valid - /// \param theFeature the validated feature - /// \param theAttr the validated attribute ID, empty string of feature is validated - /// \param theArguments list of string, feature attribute names: dependent attributes - //virtual bool validate(const boost::shared_ptr& theFeature, - // const std::string theAttr, std::list theArguments) const = 0; }; typedef boost::shared_ptr ValidatorPtr; -- 2.39.2