X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Validators.cpp;h=fa7ac518f60a1696c8a4b04f5b88cc7392107735;hb=8abaa3d7f05f4f3cfe57d5d6921a66e29da72640;hp=31fd4c048b0f9587e26b76c1e86e0cf63a1bd3d8;hpb=a7f44a41bdf29e7bd978ff3b8c8bd514d1223be7;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index 31fd4c048..fa7ac518f 100644 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: PartSet_Validators.cpp // Created: 09 July 2014 // Author: Vitaly SMETANNIKOV @@ -16,6 +18,9 @@ #include #include +#ifdef _DEBUG +#include +#endif int shapesNbPoints(const ModuleBase_ISelection* theSelection) { @@ -53,7 +58,7 @@ int shapesNbLines(const ModuleBase_ISelection* theSelection) bool PartSet_DistanceValidator::isValid(const ModuleBase_ISelection* theSelection) const { - int aCount = shapesNbPoints(theSelection); + int aCount = shapesNbPoints(theSelection) + shapesNbLines(theSelection); return (aCount > 0) && (aCount < 3); } @@ -96,7 +101,11 @@ bool PartSet_RadiusValidator::isValid(const ModuleBase_ISelection* theSelection) return (aCount > 0) && (aCount < 2); } - +bool PartSet_RigidValidator::isValid(const ModuleBase_ISelection* theSelection) const +{ + int aCount = shapesNbLines(theSelection); + return (aCount > 0) && (aCount < 2); +} bool PartSet_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature, const std::list& theArguments, @@ -161,4 +170,4 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute { // not implemented return true; -} \ No newline at end of file +}