-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
GeomShapePtr aLineShape1 = aLineAttribute1->value();
ResultPtr aContext1 = aLineAttribute1->context();
if(!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if(!aLineShape1.get()) {
GeomShapePtr aShape1 = anAttribute1->value();
ResultPtr aContext1 = anAttribute1->context();
if(!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if(!aShape1.get()) {
aShape2 = aContext2->shape();
}
- bool isPlaneFirst = false;
anEdge = getEdge(aShape1);
-
aFace = getFace(aShape2);
if(!anEdge.get() || !aFace.get()) {
anEdge = getEdge(aShape2);
aFace = getFace(aShape1);
- isPlaneFirst = true;
}
if(!anEdge.get() || !aFace.get()) {
GeomShapePtr aPointShape1 = aPointAttribute1->value();
ResultPtr aContext1 = aPointAttribute1->context();
if(!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if(!aPointShape1.get()) {
GeomShapePtr aShape1 = anAttribute1->value();
ResultPtr aContext1 = anAttribute1->context();
if(!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if(!aShape1.get()) {
GeomShapePtr aShape1 = anAttribute1->value();
ResultPtr aContext1 = anAttribute1->context();
if(!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if(!aShape1.get()) {
GeomShapePtr aShape1 = anAttribute1->value();
ResultPtr aContext1 = anAttribute1->context();
if(!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if(!aShape1.get()) {
GeomShapePtr aShape1 = anAttribute1->value();
ResultPtr aContext1 = anAttribute1->context();
if (!aContext1.get()) {
- theError = "One of the attribute not initialized.";
+ theError = "One of the attribute is not initialized.";
return false;
}
if (!aShape1.get()) {
return true;
}
+//==================================================================================================
+bool ConstructionPlugin_ValidatorNotFeature::isValid(
+ const AttributePtr& theAttribute,
+ const std::list<std::string>& /*theArguments*/,
+ Events_InfoMessage& theError) const
+{
+ AttributeSelectionPtr aSelAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ if (!aSelAttr) {
+ theError = "Wrong attribute";
+ return false;
+ }
+
+ FeaturePtr aContextFeature = aSelAttr->contextFeature();
+ if (aContextFeature) {
+ theError = "Feature should not be selected";
+ return false;
+ }
+ return true;
+}
+
+//==================================================================================================
+
std::shared_ptr<GeomAPI_Edge> getEdge(const GeomShapePtr theShape)
{
GeomEdgePtr anEdge;