示例#1
0
 internal override void Cut(double t1, double t2, com.epl.geometry.SegmentBuffer subSegmentBuffer)
 {
     if (subSegmentBuffer == null)
     {
         throw new System.ArgumentException();
     }
     subSegmentBuffer.CreateLine();
     // Make sure buffer contains Line class.
     com.epl.geometry.Segment subSegment = subSegmentBuffer.Get();
     subSegment.AssignVertexDescription(m_description);
     com.epl.geometry.Point2D point = new com.epl.geometry.Point2D();
     GetCoord2D(t1, point);
     subSegment.SetStartXY(point.x, point.y);
     GetCoord2D(t2, point);
     subSegment.SetEndXY(point.x, point.y);
     for (int iattr = 1, nattr = m_description.GetAttributeCount(); iattr < nattr; iattr++)
     {
         int semantics = m_description._getSemanticsImpl(iattr);
         int ncomps    = com.epl.geometry.VertexDescription.GetComponentCount(semantics);
         for (int ordinate = 0; ordinate < ncomps; ordinate++)
         {
             double value1 = GetAttributeAsDbl(t1, semantics, ordinate);
             subSegment.SetStartAttribute(semantics, ordinate, value1);
             double value2 = GetAttributeAsDbl(t2, semantics, ordinate);
             subSegment.SetEndAttribute(semantics, ordinate, value2);
         }
     }
 }