return thePoint2D->to3D(aC->pnt(), aX->dir(), aY);
}
-ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShape,
- const ObjectPtr& theObject,
- CompositeFeaturePtr theSketch)
+ResultPtr PartSet_Tools::findFixedObjectByExternal(const TopoDS_Shape& theShape,
+ const ObjectPtr& theObject,
+ CompositeFeaturePtr theSketch)
{
+ ResultPtr aResult;
if (theShape.ShapeType() == TopAbs_EDGE) {
// Check that we already have such external edge
std::shared_ptr<GeomAPI_Edge> aInEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge());
aInEdge->setImpl(new TopoDS_Shape(theShape));
- ResultPtr aResult = findExternalEdge(theSketch, aInEdge);
- if (aResult)
- return aResult;
+ aResult = findExternalEdge(theSketch, aInEdge);
+ }
+ if (theShape.ShapeType() == TopAbs_VERTEX) {
+ std::shared_ptr<GeomAPI_Vertex> aInVert = std::shared_ptr<GeomAPI_Vertex>(new GeomAPI_Vertex());
+ aInVert->setImpl(new TopoDS_Shape(theShape));
+ aResult = findExternalVertex(theSketch, aInVert);
+ }
+ return aResult;
+}
- // If not found then we have to create new
+ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShape,
+ const ObjectPtr& theObject,
+ CompositeFeaturePtr theSketch)
+{
+ if (theShape.ShapeType() == TopAbs_EDGE) {
Standard_Real aStart, aEnd;
Handle(V3d_View) aNullView;
FeaturePtr aMyFeature;
}
}
if (theShape.ShapeType() == TopAbs_VERTEX) {
- std::shared_ptr<GeomAPI_Vertex> aInVert = std::shared_ptr<GeomAPI_Vertex>(new GeomAPI_Vertex());
- aInVert->setImpl(new TopoDS_Shape(theShape));
- ResultPtr aResult = findExternalVertex(theSketch, aInVert);
- if (aResult)
- return aResult;
-
FeaturePtr aMyFeature = theSketch->addFeature(SketchPlugin_Point::ID());
if (aMyFeature) {