From 0db3faabe998b4cf61e0d588b5c23c7c43493522 Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Tue, 14 Sep 2021 12:58:03 +0200
Subject: [PATCH] [#96] Added doxygen comments to define modules as groups

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 .../include/vkcv/asset/asset_loader.hpp       |  8 +++
 modules/camera/include/vkcv/camera/Camera.hpp |  8 +++
 .../include/vkcv/camera/CameraController.hpp  |  7 ++
 .../include/vkcv/camera/CameraManager.hpp     |  8 +++
 .../vkcv/camera/PilotCameraController.hpp     |  7 ++
 .../vkcv/camera/TrackballCameraController.hpp |  7 ++
 modules/gui/include/vkcv/gui/GUI.hpp          | 64 ++++++++++++++++---
 .../include/vkcv/material/Material.hpp        | 19 +++++-
 .../meshlet/include/vkcv/meshlet/Forsyth.hpp  | 31 +++++----
 .../meshlet/include/vkcv/meshlet/Meshlet.hpp  |  8 +++
 .../meshlet/include/vkcv/meshlet/Tipsify.hpp  |  9 +++
 modules/scene/include/vkcv/scene/Bounds.hpp   |  7 ++
 modules/scene/include/vkcv/scene/Frustum.hpp  |  7 ++
 modules/scene/include/vkcv/scene/Mesh.hpp     |  7 ++
 modules/scene/include/vkcv/scene/MeshPart.hpp |  7 ++
 modules/scene/include/vkcv/scene/Node.hpp     |  7 ++
 modules/scene/include/vkcv/scene/Scene.hpp    |  8 +++
 .../include/vkcv/shader/Compiler.hpp          |  8 +++
 .../include/vkcv/shader/GLSLCompiler.hpp      |  7 ++
 .../vkcv/upscaling/BilinearUpscaling.hpp      |  7 ++
 .../include/vkcv/upscaling/FSRUpscaling.hpp   |  7 ++
 .../include/vkcv/upscaling/Upscaling.hpp      |  8 +++
 22 files changed, 234 insertions(+), 22 deletions(-)

diff --git a/modules/asset_loader/include/vkcv/asset/asset_loader.hpp b/modules/asset_loader/include/vkcv/asset/asset_loader.hpp
index 25d7d5b3..2362e560 100644
--- a/modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+++ b/modules/asset_loader/include/vkcv/asset/asset_loader.hpp
@@ -36,6 +36,12 @@
 
 namespace vkcv::asset {
 
+/**
+ * @defgroup vkcv_asset Asset Loader Module
+ * A module to load assets like scenes, meshes and textures.
+ * @{
+ */
+
 /**
  * These return codes are limited to the asset loader module. If unified return
  * codes are defined for the vkcv framework, these will be used instead.
@@ -321,4 +327,6 @@ int loadScene(const std::filesystem::path &path, Scene &scene);
  */
 Texture loadTexture(const std::filesystem::path& path);
 
+/** @} */
+
 }	// end namespace vkcv::asset
diff --git a/modules/camera/include/vkcv/camera/Camera.hpp b/modules/camera/include/vkcv/camera/Camera.hpp
index 8a8c5df5..44851c10 100644
--- a/modules/camera/include/vkcv/camera/Camera.hpp
+++ b/modules/camera/include/vkcv/camera/Camera.hpp
@@ -8,6 +8,12 @@
 
 namespace vkcv::camera {
 
+    /**
+     * @defgroup vkcv_camera Camera Module
+     * A module to manage intrinsic and extrinsic parameters with camera instances.
+     * @{
+     */
+
     /**
      * @brief Used to create a camera which governs the view and projection matrices.
      */
@@ -207,4 +213,6 @@ namespace vkcv::camera {
         void setUp(const glm::vec3 &up);
     };
 
+    /** @} */
+
 }
diff --git a/modules/camera/include/vkcv/camera/CameraController.hpp b/modules/camera/include/vkcv/camera/CameraController.hpp
index 90fc9740..6d4d0209 100644
--- a/modules/camera/include/vkcv/camera/CameraController.hpp
+++ b/modules/camera/include/vkcv/camera/CameraController.hpp
@@ -5,6 +5,11 @@
 
 namespace vkcv::camera {
 
+    /**
+     * @addtogroup vkcv_camera
+     * @{
+     */
+
     /**
      * @brief Used as a base class for defining camera controller classes with different behaviors, e.g. the
      * #PilotCameraController.
@@ -69,4 +74,6 @@ namespace vkcv::camera {
         virtual void gamepadCallback(int gamepadIndex, Camera &camera, double frametime) = 0;
     };
 
+    /** @} */
+
 }
\ No newline at end of file
diff --git a/modules/camera/include/vkcv/camera/CameraManager.hpp b/modules/camera/include/vkcv/camera/CameraManager.hpp
index 409f9196..9591aa35 100644
--- a/modules/camera/include/vkcv/camera/CameraManager.hpp
+++ b/modules/camera/include/vkcv/camera/CameraManager.hpp
@@ -9,6 +9,11 @@
 
 namespace vkcv::camera {
 
+    /**
+     * @addtogroup vkcv_camera
+     * @{
+     */
+
     /**
      * @brief Used for specifying existing types of camera controllers when adding a new controller object to the
      * #CameraManager.
@@ -192,4 +197,7 @@ namespace vkcv::camera {
          */
         void update(double deltaTime);
     };
+
+    /** @} */
+
 }
