TriMesh
Inheritance: java.lang.Object, com.aspose.threed.A3DObject, com.aspose.threed.SceneObject, com.aspose.threed.Entity
All Implemented Interfaces: java.lang.Iterable
public class TriMesh extends Entity implements Iterable<Vertex>
Un TriMesh contiene dati grezzi che possono essere usati direttamente dalla GPU. Questa classe è un’utilità per aiutare a costruire una mesh che contiene solo dati per vertice. Esempio: Il codice seguente mostra come creare un TriMesh con layout di memoria personalizzato e esportarlo in un file.
//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
VertexDeclaration vd = new VertexDeclaration();
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
//convert a mesh to tri-mesh using specified memory layout
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(vd, mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
try(var s = new FileOutputStream("output.bin")) {
triMesh.writeVerticesTo(s);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(s);
}
Costruttori
| Costruttore | Descrizione |
|---|---|
| TriMesh(String name, VertexDeclaration declaration) | Inizializza un’istanza di TriMesh |
Metodi
| Metodo | Descrizione |
|---|---|
| addTriangle(int a, int b, int c) | Aggiungi un nuovo triangolo |
| beginVertex() | Inizia ad aggiungere vertice |
| copyFrom(TriMesh input, VertexDeclaration vd) | Copia il TriMesh dall’input con un nuovo layout di vertice |
| endVertex() | Termina l’aggiunta del vertice |
| equals(Object arg0) | |
| findProperty(String propertyName) | Trova la proprietà. |
| fromMesh(Mesh mesh) | Crea un TriMesh dall’oggetto mesh fornito, la dichiarazione dei vertici è basata sulla struttura della mesh di input. |
| fromMesh(Mesh mesh, boolean useFloat) | Crea un TriMesh dall’oggetto mesh fornito, la dichiarazione dei vertici è basata sulla struttura della mesh di input. |
| fromMesh(VertexDeclaration declaration, Mesh mesh) | Crea un TriMesh dall’oggetto mesh fornito con il layout di vertice specificato. |
| fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping) | Crea TriMesh da dati grezzi |
| getBoundingBox() | Ottiene il bounding box dell’entità corrente nel suo sistema di coordinate dello spazio oggetto. |
| getCapacity() | La capacità dei vertici pre-allocati. |
| getClass() | |
| getEntityRendererKey() | Ottiene la chiave del renderer dell’entità registrata nel renderer |
| getExcluded() | Ottiene se escludere questa entità durante l’esportazione. |
| getIndicesCount() | Il numero di indici in questo TriMesh |
| getIntIndices() | Converti gli indici in un array di interi a 32 bit |
| getName() | Ottiene il nome. |
| getParentNode() | Ottiene il primo nodo genitore; se impostato, questa entità verrà staccata dagli altri nodi genitori. |
| getParentNodes() | Ottiene tutti i nodi genitore; un’entità può essere collegata a più nodi genitore per l’instancing della geometria. |
| getProperties() | Ottiene la collezione di tutte le proprietà. |
| getProperty(String property) | Ottieni il valore della proprietà specificata |
| getScene() | Ottiene la scena a cui appartiene questo oggetto |
| getShortIndices() | Converti gli indici in un array di interi a 16 bit |
| getUnmergedVerticesCount() | Il numero di vertici non uniti forniti da beginVertex e endVertex. |
| getVertexDeclaration() | Il layout dei vertici del TriMesh. |
| getVerticesCount() | Il numero di vertici in questo TriMesh |
| getVerticesSizeInBytes() | La dimensione totale di tutti i vertici in byte |
| hashCode() | |
| indicesToArray(int[][] result) | Converti gli indici in un array di interi a 32 bit |
| indicesToArray(short[][] result) | Converti gli indici in un array di interi a 16 bit |
| iterator() | Ottieni l’enumeratore per enumerare Vertex |
| loadVerticesFromBytes(byte[] verticesInBytes) | Carica i vertici da byte, la lunghezza dei byte deve essere un multiplo intero della dimensione del vertice. |
| notify() | |
| notifyAll() | |
| readDouble(int idx, VertexField field) | Leggi il campo double |
| readFVector2(int idx, VertexField field) | Leggi il campo vector2 |
| readFVector3(int idx, VertexField field) | Leggi il campo vector3 |
| readFVector4(int idx, VertexField field) | Leggi il campo vector4 |
| readFloat(int idx, VertexField field) | Leggi il campo float |
| readVector2(int idx, VertexField field) | Leggi il campo vector2 |
| readVector3(int idx, VertexField field) | Leggi il campo vector3 |
| readVector4(int idx, VertexField field) | Leggi il campo vector4 |
| removeProperty(Property property) | Rimuove una proprietà dinamica. |
| removeProperty(String property) | Rimuove la proprietà specificata identificata per nome |
| setExcluded(boolean value) | Imposta se escludere questa entità durante l’esportazione. |
| setName(String value) | Imposta il nome. |
| setParentNode(Node value) | Imposta il primo nodo genitore; se impostato, questa entità verrà staccata dagli altri nodi genitori. |
| setProperty(String property, Object value) | Imposta il valore della proprietà specificata |
| toString() | Ottiene la rappresentazione stringa di TriMesh |
| verticesToArray() | Converti i dati dei vertici in array di byte |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) | |
| write16bIndicesTo(Stream stream) | Scrivi i dati degli indici come intero a 16 bit nello stream Example: |
| write16bIndicesTo(OutputStream stream) | Scrivi i dati degli indici come intero a 16 bit nello stream |
| write32bIndicesTo(Stream stream) | Scrivi i dati degli indici come intero a 32 bit nello stream Example: |
| write32bIndicesTo(OutputStream stream) | Scrivi i dati degli indici come intero a 32 bit nello stream |
| writeVerticesTo(Stream stream) | Scrivi i dati dei vertici nello stream specificato |
| writeVerticesTo(OutputStream stream) | Scrivi i dati dei vertici nello stream specificato |
TriMesh(String name, VertexDeclaration declaration)
public TriMesh(String name, VertexDeclaration declaration)
Inizializza un’istanza di TriMesh
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| nome | java.lang.String | Il nome di questo TriMesh |
| declaration | VertexDeclaration | La dichiarazione del vertice |
addTriangle(int a, int b, int c)
public void addTriangle(int a, int b, int c)
Aggiungi un nuovo triangolo
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| a | int | L’indice del primo vertice |
| b | int | L’indice del secondo vertice |
| c | int | L’indice del terzo vertice |
beginVertex()
public Vertex beginVertex()
Inizia ad aggiungere vertice
Returns: Vertex - The reference of internal vertex object in type Vertex
copyFrom(TriMesh input, VertexDeclaration vd)
public static TriMesh copyFrom(TriMesh input, VertexDeclaration vd)
Copia il TriMesh dall’input con un nuovo layout di vertice
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| input | TriMesh | Il TriMesh di input per la copia |
| vd | VertexDeclaration | La nuova dichiarazione del vertice del TriMesh di output |
Returns: TriMesh - A new TriMesh instance with new vertex declaration. Example:
//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
VertexDeclaration vd = new VertexDeclaration();
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var oldTriMesh = TriMesh.fromMesh((new Sphere()).toMesh());
//now create a new TriMesh from old TriMesh, using explicit memory layout defined by vd
var newTriMesh = TriMesh.copyFrom(oldTriMesh, vd);
endVertex()
public int endVertex()
Termina l’aggiunta del vertice
Returns: int
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
findProperty(String propertyName)
public Property findProperty(String propertyName)
Trova la proprietà. Può essere una proprietà dinamica (creata con CreateDynamicProperty/SetProperty) o una proprietà nativa (identificata per nome).
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| propertyName | java.lang.String | Nome della proprietà. |
Returns: Property - The property.
fromMesh(Mesh mesh)
public static TriMesh fromMesh(Mesh mesh)
Crea un TriMesh dall’oggetto mesh fornito, la dichiarazione dei vertici è basata sulla struttura della mesh di input.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| mesh | Mesh |
Returns: TriMesh - The TriMesh generated from given Mesh Example: The following code shows how to create a TriMesh with custom memory layout, and export it to file.
//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
VertexDeclaration vd = new VertexDeclaration();
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
//convert a mesh to tri-mesh using specified memory layout
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(vd, mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
try(var s = new FileOutputStream("output.bin")) {
triMesh.writeVerticesTo(s);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(s);
}
fromMesh(Mesh mesh, boolean useFloat)
public static TriMesh fromMesh(Mesh mesh, boolean useFloat)
Crea un TriMesh dall’oggetto mesh fornito, la dichiarazione dei vertici è basata sulla struttura della mesh di input.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| mesh | Mesh | |
| useFloat | boolean | Usa il tipo float al posto del tipo double per ogni componente dell’elemento del vertice. |
Returns: TriMesh - The TriMesh generated from given Mesh Example: The following code shows how to create a TriMesh with custom memory layout, and export it to file.
//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
VertexDeclaration vd = new VertexDeclaration();
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
//convert a mesh to tri-mesh using specified memory layout
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(vd, mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
try(var s = new FileOutputStream("output.bin")) {
triMesh.writeVerticesTo(s);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(s);
}
fromMesh(VertexDeclaration declaration, Mesh mesh)
public static TriMesh fromMesh(VertexDeclaration declaration, Mesh mesh)
Crea un TriMesh dall’oggetto mesh fornito con il layout di vertice specificato.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| declaration | VertexDeclaration | Definizione del tipo del vertice, o layout di memoria |
| mesh | Mesh | Mesh di origine |
Returns: TriMesh - Instance of TriMesh converted from input mesh with specified vertex’s memory layout Example: The following code shows how to create a TriMesh with custom memory layout, and export it to file.
//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
VertexDeclaration vd = new VertexDeclaration();
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
//convert a mesh to tri-mesh using specified memory layout
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(vd, mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
try(var s = new FileOutputStream("output.bin")) {
triMesh.writeVerticesTo(s);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(s);
}
fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping)
public static TriMesh fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping)
Crea TriMesh da dati grezzi
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| vd | VertexDeclaration | Dichiarazione del vertice, deve contenere almeno un campo. |
| vertici | byte[] | I dati dei vertici di input, la lunghezza minima dei vertici deve essere maggiore o uguale alla dimensione della dichiarazione del vertice |
| indici | int[] | Gli indici del triangolo |
| generateVertexMapping | boolean | Genera Vertex per ogni vertice, il che non è necessario solo per la serializzazione/deserializzazione. |
Returns: TriMesh - The TriMesh instance that encapsulated the input byte array. Remarks: The returned TriMesh will not copy the input byte array for performance, external changes on the array will be reflected to this instance. Example: The following code shows how to construct a TriMesh from raw bytes, this is useful when build your own 3D format
var indices = new int[] { 0, 1, 2 };
var vertices = new byte[]{
0, 0, 0, 191,
0, 0, 0, 0,
0, 0, 0, 191,
0, 0, 0, 191,
0, 0, 0, 0,
0, 0, 0, 63,
0, 0, 0, 63,
0, 0, 0, 0The string representation,
0, 0, 0, 63
};
VertexDeclaration vd = new VertexDeclaration();
vd.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Position);
var triMesh = TriMesh.FromRawData(vd, vertices, indices, true);
getBoundingBox()
public BoundingBox getBoundingBox()
Ottiene il bounding box dell’entità corrente nel suo sistema di coordinate dello spazio oggetto.
Returns: BoundingBox - the bounding box of current entity in its object space coordinate system. Example: The following code shows how to calculate the bounding box of a shape
Entity entity = new Sphere();
entity.setRadius(10);
var bbox = entity.getBoundingBox();
System.out.printf("The bounding box of the entity is %s ~ %s", bbox.getMinimum(), bbox.getMaximum());
getCapacity()
public int getCapacity()
La capacità dei vertici pre-allocati.
Returns: int - La capacità dei vertici pre-allocati.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getEntityRendererKey()
public EntityRendererKey getEntityRendererKey()
Ottiene la chiave del renderer dell’entità registrata nel renderer
Returns: EntityRendererKey - the key of the entity renderer registered in the renderer
getExcluded()
public boolean getExcluded()
Ottiene se escludere questa entità durante l’esportazione.
Returns: boolean - se escludere questa entità durante l’esportazione.
getIndicesCount()
public int getIndicesCount()
Il numero di indici in questo TriMesh
Returns: int - Il numero di indici in questo TriMesh
getIntIndices()
public int[] getIntIndices()
Converti gli indici in un array di interi a 32 bit
Returns: int[]
getName()
public String getName()
Ottiene il nome.
Returns: java.lang.String - il nome.
getParentNode()
public Node getParentNode()
Ottiene il primo nodo genitore; se impostato, questa entità verrà staccata dagli altri nodi genitori.
Returns: Node - the first parent node, if set the first parent node, this entity will be detached from other parent nodes.
getParentNodes()
public ArrayList<Node> getParentNodes()
Ottiene tutti i nodi genitore; un’entità può essere collegata a più nodi genitore per l’instancing della geometria.
Returns: java.util.ArrayList<com.aspose.threed.Node> - tutti i nodi genitore, un’entità può essere collegata a più nodi genitore per l’instanziazione della geometria
getProperties()
public PropertyCollection getProperties()
Ottiene la collezione di tutte le proprietà.
Returns: PropertyCollection - the collection of all properties.
getProperty(String property)
public Object getProperty(String property)
Ottieni il valore della proprietà specificata
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| proprietà | java.lang.String | Nome della proprietà |
Returns: java.lang.Object - Il valore della proprietà trovata
getScene()
public Scene getScene()
Ottiene la scena a cui appartiene questo oggetto
Returns: Scene - the scene that this object belongs to
getShortIndices()
public short[] getShortIndices()
Converti gli indici in un array di interi a 16 bit
Returns: short[]
getUnmergedVerticesCount()
public int getUnmergedVerticesCount()
Il numero di vertici non uniti forniti da beginVertex e endVertex.
Returns: int - Il numero di vertici non uniti che sono stati passati da beginVertex e endVertex.
getVertexDeclaration()
public VertexDeclaration getVertexDeclaration()
Il layout dei vertici del TriMesh.
Returns: VertexDeclaration - The vertex layout of the TriMesh.
getVerticesCount()
public int getVerticesCount()
Il numero di vertici in questo TriMesh
Returns: int - Il numero di vertici in questo TriMesh
getVerticesSizeInBytes()
public int getVerticesSizeInBytes()
La dimensione totale di tutti i vertici in byte
Returns: int - La dimensione totale di tutti i vertici in byte
hashCode()
public native int hashCode()
Returns: int
indicesToArray(int[][] result)
public void indicesToArray(int[][] result)
Converti gli indici in un array di interi a 32 bit
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| risultato | int[][] |
indicesToArray(short[][] result)
public void indicesToArray(short[][] result)
Converti gli indici in un array di interi a 16 bit
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| risultato | short[][] |
iterator()
public Iterator<Vertex> iterator()
Ottieni l’enumeratore per enumerare Vertex
Returns: java.util.Iterator<com.aspose.threed.Vertex>
loadVerticesFromBytes(byte[] verticesInBytes)
public void loadVerticesFromBytes(byte[] verticesInBytes)
Carica i vertici da byte, la lunghezza dei byte deve essere un multiplo intero della dimensione del vertice. Esempio: Il codice seguente mostra come creare un TriMesh vuoto e caricare manualmente i vertici da byte grezzi.
var indices = new int[] { 0, 1, 2 };
var vertices = new byte[]{
0, 0, 0, 191,
0, 0, 0, 0,
0, 0, 0, 191,
0, 0, 0, 191,
0, 0, 0, 0,
0, 0, 0, 63,
0, 0, 0, 63,
0, 0, 0, 0,
0, 0, 0, 63
};
VertexDeclaration vd = new VertexDeclaration();
vd.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Position);
//create an empty TriMesh with specified vertex declaration
var triMesh = new TriMesh("", vd);
//load vertices directly from bytes
triMesh.LoadVerticesFromBytes(vertices);
triMesh.AddTriangle(0, 1, 2);
int[] indices = new int[] { 0, 1, 2 };
byte[] vertices = new byte[]{
0, 0, 0, 191,
0, 0, 0, 0,
0, 0, 0, 191,
0, 0, 0, 191,
0, 0, 0, 0,
0, 0, 0, 63,
0, 0, 0, 63,
0, 0, 0, 0,
0, 0, 0, 63
};
VertexDeclaration vd = new VertexDeclaration();
vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
//create an empty TriMesh with specified vertex declaration
var triMesh = new TriMesh("", vd);
//load vertices directly from bytes
triMesh.loadVerticesFromBytes(vertices);
triMesh.addTriangle(0, 1, 2);
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| verticesInBytes | byte[] |
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
readDouble(int idx, VertexField field)
public double readDouble(int idx, VertexField field)
Leggi il campo double
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato compatibile float/double |
Returns: double - Valore double del campo del vertice specificato
readFVector2(int idx, VertexField field)
public FVector2 readFVector2(int idx, VertexField field)
Leggi il campo vector2
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato Vector2/FVector2 |
Returns: FVector2 - FVector2 of specified vertex’s field
readFVector3(int idx, VertexField field)
public FVector3 readFVector3(int idx, VertexField field)
Leggi il campo vector3
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato Vector3/FVector3 |
Returns: FVector3
readFVector4(int idx, VertexField field)
public FVector4 readFVector4(int idx, VertexField field)
Leggi il campo vector4
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato Vector4/FVector4 |
Returns: FVector4
readFloat(int idx, VertexField field)
public float readFloat(int idx, VertexField field)
Leggi il campo float
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato compatibile float/double |
Returns: float - Valore float del campo del vertice specificato
readVector2(int idx, VertexField field)
public Vector2 readVector2(int idx, VertexField field)
Leggi il campo vector2
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato Vector2/FVector2 |
Returns: Vector2 - Vector2 of specified vertex’s field
readVector3(int idx, VertexField field)
public Vector3 readVector3(int idx, VertexField field)
Leggi il campo vector3
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato Vector3/FVector3 |
Returns: Vector3
readVector4(int idx, VertexField field)
public Vector4 readVector4(int idx, VertexField field)
Leggi il campo vector4
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| idx | int | L’indice del vertice da leggere |
| field | VertexField | Il campo con un tipo di dato Vector4/FVector4 |
Returns: Vector4
removeProperty(Property property)
public boolean removeProperty(Property property)
Rimuove una proprietà dinamica.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| property | Property | Quale proprietà rimuovere |
Returns: boolean - true se la proprietà è stata rimossa con successo
removeProperty(String property)
public boolean removeProperty(String property)
Rimuove la proprietà specificata identificata per nome
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| proprietà | java.lang.String | Quale proprietà rimuovere |
Returns: boolean - true se la proprietà è stata rimossa con successo
setExcluded(boolean value)
public void setExcluded(boolean value)
Imposta se escludere questa entità durante l’esportazione.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| valore | boolean | Nuovo valore |
setName(String value)
public void setName(String value)
Imposta il nome.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| valore | java.lang.String | Nuovo valore |
setParentNode(Node value)
public void setParentNode(Node value)
Imposta il primo nodo genitore; se impostato, questa entità verrà staccata dagli altri nodi genitori.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| value | Node | Nuovo valore |
setProperty(String property, Object value)
public void setProperty(String property, Object value)
Imposta il valore della proprietà specificata
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| proprietà | java.lang.String | Nome della proprietà |
| valore | java.lang.Object | Il valore della proprietà |
toString()
public String toString()
Ottiene la rappresentazione stringa di TriMesh
Returns: java.lang.String - La rappresentazione come stringa
verticesToArray()
public byte[] verticesToArray()
Converti i dati dei vertici in array di byte
Returns: byte[]
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| arg0 | long | |
| arg1 | int |
write16bIndicesTo(Stream stream)
public void write16bIndicesTo(Stream stream)
Scrivi i dati degli indici come intero a 16 bit nello stream Example:
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
var stream = new ByteArrayOutputStream();
try(var s = Stream.wrap(stream)) {
triMesh.writeVerticesTo(s);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(s);
}
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| stream | Stream |
write16bIndicesTo(OutputStream stream)
public void write16bIndicesTo(OutputStream stream)
Scrivi i dati degli indici come intero a 16 bit nello stream
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| flusso | java.io.OutputStream |
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
var stream = new ByteArrayOutputStream();
triMesh.writeVerticesTo(stream);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(stream);
``` |
### write32bIndicesTo(Stream stream) {#write32bIndicesTo-com.aspose.threed.Stream-}
public void write32bIndicesTo(Stream stream)
Scrivi i dati degli indici come intero a 32 bit nello stream **Example:**
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh var mesh = (new Sphere()).toMesh(); var triMesh = TriMesh.fromMesh(mesh); //save it to a stream, 115 vertices * 32bytes per vertex var stream = new ByteArrayOutputStream(); try(var s = Stream.wrap(stream)) { triMesh.writeVerticesTo(s); //save indices as ushort to stream, 504 indices * 2 bytes per index triMesh.write32bIndicesTo(s); }
**Parameters:**
| Parametro | Tipo | Descrizione |
| --- | --- | --- |
| stream | [Stream](../../com.aspose.threed/stream) | |
### write32bIndicesTo(OutputStream stream) {#write32bIndicesTo-java.io.OutputStream-}
public void write32bIndicesTo(OutputStream stream)
Scrivi i dati degli indici come intero a 32 bit nello stream
**Parameters:**
| Parametro | Tipo | Descrizione |
| --- | --- | --- |
| | flusso | java.io.OutputStream | **Esempio:** |
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
var stream = new ByteArrayOutputStream();
triMesh.writeVerticesTo(stream);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write32bIndicesTo(stream);
### writeVerticesTo(Stream stream) {#writeVerticesTo-com.aspose.threed.Stream-}
public void writeVerticesTo(Stream stream)
Scrivi i dati dei vertici nello stream specificato
**Parameters:**
| Parametro | Tipo | Descrizione |
| --- | --- | --- |
| | stream | [Stream](../../com.aspose.threed/stream) | Il flusso su cui verranno scritti i dati dei vertici **Esempio:** |
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh var mesh = (new Sphere()).toMesh(); var triMesh = TriMesh.fromMesh(mesh); //save it to a stream, 115 vertices * 32bytes per vertex var stream = new ByteArrayOutputStream(); try(var s = Stream.wrap(stream)) { triMesh.writeVerticesTo(s); //save indices as ushort to stream, 504 indices * 2 bytes per index triMesh.write16bIndicesTo(s); }
### writeVerticesTo(OutputStream stream) {#writeVerticesTo-java.io.OutputStream-}
public void writeVerticesTo(OutputStream stream)
Scrivi i dati dei vertici nello stream specificato
**Parameters:**
| Parametro | Tipo | Descrizione |
| --- | --- | --- |
| | flusso | java.io.OutputStream | Il flusso su cui verranno scritti i dati dei vertici **Esempio:** |
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
var stream = new ByteArrayOutputStream();
triMesh.writeVerticesTo(stream);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(stream);