X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ISelection.cpp;h=cff9fa134ae48aa270437c0f5992c18fbc3f07b6;hb=5303dd1fa6ad4411e38f8d36103c72109957e05c;hp=708382115cc5a3783d074411c92b094e00cafcf7;hpb=90ae02f67bbf42f79ea2fc05404d455159cb53a7;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ISelection.cpp b/src/ModuleBase/ModuleBase_ISelection.cpp index 708382115..cff9fa134 100644 --- a/src/ModuleBase/ModuleBase_ISelection.cpp +++ b/src/ModuleBase/ModuleBase_ISelection.cpp @@ -2,6 +2,31 @@ #include "ModuleBase_ISelection.h" +//******************************************************************** +void ModuleBase_ISelection::appendSelected(const QList theValues, + QList& theValuesTo) +{ + // collect the objects from the viewer + QObjectPtrList anExistedObjects; + QList::const_iterator aPrsIt = theValuesTo.begin(), + aPrsLast = theValuesTo.end(); + for (; aPrsIt != aPrsLast; aPrsIt++) { + if ((*aPrsIt).owner() && (*aPrsIt).object()) + anExistedObjects.push_back((*aPrsIt).object()); + } + + + QList::const_iterator anIt = theValues.begin(), + aLast = theValues.end(); + for (; anIt != aLast; anIt++) { + ObjectPtr anObject = (*anIt).object(); + if (anObject.get() != NULL && !anExistedObjects.contains(anObject)) { + theValuesTo.append(ModuleBase_ViewerPrs(anObject, TopoDS_Shape(), NULL)); + } + } + +} + //******************************************************************** ResultPtr ModuleBase_ISelection::getResult(const ModuleBase_ViewerPrs& thePrs) {