コード例 #1
0
        public IPath CreatePath(IList <PathPoint> origins)
        {
            if (origins == null)
            {
                throw new ArgumentNullException(nameof(origins));
            }
            if (origins.Count != 3)
            {
                throw new ArgumentOutOfRangeException(nameof(origins));
            }

            var segments = new PathSegmentList()
            {
                new LinePathSegment()
                {
                    Origin = origins[0]
                },
                new LinePathSegment()
                {
                    Origin = origins[1]
                },
                new LinePathSegment()
                {
                    Origin = origins[2]
                }
            };

            var path = new Path(this, segments);

            return(path);
        }
コード例 #2
0
ファイル: Path.cs プロジェクト: rgtodd/quiltsystem
        protected Path(Path prototype)
        {
            if (prototype == null)
            {
                throw new ArgumentNullException(nameof(prototype));
            }

            m_pathGeometry = prototype.m_pathGeometry;
            m_segments     = prototype.m_segments.Clone();
        }
コード例 #3
0
ファイル: Path.cs プロジェクト: rgtodd/quiltsystem
        public Path(JToken json)
        {
            if (json == null)
            {
                throw new ArgumentNullException(nameof(json));
            }

            m_pathGeometry = PathGeometryFactory.Create(json[JsonNames.PathGeometry]);
            m_segments     = new PathSegmentList(json[JsonNames.Segments]);
        }
コード例 #4
0
ファイル: Path.cs プロジェクト: rgtodd/quiltsystem
 public Path(IPathGeometry pathGeometry, PathSegmentList segments)
 {
     m_pathGeometry = pathGeometry ?? throw new ArgumentNullException(nameof(pathGeometry));
     m_segments     = segments ?? throw new ArgumentNullException(nameof(segments));
 }