// Copyright (C) Stichting Deltares 2023. 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.Collections.Generic; namespace Deltares.DamEngine.Data.Geometry; /// /// Class holding the waternet. /// public class Waternet : GeometryObject { private PhreaticLine phreaticLine; /// /// Initializes a new instance of the class. /// public Waternet() { IsGenerated = false; } /// /// Gets or sets the phreatic line. /// /// /// The phreatic line. /// public PhreaticLine PhreaticLine { get { return phreaticLine; } set { phreaticLine = value; if (phreaticLine != null) { if (phreaticLine.Points.Count == 0 && phreaticLine.CalcPoints.Count > 0) { phreaticLine.SyncPoints(); } } } } /// /// Gets the head line list. /// /// /// The head line list. /// public List HeadLineList { get; } = new List(); /// /// Gets the waternet line list. /// /// /// The waternet line list. /// public List WaternetLineList { get; } = new List(); /// /// Gets or sets the unit weight. /// /// /// The unit weight. /// public double UnitWeight { get; set; } = GeometryConstants.VolumicWeightOfWater; /// /// Gets or sets a value indicating whether this instance is generated. /// /// /// true if this instance is generated; otherwise, false. /// public bool IsGenerated { get; set; } /// /// Adds the waternet line. /// /// A waternet line. public void AddWaternetLine(WaternetLine aWaternetLine) { if (!WaternetLineList.Contains(aWaternetLine)) { aWaternetLine.SyncPoints(); WaternetLineList.Add(aWaternetLine); } } }