From 5bbb27fd8e7b2e3031a15e403af141d67040e3fc Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Mon, 2 Jun 2008 01:41:39 -0800 Subject: [PATCH] Now requests don't have names anymore, because that didn't seem useful. The description string is just the type of request. [git-p4: depot-paths = "//depot/solvespace/": change = 1770] --- file.cpp | 4 ---- sketch.cpp | 22 ++++++++++++++++++---- sketch.h | 1 - 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/file.cpp b/file.cpp index de8b997f..97e9b2b2 100644 --- a/file.cpp +++ b/file.cpp @@ -27,15 +27,12 @@ void SolveSpace::NewFile(void) { r.group = Group::HGROUP_REFERENCES; r.workplane = Entity::FREE_IN_3D; - r.name.strcpy("#XY"); r.h = Request::HREQUEST_REFERENCE_XY; request.Add(&r); - r.name.strcpy("#YZ"); r.h = Request::HREQUEST_REFERENCE_YZ; request.Add(&r); - r.name.strcpy("#ZX"); r.h = Request::HREQUEST_REFERENCE_ZX; request.Add(&r); @@ -81,7 +78,6 @@ const SolveSpace::SaveTable SolveSpace::SAVED[] = { { 'r', "Request.type", 'd', &(SS.sv.r.type) }, { 'r', "Request.workplane.v", 'x', &(SS.sv.r.workplane.v) }, { 'r', "Request.group.v", 'x', &(SS.sv.r.group.v) }, - { 'r', "Request.name", 'N', &(SS.sv.r.name) }, { 'r', "Request.construction", 'b', &(SS.sv.r.construction) }, { 'e', "Entity.h.v", 'x', &(SS.sv.e.h.v) }, diff --git a/sketch.cpp b/sketch.cpp index 1a045344..7414a984 100644 --- a/sketch.cpp +++ b/sketch.cpp @@ -945,12 +945,26 @@ void Request::Generate(IdList *entity, } char *Request::DescriptionString(void) { - static char ret[100]; - if(name.str[0]) { - sprintf(ret, "r%03x-%s", h.v, name.str); + char *s; + if(h.v == Request::HREQUEST_REFERENCE_XY.v) { + s = "#XY"; + } else if(h.v == Request::HREQUEST_REFERENCE_YZ.v) { + s = "#YZ"; + } else if(h.v == Request::HREQUEST_REFERENCE_ZX.v) { + s = "#ZX"; } else { - sprintf(ret, "r%03x-(unnamed)", h.v); + switch(type) { + case WORKPLANE: s = "workplane"; break; + case DATUM_POINT: s = "datum-point"; break; + case LINE_SEGMENT: s = "line-segment"; break; + case CUBIC: s = "cubic-bezier"; break; + case CIRCLE: s = "circle"; break; + case ARC_OF_CIRCLE: s = "arc-of-circle"; break; + default: s = "???"; break; + } } + static char ret[100]; + sprintf(ret, "r%03x-%s", h.v, s); return ret; } diff --git a/sketch.h b/sketch.h index 5bb6cea4..a456bd3b 100644 --- a/sketch.h +++ b/sketch.h @@ -199,7 +199,6 @@ public: hEntity workplane; // or Entity::FREE_IN_3D hGroup group; - NameStr name; bool construction; static hParam AddParam(IdList *param, hParam hp);