diff --git a/modules/camera/include/vkcv/camera/PilotCameraController.hpp b/modules/camera/include/vkcv/camera/PilotCameraController.hpp
index 67388818..0596b776 100644
--- a/modules/camera/include/vkcv/camera/PilotCameraController.hpp
+++ b/modules/camera/include/vkcv/camera/PilotCameraController.hpp
@@ -4,6 +4,11 @@
 
 namespace vkcv::camera {
 
+    /**
+     * @addtogroup vkcv_camera
+     * @{
+     */
+
     /**
      * @brief Used to move around a camera object in world space.
      */
@@ -111,4 +116,6 @@ namespace vkcv::camera {
         void gamepadCallback(int gamepadIndex, Camera &camera, double frametime);
     };
 
+    /** @} */
+
 }
\ No newline at end of file
diff --git a/modules/camera/include/vkcv/camera/TrackballCameraController.hpp b/modules/camera/include/vkcv/camera/TrackballCameraController.hpp
index 20336f7a..13f7fefa 100644
--- a/modules/camera/include/vkcv/camera/TrackballCameraController.hpp
+++ b/modules/camera/include/vkcv/camera/TrackballCameraController.hpp
@@ -4,6 +4,11 @@
 
 namespace vkcv::camera {
 
+    /**
+     * @addtogroup vkcv_camera
+     * @{
+     */
+
     /**
      * @brief Used to orbit a camera around its center point.
      */
@@ -106,4 +111,6 @@ namespace vkcv::camera {
         void gamepadCallback(int gamepadIndex, Camera &camera, double frametime);
     };
 
+    /** @} */
+
 }
