Commit Graph

57 Commits (9ade574d36ae06ce63f9d84195cbb04a0c63456a)

Author SHA1 Message Date
Jonathan Westhues f9eedb4db7 Oops, Windows timers are periodic. So after displaying a tooltip,
we repainted once every second thereafter...

[git-p4: depot-paths = "//depot/solvespace/": change = 1889]
2009-01-04 04:52:11 -08:00
Jonathan Westhues 0f228fc0fb Add a toolbar. This requires a tool to convert my PNG icons to
tables in the code, which I have written in perl and am checking
in.

Also get WM_MOUSELEAVE events from win32, so that I can de-hover
everything when the mouse leaves the graphics window. And fix one
of the icons, which was 23x24 instead of 24x24.

[git-p4: depot-paths = "//depot/solvespace/": change = 1883]
2009-01-02 02:38:36 -08:00
Jonathan Westhues 3ae0ca8c19 Add menu items to snap view to nearest orthogonal or iso view.
[git-p4: depot-paths = "//depot/solvespace/": change = 1882]
2009-01-01 20:06:47 -08:00
Jonathan Westhues 285f990ad6 Make the mousewheel work in whichever window the mouser is over,
and not whichever is the foreground window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1867]
2008-08-14 20:55:03 -08:00
Jonathan Westhues ea7ffd4b2a Scroll the textwindow when the mousewheel moves.
[git-p4: depot-paths = "//depot/solvespace/": change = 1856]
2008-02-10 06:06:54 -08:00
Jonathan Westhues 0c10efdab6 Add a simple license key: I take the CRC of the license info, plus
some magic numbers. This would be trivial to break, but still more
difficult than patching the binary to skip the check...

