#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeReference.h>
+#include <SketchPlugin_Sketch.h>
+
#include <list>
+#ifdef _DEBUG
+#include <iostream>
+#endif
int shapesNbPoints(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);
}
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<std::string>& theArguments,
{
// not implemented
return true;
-}
\ No newline at end of file
+}
+
+bool PartSet_SketchValidator::isValid(const ObjectPtr theObject) const
+{
+ FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+ return aFeature->getKind() == SketchPlugin_Sketch::ID();
+}