Skip to content

Commit

Permalink
add navigation style test
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Dec 30, 2024
1 parent d3518e8 commit 1e49ab9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/src/basics_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ TEST_F(PolyscopeTest, WindowProperties) {
// resizable
polyscope::view::setWindowResizable(false);
EXPECT_FALSE(polyscope::view::getWindowResizable());

polyscope::show(3);
}

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

// ============================================================
// =============== View and navigation
// ============================================================

TEST_F(PolyscopeTest, NavigationMode) {

// Cycle through the navigation options

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Turntable);
polyscope::show(3);

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Free);
polyscope::show(3);

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Planar);
polyscope::show(3);

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Arcball);
polyscope::show(3);

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::None);
polyscope::show(3);

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::FirstPerson);
polyscope::show(3);

polyscope::view::setNavigateStyle(polyscope::NavigateStyle::Turntable); // set back to usual default
}


// ============================================================
// =============== Ground plane tests
// ============================================================
Expand Down

0 comments on commit 1e49ab9

Please sign in to comment.