[git-p4: depot-paths = "//depot/solvespace/": change = 1853]
2008-02-09 05:52:01 -08:00
Jonathan Westhues a783f14eff Add an icon file (ugly, but at least it's not the default anymore).
And add the manifest that gets us visual styles on the controls
under Win32.

[git-p4: depot-paths = "//depot/solvespace/": change = 1844]
2008-07-18 01:50:52 -08:00
Jonathan Westhues f70bbb3e7f This BSP split and simplify thing is stupid, but a hard-coded limit
on the number of pieces that we know how to reassemble is even
stupider. Now dynamically allocated.

[git-p4: depot-paths = "//depot/solvespace/": change = 1837]
2008-07-13 04:58:52 -08:00
Jonathan Westhues cdeeb67d83 Oops, the ASCII codes for some characters I was using overlapped
with the VK codes for some keys that I wasn't. Ugly, but work
around that.

[git-p4: depot-paths = "//depot/solvespace/": change = 1833]
2008-07-09 23:26:41 -08:00
Jonathan Westhues 7cf0deb9f4 Reassign the keyboard shortcuts so that the constraints don't all
start with Shift, since that's hard to type.

[git-p4: depot-paths = "//depot/solvespace/": change = 1831]
2008-07-09 23:06:07 -08:00
Jonathan Westhues 49b6e9a74d Remove the back button from the text window, since I never used it.
And fix a bug; wasn't asking the user whether to save before
abandoning file when a new file was opened recent.

[git-p4: depot-paths = "//depot/solvespace/": change = 1830]
2008-07-09 22:11:56 -08:00
Jonathan Westhues 6852b4134f Request a deeper z buffer and color depth. Doesn't seem like that
could hurt, but still make offsets work as if it's a 16 bit buffer,
since I don't seem to actually get 24 bits.

[git-p4: depot-paths = "//depot/solvespace/": change = 1828]
2008-07-08 22:41:42 -08:00
Jonathan Westhues 4c42f329cd Show the open filename in the title bar of the graphics window.
[git-p4: depot-paths = "//depot/solvespace/": change = 1826]
2008-07-08 00:02:22 -08:00
Jonathan Westhues 72d188619d Add a scale factor when exporting; the user specifies a number, and
all coordinates are divided by that number as we export.

And add functions to store a float in the registry. I'm using those
for the scale factor, and also to replace the crazy scaled integers
that I was using for light positions etc. before.

[git-p4: depot-paths = "//depot/solvespace/": change = 1824]
2008-07-07 23:41:29 -08:00
Jonathan Westhues cad77c9c47 Add routines to remove T intersections from the mesh, which are
introduced by the bsp routines. It's usually, though not always,
possible to generate a watertight mesh. The occasions where it's
not look ugly, floating point issues, no quick fix.

And use those to generate a list of edges where two different faces
meet, which I can emphasize for cosmetic reasons (and some UI to
specify whether to do that, and with what color).

And make the right mouse button rotate the model, since that was
previously doing nothing.

[git-p4: depot-paths = "//depot/solvespace/": change = 1821]
2008-07-05 23:56:24 -08:00
Jonathan Westhues 273339d5c4 Add TrueType font support to SolveSpace. This uses a modified
version of the code from SketchFlat, with all arbitrary limits
removed.

The TTF text is its own entity, and that entity includes the
font file basename and the text. That's an extra 128 bytes in the
entity, which is around a 50% increase, kind of a shame. It was
simple, though.

[git-p4: depot-paths = "//depot/solvespace/": change = 1814]
2008-06-30 01:09:17 -08:00
Jonathan Westhues 12942a74cf Add logic to remember imported files' relative filenames, and use
that to try to find them if we can't find them by absolute path.
This is intended to make everything still work if you copy an
entire directory tree of files that import each other.

Also add a mechanism to not paint the scene if we're not sure it's
consistent; otherwise got some crashes on startup. And disable both
text and graphic window when displaying a modal dialog, wasn't
doing that always.

[git-p4: depot-paths = "//depot/solvespace/": change = 1808]
2008-06-24 21:14:49 -08:00
Jonathan Westhues b5c87291ea Fix failure to solve when auto-constraining new arc, and make all
paths absolute immediately.

[git-p4: depot-paths = "//depot/solvespace/": change = 1795]
2008-06-16 00:35:05 -08:00
Jonathan Westhues 650e9db150 Add more measurement information about the selection. And remove
menu items for some features that I suppose I won't add, and fix
some bugs.

[git-p4: depot-paths = "//depot/solvespace/": change = 1787]
2008-06-11 23:31:41 -08:00
Jonathan Westhues d471872830 Add reference dimensions, add user-programmable lighting, and add a
configuration screen where all this can be specified.

[git-p4: depot-paths = "//depot/solvespace/": change = 1783]
2008-06-10 20:22:52 -08:00
Jonathan Westhues 64c7a4e61b Fix bugs: problem drag-rotating normals with the mouse, a failure
to save our registry stuff (because we were calling exit() instead
of doing a PostQuitMessage()), and a misclassification of triangles
coplanar with the test surface, when the test surface contained
zero-area triangles.

[git-p4: depot-paths = "//depot/solvespace/": change = 1773]
2008-06-03 10:48:47 -08:00
Jonathan Westhues ea6db67c7d Improve convergence of constraints involving parallel vectors, by
using the initial numerical guess of whichever vector is already
known to choose our projection planes.

And add a mechanism to defer showing the text window or
regenerating, in order to simplify dependencies on valid actives.
Also yes/no/cancel when about to abandon an unsaved file, and a
bugfix when rotating a rot/trans point.

[git-p4: depot-paths = "//depot/solvespace/": change = 1772]
2008-06-03 10:28:41 -08:00
Jonathan Westhues 57db9bea34 Use a higher-res timer for GetMilliseconds(), and tweak some stuff.
[git-p4: depot-paths = "//depot/solvespace/": change = 1765]
2008-06-01 01:46:02 -08:00
Jonathan Westhues 69eb2273ac Add color. Now each triangle has metadata, which are preserved in
csg ops; so the union of a red part and a blue part has both red
and blue faces. And some user interface to pick the color in the
text window.

The metadata also include a face, which will be an entity; I can
use that to constrain against. But none of that is yet implemented.

[git-p4: depot-paths = "//depot/solvespace/": change = 1757]
2008-05-29 22:09:41 -08:00
Jonathan Westhues 502211495b Add the file open/save user interface. This includes a list of
recently opened files, that is saved in the registry and displayed
in a separate popup menu.

[git-p4: depot-paths = "//depot/solvespace/": change = 1752]
2008-05-28 02:10:31 -08:00
Jonathan Westhues 93c797329e More reasonable default window locations.
[git-p4: depot-paths = "//depot/solvespace/": change = 1751]
2008-05-27 01:59:19 -08:00
Jonathan Westhues 4375c01c51 Add step and repeat translate, with multiple copies; that all works
nicely. And to do that, I've added the user interface to show an
edit control in the text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1749]
2008-05-26 22:36:59 -08:00
Jonathan Westhues b484c26493 Many user interface additions. Now I report when the solver fails,
and in the case of a singular Jacobian, report which constraints
can be removed to fix it. Also a mechanism to hover and select
entities and constraints from the text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1746]
2008-05-26 01:56:50 -08:00
Jonathan Westhues 749e2a0149 Add double-sided extrudes, and user interface for that. Also put
the coordinate system (x, y, z normal vectors) in the bottom left
corner of the screen at all times, and hide group-created
workplanes except when that group is active, and activate that
workplane when the group is activated.

