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.
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.
* 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.
- 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.
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.