diff --git a/applications/Mapple/paint_canvas.cpp b/applications/Mapple/paint_canvas.cpp index 7261917f..c7e59a2d 100644 --- a/applications/Mapple/paint_canvas.cpp +++ b/applications/Mapple/paint_canvas.cpp @@ -1878,6 +1878,18 @@ void PaintCanvas::showCoordinatesUnderMouse(bool b) { void PaintCanvas::draw() { + // To have split views of different rendering styles for the same object/scene. + //glEnable(GL_SCISSOR_TEST); + //int scissor[4]; + //glGetIntegerv(GL_SCISSOR_BOX, scissor); + //glScissor(scissor[0], scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(false); + //Viewer::draw(); + //glScissor(scissor[2] * 0.5f, scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(true); + //Viewer::draw(); + //glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); + if (models_.empty()) return; diff --git a/easy3d/viewer/viewer.cpp b/easy3d/viewer/viewer.cpp index 638f464a..c745390c 100644 --- a/easy3d/viewer/viewer.cpp +++ b/easy3d/viewer/viewer.cpp @@ -1729,16 +1729,17 @@ namespace easy3d { void Viewer::draw() const { -// glEnable(GL_SCISSOR_TEST); -// int scissor[4]; -// glGetIntegerv(GL_SCISSOR_BOX, scissor); -// glScissor(scissor[0], scissor[1], scissor[2] * 0.5f, scissor[3]); -// current_model()->renderer()->get_lines_drawable("edges")->set_visible(false); -// draw(); -// glScissor(scissor[2] * 0.5f, scissor[1], scissor[2] * 0.5f, scissor[3]); -// current_model()->renderer()->get_lines_drawable("edges")->set_visible(true); -// draw(); -// glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); + // To have split views of different rendering styles for the same object/scene. + //glEnable(GL_SCISSOR_TEST); + //int scissor[4]; + //glGetIntegerv(GL_SCISSOR_BOX, scissor); + //glScissor(scissor[0], scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(false); + //Viewer::draw(); + //glScissor(scissor[2] * 0.5f, scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(true); + //Viewer::draw(); + //glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); for (const auto m : models_) { if (!m->renderer()->is_visible()) diff --git a/tutorials/Tutorial_203_Viewer_wxWidgets/viewer.cpp b/tutorials/Tutorial_203_Viewer_wxWidgets/viewer.cpp index c5752cb5..01986d8c 100644 --- a/tutorials/Tutorial_203_Viewer_wxWidgets/viewer.cpp +++ b/tutorials/Tutorial_203_Viewer_wxWidgets/viewer.cpp @@ -789,6 +789,18 @@ namespace easy3d { void Viewer::draw() const { + // To have split views of different rendering styles for the same object/scene. + //glEnable(GL_SCISSOR_TEST); + //int scissor[4]; + //glGetIntegerv(GL_SCISSOR_BOX, scissor); + //glScissor(scissor[0], scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(false); + //Viewer::draw(); + //glScissor(scissor[2] * 0.5f, scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(true); + //Viewer::draw(); + //glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); + for (const auto m : models_) { if (!m->renderer()->is_visible()) continue; diff --git a/tutorials/Tutorial_204_Viewer_Qt/viewer.cpp b/tutorials/Tutorial_204_Viewer_Qt/viewer.cpp index 939afffc..c8305241 100644 --- a/tutorials/Tutorial_204_Viewer_Qt/viewer.cpp +++ b/tutorials/Tutorial_204_Viewer_Qt/viewer.cpp @@ -984,6 +984,18 @@ namespace easy3d { void Viewer::draw() { + // To have split views of different rendering styles for the same object/scene. + //glEnable(GL_SCISSOR_TEST); + //int scissor[4]; + //glGetIntegerv(GL_SCISSOR_BOX, scissor); + //glScissor(scissor[0], scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(false); + //Viewer::draw(); + //glScissor(scissor[2] * 0.5f, scissor[1], scissor[2] * 0.5f, scissor[3]); + //current_model()->renderer()->get_lines_drawable("edges")->set_visible(true); + //Viewer::draw(); + //glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); + easy3d_debug_log_gl_error for (const auto m: models_) { diff --git a/tutorials/Tutorial_307_CrossSection/CMakeLists.txt b/tutorials/Tutorial_307_CrossSection/CMakeLists.txt index ddb716c6..7380da95 100644 --- a/tutorials/Tutorial_307_CrossSection/CMakeLists.txt +++ b/tutorials/Tutorial_307_CrossSection/CMakeLists.txt @@ -1,5 +1,5 @@ get_filename_component(example ${CMAKE_CURRENT_SOURCE_DIR} NAME) -set(dependencies 3rd_imgui easy3d::core easy3d::renderer easy3d::viewer easy3d::util) +set(dependencies easy3d::core easy3d::renderer easy3d::viewer easy3d::util) set(${example}_files main.cpp