예제 #1
0
        //Methods ------------------------------------------------------------------------------------------------------------------------------------
        public WaveTableEngine(TableManager tmgr)
        {
            _simulationObjects = new List<SimulationObject>();

            _tableManager = tmgr;
            _tableManager.OnNewLongTermObject += new TableManager.TableManagerObjectChange(_tableManager_OnNewLongTermObject);
            _tableManager.OnNewObject += new TableManager.TableManagerObjectChange(_tableManager_OnNewObject);
            _tableManager.OnObjectMove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectMove);
            _tableManager.OnObjectRemove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectRemove);
            _tableManager.OnObjectRotate += new TableManager.TableManagerObjectChange(_tableManager_OnObjectRotate);

            _tableManager.BeamerScreen.OnMouseClick += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseClick);
            _tableManager.BeamerScreen.OnMouseMoveDown += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseMoveDown);

            _waveEngine = new WaveEngine();
            _waveEngine.OnNewSimulationFrame += new WaveEngine.NewSimulationFrameHandler(_waveEngine_OnNewSimulationFrame);

            _dynColVis = new DynamicColorVisualizer();

            _mapManager = new MapManager(_waveEngine);

            _updateTimer = new Timer(1000);
            _updateTimer.Enabled = false;
            _updateTimer.Elapsed += new ElapsedEventHandler(_updateTimer_Elapsed);
        }
예제 #2
0
        //Methods ------------------------------------------------------------------------------------------------------------------------------------
        public WaveTableEngine(TableManager tmgr)
        {
            _simulationObjects = new List<SimulationObject>();

            _tableManager = tmgr;
            _tableManager.OnObjectMove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectMove);
            _tableManager.OnNewObjectList += new TableManager.TableManagerObjectHandler(_tableManager_OnNewObjectList);
            _tableManager.BeamerScreen.OnMouseClick += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseClick);
            _tableManager.BeamerScreen.OnMouseMoveDown += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseMoveDown);

            _waveEngine = new WaveEngine();
            _waveEngine.OnNewSimulationFrame += new WaveEngine.NewSimulationFrameHandler(_waveEngine_OnNewSimulationFrame);

            _mapManager = new MapManager(_waveEngine);

            _dynColVis = new DynamicColorVisualizer();
        }
예제 #3
0
 public MapManager(WaveEngine waveEngine)
 {
     _waveEngineRef = waveEngine;
 }
예제 #4
0
파일: SimForm.cs 프로젝트: AtiX/wavesim
        private void Form1_Load(object sender, EventArgs e)
        {
            Engine = new WaveEngine();
            Engine.OnNewSimulationFrame += new WaveEngine.NewSimulationFrameHandler(Engine_OnNewSimulationFrame);
            Engine.Init(pb_image.Width / _resDiv, pb_image.Height / _resDiv);

            dcv = new DynamicColorVisualizer();

            tsCbMouseAction.SelectedIndex = 0;
            tsCbMouseValue.SelectedIndex = 9;
            tsCbSimResolution.SelectedIndex = 3;

            if (_fileToLoad != "")
            {
                WaveSettings set = Engine.Settings;

                bool result = set.LoadFromFile(_fileToLoad);

                if (!result)
                {
                    MessageBox.Show("An error occured whilst loading the file!", "Load");
                    return;
                }

                //Resize window
                int deltaWidth = this.Width - pb_image.Width;
                int deltaHeight = this.Height - pb_image.Height;

                Size windowS = new Size(set.Width * _resDiv + deltaWidth, set.Height * _resDiv + deltaHeight);
                this.Size = windowS;

                Engine.Settings = set;
                //MessageBox.Show("File loaded successfully!", "Load");
            }

            String PersonalFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.InitialDirectory = PersonalFolder + "\\WaveSim";
            openFileDialog.InitialDirectory = PersonalFolder + "\\WaveSim";

            Engine.Start();
        }