using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VisimBox.Renderer.RenderObjects;
using VisimBox.Scene;

namespace VisimBuilder.ObjectCreation
{
    public partial class SkyboxCreator : ObjectCreationBase
    {
        public SkyboxCreator()
        {
            InitializeComponent();
            SetDefault();
        }

        public override void Init(MainBuilderForm boss)
        {
            base.Init(boss);
        }

        public override void SetDefault()
        {
            base.SetDefault();
            labelObjectName.Text = "Skybox";
            textBoxName.Text = "Skybox";
            vectorEditing1.EditedVector = new VisiMath.Vector3(100, 100, 100);
            textureLookup1.SelectedTexture = null;
            textureLookup2.SelectedTexture = null;
            textureLookup3.SelectedTexture = null;
            textureLookup4.SelectedTexture = null;
            textureLookup5.SelectedTexture = null;
            textureLookup6.SelectedTexture = null;
        }


        public override VisimBox.Scene.Node ObjectCreation(string name, VisiMath.ITransformation itrans, VisimBox.Scene.Node owner)
        {
            SkyboxData sb = new SkyboxData(textureLookup1.SelectedTexture, textureLookup2.SelectedTexture, textureLookup3.SelectedTexture,
                textureLookup4.SelectedTexture, textureLookup5.SelectedTexture, textureLookup6.SelectedTexture,
                vectorEditing1.EditedVector);
            sb.LoadTextures();

            SkyBoxNode sbnode = new SkyBoxNode(null, sb);

            sbnode.Trans = itrans;

            owner.AddNode(sbnode, name);
            return sbnode;
        }
    }


    public class CreateSkyboxItem : CreateNewItem
    {
        public CreateSkyboxItem(MainBuilderForm boss)
            : base(boss, "Skybox", "Skybox visual object")
        {
            RefreshBaseCreator();
        }

        protected override void RefreshBaseCreator()
        {
            BaseCreator = new SkyboxCreator();
            BaseCreator.Init(Boss);
        }


    }
}
