Commit graph

130 commits

Author SHA1 Message Date
Leonardo Zide
a5207573bf Customizable object colors. 2021-11-24 15:20:08 -08:00
Leonardo Zide
94a5a5dc52 Moved blend to context. 2021-11-22 16:18:09 -08:00
Leonardo Zide
2a24933fa8 Scoped enums. 2021-11-14 19:10:16 -08:00
Leonardo Zide
7d884e6b5f Static analysis fixes. 2021-11-14 18:34:24 -08:00
Johannes Sixt
ba2cc70de8 Implement a piece's focused section as a simple index, not a bit mask.
It does not make sense to have a "focus" on more than one thing. Keep the
most recently focused section of a piece as a single index rather than a
bit mask. This removes a lot of implementation burden.
2021-10-31 15:51:58 +01:00
Johannes Sixt
d7ed7aaef4 Hold selection state in a separate variable, and treat all sections equal.
Notice that the selection state of individual piece sections are stored,
but never queried: the result of neither version of IsSelected() depends
on the section whose state is selected. Do not hold the state of
individual sections.

There is a theoretical change in behavior: Before, when a particular
section was unselected with SetSelected(Section, false), the focus state
of only the requested section was removed; now we remove the complete
focus. This change has no practical relevance, because there is no
user interface that can unselect individual piece sections.
2021-10-31 15:50:57 +01:00
Johannes Sixt
f81f949dc6 Hold states "hidden" and "pivot point valid" in separate variables.
In this way, the accesses are more natural than bit manipulations.
2021-10-31 15:50:57 +01:00
Leonardo Zide
f69ecf7fc0 Keep BFC disabled. Fixes #717. 2021-05-16 15:53:59 -07:00
Leonardo Zide
0be663f73c Reset BFC state after enabling it. 2021-03-27 17:52:21 -07:00
Leonardo Zide
b8a8cb6730 Removed direct GL function calls. 2021-01-12 14:29:56 -08:00
Leonardo Zide
cb710206b7 Moved key functions into a separate class. 2021-01-05 11:26:01 -08:00
Leonardo Zide
499e648673 Use individual bounding boxes for zoom extents. 2020-12-31 10:22:12 -08:00
Leonardo Zide
2d7aba8895 Use QString for object names. 2020-12-13 16:27:21 -08:00
Leonardo Zide
60a0f9190d Widget merging. 2020-12-05 11:02:10 -08:00
Leonardo Zide
acd7dd3f9a Allow highlight color to be set by the user. 2020-04-25 11:36:28 -07:00
Leonardo Zide
5a76f4c870 Scoped enums. 2020-04-18 19:45:21 -07:00
Leonardo Zide
70da56bb05 More accurate bounding box calculation for submodels. 2020-04-11 11:04:27 -07:00
Johannes Sixt
ca73f3e3ad
Synthesis of Technic Universal Joints (#456)
* Split synth info initialzation by type.

We are going to remove the type enumeration and use a class hierarchy
instead. This preparation will then be helpful.

* Make Add...Parts() overrides of a virtual AddPart() function.

Since we have a class hierarchy for the different synthesized pieces, we
can now turn a case distinction into a virtual function call.

* Move initialization based on type to derived class constructors.

Move initialization of end transformations of flexible parts into
class lcSynthInfoCurved.

* Make GetDefaultControlPoints() virtual with overrides.

* Remove obsolete enum lcSynthType.

We have replaced its purpose by derived classes by now.

* Initialize shock absorbers' spring part ID early.

This removes the awkward early return that is needed in the if-else
cascade.

* Split lcSynthInfo into derived classes for curved and straight pieces.

* Only curved parts have varying sections, start, middle, and end properties.

Move the properties from the base class to the derived class that needs
them.

* Use derived classes to mark synthesized objects of different kinds.

We will extend the derived classes in the upcoming commits.

* PieceInfo is only needed to synthesize some hoses and shock absorbers.

* Initialize edge part IDs of flexible hoses early.

This removes another case distinction in AddParts().

* Verify the number of control points loaded from a model file.

* Synthesize Technic universal joints.

The direction of one end can be changed so that it points to the control
point.

* Technic universal joints need only the position of the control point.

* Synthesize legacy universal joints.
2020-03-30 12:17:08 -07:00
Leonardo Zide
90f1336a48 Scoped enums and constexpr. 2020-03-22 13:44:20 -07:00
Leonardo Zide
ade7334fa1 Support up to 10 control points and prevent the user from adding more. 2020-03-22 11:12:15 -07:00
Leonardo Zide
fb7f952e98 Fixed a case where drag and drop a submodel didn't do anything. 2020-02-01 11:34:56 -08:00
Leonardo Zide
cbf534fcdf Added option to fade previous steps. 2020-01-01 17:06:17 -08:00
Gerd Wachsmuth
516ddcbf7e Fix two issues with pivot points (#382)
- ResetPivotPoint() now truely resets the pivot point (and not only
invalidating it).
- The copy constructor of lcPiece now also copies the state of the pivot
point. Thus, duplicating pieces also duplicates the pivot points.
2019-08-20 14:52:29 -07:00
Leonardo Zide
e68ce05b57 Moved mesh flags to the mesh class. 2019-07-21 08:56:37 -07:00
Leonardo Zide
e45fe81ace Array cleanup. 2019-05-27 16:39:51 -07:00
Leonardo Zide
3070d25663 Support exporting flexible parts. Fixes #157. 2019-05-26 11:08:47 -07:00
Leonardo Zide
602dfeb8b6 Fixed /w4 warnings. 2019-05-18 11:33:27 -07:00
Leonardo Zide
b31d33fd67 Don't show hidden pieces in submodels. 2019-03-12 19:51:04 -07:00
Leonardo Zide
752ae54788 Fixed interface draw location in active submodels. 2018-04-07 17:17:32 -07:00
Leonardo Zide
718b31a2bd Fixed selection tinting when editing submodels. 2018-04-07 11:45:00 -07:00
Leonardo Zide
b30ffd1b59 Initial implementation of in place submodel editing. 2018-03-29 10:20:36 -07:00
Leonardo Zide
51bbdb9b97 Added option to remove key frames from selected objects. 2018-02-24 12:47:19 -08:00
Leonardo Zide
35eb41217a Fixed first key frame being overwritten when loading a file. Fixes #191. 2018-02-24 11:44:56 -08:00
Leonardo Zide
9c503eb7a4 Fixed moving the pivot point of rotated pieces. Fixes #179. 2018-01-22 17:14:38 -08:00
Leonardo Zide
7ca156b3a7 Added commands for moving the camera relative to its current orientation. 2018-01-15 11:35:15 -08:00
Leonardo Zide
636e013455 Removed lcint types. 2017-12-02 12:22:04 -08:00
leozide
f2560c18e0 Fixed parts being considered hidden in some cases. Fixes #108. 2017-08-25 16:17:22 -07:00
Leonardo Zide
82528a2c7a Don't uppercase part names when saving. 2017-07-27 09:21:55 -07:00
leozide
5de0644c7b Save positions with 4 digits and rotations with 6. 2017-07-26 17:34:25 -07:00
Leonardo Zide
94eb5b8ae2 Store library pieces in a map. 2017-07-23 19:35:18 -07:00
Leonardo Zide
5cd85a1584 Preserve case of part names in files. 2017-07-22 20:54:33 -07:00
Alistair Buxton
2de2e2c187 Highlight parts added in the current step. 2017-06-20 07:47:31 -07:00
Johannes Sixt
2448a47071 Fortify against random control points in imported files.
It can happen (accidentally or maliciously) that control points are
imported from a file for pieces that cannot be synthesized. In such a case,
a click on the control point indicator leads to a NULL pointer access.
Insert checks so that the click is effectively ignored.
2017-04-15 16:41:32 +02:00
leozide
f7d61f33ce Updated code to use nullptr and override. 2017-04-13 17:26:40 -07:00
leozide
35050efe3a Compiler feature test. 2017-04-13 17:07:29 -07:00
Leonardo Zide
c34810c084 Static analysis fixes. 2017-04-02 17:15:09 -07:00
Leonardo Zide
b9726a2a99 Reorganized scene and context classes. 2017-04-01 16:53:54 -07:00
Leonardo Zide
49a88e1ab4 Fixed synth parts adding the wrong mesh to the scene when in a submodel. Fixes #42. 2017-03-26 18:28:31 -07:00
Leonardo Zide
155fa7cdc2 Removed redundant glBlendFunc calls. 2017-03-25 00:03:17 -07:00
Leonardo Zide
c85f0f7eea Disable normals for unlit passes. 2017-03-24 09:34:53 -07:00