#include <GeomAPI_Pnt.h>
#include <GeomAPI_Vertex.h>
#include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
//==================================================================================================
ConstructionPlugin_Point::ConstructionPlugin_Point()
//==================================================================================================
void ConstructionPlugin_Point::initAttributes()
{
- data()->addAttribute(point3d(), GeomDataAPI_Point::typeId());
+ data()->addAttribute(POINT3D(), GeomDataAPI_Point::typeId());
data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
removeResults(1); // for case the point type was switched from multi-results type
std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
+ aConstr->setInfinite(true);
aConstr->setShape(aShape);
setResult(aConstr);
}
std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByXYZ()
{
AttributePointPtr aPoint =
- std::dynamic_pointer_cast<GeomDataAPI_Point>(data()->attribute(point3d()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point>(data()->attribute(POINT3D()));
return GeomAlgoAPI_PointBuilder::vertex(aPoint->x(), aPoint->y(), aPoint->z());
}
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();