Commit Graph

168 Commits (f09ae155862f456d70bbb1fc24b21784d69aea0e)

Author SHA1 Message Date
Daniel Richard G c60e3dd34e Initial Autotools and FLTK support
With this commit, SolveSpace gains an Autotools build system and a new
platform-dependent backend implemented using the FLTK GUI toolkit. These
will allow the application to be built and run on Linux and other Unix-like
operating systems, and prospectively, MacOS X.

A number of new files have been added:

* Makefile.am: Automake makefile template; this contains some experimental
  support for MinGW and MSVC++ builds that needs further development

* ac-aux/ax_fltk.m4: Autoconf M4 macro to locate and query the system's
  installation of FLTK; this will eventually be contributed to the GNU
  Autoconf Archive

* autogen.sh: Script to bootstrap the Autotools build system, usually for a
  tree just checked out from source control

* configure.ac: Source for the Autoconf configure script; note that this
  file specifies a version of 2.1, near the top

* fltk/fltkmain.cpp: Main FLTK backend implementation

* fltk/fltkutil.cpp: Utility functions for the FLTK backend

* fltk/xFl_Gl_Window_Group.{H,cxx}: Implementation of a new
  Fl_Gl_Window_Group widget for FLTK, needed to facilitate drawing FLTK
  widgets on top of OpenGL graphics as SolveSpace does. This has been
  submitted to the FLTK project for (hopefully) eventual upstream
  inclusion:

    http://www.fltk.org/str.php?L2992

The following minor changes are also a part of this commit:

* Makefile.msvc: Define PACKAGE_VERSION=2.1 for the benefit of
  solvespace.cpp in MSVC++ builds

* solvespace.cpp: In the About dialog text, use PACKAGE_VERSION rather than
  hard-coding the version of the program

* solvespace.h: Don't define the C99 integer types if
  HAVE_C99_INTEGER_TYPES is defined, to facilitate MinGW builds
2013-10-28 01:28:42 -04:00
Daniel Richard G 7ca137f5fe Changed GetMilliseconds() to return a 64-bit value
This function previously returned an int32_t. Presuming that it measures
the length of time since the application was started, the 32-bit type would
cause the returned value to wrap from 2^31-1 to -2^31 after a little less
than twenty-five days.
2013-10-28 00:43:38 -04:00
Daniel Richard G 873811d865 Preliminary changes for FLTK support
* Added "Show Menu Bar" and "Full Screen" menu items, which will be
  implemented in the FLTK interface. These are currently prevented from
  appearing in the Win32 interface by the HAVE_FLTK and
  HAVE_FLTK_FULLSCREEN macros.

* Moved the "Show Text Window" down below the "Show Toolbar" item, so that
  "Show Menu Bar", "Show Toolbar" and "Show Text Window" are in the same
  vertical order as their corresponding UI elements typically take on

* Added new platform-dependent routines to back the new menu items:

    void ToggleMenuBar(void);
    bool MenuBarIsVisible(void);
    void ToggleFullScreen(void);
    bool FullScreenIsActive(void);

  These are stubs in the Win32 code.

* Fleshed out the system header #includes in solvespace.h, and moved them
  to the top of the file per convention

* Rewrote the file dialog selection patterns in terms of macros that allow
  them to expand to either the FLTK or Windows formats

* Don't use __stdcall in SSGL_CALLBACK, and make SSGL_CALLBACK 'extern "C"'
  as OpenGL usually expects function pointers to point to C functions
