Fix wrong order of path type enum, and make it enum class

This commit is contained in:
Emma Broman
2022-03-22 11:15:20 +01:00
parent 3844df20c9
commit 2f29fcd9e2
2 changed files with 8 additions and 9 deletions

View File

@@ -39,10 +39,10 @@ namespace openspace::interaction {
class Path {
public:
enum Type {
AvoidCollision,
Linear,
enum class Type {
AvoidCollision = 0,
ZoomOutOverview,
Linear,
AvoidCollisionWithLookAt // @TODO (2021-08-13, emmbr) This type right now leads
// to rapid rotations, but is useful in specific
// scenarios, e.g. close to surfaces. Later we want to

View File

@@ -123,10 +123,10 @@ PathNavigator::PathNavigator()
, _relevantNodeTags(RelevantNodeTagsInfo)
{
_defaultPathType.addOptions({
{ Path::Type::AvoidCollision, "AvoidCollision" },
{ Path::Type::ZoomOutOverview, "ZoomOutOverview"},
{ Path::Type::Linear, "Linear" },
{ Path::Type::AvoidCollisionWithLookAt, "AvoidCollisionWithLookAt"}
{ static_cast<int>(Path::Type::AvoidCollision), "AvoidCollision" },
{ static_cast<int>(Path::Type::ZoomOutOverview), "ZoomOutOverview" },
{ static_cast<int>(Path::Type::Linear), "Linear" },
{ static_cast<int>(Path::Type::AvoidCollisionWithLookAt), "AvoidCollisionWithLookAt"}
});
addProperty(_defaultPathType);
@@ -343,8 +343,7 @@ void PathNavigator::continuePath() {
}
Path::Type PathNavigator::defaultPathType() const {
const int pathType = _defaultPathType;
return Path::Type(pathType);
return static_cast<Path::Type>(_defaultPathType.value());
}
double PathNavigator::minValidBoundingSphere() const {