Commit Graph

1204 Commits (0b79dc277e86f536736669e273576738e290d76a)

Author SHA1 Message Date
whitequark 6cf5409cd7 Update testsuite after ced4244. 2017-02-06 14:50:21 +00:00
whitequark cd26256675 Travis: run tests again.
Tests used to be included in `make all`, but not since 8d0e226.
2017-02-06 14:49:13 +00:00
EvilSpirit 97e71856b3 Snap point to entity when constraining to a hovered entity.
Before this commit, when a point is constrained to an entity (point,
circle, arc of circle or line segment) by clicking on it,
the resulting constraint is not necessarily satisfied, and the next
regeneration may place the newly constrained point somewhere other
than the intended position. After this commit, the parameters
are modified to satisfy the constraint.
2017-02-06 14:20:19 +00:00
EvilSpirit ced42440e7 Explicitly represent the parameter used in constraints.
Commit f5485cb and its ancestors add a parameter to some constraints.
This parameter must be materialized and assigned a non-zero value via
ModifyToSatisfy for the solver library to not make unnecessary
changes to the sketch during the initial generation. For this, we
represent it explicitly instead of using hc.param(0), such that
the materialized constraint does not conflict with any user-defined
ones.
2017-02-06 13:02:49 +00:00
whitequark 80c7296316 Win32: do not redefine VOS_NT_WINDOWS32/VFT_APP. 2017-02-06 11:23:06 +00:00
whitequark 4260be2445 DXF: mark POLYLINE as 3d if any of the points have non-zero Z.
This commit follows 41365c5, which enabled export of Z coordinate
by using POLYLINE instead of LWPOLYLINE. After this commit, only
the AcDb2dPolyline/AcDb2dVertex are used when exporting flat views,
which may improve compatibility with 2d design packages.
2017-02-05 09:39:22 +00:00
EvilSpirit baf9dc0aae Remove degenerate triangles when generating triangle mesh. 2017-02-05 09:25:07 +00:00
whitequark 4465bc0270 CMake: do not remove translations on `make clean`. 2017-02-02 18:09:50 +00:00
whitequark 51b88280e5 README: suggest release builds, as these are much faster.
Also, remove -DENABLE_TESTS=OFF, since tests are no longer run
when building the default target.
2017-02-02 17:45:55 +00:00
whitequark 279424290b Remove a redundant ReloadAllImported() call. 2017-01-31 02:20:10 +00:00
whitequark 6e88eaef69 Fix a path construction issue introduced in 3fc85b7. 2017-01-31 02:15:37 +00:00
EvilSpirit d4b052d34d Fix logic introduced in 55ae10b.
Before this commit, the effect of the AddPending() call was
immediately reversed by ClearSuper.
2017-01-24 20:30:48 +00:00
whitequark 3fc85b7934 CLI: add the "regenerate" command, for use in Makefiles etc. 2017-01-24 19:55:53 +00:00
whitequark 27a5f6f9bd CLI: include directory name in %-replacement. 2017-01-24 19:54:47 +00:00
whitequark 67a916d19c CLI: show usage when --help/-h passed. 2017-01-24 19:40:30 +00:00
whitequark ff0af6fdba Fix a typo in 495a7ac. 2017-01-23 11:15:37 +00:00
whitequark 495a7ac166 Refactor the "File → Export Image" command.
The existing code is horrible and needlessly platform-dependent.
Even worse, it causes a freeze on GTK. Instead of propping that up
with a few more crutches, just fix the root cause.
2017-01-23 00:24:18 +00:00
whitequark bb2cc4aa56 GTK: do not compose rendered geometry with an alpha buffer.
The somewhat confusingly named set_has_alpha() function does not
affect whether alpha can be used during rendering to the area.
Rather, it affects whether alpha will be used when composing
the contents of the area with the window underneath it.
2017-01-21 06:34:44 +00:00
EvilSpirit 669e6f0dcb Select the appropriate entity when dragging a circle or a normal.
This commit adds logic that was missed in 25631d4.
2017-01-20 11:54:56 +00:00
EvilSpirit 119b17ac75 Fix an occasional crash when starting to drag an entity. 2017-01-20 11:48:47 +00:00
EvilSpirit 86f229c5e6 Render points corresponding to a DOF in the front layer.
Before this commit, if any rendering mode except "show all occluded"
is enabled, points can be highlighted for corresponding to a DOF
after "Analyze → Degrees of Freedom" but then promptly occluded,
which is confusing.
2017-01-20 11:46:31 +00:00
EvilSpirit db75e06ecc Add a command to show center of mass, assuming uniform density. 2017-01-19 08:54:11 +00:00
whitequark 068191bf28 GTK: unbreak the color chooser.
We want to suppress accelerators but still get input to (at least)
the window where the editor is opened. It's no harm to permit input
to other windows, but it is bad to route all of it to the editor,
since color chooser depends on being able to receive input.

