internal static void DrawArrow2d(Point start, Point end)
        {
            Point normal    = EdgeIndex.GetLineNormal(start, end);
            Point direction = Vector2.Subtract(end, start);
            float length    = 0;

            Vector2.Normalize(direction, out length, out direction);
            // this length 20 should probably be a percentage of the line.
            direction.X *= 20;
            direction.Y *= 20;
            Point arrowHeadEnd = Vector2.Subtract(direction, end);

            Point arrowHead1 = new Point(arrowHeadEnd.X + (normal.X * 20), arrowHeadEnd.Y + (normal.Y * 20));
            Point arrowHead2 = new Point(arrowHeadEnd.X + (normal.X * -20), arrowHeadEnd.Y + (normal.Y * -20));

            DrawLine2d(start, end);
            DrawLine2d(arrowHead1, end);
            DrawLine2d(arrowHead2, end);
        }
Beispiel #2
0
        public override void AddEdge(EdgeIndex edge)
        {
            var v0 = Mesh.Vertices[edge.i0];
            var v1 = Mesh.Vertices[edge.i1];

            var e0 = new EDGE();
            var e1 = new EDGE();

            e0.Opposite = e1;
            e1.Opposite = e0;

            v0.Edge   = e0;
            e0.Vertex = v0;

            v1.Edge   = e1;
            e1.Vertex = v1;

            Mesh.Edges.Add(e0);
            Mesh.Edges.Add(e1);
        }
Beispiel #3
0
        private static void CreateLine <MESH>(IMeshConstructor <MESH> constructor, MeshDescriptor des)
        {
            constructor.PushEdgeMesh(des.Vertices, des.Edges);

            for (int i = 0; i < des.Vertices; i++)
            {
                Vector2f v = CGAL_GetSkeletonPoint(i);
                constructor.AddVertex(v);
            }

            for (int i = 0; i < des.Edges; i++)
            {
                EdgeIndex edge = CGAL_GetSkeletonEdge(i);
                constructor.AddEdge(edge);
            }

            int numConnections = CGAL_NumEdgeConnection();

            for (int i = 0; i < numConnections; i++)
            {
                EdgeConnection con = CGAL_GetEdgeConnection(i);
                constructor.AddEdgeConnection(con);
            }
        }
Beispiel #4
0
 public virtual void AddEdge(EdgeIndex edge)
 {
 }
Beispiel #5
0
 public override void AddEdge(EdgeIndex edge)
 {
     m_mesh.Indices[m_edgeIndex * 2 + 0] = edge.i0;
     m_mesh.Indices[m_edgeIndex * 2 + 1] = edge.i1;
     m_edgeIndex++;
 }