#include <ModelAPI_ResultConstruction.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_AttributeString.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
#include <GeomAlgoAPI_FaceBuilder.h>
#include <GeomAPI_Pnt2d.h>
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()
anAttrC->isInitialized() && anAttrD->isInitialized() ) {
double aA = anAttrA->value(), aB = anAttrB->value(),
aC = anAttrC->value(), aD = anAttrD->value();
- std::shared_ptr<GeomAPI_Pln> aPlane = std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(aA, aB, aC, aD));
+ std::shared_ptr<GeomAPI_Pln> aPlane =
+ std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(aA, aB, aC, aD));
std::string kDefaultPlaneSize = "200";
double aSize = Config_PropManager::integer("Sketch planes", "planes_size", kDefaultPlaneSize);
aSize *= 4.;