Package browser

Source Code of browser.WigConverter

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package browser;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import wigfilereader.WigFile;
import wigfilereader.WigValue;

/**
*
* @author brandon
*/
public class WigConverter {

    String wigFilePath;
    String outFilePath;
    WigFile wf;
    private ArrayList<TubePosition> tubePositions;

    int colorR;
    int colorG;
    int colorB;
    double radius;

    public WigConverter(String wigFilePath, int colorR, int colorG, int colorB, double radius) throws FileNotFoundException, IOException {
        this.wigFilePath = wigFilePath;
        this.colorR = colorR;
        this.colorG = colorG;
        this.colorB = colorB;
        this.radius = radius;

        tubePositions = new ArrayList<TubePosition>();
        wf = new WigFile(wigFilePath);
    }

    public void convert() throws IOException {

        while(wf.hasNext()) {
            WigValue value = wf.next();
            int x = value.getPosition();
            double y = value.getValue();
            double z = 0;

            TubePosition position = new TubePosition(x, y, z, colorR, colorG, colorB, radius);
            getTubePositions().add(position);
        }
    }

    /**
     * @return the tubePositions
     */
    public ArrayList<TubePosition> getTubePositions() {
        return tubePositions;
    }


}
TOP

Related Classes of browser.WigConverter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.