Java Code Examples for processing.data.XML#getFloat()

The following examples show how to use processing.data.XML#getFloat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProjectiveDeviceCalibration.java    From PapARt with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void getMatFrom(XML node, PMatrix3D matrix) {
    matrix.m00 = node.getFloat("m00");
    matrix.m01 = node.getFloat("m01");
    matrix.m02 = node.getFloat("m02");
    matrix.m03 = node.getFloat("m03");
    matrix.m10 = node.getFloat("m10");
    matrix.m11 = node.getFloat("m11");
    matrix.m12 = node.getFloat("m12");
    matrix.m13 = node.getFloat("m13");
    matrix.m20 = node.getFloat("m20");
    matrix.m21 = node.getFloat("m21");
    matrix.m22 = node.getFloat("m22");
    matrix.m23 = node.getFloat("m23");
    matrix.m30 = node.getFloat("m30");
    matrix.m31 = node.getFloat("m31");
    matrix.m32 = node.getFloat("m32");
    matrix.m33 = node.getFloat("m33");
}
 
Example 2
Source File: PlaneCalibration.java    From PapARt with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void loadFrom(PApplet parent, String fileName) {
    XML root = parent.loadXML(fileName);
    XML planeNode = root.getChild(PLANE_XML_NAME);
    XML posNode = planeNode.getChild(PLANE_POS_XML_NAME);
    XML normalNode = planeNode.getChild(PLANE_NORMAL_XML_NAME);
    XML heightNode = planeNode.getChild(PLANE_HEIGHT_XML_NAME);

    Vec3D position = getVectorFrom(posNode);
    Vec3D normal = getVectorFrom(normalNode);
    float h = heightNode.getFloat(PLANE_HEIGHT_XML_NAME);

    this.plane = new Plane();
    plane.set(position);
    plane.normal.set(normal);
    setHeight(h);
}
 
Example 3
Source File: PlanarTouchCalibration.java    From PapARt with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void getFrom(XML xml) {
    maximumDistance = xml.getFloat(MAX_DIST_XML_NAME);
    maximumDistanceInit = xml.getFloat(MAX_DIST_INIT_XML_NAME);
    minimumComponentSize = xml.getInt(MIN_COPO_SIZE_XML_NAME);
    minimumHeight = xml.getFloat(MIN_HEIGHT_XML_NAME);
    maximumRecursion = xml.getInt(MAX_RECURSION_XML_NAME);

    searchDepth = xml.getInt(SEARCH_DEPTH_XML_NAME);
    precision = xml.getInt(PRECISION_XML_NAME);

    normalFilter = xml.getFloat(NORMAL_FILTER_XML_NAME);
    trackingForgetTime = xml.getInt(TRACKING_FORGET_TIME_XML_NAME);
    trackingMaxDistance = xml.getFloat(TRACKING_MAX_DIST_TIME_XML_NAME);

    test1 = xml.getFloat(TEST1_XML_NAME);
    test2 = xml.getFloat(TEST2_XML_NAME);
    test3 = xml.getFloat(TEST3_XML_NAME);
    test4 = xml.getFloat(TEST4_XML_NAME);
    test5 = xml.getFloat(TEST5_XML_NAME);
}
 
Example 4
Source File: QuadSurface.java    From sketch-mapper with MIT License 6 votes vote down vote up
private void setupCornerPoints(XML xml) {
    PVector[] points = new PVector[4];
    int index = 0;
    while (index < 4) {
        for (XML child : xml.getChildren()) {
            if (!"cornerpoint".equals(child.getName())) {
                continue;
            }
            float x = child.getFloat("x");
            float y = child.getFloat("y");
            points[index] = new PVector(x, y);
            index++;
        }
    }
    setCornerPoints(
            points[0].x, points[0].y,
            points[1].x, points[1].y,
            points[2].x, points[2].y,
            points[3].x, points[3].y
    );
}
 
Example 5
Source File: PlaneCalibration.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
private Vec3D getVectorFrom(XML node) {
    Vec3D v = new Vec3D();
    v.x = node.getFloat(X_XML_NAME);
    v.y = node.getFloat(Y_XML_NAME);
    v.z = node.getFloat(Z_XML_NAME);
    return v;
}