+// ============================================================================
+// Function: computeDoF
+// Class: SketchSolver_Group
+// Purpose: compute DoF of the sketch and set corresponding field
+// ============================================================================
+void SketchSolver_Group::computeDoF()
+{
+ std::ostringstream aDoFMsg;
+ int aDoF = mySketchSolver->dof();
+ /// "DoF = 0" content of string value is used in PartSet by Sketch edit
+ /// If it is changed, it should be corrected also there
+ if (aDoF == 0)
+ aDoFMsg << "Sketch is fully fixed (DoF = 0)";
+ else
+ aDoFMsg << "DoF (degrees of freedom) = " << aDoF;
+ mySketch->string(SketchPlugin_Sketch::SOLVER_DOF())->setValue(aDoFMsg.str());
+
+ if (aDoF > 0 && myDOF <= 0)
+ sendMessage(EVENT_SKETCH_UNDER_CONSTRAINED, mySketch, aDoF);
+ else if (aDoF == 0 && myDOF != 0)
+ sendMessage(EVENT_SKETCH_FULLY_CONSTRAINED, mySketch, aDoF);
+ else if (aDoF < 0)
+ sendMessage(EVENT_SKETCH_OVER_CONSTRAINED, mySketch, aDoF);
+
+ myDOF = aDoF;
+}
+