So, what we do is add modal grab to the *overlay*, which has
the editor and the underlay widget, route all events as usual
to children, and just force the key events to go to the editor,
since otherwise they would still propagate up for some reason.
2017-01-17 13:11:09 +00:00
whitequark 8749a175a6 Draw constraints/entities when hovered or selected even if invisible.
This goes really well with the related constraint/request lists,
and in general seems very natural.
2017-01-17 11:53:51 +00:00
whitequark e388d9fd16 List applied constraints when selecting an entity. 2017-01-17 11:43:45 +00:00
whitequark 5d9356a90a List constrained requests when selecting a constraint. 2017-01-17 11:32:50 +00:00
whitequark 4aae22929a Add *.slvs to gitignore.
I've committed some random sketches one time too many...
2017-01-17 11:29:18 +00:00
EvilSpirit 3e668079b5 Fix a crash after creating a constraint.
To reproduce, e.g.:
  * draw a rect;
  * translate the rect;
  * add a pt-on-line constraint between two instances.
2017-01-17 11:26:04 +00:00
whitequark 8d0e226722 CMake: do not depend on testsuite in the default target. 2017-01-17 11:26:04 +00:00
whitequark 572fbc7463 Reapply "Simplify Group::IsVisible(), GroupsInOrder()."
This reverts commit 1d1bdddef21baf1e312fcc65bb67e76c87b2b0fc,
with a bugfix for pruning orphans when deleting a group in the middle
of the sketch.
2017-01-17 11:26:04 +00:00
whitequark 04e86d9b36 Travis: revert the hack for transient build failures. 2017-01-17 11:26:04 +00:00
whitequark 67146f6ab2 Revert "Simplify Group::IsVisible(), GroupsInOrder()."
This reverts commit 022d012a44.

The commit above has caused crashes during pruning.
2017-01-17 11:26:04 +00:00
whitequark 8370382a33 Fix reference to a shader that no longer exists. 2017-01-17 11:26:04 +00:00
whitequark 5b2ad9b5f1 Fix 2d stippling of hovered and selected faces.
This was broken in ec07516.
2017-01-17 11:26:04 +00:00
whitequark 6931979b8e Fix an OpenGL initialization glitch.
Before this commit, the first time NewFrame() is called,
the background color would not be filled, leading to interference
with whatever the GUI toolkit decided to put there.
2017-01-14 06:06:55 +00:00
EvilSpirit 5c34b3f6ef Allow copying and pasting of datum points. 2017-01-14 03:17:09 +00:00
EvilSpirit 12a1a35784 Reserve space upfront when possible, to avoid re-allocations. 2017-01-14 03:07:33 +00:00
whitequark fba88859e1 Normalize CRLF newlines to LF when loading string resources. 2017-01-14 02:41:23 +00:00
whitequark ec07516580 GTK: work around a gtkmm<3.22 bug. 2017-01-14 02:41:23 +00:00
whitequark 29e43e67ea Fall back to en_US if the system locale is not available.
Without this, msgids would be used instead of the more proper
message strings. Also, since RefreshLocale() is never called,
the menu goes missing.
2017-01-14 00:32:47 +00:00
whitequark cde86a0626 Fix an uninitialized variable. 2017-01-13 23:43:02 +00:00
whitequark 6b67cfe63f Except when using OpenGL ES 2, use OpenGL 3.2+ Core profile.
This is primarily done to lower the GTK version dependency below
GTK 3.22, since GTK 3.22 is unlikely to be widely availale any
time soon.
2017-01-13 23:43:02 +00:00
whitequark 6de5133609 GTK: default to the en_US locale if LANGUAGE is set and empty. 2017-01-13 21:13:40 +00:00
EvilSpirit 022d012a44 Simplify Group::IsVisible(), GroupsInOrder(). 2017-01-12 01:40:34 +00:00
EvilSpirit 43db2201fd Turn newly created redundant constraints with a label into references.
This is a fairly standard CAD feature; it conveys the same
information and has the same recovery path, without erroring out,
so seems like an obvious win.
2017-01-12 01:34:41 +00:00
EvilSpirit c00ab25740 Don't move points when automatically constraining coincident.
This can change the sketch dramatically, e.g. extrude a rectangle
and draw a line diagonally from the top to the bottom face.
2017-01-11 04:34:11 +00:00
whitequark 855de072be Automatically constrain arc or rectangle points. 2017-01-11 04:17:14 +00:00
EvilSpirit 55ae10b5b8 Do not hover or select entities from any pending request. 2017-01-11 04:16:59 +00:00
whitequark 96476ca2e5 GTK: respect the scale factor when computing coordinates.
This doesn't bring true HiDPI support yet, since there are no HiDPI
assets anyway, but it makes the interface usable.
2017-01-11 03:41:06 +00:00
EvilSpirit fb667fb8bb Use a dedicated BitmapFont instance per Canvas.
Before this commit, updates to the bitmap font in the graphics window
cause missing characters in the text window and vice versa. This is
because BitmapFont contains a texture that's mutated, and sharing it
would also require sharing display lists between GL contexts, which
is not done (and overly complicated for this case anyway).
2017-01-11 03:33:10 +00:00