+ std::set<ResultPtr> anEdgeShapes;
+ ModelGeomAlgo_Shape::shapesOfType(aFeature, GeomAPI_Shape::EDGE, anEdgeShapes);
+ if (anEdgeShapes.empty())
+ ModelGeomAlgo_Shape::shapesOfType(aFeature, GeomAPI_Shape::VERTEX, anEdgeShapes);
+
+ if (anEdgeShapes.empty())
+ continue;
+ ResultPtr aResult = *anEdgeShapes.begin();
+ GeomShapePtr aShape = aResult->shape();
+
+ GeomShapePtr aShapeOfIntersection = aFeatureShape->intersect(aShape);
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ int aPrevSize = thePointToAttributeOrObject.size();
+#endif
+ appendShapePoints(aShapeOfIntersection, aResult, thePointToAttributeOrObject);
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ if (aPrevSize != thePointToAttributeOrObject.size())
+ std::cout << " <- appendShapePoints"
+ << thePointToAttributeOrObject.size() - aPrevSize << std::endl;
+#endif
+ }
+ }
+}
+
+std::list<std::shared_ptr<GeomAPI_Pnt> > ModelGeomAlgo_Point2D::getSetOfPntIntersectedShape(
+ const std::shared_ptr<ModelAPI_Feature>& theBaseFeature,
+ const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures)
+{
+ std::list<std::shared_ptr<GeomAPI_Pnt> > aPoints;
+
+ PointToRefsMap aRefsMap;
+ getPointsIntersectedShape(theBaseFeature, theFeatures, aRefsMap);
+
+ for (PointToRefsMap::const_iterator aPointIt = aRefsMap.begin();
+ aPointIt != aRefsMap.end(); aPointIt++)
+ aPoints.push_back(aPointIt->first);
+
+ return aPoints;
+}
+
+void ModelGeomAlgo_Point2D::getPointsInsideShape(
+ const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+ const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theAttributes,
+ const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
+ const std::shared_ptr<GeomAPI_Dir>& theDirX,
+ const std::shared_ptr<GeomAPI_Dir>& theDirY,
+ PointToRefsMap& thePointToAttributeOrObject)
+{
+#ifdef DEBUG_POINT_INSIDE_SHAPE
+ std::cout << "ModelGeomAlgo_Point2D::getPointsInsideShape:" << std::endl;
+#endif
+ std::set<std::shared_ptr<GeomDataAPI_Point2D> >::const_iterator anIt = theAttributes.begin(),
+ aLast = theAttributes.end();
+ for (; anIt != aLast; anIt++) {
+ std::shared_ptr<GeomDataAPI_Point2D> anAttribute = *anIt;
+ std::shared_ptr<GeomAPI_Pnt2d> aPnt2d = anAttribute->pnt();
+ std::shared_ptr<GeomAPI_Pnt> aPoint = aPnt2d->to3D(theOrigin, theDirX, theDirY);
+ std::shared_ptr<GeomAPI_Pnt> aProjectedPoint;
+ if (isInnerPointOnEdge(theBaseShape, aPoint, aProjectedPoint)) {
+ if (thePointToAttributeOrObject.find(aProjectedPoint) != thePointToAttributeOrObject.end())
+ thePointToAttributeOrObject.at(aProjectedPoint).first.push_back(anAttribute);
+ else {
+ std::list<std::shared_ptr<GeomDataAPI_Point2D> > anAttributes;
+ std::list<std::shared_ptr<ModelAPI_Object> > anObjects;
+ anAttributes.push_back(anAttribute);
+ thePointToAttributeOrObject[aProjectedPoint] = std::make_pair(anAttributes, anObjects);