Package java.nio

Examples of java.nio.FloatBuffer.position()


  }

  private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
    FloatBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static LongBuffer doNoCopyWrap(LongBuffer buffer) {
    LongBuffer direct_buffer = lookupBuffer(buffer);
View Full Code Here


    float[] color = new float[3];
   
    // Update the buffer
    for (int i=0; i<triangles.length; i+=3) {
      getColorForValue(data[d][triangles[i]]).getRGBColorComponents(color);
      colors.position(i*3);
      colors.put(color);
      getColorForValue(data[d][triangles[i+1]]).getRGBColorComponents(color);
      colors.position((i+1)*3);
      colors.put(color);
      getColorForValue(data[d][triangles[i+2]]).getRGBColorComponents(color);
 
View Full Code Here

    for (int i=0; i<triangles.length; i+=3) {
      getColorForValue(data[d][triangles[i]]).getRGBColorComponents(color);
      colors.position(i*3);
      colors.put(color);
      getColorForValue(data[d][triangles[i+1]]).getRGBColorComponents(color);
      colors.position((i+1)*3);
      colors.put(color);
      getColorForValue(data[d][triangles[i+2]]).getRGBColorComponents(color);
      colors.position((i+2)*3);
      colors.put(color);
    }
 
View Full Code Here

      colors.put(color);
      getColorForValue(data[d][triangles[i+1]]).getRGBColorComponents(color);
      colors.position((i+1)*3);
      colors.put(color);
      getColorForValue(data[d][triangles[i+2]]).getRGBColorComponents(color);
      colors.position((i+2)*3);
      colors.put(color);
    }

    // Update the name in the tree to show the selected variable
    ((ActiveNode)children.get(0)).setName(names[d]);
View Full Code Here

      // don't want side effects on neighboring triangles.
      // This method gives a way to do both point and tiangle selection as an example.
      // It should be quite straightforward to adapt according to the needs of a
      // real application.
      getColorForValue(data[currentVariable][triangles[idx[0]]],(closest==0) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[0]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[1]]],(closest==1) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[1]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[2]]],(closest==2) ? 0.1f : 0.5f).getRGBColorComponents(color);
View Full Code Here

      // real application.
      getColorForValue(data[currentVariable][triangles[idx[0]]],(closest==0) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[0]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[1]]],(closest==1) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[1]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[2]]],(closest==2) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[2]*3);
      colors.put(color);
     
 
View Full Code Here

      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[1]]],(closest==1) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[1]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[2]]],(closest==2) ? 0.1f : 0.5f).getRGBColorComponents(color);
      colors.position(idx[2]*3);
      colors.put(color);
     
      // Also display the selected values to standard output
      System.out.print("Values for the picked triangle ("+names[currentVariable]+"): ");
      System.out.print(data[currentVariable][triangles[idx[0]]]);
View Full Code Here

      System.out.println(" with * = closest point");
    }
    else {
      // restore original colors
      getColorForValue(data[currentVariable][triangles[idx[0]]]).getRGBColorComponents(color);
      colors.position(idx[0]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[1]]]).getRGBColorComponents(color);
      colors.position(idx[1]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[2]]]).getRGBColorComponents(color);
 
View Full Code Here

      // restore original colors
      getColorForValue(data[currentVariable][triangles[idx[0]]]).getRGBColorComponents(color);
      colors.position(idx[0]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[1]]]).getRGBColorComponents(color);
      colors.position(idx[1]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[2]]]).getRGBColorComponents(color);
      colors.position(idx[2]*3);
      colors.put(color);
    }
 
View Full Code Here

      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[1]]]).getRGBColorComponents(color);
      colors.position(idx[1]*3);
      colors.put(color);
      getColorForValue(data[currentVariable][triangles[idx[2]]]).getRGBColorComponents(color);
      colors.position(idx[2]*3);
      colors.put(color);
    }

    // Syn3D event propagation, refresh the scene, etc...
    super.highlight(on,parameter);
View Full Code Here

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.