public class TriangleMesh extends Mesh
Note that the term point, as used in the method names and method descriptions, actually refers to a set of x, y, and z point representing the position of a single vertex. The term points (plural) is used to indicate sets of x, y, and z points for multiple vertices. Similarly, the term texCoord is used to indicate a set of u and v texture coordinates for a single vertex, while the term texCoords (plural) is used to indicate sets of u and v texture coordinates for multiple vertices. Lastly, the term face is used to indicate 3 set of interleaving points and texture coordinates that together represent the geometric topology of a single triangle, while the term faces (plural) is used to indicate sets of triangles (each represent by a face).
For example, the faces that represent a single textured rectangle, using 2 triangles, has the following data order: [
p0, t0, p1, t1, p3, t3, // First triangle of a textured rectangle
p1, t1, p2, t2, p3, t3 // Second triangle of a textured rectangle
]
where p0, p1, p2 and p3 are indices into the points array, and t0, t1, t2 and t3 are indices into the texCoords array.
Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyIntegerProperty |
faceCount
The total number of faces of this
TriangleMesh |
javafx.beans.property.ReadOnlyIntegerProperty |
faceSmoothingGroupCount
The total number of faceSmoothingGroups of this
TriangleMesh |
javafx.beans.property.ReadOnlyIntegerProperty |
pointCount
The total number of points of this
TriangleMesh |
javafx.beans.property.ReadOnlyIntegerProperty |
texCoordCount
The total number of texture coordinates of this
TriangleMesh |
Modifier and Type | Field and Description |
---|---|
static int |
NUM_COMPONENTS_PER_FACE |
static int |
NUM_COMPONENTS_PER_POINT |
static int |
NUM_COMPONENTS_PER_TEXCOORD |
Constructor and Description |
---|
TriangleMesh()
Creates a new instance of
TriangleMesh class. |
TriangleMesh(float[] points,
float[] texCoords,
int[] faces)
Creates a new instance of
TriangleMesh class. |
Modifier and Type | Method and Description |
---|---|
com.sun.javafx.geom.BaseBounds |
computeBounds(com.sun.javafx.geom.BaseBounds bounds) |
javafx.beans.property.ReadOnlyIntegerProperty |
faceCountProperty()
The total number of faces of this
TriangleMesh |
javafx.beans.property.ReadOnlyIntegerProperty |
faceSmoothingGroupCountProperty()
The total number of faceSmoothingGroups of this
TriangleMesh |
int |
getFaceCount()
Retrieve total number of faces of this
TriangleMesh |
int[] |
getFaces(int[] faces)
Gets the faces, indices into the points and texCoords arrays, of this
TriangleMesh |
int[] |
getFaces(int index,
int[] faces,
int length)
Gets the faces, indices into the points and texCoords arrays,
associated with this
TriangleMesh starting at the specified
index for length number of faces. |
int |
getFaceSmoothingGroupCount()
Retrieve total number of faceSmoothingGroups of this
TriangleMesh |
int[] |
getFaceSmoothingGroups(int[] faceSmoothingGroups)
Gets the face smoothing group for each face in this
TriangleMesh |
int[] |
getFaceSmoothingGroups(int index,
int[] faceSmoothingGroups,
int length)
Gets the face smoothing group for each face in this
TriangleMesh
starting at the specified index for length number of face
smoothing groups. |
int |
getPointCount()
Retrieve total number of points of this
TriangleMesh |
float[] |
getPoints(float[] points)
Gets the points of this
TriangleMesh |
float[] |
getPoints(int index,
float[] points,
int length)
Gets the points associated with this
TriangleMesh starting at the
specified index for length number of points. |
int |
getTexCoordCount()
Retrieve total number of texture coordinates of this
TriangleMesh |
float[] |
getTexCoords(float[] texCoords)
Gets the texture coordinates of this
TriangleMesh . |
float[] |
getTexCoords(int index,
float[] texCoords,
int length)
Gets the texture coordinates associated with this
TriangleMesh
starting at the specified index for length number of
texCoords. |
com.sun.javafx.sg.PGTriangleMesh |
impl_getPGTriangleMesh()
The peer node created by the graphics Toolkit/Pipeline implementation
|
void |
impl_updatePG() |
javafx.beans.property.ReadOnlyIntegerProperty |
pointCountProperty()
The total number of points of this
TriangleMesh |
void |
setDirty(boolean value)
Sets the value of the property dirty.
|
void |
setFaces(int[] faces)
Sets the faces, indices into the points and texCoords arrays,
associated with this
TriangleMesh . |
void |
setFaces(int index,
int[] faces,
int start,
int length)
Sets the faces, indices into the points and texCoords arrays,
associated with this
TriangleMesh
starting at the specifiedindex using data in faces
starting at index start for length number of faces. |
void |
setFaceSmoothingGroups(int[] faceSmoothingGroups)
Sets the face smoothing group for each face in this
TriangleMesh
TODO: 3D - if faceSmoothingGroups is null (default) --> smooth faces
Note: faceSmoothingGroups.length must be equal to faces.length/NUM_COMPONENTS_PER_FACE. |
void |
setFaceSmoothingGroups(int index,
int[] faceSmoothingGroups,
int start,
int length)
Sets the faceSmoothingGroups associated with this
TriangleMesh
starting at the specified index using data in faceSmoothingGroups
starting at index start for length number of faceSmoothingGroups. |
void |
setPoints(float[] points)
Sets the points of this
TriangleMesh |
void |
setPoints(int index,
float[] points,
int start,
int length)
Sets the points associated with this
TriangleMesh
starting at the specified index using data in points
starting at index start for length number of points. |
void |
setTexCoords(float[] texCoords)
Sets the texture coordinates of this
TriangleMesh . |
void |
setTexCoords(int index,
float[] texCoords,
int start,
int length)
Sets the texture coordinates associated with this
TriangleMesh
starting at the specified index using data in texCoords
starting at index start for length number of texCoords. |
javafx.beans.property.ReadOnlyIntegerProperty |
texCoordCountProperty()
The total number of texture coordinates of this
TriangleMesh |
dirtyProperty, isDirty
public javafx.beans.property.ReadOnlyIntegerProperty pointCountProperty
TriangleMesh
getPointCount()
public javafx.beans.property.ReadOnlyIntegerProperty texCoordCountProperty
TriangleMesh
getTexCoordCount()
public javafx.beans.property.ReadOnlyIntegerProperty faceCountProperty
TriangleMesh
getFaceCount()
public javafx.beans.property.ReadOnlyIntegerProperty faceSmoothingGroupCountProperty
TriangleMesh
getFaceSmoothingGroupCount()
public static final int NUM_COMPONENTS_PER_POINT
public static final int NUM_COMPONENTS_PER_TEXCOORD
public static final int NUM_COMPONENTS_PER_FACE
public TriangleMesh()
TriangleMesh
class.public TriangleMesh(float[] points, float[] texCoords, int[] faces)
TriangleMesh
class.
TODO: 3D - doc. follows array semanticpoints
- points array (points.length must be divisible by NUM_COMPONENTS_PER_POINT)texCoords
- texCoords array (texCoords.length must be divisible by
NUM_COMPONENTS_PER_TEXCOORD)faces
- faces (or triangles) array (faces.length must be divisible
by NUM_COMPONENTS_PER_FACE)public final int getPointCount()
TriangleMesh
public javafx.beans.property.ReadOnlyIntegerProperty pointCountProperty()
TriangleMesh
getPointCount()
public final int getTexCoordCount()
TriangleMesh
public javafx.beans.property.ReadOnlyIntegerProperty texCoordCountProperty()
TriangleMesh
getTexCoordCount()
public final int getFaceCount()
TriangleMesh
public javafx.beans.property.ReadOnlyIntegerProperty faceCountProperty()
TriangleMesh
getFaceCount()
public final int getFaceSmoothingGroupCount()
TriangleMesh
public javafx.beans.property.ReadOnlyIntegerProperty faceSmoothingGroupCountProperty()
TriangleMesh
getFaceSmoothingGroupCount()
public final void setPoints(float[] points)
TriangleMesh
points
- source array of NUM_COMPONENTS_PER_POINT * n values containing n new points.public final void setPoints(int index, float[] points, int start, int length)
TriangleMesh
starting at the specified index
using data in points
starting at index start
for length
number of points.index
- the starting destination index in this TriangleMesh's points arraypoints
- source array of floats containing the new pointsstart
- starting source index in the points array.length
- number of point elements to be copied.public final float[] getPoints(float[] points)
TriangleMesh
points
- a float array that will receive the points
if it not null and has sufficient capacity.public final float[] getPoints(int index, float[] points, int length)
TriangleMesh
starting at the
specified index
for length
number of points.index
- starting source points index in this TriangleMesh
points
- destination array that will receive this TriangleMesh
's points datalength
- number of point elements to be copiedpublic final void setTexCoords(float[] texCoords)
TriangleMesh
.texCoords
- source array of NUM_COMPONENTS_PER_TEXCOORD * n values containing n new texCoords.public final void setTexCoords(int index, float[] texCoords, int start, int length)
TriangleMesh
starting at the specified index
using data in texCoords
starting at index start
for length
number of texCoords.index
- the starting destination index in this TriangleMesh's texCoords arraytexCoords
- an float array containing the new texture coordinatesstart
- starting source index in the texture coordinates arraylength
- number of texCoord elements to be copied.public final float[] getTexCoords(float[] texCoords)
TriangleMesh
.texCoords
- a float array that will receive the texture coordinates
if it not null and has sufficient capacitypublic final float[] getTexCoords(int index, float[] texCoords, int length)
TriangleMesh
starting at the specified index
for length
number of
texCoords.index
- starting source texCoords index in this TriangleMesh
texCoords
- destination array that will receive this TriangleMesh
's texCoords datalength
- number of texCoord elements to be copiedpublic final void setFaces(int[] faces)
TriangleMesh
.faces
- source array of NUM_COMPONENTS_PER_FACE * n indices
(3 point indices and 3 texCood indices) containing n new facespublic final void setFaces(int index, int[] faces, int start, int length)
TriangleMesh
starting at the specifiedindex
using data in faces
starting at index start
for length
number of faces.index
- the starting destination index in this TriangleMesh's faces arrayfaces
- an int array containing the new interleaved verticesstart
- starting source index in the faces array.length
- number of interleaved vertex elements to be copiedpublic final int[] getFaces(int[] faces)
TriangleMesh
faces
- an int array that will receive the faces if it not null and
has sufficient capacity.public final int[] getFaces(int index, int[] faces, int length)
TriangleMesh
starting at the specified
index
for length
number of faces.index
- starting source faces index in this TriangleMesh
faces
- destination array that will receive this TriangleMesh
's faces datalength
- number of face elements to be copiedpublic final void setFaceSmoothingGroups(int[] faceSmoothingGroups)
TriangleMesh
TODO: 3D - if faceSmoothingGroups is null (default) --> smooth faces
Note: faceSmoothingGroups.length must be equal to faces.length/NUM_COMPONENTS_PER_FACE.
Error: Throw exception?public final void setFaceSmoothingGroups(int index, int[] faceSmoothingGroups, int start, int length)
TriangleMesh
starting at the specified index
using data in faceSmoothingGroups
starting at index start
for length
number of faceSmoothingGroups.index
- the starting destination index in this TriangleMesh's faceSmoothingGroups arraypoints
- source array of floats containing the new faceSmoothingGroupsstart
- starting source index in the faceSmoothingGroups array.length
- number of faceSmoothingGroup elements to be copied.public final int[] getFaceSmoothingGroups(int[] faceSmoothingGroups)
TriangleMesh
public final int[] getFaceSmoothingGroups(int index, int[] faceSmoothingGroups, int length)
TriangleMesh
starting at the specified index
for length
number of face
smoothing groups.index
- starting source face smoothing groups index in this TriangleMesh
faceSmoothingGroups
- destination array that will receive this
TriangleMesh
's faceSmoothingGroups datalength
- number of faceSmoothingGroup elements to be copiedpublic void setDirty(boolean value)
Mesh
public com.sun.javafx.sg.PGTriangleMesh impl_getPGTriangleMesh()
public void impl_updatePG()
impl_updatePG
in class Mesh
public com.sun.javafx.geom.BaseBounds computeBounds(com.sun.javafx.geom.BaseBounds bounds)
computeBounds
in class Mesh
Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.