Commit in GeomConverter on MAIN |
resources/org/lcsim/schemas/lcdd/1.0/lcdd_fields.xsd | +3 | | 1.3 -> 1.4 |
src/org/lcsim/geometry/compact/converter/lcdd/FieldMap3D.java | +12 | -1 | 1.1 -> 1.2 |
src/org/lcsim/geometry/compact/converter/lcdd/util/FieldMap3D.java | +5 | -2 | 1.1 -> 1.2 |
testResources/org/lcsim/geometry/field/FieldMap3DTest.xml | +3 | -3 | 1.3 -> 1.4 |
| +23 | -6 | |
4 modified files
GeomConverter/resources/org/lcsim/schemas/lcdd/1.0
diff -u -r1.3 -r1.4
--- lcdd_fields.xsd 29 Aug 2013 21:32:50 -0000 1.3
+++ lcdd_fields.xsd 5 Sep 2013 17:54:54 -0000 1.4
@@ -214,6 +214,9 @@
<xs:complexContent>
<xs:extension base="FieldType">
<xs:attribute name="filename" type="xs:string" />
+ <xs:attribute name="xoffset" type="xs:double" use="optional" default="0.0" />
+ <xs:attribute name="yoffset" type="xs:double" use="optional" default="0.0" />
+ <xs:attribute name="zoffset" type="xs:double" use="optional" default="0.0" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
diff -u -r1.1 -r1.2
--- FieldMap3D.java 29 Aug 2013 21:32:50 -0000 1.1
+++ FieldMap3D.java 5 Sep 2013 17:54:54 -0000 1.2
@@ -16,10 +16,21 @@
void addToLCDD(LCDD lcdd) throws JDOMException
{
+ double xoffset, yoffset, zoffset;
+ xoffset = yoffset = zoffset = 0;
+ if (node.getAttribute("xoffset") != null)
+ xoffset = node.getAttribute("xoffset").getDoubleValue();
+ if (node.getAttribute("yoffset") != null)
+ yoffset = node.getAttribute("yoffset").getDoubleValue();
+ if (node.getAttribute("zoffset") != null)
+ zoffset = node.getAttribute("zoffset").getDoubleValue();
org.lcsim.geometry.compact.converter.lcdd.util.FieldMap3D fieldMap =
new org.lcsim.geometry.compact.converter.lcdd.util.FieldMap3D(
node.getAttribute("name").getValue(),
- node.getAttribute("filename").getValue());
+ node.getAttribute("filename").getValue(),
+ xoffset,
+ yoffset,
+ zoffset);
lcdd.add(fieldMap);
}
GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util
diff -u -r1.1 -r1.2
--- FieldMap3D.java 29 Aug 2013 21:32:50 -0000 1.1
+++ FieldMap3D.java 5 Sep 2013 17:54:54 -0000 1.2
@@ -7,9 +7,12 @@
public class FieldMap3D extends Field
{
/** Creates a new instance of Solenoid */
- public FieldMap3D(String name, String filename)
+ public FieldMap3D(String name, String filename, double xoffset, double yoffset, double zoffset)
{
super("field_map_3d", name);
setAttribute("filename", filename);
- }
+ setAttribute("xoffset", Double.toString(xoffset));
+ setAttribute("yoffset", Double.toString(yoffset));
+ setAttribute("zoffset", Double.toString(zoffset));
+ }
}
\ No newline at end of file
GeomConverter/testResources/org/lcsim/geometry/field
diff -u -r1.3 -r1.4
--- FieldMap3DTest.xml 4 Sep 2013 00:16:36 -0000 1.3
+++ FieldMap3DTest.xml 5 Sep 2013 17:54:55 -0000 1.4
@@ -27,8 +27,8 @@
<fields>
<field type="FieldMap3D" name="FieldMap3DTest"
filename="./testResources/org/lcsim/geometry/field/HPS_b18d36_unfolded.dat"
- offsetX="1.0"
- offsetY="2.0"
- offsetZ="3.0"/>
+ xoffset="1.0"
+ yoffset="2.0"
+ zoffset="3.0" />
</fields>
</lccdd>
CVSspam 0.2.12