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

#include "Common"
#include <osg/Vec3>
#include <osg/Matrix>
#include <osg/GL>
#include <stdint.h> // for uintptr_t

namespace osgEarth {
    namespace Util {
        class OceanNode;
    }
}

namespace osgEarth { namespace Triton
{
    /** Enumerates the ocean quality settings used in Ocean::SetQuality() */
    enum OceanQuality {
        GOOD,
        BETTER,
        BEST
    };

    class OSGEARTHTRITON_EXPORT BreakingWavesParameters
    {
    public:
        void SetSteepness(float);
        float GetSteepness() const;

        void SetWavelength(float);
        float GetWavelength() const;

    public:
        BreakingWavesParameters(uintptr_t handle) : _handle(handle) { }
        uintptr_t _handle;
    };

    class OSGEARTHTRITON_EXPORT Environment
    {
    public:
        void SetDirectionalLight(const osg::Vec3& dir, const osg::Vec3& color);
        osg::Vec3 GetLightDirection() const;
        osg::Vec3 GetDirectionalLightColor() const;

        void SetAmbientLight(const osg::Vec3& color);
        osg::Vec3 GetAmbientLightColor() const;

        void SetSunIntensity(float intensity);
        float GetSunIntensity() const;

        BreakingWavesParameters GetBreakingWavesParameters() const;

        void SimulateSeaState(double bs, double winddir);

        void SetAboveWaterVisibility(double visibility, osg::Vec3 fog_color);
        void GetAboveWaterVisibility(double &visibility, osg::Vec3 &fog_color) const;

        void SetEnvironmentMap(GLuint id, const osg::Matrixd &textureMatrix = osg::Matrixd());
        GLuint GetEnvironmentMap() const;
        osg::Matrixd GetEnvironmentMapMatrix() const;
    public:
        Environment(uintptr_t handle) : _handle(handle) { }
        uintptr_t _handle;
    };

    class OSGEARTHTRITON_EXPORT Ocean
    {
    public:
        void SetChoppiness(float);
        float GetChoppiness() const;

        void EnableWireframe(bool wireframe);

        void SetQuality(OceanQuality value);
        OceanQuality GetQuality() const;

        void EnableSpray(bool enabled);
        bool SprayEnabled() const;

        void EnableGodRays(bool enabled);
        bool GodRaysEnabled() const;

        void SetGodRaysFade(float fadeAmount);
        float GetGodRaysFade() const;

    public:
        Ocean(uintptr_t handle) : _handle(handle) { }
        uintptr_t _handle;
    };

} } // namespace osgEarth::SilverLining

#endif // OSGEARTH_TRITON_API_WRAPPER
