/////////////////////////////////////////////////////////////////////////
//                                                                     //
// This file contains the definitions of the tokens of the language    //
// used to describe the scene.                                         //
//                                                                     //
/////////////////////////////////////////////////////////////////////////
#ifndef __TOKENS_HPP__
#define __TOKENS_HPP__


#define MAKE_TOKEN(a,b) (((a) << 16) | (b))

// Groups of properties
static const int TOKEN_GENERAL               = MAKE_TOKEN(1 <<  0,  1);
static const int TOKEN_STEREOGRAM            = MAKE_TOKEN(1 <<  0,  2);
static const int TOKEN_SHADER                = MAKE_TOKEN(1 <<  0,  3);

// General properties
static const int TOKEN_SMALLREAL             = MAKE_TOKEN(1 <<  1,  1);
static const int TOKEN_WIDTH                 = MAKE_TOKEN(1 <<  1,  2);
static const int TOKEN_HEIGHT                = MAKE_TOKEN(1 <<  1,  3);
static const int TOKEN_BACKCOLOR             = MAKE_TOKEN(1 <<  1,  4);
static const int TOKEN_CAMERAPOS             = MAKE_TOKEN(1 <<  1,  5);
static const int TOKEN_CAMERATARGET          = MAKE_TOKEN(1 <<  1,  6);
static const int TOKEN_UPVECTOR              = MAKE_TOKEN(1 <<  1,  7);
static const int TOKEN_FOCALE                = MAKE_TOKEN(1 <<  1,  8);
static const int TOKEN_FSTOP                 = MAKE_TOKEN(1 <<  1,  9);
static const int TOKEN_DIMFILM               = MAKE_TOKEN(1 <<  1, 10);
static const int TOKEN_GENREFRINDEX          = MAKE_TOKEN(1 <<  1, 11);

// Types of surfaces
static const int TOKEN_NEW                   = MAKE_TOKEN(1 <<  2,  1);
static const int TOKEN_SPHERE                = MAKE_TOKEN(1 <<  2,  2);
static const int TOKEN_PLANE                 = MAKE_TOKEN(1 <<  2,  3);
static const int TOKEN_TRIANGLE              = MAKE_TOKEN(1 <<  2,  4);
static const int TOKEN_QUADRIC               = MAKE_TOKEN(1 <<  2,  5);
static const int TOKEN_UNION                 = MAKE_TOKEN(1 <<  2, 11);
static const int TOKEN_DIFFERENCE            = MAKE_TOKEN(1 <<  2, 12);
static const int TOKEN_INTERSECTION          = MAKE_TOKEN(1 <<  2, 13);

// Surface transformations
static const int TOKEN_TRANSLATE             = MAKE_TOKEN(1 <<  3,  1);
static const int TOKEN_SCALE                 = MAKE_TOKEN(1 <<  3,  2);
static const int TOKEN_ROTATE                = MAKE_TOKEN(1 <<  3,  3);

// Surface properties
static const int TOKEN_SURFACECOLOR          = MAKE_TOKEN(1 <<  4,  1);
static const int TOKEN_AMBIENTCOEF           = MAKE_TOKEN(1 <<  4,  2);
static const int TOKEN_DIFFUSECOEF           = MAKE_TOKEN(1 <<  4,  3);
static const int TOKEN_SPECULARCOEF          = MAKE_TOKEN(1 <<  4,  4);
static const int TOKEN_SHININESSCOEF         = MAKE_TOKEN(1 <<  4,  5);
static const int TOKEN_REFLEXIONCOEF         = MAKE_TOKEN(1 <<  4,  6);
static const int TOKEN_REFRACTIONCOEF        = MAKE_TOKEN(1 <<  4,  7);
static const int TOKEN_NEARCLIPPLANE         = MAKE_TOKEN(1 <<  4,  8);
static const int TOKEN_FARCLIPPLANE          = MAKE_TOKEN(1 <<  4,  9);
static const int TOKEN_REFRACTIONINDEX       = MAKE_TOKEN(1 <<  4, 10);
static const int TOKEN_MAX_LEVEL             = MAKE_TOKEN(1 <<  4, 11);
static const int TOKEN_MIN_ENERGY            = MAKE_TOKEN(1 <<  4, 12);

