Examples of ShortArray


Examples of com.badlogic.gdx.utils.ShortArray

    float angleU = 0f;
    float angleV = 0f;
    VertexInfo curr1 = vertTmp3.set(null, null, null, null);
    curr1.hasUV = curr1.hasPosition = curr1.hasNormal = true;

    if (tmpIndices == null) tmpIndices = new ShortArray(divisionsU * 2);
    final int s = divisionsU + 3;
    tmpIndices.ensureCapacity(s);
    while (tmpIndices.size > s)
      tmpIndices.pop();
    while (tmpIndices.size < s)
View Full Code Here

Examples of com.badlogic.gdx.utils.ShortArray

    float angleU = 0f;
    float angleV = 0f;
    VertexInfo curr1 = vertTmp3.set(null, null, null, null);
    curr1.hasUV = curr1.hasPosition = curr1.hasNormal = true;

    if (tmpIndices == null) tmpIndices = new ShortArray(divisionsU * 2);
    final int s = divisionsU + 3;
    tmpIndices.ensureCapacity(s);
    while (tmpIndices.size > s)
      tmpIndices.pop();
    while (tmpIndices.size < s)
View Full Code Here

Examples of com.badlogic.gdx.utils.ShortArray

   *         method. */
  public ShortArray computeTriangles (float[] vertices, int offset, int count) {
    this.vertices = vertices;
    int vertexCount = this.vertexCount = count / 2;

    ShortArray indicesArray = this.indicesArray;
    indicesArray.clear();
    indicesArray.ensureCapacity(vertexCount);
    indicesArray.size = vertexCount;
    short[] indices = this.indices = indicesArray.items;
    if (areVerticesClockwise(vertices, offset, count)) {
      for (short i = 0; i < vertexCount; i++)
        indices[i] = i;
    } else {
      for (int i = 0, n = vertexCount - 1; i < vertexCount; i++)
        indices[i] = (short)(n - i); // Reversed.
    }

    IntArray vertexTypes = this.vertexTypes;
    vertexTypes.clear();
    vertexTypes.ensureCapacity(vertexCount);
    for (int i = 0, n = vertexCount; i < n; ++i)
      vertexTypes.add(classifyVertex(i));

    // A polygon with n vertices has a triangulation of n-2 triangles.
    ShortArray triangles = this.triangles;
    triangles.clear();
    triangles.ensureCapacity(Math.max(0, vertexCount - 2) * 3);
    triangulate();
    return triangles;
  }
View Full Code Here

Examples of com.badlogic.gdx.utils.ShortArray

      vertexTypes[previousIndex] = classifyVertex(previousIndex);
      vertexTypes[nextIndex] = classifyVertex(nextIndex);
    }

    if (vertexCount == 3) {
      ShortArray triangles = this.triangles;
      short[] indices = this.indices;
      triangles.add(indices[0]);
      triangles.add(indices[1]);
      triangles.add(indices[2]);
    }
  }
View Full Code Here

Examples of com.badlogic.gdx.utils.ShortArray

    return true;
  }

  private void cutEarTip (int earTipIndex) {
    short[] indices = this.indices;
    ShortArray triangles = this.triangles;

    triangles.add(indices[previousIndex(earTipIndex)]);
    triangles.add(indices[earTipIndex]);
    triangles.add(indices[nextIndex(earTipIndex)]);

    indicesArray.removeIndex(earTipIndex);
    vertexTypes.removeIndex(earTipIndex);
    vertexCount--;
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.ShortArray

      return ( ArrayImgAWTScreenImage ) container;
    }

    if ( ShortType.class.isAssignableFrom( type.getClass() ) )
    {
      final ShortArray array = new ShortArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< ShortType, ShortArray > container = new ShortAWTScreenImage( new ShortType( array ), array, dims );
      container.setLinkedType( new ShortType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }

    if ( UnsignedShortType.class.isAssignableFrom( type.getClass() ) )
    {
      final ShortArray array = new ShortArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< UnsignedShortType, ShortArray > container = new UnsignedShortAWTScreenImage( new UnsignedShortType( array ), array, dims );
      container.setLinkedType( new UnsignedShortType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.ShortArray

  // this is the constructor if you want it to be a variable
  public GenericShortType( final short value )
  {
    img = null;
    dataAccess = new ShortArray( 1 );
    setValue( value );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.ShortArray

  }

  @Override
  public CellImg< T, ShortArray, DefaultCell< ShortArray > > createShortInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return createInstance( new ShortArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.ShortArray

  }

  @Override
  public NativeImg< T, ShortArray > createShortInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return new PlanarImg< T, ShortArray >( new ShortArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.ShortArray

  @Override
  public ArrayImg< T, ShortArray > createShortInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    final int numEntities = numEntitiesRangeCheck( dimensions, entitiesPerPixel );

    return new ArrayImg< T, ShortArray >( new ShortArray( numEntities ), dimensions, entitiesPerPixel );
  }
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.