2013-10-28 00:43:38 -04:00
Daniel Richard G c6203678e1 Renamed GL helper routines/identifiers to use "ssgl" prefix instead of "glx"
The "glx" prefix on the names of SolveSpace's various GL helper routines
was confusingly similar to those used by official OpenGL-associated
libraries (e.g. "glu" used by the GL Utility library, and "glX" used by
GLX), and could thus give the erroneous impression that it represented a
system API rather than ordinary application logic. We thus rename these
routines to have an "ssgl" prefix, clearly identifying them with SolveSpace
while retaining some visual kinship to GL function names.
2013-10-28 00:43:38 -04:00
Daniel Richard G 0afb5618ce Quash warnings for floating-point equality comparisons
GCC and Clang's -Wfloat-equal warning notes that comparing floating-point
values with == or != may be questionable. But the few instances of these in
SolveSpace are defensibly correct (as discussed with Jonathan), so to keep
folks from getting nervous that a CAD application isn't handling its floats
correctly, we define an EXACT() macro inside which the -Wfloat-equal
warning is disabled. This macro will also serve as a source-code
annotation, like a comment but better.

(The warning is only disabled for Clang, alas, because GCC is particular
about where _Pragma() can be used. This isn't so bad, however, because the
warning is much easier to enable on Clang [thanks to -Weverything], whereas
with GCC it has to be requested explicitly.)
2013-10-28 00:43:37 -04:00
Daniel Richard G 8bc322eb47 Various fixes for warnings and minutia
This commit consists of numerous small changes, none significant enough to
merit a commit on their own:

* Added extra braces to quash for-loop variable scoping issues for older
  compilers (or "g++ -fno-for-scope")

* Appeased "unreachable code" warnings, spurious or otherwise

* Added casts to fix integer-variable signedness warnings

* Added a dummy virtual method to the VectorFileWriter class to silence the
  -Wweak-vtables warning from Clang++

* Renamed some parameters in the Expr and GraphicsWindow classes to
  eliminate "parameter shadows a field" warnings

* Removed an inert "0 ||" from a conditional, and changed a "&& 0" into an
  "#if 0"

* Added missing elements to array/struct/class initializers to zap further
  warnings

* Indented some cpp conditionals where appropriate

* Qualified some variables and functions as static to quiet "no previous
  declaration" warnings

* toolbar.cpp needed to #include<icons-proto.h> to fix those same "no
  previous declaration" warnings from icons.h

* Added some casts and const qualifiers to the Win32 code to address
  warnings produced by g++ when compiling under MinGW

* Rewrote Cnf{Freeze,Thaw}Float() to use a union rather than pointer
  aliasing; this makes g++ a lot happier

* Removed redundant #includes from win32/w32util.cpp

* With Jonathan's blessing, shortened the last line of the About dialog
  text to better match the preceding lines
2013-10-28 00:42:39 -04:00
Daniel Richard G a5176f4545 Replaced RGB-color integers with dedicated data structure
RGB colors were represented using a uint32_t with the red, green and blue
values stuffed into the lower three octets (i.e. 0x00BBGGRR), like
Microsoft's COLORREF. This approach did not lend itself to type safety,
however, so this change replaces it with an RgbColor class that provides
the same infomation plus a handful of useful methods to work with it. (Note
that sizeof(RgbColor) == sizeof(uint32_t), so this change should not lead
to memory bloat.)

Some of the new methods/fields replace what were previously macro calls;
e.g. RED(c) is now c.red, REDf(c) is now c.redF(). The .Equals() method is
now used instead of == to compare colors.

RGB colors still need to be represented as packed integers in file I/O and
preferences, so the methods .FromPackedInt() and .ToPackedInt() are
provided. Also implemented are Cnf{Freeze,Thaw}Color(), type-safe wrappers
around Cnf{Freeze,Thaw}Int() that facilitate I/O with preferences.

(Cnf{Freeze,Thaw}Color() are defined outside of the system-dependent code
to minimize the footprint of the latter; because the same can be done with
Cnf{Freeze,Thaw}Bool(), those are also moved out of the system code with
this commit.)

