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.
This commit is contained in:
@@ -684,6 +684,7 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project)
|
||||
Piece->SetPieceInfo(Info, PartId, false);
|
||||
Piece->Initialize(Transform, CurrentStep);
|
||||
Piece->SetColorCode(ColorCode);
|
||||
Piece->VerifyControlPoints(ControlPoints);
|
||||
Piece->SetControlPoints(ControlPoints);
|
||||
AddPiece(Piece);
|
||||
Piece = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user