+bool PartSet_SketcherMgr::canDisplayConstraint(const FeaturePtr& theFeature,
+ const PartSet_Tools::ConstraintVisibleState& theState,
+ bool& isProcessed) const
+{
+ bool aSwitchedOn = true;
+
+ const QStringList& aConstrIds = constraintsIdList();
+
+ std::string aKind = theFeature->getKind();
+ if (aConstrIds.contains(QString(aKind.c_str()))) {
+ bool isTypedConstraint = false;
+
+ switch (theState) {
+ case PartSet_Tools::Dimensional: {
+ bool isDistance = isDistanceKind(aKind);
+ if (isDistance) {
+ isProcessed = true;
+ aSwitchedOn = myIsConstraintsShown[theState];
+ }
+ }
+ break;
+ case PartSet_Tools::Geometrical: {
+ bool isGeometrical = !isDistanceKind(aKind);
+ if (isGeometrical) {
+ isProcessed = true;
+ aSwitchedOn = myIsConstraintsShown[theState];
+ }
+ }
+ break;
+ case PartSet_Tools::Any: {
+ isProcessed = true;
+ bool isDistance = isDistanceKind(aKind);
+ if (isDistance)
+ aSwitchedOn = myIsConstraintsShown[PartSet_Tools::Dimensional];
+ else
+ aSwitchedOn = myIsConstraintsShown[PartSet_Tools::Geometrical];
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return aSwitchedOn;
+}
+