Commit Graph

460 Commits (0f7a34ccca32977be3f68b90d4a9c17ccbe3b47e)

Author SHA1 Message Date
Daniel Richard G 0f7a34ccca Fixed a typo: "==" was intended, not "=" 2013-08-26 17:06:53 -04:00
Daniel Richard G e256956d12 Added missing items to GraphicsWindow::menu[] elements
Several MenuEntry elements in GraphicsWindow::menu[] were being initialized
with four items instead of the requisite five, due to a missing fourth
column (corresponding to the .accel field of MenuEntry). This change simply
adds zeroes as the missing column to the appropriate elements.
2013-08-26 17:00:02 -04:00
Daniel Richard G 66f46b7b67 General compiler warning/error fixes
This addresses a grab bag of compiler grievances relating to C++ syntax,
type, and scope, as observed on Linux with g++ and Solaris with Sun
WorkShop 6.
2013-08-26 16:54:04 -04:00
Daniel Richard G 7715fd1bb8 Don't ignore the return value of fgets() and fread() 2013-08-26 16:48:41 -04:00
Daniel Richard G 1b00c8c3ab Use size_t instead of int in the memory allocation routines
size_t is the correct type to use when specifying the memory-size of an
object. That is why sizeof(), strlen() and malloc() all use it.
2013-08-26 16:40:25 -04:00
Daniel Richard G dcc963aa4b Modified Get{BYTE,WORD,DWORD}() to return the respective type
Having e.g. GetWORD() return a WORD rather than int eliminates the need for
a cast when assigning to WORD variables. We use casts only when assigning
to a different (but same-sized) type.

Also, check for EOF explicitly when calling fgetc().
2013-08-26 16:24:16 -04:00
Daniel Richard G a72575d04e Use casts to bridge mismatches in integer-type sizes and signedness
The compiler gets nervous when we (for example) pass in a size_t as an int
parameter, or assign an int to a char, or assign -1 to an unsigned type. By
adding appropriate casts, we inform the compiler that, yes, we know what
we're doing.

This change also upgrades a va_arg() type from char to int, as char is
always promoted to int when passed through '...'.
2013-08-26 16:19:23 -04:00
Daniel Richard G 8913d11fa5 Quash "variable may be used uninitialized" warnings
Whether or not there is any actual danger of these variables being used
without initialization, the warnings are noise, and getting rid of them is
trivial.
2013-08-26 15:36:00 -04:00
Daniel Richard G df6125efee Fix "jump to label 'foo' crosses initialization of 'bar'" errors
Newer C++ compilers do not allow goto-ing over an initialized variable
declaration, as this violates C++98. We address this by (in most cases)
separating the initialization from the declaration, or moving the goto to
an equivalent location.

Refer to the following discussions for more background:

http://stackoverflow.com/questions/11306799/why-does-c-enforce-such-behavior-in-crosses-initialization
http://stackoverflow.com/questions/12992108/crosses-initialization-of-variable-only-when-initialization-combined-with-decl
2013-08-26 15:24:50 -04:00
Daniel Richard G 02776ea535 Added const qualifiers
String literals in C++ are implicitly typed as 'const char *', and with
this change, their const-ness is maintained when assigning them to
variables or passing them as arguments. This significantly cuts down the
number of warnings generated by the compiler.
2013-08-26 14:58:35 -04:00
Jonathan Westhues affbeafc6c Make a copy of "freeze" library for storing stuff in registry, to
make //depot/solvespace/... entirely self-contained.

[git-p4: depot-paths = "//depot/solvespace/": change = 2216]
2013-08-20 21:54:54 -08:00
Jonathan Westhues defeb6411a Clean up SolveSpace makefile, and add forgotten copyright notice.
[git-p4: depot-paths = "//depot/solvespace/": change = 2213]
2013-07-28 14:53:30 -08:00
Jonathan Westhues bc426a2a7f Delete obsolete text in solvespace/doc/..., superseded by the
stuff on the website.

[git-p4: depot-paths = "//depot/solvespace/": change = 2212]
2013-07-28 14:40:37 -08:00
Jonathan Westhues 0ee8ba1457 Changes in preparation for the release of SolveSpace under the GPL,
to add that license, and change all copyright notices to me, not
Useful Subset, LLC.

[git-p4: depot-paths = "//depot/solvespace/": change = 2211]
2013-07-28 14:08:34 -08:00
Jonathan Westhues 1abd87954c Oops, fix gross memory leak in SolveSpace library due to failure
to destroy temporary heap.

[git-p4: depot-paths = "//depot/solvespace/": change = 2210]
2013-03-15 08:43:35 -08:00
Jonathan Westhues 7919e7171d Make SolveSpace work unrestricted without a license file, and
increase its version number to 1.9.

