X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Plane.cpp;h=adcd4c1229bdf34e622cc1adaa0a629994f60515;hb=13d3f0d8b46a06931cbe8620b8563049eff4a9f6;hp=7448f5a7e5aa62f5d8bc70b9b403f8593c0fcbdc;hpb=08c3ac23e89dcdc6504121af63731d764e1b6b42;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 7448f5a7e..adcd4c122 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include @@ -23,15 +25,20 @@ ConstructionPlugin_Plane::ConstructionPlugin_Plane() void ConstructionPlugin_Plane::initAttributes() { - data()->addAttribute(ConstructionPlugin_Plane::METHOD(), ModelAPI_AttributeString::type()); + data()->addAttribute(ConstructionPlugin_Plane::METHOD(), ModelAPI_AttributeString::typeId()); // Face & Distance - data()->addAttribute(ConstructionPlugin_Plane::FACE(), ModelAPI_AttributeSelection::type()); - data()->addAttribute(ConstructionPlugin_Plane::DISTANCE(), ModelAPI_AttributeDouble::type()); + data()->addAttribute(ConstructionPlugin_Plane::FACE(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(ConstructionPlugin_Plane::DISTANCE(), ModelAPI_AttributeDouble::typeId()); // General equation - data()->addAttribute(ConstructionPlugin_Plane::A(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(ConstructionPlugin_Plane::B(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(ConstructionPlugin_Plane::C(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(ConstructionPlugin_Plane::D(), ModelAPI_AttributeDouble::type()); + data()->addAttribute(ConstructionPlugin_Plane::A(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(ConstructionPlugin_Plane::B(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(ConstructionPlugin_Plane::C(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(ConstructionPlugin_Plane::D(), ModelAPI_AttributeDouble::typeId()); + + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Plane::A()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Plane::B()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Plane::C()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Plane::D()); } void ConstructionPlugin_Plane::execute() @@ -47,6 +54,7 @@ void ConstructionPlugin_Plane::execute() if (!aPlaneFace.get()) return; ResultConstructionPtr aConstr = document()->createConstruction(data()); + aConstr->setInfinite(true); aConstr->setShape(aPlaneFace); setResult(aConstr); } @@ -88,6 +96,10 @@ std::shared_ptr ConstructionPlugin_Plane::createPlaneByFaceAndDi double aDist = aDistAttr->value(); GeomShapePtr aShape = aFaceAttr->value(); + if (!aShape.get()) { + aShape = aFaceAttr->context()->shape(); + } + if (aShape.get() != NULL) { std::shared_ptr aPln = GeomAlgoAPI_FaceBuilder::plane(aShape); std::shared_ptr aOrig = aPln->location();