Package vtk

Examples of vtk.vtkUnsignedCharArray


    public void addTube(ArrayList<TubePosition> tubePositions) throws FileNotFoundException, IOException, Exception {

        double opacity = 1.0;
        vtkPoints points = null;
        vtkUnsignedCharArray colorArray = null;
        vtkFloatArray radiusArray = null;

        // initialize the points array
        points = new vtkPoints();

        // initialize the color array
        colorArray = new vtkUnsignedCharArray();
        colorArray.SetNumberOfComponents(3);
        colorArray.SetName("colors");

        // initialize the radius array
        radiusArray = new vtkFloatArray();
        radiusArray.SetName("radius");

        for (TubePosition tubePosition : tubePositions) {
            double x = tubePosition.x;
            double y = tubePosition.y;
            double z = tubePosition.z;
            int colorR = (int) tubePosition.r;
            int colorG = (int) tubePosition.g;
            int colorB = (int) tubePosition.b;
            double radius = tubePosition.radius;

            points.InsertNextPoint(x, y, z);
            colorArray.InsertNextTuple3(colorR, colorG, colorB);
            radiusArray.InsertNextValue(radius);
        }

        // add the lastube
        if (points != null) {
View Full Code Here

TOP

Related Classes of vtk.vtkUnsignedCharArray

Copyright © 2018 www.massapicom. 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.