[git-p4: depot-paths = "//depot/solvespace/": change = 2198]
2012-01-21 12:12:00 -08:00
Jonathan Westhues e11347f613 Oops, update copyright date to 2011 for SolveSpace.
[git-p4: depot-paths = "//depot/solvespace/": change = 2195]
2011-07-04 11:25:17 -08:00
Jonathan Westhues c98a0b381f Increment SolveSpace's version number to 1.8.
[git-p4: depot-paths = "//depot/solvespace/": change = 2194]
2011-07-04 11:10:00 -08:00
Jonathan Westhues fc3dc68f83 Check in the VB.NET example for the SolveSpace library, and update
the documentation accordingly. Also rename the C example for
consistency, and update copyright dates.

[git-p4: depot-paths = "//depot/solvespace/": change = 2190]
2011-03-13 00:04:09 -08:00
Jonathan Westhues b3bdadfeb8 Fix that typo elsewhere in the slvs.dll examples, and note that
VB.NET example in the documentation.

[git-p4: depot-paths = "//depot/solvespace/": change = 2188]
2011-03-05 14:33:05 -08:00
Jonathan Westhues 3dc21ec8dd Make oops() calls exit instead of entering debugger by default,
since the latter looks worse if it happens to someone else.

[git-p4: depot-paths = "//depot/solvespace/": change = 2187]
2011-03-05 12:52:57 -08:00
Jonathan Westhues dcfae0f341 Typo in SolveSpace library example, embarrassing.
[git-p4: depot-paths = "//depot/solvespace/": change = 2186]
2011-03-05 12:22:59 -08:00
Jonathan Westhues 3dea64af47 Make default text in dimension box the exact (up to ten digits
after decimal) current value of the dimension, not the value
truncated to the same number of digits that are usually displayed.

And make the paste transformed screen accept expressions, not
just integers, for the count, angle, and scale.

[git-p4: depot-paths = "//depot/solvespace/": change = 2181]
2010-10-11 19:13:41 -08:00
Jonathan Westhues cc3b17f60e Make the number of digits after the decimal point (for dimensions,
as they are displayed on the drawing, and for many other places) a
user-configurable parameter.

Also reshuffle some options in the configuration screen, to put all
the stuff relating to exports together.

[git-p4: depot-paths = "//depot/solvespace/": change = 2179]
2010-09-23 18:58:34 -08:00
Jonathan Westhues e672706770 Due to questionable decision to use copy-number values of 1000
and up for special things, the number of times that a group may
be stepped is limited to 999. So avoid a crash by not letting
the user specify more than that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2178]
2010-09-17 18:20:08 -08:00
Jonathan Westhues 307965d53f Update selection of extrusion/lathe solid model color to use new
color picker.

And apply same rule to rewrite nearly-white colors (when exporting
with a file format typically viewed on a white background) for fill
color as for stroke color.

[git-p4: depot-paths = "//depot/solvespace/": change = 2176]
2010-08-14 11:00:25 -08:00
Jonathan Westhues 439e4d3124 Add a color picker, with a fancy HSV (actually, a modified version
of that, where you can pick the hue and blackness, and then the
whiteness) color picker and some swatches.

This is used in three places now: the special colors in the config
screen, the background color, and the style colors.

[git-p4: depot-paths = "//depot/solvespace/": change = 2174]
2010-07-20 21:04:03 -08:00
Jonathan Westhues 98897af77b Fix typo in SolveSpace library documentation.
[git-p4: depot-paths = "//depot/solvespace/": change = 2173]
2010-07-15 02:07:54 -08:00
Jonathan Westhues cedb360af2 Note in documentation for SolveSpace library that the constraint to
place a point on a circle also works for arcs.

[git-p4: depot-paths = "//depot/solvespace/": change = 2172]
2010-07-14 06:55:54 -08:00
Jonathan Westhues 824cc00915 Put wrappers around the functions to show and hide the edit control
in the text window. This means that I can move the conversion from
half-row and column to (x, y) into the platform-independent code,
and that I'll be ready to add my color picker.

[git-p4: depot-paths = "//depot/solvespace/": change = 2171]
2010-07-11 23:51:12 -08:00
Jonathan Westhues 319ba16541 When curves to be split intersect at multiple points, don't just
choose arbitrarily. Instead, split at the point closest to the
mouse pointer.

[git-p4: depot-paths = "//depot/solvespace/": change = 2170]
2010-07-11 22:47:14 -08:00
Jonathan Westhues 9ae29aa0e9 Build the demo version of the solver library as a DLL, not a static
library. If I understand correctly, that will avoid all the
compiler version issues with different required versions of libc.

[git-p4: depot-paths = "//depot/solvespace/": change = 2167]
2010-07-10 10:53:30 -08:00
Jonathan Westhues 46a7d0f719 Disable buffer overrun protection in the library that we build,
since that makes it more difficult to interoperate with the MSVC6
compiler.

[git-p4: depot-paths = "//depot/solvespace/": change = 2165]
2010-07-06 21:01:17 -08:00
Jonathan Westhues d8b84a9bf0 The box when additional things get deleted (because they depend on
whatever just got deleted explicitly) should be a message, not an
error.

