Skip to content

Commit 1e49ab9

Browse files
committed
add navigation style test
1 parent d3518e8 commit 1e49ab9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/src/basics_test.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ TEST_F(PolyscopeTest, WindowProperties) {
126126
// resizable
127127
polyscope::view::setWindowResizable(false);
128128
EXPECT_FALSE(polyscope::view::getWindowResizable());
129+
130+
polyscope::show(3);
129131
}
130132

131133
TEST_F(PolyscopeTest, Screenshot) { polyscope::screenshot("test_screeshot.png"); }
@@ -138,6 +140,36 @@ TEST_F(PolyscopeTest, ScreenshotBuffer) {
138140
EXPECT_EQ(buff2.size(), polyscope::view::bufferWidth * polyscope::view::bufferHeight * 4);
139141
}
140142

143+
// ============================================================
144+
// =============== View and navigation
145+
// ============================================================
146+
147+
TEST_F(PolyscopeTest, NavigationMode) {
148+
149+
// Cycle through the navigation options
150+
151+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Turntable);
152+
polyscope::show(3);
153+
154+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Free);
155+
polyscope::show(3);
156+
157+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Planar);
158+
polyscope::show(3);
159+
160+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Arcball);
161+
polyscope::show(3);
162+
163+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::None);
164+
polyscope::show(3);
165+
166+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::FirstPerson);
167+
polyscope::show(3);
168+
169+
polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Turntable); // set back to usual default
170+
}
171+
172+
141173
// ============================================================
142174
// =============== Ground plane tests
143175
// ============================================================

0 commit comments

Comments
 (0)