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

The following examples show how to use processing.data.XML#setInt() . 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: PlanarTouchCalibration.java    From PapARt with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void setIn(XML xml) {
    xml.setFloat(MAX_DIST_XML_NAME, maximumDistance);
    xml.setFloat(MAX_DIST_INIT_XML_NAME, maximumDistanceInit);
    xml.setFloat(MIN_HEIGHT_XML_NAME, minimumHeight);
    xml.setFloat(NORMAL_FILTER_XML_NAME, normalFilter);

    xml.setInt(MIN_COPO_SIZE_XML_NAME, minimumComponentSize);
    xml.setInt(MAX_RECURSION_XML_NAME, maximumRecursion);
    xml.setInt(SEARCH_DEPTH_XML_NAME, searchDepth);
    xml.setInt(PRECISION_XML_NAME, precision);

    xml.setInt(TRACKING_FORGET_TIME_XML_NAME, trackingForgetTime);
    xml.setFloat(TRACKING_MAX_DIST_TIME_XML_NAME, trackingMaxDistance);

    xml.setFloat(TEST1_XML_NAME, test1);
    xml.setFloat(TEST2_XML_NAME, test2);
    xml.setFloat(TEST3_XML_NAME, test3);
    xml.setFloat(TEST4_XML_NAME, test4);
    xml.setFloat(TEST5_XML_NAME, test5);
}
 
Example 2
Source File: ScreenConfiguration.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
private XML createScreenNode() {
    XML screenNode = new XML(SCREEN_XML_NAME);
    screenNode.setInt(SCREEN_WIDTH_XML_NAME, projectionScreenWidth);
    screenNode.setInt(SCREEN_HEIGHT_XML_NAME, projectionScreenHeight);
    screenNode.setInt(SCREEN_OFFSET_X_XML_NAME, projectionScreenOffsetX);
    screenNode.setInt(SCREEN_OFFSET_Y_XML_NAME, projectionScreenOffsetY);
    return screenNode;
}
 
Example 3
Source File: SurfaceMapper.java    From sketch-mapper with MIT License 5 votes vote down vote up
/**
 * Puts all projection mapping data in the XMLElement
 *
 * @param root
 */
public void save(XML root) {
    root.setName("ProjectionMap");
    // create XML elements for each surface containing the resolution
    // and control point data
    for (SuperSurface s : surfaces) {
        XML surf = new XML("surface");
        surf.setInt("type", s.getSurfaceType());
        surf.setInt("id", s.getId());
        surf.setString("name", s.getSurfaceName());
        surf.setInt("res", s.getRes());
        surf.setString("lock", String.valueOf(s.isLocked()));
        surf.setInt("horizontalForce", s.getHorizontalForce());
        surf.setInt("verticalForce", s.getVerticalForce());
        surf.setString("sketch", s.getSketch().getName());

        for (int i = 0; i < s.getCornerPoints().length; i++) {
            XML cp = new XML("cornerpoint");
            cp.setInt("i", i);
            cp.setFloat("x", s.getCornerPoint(i).x);
            cp.setFloat("y", s.getCornerPoint(i).y);
            surf.addChild(cp);

        }

        if (s.getSurfaceType() == SuperSurface.BEZIER) {
            for (int i = 0; i < 8; i++) {
                XML bp = new XML("bezierpoint");
                bp.setInt("i", i);
                bp.setFloat("x", s.getBezierPoint(i).x);
                bp.setFloat("y", s.getBezierPoint(i).y);
                surf.addChild(bp);
            }
        }
        root.addChild(surf);
    }
}
 
Example 4
Source File: ProjectiveDeviceCalibration.java    From PapARt with GNU Lesser General Public License v3.0 4 votes vote down vote up
private XML resolutionNode() {
    XML node = new XML(RESOLUTION_XML_NAME);
    node.setInt(WIDTH_XML_NAME, width);
    node.setInt(HEIGHT_XML_NAME, height);
    return node;
}