Ryan Pavlik
610e35f6dd
Improve Clear(). NFC.
...
Was getting segfaults near here with another patch since removed from the branch.
Moving these assignments after the memfree means they still have
useful data when debugging a crash in memfree.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
b9d035c805
Improve MoveSelfInto. NFC.
...
std::swap is an idiomatic way to do a move.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
9fd09ddd8a
Add IdList::AllocForOneMore() based on List. NFC.
...
Also modifies a sizeof call.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
0bfbbe2bf3
Improve implementation hiding in IdList/List. NFC.
...
Allows distancing users from the internal "elem" member.
Add Get() and operator[].
Replace direct references to elem.
Make elem and elemsAllocated private in IdList/List.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
482f0e8de9
Replace qsort with std::sort and lambda. NFC.
...
Removes static variable usage, permits hiding of the underlying pointer
(std::sort uses iterators intead), type safety, etc.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
1b97a006e9
Add and use List<T>::IsEmpty, range-for, etc. NFC.
...
Changes resemble those already made to IdList.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
0bb6a348e3
IdList::RemoveTagged switch to std::remove_if from iteration. NFC.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
3ea077b70f
Reduce scopes and placate clang-tidy. NFC.
...
Pointing out one potential issue with an assert.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
60fdac141d
Simplify IdList::Add(). NFC.
...
Offloads most of the work onto standard algorithms to make it
more self-evidently correct.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
3340392bf0
Add and use LowerBound methods in IdList. NFC.
...
Clearer and less error-prone to use standard-supplied algorithms.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
0c941aedb1
Revise IdList::Tag to reduce code duplication. NFC.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
5ada4dbd9c
Add and use IdList::IsEmpty. NFC.
...
Removes consuming code from the implementation details, easing swap of
the underlying container, etc.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
b5f36a4f01
Provide cbegin(), cend() in containers. NFC.
...
Allows forcing const iteration.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
86f20cc7e5
Convert many loops to range-for or std algorithms. NFC.
...
Also add comments about indexing and when we don't use range-for.
2019-08-20 15:57:11 +00:00
whitequark
97c8cb7d71
Make sure changing color of a group does not reset alpha.
2019-08-12 08:52:51 +00:00
nabijaczleweli
d9081b0b08
VRML: add support for transparency.
2019-08-09 23:32:24 +00:00
nabijaczleweli
837628ea3e
Add VRML (WRL) triangle mesh export.
...
Transparency is not supported.
2019-08-09 21:30:33 +00:00
phkahler
986da7d224
Implement helical extrusion groups.
2019-07-31 04:16:56 +00:00
whitequark
b3f739f2c4
Improve layout for reference axes with very vertically small windows.
2019-07-12 11:23:28 +00:00
KmolYuan
d5ac4039ea
Add set values method for parameters.
2019-07-11 20:40:33 +08:00
Ryan Pavlik
b2af9cee6c
Use the fact that handles are now less-than comparable. NFC.
2019-07-10 15:40:21 +00:00
Ryan Pavlik
5efb09e6d4
Use the new equality/inequality operators of handles to reduce references to .v. NFC.
2019-07-10 15:40:21 +00:00
Ryan Pavlik
7bd4b149f7
Traits work for handles to permit sharing functionality and operators. NFC.
2019-07-10 15:40:21 +00:00
KmolYuan
594ae25483
Fix URL.
2019-07-09 15:51:20 +08:00
phkahler
346f004e51
Brighter blue and yellow in text window for higher contrast/readability.
2019-07-09 00:48:06 +00:00
KmolYuan
5fe420bdff
Correction of unittest case.
2019-07-08 16:37:12 +08:00
whitequark
02d7f0c0aa
Auto-recover files corrupted by the bug in commit bd84bc1a
.
2019-06-25 00:48:57 +00:00
whitequark
49a7f863b8
Fix off-by-1 in Group::Remap.
...
This was introduced in bd84bc1a
and caused crashes with:
Assertion failed: hm.v != t->h.v.
2019-06-24 22:59:34 +00:00
Maximilian Federle
cb0fdb1c28
Freedesktop: add scalable SVG icon.
2019-06-14 20:59:36 +00:00
phkahler
5df53fc59e
Implement revolve groups.
2019-06-03 17:32:38 +00:00
whitequark
3d80062b66
GTK: delete all gtkmm objects before destrying Gtk::Main.
...
Otherwise this results in harmless but annoying spam on applciation
shutdown.
See https://gitlab.gnome.org/GNOME/gtkmm/issues/22 .
2019-05-31 23:07:04 +00:00
whitequark
359697990a
Update q3d submodule.
2019-05-31 23:07:04 +00:00
ruevs
9ac55f392a
Win32: fix build with -DOPENGL=1.
2019-05-29 15:06:25 +00:00
KmolYuan
0975723a3f
Add stub file to package data.
2019-05-29 17:44:55 +08:00
KmolYuan
caaed11290
Constrain Cython version.
2019-05-29 16:34:37 +08:00
KmolYuan
329c1246ae
Update test case module.
2019-05-29 15:52:08 +08:00
KmolYuan
5be39f2ba1
Update ignore items.
2019-05-29 15:30:17 +08:00
KmolYuan
50a16dfde6
Compatibility adjustment.
2019-05-29 14:34:49 +08:00
KmolYuan
14e28827ee
Add cython modules.
2019-05-28 20:19:11 +08:00
whitequark
6352405206
Deselect entities with Ctrl-LMB.
...
In other words, Ctrl inverts the normal action of LMB. It is already
possible to deselect entities through the context menu, but that
can be very awkward on laptop touchpads with a crowded sketch; with
Ctrl, a misclick is easily corrected without moving cursor at all.
2019-05-24 19:11:56 +00:00
whitequark
bd84bc1ae9
Replace entity map implementation with std::unordered_map.
...
On a single load benchmark this provides about 25% speedup.
2019-05-24 18:19:10 +00:00
whitequark
406c55e8b9
Instead of creating an exact copy of existing constraint, select it.
2019-05-24 16:21:55 +00:00
whitequark
09ca442715
Commit missing parts of cf2f0e5d
.
2019-05-24 16:02:01 +00:00
whitequark
eb7e12b829
Make sure file from a recent menu exists before using it.
...
Otherwise it can result in a very confusing error that does not
suggest at all that the file is missing.
2019-05-24 15:57:43 +00:00
whitequark
beea4444ab
Move logic for handling allowRedundant out of System. NFC.
2019-05-24 15:43:20 +00:00
whitequark
cf2f0e5d44
In TryConstrain(), reject redundant constraints in overconstrained groups.
...
This keeps groups with allowed redundant constraints cleaner when
they are used together with automatic constraints.
2019-05-24 15:40:18 +00:00
whitequark
549565958f
Skip creating an automatic H/V constraint if it would be redundant.
...
This means that automatically added H/V constraints now will never
cause the sketch to become overconstrained, which currently makes
that feature almost unusable.
2019-05-24 15:06:53 +00:00
whitequark
394c1f62d8
Remove forceDofCheck parameter from SolveRank(). NFC.
...
It makes no sense to solve by substitution (therefore weakening rank
check) in SolveRank(), since that's the whole point of SolveRank().
In addition, because SolveRank() is currently always called right
after AddConstraint(), forceDofCheck would always be true anyway.
In addition, it makes no sense to have TestRankForGroup() dependent
on the result of the previous solve. (For SolveGroup(), solving by
substitution after we know that rank test succeeds makes dragging
points much faster.)
2019-05-24 14:07:48 +00:00
whitequark
88879d352e
Show Degrees of Freedom → Show Underconstrained Points
...
Clarify the name of the command, as the old name is not strictly
correct. E.g. consider a vertical line with a midpoint constraint to
origin has 1 DOF, but 2 highlights are shown. Conversely, a single
datum point has 2 DOF, but 1 highlight is shown.
2019-05-24 12:34:42 +00:00
EvilSpirit
9d1c295495
Add a setting to format constraint labels using SI prefixes.
...
Supported metric units: km, m, cm, mm, µm, nm.
Supported USCS units: in, mil, µin.
Also, use the newly introduced unit formatting machinery in tools for
measuring perimeter, area and volume, so that e.g. volume is not
displayed in millions of cubic millimeters.
2019-05-24 12:31:41 +00:00