From: sbh Date: Mon, 22 Dec 2014 07:21:50 +0000 (+0300) Subject: Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1 X-Git-Tag: V_0.7.0_rc1~57^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7bf19255421b34594c7b0a76d0ce28166d0ce895;p=modules%2Fshaper.git Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1 Conflicts: src/Events/Events_Loop.cpp: <<<<<<< HEAD if (!aWasFlushed) myFlushed.erase(myFlushed.find(theID.myID)); ======= std::set::iterator anIt = myFlushed.find(theID.myID); if (anIt != myFlushed.end()) { myFlushed.erase(anIt); } >>>>>>> origin/BR_PYTHON_PLUGIN src/ModelAPI/ModelAPI.i src/ModelAPI/ModelAPI_Plugin.h src/PartSetPlugin/PartSetPlugin_Plugin.h --- 7bf19255421b34594c7b0a76d0ce28166d0ce895 diff --cc src/Events/Events_Loop.cpp index 3ab9a1caf,d70b9764f..139e86234 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@@ -127,8 -122,10 +127,9 @@@ void Events_Loop::flush(const Events_ID std::shared_ptr aGroup = aMyGroup->second; myGroups.erase(aMyGroup); send(aGroup, false); - std::set::iterator anIt = myFlushed.find(theID.myID); - if (anIt != myFlushed.end()) { - myFlushed.erase(anIt); - } ++ + if (!aWasFlushed) + myFlushed.erase(myFlushed.find(theID.myID)); } } diff --cc src/Model/Model_Update.cpp index 7360d0d1e,e7116df59..b27e6cc17 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@@ -324,12 -280,14 +325,14 @@@ bool Model_Update::updateFeature(Featur } } else { theFeature->eraseResults(); - redisplayWithResults(theFeature); // result also must be updated + redisplayWithResults(theFeature, ModelAPI_StateInvalidArgument); // result also must be updated } } else { // for automatically updated features (on abort, etc) it is necessary to redisplay anyway - redisplayWithResults(theFeature); + redisplayWithResults(theFeature, ModelAPI_StateNothing); } - } else { // returns also true is results were updated: for sketch that refers to sub-features but results of sub-features were changed + } else { + // returns also true is results were updated: for sketch that + // refers to sub-features but results of sub-features were changed const std::list >& aResults = theFeature->results(); std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { diff --cc src/ModelAPI/ModelAPI.i index 1558e49dc,5c97aeb4c..bdf6c28e5 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@@ -112,14 -128,26 +128,30 @@@ %include "ModelAPI_ResultParameters.h" %include "ModelAPI_Tools.h" ++// std::list -> [] %template(ObjectList) std::list >; %template(ResultList) std::list >; +%template(DocumentList) std::list >; ++// std::dynamic_pointer_cast template std::shared_ptr shared_ptr_cast(std::shared_ptr theObject); %template(modelAPI_CompositeFeature) shared_ptr_cast; %template(modelAPI_Feature) shared_ptr_cast; -// Result casts ++ + %template(modelAPI_Result) shared_ptr_cast; %template(modelAPI_ResultConstruction) shared_ptr_cast; %template(modelAPI_ResultBody) shared_ptr_cast; %template(modelAPI_ResultPart) shared_ptr_cast; +%template(modelAPI_ResultGroup) shared_ptr_cast; + + // Attribute casts + %template(modelAPI_AttributeDocRef) shared_ptr_cast; + %template(modelAPI_AttributeDouble) shared_ptr_cast; + %template(modelAPI_AttributeInteger) shared_ptr_cast; + %template(modelAPI_AttributeString) shared_ptr_cast; + %template(modelAPI_AttributeReference) shared_ptr_cast; + %template(modelAPI_AttributeRefAttr) shared_ptr_cast; + %template(modelAPI_AttributeBoolean) shared_ptr_cast; + %template(modelAPI_AttributeSelection) shared_ptr_cast; + %template(modelAPI_AttributeSelectionList) shared_ptr_cast; + %template(modelAPI_AttributeRefList) shared_ptr_cast; diff --cc src/SketchPlugin/SketchPlugin_Plugin.h index fad6fa739,3b480410b..a02ef822c --- a/src/SketchPlugin/SketchPlugin_Plugin.h +++ b/src/SketchPlugin/SketchPlugin_Plugin.h @@@ -20,13 -16,7 +20,12 @@@ class SKETCHPLUGIN_EXPORT SketchPlugin_ virtual FeaturePtr createFeature(std::string theFeatureID); public: - /// Is needed for python wrapping by swig SketchPlugin_Plugin(); + //! Redefinition of Events_Listener method + virtual void processEvent(const std::shared_ptr& theMessage); + protected: + std::shared_ptr getFeaturesState( + const std::shared_ptr& theFeature) const; }; #endif