[git-p4: depot-paths = "//depot/solvespace/": change = 2162]
2010-06-13 20:42:47 -08:00
Jonathan Westhues 9a0591cfc4 Indicate diameter symbol on diameter dimensions, instead of just a
bare number.

[git-p4: depot-paths = "//depot/solvespace/": change = 2157]
2010-05-22 22:21:42 -08:00
Jonathan Westhues 5ba5371ae8 Put a link the rounding screen to return home, just in case the one
at the top left isn't obvious enough.

[git-p4: depot-paths = "//depot/solvespace/": change = 2155]
2010-05-16 17:54:19 -08:00
Jonathan Westhues e4312cc79a Fix tooltip; arc and tangent arc are separate operations now.
[git-p4: depot-paths = "//depot/solvespace/": change = 2150]
2010-05-16 11:29:05 -08:00
Jonathan Westhues 2cd6ca882f Oops, camera tangent was defaulting to 300, not 0.3, very bad.
[git-p4: depot-paths = "//depot/solvespace/": change = 2149]
2010-05-16 10:46:10 -08:00
Jonathan Westhues 00231a6799 Add two more icons to the toolbar, for text in a TrueType font and
for the tangent arc thing.

And update the version number to 1.7, in preparation for the next
release.

[git-p4: depot-paths = "//depot/solvespace/": change = 2147]
2010-05-16 09:04:56 -08:00
Jonathan Westhues fe2ea5d5e1 Improve the non-parametric rounding. It now works on both lines and
circles, using a numerical method. And the user can specify a
radius, instead of letting us choose automatically, and specify
whether the original lines should be kept and made construction, or
deleted.

[git-p4: depot-paths = "//depot/solvespace/": change = 2146]
2010-05-16 08:36:23 -08:00
Jonathan Westhues a05cc4dda8 Add a checkbox to group screens to toggle visibility; seemed silly
to have that available from the list of groups, but not there.

[git-p4: depot-paths = "//depot/solvespace/": change = 2143]
2010-05-11 20:57:41 -08:00
Jonathan Westhues a95054890f Fix some cases where the green line (that indicates the center of
an in-plane rotation of the view, or of a set of entities) would
remain on screen after the action was over.

[git-p4: depot-paths = "//depot/solvespace/": change = 2142]
2010-05-11 20:47:58 -08:00
Jonathan Westhues 949df4d139 Add a constraint for tangency between any combination of arcs
and cubics. Also add that to the library interface.

It might have been better to use a single constraint for that,
plus all the line-curve or line-line cases, but it would break
backwards compatibility if I did that now, and perhaps be
confusing with the 'other' member (which is meaningless for
lines) anyways.

[git-p4: depot-paths = "//depot/solvespace/": change = 2141]
2010-05-09 20:14:06 -08:00
Jonathan Westhues 9f7ff34b98 Add option to treat all dimensions as reference dimensions. This is
useful because it makes it possible to add cosmetic dimensions to
an existing model, without REF appended.

[git-p4: depot-paths = "//depot/solvespace/": change = 2140]
2010-05-09 17:06:09 -08:00
Jonathan Westhues 8481c54012 Major UI changes, to use the checkboxes and radio buttons wherever
possible. This replaces all of the color-coded links, that I liked
but that were nonstandard.

Also rip out the old sweep and helical sweep UI; that was disabled,
but the code was still present.

And fix dependencies in makefile, since textwin.cpp depends on the
icons now.

[git-p4: depot-paths = "//depot/solvespace/": change = 2139]
2010-05-09 10:25:23 -08:00
Jonathan Westhues 2dbb21aecd Add special characters to font, to represent checkboxes and radio
buttons. This requires some tools to convert .png images to that,
and that I put the characters in a two-dimensional grid in the
texture (since one-dimensional strip gets wider than the hardware
supports).

[git-p4: depot-paths = "//depot/solvespace/": change = 2138]
2010-05-08 17:20:02 -08:00
Jonathan Westhues 7a2941d2ea Add locked-where-dragged constraint to library interface, and
update some copyright dates and bad grammar in comments.

[git-p4: depot-paths = "//depot/solvespace/": change = 2137]
2010-05-06 18:13:57 -08:00
Jonathan Westhues f27b567f5c Note when an entity is construction, when we describe it in the
text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 2136]
2010-05-03 21:13:35 -08:00
Jonathan Westhues 4628048d45 Add "lock point where dragged" constraint, in either 2d or 3d.
And call the cubic things splines, not segments, since that's what
they are now.

[git-p4: depot-paths = "//depot/solvespace/": change = 2135]
2010-05-03 21:11:52 -08:00
Jonathan Westhues ef7f6c6057 Oops, clear hovered icon in the text window when the mouse leaves
that window; otherwise it remains highlighted, and may even get
tooltipped.

[git-p4: depot-paths = "//depot/solvespace/": change = 2134]
2010-05-02 21:43:42 -08:00