From 1e49ab9cbce1ff9ffed385087d86293139f164a2 Mon Sep 17 00:00:00 2001 From: Nicholas Sharp Date: Mon, 30 Dec 2024 01:45:03 -0500 Subject: [PATCH] add navigation style test --- test/src/basics_test.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/src/basics_test.cpp b/test/src/basics_test.cpp index a8e7296a..fc39eae3 100644 --- a/test/src/basics_test.cpp +++ b/test/src/basics_test.cpp @@ -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"); } @@ -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 // ============================================================