// Copyright (C) Stichting Deltares 2025. All rights reserved. // // This file is part of the Dam Engine. // // The Dam Engine is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System; using Deltares.DamEngine.Data.Standard; namespace Deltares.DamEngine.Data.Geometry; /// /// Base class for all Geometry objects /// [Serializable] public abstract class GeometryObject : IGeometryObject, IName { private string name = ""; #region IGeometryObject Members /// /// Gets or sets the name. /// /// /// The name. /// public virtual string Name { get { return name; } set { if (value != null) { name = value; } } } #endregion /// /// Gets the geometry bounds. /// /// public virtual GeometryBounds GetGeometryBounds() { return null; } /// /// Rounds given value to given accuracy (by default the geometry accuracy is used) /// /// /// /// the value rounded to the requested accuracy public static double RoundValue(double originalValue, double accuracy = GeometryConstants.Accuracy) => Math.Round(originalValue / accuracy) * accuracy; /// /// Returns a that represents this instance. /// /// /// A that represents this instance. /// public override string ToString() { return Name; } }