コード例 #1
0
        private void DrawVector2D(DirectedEdge edge)
        {
            Vector2DInfo vectorInfo = new Vector2DInfo(new Point(VertexCoords[edge.Begin].X, VertexCoords[edge.Begin].Y),
                                                       new Point(VertexCoords[edge.End].X, VertexCoords[edge.End].Y));

            Gl.glBegin(Gl.GL_LINES);
            Gl.glVertex2d(vectorInfo.Begin.X, vectorInfo.Begin.Y);
            Gl.glVertex2d(vectorInfo.End.X, vectorInfo.End.Y);

            Gl.glVertex2d(vectorInfo.End.X, vectorInfo.End.Y);
            Gl.glVertex2d(vectorInfo.End.X + vectorInfo.LeftArrowPoint.X,
                          vectorInfo.End.Y + vectorInfo.LeftArrowPoint.Y);

            Gl.glVertex2d(vectorInfo.End.X, vectorInfo.End.Y);
            Gl.glVertex2d(vectorInfo.End.X + vectorInfo.RightArrowPoint.X,
                          vectorInfo.End.Y + vectorInfo.RightArrowPoint.Y);
            Gl.glEnd();
        }
コード例 #2
0
        private void DrawVector2D(DirectedEdge edge)
        {
            Vector2DInfo vectorInfo = new Vector2DInfo(new Point(VertexCoords[edge.Begin].X, VertexCoords[edge.Begin].Y),
                                                       new Point(VertexCoords[edge.End].X, VertexCoords[edge.End].Y));

            Gl.glBegin(Gl.GL_LINES);
            Gl.glVertex2d(vectorInfo.Begin.X, vectorInfo.Begin.Y);
            Gl.glVertex2d(vectorInfo.End.X, vectorInfo.End.Y);

            Gl.glVertex2d(vectorInfo.End.X, vectorInfo.End.Y);
            Gl.glVertex2d(vectorInfo.End.X + vectorInfo.LeftArrowPoint.X,
                          vectorInfo.End.Y + vectorInfo.LeftArrowPoint.Y);

            Gl.glVertex2d(vectorInfo.End.X, vectorInfo.End.Y);
            Gl.glVertex2d(vectorInfo.End.X + vectorInfo.RightArrowPoint.X,
                          vectorInfo.End.Y + vectorInfo.RightArrowPoint.Y);
            Gl.glEnd();
        }