Пример #1
0
        ///
        ///	 <summary> * generate a JDF 1.3 compatible Layout from this (1.2)
        ///	 *  </summary>
        ///	 * <returns> true if successful </returns>
        ///
        public virtual bool toNewLayout()
        {
            VElement vSig = getChildElementVector(ElementName.SIGNATURE, null, null, false, 0, false);

            // loop over all signatures and rename them to Layout
            for (int iSig = 0; iSig < vSig.Count; iSig++)
            {
                JDFElement rSig = (JDFElement)vSig[iSig];
                if (rSig is JDFRefElement)
                {
                    rSig = ((JDFRefElement)rSig).inlineRef();
                }
                //C# renameElement only returns the renamed element.
                rSig = (JDFElement)rSig.renameElement(ElementName.LAYOUT, null);
                JDFLayout newLO = (JDFLayout)rSig;
                newLO.setPartIDKey(EnumPartIDKey.SignatureName, rSig.getAttribute(AttributeName.NAME, null, "Sig" + Convert.ToString(iSig)));
                newLO.cleanLayoutLeaf();

                VElement vSheet = newLO.getChildElementVector(ElementName.SHEET, null, null, false, 0, false);
                // loop over all sheets and rename them to Layout
                for (int iSheet = 0; iSheet < vSheet.Count; iSheet++)
                {
                    JDFElement rSheet = (JDFElement)vSheet[iSheet];
                    if (rSheet is JDFRefElement)
                    {
                        rSheet = ((JDFRefElement)rSheet).inlineRef();
                    }
                    //C# renameElement only returns the renamed element.
                    rSheet = (JDFElement)rSheet.renameElement(ElementName.LAYOUT, null);
                    newLO  = (JDFLayout)rSheet;
                    newLO.setPartIDKey(EnumPartIDKey.SheetName, rSheet.getAttribute(AttributeName.NAME, null, "Sheet" + Convert.ToString(iSheet)));
                    newLO.cleanLayoutLeaf();

                    VElement vSurf = newLO.getChildElementVector(ElementName.SURFACE, null, null, false, 0, false);
                    // loop over all surfaces and rename them to Layout
                    for (int iSurf = 0; iSurf < vSurf.Count; iSurf++)
                    {
                        JDFElement rSurf = (JDFElement)vSurf[iSurf];
                        if (rSurf is JDFRefElement)
                        {
                            rSurf = ((JDFRefElement)rSurf).inlineRef();
                        }
                        //C# renameElement only returns the renamed element.
                        rSurf = (JDFElement)rSurf.renameElement(ElementName.LAYOUT, null);
                        newLO = (JDFLayout)rSurf;
                        newLO.setPartIDKey(EnumPartIDKey.Side, rSurf.getAttribute(AttributeName.SIDE, null, "Surf" + Convert.ToString(iSurf)));
                        newLO.cleanLayoutLeaf();
                    }
                }
            }
            return(true);
        }