[git-p4: depot-paths = "//depot/solvespace/": change = 1726]
2008-05-17 00:02:39 -08:00
Jonathan Westhues 65ea276fa4 I turned on hardware acceleration for my graphics card, and
everything broke; apparently that driver didn't like me continually
destroying and recreating the HPGL context, and it also didn't like
me drawing zero-area polygons for my edges (which seemed like a
good idea, because it let me use glPolygonOffset instead of doing
that by hand). So it now all seems to work again, and faster.

[git-p4: depot-paths = "//depot/solvespace/": change = 1723]
2008-05-15 20:54:47 -08:00
Jonathan Westhues 6b264a6ba6 Add a convenience command to draw a rectangle (as four line
segments), add the toggle construction command, and color the lines
differently depending on what group you're in.

Also change dynamic memory stuff to use a Win32 heap for everything
(no malloc), and validate that often. I think I've seen it crash,
though I can't reproduce it.

[git-p4: depot-paths = "//depot/solvespace/": change = 1708]
2008-05-06 20:17:29 -08:00
Jonathan Westhues 598d456d8d Tear apart the text window, mostly to beautify things. The
foreground and background colours are now specified separately, and
it's possible to insert half-line spaces. So now I have a window
that lets me show/hide groups, and select the active one.

[git-p4: depot-paths = "//depot/solvespace/": change = 1695]
2008-04-27 23:18:39 -08:00
Jonathan Westhues aedd91735f Text window was double-buffered, but background was still getting
erased before redraw, which caused a bit of flicker on show. And
hide debug prints in solver.

