コード例 #1
0
 public override void MakeSchemaCompliant()
 {
     base.MakeSchemaCompliant();
     NumberOfDimensions.MakeSchemaCompliant();
     CellGeometry.MakeSchemaCompliant();
     TransformationParameterAvailability.MakeSchemaCompliant();
 }
コード例 #2
0
        public void Length_NegativeCoordinates_ShouldReturnCorrectLength()
        {
            var geometry = new CellGeometry(
                new Vector3(0, -1, -2),
                new Vector3(-1, -2, -3),
                face.Object);

            Assert.AreEqual(1.732, geometry.Length, 0.0001f);
        }
コード例 #3
0
        private IEnumerable <IPlantCell> CreateNodeCells(IPlantPartDescriptor descriptor)
        {
            var top     = descriptor.Top;
            var bottom  = new Vector3(top.X, top.Y, top.Z);
            var polygon = new Vector2[0];
            var face    = new Face(polygon);
            var geo     = new CellGeometry(top, bottom, face);
            var cell    = cellFactory.CreateCell(PlantCellType.Parenchyma, geo, new Vacuole(), new CellWall());

            return(new [] { cell });
        }
コード例 #4
0
        public IPlantCell[] Divide(IPlantCell cell, IPlantPart plantPart)
        {
            ICellGeometry geo = cell.Geometry;

            Vector3 halfPoint = GetCellHalfWay(geo);

            ICellGeometry topCellGeometry    = new CellGeometry(geo.TopCenter, halfPoint, geo.Face);
            ICellGeometry bottomCellGeometry = new CellGeometry(halfPoint, geo.BottomCenter, geo.Face);

            IPlantCell[] cells = new IPlantCell[2];

            cells[0] = CreatePlantCell(cell.CellType, topCellGeometry, cell.Vacuole, cell.CellWall);
            cells[1] = CreatePlantCell(cell.CellType, bottomCellGeometry, cell.Vacuole, cell.CellWall);

            return(cells);
        }
コード例 #5
0
        private (ICellGeometry original, ICellGeometry first, ICellGeometry second) CreateGeometries()
        {
            var face = new Face(new[]
            {
                new Vector2(0), new Vector2(0)
            });

            var top = new Vector3 {
                X = 23F, Y = 30F, Z = 10F
            };
            var bottom = new Vector3 {
                X = 10F, Y = 12F, Z = 2F
            };
            var half = new Vector3 {
                X = 16.5F, Y = 21, Z = 6
            };
            ICellGeometry original = new CellGeometry(top, bottom, face);
            ICellGeometry first    = new CellGeometry(top, half, face);
            ICellGeometry second   = new CellGeometry(half, bottom, face);

            return(original, first, second);
        }