110 lines
4.3 KiB
C#
110 lines
4.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.ComponentModel;
|
|
using System.Drawing.Design;
|
|
using DynamicTypeDescriptor;
|
|
using CaeGlobals;
|
|
|
|
namespace CPSO
|
|
{
|
|
[Serializable]
|
|
public abstract class ViewBoundaryCondition : ViewMultiRegion
|
|
{
|
|
// Variables
|
|
private string _selectionHidden;
|
|
|
|
|
|
// Properties
|
|
[Category("Data")]
|
|
[ReadOnly(false)]
|
|
[OrderedDisplayName(0, 10, "Name")]
|
|
[Description("Name of the boundary condition.")]
|
|
[Id(1, 1)]
|
|
public abstract string Name { get; set; }
|
|
//
|
|
[Category("Region")]
|
|
[OrderedDisplayName(0, 10, "Region type")]
|
|
[Description("Select the region type for the creation of the boundary condition.")]
|
|
[Id(1, 2)]
|
|
public override string RegionType { get { return base.RegionType; } set { base.RegionType = value; UpdateVisibility(); } }
|
|
//
|
|
[Category("Region")]
|
|
[OrderedDisplayName(1, 10, "Hidden")]
|
|
[Description("Hidden.")]
|
|
[Id(2, 2)]
|
|
public string SelectionHidden { get { return _selectionHidden; } set { _selectionHidden = value; } }
|
|
//
|
|
[Category("Region")]
|
|
[OrderedDisplayName(2, 10, "Node set")]
|
|
[Description("Select the node set for the creation of the boundary condition.")]
|
|
[Id(3, 2)]
|
|
public abstract string NodeSetName { get; set; }
|
|
//
|
|
[Category("Region")]
|
|
[OrderedDisplayName(3, 10, "Surface")]
|
|
[Description("Select the surface for the creation of the boundary condition.")]
|
|
[Id(4, 2)]
|
|
public abstract string SurfaceName { get; set; }
|
|
//
|
|
[Category("Region")]
|
|
[OrderedDisplayName(4, 10, "Reference point")]
|
|
[Description("Select the reference point for the creation of the boundary condition.")]
|
|
[Id(5, 2)]
|
|
public abstract string ReferencePointName { get; set; }
|
|
//
|
|
[Category("Time/Frequency")]
|
|
[OrderedDisplayName(0, 10, "Amplitude")]
|
|
[Description("Select the amplitude for the boundary condition.")]
|
|
[Id(1, 18)]
|
|
public abstract string AmplitudeName { get; set; }
|
|
//
|
|
[Category("Orientation")]
|
|
[OrderedDisplayName(0, 10, "Coordinate system")]
|
|
[Description("Select the coordinate system for the boundary condition.")]
|
|
[Id(1, 19)]
|
|
public abstract string CoordinateSystemName { get; set; }
|
|
//
|
|
[Category("Appearance")]
|
|
[DisplayName("Color")]
|
|
[Description("Select boundary condition color.")]
|
|
[Editor(typeof(UserControls.ColorEditorEx), typeof(UITypeEditor))]
|
|
[Id(1, 20)]
|
|
public abstract System.Drawing.Color Color { get; set; }
|
|
|
|
|
|
// Constructors
|
|
|
|
|
|
// Methods
|
|
public abstract CaeModel.BoundaryCondition GetBase();
|
|
public virtual void UpdateVisibility()
|
|
{
|
|
}
|
|
public override void UpdateRegionVisibility()
|
|
{
|
|
base.UpdateRegionVisibility();
|
|
// Hide SelectionHidden
|
|
if (base.RegionType == RegionTypeEnum.Selection.ToFriendlyString())
|
|
DynamicCustomTypeDescriptor.GetProperty(nameof(SelectionHidden)).SetIsBrowsable(false);
|
|
}
|
|
public void PopulateAmplitudeNames(string[] amplitudeNames)
|
|
{
|
|
List<string> names = new List<string>() { CaeModel.Amplitude.DefaultAmplitudeName };
|
|
names.AddRange(amplitudeNames);
|
|
DynamicCustomTypeDescriptor.PopulateProperty(nameof(AmplitudeName), names.ToArray(), false, 2);
|
|
}
|
|
public void PopulateCoordinateSystemNames(string[] coordinateSystemNames)
|
|
{
|
|
List<string> names = new List<string>() { CaeMesh.CoordinateSystem.DefaultCoordinateSystemName };
|
|
names.AddRange(coordinateSystemNames);
|
|
DynamicCustomTypeDescriptor.PopulateProperty(nameof(CoordinateSystemName), names.ToArray(), false, 2);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|