diff --git a/naming_convention.txt b/naming_convention.txt index 7f38de20ad07e131bcb7bcfa5144eeef5737684f..d64a539b4cd375e1cf55008158b4850ec7901f0f 100644 --- a/naming_convention.txt +++ b/naming_convention.txt @@ -9,3 +9,8 @@ public methods - cammelCase When a parameter is used to overwrite an attribute, their names should match with the parameter being preceded by an underscore ( sens -> _sens). + +includes should be in these groups in the following order: + local libraries (own hpp file first) + project specific libraries (OpenGL, ...) + standard libraries (C++ first, then C) \ No newline at end of file diff --git a/src/common/include/common/aabb.hpp b/src/common/include/common/aabb.hpp index 103455fd4ce6270da11dc8f1803563aeed823da8..d0a1a3b1703972b03ac02f4520ff8625fe9a5eea 100644 --- a/src/common/include/common/aabb.hpp +++ b/src/common/include/common/aabb.hpp @@ -1,13 +1,15 @@ #ifndef AABB_INCLUDED #define AABB_INCLUDED +#include <common/node.hpp> + #include <glad/glad.h> #include <glm/glm.hpp> -#include <vector> + #include <array> -#include <utility> #include <memory> -#include <common/node.hpp> +#include <utility> +#include <vector> using node_ptr = std::shared_ptr<Node>; diff --git a/src/common/include/common/frame.hpp b/src/common/include/common/frame.hpp index 76d843fcd38ec40f211819372ac20a6d33f18cdd..cd086214210f7a0f574139825d558125304e7b35 100644 --- a/src/common/include/common/frame.hpp +++ b/src/common/include/common/frame.hpp @@ -3,11 +3,12 @@ #include <glad/glad.h> #include <glm/glm.hpp> +#include <glm/gtc/matrix_access.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <glm/gtc/quaternion.hpp> #include <glm/gtx/quaternion.hpp> -#include <glm/gtc/matrix_access.hpp> + #include <vector> class Frame diff --git a/src/common/include/common/node.hpp b/src/common/include/common/node.hpp index db2601c22b3fd3d2873295bd659f8f64a1fc65be..7dc909598c62028c8b3e5e4b30d799f47f376842 100644 --- a/src/common/include/common/node.hpp +++ b/src/common/include/common/node.hpp @@ -3,8 +3,9 @@ #include <common/frame.hpp> #include <common/objectbase.hpp> -#include <vector> + #include <memory> +#include <vector> using objectbase_ptr = std::shared_ptr<ObjectBase>; using frame_ptr = std::shared_ptr<Frame>; diff --git a/src/controls/include/controls/cam_control.hpp b/src/controls/include/controls/cam_control.hpp index d9af94596429b0dbd9de26344be20cc95ad102e2..ea4de753a8613391bf725685c35396a48c78edd8 100644 --- a/src/controls/include/controls/cam_control.hpp +++ b/src/controls/include/controls/cam_control.hpp @@ -1,17 +1,16 @@ #ifndef CAM_CONTROL_INCLUDED #define CAM_CONTROL_INCLUDED -#include <glad/glad.h> -#include <glm/glm.hpp> -#include <glm/gtc/matrix_transform.hpp> -#include <glm/gtc/type_ptr.hpp> - #include <controls/control.hpp> - #include <osi/window.hpp> #include <osi/keyboard.hpp> #include <osi/mouse.hpp> +#include <glad/glad.h> +#include <glm/glm.hpp> +#include <glm/gtc/matrix_transform.hpp> +#include <glm/gtc/type_ptr.hpp> + class CameraController : public Controller { glm::vec2 sens; diff --git a/src/controls/include/controls/control.hpp b/src/controls/include/controls/control.hpp index b4c9507f6f0e7699768d0db8b78629acd7cb3f3e..659ac3d6e0255252ab40b7da8070901827039317 100644 --- a/src/controls/include/controls/control.hpp +++ b/src/controls/include/controls/control.hpp @@ -1,15 +1,16 @@ #ifndef CONTROL_INCLUDED #define CONTROL_INCLUDED +#include <common/frame.hpp> + #include <glad/glad.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> -#include <common/frame.hpp> -#include <unordered_set> -#include <string> #include <memory> +#include <string> +#include <unordered_set> using frame_ptr = std::shared_ptr<Frame>; diff --git a/src/controls/include/controls/obj_control.hpp b/src/controls/include/controls/obj_control.hpp index ba1246828bb290f16d9ba301d408d712f42ef1f5..958567b9a9f01aaca03287121ae852c20f4e5b3e 100644 --- a/src/controls/include/controls/obj_control.hpp +++ b/src/controls/include/controls/obj_control.hpp @@ -1,17 +1,17 @@ #ifndef OBJ_CONTROL_INCLUDED #define OBJ_CONTROL_INCLUDED +#include <common/frame.hpp> +#include <controls/control.hpp> +#include <osi/mouse.hpp> + #include <glad/glad.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> -#include <controls/control.hpp> -#include <common/frame.hpp> -#include <unordered_set> #include <string> - -#include <osi/mouse.hpp> +#include <unordered_set> class ObjectController : public Controller { diff --git a/src/filein/include/filein/obj_loader.hpp b/src/filein/include/filein/obj_loader.hpp index c057ce0a5f2f0e188b82e163c06327cb794eccb0..545ef4adb9bd2cf9eb0a913e5f513048e1e17dc7 100644 --- a/src/filein/include/filein/obj_loader.hpp +++ b/src/filein/include/filein/obj_loader.hpp @@ -1,13 +1,14 @@ #ifndef OBJ_LOADER_INCLUDED #define OBJ_LOADER_INCLUDED -#include <vector> -#include <string> -#include <stdexcept> -#include <memory> +#include <gfx/mesh.hpp> + #include <tiny_obj_loader.h> -#include <gfx/mesh.hpp> +#include <memory> +#include <string> +#include <stdexcept> +#include <vector> using mesh_ptr = std::shared_ptr<Mesh>; diff --git a/src/filein/src/obj_loader.cpp b/src/filein/src/obj_loader.cpp index 7b98f8872718382322bed33bdc1713352a5eac18..ad794b50a5fd382ec5ef5c629c46e6974051e6e7 100644 --- a/src/filein/src/obj_loader.cpp +++ b/src/filein/src/obj_loader.cpp @@ -1,6 +1,5 @@ #include <filein/obj_loader.hpp> - mesh_ptr load_object(std::string const& model_path) { // TO DO: rework indices for normals from .obj diff --git a/src/studio/include/studio/simulator.hpp b/src/studio/include/studio/simulator.hpp index 6f35eaac7cc3ad4e6731ef563eb6c0bc96933bf6..e2e0ce04a3bf9bd9d40aaa4ee730f37342865740 100644 --- a/src/studio/include/studio/simulator.hpp +++ b/src/studio/include/studio/simulator.hpp @@ -4,28 +4,23 @@ # include <osi/simulator.hpp> # include <utils/math.hpp> -#include <osi/opengl.hpp> -#include <osi/gui.hpp> -#include <SDL2/SDL.h> - -#include <glad/glad.h> -#include <gfx/vao.hpp> -#include <gfx/vbo.hpp> -#include <gfx/ebo.hpp> -#include <gfx/camera.hpp> -#include <common/objectbase.hpp> -#include <gfx/mesh.hpp> #include <common/frame.hpp> -#include <gfx/light.hpp> +#include <common/objectbase.hpp> #include <common/node.hpp> #include <controls/cam_control.hpp> #include <controls/obj_control.hpp> +#include <gfx/camera.hpp> +#include <gfx/light.hpp> +#include <gfx/mesh.hpp> +// #include <gfx/render.hpp> #include <gfx/shader.hpp> -#include <gfx/render.hpp> -#include <iostream> + +#include <glad/glad.h> +// #include <SDL2/SDL.h> + +#include <map> #include <memory> #include <vector> -#include <map> namespace studio { diff --git a/src/studio/src/simulator.cpp b/src/studio/src/simulator.cpp index e5a31432e1013412e0c5d6c3fea6fe0a27734203..248fd6651e2944763c60a8179f70a7acc3bb8a4e 100644 --- a/src/studio/src/simulator.cpp +++ b/src/studio/src/simulator.cpp @@ -1,21 +1,19 @@ #include <studio/simulator.hpp> -#include <osi/opengl.hpp> -#include <osi/gui.hpp> -#include <utils/assumptions.hpp> -#include <glad/glad.h> -#include <gfx/shader.hpp> -#include <gfx/render.hpp> #include <filein/obj_loader.hpp> +#include <gfx/render.hpp> #include <gui/ui.hpp> -#include <iostream> -#include <vector> -#include <filesystem> +#include <utils/assumptions.hpp> +#include <glad/glad.h> #include <glm/gtc/constants.hpp> #include <glm/gtx/intersect.hpp> -#include <limits> + #include <algorithm> +#include <iostream> +#include <limits> +#include <filesystem> +#include <vector> namespace studio { std::vector<float> obj_vertices =