public static VertexStore CreateVxs(IEnumerable <VertexData> iter, VertexStore vxs) { foreach (VertexData v in iter) { vxs.AddVertex(v.x, v.y, v.command); } return(vxs); }
public static VertexStore CreateVxs(IEnumerable<VertexData> iter, VertexStore vxs) { foreach (VertexData v in iter) { vxs.AddVertex(v.x, v.y, v.command); } return vxs; }
public VertexStore MakeVxs(VertexStore outputVxs) { for (int i = 0; i < 8; ++i) { VertexCmd cmd; outputVxs.AddVertex(m_x[i], m_y[i], cmd = m_cmd[i]); if (cmd == VertexCmd.NoMore) { break; } } return(outputVxs); }
/// <summary> /// we do NOT store vxs, return original outputVxs /// </summary> /// <param name="src"></param> /// <param name="outputVxs"></param> /// <returns></returns> public static VertexStore TransformToVxs(this Affine aff, VertexStoreSnap src, VertexStore outputVxs) { var snapIter = src.GetVertexSnapIter(); VertexCmd cmd; double x, y; while ((cmd = snapIter.GetNextVertex(out x, out y)) != VertexCmd.NoMore) { aff.Transform(ref x, ref y); outputVxs.AddVertex(x, y, cmd); } return(outputVxs); }
public static VertexStore TransformToVxs(this Perspective perspecitveTx, VertexStoreSnap snap, VertexStore vxs) { var vsnapIter = snap.GetVertexSnapIter(); double x, y; VertexCmd cmd; do { cmd = vsnapIter.GetNextVertex(out x, out y); perspecitveTx.Transform(ref x, ref y); vxs.AddVertex(x, y, cmd); } while (!VertexHelper.IsEmpty(cmd)); return(vxs); }
public static VertexStore TransformToVxs(this Bilinear bilinearTx, VertexStore src, VertexStore vxs) { int count = src.Count; VertexCmd cmd; double x, y; for (int i = 0; i < count; ++i) { cmd = src.GetVertex(i, out x, out y); bilinearTx.Transform(ref x, ref y); vxs.AddVertex(x, y, cmd); } return(vxs); }
public static VertexStore TransformToVxs(this Perspective perspecitveTx, VertexStore src, VertexStore vxs) { VertexCmd cmd; double x, y; int count = src.Count; for (int i = 0; i < count; ++i) { cmd = src.GetVertex(i, out x, out y); perspecitveTx.Transform(ref x, ref y); vxs.AddVertex(x, y, cmd); } return(vxs); }
public void WriteTo(VertexStore outputVxs) { this.Rewind(); double x = 0, y = 0; for (;;) { var cmd = GetNextVertex(ref x, ref y); outputVxs.AddVertex(x, y, cmd); if (cmd == VertexCmd.Stop) { break; } } }
public VertexStore MakeVxs() { VertexStore vxs = new VertexStore(); for (int i = 0; i < 8; ++i) { VertexCmd cmd; vxs.AddVertex(m_x[i], m_y[i], cmd = m_cmd[i]); if (cmd == VertexCmd.Stop) { break; } } return(vxs); }
/// <summary> /// we do NOT store vxs, return original outputVxs /// </summary> /// <param name="src"></param> /// <param name="outputVxs"></param> public static VertexStore TransformToVxs(this Affine aff, VertexStore src, VertexStore outputVxs) { int count = src.Count; VertexCmd cmd; double x, y; for (int i = 0; i < count; ++i) { cmd = src.GetVertex(i, out x, out y); aff.Transform(ref x, ref y); outputVxs.AddVertex(x, y, cmd); } //outputVxs.HasMoreThanOnePart = src.HasMoreThanOnePart; return(outputVxs); }
public void WriteTo(VertexStore outputVxs) { this.Rewind(); int currentRangeIndex = 0; double x = 0, y = 0; //int n = 0; for (;;) { VertexCmd cmd = GetNextVertex(out x, out y); if (cmd == VertexCmd.NoMore) { if (currentRangeIndex + 1 < multipartVertexDistanceList.RangeCount) { //move to next range multipartVertexDistanceList.SetRangeIndex(currentRangeIndex + 1); currentRangeIndex++; m_status = Status.Ready; m_src_vertex = 0; m_out_vertex = 0; continue; } else { break;//exit from loop } } outputVxs.AddVertex(x, y, cmd); //Console.WriteLine(n + " " + x + "," + y); //n++; //if (n == 419) //{ //} } }
static void AddVertex(VertexStore output, double x, double y) { output.AddVertex(x, y, VertexCmd.LineTo); }