Color integers were being OR'ed with 0x80000000 in some places for two
distinct purposes: One, to indicate use of a default color in
glxFillMesh(); this has been replaced by use of the .UseDefault() method.
Two, to indicate to TextWindow::Printf() that the format argument of a
"%Bp"/"%Fp" specifier is an RGB color rather than a color "code" from
TextWindow::bgColors[] or TextWindow::fgColors[] (as the specifier can
accept either); instead, we define a new flag "z" (as in "%Bz" or "%Fz") to
indicate an RGBcolor pointer, leaving "%Bp"/"%Fp" to indicate a color code
exclusively.

(This also allows TextWindow::meta[][].bg to be a char instead of an int,
partly compensating for the new .bgRgb field added immediately after.)

In array declarations, RGB colors could previously be specified as 0 (often
in a terminating element). As that no longer works, we define NULL_COLOR,
which serves much the same purpose for RgbColor variables as NULL serves
for pointers.
2013-10-25 01:49:12 -04:00
Daniel Richard G dd168ad22c Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:

    QWORD  --> uint64_t
    SQWORD --> int64_t
    DWORD  --> uint32_t
    SDWORD --> int32_t
    WORD   --> uint16_t
    SWORD  --> int16_t
    BYTE   --> uint8_t
    BOOL   --> bool
    TRUE   --> true
    FALSE  --> false

The following related changes are also included:

* Added C99 integer type definitions for Windows, as stdint.h is not
  available prior to Visual Studio 2010

* Changed types of some variables in the SolveSpace class from 'int' to
  'bool', as they actually represent boolean settings

* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
  variables in the Registry

* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()

* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
  inspired by the OpenType spec)

* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
  in a few places, these were represented by an int; these have been
  corrected to uint32_t
2013-10-02 01:45:13 -04:00
Daniel Richard G e7f3a3c0db Build fix for Visual Studio 2003
INT_MAX was not being defined, so #include <limits.h>.
2013-09-20 21:38:53 -04:00
Daniel Richard G 3cfe6b6da1 Synthesize accelerator labels (e.g. "Ctrl+S") instead of hard-coding them
GraphicsWindow::menu[] previously recorded both item names (e.g. "Open...")
and accelerator labels ("Ctrl+O") in .label, and accelerator key/mask
values in .accel. Not only were the accelerator labels redundant given the
latter, they are not needed by GUI toolkits like FLTK, which generate them
from key/mask values.

So we remove the accelerator portion from each menu-item label, and define
a new MakeAcceleratorLabel() routine which takes a key/mask value and
returns the appropriate label. We make use of this new routine in
CreateGraphicsWindowMenus() and GraphicsWindow::ToolbarDrawOrHitTest().
2013-09-20 15:01:00 -04:00
Daniel Richard G 66758b9595 Miscellaneous adjustments for warnings and code quality
This commit contains a grab bag of minor changes not worth committing
individually:

* Replaced raw Latin-1 characters with octal escapes to avoid source-file
  encoding issues

* Undefined some convenience macros after they've served their purpose

* Rewrote SEdge::From() to avoid confusing less-capable C++ compilers

* Have oops() print a newline at the end of its message

* Removed "static" keyword from the Bernstein() function definition, as it
  has a non-static prototype in srf/surface.h

* Added casts (and changed a variable type) to quell warnings about integer
  size and signedness

* Simplified an expression with our handy arraylen() macro
2013-09-19 02:35:56 -04:00
Daniel Richard G 07b128b877 Define some menu-bar menu items as radio buttons
Some menu items in the menu-bar are toggles (each representing an option
that can be turned on or off independently), and some are 1-of-N selections
(e.g. mm or inches), like tuner buttons on a car radio. Windows can draw an
optional check-mark besides a menu item, and SolveSpace has been using this
feature to implement both kinds of menu items, with the backend logic
making them behave as a toggle or radio button as appropriate.

