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)); }
/// <summary> /// Gets the shape that this graph represents. If no output node is present, /// an empty shape is returned. /// </summary> /// <returns>IExplicitShape<GridPoint2>.</returns> public IExplicitShape <GridPoint2> GetShape() { Recompute(); foreach (var outputNode in Nodes.OfType <OutputShape2Node>()) { return(outputNode.Output[0]); } return(ExplicitShape.Empty2()); }
/// <summary> /// Gets the shape that this graph represents. If no output node is present, /// an empty shape is returned. /// </summary> /// <returns>IExplicitShape<System.Int32>.</returns> public IExplicitShape <int> GetShape() { Recompute(); foreach (var outputNode in Nodes.OfType <OutputShape1Node>()) { return(outputNode.Output[0]); } return(ExplicitShape.Empty1()); }
protected override IExplicitShape <int> Generate() { return(ExplicitShape.Segment(size)); }
protected override IExplicitShape <GridPoint3> Generate() { var dimensionsGridPoint = dimensions.GetGridPoint(); return(ExplicitShape.Parallelepiped(dimensionsGridPoint)); }
protected override IExplicitShape <int> Generate() { return(ExplicitShape.Bitmask(mask)); }
protected override IExplicitShape <GridPoint3> Generate() { return(ExplicitShape.Single3()); }
protected override IExplicitShape <int> Generate() { return(ExplicitShape.Single1()); }
protected override IExplicitShape <GridPoint2> Generate() { var dimensions1 = dimensions.GetGridPoint(); return(ExplicitShape.Parallelogram(dimensions1)); }