From 7054d9f1622817b3ba21b73d710a7212a9dacc31 Mon Sep 17 00:00:00 2001 From: Adam Kewley Date: Fri, 17 Nov 2023 11:57:27 +0100 Subject: [PATCH] Clean up headers in OpenSimCreator/ModelGraph (#802) --- src/OpenSimCreator/CMakeLists.txt | 4 +- src/OpenSimCreator/ModelGraph/BodyEl.cpp | 25 +++++++++++ src/OpenSimCreator/ModelGraph/BodyEl.hpp | 27 ++---------- .../CommittableModelGraphActions.cpp | 1 + src/OpenSimCreator/ModelGraph/EdgeEl.cpp | 21 ++++++++++ src/OpenSimCreator/ModelGraph/EdgeEl.hpp | 22 +++------- src/OpenSimCreator/ModelGraph/GroundEl.cpp | 38 +++++++++++++++++ src/OpenSimCreator/ModelGraph/GroundEl.hpp | 32 +++------------ .../ModelGraph/ISceneElLookup.hpp | 3 +- src/OpenSimCreator/ModelGraph/JointEl.cpp | 38 +++++++++++++++++ src/OpenSimCreator/ModelGraph/JointEl.hpp | 41 ++++--------------- src/OpenSimCreator/ModelGraph/MeshEl.cpp | 39 ++++++++++++++++++ src/OpenSimCreator/ModelGraph/MeshEl.hpp | 39 +++--------------- src/OpenSimCreator/ModelGraph/ModelGraph.cpp | 11 +++++ src/OpenSimCreator/ModelGraph/ModelGraph.hpp | 6 +-- .../ModelGraph/ModelGraphHelpers.cpp | 4 +- .../ModelGraph/ModelGraphHelpers.hpp | 4 +- src/OpenSimCreator/ModelGraph/StationEl.cpp | 36 ++++++++++++++++ src/OpenSimCreator/ModelGraph/StationEl.hpp | 35 ++-------------- 19 files changed, 251 insertions(+), 175 deletions(-) create mode 100644 src/OpenSimCreator/ModelGraph/GroundEl.cpp create mode 100644 src/OpenSimCreator/ModelGraph/ModelGraph.cpp diff --git a/src/OpenSimCreator/CMakeLists.txt b/src/OpenSimCreator/CMakeLists.txt index 844feeee8..9a08e457a 100644 --- a/src/OpenSimCreator/CMakeLists.txt +++ b/src/OpenSimCreator/CMakeLists.txt @@ -64,6 +64,7 @@ add_library(OpenSimCreator STATIC ModelGraph/CrossrefDirection.hpp ModelGraph/EdgeEl.cpp ModelGraph/EdgeEl.hpp + ModelGraph/GroundEl.cpp ModelGraph/GroundEl.hpp ModelGraph/ISceneElLookup.hpp ModelGraph/JointEl.cpp @@ -71,6 +72,7 @@ add_library(OpenSimCreator STATIC ModelGraph/MeshEl.cpp ModelGraph/MeshEl.hpp ModelGraph/ModelCreationFlags.hpp + ModelGraph/ModelGraph.cpp ModelGraph/ModelGraph.hpp ModelGraph/ModelGraphHelpers.cpp ModelGraph/ModelGraphHelpers.hpp @@ -271,7 +273,7 @@ add_library(OpenSimCreator STATIC Utils/TPS3D.hpp Utils/UndoableModelActions.cpp Utils/UndoableModelActions.hpp - "UI/Tabs/MeshImporter/ImportStationsFromCSVPopup.cpp") +) # OpenSimCreatorConfig.hpp # diff --git a/src/OpenSimCreator/ModelGraph/BodyEl.cpp b/src/OpenSimCreator/ModelGraph/BodyEl.cpp index 544aade6f..f250a0075 100644 --- a/src/OpenSimCreator/ModelGraph/BodyEl.cpp +++ b/src/OpenSimCreator/ModelGraph/BodyEl.cpp @@ -1,10 +1,14 @@ #include "BodyEl.hpp" +#include +#include #include +#include #include #include +#include #include #include @@ -23,3 +27,24 @@ void osc::BodyEl::implSetLabel(std::string_view sv) { m_Name = SanitizeToOpenSimComponentName(sv); } + +osc::SceneElClass osc::BodyEl::CreateClass() +{ + return + { + ModelGraphStrings::c_BodyLabel, + ModelGraphStrings::c_BodyLabelPluralized, + ModelGraphStrings::c_BodyLabelOptionallyPluralized, + ICON_FA_CIRCLE, + ModelGraphStrings::c_BodyDescription, + }; +} + +std::ostream& osc::BodyEl::implWriteToStream(std::ostream& o) const +{ + return o << "BodyEl(ID = " << m_ID + << ", Name = " << m_Name + << ", m_Transform = " << m_Xform + << ", Mass = " << Mass + << ')'; +} diff --git a/src/OpenSimCreator/ModelGraph/BodyEl.hpp b/src/OpenSimCreator/ModelGraph/BodyEl.hpp index 761c4a699..8574b2e56 100644 --- a/src/OpenSimCreator/ModelGraph/BodyEl.hpp +++ b/src/OpenSimCreator/ModelGraph/BodyEl.hpp @@ -1,19 +1,17 @@ #pragma once -#include -#include #include #include #include -#include #include #include #include #include -#include +#include #include +#include namespace osc { @@ -44,17 +42,7 @@ namespace osc } private: friend class SceneElCRTP; - static SceneElClass CreateClass() - { - return - { - ModelGraphStrings::c_BodyLabel, - ModelGraphStrings::c_BodyLabelPluralized, - ModelGraphStrings::c_BodyLabelOptionallyPluralized, - ICON_FA_CIRCLE, - ModelGraphStrings::c_BodyDescription, - }; - } + static SceneElClass CreateClass(); SceneElFlags implGetFlags() const final { @@ -71,14 +59,7 @@ namespace osc return m_ID; } - std::ostream& implWriteToStream(std::ostream& o) const final - { - return o << "BodyEl(ID = " << m_ID - << ", Name = " << m_Name - << ", m_Transform = " << m_Xform - << ", Mass = " << Mass - << ')'; - } + std::ostream& implWriteToStream(std::ostream&) const final; CStringView implGetLabel() const final { diff --git a/src/OpenSimCreator/ModelGraph/CommittableModelGraphActions.cpp b/src/OpenSimCreator/ModelGraph/CommittableModelGraphActions.cpp index db7c04f14..c91bce6e5 100644 --- a/src/OpenSimCreator/ModelGraph/CommittableModelGraphActions.cpp +++ b/src/OpenSimCreator/ModelGraph/CommittableModelGraphActions.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/src/OpenSimCreator/ModelGraph/EdgeEl.cpp b/src/OpenSimCreator/ModelGraph/EdgeEl.cpp index 769991acd..79f44b80b 100644 --- a/src/OpenSimCreator/ModelGraph/EdgeEl.cpp +++ b/src/OpenSimCreator/ModelGraph/EdgeEl.cpp @@ -2,12 +2,28 @@ #include #include +#include +#include #include #include #include #include +#include + +osc::SceneElClass osc::EdgeEl::CreateClass() +{ + return SceneElClass + { + "Edge", + "Edges", + "Edge(s)", + ICON_FA_ARROWS_ALT, + "An edge between the centers of two other scene elements", + }; +} + osc::Transform osc::EdgeEl::implGetXform(ISceneElLookup const& lookup) const { SceneEl const* first = lookup.find(m_FirstAttachmentID); @@ -23,6 +39,11 @@ osc::Transform osc::EdgeEl::implGetXform(ISceneElLookup const& lookup) const } } +std::ostream& osc::EdgeEl::implWriteToStream(std::ostream& out) const +{ + return out << "Edge(id = " << m_ID << ", lhs = " << m_FirstAttachmentID << ", rhs = " << m_SecondAttachmentID << ')'; +} + osc::AABB osc::EdgeEl::implCalcBounds(ISceneElLookup const& lookup) const { SceneEl const* first = lookup.find(m_FirstAttachmentID); diff --git a/src/OpenSimCreator/ModelGraph/EdgeEl.hpp b/src/OpenSimCreator/ModelGraph/EdgeEl.hpp index 8c42772b2..775acb0bc 100644 --- a/src/OpenSimCreator/ModelGraph/EdgeEl.hpp +++ b/src/OpenSimCreator/ModelGraph/EdgeEl.hpp @@ -1,16 +1,17 @@ #pragma once #include +#include #include #include -#include #include #include #include #include -#include +#include +#include #include #include @@ -40,17 +41,7 @@ namespace osc } private: friend class SceneElCRTP; - static SceneElClass CreateClass() - { - return SceneElClass - { - "Edge", - "Edges", - "Edge(s)", - ICON_FA_ARROWS_ALT, - "An edge between the centers of two other scene elements", - }; - } + static SceneElClass CreateClass(); std::vector implGetCrossReferences() const final { @@ -89,10 +80,7 @@ namespace osc return m_ID; } - std::ostream& implWriteToStream(std::ostream& out) const final - { - return out << "Edge(id = " << m_ID << ", lhs = " << m_FirstAttachmentID << ", rhs = " << m_SecondAttachmentID << ')'; - } + std::ostream& implWriteToStream(std::ostream&) const final; CStringView implGetLabel() const { diff --git a/src/OpenSimCreator/ModelGraph/GroundEl.cpp b/src/OpenSimCreator/ModelGraph/GroundEl.cpp new file mode 100644 index 000000000..9beeb9aa0 --- /dev/null +++ b/src/OpenSimCreator/ModelGraph/GroundEl.cpp @@ -0,0 +1,38 @@ +#include "GroundEl.hpp" + +#include +#include +#include + +#include +#include +#include + +#include + +osc::SceneElClass osc::GroundEl::CreateClass() +{ + return + { + ModelGraphStrings::c_GroundLabel, + ModelGraphStrings::c_GroundLabelPluralized, + ModelGraphStrings::c_GroundLabelOptionallyPluralized, + ICON_FA_DOT_CIRCLE, + ModelGraphStrings::c_GroundDescription, + }; +} + +osc::UID osc::GroundEl::implGetID() const +{ + return ModelGraphIDs::Ground(); +} + +std::ostream& osc::GroundEl::implWriteToStream(std::ostream& o) const +{ + return o << ModelGraphStrings::c_GroundLabel << "()"; +} + +osc::CStringView osc::GroundEl::implGetLabel() const +{ + return ModelGraphStrings::c_GroundLabel; +} diff --git a/src/OpenSimCreator/ModelGraph/GroundEl.hpp b/src/OpenSimCreator/ModelGraph/GroundEl.hpp index e6f404069..80c1aff62 100644 --- a/src/OpenSimCreator/ModelGraph/GroundEl.hpp +++ b/src/OpenSimCreator/ModelGraph/GroundEl.hpp @@ -2,16 +2,13 @@ #include #include -#include -#include -#include #include #include #include #include -#include +#include namespace osc { @@ -19,37 +16,18 @@ namespace osc class GroundEl final : public SceneElCRTP { private: friend class SceneElCRTP; - static SceneElClass CreateClass() - { - return - { - ModelGraphStrings::c_GroundLabel, - ModelGraphStrings::c_GroundLabelPluralized, - ModelGraphStrings::c_GroundLabelOptionallyPluralized, - ICON_FA_DOT_CIRCLE, - ModelGraphStrings::c_GroundDescription, - }; - } + static SceneElClass CreateClass(); SceneElFlags implGetFlags() const final { return SceneElFlags::None; } - UID implGetID() const final - { - return ModelGraphIDs::Ground(); - } + UID implGetID() const final; - std::ostream& implWriteToStream(std::ostream& o) const final - { - return o << ModelGraphStrings::c_GroundLabel << "()"; - } + std::ostream& implWriteToStream(std::ostream&) const final; - CStringView implGetLabel() const final - { - return ModelGraphStrings::c_GroundLabel; - } + CStringView implGetLabel() const final; Transform implGetXform(ISceneElLookup const&) const final { diff --git a/src/OpenSimCreator/ModelGraph/ISceneElLookup.hpp b/src/OpenSimCreator/ModelGraph/ISceneElLookup.hpp index 069d2a97f..015ab9c79 100644 --- a/src/OpenSimCreator/ModelGraph/ISceneElLookup.hpp +++ b/src/OpenSimCreator/ModelGraph/ISceneElLookup.hpp @@ -2,11 +2,12 @@ #include +namespace osc { class SceneEl; } + namespace osc { // virtual interface to something that can be used to lookup scene elements in // some larger document - class SceneEl; class ISceneElLookup { protected: ISceneElLookup() = default; diff --git a/src/OpenSimCreator/ModelGraph/JointEl.cpp b/src/OpenSimCreator/ModelGraph/JointEl.cpp index d193a59f6..5c6f65c08 100644 --- a/src/OpenSimCreator/ModelGraph/JointEl.cpp +++ b/src/OpenSimCreator/ModelGraph/JointEl.cpp @@ -1,16 +1,22 @@ #include "JointEl.hpp" +#include +#include +#include #include #include #include +#include #include #include #include #include #include +#include #include +#include osc::JointEl::JointEl( UID id, @@ -29,11 +35,43 @@ osc::JointEl::JointEl( { } +osc::SceneElClass osc::JointEl::CreateClass() +{ + return + { + ModelGraphStrings::c_JointLabel, + ModelGraphStrings::c_JointLabelPluralized, + ModelGraphStrings::c_JointLabelOptionallyPluralized, + ICON_FA_LINK, + ModelGraphStrings::c_JointDescription, + }; +} + +std::vector osc::JointEl::implGetCrossReferences() const +{ + return + { + {m_Parent, ModelGraphStrings::c_JointParentCrossrefName, CrossrefDirection::ToParent}, + {m_Child, ModelGraphStrings::c_JointChildCrossrefName, CrossrefDirection::ToChild }, + }; +} + osc::CStringView osc::JointEl::getSpecificTypeName() const { return osc::At(osc::GetComponentRegistry(), m_JointTypeIndex).name(); } +std::ostream& osc::JointEl::implWriteToStream(std::ostream& o) const +{ + return o << "JointEl(ID = " << m_ID + << ", JointTypeIndex = " << m_JointTypeIndex + << ", UserAssignedName = " << m_UserAssignedName + << ", Parent = " << m_Parent + << ", Child = " << m_Child + << ", m_Transform = " << m_Xform + << ')'; +} + void osc::JointEl::implSetLabel(std::string_view sv) { m_UserAssignedName = osc::SanitizeToOpenSimComponentName(sv); diff --git a/src/OpenSimCreator/ModelGraph/JointEl.hpp b/src/OpenSimCreator/ModelGraph/JointEl.hpp index aa1904eb9..2b8d427b5 100644 --- a/src/OpenSimCreator/ModelGraph/JointEl.hpp +++ b/src/OpenSimCreator/ModelGraph/JointEl.hpp @@ -3,17 +3,15 @@ #include #include #include -#include -#include -#include #include #include #include #include #include -#include +#include +#include #include #include #include @@ -31,7 +29,8 @@ namespace osc std::string const& userAssignedName, // can be empty UID parent, UID child, - Transform const& xform); + Transform const& xform + ); CStringView getSpecificTypeName() const; @@ -67,26 +66,9 @@ namespace osc private: friend class SceneElCRTP; - static SceneElClass CreateClass() - { - return - { - ModelGraphStrings::c_JointLabel, - ModelGraphStrings::c_JointLabelPluralized, - ModelGraphStrings::c_JointLabelOptionallyPluralized, - ICON_FA_LINK, - ModelGraphStrings::c_JointDescription, - }; - } + static SceneElClass CreateClass(); - std::vector implGetCrossReferences() const final - { - return - { - {m_Parent, ModelGraphStrings::c_JointParentCrossrefName, CrossrefDirection::ToParent}, - {m_Child, ModelGraphStrings::c_JointChildCrossrefName, CrossrefDirection::ToChild }, - }; - } + std::vector implGetCrossReferences() const final; void implSetCrossReferenceConnecteeID(int i, UID id) final { @@ -117,16 +99,7 @@ namespace osc return m_ID; } - std::ostream& implWriteToStream(std::ostream& o) const final - { - return o << "JointEl(ID = " << m_ID - << ", JointTypeIndex = " << m_JointTypeIndex - << ", UserAssignedName = " << m_UserAssignedName - << ", Parent = " << m_Parent - << ", Child = " << m_Child - << ", m_Transform = " << m_Xform - << ')'; - } + std::ostream& implWriteToStream(std::ostream&) const final; CStringView implGetLabel() const final { diff --git a/src/OpenSimCreator/ModelGraph/MeshEl.cpp b/src/OpenSimCreator/ModelGraph/MeshEl.cpp index a41dc11a1..6e49f2bb1 100644 --- a/src/OpenSimCreator/ModelGraph/MeshEl.cpp +++ b/src/OpenSimCreator/ModelGraph/MeshEl.cpp @@ -1,14 +1,21 @@ #include "MeshEl.hpp" +#include +#include +#include +#include #include +#include #include #include #include #include #include +#include #include +#include osc::MeshEl::MeshEl( UID id, @@ -29,6 +36,38 @@ osc::AABB osc::MeshEl::calcBounds() const return TransformAABB(m_MeshData.getBounds(), m_Transform); } +osc::SceneElClass osc::MeshEl::CreateClass() +{ + return + { + ModelGraphStrings::c_MeshLabel, + ModelGraphStrings::c_MeshLabelPluralized, + ModelGraphStrings::c_MeshLabelOptionallyPluralized, + ICON_FA_CUBE, + ModelGraphStrings::c_MeshDescription, + }; +} + +std::vector osc::MeshEl::implGetCrossReferences() const +{ + return + { + {m_Attachment, ModelGraphStrings::c_MeshAttachmentCrossrefName, CrossrefDirection::ToParent}, + }; +} + +std::ostream& osc::MeshEl::implWriteToStream(std::ostream& o) const +{ + return o << "MeshEl(" + << "ID = " << m_ID + << ", Attachment = " << m_Attachment + << ", m_Transform = " << m_Transform + << ", MeshData = " << &m_MeshData + << ", Path = " << m_Path + << ", Name = " << m_Name + << ')'; +} + void osc::MeshEl::implSetLabel(std::string_view sv) { m_Name = SanitizeToOpenSimComponentName(sv); diff --git a/src/OpenSimCreator/ModelGraph/MeshEl.hpp b/src/OpenSimCreator/ModelGraph/MeshEl.hpp index f03fe335e..3244a6aaf 100644 --- a/src/OpenSimCreator/ModelGraph/MeshEl.hpp +++ b/src/OpenSimCreator/ModelGraph/MeshEl.hpp @@ -1,22 +1,19 @@ #pragma once #include -#include -#include #include #include -#include #include #include #include #include #include -#include +#include #include #include -#include +#include #include namespace osc @@ -74,25 +71,9 @@ namespace osc private: friend class SceneElCRTP; - static SceneElClass CreateClass() - { - return - { - ModelGraphStrings::c_MeshLabel, - ModelGraphStrings::c_MeshLabelPluralized, - ModelGraphStrings::c_MeshLabelOptionallyPluralized, - ICON_FA_CUBE, - ModelGraphStrings::c_MeshDescription, - }; - } + static SceneElClass CreateClass(); - std::vector implGetCrossReferences() const final - { - return - { - {m_Attachment, ModelGraphStrings::c_MeshAttachmentCrossrefName, CrossrefDirection::ToParent}, - }; - } + std::vector implGetCrossReferences() const final; void implSetCrossReferenceConnecteeID(int i, UID id) final { @@ -120,17 +101,7 @@ namespace osc return m_ID; } - std::ostream& implWriteToStream(std::ostream& o) const final - { - return o << "MeshEl(" - << "ID = " << m_ID - << ", Attachment = " << m_Attachment - << ", m_Transform = " << m_Transform - << ", MeshData = " << &m_MeshData - << ", Path = " << m_Path - << ", Name = " << m_Name - << ')'; - } + std::ostream& implWriteToStream(std::ostream&) const final; CStringView implGetLabel() const final { diff --git a/src/OpenSimCreator/ModelGraph/ModelGraph.cpp b/src/OpenSimCreator/ModelGraph/ModelGraph.cpp new file mode 100644 index 000000000..2a057eee4 --- /dev/null +++ b/src/OpenSimCreator/ModelGraph/ModelGraph.cpp @@ -0,0 +1,11 @@ +#include "ModelGraph.hpp" + +#include +#include + +#include + +osc::ModelGraph::ModelGraph() : + m_Els{{ModelGraphIDs::Ground(), ClonePtr{GroundEl{}}}} +{ +} diff --git a/src/OpenSimCreator/ModelGraph/ModelGraph.hpp b/src/OpenSimCreator/ModelGraph/ModelGraph.hpp index a7e9497a1..84845b3c1 100644 --- a/src/OpenSimCreator/ModelGraph/ModelGraph.hpp +++ b/src/OpenSimCreator/ModelGraph/ModelGraph.hpp @@ -1,8 +1,6 @@ #pragma once -#include #include -#include #include #include @@ -136,7 +134,7 @@ namespace osc public: - ModelGraph() = default; + ModelGraph(); template T = SceneEl> T* tryUpdElByID(UID id) @@ -379,7 +377,7 @@ namespace osc // insert a senteniel ground element into the model graph (it should always // be there) - SceneElMap m_Els = {{ModelGraphIDs::Ground(), ClonePtr{GroundEl{}}}}; + SceneElMap m_Els; std::unordered_set m_SelectedEls; std::vector> m_DeletedEls; }; diff --git a/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.cpp b/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.cpp index 4d9c66415..af0553698 100644 --- a/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.cpp +++ b/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.cpp @@ -304,8 +304,10 @@ void osc::PointAxisTowards( osc::SceneDecorationFlags osc::computeFlags( ModelGraph const& mg, UID id, - UID hoverID) + std::optional maybeHoverID) { + UID const hoverID = maybeHoverID ? *maybeHoverID : ModelGraphIDs::Empty(); + if (id == ModelGraphIDs::Empty()) { return SceneDecorationFlags::None; diff --git a/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.hpp b/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.hpp index 57cf5e217..53f94102b 100644 --- a/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.hpp +++ b/src/OpenSimCreator/ModelGraph/ModelGraphHelpers.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include @@ -12,6 +11,7 @@ #include #include +#include #include #include @@ -109,6 +109,6 @@ namespace osc SceneDecorationFlags computeFlags( ModelGraph const&, UID id, - UID hoverID = ModelGraphIDs::Empty() + std::optional maybeHoverID = std::nullopt ); } diff --git a/src/OpenSimCreator/ModelGraph/StationEl.cpp b/src/OpenSimCreator/ModelGraph/StationEl.cpp index 79a9d8104..6a3c52e3e 100644 --- a/src/OpenSimCreator/ModelGraph/StationEl.cpp +++ b/src/OpenSimCreator/ModelGraph/StationEl.cpp @@ -1,12 +1,18 @@ #include "StationEl.hpp" +#include +#include +#include #include +#include #include #include +#include #include #include +#include osc::StationEl::StationEl( UID id, @@ -32,6 +38,36 @@ osc::StationEl::StationEl( { } +osc::SceneElClass osc::StationEl::CreateClass() +{ + return + { + ModelGraphStrings::c_StationLabel, + ModelGraphStrings::c_StationLabelPluralized, + ModelGraphStrings::c_StationLabelOptionallyPluralized, + ICON_FA_MAP_PIN, + ModelGraphStrings::c_StationDescription, + }; +} + +std::vector osc::StationEl::implGetCrossReferences() const +{ + return + { + {m_Attachment, ModelGraphStrings::c_StationParentCrossrefName, CrossrefDirection::ToParent}, + }; +} + +std::ostream& osc::StationEl::implWriteToStream(std::ostream& o) const +{ + return o << "StationEl(" + << "ID = " << m_ID + << ", Attachment = " << m_Attachment + << ", Position = " << m_Position + << ", Name = " << m_Name + << ')'; +} + void osc::StationEl::implSetLabel(std::string_view sv) { m_Name = SanitizeToOpenSimComponentName(sv); diff --git a/src/OpenSimCreator/ModelGraph/StationEl.hpp b/src/OpenSimCreator/ModelGraph/StationEl.hpp index a4361658c..737ff2bdc 100644 --- a/src/OpenSimCreator/ModelGraph/StationEl.hpp +++ b/src/OpenSimCreator/ModelGraph/StationEl.hpp @@ -3,16 +3,13 @@ #include #include #include -#include -#include -#include #include #include #include #include -#include +#include #include #include #include @@ -48,25 +45,9 @@ namespace osc private: friend class SceneElCRTP; - static SceneElClass CreateClass() - { - return - { - ModelGraphStrings::c_StationLabel, - ModelGraphStrings::c_StationLabelPluralized, - ModelGraphStrings::c_StationLabelOptionallyPluralized, - ICON_FA_MAP_PIN, - ModelGraphStrings::c_StationDescription, - }; - } + static SceneElClass CreateClass(); - std::vector implGetCrossReferences() const final - { - return - { - {m_Attachment, ModelGraphStrings::c_StationParentCrossrefName, CrossrefDirection::ToParent}, - }; - } + std::vector implGetCrossReferences() const final; void implSetCrossReferenceConnecteeID(int i, UID id) final { @@ -91,15 +72,7 @@ namespace osc return m_ID; } - std::ostream& implWriteToStream(std::ostream& o) const final - { - return o << "StationEl(" - << "ID = " << m_ID - << ", Attachment = " << m_Attachment - << ", Position = " << m_Position - << ", Name = " << m_Name - << ')'; - } + std::ostream& implWriteToStream(std::ostream&) const final; CStringView implGetLabel() const final {