Esempio n. 1
0
        public void XmlTest()
        {
            var          pointData = new PointCellData();
            const string name      = "Some random name 23490371";

            pointData.DataArrays.Add(new DataArray()
            {
                Name = name,
            });

            var element = XmlHelper.ToXElement(pointData);

            Assert.AreEqual(name, element.Element("DataArray").Attribute("Name").Value);
        }
        /// <summary>
        /// Builds the XML element for serializing.
        /// </summary>
        /// <returns>The <see cref="PointCellData"/> instance that represents the XML element.</returns>
        public PointCellData ToXml()
        {
            var pointData = new PointCellData()
            {
                Scalars = Scalars?.Name,
                Vectors = Vectors?.Name,
                Normals = Normals?.Name,
                Tensors = Tensors?.Name,
                TCoords = TCoords?.Name,
            };

            foreach (var item in DataArrays)
            {
                pointData.DataArrays.Add(item.ToXml());
            }

            return(pointData);
        }