コード例 #1
0
 private void initialize()
 {
     jointing[0] = null;
     jointing[1] = null;
     start       = null;
     end         = null;
 }
コード例 #2
0
 public OriEdge(OriVertex x1, OriVertex x2)
 {
     initialize();
     this.start = x1;
     this.end   = x2;
     direction  = x1.p - x2.p;
 }
コード例 #3
0
 public bool IsExitVertex(OriVertex v)
 {
     if (v == start || v == end)
     {
         return(true);
     }
     return(false);
 }
コード例 #4
0
 private void AddVertex(OriVertex v, int num)
 {
     if (num != 0)
     {
         edges.Add(new OriEdge(vertexs[edges.Count - 1], v));
     }
     vertexs.Insert(num, v);
 }
コード例 #5
0
 public OriEdge(OriVertex x1, OriVertex x2)
 {
     initialize();
     this.start     = x1;
     this.end       = x2;
     direction[0]   = (x1.p_origin - x2.p_origin).normalized;
     direction[1]   = (x2.p_origin - x1.p_origin).normalized;
     direction_p[0] = (x1.p - x2.p).normalized;
     direction_p[1] = (x2.p - x1.p).normalized;/*
                                                * direction = (x1.p_origin - x2.p_origin).normalized;
                                                * direction_p = (x1.p - x2.p).normalized;*/
 }
コード例 #6
0
        public void RegisterVertex(float x_origin, float y_origin, float x, float y)
        {
            x_origin *= MAX_SIZE / PAPER_SIZE;
            y_origin *= MAX_SIZE / PAPER_SIZE;
            x        *= MAX_SIZE / PAPER_SIZE;
            y        *= MAX_SIZE / PAPER_SIZE;

            OriVertex v = new OriVertex(new Vector2(x_origin, y_origin), new Vector2(x, y), vertex_count);

            vertexs.Add(v);
            vertex_count++;
        }
コード例 #7
0
        public List <OriEdge> EdgesIncludeVertex(OriVertex v)
        {
            List <OriEdge> edge = new List <OriEdge>();

            for (int i = 0; i < edges.Count; i++)
            {
                if (edges[i].IsExitVertex(v))
                {
                    edge.Add(edges[i]);
                }
            }
            return(edge);
        }
コード例 #8
0
 private void AddVertex(OriVertex v, int num)
 {
     vertexs.Add(v);
 }
コード例 #9
0
 public OriVertex oppositeVertex(OriVertex v)
 {
     return(v == start ? end : start);
 }
コード例 #10
0
        public void RegisterVertex(float x_origin, float y_origin, float x, float y)
        {
            OriVertex v = new OriVertex(new Vector2(x_origin, y_origin), new Vector2(x, y));

            vertexs.Add(v);
        }