/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2014 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_DRIVERS_REX_PROXY_SURFACE_NODE
#define OSGEARTH_DRIVERS_REX_PROXY_SURFACE_NODE 1

#include "Common"
#include "ProxyGeometry"

#include <osgEarth/TileKey>

#include <osg/Vec3>
#include <osg/MatrixTransform>
#include <vector>

namespace osgEarth
{
    class MapInfo;
}

namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
{
    typedef std::vector<osg::Vec3> VectorPoints;
    /**
     * SurfaceNode holds the proxy (physics) geometry of the terrain surface.
     */
    class ProxySurfaceNode : public osg::MatrixTransform
    {
    public:
        ProxySurfaceNode(const TileKey& key, const MapInfo& mapInfo, unsigned tileSize, const osg::Texture* pTexture);

    protected:
        virtual ~ProxySurfaceNode() { }

        // container for proxy geometry
        osg::ref_ptr<osg::Geode>   _proxySurfaceGeode;

        // proxy geometry used for intersections, bounds, etc.
        osg::ref_ptr<ProxyGeometry> _proxyGeom;
    };
} } } // namespace osgEarth::Drivers::RexTerrainEngine

#endif // OSGEARTH_DRIVERS_REX_SURFACE_NODE
