Esempio n. 1
0
        protected override IExplicitShape <GridPoint2> Generate()
        {
            var points        = vertices.Select(p => p.GetGridPoint());
            var implicitShape = ImplicitShape.ConvexPolygon(points);
            var bounds        = GridRect.Erode(ExplicitShape.GetBounds(points));

            return(implicitShape.ToExplicit(bounds));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the shape that this graph represents. If no output node is present,
        /// an empty shape is returned.
        /// </summary>
        /// <returns>IExplicitShape&lt;GridPoint2&gt;.</returns>
        public IExplicitShape <GridPoint2> GetShape()
        {
            Recompute();

            foreach (var outputNode in Nodes.OfType <OutputShape2Node>())
            {
                return(outputNode.Output[0]);
            }

            return(ExplicitShape.Empty2());
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the shape that this graph represents. If no output node is present,
        /// an empty shape is returned.
        /// </summary>
        /// <returns>IExplicitShape&lt;System.Int32&gt;.</returns>
        public IExplicitShape <int> GetShape()
        {
            Recompute();

            foreach (var outputNode in Nodes.OfType <OutputShape1Node>())
            {
                return(outputNode.Output[0]);
            }

            return(ExplicitShape.Empty1());
        }
Esempio n. 4
0
 protected override IExplicitShape <int> Generate()
 {
     return(ExplicitShape.Segment(size));
 }
        protected override IExplicitShape <GridPoint3> Generate()
        {
            var dimensionsGridPoint = dimensions.GetGridPoint();

            return(ExplicitShape.Parallelepiped(dimensionsGridPoint));
        }
Esempio n. 6
0
 protected override IExplicitShape <int> Generate()
 {
     return(ExplicitShape.Bitmask(mask));
 }
Esempio n. 7
0
 protected override IExplicitShape <GridPoint3> Generate()
 {
     return(ExplicitShape.Single3());
 }
Esempio n. 8
0
 protected override IExplicitShape <int> Generate()
 {
     return(ExplicitShape.Single1());
 }
        protected override IExplicitShape <GridPoint2> Generate()
        {
            var dimensions1 = dimensions.GetGridPoint();

            return(ExplicitShape.Parallelogram(dimensions1));
        }