static std::string angleTypeToString(FeaturePtr theFeature)
{
static const double TOLERANCE = 1.e-7;
+ static const std::string THE_ANGLE_DIRECT("Direct");
+ static const std::string THE_ANGLE_SUPPLEMENTARY("Supplementary");
+ static const std::string THE_ANGLE_BACKWARD("Backward");
+
double anAngleDirect, anAngleComplmentary, anAngleBackward;
calculatePossibleValuesOfAngle(theFeature, anAngleDirect, anAngleComplmentary, anAngleBackward);
// find the minimal difference
std::string aType;
if (isDirect && aDirectDiff < TOLERANCE) {
- // Nothing to do.
- // This case is empty and going the first to check the direct angle before the others.
+ aType = THE_ANGLE_DIRECT;
}
else if (isComplementary && aComplementaryDiff < TOLERANCE)
- aType = "Complementary";
+ aType = THE_ANGLE_SUPPLEMENTARY;
else if (isBackward && aBackwardDiff < TOLERANCE)
- aType = "Backward";
+ aType = THE_ANGLE_BACKWARD;
else {
if (aComplementaryDiff < aDirectDiff && aComplementaryDiff < aBackwardDiff)
- aType = "Complementary";
+ aType = THE_ANGLE_SUPPLEMENTARY;
else if (aBackwardDiff < aDirectDiff && aBackwardDiff < aComplementaryDiff)
- aType = "Backward";
+ aType = THE_ANGLE_BACKWARD;
}
return aType;
}
// calculate angle value as it was just applied to the attributes
FeaturePtr aBase = feature();
- std::string aSetterSuffix = angleTypeToString(aBase);
const std::string& aSketchName = theDumper.parentName(aBase);
- theDumper << aBase << " = " << aSketchName << "." << "setAngle" << aSetterSuffix << "(";
+ theDumper << aBase << " = " << aSketchName << "." << "setAngle(";
bool isFirstAttr = true;
for (int i = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {
if (aValueAttr && aValueAttr->isInitialized())
theDumper << ", " << aValueAttr;
- theDumper << ")" << std::endl;
+ std::string aType = angleTypeToString(aBase);
+ theDumper << ", type = \"" << aType << "\")" << std::endl;
}