Commit Graph

1412 Commits

Author SHA1 Message Date
Ryan Pavlik
ec13839c92 Modify clang-format config to avoid single-line things. NFC. 2019-09-11 09:43:03 +00:00
Ryan Pavlik
bedea1ef3c Avoid undefined behavior from out-of-range access. NFC. 2019-09-10 06:44:34 +00:00
Ryan Pavlik
b8ee0e941b Remove extraneous semicolon. NFC. 2019-09-10 06:44:34 +00:00
Ryan Pavlik
78819ffca3 Fix "virtual function without virtual destructor" warning. NFC. 2019-09-10 06:44:34 +00:00
Ryan Pavlik
c959af1149 Fix a comment. NFC.
Found by clang-tidy.
2019-09-10 06:44:34 +00:00
Ryan Pavlik
3e566d7e67 Remove std::move from trivially-copyable types. NFC.
Found by clang-tidy
2019-09-10 06:44:34 +00:00
Ryan Pavlik
c0904e2ba8 Use IsEmpty() or .empty() to check if a container is empty. NFC.
Most found by clang-tidy.
2019-09-10 04:22:21 +00:00
Ryan Pavlik
61c0167ad7 Fix TTF iteration in case of an empty list. 2019-09-10 04:22:07 +00:00
Ryan Pavlik
15838dc5a1 For loop cleanup. NFC. 2019-09-10 04:21:57 +00:00
Ryan Pavlik
231dff6cd9 Add and use List::Last(). NFC. 2019-09-10 04:20:38 +00:00
whitequark
c5f3cd151a Use the same @todo hot comment style everywhere. 2019-09-10 04:07:42 +00:00
Ryan Pavlik
d514a26f92 Fix use-after-free in revolve and helix.
Pointers get invalidated if a list has to be re-allocated.
CopyEntity can do that.
2019-09-10 04:07:42 +00:00
Ryan A. Pavlik
a4c0022815 Fix a warning about a virtual destructor. 2019-09-10 03:33:05 +00:00
Ryan A. Pavlik
43b2261e9c CLI/testsuite: do not crash if a dialog is displayed. 2019-09-10 03:23:31 +00:00
phkahler
22e4011cb6 use std::vector in helix operations instead of fixed length array. Remove limit on number of sections. Delete definition of Revolved struct. 2019-08-25 14:30:37 +00:00
phkahler
e22c522c81 use std::vector in lathe operations instead of fixed length array 2019-08-25 14:30:37 +00:00
phkahler
2dd50d0f3a Only allow lathe, revolve and helix for 2d sketches. 2019-08-25 14:30:37 +00:00
Ryan Pavlik
13820bf27d Revert "IdList::RemoveTagged switch to std::remove_if from iteration. NFC."
This reverts commit 0bb6a348e3.
2019-08-20 23:28:43 +00:00
Ryan Pavlik
b284e80785 Improve NextAfter. NFC. 2019-08-20 15:57:11 +00:00
Ryan Pavlik
533ca618eb Fix a manual manipulation of List::n. NFC.
This broke encapsulation and thus caused problems for any deeper changes
to List.
2019-08-20 15:57:11 +00:00
Ryan Pavlik
dd738dd1fc Add Last(). NFC.
Counterpart of First().  standard library calls this "back()".
2019-08-20 15:57:11 +00:00
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
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
phkahler
346f004e51 Brighter blue and yellow in text window for higher contrast/readability. 2019-07-09 00:48:06 +00: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