/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
 * Copyright 2008-2016 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_BUILDINGS_PARAPET_H
#define OSGEARTH_BUILDINGS_PARAPET_H

#include "Common"
#include "Elevation"
#include <osgEarth/Geometry>

namespace osgEarth { namespace Buildings
{
    using namespace osgEarth;

    class BuildContext;
    
    /**
     * Low wall along the edge of a roof.
     */
    class OSGEARTHBUILDINGS_EXPORT Parapet : public Elevation
    {
    public:
        /** Constructor */
        Parapet();

        Parapet(const Parapet& rhs);

        virtual Elevation* clone() const;

        /**
         * Width of the parapet, in meters
         */
        void setWidth(float value);
        float getWidth() const { return _width.get(); }

    public: // Elevation

        virtual Config getConfig() const;

        virtual bool isDetail() const { return true; }

    protected:
        virtual ~Parapet() { }

        virtual bool buildImpl(const Polygon* footprint, BuildContext& bc) override;

        optional<float> _width;
    };
} }

#endif // OSGEARTH_BUILDINGS_PARAPET_H
