using EVE;
using EVE.EVEObjects;
using EVE.EVEShaders;
using EVE.EVECameras;
using EVE.EVELights;
using EVE.EVEOctrees;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

using System;

namespace EVEDemo
{
    public class EVEExposer
    {
        public static void SetupExposedObjects()
        {
            EVEPostProc post;
            post = new EVEPostProc(@"Content/Shaders/Inverse");
            EVEShaderManager.AddPostProc("Inverse", post);

            post = new EVEPostProc(@"Content/Shaders/BasicPost");
            EVEShaderManager.AddPostProc("BasicPost", post);

            post = new EVEPostProc(@"Content/Shaders/Sobel");
            EVEShaderManager.AddPostProc("Sobel", post);

            post = new EVEPostProc(@"Content/Shaders/GBlur");
            EVEShaderManager.AddPostProc("GBlur", post);

            post = new EVEPostProc(@"Content/Shaders/DeSaturate");
            EVEShaderManager.AddPostProc("DeSaturate", post);
        }

        public static void POST_CLEAR()
        {
            EVEShaderManager.ClearPost();
        }

        public static void POST_ADD_INVERSE()
        {
            EVEShaderManager.AddToPost("Inverse");
        }

        public static void POST_ADD_SOBEL()
        {
            EVEShaderManager.AddToPost("Sobel");
        }

        public static void POST_ADD_GBLUR()
        {
            EVEShaderManager.AddToPost("GBlur");
        }

        public static void POST_ADD_DESAT()
        {
            EVEShaderManager.AddToPost("DeSaturate");
        }

        public static void CAMERA_TRANSLATE(float x, float y, float z)
        {
            EVECameraManager.ActiveCamera.Translate(new Vector3(x, y, z));
        }

        public static void CAMERA_ROTATE(float x, float y, float z, float a)
        {
            EVECameraManager.ActiveCamera.Rotate(new Vector3(x,y,z), a);
        }

        public static void CAMERA_REVOLVE(float xt, float yt, float zt, float x,float y, float z, float a)
        {
            EVECameraManager.ActiveCamera.Revolve(new Vector3(xt,yt,zt), new Vector3(x, y, z), a);
        }
        
        public static void CAMERA_LOOKAT(float x, float y, float z)
        {
            EVECameraManager.ActiveCamera.LookAt(new Vector3(x,y,z));
        }

        public static void CAMERA_SETPOS(float x, float y, float z)
        {
            EVECameraManager.ActiveCamera.Position = new Vector3(x, y, z);
        }

        public static void CAMERA_ADD(string cameraLabel)
        {
            EVECamera newCamera = new EVECamera(EVECameraManager.ActiveCamera.Viewport);
            EVECameraManager.AddCamera(newCamera, cameraLabel);
        }

        public static void CAMERA_SET(string cameraLabel)
        {
            EVECameraManager.SetActiveCamera(cameraLabel);
        }

        public static void LIGHT_ADD(string lightLabel)
        {
            EVELight newLight = new EVELight();
            EVELightManager.AddLight(newLight, lightLabel);
        }

        public static void LIGHT_SET(string lightLabel)
        {
            EVELightManager.SetActiveLight(lightLabel);
        }

        public static void LIGHT_TRANSLATE(float x, float y, float z)
        {
            EVELightManager.ActiveLight.Position = EVELightManager.ActiveLight.Position + new Vector3(x, y, z);
        }

        public static void LIGHT_SETPOS(float x, float y, float z)
        {
            EVELightManager.ActiveLight.Position = new Vector3(x, y, z);
        }

        public static void LIGHT_SETDIFFUSE(float x, float y, float z)
        {
            EVELightManager.ActiveLight.DiffuseColor = new Vector3(x, y, z);
        }

        public static void LIGHT_SETSPECULAR(float x, float y, float z)
        {
            EVELightManager.ActiveLight.SpecularColor = new Vector3(x, y, z);
        }

        public static void OCT_GRID_OFF()
        {
            EVEOctreeManager.DrawOctNodes = false;
        }

        public static void OCT_GRID_ON()
        {
            EVEOctreeManager.DrawOctNodes = true;
        }


    }
}