Skip to content

Commit

Permalink
Refactor ModelGraph -> OpenSim::Model code into ModelGraphOpenSimBrid…
Browse files Browse the repository at this point in the history
…ge hpp+cpp files (#802)
  • Loading branch information
adamkewley committed Nov 16, 2023
1 parent d04a9d5 commit 530330d
Show file tree
Hide file tree
Showing 5 changed files with 853 additions and 776 deletions.
3 changes: 3 additions & 0 deletions src/OpenSimCreator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ add_library(OpenSimCreator STATIC
ModelGraph/JointEl.hpp
ModelGraph/MeshEl.cpp
ModelGraph/MeshEl.hpp
ModelGraph/ModelCreationFlags.hpp
ModelGraph/ModelGraph.hpp
ModelGraph/ModelGraphHelpers.cpp
ModelGraph/ModelGraphHelpers.hpp
ModelGraph/ModelGraphIDs.cpp
ModelGraph/ModelGraphIDs.hpp
ModelGraph/ModelGraphOpenSimBridge.cpp
ModelGraph/ModelGraphOpenSimBridge.hpp
ModelGraph/ModelGraphStrings.hpp
ModelGraph/SceneEl.cpp
ModelGraph/SceneEl.hpp
Expand Down
27 changes: 27 additions & 0 deletions src/OpenSimCreator/ModelGraph/ModelCreationFlags.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include <oscar/Shims/Cpp23/utility.hpp>

namespace osc
{
// user-editable flags that affect how the model is created from the model graph
enum class ModelCreationFlags {
None,
ExportStationsAsMarkers,
};

constexpr bool operator&(ModelCreationFlags const& lhs, ModelCreationFlags const& rhs)
{
return (osc::to_underlying(lhs) & osc::to_underlying(rhs)) != 0;
}

constexpr ModelCreationFlags operator+(ModelCreationFlags const& lhs, ModelCreationFlags const& rhs)
{
return static_cast<ModelCreationFlags>(osc::to_underlying(lhs) | osc::to_underlying(rhs));
}

constexpr ModelCreationFlags operator-(ModelCreationFlags const& lhs, ModelCreationFlags const& rhs)
{
return static_cast<ModelCreationFlags>(osc::to_underlying(lhs) & ~osc::to_underlying(rhs));
}
}
Loading

0 comments on commit 530330d

Please sign in to comment.