Commit Graph
121 Commits
Author SHA1 Message Date
Leonardo Zide fb71e545a9 Saved undo data as structures. 2026-02-11 20:15:26 -08:00
Leonardo Zide 576f9fe13e Moved hidden state to lcObject. 2026-02-03 23:02:24 -08:00
Leonardo Zide 07c80b705f Fixed duplicate pieces not grouping correctly. 2026-02-03 09:41:28 -08:00
Leonardo Zide c627e1608e Merged selection/focus code in the lcObject class. 2026-01-25 23:01:47 -08:00
Leonardo Zide 8342e147cf Added RemoveFromSelection action. 2026-01-10 21:34:21 -08:00
Leonardo Zide 75ac6fe0cb Removed unused SetSelected override. 2026-01-03 10:14:45 -03:00
Leonardo Zide 6334c159a9 Removed add piece action. 2025-12-28 15:21:09 -03:00
Leonardo Zide 2741b86e9c Don't save selection in object edit actions. 2025-12-21 13:39:34 -03:00
Leonardo Zide 4de6c095e4 Save the entire object state to the undo buffer instead of only key frames. 2025-12-04 17:41:04 -08:00
Leonardo Zide 3bf01f2095 Added actions for mouse drag changes. 2025-11-23 20:33:59 -08:00
Leonardo Zide 6df16f5742 Added step insert and delete actions. 2025-11-19 22:34:53 -08:00
Leonardo Zide e86208caab Draw train track connection boxes in the manipulator to match the scaling with the other gizmos. 2025-05-01 12:26:34 -07:00
Leonardo Zide 4f2782b407 Added rotate train track gizmo. 2024-12-17 19:20:38 -08:00
Leonardo Zide 24b7c43a09 Fixed train track gizmo drawing when a rotated connection has focus. 2024-12-09 10:42:31 -08:00
Leonardo Zide ff23653709 Added track rotation and focus shortcuts. 2024-12-07 20:02:47 -08:00
Leonardo Zide fd61c1c9f9 Added gizmo to rotate train tracks. 2024-11-30 12:29:15 -08:00
Leonardo Zide 41097f8489 Only draw track connections when focused. 2024-11-29 18:45:27 -08:00
Leonardo Zide a08ad3f81b Detect train track connections and pick an open one when inserting. 2024-11-27 13:04:53 -08:00
Leonardo Zide 14e5e7d126 Connect train tracks when inserting with the keyboard. 2024-11-23 18:03:54 -08:00
Leonardo Zide aae75b36fe Removed lcArray from control points. 2024-05-12 12:45:15 -07:00
Leonardo Zide 34941219f5 Added support for multi edit piece id and color. 2024-03-02 17:37:46 -08:00
Leonardo Zide 39bdb1aa0a Added multi state support to colors. 2024-02-19 14:54:45 -08:00
Leonardo Zide db24fab6d7 Support changing multiple bool properties at the same time. 2024-02-19 12:32:19 -08:00
Leonardo Zide a42d86394c Support toggling key frames. 2024-01-21 12:53:18 -08:00
Leonardo Zide 4785caac2a Added key frame widgets. 2024-01-14 17:41:01 -08:00
Leonardo Zide 086be790d0 Removed Get/SetValue. 2023-12-28 10:27:00 -08:00
Leonardo Zide e4f4df4376 Use lcObjectProperty in Piece. 2023-12-28 10:21:52 -08:00
Leonardo Zide a27694a594 Support dragging light targets to rotate. 2023-09-23 18:38:03 -07:00
Leonardo Zide 5d558b38bb Warning fix. 2021-11-13 17:52:29 -08:00
Johannes Sixt 31855d508f Permit an enormous number of control points. 2021-10-31 16:09:03 +01: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 b301b59f8f Implement GetSectionPosition() with computed, not enumerated indices.
This aligns the function with others, such as GetRotationCenter().
2021-10-31 15:50:57 +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 00f3f0588f Cleanup. 2021-01-16 18:27:39 -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 2390feb88f Deleted unsafe default operations. 2020-05-03 15:39:39 -07:00
Leonardo Zide 70da56bb05 More accurate bounding box calculation for submodels. 2020-04-11 11:04:27 -07:00
Johannes SixtandGitHub 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 7275c4256d Added const qualifiers. 2020-03-22 20:18:52 -07:00
Leonardo Zide 7c9773f228 Fixed override and virtual function qualifiers. 2020-03-22 15:44:41 -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 cbf534fcdf Added option to fade previous steps. 2020-01-01 17:06:17 -08:00
Leonardo Zide bd25c7f31a Sort translucent meshes per section. 2019-11-22 16:47:58 -08:00
Gerd WachsmuthandLeonardo Zide 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 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