From 8cb5010d6feaff7cc62e56ebd4c959265b3a41a9 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 9 Jan 2025 01:13:42 +0000 Subject: [PATCH] [clang-format] Committing clang-format changes --- .../render/910-viewer-imgui/CMakeLists.txt | 2 +- examples/render/910-viewer-imgui/main.cpp | 12 ++--- examples/render/common/get_drawable_mesh.h | 3 +- vclib/render/3rdparty/imgui.cmake | 2 +- .../vclib/bgfx_imgui/imgui_impl_bgfx.h | 6 +-- .../vclib/glfw_imgui/viewer_window_imgui.h | 22 ++++---- vclib/render/src/vclib/glfw/viewer_window.cpp | 4 +- .../vclib/glfw_imgui/viewer_window_imgui.cpp | 54 +++++++++---------- 8 files changed, 50 insertions(+), 55 deletions(-) diff --git a/examples/render/910-viewer-imgui/CMakeLists.txt b/examples/render/910-viewer-imgui/CMakeLists.txt index 38cdb6bc5..c37ec0dde 100644 --- a/examples/render/910-viewer-imgui/CMakeLists.txt +++ b/examples/render/910-viewer-imgui/CMakeLists.txt @@ -2,7 +2,7 @@ #* VCLib * #* Visual Computing Library * #* * -#* Copyright(C) 2021-2024 * +#* Copyright(C) 2021-2025 * #* Visual Computing Lab * #* ISTI - Italian National Research Council * #* * diff --git a/examples/render/910-viewer-imgui/main.cpp b/examples/render/910-viewer-imgui/main.cpp index 43427d35d..f794fa863 100644 --- a/examples/render/910-viewer-imgui/main.cpp +++ b/examples/render/910-viewer-imgui/main.cpp @@ -2,28 +2,28 @@ * VCLib * * Visual Computing Library * * * - * Copyright(C) 2021-2024 * + * Copyright(C) 2021-2025 * * Visual Computing Lab * * ISTI - Italian National Research Council * * * * All rights reserved. * * * * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * + * it under the terms of the Mozilla Public License Version 2.0 as published * + * by the Mozilla Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * for more details. * + * Mozilla Public License Version 2.0 * + * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * ****************************************************************************/ #include "get_drawable_mesh.h" -#include #include +#include class ImguiDemo : public vcl::glfw::ViewerWindowImgui { diff --git a/examples/render/common/get_drawable_mesh.h b/examples/render/common/get_drawable_mesh.h index d8dca4991..51b597cf6 100644 --- a/examples/render/common/get_drawable_mesh.h +++ b/examples/render/common/get_drawable_mesh.h @@ -35,8 +35,7 @@ inline vcl::DrawableMesh getDrawableMesh( const std::string& filename = "bimba.obj") { // load a mesh: - MeshType m = - vcl::load(VCLIB_EXAMPLE_MESHES_PATH "/" + filename); + MeshType m = vcl::load(VCLIB_EXAMPLE_MESHES_PATH "/" + filename); vcl::updatePerVertexAndFaceNormals(m); // enable the vertex color of the mesh and set it to gray diff --git a/vclib/render/3rdparty/imgui.cmake b/vclib/render/3rdparty/imgui.cmake index 3cd1e1286..b67c43a95 100644 --- a/vclib/render/3rdparty/imgui.cmake +++ b/vclib/render/3rdparty/imgui.cmake @@ -2,7 +2,7 @@ #* VCLib * #* Visual Computing Library * #* * -#* Copyright(C) 2021-2024 * +#* Copyright(C) 2021-2025 * #* Visual Computing Lab * #* ISTI - Italian National Research Council * #* * diff --git a/vclib/render/include/vclib/bgfx_imgui/imgui_impl_bgfx.h b/vclib/render/include/vclib/bgfx_imgui/imgui_impl_bgfx.h index 4b74809fd..30c2711d5 100644 --- a/vclib/render/include/vclib/bgfx_imgui/imgui_impl_bgfx.h +++ b/vclib/render/include/vclib/bgfx_imgui/imgui_impl_bgfx.h @@ -3,8 +3,8 @@ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ -#ifndef IMGUI_IMPL_BGFX_H -#define IMGUI_IMPL_BGFX_H +#ifndef VCL_BGFX_IMGUI_IMGUI_IMPL_BGFX_H +#define VCL_BGFX_IMGUI_IMGUI_IMPL_BGFX_H #include #include @@ -137,4 +137,4 @@ namespace ImGui } // namespace ImGui -#endif // IMGUI_IMPL_BGFX_H +#endif // VCL_BGFX_IMGUI_IMGUI_IMPL_BGFX_H diff --git a/vclib/render/include/vclib/glfw_imgui/viewer_window_imgui.h b/vclib/render/include/vclib/glfw_imgui/viewer_window_imgui.h index 52987dc2f..68b7c079b 100644 --- a/vclib/render/include/vclib/glfw_imgui/viewer_window_imgui.h +++ b/vclib/render/include/vclib/glfw_imgui/viewer_window_imgui.h @@ -2,7 +2,7 @@ * VCLib * * Visual Computing Library * * * - * Copyright(C) 2021-2024 * + * Copyright(C) 2021-2025 * * Visual Computing Lab * * ISTI - Italian National Research Council * * * @@ -20,8 +20,8 @@ * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * ****************************************************************************/ -#ifndef VCL_EXT_GLFW_VIEWER_WINDOW_IMGUI_H -#define VCL_EXT_GLFW_VIEWER_WINDOW_IMGUI_H +#ifndef VCL_GLFW_IMGUI_VIEWER_WINDOW_IMGUI_H +#define VCL_GLFW_IMGUI_VIEWER_WINDOW_IMGUI_H #include @@ -56,10 +56,10 @@ class ViewerWindowImgui : public ViewerWindow // callback override to handle imgui events void glfwKeyCallback( GLFWwindow* win, - int key, - int scancode, - int action, - int mods) override; + int key, + int scancode, + int action, + int mods) override; void glfwMouseButtonCallback( GLFWwindow* win, @@ -69,12 +69,10 @@ class ViewerWindowImgui : public ViewerWindow void glfwCursorPosCallback(GLFWwindow*, double xpos, double ypos) override; - void glfwScrollCallback( - GLFWwindow* win, - double xoffset, - double yoffset) override; + void glfwScrollCallback(GLFWwindow* win, double xoffset, double yoffset) + override; }; } // namespace vcl::glfw -#endif // VCL_EXT_GLFW_VIEWER_WINDOW_H +#endif // VCL_GLFW_IMGUI_VIEWER_WINDOW_IMGUI_H diff --git a/vclib/render/src/vclib/glfw/viewer_window.cpp b/vclib/render/src/vclib/glfw/viewer_window.cpp index 9e4a5fdd1..3869ff706 100644 --- a/vclib/render/src/vclib/glfw/viewer_window.cpp +++ b/vclib/render/src/vclib/glfw/viewer_window.cpp @@ -93,9 +93,9 @@ void ViewerWindow::onResize(unsigned int width, unsigned int height) { ViewerCanvas::onResize(width, height); frame(); - #ifdef VCLIB_RENDER_BACKEND_OPENGL2 +#ifdef VCLIB_RENDER_BACKEND_OPENGL2 glfwSwapBuffers(mWindow); - #endif +#endif } } // namespace vcl::glfw diff --git a/vclib/render/src/vclib/glfw_imgui/viewer_window_imgui.cpp b/vclib/render/src/vclib/glfw_imgui/viewer_window_imgui.cpp index 7f549a4d2..161a6c98b 100644 --- a/vclib/render/src/vclib/glfw_imgui/viewer_window_imgui.cpp +++ b/vclib/render/src/vclib/glfw_imgui/viewer_window_imgui.cpp @@ -2,7 +2,7 @@ * VCLib * * Visual Computing Library * * * - * Copyright(C) 2021-2024 * + * Copyright(C) 2021-2025 * * Visual Computing Lab * * ISTI - Italian National Research Council * * * @@ -20,7 +20,6 @@ * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * ****************************************************************************/ - #ifdef VCLIB_RENDER_BACKEND_OPENGL2 #include #elif defined(VCLIB_RENDER_BACKEND_BGFX) @@ -36,8 +35,7 @@ ViewerWindowImgui::ViewerWindowImgui( const std::string& windowTitle, uint width, uint height, - void*) : - ViewerWindow(v, windowTitle, width, height) + void*) : ViewerWindow(v, windowTitle, width, height) { } @@ -45,13 +43,11 @@ ViewerWindowImgui::ViewerWindowImgui( const std::string& windowTitle, uint width, uint height, - void*) : - vcl::glfw::ViewerWindow(windowTitle, width, height) + void*) : vcl::glfw::ViewerWindow(windowTitle, width, height) { } -ViewerWindowImgui::ViewerWindowImgui(void* parent) : - ViewerWindow(parent) +ViewerWindowImgui::ViewerWindowImgui(void* parent) : ViewerWindow(parent) { } @@ -82,8 +78,7 @@ void ViewerWindowImgui::show() while (!glfwWindowShouldClose(mWindow)) { glfwPollEvents(); // slow down rendering if window is minimized - if (glfwGetWindowAttrib(mWindow, GLFW_ICONIFIED) != 0) - { + if (glfwGetWindowAttrib(mWindow, GLFW_ICONIFIED) != 0) { ImGui_ImplGlfw_Sleep(10); continue; } @@ -133,30 +128,33 @@ using Base = ViewerWindow; void ViewerWindowImgui::glfwKeyCallback( GLFWwindow* win, - int key, - int scancode, - int action, - int mods) - { - const auto & io = ImGui::GetIO(); - if (!io.WantCaptureKeyboard) - Base::glfwKeyCallback(win, key, scancode, action, mods); - } + int key, + int scancode, + int action, + int mods) +{ + const auto& io = ImGui::GetIO(); + if (!io.WantCaptureKeyboard) + Base::glfwKeyCallback(win, key, scancode, action, mods); +} void ViewerWindowImgui::glfwMouseButtonCallback( GLFWwindow* win, int button, int action, int mods) - { - const auto & io = ImGui::GetIO(); - if (!io.WantCaptureMouse) - Base::glfwMouseButtonCallback(win, button, action, mods); - } +{ + const auto& io = ImGui::GetIO(); + if (!io.WantCaptureMouse) + Base::glfwMouseButtonCallback(win, button, action, mods); +} -void ViewerWindowImgui::glfwCursorPosCallback(GLFWwindow*, double xpos, double ypos) +void ViewerWindowImgui::glfwCursorPosCallback( + GLFWwindow*, + double xpos, + double ypos) { - const auto & io = ImGui::GetIO(); + const auto& io = ImGui::GetIO(); if (!io.WantCaptureMouse) Base::glfwCursorPosCallback(nullptr, xpos, ypos); } @@ -165,8 +163,8 @@ void ViewerWindowImgui::glfwScrollCallback( GLFWwindow*, double xoffset, double yoffset) -{ - const auto & io = ImGui::GetIO(); +{ + const auto& io = ImGui::GetIO(); if (!io.WantCaptureMouse) Base::glfwScrollCallback(nullptr, xoffset, yoffset); }