#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>
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()
if (!aPlaneFace.get())
return;
ResultConstructionPtr aConstr = document()->createConstruction(data());
+ aConstr->setInfinite(true);
aConstr->setShape(aPlaneFace);
setResult(aConstr);
}
double aDist = aDistAttr->value();
GeomShapePtr aShape = aFaceAttr->value();
+ if (!aShape.get()) {
+ aShape = aFaceAttr->context()->shape();
+ }
+
if (aShape.get() != NULL) {
std::shared_ptr<GeomAPI_Pln> aPln = GeomAlgoAPI_FaceBuilder::plane(aShape);
std::shared_ptr<GeomAPI_Pnt> aOrig = aPln->location();