public LDPolygon getPolygon() { LDPolygon p = new LDPolygon(); p.Add(m_topLeft); p.Add(m_topRight); p.Add(m_bottomRight); p.Add(m_bottomLeft); return(p); }
public LDPolygon toPolygon(LDPointList points) { Debug.Assert((points.length() > m_index1)); Debug.Assert(points.length() > m_index2); Debug.Assert(points.length() > m_index3); LDPolygon v = new LDPolygon(); v.Add(new LDPoint(points.at(m_index1))); v.Add(new LDPoint(points.at(m_index2))); v.Add(new LDPoint(points.at(m_index3))); return(v); }
public void getOutlinePolygonTest_simple() { LDTriangleList triangles = simpleTriangle(); LDPointList points = new LDPointList(); points.Add(new LDPoint(0, 0)); points.Add(new LDPoint(0, 100)); points.Add(new LDPoint(100, 100)); LDPolygon compare = new LDPolygon(); compare.Add(new LDPoint(0, 0)); compare.Add(new LDPoint(0, 100)); compare.Add(new LDPoint(100, 100)); LDPolygon result = triangles.getOutlinePolygon(points); TestUtil.COMPARE(result, compare); }
public LDPolygon translated(LDPoint offset) { LDPolygon translated = new LDPolygon(); foreach (var p in this) { translated.Add(new LDPoint(p.x() + offset.x(), p.y() + offset.y())); } return(translated); }
public LDPolygon getOutlinePolygon() { List <int> indices = getOutlinePointIndices(); LDPolygon result = new LDPolygon(); foreach (var index in indices) { result.Add(getPoint(index)); } return(result); }
public LDPolygon getOutlinePolygon(LDPointList points) { List <int> indices = getOutlinePointIndices(points); LDPolygon result = new LDPolygon(); foreach (var index in indices) { common.LD_ASSERT_OUT_OF_INDEX(points, index); result.Add(points[index]); } return(result); }