\ No newline at end of file
diff --git a/modules/gui/include/vkcv/gui/GUI.hpp b/modules/gui/include/vkcv/gui/GUI.hpp
index 8826cdba..9a85e641 100644
--- a/modules/gui/include/vkcv/gui/GUI.hpp
+++ b/modules/gui/include/vkcv/gui/GUI.hpp
@@ -9,29 +9,73 @@
 
 namespace vkcv::gui {
 
+    /**
+     * @defgroup vkcv_gui GUI Module
+     * A module to manage ImGUI integration for VkCV applications.
+     * @{
+     */
+
+    /**
+     * Class to manage ImGui integration for VkCV.
+     */
 	class GUI final {
 	private:
+        /**
+         * Window handle of the currently used window to draw user interface on.
+         */
 		WindowHandle m_windowHandle;
+
+        /**
+         * Reference to the current Core instance.
+         */
 		Core& m_core;
-		
+
+        /**
+         * Reference to the current Context instance.
+         */
 		const Context& m_context;
-		
+
+        /**
+         * ImGui context for drawing GUI.
+         */
 		ImGuiContext* m_gui_context;
-		
+
+        /**
+         * Vulkan handle for the ImGui descriptor pool.
+         */
 		vk::DescriptorPool m_descriptor_pool;
+
+        /**
+         * Vulkan handle for the ImGui render pass.
+         */
 		vk::RenderPass m_render_pass;
-		
+
+        /**
+         * Event handle for pressing a mouse button.
+         */
 		event_handle<int,int,int> f_mouseButton;
+
+        /**
+         * Event handle for scrolling with the mouse or touchpad.
+         */
 		event_handle<double,double> f_mouseScroll;
+
+        /**
+         * Event handle for pressing a key.
+         */
 		event_handle<int,int,int,int> f_key;
+
+        /**
+         * Event handle for typing a character.
+         */
 		event_handle<unsigned int> f_char;
 		
 	public:
 		/**
-		 * Constructor of a new instance of ImGui management
+		 * Constructor of a new instance for ImGui management.
 		 *
-		 * @param core Valid #Core instance of the framework
-		 * @param window Valid #Window instance of the framework
+		 * @param[in,out] core Valid Core instance of the framework
+		 * @param[in,out] window Valid Window instance of the framework
 		 */
 		GUI(Core& core, WindowHandle& windowHandle);
 		
@@ -42,12 +86,12 @@ namespace vkcv::gui {
 		GUI& operator=(GUI&& other) = delete;
 		
 		/**
-		 * Destructor of a #GUI instance
+		 * Destructor of a GUI instance.
 		 */
 		virtual ~GUI();
 		
 		/**
-		 * Sets up a new frame for ImGui to draw
+		 * Sets up a new frame for ImGui to draw.
 		 */
 		void beginGUI();
 		
@@ -59,4 +103,6 @@ namespace vkcv::gui {
 		
 	};
 
+    /** @} */
+
 }
diff --git a/modules/material/include/vkcv/material/Material.hpp b/modules/material/include/vkcv/material/Material.hpp
index 41ee8aec..f03bd13f 100644
--- a/modules/material/include/vkcv/material/Material.hpp
+++ b/modules/material/include/vkcv/material/Material.hpp
@@ -6,13 +6,26 @@
 #include <vkcv/Handles.hpp>
 
 namespace vkcv::material {
-	
+
+    /**
+     * @defgroup vkcv_material Material Module
+     * A module to manage standardized materials for rendering.
+     * @{
+     */
+
+    /**
+     * Enum to handle standardized material types.
+     */
 	enum class MaterialType {
 		PBR_MATERIAL = 1,
 		
 		UNKNOWN = 0
 	};
-	
+
+    /**
+     * Class to manage required handles for materials using
+     * a wide range of textures with separate samplers and factors.
+     */
 	class Material {
 	private:
 		struct Texture {
@@ -70,5 +83,7 @@ namespace vkcv::material {
 								  const float emissiveFactor [3]);
 	
 	};
+
+    /** @} */
 	
 }
diff --git a/modules/meshlet/include/vkcv/meshlet/Forsyth.hpp b/modules/meshlet/include/vkcv/meshlet/Forsyth.hpp
index 43dc9a3b..90625bd4 100644
--- a/modules/meshlet/include/vkcv/meshlet/Forsyth.hpp
+++ b/modules/meshlet/include/vkcv/meshlet/Forsyth.hpp
@@ -4,15 +4,24 @@
 
 namespace vkcv::meshlet
 {
- /**
-  * Reorders the index buffer, simulating a LRU cache, so that vertices are grouped together in close triangle patches
-  * @param idxBuf current IndexBuffer
-  * @param vertexCount of the mesh
-  * @return new reordered index buffer to replace the input index buffer
-  * References:
-  * https://tomforsyth1000.github.io/papers/fast_vert_cache_opt.html
-  * https://www.martin.st/thesis/efficient_triangle_reordering.pdf
-  * https://github.com/vivkin/forsyth/blob/master/forsyth.h
-  */
- VertexCacheReorderResult forsythReorder(const std::vector<uint32_t> &idxBuf, const size_t vertexCount);
+
+    /**
+     * @addtogroup vkcv_meshlet
+     * @{
+     */
+
+    /**
+    * Reorders the index buffer, simulating a LRU cache, so that vertices are grouped together in close triangle patches
+    * @param idxBuf current IndexBuffer
+    * @param vertexCount of the mesh
+    * @return new reordered index buffer to replace the input index buffer
+    * References:
+    * https://tomforsyth1000.github.io/papers/fast_vert_cache_opt.html
+    * https://www.martin.st/thesis/efficient_triangle_reordering.pdf
+    * https://github.com/vivkin/forsyth/blob/master/forsyth.h
+    */
+    VertexCacheReorderResult forsythReorder(const std::vector<uint32_t> &idxBuf, const size_t vertexCount);
+
+    /** @} */
+
 }
diff --git a/modules/meshlet/include/vkcv/meshlet/Meshlet.hpp b/modules/meshlet/include/vkcv/meshlet/Meshlet.hpp
index 9900dffa..ee328787 100644
--- a/modules/meshlet/include/vkcv/meshlet/Meshlet.hpp
+++ b/modules/meshlet/include/vkcv/meshlet/Meshlet.hpp
@@ -7,6 +7,12 @@
 
 namespace vkcv::meshlet {
 
+    /**
+     * @defgroup vkcv_meshlet Meshlet Module
+     * A module to convert meshes into meshlets for rendering via mesh shaders.
+     * @{
+     */
+
     struct Vertex {
         glm::vec3   position;
         float       padding0;
@@ -56,4 +62,6 @@ namespace vkcv::meshlet {
             const std::vector<uint8_t>& indexData,
             vkcv::asset::IndexType indexType);
 
+    /** @} */
+
 }
\ No newline at end of file
diff --git a/modules/meshlet/include/vkcv/meshlet/Tipsify.hpp b/modules/meshlet/include/vkcv/meshlet/Tipsify.hpp
index 6fb4b37d..3c808f95 100644
--- a/modules/meshlet/include/vkcv/meshlet/Tipsify.hpp
+++ b/modules/meshlet/include/vkcv/meshlet/Tipsify.hpp
@@ -5,6 +5,12 @@
 #include <iostream>
 
 namespace vkcv::meshlet {
+
+    /**
+     * @addtogroup vkcv_meshlet
+     * @{
+     */
+
     /**
      * reorders the IndexBuffer, so all usages of vertices to triangle are as close as possible
      * @param indexBuffer32Bit current IndexBuffer
@@ -20,4 +26,7 @@ namespace vkcv::meshlet {
      */
     VertexCacheReorderResult tipsifyMesh(const std::vector<uint32_t> &indexBuffer32Bit,
                                          const int vertexCount, const unsigned int cacheSize = 20);
+
+    /** @} */
+
 }
\ No newline at end of file
diff --git a/modules/scene/include/vkcv/scene/Bounds.hpp b/modules/scene/include/vkcv/scene/Bounds.hpp
index 07cdf888..e31970ff 100644
--- a/modules/scene/include/vkcv/scene/Bounds.hpp
+++ b/modules/scene/include/vkcv/scene/Bounds.hpp
@@ -5,6 +5,11 @@
 #include <glm/vec3.hpp>
 
 namespace vkcv::scene {
+
+    /**
+     * @addtogroup vkcv_scene
+     * @{
+     */
 	
 	class Bounds {
 	private:
@@ -65,5 +70,7 @@ namespace vkcv::scene {
 	};
 	
 	std::ostream& operator << (std::ostream& out, const Bounds& bounds);
+
+    /** @} */
 	
 }
diff --git a/modules/scene/include/vkcv/scene/Frustum.hpp b/modules/scene/include/vkcv/scene/Frustum.hpp
index de391757..723eb0a8 100644
--- a/modules/scene/include/vkcv/scene/Frustum.hpp
+++ b/modules/scene/include/vkcv/scene/Frustum.hpp
@@ -4,9 +4,16 @@
 #include "vkcv/scene/Bounds.hpp"
 
 namespace vkcv::scene {
+
+    /**
+     * @addtogroup vkcv_scene
+     * @{
+     */
 	
 	Bounds transformBounds(const glm::mat4& transform, const Bounds& bounds, bool* negative_w = nullptr);
 	
 	bool checkFrustum(const glm::mat4& transform, const Bounds& bounds);
+
+    /** @} */
 	
 }
diff --git a/modules/scene/include/vkcv/scene/Mesh.hpp b/modules/scene/include/vkcv/scene/Mesh.hpp
index bc82af4b..fc89cd02 100644
--- a/modules/scene/include/vkcv/scene/Mesh.hpp
+++ b/modules/scene/include/vkcv/scene/Mesh.hpp
@@ -7,6 +7,11 @@
 #include "MeshPart.hpp"
 
 namespace vkcv::scene {
+
+    /**
+     * @addtogroup vkcv_scene
+     * @{
+     */
 	
 	typedef typename event_function<const glm::mat4&, const glm::mat4&, PushConstants&, vkcv::DrawcallInfo&>::type RecordMeshDrawcallFunction;
 	
@@ -48,5 +53,7 @@ namespace vkcv::scene {
 		const Bounds& getBounds() const;
 	
 	};
+
+    /** @} */
 	
 }
diff --git a/modules/scene/include/vkcv/scene/MeshPart.hpp b/modules/scene/include/vkcv/scene/MeshPart.hpp
index 0d3467c6..ec1e6c7d 100644
--- a/modules/scene/include/vkcv/scene/MeshPart.hpp
+++ b/modules/scene/include/vkcv/scene/MeshPart.hpp
@@ -9,6 +9,11 @@
 #include "Bounds.hpp"
 
 namespace vkcv::scene {
+
+    /**
+     * @addtogroup vkcv_scene
+     * @{
+     */
 	
 	class Scene;
 	class Mesh;
@@ -51,4 +56,6 @@ namespace vkcv::scene {
 		
 	};
 
+    /** @} */
+
 }
diff --git a/modules/scene/include/vkcv/scene/Node.hpp b/modules/scene/include/vkcv/scene/Node.hpp
index 1fcca5b9..dc82ab62 100644
--- a/modules/scene/include/vkcv/scene/Node.hpp
+++ b/modules/scene/include/vkcv/scene/Node.hpp
@@ -8,6 +8,11 @@
 #include "Mesh.hpp"
 
 namespace vkcv::scene {
+
+    /**
+     * @addtogroup vkcv_scene
+     * @{
+     */
 	
 	class Scene;
 	
@@ -57,5 +62,7 @@ namespace vkcv::scene {
 		const Bounds& getBounds() const;
 		
 	};
+
+    /** @} */
 	
 }
diff --git a/modules/scene/include/vkcv/scene/Scene.hpp b/modules/scene/include/vkcv/scene/Scene.hpp
index 095c5e27..f2ea3b3a 100644
--- a/modules/scene/include/vkcv/scene/Scene.hpp
+++ b/modules/scene/include/vkcv/scene/Scene.hpp
@@ -11,6 +11,12 @@
 #include "Node.hpp"
 
 namespace vkcv::scene {
+
+    /**
+     * @defgroup vkcv_scene Scene Module
+     * A module to manage basic scene rendering with CPU-side frustum culling.
+     * @{
+     */
 	
 	class Scene {
 		friend class MeshPart;
@@ -69,5 +75,7 @@ namespace vkcv::scene {
 		static Scene load(Core& core, const std::filesystem::path &path);
 		
 	};
+
+    /** @} */
 	
 }
\ No newline at end of file
diff --git a/modules/shader_compiler/include/vkcv/shader/Compiler.hpp b/modules/shader_compiler/include/vkcv/shader/Compiler.hpp
index 5b119ca5..32590e16 100644
--- a/modules/shader_compiler/include/vkcv/shader/Compiler.hpp
+++ b/modules/shader_compiler/include/vkcv/shader/Compiler.hpp
@@ -8,6 +8,12 @@
 #include <vkcv/ShaderStage.hpp>
 
 namespace vkcv::shader {
+
+    /**
+     * @defgroup vkcv_shader Shader Compiler Module
+     * A module to use runtime shader compilation.
+     * @{
+     */
 	
 	typedef typename event_function<ShaderStage, const std::filesystem::path&>::type ShaderCompiledFunction;
 	
@@ -29,5 +35,7 @@ namespace vkcv::shader {
 		
 		void setDefine(const std::string& name, const std::string& value);
 	};
+
+    /** @} */
 	
 }
diff --git a/modules/shader_compiler/include/vkcv/shader/GLSLCompiler.hpp b/modules/shader_compiler/include/vkcv/shader/GLSLCompiler.hpp
index eca84def..a50c5ae0 100644
--- a/modules/shader_compiler/include/vkcv/shader/GLSLCompiler.hpp
+++ b/modules/shader_compiler/include/vkcv/shader/GLSLCompiler.hpp
@@ -6,6 +6,11 @@
 #include "Compiler.hpp"
 
 namespace vkcv::shader {
+
+    /**
+     * @addtogroup vkcv_shader
+     * @{
+     */
 	
 	class GLSLCompiler : public Compiler {
 	private:
@@ -29,5 +34,7 @@ namespace vkcv::shader {
 					 const std::filesystem::path& includePath = "", bool update = false) override;
 		
 	};
+
+    /** @} */
 	
 }
diff --git a/modules/upscaling/include/vkcv/upscaling/BilinearUpscaling.hpp b/modules/upscaling/include/vkcv/upscaling/BilinearUpscaling.hpp
index 52124dc8..08ef6c8c 100644
--- a/modules/upscaling/include/vkcv/upscaling/BilinearUpscaling.hpp
+++ b/modules/upscaling/include/vkcv/upscaling/BilinearUpscaling.hpp
@@ -3,6 +3,11 @@
 #include "Upscaling.hpp"
 
 namespace vkcv::upscaling {
+
+    /**
+     * @addtogroup vkcv_upscaling
+     * @{
+     */
 	
 	class BilinearUpscaling : public Upscaling {
 	private:
@@ -15,4 +20,6 @@ namespace vkcv::upscaling {
 	
 	};
 
+    /** @} */
+
 }
diff --git a/modules/upscaling/include/vkcv/upscaling/FSRUpscaling.hpp b/modules/upscaling/include/vkcv/upscaling/FSRUpscaling.hpp
index 4d331671..56cc9741 100644
--- a/modules/upscaling/include/vkcv/upscaling/FSRUpscaling.hpp
+++ b/modules/upscaling/include/vkcv/upscaling/FSRUpscaling.hpp
@@ -5,6 +5,11 @@
 #include <vkcv/ShaderProgram.hpp>
 
 namespace vkcv::upscaling {
+
+    /**
+     * @addtogroup vkcv_upscaling
+     * @{
+     */
 	
 	enum class FSRQualityMode : int {
 		NONE = 0,
@@ -80,4 +85,6 @@ namespace vkcv::upscaling {
 		
 	};
 
+    /** @} */
+
 }
diff --git a/modules/upscaling/include/vkcv/upscaling/Upscaling.hpp b/modules/upscaling/include/vkcv/upscaling/Upscaling.hpp
index c44e878a..acc33c8e 100644
--- a/modules/upscaling/include/vkcv/upscaling/Upscaling.hpp
+++ b/modules/upscaling/include/vkcv/upscaling/Upscaling.hpp
@@ -4,6 +4,12 @@
 #include <vkcv/Handles.hpp>
 
 namespace vkcv::upscaling {
+
+    /**
+     * @defgroup vkcv_upscaling Upscaling Module
+     * A module to upscale an image from an internal resolution to a final resolution in realtime.
+     * @{
+     */
 	
 	class Upscaling {
 	protected:
@@ -19,5 +25,7 @@ namespace vkcv::upscaling {
 							 		 const ImageHandle& output) = 0;
 	
 	};
+
+    /** @} */
 	
 }
-- 
GitLab