Add some doxygen configuration #10

Merged
twistdroach merged 1 commits from doxygen_config into master 2020-10-01 19:47:01 -04:00
10 changed files with 58 additions and 3 deletions

View File

@ -1,5 +1,5 @@
project("Simple Raytracer" C)
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.3)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
@ -14,6 +14,26 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
add_link_options(--coverage)
endif()
find_package( Doxygen )
if ( DOXYGEN_FOUND )
set( DOXYGEN_EXCLUDE_PATTERNS
*/test/*
*/main/*
*/external/* )
set( DOXYGEN_OUTPUT_DIRECTORY doxygen )
set( DOXYGEN_EXTRACT_ALL YES )
set( DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES )
doxygen_add_docs( doxygen "${CMAKE_CURRENT_SOURCE_DIR}" )
else()
message( "Doxygen need to be installed to generate the doxygen documentation" )
endif()
add_subdirectory(module_math)
add_subdirectory(module_datastructures)
add_subdirectory(module_shapes)

View File

@ -3,6 +3,9 @@
#include "cylinder.h"
/**
* \extends CYLINDER_Cylinder
*/
typedef CYLINDER_Cylinder CONE_Cone;
const SHAPE_vtable CONE_vtable;

View File

@ -4,6 +4,9 @@
#include "ray.h"
#include "shape.h"
/**
* \extends SHAPE_Shape
*/
typedef SHAPE_Shape CUBE_Cube;
const SHAPE_vtable CUBE_vtable;

View File

@ -4,6 +4,10 @@
#include "ray.h"
#include "shape.h"
/**
* \extends SHAPE_Shape
*/
typedef struct CYLINDER_Cylinder {
SHAPE_Shape shape;
double minimum, maximum;

View File

@ -23,7 +23,7 @@ void GROUP_init(GROUP_Group* group) {
group->list = ARRLIST_new();
}
void delete_subshape(void* void_shape, void* context) {
static void delete_subshape(void* void_shape, void* context) {
assert(void_shape);
UNUSED(context);
SHAPE_Shape* shape = (SHAPE_Shape*) void_shape;
@ -65,7 +65,7 @@ typedef struct check_shape_context {
RAY_Intersections* intersections;
} check_shape_context;
void check_shape(void* void_shape, void* void_context) {
static void check_shape(void* void_shape, void* void_context) {
check_shape_context* c = (check_shape_context*) void_context;
SHAPE_Shape* shape = (SHAPE_Shape*) void_shape;
SHAPE_intersect(c->intersections, shape, c->local_ray);

View File

@ -18,6 +18,13 @@ void GROUP_destroy(GROUP_Group* group);
void GROUP_delete(GROUP_Group* group);
void GROUP_delete_shape(SHAPE_Shape* shape);
/**
* \pure This function should never be called...it should be overridden by the members of the group.
* @param local_normal
* @param group
* @param local_point
* @param hit
*/
void GROUP_local_normal_at(TUPLES_Vector* local_normal, SHAPE_Shape* group, const TUPLES_Point* local_point, const RAY_Xs* hit);
void GROUP_local_intersect(RAY_Intersections* intersections, SHAPE_Shape* group, const RAY_Ray* local_ray);

View File

@ -4,7 +4,11 @@
#include <ray.h>
#include "shape.h"
/**
* \extends SHAPE_Shape
*/
typedef SHAPE_Shape PLANE_Plane;
const SHAPE_vtable PLANE_vtable;
#define PLANE_new() (PLANE_Plane*)SHAPE_new(&PLANE_vtable)

View File

@ -5,7 +5,11 @@
#include "material.h"
#include "shape.h"
/**
* \extends SHAPE_Shape
*/
typedef SHAPE_Shape SPHERE_Sphere;
const SHAPE_vtable SPHERE_vtable;
#define SPHERE_new() (SPHERE_Sphere*)SHAPE_new(&SPHERE_vtable)

View File

@ -5,6 +5,10 @@
#include "ray.h"
const SHAPE_vtable TESTSHAPE_vtable;
/**
* \extends SHAPE_Shape
*/
typedef struct TESTSHAPE_TestShape {
SHAPE_Shape parent; /** parent class */
double size;

View File

@ -3,12 +3,18 @@
#include "shape.h"
/**
* \extends SHAPE_Shape
*/
typedef struct TRIANGLE_Triangle {
SHAPE_Shape shape; /* Superclass */
TUPLES_Point p1, p2, p3; /* Corners of the triangle */
TUPLES_Vector e1, e2, normal; /* Two edges and the normal vector */
} TRIANGLE_Triangle;
/**
* \extends TRIANGLE_Triangle
*/
typedef struct TRIANGLE_SmoothTriangle {
union {
TRIANGLE_Triangle tri;