X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Plane.cpp;h=13ae2b36d65cb7fe6ca22bcdeb2f398b22172352;hb=1b9dd3633d644c358424227423b330e9551be38f;hp=5fecd65240f47ab593168de9c74efb98a8eabe95;hpb=8579a62492b5e8227d9e256cc9754a31442c05ed;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 5fecd6524..13ae2b36d 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() @@ -137,7 +144,8 @@ std::shared_ptr ConstructionPlugin_Plane::createPlaneByGeneralEqu anAttrC->isInitialized() && anAttrD->isInitialized() ) { double aA = anAttrA->value(), aB = anAttrB->value(), aC = anAttrC->value(), aD = anAttrD->value(); - std::shared_ptr aPlane = std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); + std::shared_ptr aPlane = + std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); std::string kDefaultPlaneSize = "200"; double aSize = Config_PropManager::integer("Sketch planes", "planes_size", kDefaultPlaneSize); aSize *= 4.;