#include <GeomAlgoAPI_ShapeTools.h>
#include <ModelGeomAlgo_Point2D.h>
+#include <ModelGeomAlgo_Shape.h>
#include <ModelGeomAlgo_Point2D.h>
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObject);
std::list<AttributePtr> a2DPointAttributes = aBaseFeature->data()->attributes(
GeomDataAPI_Point2D::typeId());
- std::list<AttributePtr>::const_iterator anIt = a2DPointAttributes.begin(),
+ std::list<AttributePtr>::const_iterator anIt = a2DPointAttributes.begin(),
aLast = a2DPointAttributes.end();
for (; anIt != aLast; anIt++) {
- std::shared_ptr<GeomDataAPI_Point2D> anAttributePoint =
+ std::shared_ptr<GeomDataAPI_Point2D> anAttributePoint =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIt);
std::shared_ptr<GeomAPI_Pnt2d> aPoint2D = anAttributePoint->pnt();
std::shared_ptr<GeomAPI_Pnt> aPoint3D = PartSet_Tools::convertTo3D(aPoint2D->x(),
/// find the points in coincident features
PntToAttributesMap aRefAttributes = myCashedReferences[aBaseObject];
- PntToAttributesMap::const_iterator aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end();
+ PntToAttributesMap::const_iterator
+ aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end();
for (; aRIt != aRLast; aRIt++) {
std::shared_ptr<GeomDataAPI_Point2D> anAttribute = aRIt->first;
std::shared_ptr<GeomAPI_Pnt> aPoint = aRIt->second;
std::set<std::shared_ptr<GeomDataAPI_Point2D> > aRefAttributes;
// current feature
FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
- std::set<GeomShapePtr> anEdgeShapes;
// edges on feature
- ModelAPI_Tools::shapesOfType(aFeature, GeomAPI_Shape::EDGE, anEdgeShapes);
- if (!anEdgeShapes.empty()) {
- GeomShapePtr aFeatureShape = *anEdgeShapes.begin();
+ std::set<ResultPtr> anEdgeResults;
+ ModelGeomAlgo_Shape::shapesOfType(aFeature, GeomAPI_Shape::EDGE, anEdgeResults);
+ if (!anEdgeResults.empty()) {
+ GeomShapePtr aFeatureShape = (*anEdgeResults.begin())->shape();
// coincidences to the feature
ModelGeomAlgo_Point2D::getPointsOfReference(aFeature, SketchPlugin_ConstraintCoincidence::ID(),
aData->attribute(SketchPlugin_Sketch::NORM_ID()));
std::shared_ptr<GeomAPI_Dir> aY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir())));
std::list<std::shared_ptr<GeomAPI_Pnt> > aPoints;
- ModelGeomAlgo_Point2D::getPointsInsideShape(aFeatureShape, aRefAttributes, aC->pnt(),
+ ModelGeomAlgo_Point2D::getPointsInsideShape_p(aFeatureShape, aRefAttributes, aC->pnt(),
aX->dir(), aY, aPoints, aPointToAttributes);
- GeomAlgoAPI_ShapeTools::splitShape(aFeatureShape, aPoints, aShapes);
+ GeomAlgoAPI_ShapeTools::splitShape_p(aFeatureShape, aPoints, aShapes);
}
myCashedShapes[theObject] = aShapes;
myCashedReferences[theObject] = aPointToAttributes;