예제 #1
0
 internal override double GetAttributeAsDbl(int semantics, int index, int ordinate)
 {
     return(m_impl.GetAttributeAsDbl(semantics, index, ordinate));
 }
예제 #2
0
        public void _updateSegment()
        {
            if (m_nextSegmentIndex < 0 || m_nextSegmentIndex >= m_segmentCount)
            {
                throw new System.IndexOutOfRangeException();
            }
            m_currentSegmentIndex = m_nextSegmentIndex;
            int startVertexIndex = GetStartPointIndex();

            m_parent._verifyAllStreams();
            com.epl.geometry.AttributeStreamOfInt8 segFlagStream = m_parent.GetSegmentFlagsStreamRef();
            int segFlag = com.epl.geometry.SegmentFlags.enumLineSeg;

            if (segFlagStream != null)
            {
                segFlag = (segFlagStream.Read(startVertexIndex) & com.epl.geometry.SegmentFlags.enumSegmentMask);
            }
            com.epl.geometry.VertexDescription vertexDescr = m_parent.GetDescription();
            switch (segFlag)
            {
            case com.epl.geometry.SegmentFlags.enumLineSeg:
            {
                if (m_line == null)
                {
                    m_line = new com.epl.geometry.Line();
                }
                m_currentSegment = (com.epl.geometry.Line)m_line;
                break;
            }

            case com.epl.geometry.SegmentFlags.enumBezierSeg:
            {
                throw com.epl.geometry.GeometryException.GeometryInternalError();
            }

            case com.epl.geometry.SegmentFlags.enumArcSeg:
            {
                // break;
                throw com.epl.geometry.GeometryException.GeometryInternalError();
            }

            default:
            {
                // break;
                throw com.epl.geometry.GeometryException.GeometryInternalError();
            }
            }
            m_currentSegment.AssignVertexDescription(vertexDescr);
            int endVertexIndex = GetEndPointIndex();

            m_parent.GetXY(startVertexIndex, m_dummyPoint);
            m_currentSegment.SetStartXY(m_dummyPoint);
            m_parent.GetXY(endVertexIndex, m_dummyPoint);
            m_currentSegment.SetEndXY(m_dummyPoint);
            for (int i = 1, nattr = vertexDescr.GetAttributeCount(); i < nattr; i++)
            {
                int semantics = vertexDescr.GetSemantics(i);
                int ncomp     = com.epl.geometry.VertexDescription.GetComponentCount(semantics);
                for (int ord = 0; ord < ncomp; ord++)
                {
                    double vs = m_parent.GetAttributeAsDbl(semantics, startVertexIndex, ord);
                    m_currentSegment.SetStartAttribute(semantics, ord, vs);
                    double ve = m_parent.GetAttributeAsDbl(semantics, endVertexIndex, ord);
                    m_currentSegment.SetEndAttribute(semantics, ord, ve);
                }
            }
        }