示例#1
0
        public TSOForm(TSOConfig tso_config, string[] args)
        {
            this.tso_config = tso_config;

            InitializeComponent();
            this.ClientSize = tso_config.ClientSize;

            this.DragDrop += new DragEventHandler(form_OnDragDrop);
            this.DragOver += new DragEventHandler(form_OnDragOver);

            this.UserResized += delegate(Object sender, EventArgs e)
            {
            userResized = true;
            };

            this.viewer = new Viewer();
            viewer.ScreenColor = tso_config.ScreenColor;

            this.fig_form = new FigureForm();

            if (viewer.InitializeApplication(this, tso_config))
            {
            viewer.figures.FigureEvent += delegate(object sender, EventArgs e)
            {
                Figure fig;
                if (viewer.figures.TryGetFigure(out fig))
                    fig_form.SetFigure(fig);
                else
                    fig_form.Clear();
            };
            viewer.Camera.SetTranslation(tso_config.Position);
            foreach (string arg in args)
                viewer.figures.LoadAnyFile(arg, true);
            if (viewer.figures.Count == 0)
                viewer.figures.LoadAnyFile(Path.Combine(save_path, @"system.tdcgsav.png"), true);
            //this.timer1.Enabled = true;
            }

            directInput = new DirectInput();
            keyboard = new Keyboard(directInput);
            keyboard.Acquire();

            keyboardState = keyboard.GetCurrentState();
        }
示例#2
0
        public TSOForm(TSOConfig tso_config, string[] args)
        {
            InitializeComponent();
            this.ClientSize = tso_config.ClientSize;
            if (tso_config.PseudoFullScreen)
            {
                this.FormBorderStyle = FormBorderStyle.None;
            }
            if (tso_config.Keying)
            {
                this.TransparencyKey = tso_config.ScreenColor;
            }

            for (int i = 0; i < keysEnabled.Length; i++)
            {
                keysEnabled[i] = true;
            }
            this.KeyDown += new KeyEventHandler(form_OnKeyDown);
            this.KeyUp   += new KeyEventHandler(form_OnKeyUp);

            this.DragDrop += new DragEventHandler(form_OnDragDrop);
            this.DragOver += new DragEventHandler(form_OnDragOver);

            this.viewer        = new Viewer();
            viewer.Windowed    = tso_config.Windowed;
            viewer.DeviceSize  = tso_config.DeviceSize;
            viewer.ScreenColor = tso_config.ScreenColor;
            viewer.Ambient     = tso_config.Ambient;
            viewer.HohoAlpha   = tso_config.HohoAlpha;
            viewer.XRGBDepth   = tso_config.XRGBDepth;
            viewer.SetDepthMapFormat(tso_config.DepthMapFormat);
            viewer.SetNormalMapFormat(tso_config.NormalMapFormat);
            viewer.SetProjectionMode(tso_config.ProjectionMode);
            viewer.SetRenderMode(tso_config.RenderMode);
            viewer.MainGel   = tso_config.MainGel;
            viewer.ScreenDof = tso_config.ScreenDof;

            this.figureForm = new FigureForm();
            this.configForm = new ConfigForm();

            CameraConfig    camera_config    = new CameraConfig();
            DepthMapConfig  depthmap_config  = new DepthMapConfig();
            OcclusionConfig occlusion_config = new OcclusionConfig();
            DiffusionConfig diffusion_config = new DiffusionConfig();

            viewer.CameraConfig    = camera_config;
            viewer.DepthMapConfig  = depthmap_config;
            viewer.OcclusionConfig = occlusion_config;
            viewer.DiffusionConfig = diffusion_config;

            configForm.CameraConfig    = camera_config;
            configForm.DepthMapConfig  = depthmap_config;
            configForm.OcclusionConfig = occlusion_config;
            configForm.DiffusionConfig = diffusion_config;
            configForm.ConfigConnect();

            this.record = new Record(viewer, tso_config.RecordStep);

            if (viewer.InitializeApplication(this, true))
            {
                viewer.ConfigConnect();
                figureForm.SetViewer(viewer);
                viewer.FigureSelectEvent += delegate(object sender, EventArgs e)
                {
                    Figure fig;
                    if (viewer.TryGetFigure(out fig))
                    {
                        figureForm.SetFigure(fig);
                    }
                    else
                    {
                        figureForm.Clear();
                    }
                };
                viewer.Camera.SetTranslation(0.0f, +10.0f, +44.0f);
                foreach (string arg in args)
                {
                    viewer.LoadAnyFile(arg, true);
                }
                if (viewer.FigureList.Count == 0)
                {
                    viewer.LoadAnyFile(Path.Combine(save_path, "system.tdcgsav.png"), true);
                }

                this.timer1.Enabled = true;
            }
        }
示例#3
0
 public void SetViewer(Viewer viewer)
 {
     this.viewer = viewer;
 }
示例#4
0
        public TSOForm(TSOConfig tso_config, string[] args)
        {
            InitializeComponent();
            this.ClientSize = tso_config.ClientSize;
            this.AllowDrop  = true;

            for (int i = 0; i < keysEnabled.Length; i++)
            {
                keysEnabled[i] = true;
            }
            this.KeyDown += new KeyEventHandler(form_OnKeyDown);
            this.KeyUp   += new KeyEventHandler(form_OnKeyUp);

            this.DragDrop += new DragEventHandler(form_OnDragDrop);
            this.DragOver += new DragEventHandler(form_OnDragOver);

            this.viewer   = new Viewer(false);
            this.fig_form = new FigureForm();
            this.tbr      = new TransBoneRotation();

            if (viewer.InitializeApplication(this, true))
            {
                viewer.FigureEvent += delegate(object sender, EventArgs e)
                {
                    Figure fig;
                    if (viewer.TryGetFigure(out fig))
                    {
                        viewer.Camera.SetCenter(fig.Center);
                    }
                };
                viewer.FigureEvent += delegate(object sender, EventArgs e)
                {
                    Figure fig;
                    if (viewer.TryGetFigure(out fig))
                    {
                        fig_form.SetFigure(fig);
                    }
                    else
                    {
                        fig_form.Clear();
                    }
                };
                foreach (string arg in args)
                {
                    viewer.LoadAnyFile(arg, true);
                }

                // �����|�[�Y��TMO�𓾂Ă���
                Figure fig_forPose;
                viewer.TryGetFigure(out fig_forPose);
                tbr.SetInitPose(fig_forPose);

                /*string script_file = Path.Combine(Application.StartupPath, "Script.cs");
                 * if (File.Exists(script_file))
                 * {
                 *  var script = CSScript.Load(script_file).CreateInstance("TDCG.Script").AlignToInterface<IScript>();
                 *  script.Hello(viewer);
                 * }*/

                this.timer1.Enabled = true;

                viewer.Camera.Translation = new Vector3(0.0f, 0.0f, +50.0f);
            }
        }