[git-p4: depot-paths = "//depot/solvespace/": change = 1693]
2008-04-27 01:31:56 -08:00
Jonathan Westhues 49ec1346d7 Add the first `derived' group, that generates entities based on
other entities. This requires a new point type, for a point that's
defined as a transformation of some other point. All works nicely,
I think. There's ugliness because entities are no longer guaranteed
to have a parent request.

Also speed up display of the text window, by caching brushes
instead of recreating for each character (!), and add a bit more
user interface in the text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1692]
2008-04-27 01:03:01 -08:00
Jonathan Westhues bfc7109e0c Standardize the behaviour of constraints, by assigning them a
workplane: a free constraint works in three-space (e.g. true
distance), and a constraint in a workplane works in that plane
(e.g. projected distance). And make the solver go automatically,
though solver itself has lots of pieces missing.

[git-p4: depot-paths = "//depot/solvespace/": change = 1691]
2008-04-26 21:00:12 -08:00
Jonathan Westhues c934737d9e Add a function to combine vertices while tesselating the polygon,
so that OpenGL can fill self-intersecting polygons.

[git-p4: depot-paths = "//depot/solvespace/": change = 1688]
2008-04-25 02:11:29 -08:00
Jonathan Westhues ebdef1818c Simplify the way that the active csys is handled, and default to
locked on to the XY plane. And simplify the handling of colors in
the text window: identify them by a character, not an integer ID,
since the character is easier to remember.

[git-p4: depot-paths = "//depot/solvespace/": change = 1687]
2008-04-25 00:26:15 -08:00
Jonathan Westhues 1331457928 Rough file/save for SolveSpace; that's all done from a single
table, relatively small code size. No user interface for it,
though.

[git-p4: depot-paths = "//depot/solvespace/": change = 1685]
2008-04-23 22:22:16 -08:00
Jonathan Westhues 1bf7e3deaf Add an ExprVector class, for a 3-vector whose members are
expressions. That simplifies a few things considerably. And some
little UI tweaks.

[git-p4: depot-paths = "//depot/solvespace/": change = 1682]
2008-04-22 05:14:15 -08:00
Jonathan Westhues fa71238def Some graphics tweaks, to the order in which stuff gets drawn, to
determine what goes in front (e.g. put a drawn line in front of the
reference plane, even if the z order would want the opposite), and
some tweaks to the mouse behaviour, and a function to modify
constraints like dimensions so that the are initially satisfied.

[git-p4: depot-paths = "//depot/solvespace/": change = 1681]
2008-04-22 02:53:42 -08:00
Jonathan Westhues 9b1b255e85 Now I can display the edit control in the graphics window, and edit
the label associated with a constraint. And that even works,
changes the length of the line.

[git-p4: depot-paths = "//depot/solvespace/": change = 1678]
2008-04-21 02:12:04 -08:00
Jonathan Westhues 2926fa95d9 Start to add some constraint stuff. I now have point-coincident,
and point-in-plane. These work, but the equation is still stupid,
solving everything at once and not substituting trivial equations.

[git-p4: depot-paths = "//depot/solvespace/": change = 1677]
2008-04-21 00:16:38 -08:00
Jonathan Westhues 0d3217c0df Rename some stuff in the IdList again. Rough in the file save
stuff, though no file load stuff, and perhaps this can all be made
to work from a table somehow. Move the quaternion stuff into its
own class, and add a fancy animated view when you orient onto a
csys.

[git-p4: depot-paths = "//depot/solvespace/": change = 1672]
2008-04-18 03:11:48 -08:00
Jonathan Westhues 2f4a3917c5 Add functions to deep-copy Exprs, for those generated from user
expressions that we wish to keep around. And make the 2d coordinate
system (that causes points to generate 2 unknowns, not 3) an
attribute of the request, not the group, and add user interface to
change that.

[git-p4: depot-paths = "//depot/solvespace/": change = 1670]
2008-04-17 23:06:37 -08:00
Jonathan Westhues 22302dca7a Now I can add a constraint (a length), and it's displayed
on-screen, and I can drag the label. That's progress. Also
implement a bunch of untested expression stuff, since I'll need
that for the values of the dimensions, for example.

[git-p4: depot-paths = "//depot/solvespace/": change = 1668]
2008-04-14 02:28:32 -08:00
Jonathan Westhues 094e10204d Make the points locked in 2d csys (expressed as two parameters, for
the plane basis vectors) work, easy. Tweak the text window a bit,
for cosmetics, and start to add the symbolic expression code.

[git-p4: depot-paths = "//depot/solvespace/": change = 1667]
2008-04-13 06:28:35 -08:00
Jonathan Westhues d36c70216a Add the keyboard accelerator mechanism for menu items. Use that to
implement zoom in/out, and orient onto a csys.

[git-p4: depot-paths = "//depot/solvespace/": change = 1663]
2008-04-12 07:17:58 -08:00
Jonathan Westhues 6c63d9c8cb Get rid of the command line from the text window; we'll say that's
just for display, and any text entry will happen via some floating
text box, same as entering a dimension on the sketch.

Add the hover and selection mechanism, which now seems to work.

Still not clear how to do imported parts, for assemblies and
hierarchy. The handle formats may still have to change.

[git-p4: depot-paths = "//depot/solvespace/": change = 1662]
2008-04-12 06:12:26 -08:00
Jonathan Westhues bf8ef7b196 Start to use that text window a bit; user interface to show and
hide things.

[git-p4: depot-paths = "//depot/solvespace/": change = 1661]
2008-04-11 04:47:14 -08:00
Jonathan Westhues 181e50f1d9 Add routines to draw a vector font (public domain Hershey Simplex
font, not bad). Use that to label the planes now.

[git-p4: depot-paths = "//depot/solvespace/": change = 1660]
2008-04-11 03:13:47 -08:00