From 4989af13e6c6544eca5c46736fbdd54fc47b4831 Mon Sep 17 00:00:00 2001 From: WandererFan Date: Mon, 9 Jun 2025 11:48:00 -0400 Subject: [PATCH] [TD]Cosmetic vertex tag save/restore fail (fix #21069) (#21374) * [TD]fix tag handling on Save/Restore * [TD]fix linter messages * [TD]remove c-style cast x4 * [TD]do not write VertexTag element in Vertex::Save --- src/Mod/TechDraw/App/CosmeticVertex.cpp | 60 +++++++------ src/Mod/TechDraw/App/CosmeticVertex.h | 4 +- src/Mod/TechDraw/App/Geometry.cpp | 115 ++++++++++++------------ src/Mod/TechDraw/App/Geometry.h | 28 +++--- src/Mod/TechDraw/App/Tag.cpp | 18 +++- src/Mod/TechDraw/App/Tag.h | 12 ++- 6 files changed, 140 insertions(+), 97 deletions(-) diff --git a/src/Mod/TechDraw/App/CosmeticVertex.cpp b/src/Mod/TechDraw/App/CosmeticVertex.cpp index f577337b41..a9a0d4412b 100644 --- a/src/Mod/TechDraw/App/CosmeticVertex.cpp +++ b/src/Mod/TechDraw/App/CosmeticVertex.cpp @@ -47,33 +47,36 @@ CosmeticVertex::CosmeticVertex() : TechDraw::Vertex() color = Preferences::vertexColor(); size = Preferences::vertexScale() * LineGroup::getDefaultWidth("Thin"); + hlrVisible = true; cosmetic = true; + cosmeticTag = getTagAsString(); } -CosmeticVertex::CosmeticVertex(const TechDraw::CosmeticVertex* cv) : TechDraw::Vertex(cv) +CosmeticVertex::CosmeticVertex(const TechDraw::CosmeticVertex* cv) : TechDraw::Vertex(cv), + permaPoint(cv->permaPoint), + linkGeom(cv->linkGeom), + color(cv->color), + size(cv->size), + style(cv->style), + visible(cv->visible) { - permaPoint = cv->permaPoint; - linkGeom = cv->linkGeom; - color = cv->color; - size = cv->size; - style = cv->style; - visible = cv->visible; + // Base fields hlrVisible = true; cosmetic = true; + cosmeticTag = getTagAsString(); } -CosmeticVertex::CosmeticVertex(const Base::Vector3d& loc) : TechDraw::Vertex(loc) +CosmeticVertex::CosmeticVertex(const Base::Vector3d& loc) : TechDraw::Vertex(loc), + permaPoint(loc), + color(Preferences::vertexColor()) { - permaPoint = loc; - linkGeom = -1; - color = Preferences::vertexColor(); size = Preferences::vertexScale() * LineGroup::getDefaultWidth("Thick"); - style = 1; //TODO: implement styled vertexes - visible = true; + hlrVisible = true; cosmetic = true; + cosmeticTag = getTagAsString(); } void CosmeticVertex::move(const Base::Vector3d& newPos) @@ -119,14 +122,16 @@ void CosmeticVertex::Save(Base::Writer &writer) const << "X=\"" << permaPoint.x << "\" Y=\"" << permaPoint.y << "\" Z=\"" << permaPoint.z << - "\"/>" << endl; - writer.Stream() << writer.ind() << "" << endl; - writer.Stream() << writer.ind() << "" << endl; - writer.Stream() << writer.ind() << "" << endl; - writer.Stream() << writer.ind() << "