Files
wg_cpso/CaeGlobals/CommonClasses/DataExchange/CellsExchangeData.cs

54 lines
1.7 KiB
C#
Raw Permalink Normal View History

2026-03-25 18:20:24 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace CaeGlobals
{
[Serializable]
public class CellsExchangeData
{
// Variables
public int[] Ids;
public int[][] CellNodeIds;
public int[] Types;
public float[] Values;
// Constructors
public CellsExchangeData()
{
Reset();
}
public CellsExchangeData(CellsExchangeData cellsExchangeData)
{
Reset();
//
if (cellsExchangeData.Ids != null) Ids = cellsExchangeData.Ids.ToArray();
if (cellsExchangeData.CellNodeIds != null)
{
CellNodeIds = new int[cellsExchangeData.CellNodeIds.Length][];
for (int i = 0; i < CellNodeIds.Length; i++) CellNodeIds[i] = cellsExchangeData.CellNodeIds[i].ToArray();
}
if (cellsExchangeData.Types != null) Types = cellsExchangeData.Types.ToArray();
if (cellsExchangeData.Values != null) Values = cellsExchangeData.Values.ToArray();
}
// Methods
private void Reset()
{
Ids = null;
CellNodeIds = null;
Types = null;
Values = null;
}
public CellsExchangeData DeepCopy()
{
return new CellsExchangeData(this);
}
}
}