Esempio n. 1
0
        private void DrawOrientedEdge(Graphics g, OrientEdgeModel edge, vec2 min, vec2 max)
        {
            vec2 A = new vec2(edge.PosA);
            vec2 B = new vec2(edge.PosB);

            if (Clip.RectangleClip(ref A, ref B, min, max))
            {
                g.DrawLine(pen, A.x, A.y, B.x, B.y);
            }
            B = new vec2(edge.PosB);
            vec2 C = new vec2(edge.PosC);

            if (Clip.RectangleClip(ref B, ref C, min, max))
            {
                g.DrawLine(pen, B.x, B.y, C.x, C.y);
            }
            C = new vec2(edge.PosC);
            vec2 D = new vec2(edge.PosD);

            if (Clip.RectangleClip(ref C, ref D, min, max) && (C - D).Length() > 6)
            {
                endPen.Color = pen.Color;
                endPen.Width = pen.Width;
                if (!D.Equals(edge.PosD))
                {
                    ServiceFunctions.Swap(ref D, ref C);
                }
                g.DrawLine(endPen, C.x, C.y, D.x, D.y);
            }
            if (edge.Weighted && Clip.SimpleClip(new vec2(edge.WeightPos.x + 5f, edge.WeightPos.y + 5f), max, min, GlobalParameters.Radius))
            {
                DrawWeight(g, edge, min, max);
            }
        }
Esempio n. 2
0
            public override string ToString()
            {
                string _to = string.Format(
                    ",{0},{1}",
                    round(to.x),
                    round(to.y)
                    );

                return(string.Format(
                           "_V,{0},{1},{2},{3},{4}{5}",
                           easing,
                           start,
                           endtime(start, end),
                           round(from.x),
                           round(from.y),
                           from.Equals(to) ? "" : _to
                           ));
            }
Esempio n. 3
0
 /// <summary>
 /// Returns true iff this equals rhs type- and component-wise.
 /// </summary>
 public static bool Equals(vec2 v, object obj) => v.Equals(obj);
Esempio n. 4
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public static bool Equals(vec2 v, vec2 rhs) => v.Equals(rhs);