Other GUI platforms can draw proper radio-button menu items that are
distinct from toggles, however. To allow the platform-specific logic to
tell the two kinds of menu items apart, this change adds the
RadioMenuById() routine, and replaces the appropriate calls to
CheckMenuById() with it. (Note that nothing is changed in the Windows GUI
code; radio-menu items are still drawn with check-marks.)
2013-09-19 00:59:18 -04:00
Daniel Richard G 16179f34cd Enabled freeing of (most) allocated memory on program exit
The Valgrind tool can give a full accounting of what memory allocations
have yet to be free()d when the program exits. It is easier to find actual
memory leaks in the code if all non-leaked allocations are elided from that
accounting, which is most easily accomplished by free()ing them.

The "most" qualifier is there because some allocations are difficult/
impossible to free, as they are internal to libraries like OpenGL and Xft.
The best we can hope for is to cover all allocations made by SolveSpace
directly.
2013-09-19 00:33:12 -04:00
Daniel Richard G 42a46e83fa Use system-agnostic return values for SaveFileYesNoCancel()
This function was returning ID{YES,NO,CANCEL}, which are specific to
Windows as return values for MessageBox(). These have been replaced with
SAVE_{YES,NO,CANCEL}, which we define ourselves.
2013-09-18 16:49:32 -04:00
Daniel Richard G bcb6c7b19b OpenGL fixes
glGetError() was returning GL_INVALID_OPERATION due to some minor missteps
2013-09-09 16:05:33 -04:00
Daniel Richard G 5cca524c62 Changed "static const int" class members into enums
Not only is the enum syntax more compact, it avoids inadvertent link
failures resulting from how C++ treats "static const int" members:

http://stackoverflow.com/questions/5391973/undefined-reference-to-static-const-int
http://stackoverflow.com/questions/5508182/static-const-int-causes-linking-error-undefined-reference

(And for what it's worth, MSVC6 gave silly errors for these members
wherever a non-zero value was assigned.)
2013-09-09 15:50:32 -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 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 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 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 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 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 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 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 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 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 01ecb986f4 Instead of a "force parallel projection" menu item that's on by
default, let's do a "use perspective projection" item that's off by
default. Same meaning, but less confusion.

[git-p4: depot-paths = "//depot/solvespace/": change = 2132]
2010-05-02 21:15:28 -08:00
Jonathan Westhues 0246add3e9 Replace ugly text links to hide/show things with icons. So add code
to draw those, and hit test with the mouse, and display tool tips
when the user hovers with the mouse. Also, underline links only
when they're hovered, and not otherwise.

And add a separate menu option to align the view to the active
workplane, vs. activating the active group's workplane, and
remap the bottom two graphics window toolbar icons to that and
"nearest iso view" instead of draw in 2d/3d, since people tended
to click on those without understanding and cause trouble.

And by default, we force a parallel projection; so the factory
default camera tangent is now 0.3, not 0.

[git-p4: depot-paths = "//depot/solvespace/": change = 2131]
2010-05-02 21:04:42 -08:00
Jonathan Westhues c4b442f92f Initial work to move text window guts into platform-independent
code. This is now drawn using gl, and the bitmap font (both there
and in the graphics window) is drawn from a texture from a static
table, not from the Win32 functions, since that's ~1000x faster.

So this adds a tool to generate that table. With luck that will
also fix my font issues under WINE, which won't have to render the
TTF itself.

Still needs some cleanup, and to make all the cosmetic improvements
that I want.

[git-p4: depot-paths = "//depot/solvespace/": change = 2130]
2010-04-25 23:52:49 -08:00
Jonathan Westhues a11010c593 Fix a gross memory leak: when switching to a new file, either after
File -> New or File -> Open, I freed the Group structures
themselves, but none of their children.

[git-p4: depot-paths = "//depot/solvespace/": change = 2120]
2010-02-28 11:23:01 -08:00
Jonathan Westhues aaf0984882 Replace standard message boxes with my own, which will word-wrap
consistently across multiple versionf of Windows, and perhaps not
be immediately ignored by the user.

