+FiltersFeaturePtr FiltersAPI_Selection::feature() const
+{
+ return myFilterFeature;
+}
+
+std::list<ModelHighAPI_Selection> FiltersAPI_Selection::select
+ (const std::string theShapeType) const
+{
+ return select(GeomAPI_Shape::shapeTypeByStr(theShapeType));
+}
+
+std::list<ModelHighAPI_Selection> FiltersAPI_Selection::select
+ (const GeomAPI_Shape::ShapeType theShapeType) const
+{
+ // finish operation to make sure the selection is done on the current state of the history
+ apply();
+
+ std::list<ModelHighAPI_Selection> aSelList;
+ static SessionPtr aSession = ModelAPI_Session::get();
+ std::list< std::pair<ResultPtr, GeomShapePtr> > aResList =
+ aSession->filters()->select(myFilterFeature, theShapeType);
+
+ std::list< std::pair<ResultPtr, GeomShapePtr> >::const_iterator itSelected = aResList.cbegin();
+ for (; itSelected != aResList.cend(); itSelected++) {
+ ResultPtr aCurRes = (*itSelected).first;
+ GeomShapePtr aSubShape = (*itSelected).second;
+ aSelList.push_back(ModelHighAPI_Selection(aCurRes, aSubShape));
+ }
+
+ return aSelList;
+}
+