#include "ModuleBase_ISelection.h"
+//********************************************************************
+void ModuleBase_ISelection::appendSelected(const QList<ModuleBase_ViewerPrs> theValues,
+ QList<ModuleBase_ViewerPrs>& theValuesTo)
+{
+ // collect the objects from the viewer
+ QObjectPtrList anExistedObjects;
+ QList<ModuleBase_ViewerPrs>::const_iterator aPrsIt = theValuesTo.begin(),
+ aPrsLast = theValuesTo.end();
+ for (; aPrsIt != aPrsLast; aPrsIt++) {
+ if ((*aPrsIt).owner() && (*aPrsIt).object())
+ anExistedObjects.push_back((*aPrsIt).object());
+ }
+
+
+ QList<ModuleBase_ViewerPrs>::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)
{