Exemple #1
0
        public void testMarkObject()
        {
            JDFDoc  doc  = new JDFDoc("JDF");
            JDFNode root = doc.getJDFRoot();

            root.setVersion(EnumVersion.Version_1_4);
            root.setType(EnumType.Tiling);
            JDFResourcePool resPool = root.getCreateResourcePool();
            KElement        kElem   = resPool.appendResource(ElementName.TILE, null, null);

            Assert.IsTrue(kElem is JDFTile);
            JDFTile tile = ((JDFTile)kElem);

            try
            {
                tile.setClipBox(new JDFRectangle("0 0 123 123"));
                tile.setCTM(new JDFMatrix("1 0 0 1 0 0"));
                JDFMarkObject m = tile.appendMarkObject();
                m.setOrd(0);
                m.setCTM(new JDFMatrix("1.2 0 0 1.4 1 444."));
                Assert.IsTrue(m.isValid(EnumValidationLevel.Complete));
                JDFMarkObject m2 = tile.appendMarkObject();
                m2.setOrd(0);
                m2.setCTM(new JDFMatrix("1.234 0 0 1.4 1 444."));
                Assert.IsTrue(m2.isValid(EnumValidationLevel.Complete));
                Assert.AreEqual(tile.getMarkObject(1), m2);
                Assert.AreEqual(tile.getCreateMarkObject(1), m2);
                Assert.IsTrue(tile.isValid(EnumValidationLevel.Complete));
            }
            catch (FormatException)
            {
                Assert.Fail("bad unit matrix");
            }
        }
Exemple #2
0
        public virtual void testWebGrowthCompensation()
        {
            JDFElement.setLongID(false);
            doc = new JDFDoc("JDF");
            JDFNode         n    = doc.getJDFRoot();
            JDFResourcePool rp   = n.getCreateResourcePool();
            JDFResource     lo   = n.addResource("Layout", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);
            JDFLayout       losh = (JDFLayout)lo.addPartition(EnumPartIDKey.SheetName, "Sheet1");
            JDFLayout       lofr = (JDFLayout)losh.addPartition(EnumPartIDKey.Side, EnumSide.Front.getName());

            rp.appendXMLComment("LayoutShift SHOULD be partitioned: at least Side and Separation will make sense", null);

            JDFResource los = n.addResource("LayoutShift", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null);

            los.appendXMLComment("Note that the interpolation algorithm between positions is implementation dependent", null);
            los = los.addPartition(EnumPartIDKey.Side, "Front");
            VString vSep = new VString("Cyan Magenta Yellow Black", " ");

            for (int i = 0; i < 16; i++)
            {
                int x               = 720 * (i % 4);
                int y               = 1000 * (i / 4);
                int ord             = i % 8;
                JDFContentObject co = lofr.appendContentObject();
                co.setOrd(ord);
                co.setOrdID(i);
                co.setCTM(new JDFMatrix(1, 0, 0, 1, x, y));
                JDFMarkObject mo = lofr.appendMarkObject();
                mo.setOrd(ord);
                mo.setOrdID(i + 100);
                mo.setCTM(new JDFMatrix(1, 0, 0, 1, x + 700, y + 900));
            }
            for (int j = 0; j < vSep.Count; j++)
            {
                KElement sepShift = los.addPartition(EnumPartIDKey.Separation, vSep.stringAt(j));
                for (int i = 0; i < 16; i += 2)
                {
                    int      x           = 720 * (i % 4);
                    int      y           = 1000 * (i / 4);
                    KElement shiftObject = sepShift.appendElement("ShiftPoint");

                    shiftObject.setAttribute("Position", new JDFXYPair(x + 360, y + 500).ToString());
                    shiftObject.setAttribute("CTM", new JDFMatrix(1, 0, 0, 1, j + i / 4, j + i % 4).ToString());
                }
            }
            doc.write2File(sm_dirTestDataTemp + "WebgrowthPartition.jdf", 2, false);
        }