Java Code Examples for processing.core.PApplet#loadXML()

The following examples show how to use processing.core.PApplet#loadXML() . 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
@Override
public void loadFrom(PApplet parent, String fileName) {
    XML root = parent.loadXML(fileName);
    XML resolutionNode = root.getChild(RESOLUTION_XML_NAME);
    this.width = resolutionNode.getInt(WIDTH_XML_NAME);
    this.height = resolutionNode.getInt(HEIGHT_XML_NAME);

    XML intrinsicsNode = root.getChild(INTRINSICS_XML_NAME);
    getMatFrom(intrinsicsNode, intrinsics);

    XML extrinsicsNode = root.getChild(EXTRINSICS_XML_NAME);
    if (extrinsicsNode == null) {
        this.hasExtrinsics = false;
        return;
    }
    getMatFrom(extrinsicsNode, extrinsics);

    checkExtrinsics();
}
 
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: CameraConfiguration.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void loadFrom(PApplet parent, String fileName) {
    // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.

    XML root = parent.loadXML(fileName);

    XML cameraNode = root.getChild(CAMERA_XML_NAME);
    loadCameraFrom(cameraNode);
}
 
Example 4
Source File: Calibration.java    From PapARt with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void replaceIn(PApplet parent, String fileName) {
    assert (isValid());
    XML root = parent.loadXML(fileName);
    this.replaceIn(root);
    parent.saveXML(root, fileName);
}
 
Example 5
Source File: PlanarTouchCalibration.java    From PapARt with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void loadFrom(PApplet parent, String fileName) {
    XML root = parent.loadXML(fileName);
    XML planarTouchCalibNode = root.getChild(PLANAR_TOUCH_CALIBRATION_XML_NAME);
    getFrom(planarTouchCalibNode);
}
 
Example 6
Source File: ScreenConfiguration.java    From PapARt with GNU Lesser General Public License v3.0 3 votes vote down vote up
@Override
public void loadFrom(PApplet parent, String fileName) {
    // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.

    XML root = parent.loadXML(fileName);

    XML screenNode = root.getChild(SCREEN_XML_NAME);
    loadScreenFrom(screenNode);


}