2008-03-25 10:02:13 +00:00
|
|
|
#include "solvespace.h"
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
const TextWindow::Color TextWindow::fgColors[] = {
|
|
|
|
{ 'd', RGB(255, 255, 255) },
|
|
|
|
{ 'l', RGB(100, 100, 255) },
|
|
|
|
{ 't', RGB(255, 200, 0) },
|
|
|
|
{ 'h', RGB(170, 0, 0) },
|
|
|
|
{ 's', RGB( 40, 255, 40) },
|
|
|
|
{ 'm', RGB(200, 200, 0) },
|
|
|
|
{ 'r', RGB( 0, 0, 0) },
|
|
|
|
{ 0, 0 },
|
|
|
|
};
|
|
|
|
const TextWindow::Color TextWindow::bgColors[] = {
|
|
|
|
{ 'd', RGB( 0, 0, 0) },
|
2008-04-28 09:40:02 +00:00
|
|
|
{ 't', RGB( 40, 20, 40) },
|
|
|
|
{ 'a', RGB( 20, 20, 20) },
|
2008-04-28 07:18:39 +00:00
|
|
|
{ 'r', RGB(255, 255, 255) },
|
|
|
|
{ 0, 0 },
|
2008-03-28 10:00:37 +00:00
|
|
|
};
|
|
|
|
|
2008-03-25 10:02:13 +00:00
|
|
|
void TextWindow::Init(void) {
|
2008-04-12 14:12:26 +00:00
|
|
|
memset(this, 0, sizeof(*this));
|
|
|
|
shown = &(showns[shownIndex]);
|
|
|
|
|
2008-03-26 09:18:12 +00:00
|
|
|
ClearScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextWindow::ClearScreen(void) {
|
2008-03-25 10:02:13 +00:00
|
|
|
int i, j;
|
|
|
|
for(i = 0; i < MAX_ROWS; i++) {
|
|
|
|
for(j = 0; j < MAX_COLS; j++) {
|
|
|
|
text[i][j] = ' ';
|
2008-04-28 07:18:39 +00:00
|
|
|
meta[i][j].fg = 'd';
|
|
|
|
meta[i][j].bg = 'd';
|
2008-03-25 10:02:13 +00:00
|
|
|
meta[i][j].link = NOT_A_LINK;
|
|
|
|
}
|
2008-04-28 07:18:39 +00:00
|
|
|
top[i] = i*2;
|
2008-03-25 10:02:13 +00:00
|
|
|
}
|
2008-03-26 09:18:12 +00:00
|
|
|
rows = 0;
|
2008-03-25 10:02:13 +00:00
|
|
|
}
|
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
void TextWindow::Printf(bool halfLine, char *fmt, ...) {
|
2008-03-25 10:02:13 +00:00
|
|
|
va_list vl;
|
|
|
|
va_start(vl, fmt);
|
|
|
|
|
2008-04-09 09:35:09 +00:00
|
|
|
if(rows >= MAX_ROWS) return;
|
|
|
|
|
2008-03-25 10:02:13 +00:00
|
|
|
int r, c;
|
2008-04-09 09:35:09 +00:00
|
|
|
r = rows;
|
2008-04-28 07:18:39 +00:00
|
|
|
top[r] = (r == 0) ? 0 : (top[r-1] + (halfLine ? 3 : 2));
|
2008-04-09 09:35:09 +00:00
|
|
|
rows++;
|
|
|
|
|
2008-03-25 10:02:13 +00:00
|
|
|
for(c = 0; c < MAX_COLS; c++) {
|
|
|
|
text[r][c] = ' ';
|
|
|
|
meta[r][c].link = NOT_A_LINK;
|
|
|
|
}
|
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
int fg = 'd', bg = 'd';
|
2008-03-28 10:00:37 +00:00
|
|
|
int link = NOT_A_LINK;
|
|
|
|
DWORD data = 0;
|
|
|
|
LinkFunction *f = NULL;
|
2008-03-25 10:02:13 +00:00
|
|
|
|
|
|
|
c = 0;
|
|
|
|
while(*fmt) {
|
2008-03-28 10:00:37 +00:00
|
|
|
char buf[1024];
|
|
|
|
|
2008-03-25 10:02:13 +00:00
|
|
|
if(*fmt == '%') {
|
2008-03-26 09:18:12 +00:00
|
|
|
fmt++;
|
|
|
|
if(*fmt == '\0') goto done;
|
2008-03-28 10:00:37 +00:00
|
|
|
strcpy(buf, "");
|
2008-03-26 09:18:12 +00:00
|
|
|
switch(*fmt) {
|
2008-03-28 10:00:37 +00:00
|
|
|
case 'd': {
|
|
|
|
int v = va_arg(vl, int);
|
|
|
|
sprintf(buf, "%d", v);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'x': {
|
|
|
|
DWORD v = va_arg(vl, DWORD);
|
|
|
|
sprintf(buf, "%08x", v);
|
|
|
|
break;
|
|
|
|
}
|
2008-03-26 09:18:12 +00:00
|
|
|
case 's': {
|
|
|
|
char *s = va_arg(vl, char *);
|
2008-03-28 10:00:37 +00:00
|
|
|
memcpy(buf, s, min(sizeof(buf), strlen(s)+1));
|
2008-03-26 09:18:12 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-03-28 10:00:37 +00:00
|
|
|
case 'E':
|
2008-04-28 07:18:39 +00:00
|
|
|
fg = 'd';
|
|
|
|
// leave the background, though
|
2008-03-28 10:00:37 +00:00
|
|
|
link = NOT_A_LINK;
|
|
|
|
data = 0;
|
|
|
|
f = NULL;
|
2008-03-26 09:18:12 +00:00
|
|
|
break;
|
2008-03-28 10:00:37 +00:00
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
case 'F':
|
|
|
|
case 'B': {
|
|
|
|
int color;
|
2008-03-28 10:00:37 +00:00
|
|
|
if(fmt[1] == '\0') goto done;
|
2008-04-28 07:18:39 +00:00
|
|
|
if(fmt[1] == 'p') {
|
2008-04-11 12:47:14 +00:00
|
|
|
color = va_arg(vl, int);
|
|
|
|
} else {
|
2008-04-28 07:18:39 +00:00
|
|
|
color = fmt[1];
|
2008-04-11 12:47:14 +00:00
|
|
|
}
|
2008-04-25 08:26:15 +00:00
|
|
|
if(color < 0 || color > 255) color = 0;
|
2008-04-28 07:18:39 +00:00
|
|
|
if(*fmt == 'F') {
|
|
|
|
fg = color;
|
|
|
|
} else {
|
|
|
|
bg = color;
|
|
|
|
}
|
|
|
|
fmt++;
|
2008-03-28 10:00:37 +00:00
|
|
|
break;
|
2008-04-28 07:18:39 +00:00
|
|
|
}
|
2008-03-28 10:00:37 +00:00
|
|
|
case 'L':
|
|
|
|
if(fmt[1] == '\0') goto done;
|
|
|
|
fmt++;
|
|
|
|
link = *fmt;
|
|
|
|
break;
|
|
|
|
|
2008-04-11 12:47:14 +00:00
|
|
|
case 'f':
|
|
|
|
f = va_arg(vl, LinkFunction *);
|
|
|
|
break;
|
|
|
|
|
2008-03-28 10:00:37 +00:00
|
|
|
case 'D':
|
|
|
|
data = va_arg(vl, DWORD);
|
|
|
|
break;
|
|
|
|
|
2008-03-26 09:18:12 +00:00
|
|
|
case '%':
|
2008-03-28 10:00:37 +00:00
|
|
|
strcpy(buf, "%");
|
2008-03-26 09:18:12 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-03-25 10:02:13 +00:00
|
|
|
} else {
|
2008-03-28 10:00:37 +00:00
|
|
|
buf[0] = *fmt;
|
|
|
|
buf[1]= '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
for(unsigned i = 0; i < strlen(buf); i++) {
|
2008-03-25 10:02:13 +00:00
|
|
|
if(c >= MAX_COLS) goto done;
|
2008-03-28 10:00:37 +00:00
|
|
|
text[r][c] = buf[i];
|
2008-04-28 07:18:39 +00:00
|
|
|
meta[r][c].fg = fg;
|
|
|
|
meta[r][c].bg = bg;
|
2008-03-28 10:00:37 +00:00
|
|
|
meta[r][c].link = link;
|
|
|
|
meta[r][c].data = data;
|
|
|
|
meta[r][c].f = f;
|
|
|
|
c++;
|
2008-03-25 10:02:13 +00:00
|
|
|
}
|
2008-03-28 10:00:37 +00:00
|
|
|
|
2008-03-25 10:02:13 +00:00
|
|
|
fmt++;
|
|
|
|
}
|
2008-04-12 14:12:26 +00:00
|
|
|
while(c < MAX_COLS) {
|
2008-04-28 07:18:39 +00:00
|
|
|
meta[r][c].fg = fg;
|
|
|
|
meta[r][c].bg = bg;
|
2008-04-12 14:12:26 +00:00
|
|
|
c++;
|
|
|
|
}
|
2008-03-25 10:02:13 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
va_end(vl);
|
|
|
|
}
|
|
|
|
|
2008-04-12 14:12:26 +00:00
|
|
|
void TextWindow::Show(void) {
|
2008-05-05 06:18:01 +00:00
|
|
|
if(!(SS.GW.pending.operation)) SS.GW.ClearPending();
|
2008-04-13 10:57:41 +00:00
|
|
|
|
2008-04-12 14:12:26 +00:00
|
|
|
ShowHeader();
|
|
|
|
|
2008-05-05 06:18:01 +00:00
|
|
|
if(SS.GW.pending.description) {
|
2008-04-13 10:57:41 +00:00
|
|
|
// A pending operation (that must be completed with the mouse in
|
|
|
|
// the graphics window) will preempt our usual display.
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, "");
|
2008-05-05 06:18:01 +00:00
|
|
|
Printf(false, "%s", SS.GW.pending.description);
|
2008-04-13 10:57:41 +00:00
|
|
|
} else {
|
|
|
|
switch(shown->screen) {
|
|
|
|
default:
|
2008-04-25 08:26:15 +00:00
|
|
|
shown->screen = SCREEN_LIST_OF_GROUPS;
|
2008-04-13 10:57:41 +00:00
|
|
|
// fall through
|
2008-04-27 09:03:01 +00:00
|
|
|
case SCREEN_LIST_OF_GROUPS: ShowListOfGroups(); break;
|
|
|
|
case SCREEN_GROUP_INFO: ShowGroupInfo(); break;
|
|
|
|
case SCREEN_REQUEST_INFO: ShowRequestInfo(); break;
|
|
|
|
case SCREEN_CONSTRAINT_INFO: ShowConstraintInfo(); break;
|
2008-04-13 10:57:41 +00:00
|
|
|
}
|
2008-03-25 10:02:13 +00:00
|
|
|
}
|
2008-04-12 14:12:26 +00:00
|
|
|
InvalidateText();
|
2008-03-26 09:18:12 +00:00
|
|
|
}
|
|
|
|
|
2008-04-28 09:40:02 +00:00
|
|
|
void TextWindow::OneScreenForwardTo(int screen) {
|
2008-04-12 14:12:26 +00:00
|
|
|
SS.TW.shownIndex++;
|
|
|
|
if(SS.TW.shownIndex >= HISTORY_LEN) SS.TW.shownIndex = 0;
|
|
|
|
SS.TW.shown = &(SS.TW.showns[SS.TW.shownIndex]);
|
|
|
|
history++;
|
2008-04-28 09:40:02 +00:00
|
|
|
|
|
|
|
if(screen >= 0) shown->screen = screen;
|
2008-03-25 10:02:13 +00:00
|
|
|
}
|
|
|
|
|
2008-04-22 13:14:15 +00:00
|
|
|
void TextWindow::ScreenNavigation(int link, DWORD v) {
|
2008-04-12 14:12:26 +00:00
|
|
|
switch(link) {
|
|
|
|
default:
|
|
|
|
case 'h':
|
2008-04-28 09:40:02 +00:00
|
|
|
SS.TW.OneScreenForwardTo(SCREEN_LIST_OF_GROUPS);
|
2008-04-12 14:12:26 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'b':
|
|
|
|
if(SS.TW.history > 0) {
|
|
|
|
SS.TW.shownIndex--;
|
|
|
|
if(SS.TW.shownIndex < 0) SS.TW.shownIndex = (HISTORY_LEN-1);
|
|
|
|
SS.TW.shown = &(SS.TW.showns[SS.TW.shownIndex]);
|
|
|
|
SS.TW.history--;
|
|
|
|
}
|
|
|
|
break;
|
2008-03-25 10:02:13 +00:00
|
|
|
|
2008-04-12 14:12:26 +00:00
|
|
|
case 'f':
|
2008-04-28 09:40:02 +00:00
|
|
|
SS.TW.OneScreenForwardTo(-1);
|
2008-04-12 14:12:26 +00:00
|
|
|
break;
|
2008-03-25 10:02:13 +00:00
|
|
|
}
|
|
|
|
}
|
2008-04-11 12:47:14 +00:00
|
|
|
void TextWindow::ShowHeader(void) {
|
2008-04-08 12:54:53 +00:00
|
|
|
ClearScreen();
|
|
|
|
|
2008-05-02 10:54:22 +00:00
|
|
|
char *cd = (SS.GW.activeWorkplane.v == Entity::FREE_IN_3D.v) ?
|
|
|
|
"free in 3d" :
|
|
|
|
SS.GetEntity(SS.GW.activeWorkplane)->DescriptionString();
|
|
|
|
|
|
|
|
// Navigation buttons
|
2008-05-05 06:18:01 +00:00
|
|
|
if(SS.GW.pending.description) {
|
2008-05-02 10:54:22 +00:00
|
|
|
Printf(false, " %Bt%Ft workplane:%Fd %s", cd);
|
2008-04-13 10:57:41 +00:00
|
|
|
} else {
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, " %Lb%f<<%E %Lh%fhome%E %Bt%Ft workplane:%Fd %s",
|
|
|
|
(&TextWindow::ScreenNavigation),
|
|
|
|
(&TextWindow::ScreenNavigation),
|
|
|
|
cd);
|
2008-04-13 10:57:41 +00:00
|
|
|
}
|
2008-04-12 14:12:26 +00:00
|
|
|
|
2008-04-11 12:47:14 +00:00
|
|
|
int datumColor;
|
2008-05-05 06:18:01 +00:00
|
|
|
if(SS.GW.showWorkplanes && SS.GW.showNormals && SS.GW.showPoints) {
|
2008-04-28 07:18:39 +00:00
|
|
|
datumColor = 's'; // shown
|
2008-05-05 06:18:01 +00:00
|
|
|
} else if(!(SS.GW.showWorkplanes || SS.GW.showNormals || SS.GW.showPoints)){
|
2008-04-28 07:18:39 +00:00
|
|
|
datumColor = 'h'; // hidden
|
2008-04-11 12:47:14 +00:00
|
|
|
} else {
|
2008-04-28 07:18:39 +00:00
|
|
|
datumColor = 'm'; // mixed
|
2008-04-11 12:47:14 +00:00
|
|
|
}
|
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
#define hs(b) ((b) ? 's' : 'h')
|
|
|
|
Printf(false, "%Bt%Ftshow: "
|
|
|
|
"%Fp%Ll%D%fworkplanes%E "
|
2008-05-05 06:18:01 +00:00
|
|
|
"%Fp%Ll%D%fnormals%E "
|
2008-04-28 07:18:39 +00:00
|
|
|
"%Fp%Ll%D%fpoints%E "
|
|
|
|
"%Fp%Ll%fany-datum%E",
|
2008-04-27 03:26:27 +00:00
|
|
|
hs(SS.GW.showWorkplanes), (DWORD)&(SS.GW.showWorkplanes), &(SS.GW.ToggleBool),
|
2008-05-05 06:18:01 +00:00
|
|
|
hs(SS.GW.showNormals), (DWORD)&(SS.GW.showNormals), &(SS.GW.ToggleBool),
|
2008-04-27 03:26:27 +00:00
|
|
|
hs(SS.GW.showPoints), (DWORD)&(SS.GW.showPoints), &(SS.GW.ToggleBool),
|
2008-04-11 12:47:14 +00:00
|
|
|
datumColor, &(SS.GW.ToggleAnyDatumShown)
|
|
|
|
);
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, "%Bt%Ft "
|
2008-05-02 10:54:22 +00:00
|
|
|
"%Fp%Ll%D%fconstraints%E "
|
|
|
|
"%Fp%Ll%D%fsolids%E "
|
|
|
|
"%Fp%Ll%D%fhidden-lines%E",
|
|
|
|
hs(SS.GW.showConstraints), (DWORD)(&SS.GW.showConstraints), &(SS.GW.ToggleBool),
|
|
|
|
hs(SS.GW.showSolids), (DWORD)(&SS.GW.showSolids), &(SS.GW.ToggleBool),
|
|
|
|
hs(SS.GW.showHdnLines), (DWORD)(&SS.GW.showHdnLines), &(SS.GW.ToggleBool)
|
2008-04-11 12:47:14 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2008-04-27 09:03:01 +00:00
|
|
|
void TextWindow::ScreenSelectGroup(int link, DWORD v) {
|
2008-04-28 09:40:02 +00:00
|
|
|
SS.TW.OneScreenForwardTo(SCREEN_GROUP_INFO);
|
2008-04-27 09:03:01 +00:00
|
|
|
SS.TW.shown->group.v = v;
|
|
|
|
}
|
2008-04-28 07:18:39 +00:00
|
|
|
void TextWindow::ScreenToggleGroupShown(int link, DWORD v) {
|
|
|
|
hGroup hg = { v };
|
|
|
|
Group *g = SS.GetGroup(hg);
|
|
|
|
g->visible = !(g->visible);
|
2008-05-17 08:02:39 +00:00
|
|
|
}
|
|
|
|
void TextWindow::ScreenShowGroupsSpecial(int link, DWORD v) {
|
|
|
|
int i;
|
|
|
|
bool before = true;
|
|
|
|
for(i = 0; i < SS.group.n; i++) {
|
|
|
|
Group *g = &(SS.group.elem[i]);
|
2008-04-28 07:18:39 +00:00
|
|
|
|
2008-05-17 08:02:39 +00:00
|
|
|
if(g->h.v == SS.GW.activeGroup.v) {
|
|
|
|
before = false;
|
|
|
|
} else if(before && link == 's') {
|
|
|
|
g->visible = true;
|
|
|
|
} else if(!before && link == 'h') {
|
|
|
|
g->visible = false;
|
|
|
|
}
|
|
|
|
}
|
2008-04-28 07:18:39 +00:00
|
|
|
}
|
|
|
|
void TextWindow::ScreenActivateGroup(int link, DWORD v) {
|
|
|
|
hGroup hg = { v };
|
|
|
|
Group *g = SS.GetGroup(hg);
|
|
|
|
g->visible = true;
|
|
|
|
SS.GW.activeGroup.v = v;
|
2008-05-17 08:02:39 +00:00
|
|
|
if(g->type == Group::DRAWING_WORKPLANE) {
|
|
|
|
// If we're activating an in-workplane drawing, then activate that
|
|
|
|
// workplane too.
|
|
|
|
SS.GW.activeWorkplane = g->h.entity(0);
|
|
|
|
}
|
2008-05-17 23:48:58 +00:00
|
|
|
SS.GW.ClearSuper();
|
2008-04-28 07:18:39 +00:00
|
|
|
}
|
2008-04-25 08:26:15 +00:00
|
|
|
void TextWindow::ShowListOfGroups(void) {
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(true, "%Ftactive show group-name%E");
|
2008-04-08 12:54:53 +00:00
|
|
|
int i;
|
2008-04-25 08:26:15 +00:00
|
|
|
for(i = 0; i < SS.group.n; i++) {
|
|
|
|
Group *g = &(SS.group.elem[i]);
|
2008-04-28 07:18:39 +00:00
|
|
|
char *s = g->DescriptionString();
|
|
|
|
bool active = (g->h.v == SS.GW.activeGroup.v);
|
|
|
|
bool shown = g->visible;
|
|
|
|
bool ref = (g->h.v == Group::HGROUP_REFERENCES.v);
|
|
|
|
Printf(false, "%Bp%Fd "
|
|
|
|
"%Fp%D%f%s%Ll%s%E%s "
|
|
|
|
"%Fp%D%f%Ll%s%E%s "
|
|
|
|
"%Fl%Ll%D%f%s",
|
|
|
|
// Alternate between light and dark backgrounds, for readability
|
|
|
|
(i & 1) ? 'd' : 'a',
|
|
|
|
// Link that activates the group
|
|
|
|
active ? 's' : 'h', g->h.v, (&TextWindow::ScreenActivateGroup),
|
|
|
|
active ? "yes" : (ref ? " " : ""),
|
|
|
|
active ? "" : (ref ? "" : "no"),
|
|
|
|
active ? "" : " ",
|
|
|
|
// Link that hides or shows the group
|
|
|
|
shown ? 's' : 'h', g->h.v, (&TextWindow::ScreenToggleGroupShown),
|
|
|
|
shown ? "yes" : "no",
|
|
|
|
shown ? "" : " ",
|
|
|
|
// Link to a screen that gives more details on the group
|
2008-04-27 09:03:01 +00:00
|
|
|
g->h.v, (&TextWindow::ScreenSelectGroup), s);
|
2008-04-08 12:54:53 +00:00
|
|
|
}
|
2008-05-17 08:02:39 +00:00
|
|
|
|
|
|
|
Printf(true, " %Fl%Ls%fshow all groups before active%E",
|
|
|
|
&(TextWindow::ScreenShowGroupsSpecial));
|
|
|
|
Printf(false, " %Fl%Lh%fhide all groups after active%E",
|
|
|
|
&(TextWindow::ScreenShowGroupsSpecial));
|
2008-04-08 12:54:53 +00:00
|
|
|
}
|
2008-04-27 09:03:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
void TextWindow::ScreenSelectConstraint(int link, DWORD v) {
|
2008-04-28 09:40:02 +00:00
|
|
|
SS.TW.OneScreenForwardTo(SCREEN_CONSTRAINT_INFO);
|
2008-04-27 09:03:01 +00:00
|
|
|
SS.TW.shown->constraint.v = v;
|
2008-04-12 14:12:26 +00:00
|
|
|
}
|
2008-04-25 08:26:15 +00:00
|
|
|
void TextWindow::ScreenSelectRequest(int link, DWORD v) {
|
2008-04-28 09:40:02 +00:00
|
|
|
SS.TW.OneScreenForwardTo(SCREEN_REQUEST_INFO);
|
2008-04-25 08:26:15 +00:00
|
|
|
SS.TW.shown->request.v = v;
|
2008-05-17 08:02:39 +00:00
|
|
|
}
|
|
|
|
void TextWindow::ScreenChangeExtrudeSides(int link, DWORD v) {
|
|
|
|
Group *g = SS.GetGroup(SS.TW.shown->group);
|
|
|
|
if(g->subtype == Group::EXTRUDE_ONE_SIDED) {
|
|
|
|
g->subtype = Group::EXTRUDE_TWO_SIDED;
|
|
|
|
} else {
|
|
|
|
g->subtype = Group::EXTRUDE_ONE_SIDED;
|
|
|
|
}
|
|
|
|
SS.GW.GeneratePerSolving();
|
2008-05-17 11:15:14 +00:00
|
|
|
SS.GW.ClearSuper();
|
2008-04-25 08:26:15 +00:00
|
|
|
}
|
|
|
|
void TextWindow::ShowGroupInfo(void) {
|
|
|
|
Group *g = SS.group.FindById(shown->group);
|
2008-04-28 07:18:39 +00:00
|
|
|
char *s;
|
2008-04-25 08:26:15 +00:00
|
|
|
if(SS.GW.activeGroup.v == shown->group.v) {
|
2008-04-28 07:18:39 +00:00
|
|
|
s = "active ";
|
2008-04-25 08:26:15 +00:00
|
|
|
} else if(shown->group.v == Group::HGROUP_REFERENCES.v) {
|
2008-04-28 07:18:39 +00:00
|
|
|
s = "special ";
|
2008-04-12 14:12:26 +00:00
|
|
|
} else {
|
2008-04-28 07:18:39 +00:00
|
|
|
s = "";
|
2008-04-12 14:12:26 +00:00
|
|
|
}
|
2008-05-17 08:02:39 +00:00
|
|
|
Printf(true, "%Ft%sGROUP %E%s", s, g->DescriptionString());
|
|
|
|
|
|
|
|
if(g->type == Group::EXTRUDE) {
|
|
|
|
bool one = (g->subtype == Group::EXTRUDE_ONE_SIDED);
|
|
|
|
Printf(true, "%FtEXTRUDE%E one-sided: %Fh%f%Ll%s%E%Fs%s%E",
|
|
|
|
&TextWindow::ScreenChangeExtrudeSides,
|
|
|
|
(one ? "" : "no"), (one ? "yes" : ""));
|
|
|
|
Printf(false, " two-sided: %Fh%f%Ll%s%E%Fs%s%E",
|
|
|
|
&TextWindow::ScreenChangeExtrudeSides,
|
|
|
|
(!one ? "" : "no"), (!one ? "yes" : ""));
|
|
|
|
}
|
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(true, "%Ftrequests in group");
|
2008-04-08 12:54:53 +00:00
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
int i, a = 0;
|
2008-04-18 11:11:48 +00:00
|
|
|
for(i = 0; i < SS.request.n; i++) {
|
2008-04-18 07:21:17 +00:00
|
|
|
Request *r = &(SS.request.elem[i]);
|
2008-04-08 12:54:53 +00:00
|
|
|
|
2008-04-25 08:26:15 +00:00
|
|
|
if(r->group.v == shown->group.v) {
|
2008-04-12 14:12:26 +00:00
|
|
|
char *s = r->DescriptionString();
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, "%Bp %Fl%Ll%D%f%s%E",
|
|
|
|
(a & 1) ? 'd' : 'a',
|
2008-04-27 09:03:01 +00:00
|
|
|
r->h.v, (&TextWindow::ScreenSelectRequest), s);
|
2008-04-28 07:18:39 +00:00
|
|
|
a++;
|
2008-04-27 09:03:01 +00:00
|
|
|
}
|
|
|
|
}
|
2008-04-28 07:18:39 +00:00
|
|
|
if(a == 0) Printf(false, "%Ba (none)");
|
2008-04-27 09:03:01 +00:00
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
a = 0;
|
|
|
|
Printf(true, "%Ftconstraints in group");
|
2008-04-27 09:03:01 +00:00
|
|
|
for(i = 0; i < SS.constraint.n; i++) {
|
|
|
|
Constraint *c = &(SS.constraint.elem[i]);
|
|
|
|
|
|
|
|
if(c->group.v == shown->group.v) {
|
|
|
|
char *s = c->DescriptionString();
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, "%Bp %Fl%Ll%D%f%s%E",
|
|
|
|
(a & 1) ? 'd' : 'a',
|
2008-04-27 09:03:01 +00:00
|
|
|
c->h.v, (&TextWindow::ScreenSelectConstraint), s);
|
2008-04-28 07:18:39 +00:00
|
|
|
a++;
|
2008-04-08 12:54:53 +00:00
|
|
|
}
|
|
|
|
}
|
2008-04-28 07:18:39 +00:00
|
|
|
if(a == 0) Printf(false, "%Ba (none)");
|
2008-04-08 12:54:53 +00:00
|
|
|
}
|
|
|
|
|
2008-04-25 08:26:15 +00:00
|
|
|
void TextWindow::ShowRequestInfo(void) {
|
|
|
|
Request *r = SS.GetRequest(shown->request);
|
|
|
|
|
|
|
|
char *s;
|
|
|
|
switch(r->type) {
|
2008-04-27 03:26:27 +00:00
|
|
|
case Request::WORKPLANE: s = "workplane"; break;
|
2008-04-25 08:26:15 +00:00
|
|
|
case Request::DATUM_POINT: s = "datum point"; break;
|
|
|
|
case Request::LINE_SEGMENT: s = "line segment"; break;
|
|
|
|
default: oops();
|
|
|
|
}
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, "[[request for %s]]", s);
|
2008-04-25 08:26:15 +00:00
|
|
|
}
|
|
|
|
|
2008-04-27 09:03:01 +00:00
|
|
|
void TextWindow::ShowConstraintInfo(void) {
|
|
|
|
Constraint *c = SS.GetConstraint(shown->constraint);
|
|
|
|
|
2008-04-28 07:18:39 +00:00
|
|
|
Printf(false, "[[constraint]]");
|
2008-04-27 09:03:01 +00:00
|
|
|
}
|
|
|
|
|
2008-04-18 07:06:37 +00:00
|
|
|
|