const std::string& aSketchName = theDumper.parentName(aBase);
AttributeSelectionPtr anExternal = aBase->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
- if (anExternal->value()) {
+ if (anExternal->context()) {
// arc is external
theDumper << aBase << " = " << aSketchName << ".addArc(" << anExternal << ")" << std::endl;
} else {
const std::string& aSketchName = theDumper.parentName(aBase);
AttributeSelectionPtr anExternal = aBase->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
- if (anExternal->value()) {
+ if (anExternal->context()) {
// circle is external
theDumper << aBase << " = " << aSketchName << ".addCircle(" << anExternal << ")" << std::endl;
} else {
const std::string& aSketchName = theDumper.parentName(aBase);
AttributeSelectionPtr anExternal = aBase->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
- if (anExternal->value()) {
+ if (anExternal->context()) {
// line is external
theDumper << aBase << " = " << aSketchName << ".addLine(" << anExternal << ")" << std::endl;
} else {
const std::string& aSketchName = theDumper.parentName(aBase);
AttributeSelectionPtr anExternal = aBase->selection(SketchPlugin_SketchEntity::EXTERNAL_ID());
- if (anExternal->value()) {
+ if (anExternal->context()) {
// point is external
theDumper << aBase << " = " << aSketchName << ".addPoint(" << anExternal << ")" << std::endl;
} else {
// the second condition for unability to move external segments anywhere
if (theID == EXTERNAL_ID() || isFixed()) {
std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
+ if (!aSelection) {
+ // empty shape in selection shows that the shape is equal to context
+ ResultPtr anExtRes = selection(EXTERNAL_ID())->context();
+ if (anExtRes)
+ aSelection = anExtRes->shape();
+ }
// update arguments due to the selection value
if (aSelection && !aSelection->isNull() && aSelection->isEdge()) {
std::shared_ptr<GeomAPI_Edge> anEdge( new GeomAPI_Edge(aSelection));
// the second condition for unability to move external segments anywhere
if (theID == EXTERNAL_ID() || isFixed()) {
std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
+ if (!aSelection) {
+ // empty shape in selection shows that the shape is equal to context
+ ResultPtr anExtRes = selection(EXTERNAL_ID())->context();
+ if (anExtRes)
+ aSelection = anExtRes->shape();
+ }
// update arguments due to the selection value
if (aSelection && !aSelection->isNull() && aSelection->isEdge()) {
std::shared_ptr<GeomAPI_Edge> anEdge( new GeomAPI_Edge(aSelection));
// to be removed after debug
if ((theID == EXTERNAL_ID() || isFixed()) && !isCopy()) {
std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
- // update arguments due to the selection value
+ if (!aSelection) {
+ // empty shape in selection shows that the shape is equal to context
+ ResultPtr anExtRes = selection(EXTERNAL_ID())->context();
+ if (anExtRes)
+ aSelection = anExtRes->shape();
+ }
+ // update arguments due to the selection value
if (aSelection && !aSelection->isNull() && aSelection->isEdge()) {
std::shared_ptr<GeomAPI_Edge> anEdge( new GeomAPI_Edge(aSelection));
std::shared_ptr<GeomDataAPI_Point2D> aStartAttr =
// the second condition for unability to move external point anywhere
if (theID == EXTERNAL_ID() || isFixed()) {
std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
- // update arguments due to the selection value
+ if (!aSelection) {
+ // empty shape in selection shows that the shape is equal to context
+ ResultPtr anExtRes = selection(EXTERNAL_ID())->context();
+ if (anExtRes)
+ aSelection = anExtRes->shape();
+ }
+ // update arguments due to the selection value
if (aSelection && !aSelection->isNull() && aSelection->isVertex()) {
std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(aSelection));
std::shared_ptr<GeomDataAPI_Point2D> aCoordAttr =
aFeature->setSketch(this);
// do not include the external edges into the result
if (aFeature->data()->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())) {
- if (aFeature->data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->value())
+ if (aFeature->data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->context())
continue;
}
// do not include the construction entities in the result