Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CreateConnectedElementI #1042

Open
joergbrech opened this issue Dec 4, 2024 · 0 comments
Open

Refactor CreateConnectedElementI #1042

joergbrech opened this issue Dec 4, 2024 · 0 comments

Comments

@joergbrech
Copy link
Contributor

The CPACSCreator added a new abstract base class CreateConnectedElementI for both wings and fuselage, which seems a bit intrusive to me. In addition the Open-Closed principle is violated, because we had to modify the existing classes for the new functionality in the TiGLViewer. In addition, neither a wing, nor a fuselage "is a" CreateConnectedElementI.

An alternative solution would be to have the TiGLViewer code use std::variant and std::visit (or boost::variant, if we still want to stick to C 14).

using ElementModificatorInterface = std::variant<Fuselage, Wing>; // could be apended with Duct, Pylon, tank in the future

The code changes are limited to the calling code, i.e. TiGLViewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant