/* osgEarth
 * Copyright 2025 Pelican Mapping
 * MIT License
 */
#ifndef OSGEARTH_UTIL_LINE_OF_SIGHT_H
#define OSGEARTH_UTIL_LINE_OF_SIGHT_H

#include <osgEarth/Common>
#include <osg/Group>

namespace osgEarth { namespace Contrib
{
    using namespace osgEarth;

    struct LineOfSight
    {
        /**
         * The line of sight display mode
         */
        enum DisplayMode
        {
            /**
             * Split mode draws a line in the good color from the start of the line to the first hit, then a bad line from the hit to the end
             */
            MODE_SPLIT,
            /**
             * Single mode draws a single line from start to end and colors it good or bad depending on whether there is line of sight or not.
             */
            MODE_SINGLE
        };
    };


    /**
     * Base class for LOS node implementations
     */
    class /* no export */ LineOfSightNode : public osg::Group
    {
    public:
        LineOfSightNode() { }
        virtual ~LineOfSightNode() { }
    };


    /** 
     * Callback for LOS change notifications 
     */
    struct LOSChangedCallback : public osg::Referenced
    {
    public:
        virtual void onChanged() {};

        /** dtor */
        virtual ~LOSChangedCallback() { }
    };

    typedef std::list< osg::ref_ptr<LOSChangedCallback> > LOSChangedCallbackList;


} } // namespace osgEarth::Util

#endif // OSGEARTH_UTIL_LINE_OF_SIGHT_H
