예제 #1
0
        protected override void loadCrScIndices()
        {
            int secNum = 4 * (m_iNumOfArcSegment + 1); // Number of points to draw in one section inside or outside surface

                if (SShape == 0 || SShape == 1 || SShape == 2)
                {
                    CCrSc_0_26 o26 = new CCrSc_0_26();
                    o26.loadCrScIndices_26_28(secNum,m_iNumOfAuxPoints);
                    TriangleIndices = o26.TriangleIndices;
                    //load_0_26_28_TriangelIndices(iNumberAux, secNum);
                }
                else if (SShape == 3)
                {
                    // const int secNum = iNumberAux + iRadiusPoints * 4;  // Number of points in section (2D)
                    int iRadiusPoints = m_iNumOfArcSegment + 1;

                    TriangleIndices = new Int32Collection();

                    // Front Side / Forehead
                    // Points order 1,2,3,4

                    AddRectangleIndices_CW_1234(TriangleIndices, 0, m_iNumOfAuxPoints + m_iNumOfArcSegment, m_iNumOfAuxPoints + 1 + m_iNumOfArcSegment, 1);
                    AddRectangleIndices_CW_1234(TriangleIndices, 1, m_iNumOfAuxPoints + 2 * m_iNumOfArcSegment + 1, m_iNumOfAuxPoints + 2 * m_iNumOfArcSegment + 2, 2);
                    AddRectangleIndices_CW_1234(TriangleIndices, 3, 2, m_iNumOfAuxPoints + 3 * m_iNumOfArcSegment + 2, m_iNumOfAuxPoints + 3 * m_iNumOfArcSegment + 3);
                    AddRectangleIndices_CW_1234(TriangleIndices, m_iNumOfAuxPoints, 0, 3, m_iNumOfAuxPoints + 4 * m_iNumOfArcSegment + 3);

                    // Arc sectors
                    // 1st SolidCircleSector
                    AddSolidCircleSectorIndices(0, m_iNumOfAuxPoints, m_iNumOfArcSegment, TriangleIndices, false);
                    // 2nd SolidCircleSector
                    AddSolidCircleSectorIndices(1, m_iNumOfAuxPoints + iRadiusPoints, m_iNumOfArcSegment, TriangleIndices, false);
                    // 3rd SolidCircleSector
                    AddSolidCircleSectorIndices(2, m_iNumOfAuxPoints + 2 * iRadiusPoints, m_iNumOfArcSegment, TriangleIndices, false);
                    // 4th SolidCircleSector
                    AddSolidCircleSectorIndices(3, m_iNumOfAuxPoints + 3 * iRadiusPoints, m_iNumOfArcSegment, TriangleIndices, false);

                    // Back Side
                    // Points order 1,4,3,2

                    int iPointNumbersOffset = m_iNumOfAuxPoints + 4 * iRadiusPoints; // Number of nodes per section - Nodes offset

                    AddRectangleIndices_CW_1234(TriangleIndices, iPointNumbersOffset + 0, iPointNumbersOffset + 1, iPointNumbersOffset + m_iNumOfAuxPoints + 1 + m_iNumOfArcSegment, iPointNumbersOffset + m_iNumOfAuxPoints + m_iNumOfArcSegment);
                    AddRectangleIndices_CW_1234(TriangleIndices, iPointNumbersOffset + 1, iPointNumbersOffset + 2, iPointNumbersOffset + m_iNumOfAuxPoints + 2 * m_iNumOfArcSegment + 2, iPointNumbersOffset + m_iNumOfAuxPoints + 2 * m_iNumOfArcSegment + 1);
                    AddRectangleIndices_CW_1234(TriangleIndices, iPointNumbersOffset + 3, iPointNumbersOffset + m_iNumOfAuxPoints + 3 * m_iNumOfArcSegment + 3, iPointNumbersOffset + m_iNumOfAuxPoints + 3 * m_iNumOfArcSegment + 2, iPointNumbersOffset + 2);
                    AddRectangleIndices_CW_1234(TriangleIndices, iPointNumbersOffset + m_iNumOfAuxPoints, iPointNumbersOffset + m_iNumOfAuxPoints + 4 * m_iNumOfArcSegment + 3, iPointNumbersOffset + 3, iPointNumbersOffset + 0);

                    // Arc sectors
                    // 1st SolidCircleSector
                    AddSolidCircleSectorIndices(iPointNumbersOffset + 0, iPointNumbersOffset + m_iNumOfAuxPoints, m_iNumOfArcSegment, TriangleIndices, true);
                    // 2nd SolidCircleSector
                    AddSolidCircleSectorIndices(iPointNumbersOffset + 1, iPointNumbersOffset + m_iNumOfAuxPoints + iRadiusPoints, m_iNumOfArcSegment, TriangleIndices, true);
                    // 3rd SolidCircleSector
                    AddSolidCircleSectorIndices(iPointNumbersOffset + 2, iPointNumbersOffset + m_iNumOfAuxPoints + 2 * iRadiusPoints, m_iNumOfArcSegment, TriangleIndices, true);
                    // 4th SolidCircleSector
                    AddSolidCircleSectorIndices(iPointNumbersOffset + 3, iPointNumbersOffset + m_iNumOfAuxPoints + 3 * iRadiusPoints, m_iNumOfArcSegment, TriangleIndices, true);

                    // Shell - outside
                    DrawCaraLaterals(m_iNumOfAuxPoints, 4 * iRadiusPoints, TriangleIndices);
                    // Shell - inside
                    AddRectangleIndices_CW_1234(TriangleIndices, 0, iPointNumbersOffset + 0, iPointNumbersOffset + 3, 3);
                    AddRectangleIndices_CW_1234(TriangleIndices, 1, iPointNumbersOffset + 1, iPointNumbersOffset + 0, 0);
                    AddRectangleIndices_CW_1234(TriangleIndices, 2, iPointNumbersOffset + 2, iPointNumbersOffset + 1, 1);
                    AddRectangleIndices_CW_1234(TriangleIndices, 3, iPointNumbersOffset + 3, iPointNumbersOffset + 2, 2);
                }
                else if (SShape == 4)
                {

                }
                else
                {
                    CCrSc_0_25 o25 = new CCrSc_0_25();
                    o25.loadCrScIndices_25();
                    TriangleIndices = o25.TriangleIndices;
                    //load_0_25_TriangelIndices();
                }
        }
예제 #2
0
 protected override void loadCrScIndices()
 {
     CCrSc_0_26 oTemp = new CCrSc_0_26();
     oTemp.loadCrScIndices_26_28(INoPointsOut,0);
     TriangleIndices = new Int32Collection();
     TriangleIndices = oTemp.TriangleIndices;
 }