[git-p4: depot-paths = "//depot/solvespace/": change = 2108]
2010-01-16 01:22:44 -08:00
Jonathan Westhues 342729d9a4 Indicate the just-exported origin and basis x and y vectors after
exporting our view to any file that doesn't have a canvas size (and
therefore doesn't get everything shifted to fit with the requested
margins around it in the canvas).

[git-p4: depot-paths = "//depot/solvespace/": change = 2107]
2010-01-13 21:24:32 -08:00
Jonathan Westhues a0a7feda89 Add G Code export to SolveSpace, similar to SketchFlat. This
requires user interface to specify the depth, number of passes,
feed, and plunge feed, unfortunately.

[git-p4: depot-paths = "//depot/solvespace/": change = 2106]
2010-01-13 20:47:17 -08:00
Jonathan Westhues ba8ac7dcd3 Add a screen to edit the view parameters; scale, translation,
rotation. Also clean up the handling of units, by putting the
conversion factors in only one place, and clean up the
expression-parsing but removing all the copies of the same error
message.

[git-p4: depot-paths = "//depot/solvespace/": change = 2093]
2010-01-03 16:35:28 -08:00
Jonathan Westhues b974a4adeb A big nasty change, originally just to add paste transformed. So it
does that, and adds a scale factor to that transformation (instead
of just mirroring, as before), but also:

    * Replace the "import mirrored" mechanism with a scale factor,
      which if negative corresponds to a reflection as well.

    * Fix self-intersection checker to report a meaningful point
      when edges are collinear.

    * Don't blow an assertion on some types of invalid file;
      instead provide a nice error message to the user.

    * Clear the naked edges before each regen.

    * Don't create zero-length line segments by snapping a line
      segment's end to its beginning.

[git-p4: depot-paths = "//depot/solvespace/": change = 2086]
2009-12-15 04:26:22 -08:00
Jonathan Westhues 9723f4e44f Add support for a clipboard, with cut, copy, and paste. This works
only in a workplane; but this means that plane sketches are
conveniently transformed from one plane to another.

Also tweak snap to grid to ignore unsnappable entities instead of
triggering an error, and to remove arbitrary limit on the number of
entities / comments that will be snapped.

[git-p4: depot-paths = "//depot/solvespace/": change = 2084]
2009-12-04 00:08:41 -08:00
Jonathan Westhues d74b1e7ece Add ability to set a background image. I import a png with libpng,
load it as a texture, and show it instead of a flat-color
background. Includes user interface to specify scale and
translation of image, but the rotation is always aligned to the
view.

[git-p4: depot-paths = "//depot/solvespace/": change = 2071]
2009-11-07 17:11:38 -08:00
Jonathan Westhues b9ab62ab3f Remove arbitrary limits on the selection size, and permit more than
one point to be dragged simultaneously. So now a dragged point
drags all the selected points and entities, and a dragged entity
drags its points (except for circles, which drag the radius).

This means that the number of forced points for the solver must now
be unlimited, and it is.

Also add commands to invert the selection within the active group,
and to select an edge chain starting from the current selection.
And redo the context menus a bit; still not great, but less
cluttered and more systematic.

[git-p4: depot-paths = "//depot/solvespace/": change = 2064]
2009-11-03 10:54:49 -08:00
Jonathan Westhues 3515748334 Make the EPS, PDF, and SVG targets output filled contours. This
also means that closed contours will get output as a single path
now, vs. one open path per Bezier segment before.

I've simplified the 2d/3d wireframe export targets somewhat; they
now support only Beziers, without an additional special case for
line segments. The performance penalty for that should not be worth
caring about, since that's infrequent.

And fix a memory leak in FindOuterFacesFrom(), fix ugly output of
filled triangles in PDF (because the line join style did bad things
on long skinny triangles), fix non-zero Z coordinates for exported
views or sections in DXF or STEP.

