private void Spectro_Load(object sender, EventArgs e) { // Initialize the data manager. This will read in all data files and prepare internal data model. _dataManager.InitializeData(); // Initilialize the utilities calss with datamanager Utilities.TheDataManager = _dataManager; // Initialize the two main rendering controls now that all other data has been initialized. SEQUENCE OF OPERATIONS IS IMPORTANT. CommonScene[] scenes = new CommonScene[] { fullSpectralScene1, rgbScene1 }; foreach (CommonScene scene in scenes) { scene.RenderSettings = _renderSettings; scene.DataManager = _dataManager; scene.LoadContent(); scene.PrepareForRendering(); } // Object selection state. _selectedObjectId = -1; _selectedObjectName = string.Empty; // Set Light Source in the scene lightSourceComboBox.Items.AddRange(_dataManager.LightSources.ToArray()); lightSourceComboBox.SelectedIndex = 0; // Set MaterialComboBox starting state. materialComboBox.Items.AddRange(_dataManager.Materials.ToArray()); materialComboBox.SelectedIndex = 0; materialComboBox.Enabled = false; // Set Observers. observerComboBox.Items.AddRange(_dataManager.Observers.ToArray()); observerComboBox.SelectedIndex = 0; // Set key value. int startingKeyValue = 1; KeyValueBar.Value = startingKeyValue; KeyValueCounter.Text = startingKeyValue.ToString(); _renderSettings.Key = startingKeyValue; // Set Light Strength int startingLightStrength = 60; LightStrengthBar.Value = startingLightStrength; LightStrengthCounter.Text = startingLightStrength.ToString(); _renderSettings.LightStrength = startingLightStrength; // Set ClipInvisible checkbox. clipInvisbleCheckBox.CheckState = CheckState.Checked; // Set Charts displays UpdateMaterialChart(_dataManager.Materials[0]); UpdateLightChart(_dataManager.LightSources[0]); UpdateObserverChart(_dataManager.Observers[0]); // Update some other things. fullSpectralScene1.Animate = animateCheckbox.Checked; rgbScene1.Animate = animateCheckbox.Checked; }
private void Spectro_Load(object sender, EventArgs e) { // Initialize the data manager. This will read in all data files and prepare internal data model. _dataManager.InitializeData(); // Initilialize the utilities calss with datamanager Utilities.TheDataManager = _dataManager; // Initialize the two main rendering controls now that all other data has been initialized. SEQUENCE OF OPERATIONS IS IMPORTANT. CommonScene[] scenes = new CommonScene[] { fullSpectralScene1, rgbScene1 }; foreach (CommonScene scene in scenes) { scene.RenderSettings = _renderSettings; scene.DataManager = _dataManager; scene.LoadContent(); scene.PrepareForRendering(); } // Object selection state. _selectedObjectId = -1; _selectedObjectName = string.Empty; // Set Light Source in the scene lightSourceComboBox.Items.AddRange(_dataManager.LightSources.ToArray()); lightSourceComboBox.SelectedIndex = 0; // Set MaterialComboBox starting state. materialComboBox.Items.AddRange(_dataManager.Materials.ToArray()); materialComboBox.SelectedIndex = 0; materialComboBox.Enabled = false; // Set Observers. observerComboBox.Items.AddRange(_dataManager.Observers.ToArray()); observerComboBox.SelectedIndex = 0; // Set key value. int startingKeyValue = 1; KeyValueBar.Value = startingKeyValue; KeyValueCounter.Text = startingKeyValue.ToString(); _renderSettings.Key = startingKeyValue; // Set Light Strength int startingLightStrength = 60; LightStrengthBar.Value = startingLightStrength; LightStrengthCounter.Text = startingLightStrength.ToString(); _renderSettings.LightStrength = startingLightStrength; // Set ClipInvisible checkbox. clipInvisbleCheckBox.CheckState = CheckState.Checked; // Set Charts displays UpdateMaterialChart(_dataManager.Materials[0]); UpdateLightChart(_dataManager.LightSources[0]); UpdateObserverChart(_dataManager.Observers[0]); // Update some other things. fullSpectralScene1.Animate = animateCheckbox.Checked; rgbScene1.Animate = animateCheckbox.Checked; }