#include <GeomAPI_Pnt.h>
#include <GeomAPI_Vertex.h>
#include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
//==================================================================================================
ConstructionPlugin_Point::ConstructionPlugin_Point()
if(!aLineShape.get()) {
aLineShape = aLineSelection->context()->shape();
}
- std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aLineShape));
+ GeomEdgePtr anEdge;
+ if (aLineShape->isEdge()) {
+ anEdge = aLineShape->edge();
+ }
+ else if (aLineShape->isCompound()) {
+ GeomAPI_ShapeIterator anIt(aLineShape);
+ anEdge = anIt.current()->edge();
+ }
// Get plane.
AttributeSelectionPtr aPlaneSelection= selection(INTERSECTION_PLANE());
if(!aPlaneShape.get()) {
aPlaneShape = aPlaneSelection->context()->shape();
}
- std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aPlaneShape));
+ GeomFacePtr aFace;
+ if (aPlaneShape->isFace()) {
+ aFace = aPlaneShape->face();
+ }
+ else if (aPlaneShape->isCompound()) {
+ GeomAPI_ShapeIterator anIt(aPlaneShape);
+ aFace = anIt.current()->face();
+ }
if (!string(USE_OFFSET())->value().empty()) {
double anOffset = real(OFFSET())->value();