[git-p4: depot-paths = "//depot/solvespace/": change = 2061]
2009-10-30 02:38:34 -08:00
Jonathan Westhues 2ca5334bdf Add interpolating splines: both periodic splines (that form a
loop), and open-ended splines, with their tangents specified at
their endpoints.

Also change constraint solver matrix size to 1024, on the theory
that a power of two will generate better array indexing, and
replace fabs() with my own function that for some reason is
faster.

[git-p4: depot-paths = "//depot/solvespace/": change = 2055]
2009-10-20 20:46:01 -08:00
Jonathan Westhues f6bb680978 Add Wavefront OBJ support, to supplement the existing STL mesh
export. That doesn't seem very useful, but it's only a few dozen
lines of code.

[git-p4: depot-paths = "//depot/solvespace/": change = 2054]
2009-10-12 03:34:43 -08:00
Jonathan Westhues 83bbc004dc Add 3d wireframe export, in DXF or STEP format. This uses most of
the same plumbing as the 2d vector output.

Also fix piecewise linear tolerance when the export scale factor is
not equal to one; have to scale the chord tol along with that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2053]
2009-10-12 02:40:48 -08:00
Jonathan Westhues 730bb8f73e Make the export scale factor affect the surfaces in a STEP file,
and lay groundwork for wireframe export.

[git-p4: depot-paths = "//depot/solvespace/": change = 2052]
2009-10-12 01:28:34 -08:00
Jonathan Westhues 33dfff2a78 Add option to disable the "not closed contour" warnings and such,
instead of tying that to whether the shaded model is shown. And
rewrite all URLs to solvespace.com, not www.solvespace.com, and get
rid of the nag screen that I just added because opening the website
with ShellExecute seems to freeze a bit on startup.

[git-p4: depot-paths = "//depot/solvespace/": change = 2044]
2009-10-01 02:35:11 -08:00
Jonathan Westhues db565438e3 Add text angle for styles. Add ability to quickly change between
perspective and parallel projections. Add a snap grid, for points
and for text comments. Draw text comments in the plane of their
workplane if they have one, otherwise always facing forward.

And fix a few nasty bugs: the possibility of an extremely long
animation onto a workplane, accidental use of the wrong style line
width for constraints, misplaced text box in style screen for
default styles, other little stuff.

[git-p4: depot-paths = "//depot/solvespace/": change = 2037]
2009-09-29 03:35:19 -08:00
Jonathan Westhues 4634961054 Add ability to assign styles to cosmetic text (in the form of
Constraint::COMMENTs), including line width and color, and text
height and origin location.

[git-p4: depot-paths = "//depot/solvespace/": change = 2033]
2009-09-24 07:52:48 -08:00
Jonathan Westhues 9416faca88 Add a context menu, with a grab bag of options. That will need some
refinement later, but it does not affect file formats so it's not
very critical.

[git-p4: depot-paths = "//depot/solvespace/": change = 2032]
2009-09-23 02:59:59 -08:00
Jonathan Westhues 9b8f32dad7 Now actually export the line styles, for PDF, EPS, and SVG file
formats, with the proper color and width. This may need a bit of
cleanup for stuff like the hidden line removal, which currently
loses the style.

Also fix a bug in the test for arcs of a circle. A second-order
Bezier with collinear control points really is an arc, but it's an
arc with infinite radius so stuff tends to blow up. So return false
for that one.

[git-p4: depot-paths = "//depot/solvespace/": change = 2030]
2009-09-21 21:46:30 -08:00
Jonathan Westhues 517c5edbfa Add user interface to modify styles: change the color, line width,
line width units, on-screen and export visibility. So now we can
use that to modify the default styles, or to create custom styles.

Also add code to draw fat lines, with round endcaps, since gl
doesn't do that.

Next we need some user interface to assign styles to entities, and
to make all the export file formats support the style attributes.

[git-p4: depot-paths = "//depot/solvespace/": change = 2029]
2009-09-18 00:14:15 -08:00