#ifndef _COMMON_HEADERS_H_
#define _COMMON_HEADERS_H_

// precision
#define HIGH_PRECISION

// matlab debugger
// NOTE: if you don't have Matlab R2010a or higher versions installed on your computer, please comment the next line.
 #define ENABLE_MATLAB_DEBUGGING

//#define ENABLE_HARD_CONSTRAINTS

// single or double presicion
#ifdef HIGH_PRECISION
	typedef double ScalarType;
	#define TW_TYPE_SCALAR_TYPE TW_TYPE_DOUBLE
#else
	typedef float ScalarType;
	#define TW_TYPE_SCALAR_TYPE TW_TYPE_FLOAT
#endif

// small number and large number
#ifdef HIGH_PRECISION
	#define EPSILON 1e-15
#else
	#define EPSILON 1e-6
#endif
#define LARGER_EPSILON 1e-6
#define EVEN_LARGER_EPSILON 1e-5
#define LOWER_TOL 1e-13
#define UPPER_TOL 1e-2
#define LARGE_NUMBER 1e5
#define INFINITY 1e15
#define HANDLE_INFLUENCE_TRESHOLD 0.9
#define DETERMINANT_THRESHOLD 0.1

// default values
#define DEFAULT_SCREEN_WIDTH 1024
#define DEFAULT_SCREEN_HEIGHT 768

// selection radius
#define DEFAULT_SELECTION_RADIUS 0.1
	
// camera mode
#define MODE_2D true
#define MODE_3D false

// exceptions
typedef enum
{
	EXCEPTION_LOG_OF_NEGATIVE,
	EXCEPTION_TOTAL_NUM
} MyExceptions;

// file localtions
#define DEFAULT_VERT_SHADER_FILE "./shaders/vert.glsl"
#define DEFAULT_FRAG_SHADER_FILE "./shaders/frag.glsl"
#define DEFAULT_TEXTURE_FILE "./textures/texture.png"
#define DEFAULT_CONFIG_FILE "./config/config.txt"
#define DEFAULT_CONFIG_CAMERA_FILE "./config/camera.txt"
#define DEFAULT_CONFIG_HANDLES_FILE "./config/handles.txt"
#define DEFAULT_EXROTATION_FILE "./config/exrotation.txt"
#define DEFAULT_TARGET_CONSTRAINT "./config/targetconstraints.txt"
#define DEFAULT_CONFIG_WEIGHTS_FILE "./config/per_vertex_weights.txt"
#define DEFAULT_CONFIG_PER_ELEMENT_WEIGHTS_FILE "./config/weights.txt"
#define DEFAULT_CONFIG_VERTICES_FILE "./config/vertices.txt"
#define DEFAULT_SCREEN_SHOT_FILE "./output/ScreenShot.png"
#define DEFAULT_OUTPUT_MESH_OBJ_FILE "./output/mesh.obj"
#define DEFAULT_OUTPUT_ATTACHMENT_OBJ_FILE "./output/handle.obj"
#define DEFAULT_MESH_MODEL "./models/cube86.mesh"
#define DEFAULT_OBJ_MODEL "./models/rect.obj"

#endif