-// Copyright (C) 2019-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2019-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <SketchPlugin_Tools.h>
#include <SketchPlugin_Sketch.h>
+#include <Locale_Convert.h>
+
#include <ModelAPI_AttributeDoubleArray.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeRefAttrList.h>
#include <ModelAPI_Events.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_Validator.h>
+#include <ModelAPI_Tools.h>
#include <GeomDataAPI_Point2DArray.h>
if (boolean(CONTROL_POLYGON_ID())->value()) {
std::list<FeaturePtr> aControlPoles;
- createControlPolygon(aBSpline, aControlPoles);
+ createControlPolygon(aBSpline, myIsPeriodic, aControlPoles);
constraintsForPoles(aControlPoles);
}
}
}
void SketchPlugin_MacroBSpline::createControlPolygon(FeaturePtr theBSpline,
+ bool thePeriodic,
std::list<FeaturePtr>& thePoles)
{
AttributePoint2DArrayPtr aPoles = std::dynamic_pointer_cast<GeomDataAPI_Point2DArray>(
// segments
for (int index = 1; index < aSize; ++index)
createAuxiliarySegment(aPoles, index - 1, index);
- if (myIsPeriodic) {
+ if (thePeriodic) {
// additional segment to close the control polygon
createAuxiliarySegment(aPoles, aSize - 1, 0);
}
{
FeaturePtr aBSpline = ModelAPI_Feature::feature(theBSplinePoles->owner());
- std::ostringstream aName;
+ std::wostringstream aName;
aName << aBSpline->name();
if (theAuxFeature->getKind() == SketchPlugin_Point::ID())
- aName << "_" << theBSplinePoles->id() << "_" << thePoleIndex1;
+ aName << "_" << Locale::Convert::toWString(theBSplinePoles->id()) << "_" << thePoleIndex1;
else
aName << "_segment_" << thePoleIndex1 << "_" << thePoleIndex2;