From dd3858e27399f404e035672574a5fd823191eb14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Tue, 13 Oct 2020 11:25:59 +0200 Subject: [PATCH] Fix issues after valid, add API python and unitary test --- src/BuildAPI/BuildAPI_Interpolation.cpp | 97 +++++++++++++++--- src/BuildAPI/BuildAPI_Interpolation.h | 42 +++++++- src/BuildPlugin/BuildPlugin_EvalListener.cpp | 34 ++++-- src/BuildPlugin/BuildPlugin_EvalListener.h | 3 +- src/BuildPlugin/BuildPlugin_Interpolation.cpp | 97 +++++++++--------- src/BuildPlugin/BuildPlugin_Interpolation.h | 4 +- src/BuildPlugin/BuildPlugin_Plugin.cpp | 2 +- src/BuildPlugin/Test/TestInterpolation.py | 12 ++- .../feature_interpolation_analytical.png | Bin 0 -> 511 bytes src/BuildPlugin/interpolation_widget.xml | 56 +++++----- src/Events/Events_Listener.cpp | 1 - src/GeomValidators/CMakeLists.txt | 1 + .../GeomValidators_MinObjectsSelected.cpp | 11 ++ 13 files changed, 248 insertions(+), 112 deletions(-) create mode 100644 src/BuildPlugin/icons/feature_interpolation_analytical.png diff --git a/src/BuildAPI/BuildAPI_Interpolation.cpp b/src/BuildAPI/BuildAPI_Interpolation.cpp index 113ed4227..f232b81da 100644 --- a/src/BuildAPI/BuildAPI_Interpolation.cpp +++ b/src/BuildAPI/BuildAPI_Interpolation.cpp @@ -39,6 +39,7 @@ BuildAPI_Interpolation::BuildAPI_Interpolation(const FeaturePtr& theFeature, : ModelHighAPI_Interface(theFeature) { if(initialize()) { + fillAttribute(BuildPlugin_Interpolation::CREATION_METHODE_BY_SELECTION_ID(),mycreationmethod); setUseTangents(true); setTangents(theStartTangent, theEndTangent); setClosed(theIsClosed); @@ -55,6 +56,7 @@ BuildAPI_Interpolation::BuildAPI_Interpolation(const FeaturePtr& theFeature, : ModelHighAPI_Interface(theFeature) { if (initialize()) { + fillAttribute(BuildPlugin_Interpolation::CREATION_METHODE_BY_SELECTION_ID(),mycreationmethod); setClosed(theIsClosed); setReorder(theIsToReorder); setUseTangents(false); @@ -62,6 +64,28 @@ BuildAPI_Interpolation::BuildAPI_Interpolation(const FeaturePtr& theFeature, } } +BuildAPI_Interpolation::BuildAPI_Interpolation(const FeaturePtr& theFeature, + const std::string & theXTexpression, + const std::string & theYTexpression, + const std::string & theZTexpression, + const ModelHighAPI_Double& theMinT, + const ModelHighAPI_Double& theMaxT, + const ModelHighAPI_Integer& theNbStep) +: ModelHighAPI_Interface(theFeature) +{ + if (initialize()) { + fillAttribute(BuildPlugin_Interpolation::CREATION_METHODE_ANALYTICAL_ID(),mycreationmethod); + fillAttribute(theXTexpression, myxt); + fillAttribute(theYTexpression, myyt); + fillAttribute(theZTexpression, myzt); + fillAttribute(theMinT, mymint); + fillAttribute(theMaxT, mymaxt); + fillAttribute(theNbStep, mynumstep); + + execute(); + } +} + //================================================================================================== BuildAPI_Interpolation::~BuildAPI_Interpolation() { @@ -112,24 +136,46 @@ void BuildAPI_Interpolation::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); std::string aPartName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrBaseObjects = - aBase->selectionList(BuildPlugin_Interpolation::BASE_OBJECTS_ID()); - - theDumper << aBase << " = model.addInterpolation(" << aPartName << ", " - << anAttrBaseObjects << ", "; - - AttributeStringPtr useTangentsAttr = useTangents(); - std::string useTangents = useTangentsAttr->value(); - if (!useTangents.empty()) { - AttributeSelectionPtr anAttrStartTangent = - aBase->selection(BuildPlugin_Interpolation::TANGENT_START_ID()); - AttributeSelectionPtr anAttrEndTangent = - aBase->selection(BuildPlugin_Interpolation::TANGENT_END_ID()); - - theDumper << anAttrStartTangent << ", " << anAttrEndTangent << ", "; + if( aBase->string(BuildPlugin_Interpolation::CREATION_METHODE_ID())->value() == + BuildPlugin_Interpolation::CREATION_METHODE_BY_SELECTION_ID() ) + { + AttributeSelectionListPtr anAttrBaseObjects = + aBase->selectionList(BuildPlugin_Interpolation::BASE_OBJECTS_ID()); + + theDumper << aBase << " = model.addInterpolation(" << aPartName << ", " + << anAttrBaseObjects << ", "; + + AttributeStringPtr useTangentsAttr = useTangents(); + std::string useTangents = useTangentsAttr->value(); + if (!useTangents.empty()) { + AttributeSelectionPtr anAttrStartTangent = + aBase->selection(BuildPlugin_Interpolation::TANGENT_START_ID()); + AttributeSelectionPtr anAttrEndTangent = + aBase->selection(BuildPlugin_Interpolation::TANGENT_END_ID()); + + theDumper << anAttrStartTangent << ", " << anAttrEndTangent << ", "; + } + + theDumper << closed() << ", " << reorder() << ")" << std::endl; + }else{ + + theDumper << aBase << " = model.addInterpolation(" << aPartName ; + AttributeStringPtr XtAttr = xt(); + std::string xt = XtAttr->value(); + AttributeStringPtr YtAttr = yt(); + std::string yt = YtAttr->value(); + AttributeStringPtr ZtAttr = zt(); + std::string zt = ZtAttr->value(); + AttributeDoublePtr minTAttr = mint(); + double mint = minTAttr->value(); + AttributeDoublePtr maxTAttr = maxt(); + double maxt = maxTAttr->value(); + AttributeIntegerPtr nbStepAttr = numstep(); + int nbStep = nbStepAttr->value(); + + theDumper<< ", \"" << xt << "\",\"" << yt << "\",\""<< zt<< "\", " ; + theDumper << mint << ", " << maxt << ", "<< nbStep<< ")"<& theP theIsToReorder)); } +InterpolationPtr addInterpolation(const std::shared_ptr& thePart, + const std::string & theXTexpression, + const std::string & theYTexpression, + const std::string & theZTexpression, + const ModelHighAPI_Double& theMinT, + const ModelHighAPI_Double& theMaxT, + const ModelHighAPI_Integer& theNbStep) +{ + std::shared_ptr aFeature = thePart->addFeature(BuildAPI_Interpolation::ID()); + return InterpolationPtr(new BuildAPI_Interpolation(aFeature, + theXTexpression, + theYTexpression, + theZTexpression, + theMinT, + theMaxT, + theNbStep)); +} //================================================================================================== void BuildAPI_Interpolation::execIfBaseNotEmpty() { diff --git a/src/BuildAPI/BuildAPI_Interpolation.h b/src/BuildAPI/BuildAPI_Interpolation.h index e1ee1031d..732a57a90 100644 --- a/src/BuildAPI/BuildAPI_Interpolation.h +++ b/src/BuildAPI/BuildAPI_Interpolation.h @@ -27,6 +27,9 @@ #include #include #include +#include +#include + class ModelHighAPI_Selection; @@ -54,11 +57,21 @@ public: const std::list& theBaseObjects, const bool theIsClosed, const bool theIsToReorder); + /// Constructor with expression analytical of X,Y andZ + BUILDAPI_EXPORT + explicit BuildAPI_Interpolation(const FeaturePtr& theFeature, + const std::string & theXTexpression, + const std::string & theYTexpression, + const std::string & theZTexpression, + const ModelHighAPI_Double& theMinT, + const ModelHighAPI_Double& theMaxT, + const ModelHighAPI_Integer& theNbStep); + /// Destructor. BUILDAPI_EXPORT virtual ~BuildAPI_Interpolation(); - INTERFACE_6(BuildPlugin_Interpolation::ID(), + INTERFACE_13(BuildPlugin_Interpolation::ID(), baseObjects, BuildPlugin_Interpolation::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, closed, BuildPlugin_Interpolation::CLOSED_ID(), @@ -70,7 +83,21 @@ public: startTangent, BuildPlugin_Interpolation::TANGENT_START_ID(), ModelAPI_AttributeSelection, /** Start point tangent */, endTangent, BuildPlugin_Interpolation::TANGENT_END_ID(), - ModelAPI_AttributeSelection, /** End point tangent */) + ModelAPI_AttributeSelection, /** End point tangent */, + xt, BuildPlugin_Interpolation::XT_ID(), + ModelAPI_AttributeString, /** xt expression*/, + yt, BuildPlugin_Interpolation::YT_ID(), + ModelAPI_AttributeString, /** yt expression*/, + zt, BuildPlugin_Interpolation::ZT_ID(), + ModelAPI_AttributeString, /** zt expression*/, + mint, BuildPlugin_Interpolation::MINT_ID(), + ModelAPI_AttributeDouble, /** zt expression*/, + maxt, BuildPlugin_Interpolation::MAXT_ID(), + ModelAPI_AttributeDouble, /** zt expression*/, + numstep, BuildPlugin_Interpolation::NUMSTEP_ID(), + ModelAPI_AttributeInteger, /** zt expression*/, + creationmethod, BuildPlugin_Interpolation::CREATION_METHODE_ID(), + ModelAPI_AttributeString, /** zt expression*/) /// Modify base attribute of the feature. BUILDAPI_EXPORT @@ -118,4 +145,15 @@ InterpolationPtr addInterpolation(const std::shared_ptr& theP const bool theIsClosed = false, const bool theIsToReorder = false); +/// \ingroup CPPHighAPI +/// \brief Create Interpolation feature using tangents. +BUILDAPI_EXPORT +InterpolationPtr addInterpolation(const std::shared_ptr& thePart, + const std::string & theXTexpression, + const std::string & theYTexpression, + const std::string & theZTexpression, + const ModelHighAPI_Double& theMinT, + const ModelHighAPI_Double& theMaxT, + const ModelHighAPI_Integer& theNbStep); + #endif // BuildAPI_Interpolation_H_ diff --git a/src/BuildPlugin/BuildPlugin_EvalListener.cpp b/src/BuildPlugin/BuildPlugin_EvalListener.cpp index 73b4292a0..335995622 100644 --- a/src/BuildPlugin/BuildPlugin_EvalListener.cpp +++ b/src/BuildPlugin/BuildPlugin_EvalListener.cpp @@ -132,29 +132,45 @@ void BuildPlugin_EvalListener::processEvent( AttributeTablesPtr anValueAttr = aParam->tables(BuildPlugin_Interpolation::VALUE_ID()); std::string anError; std::list > aParamsList; - - AttributeStringPtr anExprAttr; + + AttributeStringPtr anExprAttr; ModelAPI_AttributeTables::Value aVal; for(int step =0; step < anValueAttr->rows(); step++ ){ anExprAttr = aParam->string(BuildPlugin_Interpolation::XT_ID()); std::wstring anExp = anExprAttr->isUValue() ? Locale::Convert::toWString(anExprAttr->valueU()) : Locale::Convert::toWString(anExprAttr->value()); - aVal.myDouble = evaluate(anVar,anValueAttr->value(step,0).myDouble,aParam, anExp, anError, aParamsList, true); - anValueAttr->setValue(aVal,step,1); - + aVal.myDouble = evaluate(anVar,anValueAttr->value(step,0).myDouble, + aParam, + anExp, + anError,aParamsList, + true); + anValueAttr->setValue(aVal,step,1); + anExprAttr = aParam->string(BuildPlugin_Interpolation::YT_ID()); anExp = anExprAttr->isUValue() ? Locale::Convert::toWString(anExprAttr->valueU()) : Locale::Convert::toWString(anExprAttr->value()); - aVal.myDouble = evaluate(anVar,anValueAttr->value(step,0).myDouble,aParam, anExp, anError, aParamsList, true); + aVal.myDouble = evaluate(anVar, + anValueAttr->value(step,0).myDouble, + aParam, + anExp, + anError, + aParamsList, + true); anValueAttr->setValue(aVal,step,2); anExprAttr = aParam->string(BuildPlugin_Interpolation::ZT_ID()); anExp = anExprAttr->isUValue() ? Locale::Convert::toWString(anExprAttr->valueU()) : Locale::Convert::toWString(anExprAttr->value()); - aVal.myDouble = evaluate(anVar,anValueAttr->value(step,0).myDouble,aParam, anExp, anError, aParamsList, true); + aVal.myDouble = evaluate(anVar, + anValueAttr->value(step,0).myDouble, + aParam, + anExp, + anError, + aParamsList, + true); anValueAttr->setValue(aVal,step,3); } @@ -167,10 +183,10 @@ void BuildPlugin_EvalListener::processEvent( } double BuildPlugin_EvalListener::evaluate( - std::wstring& theVariable, + std::wstring& theVariable, double theValueVariable, FeaturePtr theParameter, - const std::wstring& theExpression, + const std::wstring& theExpression, std::string& theError, std::list >& theParamsList, const bool theIsParameter) diff --git a/src/BuildPlugin/BuildPlugin_EvalListener.h b/src/BuildPlugin/BuildPlugin_EvalListener.h index 3698e6f51..ab558a356 100644 --- a/src/BuildPlugin/BuildPlugin_EvalListener.h +++ b/src/BuildPlugin/BuildPlugin_EvalListener.h @@ -27,7 +27,6 @@ class ModelAPI_Attribute; class ModelAPI_Document; class ModelAPI_Feature; class ModelAPI_ResultParameter; -// JL_CGLB n'existe pas class InitializationPlugin_Parameter; class BuildPlugin_PyInterp; /** @@ -50,7 +49,7 @@ class BuildPlugin_EvalListener : public Events_Listener protected: /// Evaluates theExpression and returns its value. - double evaluate(std::wstring& theVariable, + double evaluate(std::wstring& theVariable, double theValueVariable,std::shared_ptr theParameter, const std::wstring& theExpression, std::string& theError, std::list >& theParamsList, diff --git a/src/BuildPlugin/BuildPlugin_Interpolation.cpp b/src/BuildPlugin/BuildPlugin_Interpolation.cpp index ab0dec57a..7aa82f279 100644 --- a/src/BuildPlugin/BuildPlugin_Interpolation.cpp +++ b/src/BuildPlugin/BuildPlugin_Interpolation.cpp @@ -59,7 +59,7 @@ //================================================================================================= BuildPlugin_Interpolation::BuildPlugin_Interpolation() { - + } //================================================================================================= @@ -89,58 +89,63 @@ void BuildPlugin_Interpolation::initAttributes() data()->addAttribute(MINT_ID(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(MAXT_ID(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(NUMSTEP_ID(), ModelAPI_AttributeInteger::typeId()); - - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), CREATION_METHODE_ANALYTICAL_ID()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), CREATION_METHODE_BY_SELECTION_ID()); + + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + CREATION_METHODE_ANALYTICAL_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + CREATION_METHODE_BY_SELECTION_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXPRESSION_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), VARIABLE_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), VALUE_ID()); - data()->addAttribute(ARGUMENTS_ID(), ModelAPI_AttributeRefList::typeId()); data()->reflist(ARGUMENTS_ID())->setIsArgument(false); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ARGUMENTS_ID()); + string(XT_ID())->setValue("t"); + string(YT_ID())->setValue("t"); + string(ZT_ID())->setValue("t"); + real(MINT_ID())->setValue(0); + real(MAXT_ID())->setValue(100); + integer(NUMSTEP_ID())->setValue(10); + updateCoods(); } void BuildPlugin_Interpolation::attributeChanged(const std::string& theID) -{ - if( (theID == XT_ID() - || theID == YT_ID() - || theID == ZT_ID() +{ + if( (theID == XT_ID() + || theID == YT_ID() + || theID == ZT_ID() || theID == MINT_ID() || theID == MAXT_ID() || theID == NUMSTEP_ID()) && string(XT_ID())->value() !="" && string(YT_ID())->value() !="" && string(ZT_ID())->value() !="" + && string(CREATION_METHODE_ID())->value() == CREATION_METHODE_ANALYTICAL_ID() ){ updateCoods(); } - } void BuildPlugin_Interpolation::updateCoods() -{ +{ std::wstring exp; - double aMint = real(MINT_ID())->value(); + double aMint = real(MINT_ID())->value(); double aMaxt = real(MAXT_ID())->value(); - int aNbrStep = integer(NUMSTEP_ID())->value(); - double scale = (aMaxt - aMint )/aNbrStep; + int aNbrStep = integer(NUMSTEP_ID())->value(); + double scale = (aMaxt - aMint )/aNbrStep; string(VARIABLE_ID())->setValue("t"); tables(VALUE_ID())->setSize(aNbrStep,4); for( int step = 0; step < aNbrStep; step++ ){ ModelAPI_AttributeTables::Value aVal; aVal.myDouble = step * scale + aMint; - tables(VALUE_ID())->setValue(aVal,step,0); + tables(VALUE_ID())->setValue(aVal,step,0); } outErrorMessage=""; - + evaluate(outErrorMessage); - if (!outErrorMessage.empty()){ - std::cout << L"outErrorMessage= " << outErrorMessage << std::endl; - } } //================================================================================================= @@ -233,61 +238,54 @@ void BuildPlugin_Interpolation::execute() { if( string( XT_ID())->value() == "" ||string( YT_ID())->value() == "" - ||string( ZT_ID())->value() == "") - return; - + ||string( ZT_ID())->value() == "" + ||tables(VALUE_ID())->rows()== 0 ) + return; + if (!outErrorMessage.empty()){ setError("Error: Python interpreter " + outErrorMessage); return; } - AttributeTablesPtr table = tables( VALUE_ID() ); + AttributeTablesPtr table = tables( VALUE_ID() ); std::list > aCoodPoints; for( int step = 0; step < table->rows() ; step++ ){ - std::vector coodPoint; + std::vector coodPoint; ModelAPI_AttributeTables::Value value; //x - value = table->value(step, 1); - coodPoint.push_back( value.myDouble ); + value = table->value(step, 1); + coodPoint.push_back( value.myDouble ); //y - value = table->value(step, 2); - coodPoint.push_back( value.myDouble ); + value = table->value(step, 2); + coodPoint.push_back( value.myDouble ); // - value = table->value(step, 3); - coodPoint.push_back( value.myDouble ); + value = table->value(step, 3); + coodPoint.push_back( value.myDouble ); aCoodPoints.push_back(coodPoint); } - + std::list aPoints; std::list aVertices; std::list >::const_iterator aItCoodPoints = aCoodPoints.begin(); - + for( ; aItCoodPoints != aCoodPoints.end(); ++aItCoodPoints ){ - std::cout << "cood = " << "(" << (*aItCoodPoints)[0] << ", "<< - (*aItCoodPoints)[1] << ", "<< - (*aItCoodPoints)[2] << " ) "<< std::endl; - GeomVertexPtr vertex = + + GeomVertexPtr vertex = GeomAlgoAPI_PointBuilder::vertex( (*aItCoodPoints)[0], (*aItCoodPoints)[1], (*aItCoodPoints)[2]); - aPoints.push_back (vertex->point()); + aPoints.push_back (vertex->point()); aVertices.push_back (vertex); - } - /* - GeomDirPtr aDirStart(new GeomAPI_Dir( aCoodPoints.front()[0], - aCoodPoints.front()[1], - aCoodPoints.front()[2])); - GeomDirPtr aDirEnd(new GeomAPI_Dir( aCoodPoints.back()[0], - aCoodPoints.back()[1], - aCoodPoints.back()[2]));*/ + } + // Create curve from points GeomEdgePtr anEdge = - GeomAlgoAPI_CurveBuilder::edge(aPoints, false, true,GeomDirPtr(),GeomDirPtr()); //aDirStart, aDirEnd); + GeomAlgoAPI_CurveBuilder::edge(aPoints, false, true,GeomDirPtr(),GeomDirPtr()); if (!anEdge.get()) { setError("Error: Result curve is empty."); return; } - + ResultBodyPtr aResultBody = document()->createBody(data()); // Load the result aResultBody->store(anEdge); @@ -297,9 +295,9 @@ void BuildPlugin_Interpolation::execute() aResultBody->generated(anExp.current(), aVertexName); aVertexIndex++; } - + setResult(aResultBody); - + } } @@ -312,7 +310,6 @@ void BuildPlugin_Interpolation::evaluate(std::string& theError) if (aProcessMessage->isProcessed()) { theError = aProcessMessage->error(); - std::cout << "theError= " << theError << std::endl; } else { // error: python interpreter is not active theError = "Python interpreter is not available"; } diff --git a/src/BuildPlugin/BuildPlugin_Interpolation.h b/src/BuildPlugin/BuildPlugin_Interpolation.h index 64181cb3b..4859364cf 100644 --- a/src/BuildPlugin/BuildPlugin_Interpolation.h +++ b/src/BuildPlugin/BuildPlugin_Interpolation.h @@ -148,7 +148,7 @@ public: static const std::string MY_VALUE_ID("value"); return MY_VALUE_ID; } - + /// attribute of parameter expression inline static const std::string& EXPRESSION_ID() { @@ -192,7 +192,7 @@ public: /// Creates a new part document if needed. BUILDPLUGIN_EXPORT virtual void execute(); - + BUILDPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); protected: diff --git a/src/BuildPlugin/BuildPlugin_Plugin.cpp b/src/BuildPlugin/BuildPlugin_Plugin.cpp index 45893e4c5..fad3b0145 100644 --- a/src/BuildPlugin/BuildPlugin_Plugin.cpp +++ b/src/BuildPlugin/BuildPlugin_Plugin.cpp @@ -64,7 +64,7 @@ BuildPlugin_Plugin::BuildPlugin_Plugin() new BuildPlugin_ValidatorBaseForVertex()); aFactory->registerValidator("BuildPlugin_ValidatorExpressionInterpolation", new BuildPlugin_ValidatorExpressionInterpolation()); - + // Register this plugin. ModelAPI_Session::get()->registerPlugin(this); diff --git a/src/BuildPlugin/Test/TestInterpolation.py b/src/BuildPlugin/Test/TestInterpolation.py index 2fae36742..a06488579 100644 --- a/src/BuildPlugin/Test/TestInterpolation.py +++ b/src/BuildPlugin/Test/TestInterpolation.py @@ -172,6 +172,16 @@ model.testHaveNamingSubshapes(Interpolation_9, model, Part_3_doc) model.end() # ============================================================================= -# Test 12. Check Python dump +# Test 12. Create curve using an analytical expression +# ============================================================================= +Part_5 = model.addPart(partSet) +Part_5_doc = Part_5.document() + +Interpolation_11 = model.addInterpolation(Part_5_doc, "sin(t)","cos(t)","t", 0, 100, 10) + +model.checkResult(Interpolation_11, model, 1, [0], [0], [0], [1], [2]) + +# ============================================================================= +# Test 13. Check Python dump # ============================================================================= assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING)) diff --git a/src/BuildPlugin/icons/feature_interpolation_analytical.png b/src/BuildPlugin/icons/feature_interpolation_analytical.png new file mode 100644 index 0000000000000000000000000000000000000000..e5c5374b978367f79f571175cc13eb6bcfd99061 GIT binary patch literal 511 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)5C}6~x?A@LD9DoT z=}1{rUgjp4pVqfx*x)K$3w)fLTx6$k1@&(~<^;q(iAQ0(11w1mp$r zuy82wh|fCmy_uI$k}WlQa*~Dv!$JuTW1fz$jTX`!>CQ)|bei%jG;FAhWbIIG_`xc0 zzp=|x;I&r+L(^`7ld1;;^1GaWzFV?GNTDGjp{KaJJ5evOVb?oV5o3j&LMs16=QlDi z9%&I}EoWjb=#*_st3su+z91Qe}omo#i#vKug`xTJ?I@y>t6)qDm42Oke92g52xuX;ygf%)4jfx<>SQ=Ax>I4ot0 zoRh`EKOK0LyJCj5&JG5q4pz^1+Kmz}-@k>MSWY$WZjVcjHIb2p(W$F?hQAxvX - + - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Events/Events_Listener.cpp b/src/Events/Events_Listener.cpp index 593f26974..267e6db6b 100644 --- a/src/Events/Events_Listener.cpp +++ b/src/Events/Events_Listener.cpp @@ -34,7 +34,6 @@ void Events_Listener::groupWhileFlush(const std::shared_ptr& the std::shared_ptr aStored = std::dynamic_pointer_cast(aMyGroup->second); aStored->Join(aGroup); - //std::cout<<"Add to group "<eventID().eventText()< #include +#include #include +#include #include //================================================================================================= @@ -36,6 +38,15 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptrname().substr(0, 6) == L"Interp" ) + { + AttributeStringPtr anAttr =theFeature->string( + BuildPlugin_Interpolation::CREATION_METHODE_ID()); + if ( anAttr->isInitialized() ) + if( anAttr->value() == BuildPlugin_Interpolation::CREATION_METHODE_ANALYTICAL_ID()) + return true; + } std::string aSelectionListId = theArguments.front(); AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(aSelectionListId); -- 2.39.2