Skip to content

Commit 4770e65

Browse files
committed
move view enums to top level namespace
1 parent e2bc747 commit 4770e65

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

include/polyscope/types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace polyscope {
77

8+
enum class NavigateStyle { Turntable = 0, Free, Planar, Arcball };
9+
enum class UpDir { XUp = 0, YUp, ZUp, NegXUp, NegYUp, NegZUp};
810
enum class BackgroundView { None = 0 };
911
enum class ProjectionMode { Perspective = 0, Orthographic };
1012
enum class TransparencyMode { None = 0, Simple, Pretty };

include/polyscope/view.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@
2323
namespace polyscope {
2424
namespace view {
2525

26-
enum class NavigateStyle { Turntable = 0, Free, Planar, Arcball };
27-
enum class UpDir { XUp = 0, YUp, ZUp, NegXUp, NegYUp, NegZUp};
26+
// Previously, these enums were defined here in the `view` namespace, but now for consistency we define all enums in the
27+
// top-level `polyscope` namespace. For backwards compatability, we import the enums so existing code like
28+
// polyscope::view::NavigateStyle::Planar still works.
29+
using polyscope::NavigateStyle;
30+
using polyscope::UpDir;
2831

2932
// === View state
3033
extern int bufferWidth;
@@ -109,7 +112,7 @@ void updateFlight(); // Note: uses wall-clock time, so should generally be calle
109112

110113

111114
// Setters, getters, etc
112-
void setUpDir(UpDir newUpDir, bool animateFlight=false);
115+
void setUpDir(UpDir newUpDir, bool animateFlight = false);
113116
UpDir getUpDir();
114117
glm::vec3 getUpVec();
115118

0 commit comments

Comments
 (0)