Commit 3f18e495 authored by Simon Boyé's avatar Simon Boyé

Vitelotte: Fixed a bunch of include guards, mainly in examples.

parent c1d81ec0
......@@ -4,8 +4,8 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef _VITELOTTE_ELEMENT_SOLVER_ERROR_
#define _VITELOTTE_ELEMENT_SOLVER_ERROR_
#ifndef _VITELOTTE_SOLVER_ERROR_
#define _VITELOTTE_SOLVER_ERROR_
#include <string>
......
......@@ -28,34 +28,36 @@ def print_all_caps_from_camel_case(toprint, out):
out.write('_')
skip = True
else:
skip = False
skip = c == "_"
out.write(c.upper())
def guard_from_filename(filename):
guard = StringIO('')
guard.write('_')
d = dirname(filename)
if d == 'Patate':
guard.write('PATATE')
elif d.startswith('Patate/common/'):
print_all_caps_from_camel_case(d.replace('/', '_'), guard)
elif d.startswith('Patate/common/') or d.startswith('examples/Vitelotte/common'):
print_all_caps_from_camel_case(d.replace('/', '_'), guard)
elif d.startswith('examples/'):
print_all_caps_from_camel_case(basename(d), guard)
else:
print_all_caps_from_camel_case(basename(dirname(d)), guard)
guard.write('_')
name, ext = splitext(basename(filename))
print_all_caps_from_camel_case(name, guard)
guard.write('_')
return guard.getvalue()
current = extract_guard(argv[1])
theorical = guard_from_filename(argv[1])
target = guard_from_filename(argv[1])
if current == theorical:
if current == target:
print('\033[32m{}\033[0m: {}'.format(argv[1], current))
else:
print('\033[31m{}\033[0m: {} - {}'.format(argv[1], current, theorical))
print('\033[31m{}\033[0m: {} - {}'.format(argv[1], current, target))
#ifndef _BEZIER_CURVE_H_
#define _BEZIER_CURVE_H_
#ifndef _EXAMPLES_VITELOTTE_COMMON_BEZIER_CURVE_
#define _EXAMPLES_VITELOTTE_COMMON_BEZIER_CURVE_
#include <cassert>
......
#ifndef GL_LINE_RENDERER
#define GL_LINE_RENDERER
#ifndef _EXAMPLES_VITELOTTE_COMMON_GL_LINE_RENDERER_
#define _EXAMPLES_VITELOTTE_COMMON_GL_LINE_RENDERER_
#include <vector>
......
#ifndef GL_POINT_RENDERER
#define GL_POINT_RENDERER
#ifndef _EXAMPLES_VITELOTTE_COMMON_GL_POINT_RENDERER_
#define _EXAMPLES_VITELOTTE_COMMON_GL_POINT_RENDERER_
#include <vector>
......
#ifndef _ORTHOGRAPHIC_CAMERA_H_
#define _ORTHOGRAPHIC_CAMERA_H_
#ifndef _EXAMPLES_VITELOTTE_COMMON_ORTHOGRAPHIC_CAMERA_
#define _EXAMPLES_VITELOTTE_COMMON_ORTHOGRAPHIC_CAMERA_
#include <Eigen/Geometry>
......
#ifndef _EXAMPLES_VITELOTTE_COMMON_VG_PLOT_OBJ_
#define _EXAMPLES_VITELOTTE_COMMON_VG_PLOT_OBJ_
#ifndef _EXAMPLES_VITELOTTE_COMMON_PLOT_OBJ_
#define _EXAMPLES_VITELOTTE_COMMON_PLOT_OBJ_
#include <fstream>
......
#ifndef _PATATE_EXAMPLES_COMMON_VG_NODE_RENDERER_H
#define _PATATE_EXAMPLES_COMMON_VG_NODE_RENDERER_H
#ifndef _EXAMPLES_VITELOTTE_COMMON_VG_NODE_RENDERER_
#define _EXAMPLES_VITELOTTE_COMMON_VG_NODE_RENDERER_
#include <Patate/vitelotte.h>
......
#ifndef _DOCUMENT_H_
#define _DOCUMENT_H_
#ifndef _MVG_EDITOR_DOCUMENT_
#define _MVG_EDITOR_DOCUMENT_
#include <Eigen/Geometry>
......
#ifndef _EDITOR_H_
#define _EDITOR_H_
#ifndef _MVG_EDITOR_EDITOR_
#define _MVG_EDITOR_EDITOR_
//#include <cstdlib>
......
#ifndef _MAIN_WINDOW_H_
#define _MAIN_WINDOW_H_
#ifndef _MVG_EDITOR_MAIN_WINDOW_
#define _MVG_EDITOR_MAIN_WINDOW_
#include <QMainWindow>
......
#ifndef VALUE_EDITOR_H
#define VALUE_EDITOR_H
#ifndef _MVG_EDITOR_VALUE_EDITOR_
#define _MVG_EDITOR_VALUE_EDITOR_
#include <vector>
......
#ifndef _APPLICATION_H_
#define _APPLICATION_H_
#ifndef _MVG_VIEWER_H_
#define _MVG_VIEWER_H_
#ifdef WIN32
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_CHECK_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_CHECK_COMMAND_
#ifndef _MVGTK_CHECK_COMMAND_
#define _MVGTK_CHECK_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_COMPACT_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_COMPACT_COMMAND_
#ifndef _MVGTK_COMPACT_COMMAND_
#define _MVGTK_COMPACT_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_CONVERT_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_CONVERT_COMMAND_
#ifndef _MVGTK_CONVERT_COMMAND_
#define _MVGTK_CONVERT_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_CURVES_TO_NODES_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_CURVES_TO_NODES_COMMAND_
#ifndef _MVGTK_CURVES_TO_NODES_COMMAND_
#define _MVGTK_CURVES_TO_NODES_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_FINALIZE_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_FINALIZE_COMMAND_
#ifndef _MVGTK_FINALIZE_COMMAND_
#define _MVGTK_FINALIZE_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_MVGTK_
#define _VITELOTTE_EXAMPLE_MVGTK_MVGTK_
#ifndef _MVGTK_MVGTK_
#define _MVGTK_MVGTK_
#include <list>
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_PLOT_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_PLOT_COMMAND_
#ifndef _MVGTK_PLOT_COMMAND_
#define _MVGTK_PLOT_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_SIMPLIFY_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_SIMPLIFY_COMMAND_
#ifndef _MVGTK_SIMPLIFY_COMMAND_
#define _MVGTK_SIMPLIFY_COMMAND_
#include "mvgtk.h"
......
#ifndef _VITELOTTE_EXAMPLE_MVGTK_SOLVE_COMMAND_
#define _VITELOTTE_EXAMPLE_MVGTK_SOLVE _COMMAND_
#ifndef _MVGTK_SOLVE_COMMAND_
#define _MVGTK_SOLVE_COMMAND_
#include "mvgtk.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment