/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
 * Copyright 2008-2010 Pelican Mapping
 * http://osgearth.org
 *
 * osgEarth is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
#ifndef OSGEARTH_DROAM_ENGINE_COMMON_H
#define OSGEARTH_DROAM_ENGINE_COMMON_H 1

#include <osgEarth/Common>

//typedef unsigned int   VertexIndex;    // index into the VBO
typedef unsigned int   NodeIndex;      // index of a node in the mesh node container
typedef unsigned short Level;          // LOD level number
typedef short          ChildIndex;     // -1 = invalid
typedef short          AncestorIndex;  // -1 = invalid
typedef int            TravNumber;     // mesh traversal number


#define WHITE   osg::Vec4f(1,1,1,1)
#define RED     osg::Vec4f(1,0,0,1)
#define BLUE    osg::Vec4f(0,0,1,1)
#define GREEN   osg::Vec4f(0,1,0,1)
#define YELLOW  osg::Vec4f(1,1,0,1)
#define MAGENTA osg::Vec4f(1,0,1,1)
#define CYAN    osg::Vec4f(0,1,1,1)


// the number of verts to initial reserve in the shared VBO:
#define RESERVED_VERTICES 20000

// define this to employ a queue for refreshing diamonds' primitive sets & tex coords in UPDATE:
#define USE_DIRTY_QUEUE

// define this to apply textures to the quadtree diamonds:
#define USE_TEXTURES

// DEBUGGING: define this to apply simulated "debugging" textures instead of fetching them from MapLayer (for testing):
//#define USE_DEBUG_TEXTURES

// DEBUGGING: define this to set a color array on the shared VBO, and to apply colors based on LOD level (for testing):
//#define USE_VERTEX_COLORS

// DEBUGGING: draw a green outline around each texture
//#define OUTLINE_TEXTURES

// the highest LOD level at which diamond splits can occur:
#define MAX_ACTIVE_LEVEL 30

// maximum number of split, merge, and image jobs to complete per UPDATE frame
// (todo: replace with time quota)
#define MAX_JOBS_PER_FRAME 10

// maximum subdivision level that can split and merge
#define MAX_ACTIVE_LEVEL 30

// multiple this # by the diamond bounding sphere radius for switch-in/out distance:
#define CULL_RANGE_FACTOR 2

// density of each AMR patch (number of rows/cols)
#define AMR_PATCH_ROWS 8

// whether to use the geodetic manifold (or the cube manifold, the default)
//#define USE_GEODETIC_MANIFOLD 1


#endif // OSGEARTH_DROAM_ENGINE_COMMON_H
