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"); } }
/// /// <summary> * Get all MarkObject from the current element /// * </summary> /// * <returns> Collection<JDFMarkObject> </returns> /// public virtual ICollection <JDFMarkObject> getAllMarkObject() { List <JDFMarkObject> v = new List <JDFMarkObject>(); JDFMarkObject kElem = (JDFMarkObject)getFirstChildElement(ElementName.MARKOBJECT, null); while (kElem != null) { v.Add(kElem); kElem = (JDFMarkObject)kElem.getNextSiblingElement(ElementName.MARKOBJECT, null); } return(v); }
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); }
public virtual void testElementVersion() { VString vPrerelease = null; VString vOptional = null; VString vDeprecated = null; JDFDoc jdfDoc = new JDFDoc("JDF"); JDFNode root = jdfDoc.getJDFRoot(); // check AdhesiveBindingParams/GlueApplication // root.setVersion(JDFElement.EnumVersion.Version_1_3); JDFAdhesiveBindingParams adhesiveBindingParam = (JDFAdhesiveBindingParams)root.addResource(ElementName.ADHESIVEBINDINGPARAMS, null, EnumUsage.Input, null, null, null, null); vDeprecated = adhesiveBindingParam.getTheElementInfo().deprecatedElements(); adhesiveBindingParam.appendGlueApplication(); vDeprecated = adhesiveBindingParam.getDeprecatedElements(99999999); Assert.IsTrue(vDeprecated.Contains(ElementName.GLUEAPPLICATION)); root.setVersion(JDFElement.EnumVersion.Version_1_0); vDeprecated = adhesiveBindingParam.getDeprecatedElements(99999999); Assert.AreEqual(0, vDeprecated.Count); // check MarkObject/DeviceMark // root.setVersion(JDFElement.EnumVersion.Version_1_0); JDFLayout layout = (JDFLayout)root.addResource(ElementName.LAYOUT, null, EnumUsage.Input, null, null, null, null); JDFMarkObject markObject = layout.appendMarkObject(); markObject.appendDeviceMark(); vPrerelease = markObject.getPrereleaseElements(99999999); Assert.IsTrue(vPrerelease.Contains(ElementName.DEVICEMARK)); root.setVersion(JDFElement.EnumVersion.Version_1_1); vOptional = markObject.getTheElementInfo().optionalElements(); Assert.IsTrue(vOptional.Contains(ElementName.DEVICEMARK)); root.setVersion(JDFElement.EnumVersion.Version_1_2); vOptional = markObject.getTheElementInfo().optionalElements(); Assert.IsTrue(vOptional.Contains(ElementName.DEVICEMARK)); root.setVersion(JDFElement.EnumVersion.Version_1_3); vDeprecated = markObject.getTheElementInfo().deprecatedElements(); Assert.IsTrue(vDeprecated.Contains(ElementName.DEVICEMARK)); }