PixelFarm.Agg.VertexStore.GetVertexXY C# (CSharp) Method

GetVertexXY() public method

public GetVertexXY ( int index, double &x, double &y ) : void
index int
x double
y double
return void
        public void GetVertexXY(int index, out double x, out double y)
        {
            int i = index << 1;
            x = m_coord_xy[i];
            y = m_coord_xy[i + 1];
        }
        public VertexCmd GetCommand(int index)

Usage Example

        static bool IsCW(VertexStore myvxs, int start, int end)
        {
            // Calculate signed area (double area to be exact)
            //---------------------
            int    np   = end - start;
            double area = 0.0;
            int    i;

            for (i = 0; i < np; i++)
            {
                double x1, y1, x2, y2;
                myvxs.GetVertexXY(start + i, out x1, out y1);
                myvxs.GetVertexXY(start + (i + 1) % np, out x2, out y2);
                area += x1 * y2 - y1 * x2;
            }
            return(area < 0.0);
            //return (area < 0.0) ? ShapePath.FlagsAndCommand.FlagCW : ShapePath.FlagsAndCommand.FlagCCW;
        }