// // SceneObjectModel.cs - provides an ObjectModel for manipulating 3D scene graphs // // Author: // Michael Becker // // Copyright (c) 2011-2020 Mike Becker's Software // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . using UniversalEditor.ObjectModels.Multimedia3D.Model; namespace UniversalEditor.ObjectModels.Multimedia3D.Scene { /// /// Provides an for manipulating 3D scene graphs. /// public class SceneObjectModel : ObjectModel { protected override ObjectModelReference MakeReferenceInternal() { ObjectModelReference omr = base.MakeReferenceInternal(); omr.Path = new string[] { "Multimedia", "3D Multimedia", "Animation scene" }; omr.Description = "Stores model settings and camera settings for an animated or static scene in 3D space."; return omr; } public uint ImageWidth { get; set; } = 512; public uint ImageHeight { get; set; } = 384; public bool FPSVisible { get; set; } = false; public bool CoordinateAxisVisible { get; set; } = true; public bool GroundShadowVisible { get; set; } = true; public bool GroundShadowTransparent { get; set; } = false; public SceneScreenCaptureMode ScreenCaptureMode { get; set; } = SceneScreenCaptureMode.None; public float GroundShadowBrightness { get; set; } = 1.0f; public SceneModelReference.SceneModelReferenceCollection Models { get; } = new SceneModelReference.SceneModelReferenceCollection(); public SceneBrush.SceneBrushCollection Brushes { get; } = new SceneBrush.SceneBrushCollection(); public ModelVertex.ModelVertexCollection Vertices { get; } = new ModelVertex.ModelVertexCollection(); /// /// Gets or sets a value indicating whether this /// is visible. /// /// true if visible; otherwise, false. public bool Visible { get; set; } = true; public override void CopyTo(ObjectModel destination) { SceneObjectModel clone = destination as SceneObjectModel; foreach (SceneModelReference smr in this.Models) { clone.Models.Add(smr.Clone() as SceneModelReference); } clone.ImageWidth = ImageWidth; clone.ImageHeight = ImageHeight; } public override void Clear() { Models.Clear(); ImageWidth = 512; ImageHeight = 384; } /// /// Gets or sets the frame rate limit. /// /// The frame rate limit. public float FPSLimit { get; set; } = 60.0f; } }