All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.mines.jtk.sgl.LineGroup Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
/****************************************************************************
Copyright 2010, Colorado School of Mines and others.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
****************************************************************************/
package edu.mines.jtk.sgl;

import java.nio.FloatBuffer;

import static edu.mines.jtk.ogl.Gl.*;
import edu.mines.jtk.util.Direct;

/**
 * A group of one or more sets of connected line segments.
 * @author Dave Hale, Colorado School of Mines
 * @version 2010.01.10
 */
public class LineGroup extends Group {

  /**
   * Constructs a line group with one set of connected line segments.
   * 

* The (x,y,z) coordinates of points are packed into the specified * array xyz. The number of points is np = xyz.length/3. * @param xyz array[3*np] of packed point coordinates. */ public LineGroup(float[] xyz) { this(xyz,null); } /** * Constructs a line group with one set of connected line segments. *

* The (x,y,z) coordinates of points are packed into the specified * array xyz. The number of points is np = xyz.length/3. *

* The (r,g,b) components of colors are packed into the specified * array rgb. The number of colors equals the number of points. * @param xyz array[3*np] of packed point coordinates. * @param rgb array[3*np] of packed color components. */ public LineGroup(float[] xyz, float[] rgb) { this.addChild(new LineNode(xyz,rgb)); } /** * Constructs a line group with multiple sets of connected line segments. *

* The number of sets is ns = xyz.length. For the set with index is, (x,y,z) * coordinates of points are packed into the array xyz[is]. The number of * points in that set is np = xyz[is].length/3. * @param xyz array[ns][3*np] of packed point coordinates. */ public LineGroup(float[][] xyz) { this(xyz,null); } /** * Constructs a line group with multiple sets of connected line segments. *

* The number of sets is ns = xyz.length. For the set with index is, (x,y,z) * coordinates of points are packed into the array xyz[is]. The number of * points in that set is np = xyz[is].length/3. *

* If rgb is not null, this array contains similarly packed (r,g,b) * components of colors. The number of colors equals the number of points. * @param xyz array[ns][3*np] of packed point coordinates. * @param rgb array[ns][3*np] of packed color components. */ public LineGroup(float[][] xyz, float[][] rgb) { int ns = xyz.length; for (int is=0; is





© 2015 - 2024 Weber Informatics LLC | Privacy Policy