static const int TOKEN_PRECISIONU            = MAKE_TOKEN(1 <<  5,  1);
static const int TOKEN_PRECISIONV            = MAKE_TOKEN(1 <<  5,  2);
static const int TOKEN_CENTER                = MAKE_TOKEN(1 <<  5,  3);
static const int TOKEN_RADIUS                = MAKE_TOKEN(1 <<  5,  4);
static const int TOKEN_NORMAL                = MAKE_TOKEN(1 <<  5,  5);
static const int TOKEN_CONSTANT              = MAKE_TOKEN(1 <<  5,  6);
static const int TOKEN_SIZE                  = MAKE_TOKEN(1 <<  5,  7);
static const int TOKEN_QUADRATIC             = MAKE_TOKEN(1 <<  5,  8);
static const int TOKEN_LINEAR                = MAKE_TOKEN(1 <<  5,  9);
static const int TOKEN_MIX                   = MAKE_TOKEN(1 <<  5, 10);
static const int TOKEN_VERTEX0               = MAKE_TOKEN(1 <<  5, 11);
static const int TOKEN_VERTEX1               = MAKE_TOKEN(1 <<  5, 12);
static const int TOKEN_VERTEX2               = MAKE_TOKEN(1 <<  5, 13);


// Surface instanciation
static const int TOKEN_INSTANCE              = MAKE_TOKEN(1 <<  6,  1);

// Light properties
static const int TOKEN_POSITION              = MAKE_TOKEN(1 <<  7,  1);
static const int TOKEN_LIGHTCOLOR            = MAKE_TOKEN(1 <<  7,  2);
static const int TOKEN_INTENSITY             = MAKE_TOKEN(1 <<  7,  3);

// New light
static const int TOKEN_LIGHT                 = MAKE_TOKEN(1 <<  8,  1);

// Parsing tokens
static const int TOKEN_INTEGER               = MAKE_TOKEN(1 <<  9,  1);
static const int TOKEN_REAL                  = MAKE_TOKEN(1 <<  9,  2);
static const int TOKEN_NAME                  = MAKE_TOKEN(1 <<  9,  3);

// Rendering modes
static const int TOKEN_MODE_RAYTRACE         = MAKE_TOKEN(1 << 10,  1);
static const int TOKEN_MODE_OPENGL           = MAKE_TOKEN(1 << 10,  2);
static const int TOKEN_MODE_DEPTH            = MAKE_TOKEN(1 << 10,  3);
static const int TOKEN_MODE_STEREOGRAM       = MAKE_TOKEN(1 << 10,  4);
static const int TOKEN_MODE_SHADERRENDER     = MAKE_TOKEN(1 << 10,  5);
static const int TOKEN_MODE_SHADERTEXT       = MAKE_TOKEN(1 << 10,  6);

// Stereogram options
static const int TOKEN_PATTERN_FILE          = MAKE_TOKEN(1 << 11,  1);
static const int TOKEN_RANDOM_PATTERN_WIDTH  = MAKE_TOKEN(1 << 11,  2);
static const int TOKEN_RANDOM_PATTERN_HEIGHT = MAKE_TOKEN(1 << 11,  3);
static const int TOKEN_NEAREST_DEPTH         = MAKE_TOKEN(1 << 11,  4);
static const int TOKEN_FARTHEST_DEPTH        = MAKE_TOKEN(1 << 11,  5);
static const int TOKEN_NEAREST_MAPS_TO       = MAKE_TOKEN(1 << 11,  6);
static const int TOKEN_FARTHEST_MAPS_TO      = MAKE_TOKEN(1 << 11,  7);

// Shader options
static const int TOKEN_REFLECTION_ENABLED    = MAKE_TOKEN(1 << 12,  1);
static const int TOKEN_REFRACTION_ENABLED    = MAKE_TOKEN(1 << 12,  2);
static const int TOKEN_RAY_OFFSET            = MAKE_TOKEN(1 << 12,  3);
static const int TOKEN_SHADOW_TYPE           = MAKE_TOKEN(1 << 12,  4);


#endif // __TOKENS_HPP__
