Refactorizar estilo del proyecto: .h → .hpp, #pragma once, includes desde raíz

Modernizar convenciones de código C++ aplicando las siguientes directivas:

## Cambios principales

**1. Renombrar headers (.h → .hpp)**
- 36 archivos renombrados a extensión .hpp (estándar C++)
- Mantenidos como .h: stb_image.h, stb_image_resize2.h (librerías C externas)

**2. Modernizar include guards (#ifndef → #pragma once)**
- resource_manager.hpp: #ifndef RESOURCE_MANAGER_H → #pragma once
- resource_pack.hpp: #ifndef RESOURCE_PACK_H → #pragma once
- spatial_grid.hpp: #ifndef SPATIAL_GRID_H → #pragma once

**3. Sistema de includes desde raíz del proyecto**
- CMakeLists.txt: añadido include_directories(${CMAKE_SOURCE_DIR}/source)
- Eliminadas rutas relativas (../) en todos los includes
- Includes ahora usan rutas absolutas desde source/

**Antes:**
```cpp
#include "../defines.h"
#include "../text/textrenderer.h"
```

**Ahora:**
```cpp
#include "defines.hpp"
#include "text/textrenderer.hpp"
```

## Archivos afectados

- 1 archivo CMakeLists.txt modificado
- 36 archivos renombrados (.h → .hpp)
- 32 archivos .cpp actualizados (includes)
- 36 archivos .hpp actualizados (includes + guards)
- 1 archivo tools/ actualizado

**Total: 70 archivos modificados**

## Verificación

 Proyecto compila sin errores
 Todas las rutas de includes correctas
 Include guards modernizados
 Librerías externas C mantienen extensión .h

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-23 13:49:58 +02:00
parent a929df6b73
commit a9d7b66e83
70 changed files with 158 additions and 164 deletions

View File

@@ -1,5 +1,5 @@
#include "atom_shape.h"
#include "../defines.h"
#include "atom_shape.hpp"
#include "defines.hpp"
#include <cmath>
void AtomShape::generatePoints(int num_points, float screen_width, float screen_height) {

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Átomo con núcleo central y órbitas electrónicas
// Comportamiento: Núcleo estático + electrones orbitando en planos inclinados

View File

@@ -1,5 +1,5 @@
#include "cube_shape.h"
#include "../defines.h"
#include "cube_shape.hpp"
#include "defines.hpp"
#include <cmath>
void CubeShape::generatePoints(int num_points, float screen_width, float screen_height) {

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
#include <vector>
// Figura: Cubo 3D rotante

View File

@@ -1,5 +1,5 @@
#include "cylinder_shape.h"
#include "../defines.h"
#include "cylinder_shape.hpp"
#include "defines.hpp"
#include <cmath>
#include <cstdlib> // Para rand()

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Cilindro 3D rotante
// Comportamiento: Superficie cilíndrica con rotación en eje Y + tumbling ocasional en X/Z

View File

@@ -1,5 +1,5 @@
#include "helix_shape.h"
#include "../defines.h"
#include "helix_shape.hpp"
#include "defines.hpp"
#include <cmath>
void HelixShape::generatePoints(int num_points, float screen_width, float screen_height) {

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Espiral helicoidal 3D con distribución uniforme
// Comportamiento: Rotación en eje Y + animación de fase vertical

View File

@@ -1,5 +1,5 @@
#include "icosahedron_shape.h"
#include "../defines.h"
#include "icosahedron_shape.hpp"
#include "defines.hpp"
#include <cmath>
#include <vector>

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Icosaedro 3D (D20, poliedro regular de 20 caras)
// Comportamiento: 12 vértices distribuidos uniformemente con rotación triple

View File

@@ -1,5 +1,5 @@
#include "lissajous_shape.h"
#include "../defines.h"
#include "lissajous_shape.hpp"
#include "defines.hpp"
#include <cmath>
void LissajousShape::generatePoints(int num_points, float screen_width, float screen_height) {

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Curva de Lissajous 3D
// Comportamiento: Curva paramétrica 3D con rotación global y animación de fase

View File

@@ -1,6 +1,6 @@
#include "png_shape.h"
#include "../defines.h"
#include "../external/stb_image.h"
#include "png_shape.hpp"
#include "defines.hpp"
#include "external/stb_image.h"
#include <cmath>
#include <algorithm>
#include <iostream>

View File

@@ -1,7 +1,7 @@
#pragma once
#include "shape.h"
#include "../defines.h" // Para PNG_IDLE_TIME_MIN/MAX constantes
#include "shape.hpp"
#include "defines.hpp" // Para PNG_IDLE_TIME_MIN/MAX constantes
#include <vector>
#include <cstdlib> // Para rand()

View File

@@ -1,5 +1,5 @@
#include "sphere_shape.h"
#include "../defines.h"
#include "sphere_shape.hpp"
#include "defines.hpp"
#include <cmath>
void SphereShape::generatePoints(int num_points, float screen_width, float screen_height) {

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Esfera 3D con distribución uniforme (Fibonacci Sphere Algorithm)
// Comportamiento: Rotación dual en ejes X e Y

View File

@@ -1,5 +1,5 @@
#include "torus_shape.h"
#include "../defines.h"
#include "torus_shape.hpp"
#include "defines.hpp"
#include <cmath>
void TorusShape::generatePoints(int num_points, float screen_width, float screen_height) {

View File

@@ -1,6 +1,6 @@
#pragma once
#include "shape.h"
#include "shape.hpp"
// Figura: Torus/Toroide 3D (donut/rosquilla)
// Comportamiento: Superficie toroidal con rotación triple (X, Y, Z)