AttributeSelectionPtr aPathAttrSelection =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
if(!aPathAttrSelection.get()) {
+// LCOV_EXCL_START
theError = "Error: This validator can only work with path selector in \"Pipe\" feature.";
return false;
+// LCOV_EXCL_STOP
}
GeomShapePtr aPathShape = aPathAttrSelection->value();
AttributeSelectionListPtr anAttrSelectionList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
theError =
"Error: This validator can only work with selection list attributes in \"Pipe\" feature.";
return false;
+// LCOV_EXCL_STOP
}
std::shared_ptr<FeaturesPlugin_Pipe> aFeature =
std::dynamic_pointer_cast<FeaturesPlugin_Pipe>(theAttribute->owner());
AttributeSelectionPtr aPathSelection = aFeature->selection(FeaturesPlugin_Pipe::PATH_OBJECT_ID());
if (!aPathSelection.get()) {
+// LCOV_EXCL_START
theError = "Error: Path not selected.";
return false;
+// LCOV_EXCL_STOP
}
GeomShapePtr aPathShape = aPathSelection->value();
}
//==================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorPipeLocationsNumber::isValid(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
return true;
}
+// LCOV_EXCL_STOP
//==================================================================================================
bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if(theArguments.empty()) {
theError = "Error: Validator parameters is empty.";
return false;
}
+// LCOV_EXCL_STOP
// Checking attribute.
if(!isValidAttribute(theAttribute, theArguments, theError)) {
AttributeSelectionListPtr aListAttr = theFeature->selectionList(aBaseObjectsID);
if(!aListAttr.get()) {
+// LCOV_EXCL_START
theError = "Error: Could not get \"%1\" attribute.";
theError.arg(aBaseObjectsID);
return false;
+// LCOV_EXCL_STOP
}
std::set<ResultConstructionPtr> aSelectedSketches;
Events_InfoMessage& theError) const
{
if(!theAttribute.get()) {
+// LCOV_EXCL_START
theError = "Error: Empty attribute.";
return false;
+// LCOV_EXCL_STOP
}
std::string anAttributeType = theAttribute->attributeType();
}
} else {
+// LCOV_EXCL_START
theError = "Error: Attribute \"%1\" does not supported by this validator.";
theError.arg(anAttributeType);
return false;
+// LCOV_EXCL_STOP
}
return true;
}
//==================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
bool aValid = !aFeatureKind && aPlanarFace;
return aValid;
}
+// LCOV_EXCL_STOP
//==================================================================================================
bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
Events_InfoMessage& theError) const
{
if(theArguments.size() != 2) {
+// LCOV_EXCL_START
theError = "Error: Validator should be used with 2 parameters for extrusion.";
return false;
+// LCOV_EXCL_STOP
}
std::list<std::string>::const_iterator
bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr& theAttribute,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if(!theAttribute.get()) {
return true;
}
+// LCOV_EXCL_STOP
std::string anAttributeType = theAttribute->attributeType();
if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
AttributeSelectionListPtr anAttrSelectionList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
theError =
"Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
return false;
+// LCOV_EXCL_STOP
}
std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theAttribute->owner());
AttributeSelectionListPtr anAttrSelectionList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
theError =
"Error: This validator can only work with selection list attributes in \"Fillet\" feature.";
return false;
+// LCOV_EXCL_STOP
}
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeSelectionListPtr anAttrSelectionList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
theError = "Error: This validator can only work with selection list in \"Partition\" feature.";
return false;
+// LCOV_EXCL_STOP
}
for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
AttributeSelectionListPtr aSubShapesAttrList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!aSubShapesAttrList.get()) {
+// LCOV_EXCL_START
theError =
"Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature.";
return false;
+// LCOV_EXCL_STOP
}
static const std::string aBaseShapeID = "base_shape";
AttributeSelectionPtr aShapeAttrSelection = aFeature->selection(aBaseShapeID);
if(!aShapeAttrSelection.get()) {
+// LCOV_EXCL_START
theError = "Error: Could not get \"%1\" attribute.";
theError.arg(aBaseShapeID);
return false;
+// LCOV_EXCL_STOP
}
GeomShapePtr aBaseShape = aShapeAttrSelection->value();
static const std::string aBaseShapeID = "base_shape";
static const std::string aSubShapesID = "subshapes_to_keep";
+// LCOV_EXCL_START
if(theFeature->getKind() != "Remove_SubShapes") {
theError = "Error: Feature \"%1\" does not supported by this validator.";
theError.arg(theFeature->getKind());
theError.arg(aSubShapesID);
return false;
}
+// LCOV_EXCL_STOP
// Copy base shape.
GeomShapePtr aBaseShape = aShapeAttrSelection->value();
}
//==================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
return true;
}
+// LCOV_EXCL_STOP
//==================================================================================================
bool FeaturesPlugin_ValidatorUnionArguments::isValid(
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
// Check feature kind.
if(theFeature->getKind() != FeaturesPlugin_Union::ID()) {
theError = "Error: This validator supports only \"%1\" feature.";
theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID());
return false;
}
+// LCOV_EXCL_STOP
// Get all shapes.
GeomAPI_Shape::ShapeType aType = GeomAPI_Shape::COMPSOLID;
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) {
+// LCOV_EXCL_START
theError = "Error: The attribute with the %1 type is not processed";
theError.arg(theAttribute->attributeType());
return false;
+// LCOV_EXCL_STOP
}
AttributeReferencePtr aRefAttribute = std::dynamic_pointer_cast<ModelAPI_AttributeReference>
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if (theArguments.size() != 2)
{
theError = "Wrong number of arguments (expected 2).";
return false;
}
+// LCOV_EXCL_STOP
int anObjectsToolsNb[2] = { 0, 0 };
}
//=================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorBooleanArguments::isNotObligatory(std::string theFeature,
std::string theAttribute)
{
return false;
}
+// LCOV_EXCL_STOP
//==================================================================================================
bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
AttributeSelectionListPtr anAttrSelectionList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if (!aFeature.get() || !anAttrSelectionList.get()) {
+// LCOV_EXCL_START
theError =
"Error: Validator used in wrong feature or attribute";
return false;
+// LCOV_EXCL_STOP
}
AttributeSelectionListPtr anOtherAttrSelectionList;
}
//==================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_IntersectionSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
return true;
}
+// LCOV_EXCL_STOP
//==================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorBooleanFuseSelection::isValid(
const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
return true;
}
+// LCOV_EXCL_STOP
//=================================================================================================
bool FeaturesPlugin_ValidatorBooleanFuseArguments::isValid(
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if (theArguments.size() != 2) {
theError = "Wrong number of arguments (expected 2).";
return false;
}
+// LCOV_EXCL_STOP
std::shared_ptr<FeaturesPlugin_BooleanFuse> aFeature =
std::dynamic_pointer_cast<FeaturesPlugin_BooleanFuse>(theFeature);
}
//=================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorBooleanFuseArguments::isNotObligatory(
std::string theFeature,
std::string theAttribute)
return false;
}
+// LCOV_EXCL_STOP
//==================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid(
const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
return true;
}
+// LCOV_EXCL_STOP
//=================================================================================================
bool FeaturesPlugin_ValidatorBooleanCommonArguments::isValid(
Events_InfoMessage& theError) const
{
if (theArguments.size() != 2) {
+// LCOV_EXCL_START
theError = "Wrong number of arguments (expected 2).";
return false;
+// LCOV_EXCL_STOP
}
std::shared_ptr<FeaturesPlugin_BooleanCommon> aFeature =
}
//=================================================================================================
+// LCOV_EXCL_START
bool FeaturesPlugin_ValidatorBooleanCommonArguments::isNotObligatory(
std::string theFeature,
std::string theAttribute)
{
return false;
}
+// LCOV_EXCL_STOP