diff --git a/constraint.cpp b/constraint.cpp index 34045ab..5527295 100644 --- a/constraint.cpp +++ b/constraint.cpp @@ -405,11 +405,6 @@ void Constraint::MenuConstrain(int id) { AddConstraint(&c); break; - case GraphicsWindow::MNU_SOLVE_NOW: - SS.ReloadAllImported(); - SS.GenerateAll(0, INT_MAX); - return; - default: oops(); } diff --git a/graphicswin.cpp b/graphicswin.cpp index 08e7805..289acde 100644 --- a/graphicswin.cpp +++ b/graphicswin.cpp @@ -12,7 +12,7 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = { { 0, "&File", 0, NULL }, { 1, "&New\tCtrl+N", MNU_NEW, 'N'|C, mFile }, { 1, "&Open...\tCtrl+O", MNU_OPEN, 'O'|C, mFile }, -{10, "&Open Recent", MNU_OPEN_RECENT, 0, mFile }, +{10, "Open &Recent", MNU_OPEN_RECENT, 0, mFile }, { 1, "&Save\tCtrl+S", MNU_SAVE, 'S'|C, mFile }, { 1, "Save &As...", MNU_SAVE_AS, 0, mFile }, { 1, NULL, 0, 0, NULL }, @@ -27,6 +27,7 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = { { 1, "&Delete\tDel", MNU_DELETE, 127, mEdit }, { 1, NULL, 0, NULL }, { 1, "&Unselect All\tEsc", MNU_UNSELECT_ALL, 27, mEdit }, +{ 1, "Re&generate All\tSpace", MNU_REGEN_ALL, ' ', mEdit }, { 0, "&View", 0, NULL }, { 1, "Zoom &In\t+", MNU_ZOOM_IN, '+', mView }, @@ -42,8 +43,8 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = { { 1, "&Drawing in 3d\tShift+Ctrl+D", MNU_GROUP_3D, 'D'|S|C,mGrp }, { 1, "Drawing in Workplane\tShift+Ctrl+W", MNU_GROUP_WRKPL, 'W'|S|C,mGrp }, { 1, NULL, 0, NULL }, -{ 1, "Step &Translating\tShift+Ctrl+R", MNU_GROUP_TRANS, 'T'|S|C,mGrp }, -{ 1, "Step &Rotating\tShift+Ctrl+T", MNU_GROUP_ROT, 'R'|S|C,mGrp }, +{ 1, "Step &Translating\tShift+Ctrl+T", MNU_GROUP_TRANS, 'T'|S|C,mGrp }, +{ 1, "Step &Rotating\tShift+Ctrl+R", MNU_GROUP_ROT, 'R'|S|C,mGrp }, { 1, NULL, 0, 0, NULL }, { 1, "E&xtrude\tShift+Ctrl+X", MNU_GROUP_EXTRUDE, 'X'|S|C,mGrp }, { 1, "&Lathe\tShift+Ctrl+L", MNU_GROUP_LATHE, 'L'|S|C,mGrp }, @@ -88,8 +89,6 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = { { 1, "Same Orient&ation\tShift+A", MNU_ORIENTED_SAME, 'A'|S, mCon }, { 1, NULL, 0, NULL }, { 1, "Comment\tShift+C", MNU_COMMENT, 'C'|S, mCon }, -{ 1, NULL, 0, NULL }, -{ 1, "Solve Once Now\tSpace", MNU_SOLVE_NOW, ' ', mCon }, { 0, "&Help", 0, NULL }, { 1, "&About\t", 0, NULL }, @@ -468,6 +467,11 @@ void GraphicsWindow::MenuEdit(int id) { SS.UndoRedo(); break; + case MNU_REGEN_ALL: + SS.ReloadAllImported(); + SS.GenerateAll(0, INT_MAX); + break; + default: oops(); } } diff --git a/polygon.h b/polygon.h index 9b896ac..fafe332 100644 --- a/polygon.h +++ b/polygon.h @@ -213,22 +213,11 @@ public: class STriangleLl { public: int tag; - STriangle tri; + STriangle *tri; STriangleLl *next; }; -// A linked list of linked lists of triangles; extra layer of encapsulation -// required because the same triangle might appear in both branches of the -// tree, if it spans the split plane, and we will need to be able to split -// the triangle into multiple pieces as we remove T intersections. -class STriangleLl2 { -public: - STriangleLl *trl; - - STriangleLl2 *next; -}; - class SKdTree { public: static const int BY_X = 0; @@ -240,7 +229,7 @@ public: SKdTree *gt; SKdTree *lt; - STriangleLl2 *tris; + STriangleLl *tris; }; #endif diff --git a/ui.h b/ui.h index 678c80c..68588f8 100644 --- a/ui.h +++ b/ui.h @@ -159,6 +159,7 @@ public: MNU_REDO, MNU_DELETE, MNU_UNSELECT_ALL, + MNU_REGEN_ALL, // Request MNU_SEL_WORKPLANE, MNU_FREE_IN_3D, @@ -197,7 +198,6 @@ public: MNU_PARALLEL, MNU_ORIENTED_SAME, MNU_COMMENT, - MNU_SOLVE_NOW, } MenuId; typedef void MenuHandler(int id); typedef struct {