public final class BufferStructureBuilder
extends java.lang.Object
BufferStructure instances.AccessorModel instance, these
instances will not be fully initialized until the build()
method is called.| Constructor and Description |
|---|
BufferStructureBuilder()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAccessorModel(java.lang.String idPrefix,
DefaultAccessorModel accessorModel)
Add the given
AccessorModel in the BufferStructure that
is currently being built. |
void |
addBufferModel(java.lang.String idPrefix,
DefaultBufferModel bufferModel)
Add the given
BufferModel in the BufferStructure
that is currently being built. |
void |
addBufferViewModel(java.lang.String idPrefix,
DefaultBufferViewModel bufferViewModel)
Add the given
BufferViewModel in the BufferStructure
that is currently being built. |
BufferStructure |
build()
Return the
BufferStructure instance that was created with
this builder. |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
byte[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_BYTE |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
float[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built. |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
int[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_INT |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
int componentType,
java.lang.String type,
java.nio.ByteBuffer byteBuffer)
Create an
AccessorModel in the BufferStructure that
is currently being built. |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
short[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_SHORT |
BufferViewModel |
createArrayBufferViewModel(java.lang.String idPrefix)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
BufferViewModel |
createArrayElementBufferViewModel(java.lang.String idPrefix)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
BufferModel |
createBufferModel(java.lang.String idPrefix,
java.lang.String uri)
Create a
BufferModel in the BufferStructure that
is currently being built. |
BufferViewModel |
createBufferViewModel(java.lang.String idPrefix,
java.lang.Integer target)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
BufferViewModel |
createImageBufferViewModel(java.lang.String idPrefix,
java.nio.ByteBuffer imageData)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
int |
getNumAccessorModels()
Returns the number of
AccessorModel instances that have
been created until now |
int |
getNumBufferModels()
Returns the number of
BufferModel instances that have
been created until now |
int |
getNumBufferViewModels()
Returns the number of
BufferViewModel instances that have
been created until now |
int |
getNumCurrentAccessorModels()
Returns the number of
AccessorModel instances that have been
added, but for which no BufferViewModel has been created
yet. |
int |
getNumCurrentBufferViewModels()
Returns the number of
BufferViewModel instances that have been
added, but for which no BufferModel has been created
yet. |
public int getNumAccessorModels()
AccessorModel instances that have
been created until nowAccessorModel instancespublic int getNumBufferViewModels()
BufferViewModel instances that have
been created until nowBufferViewModel instancespublic int getNumBufferModels()
BufferModel instances that have
been created until nowBufferModel instancespublic int getNumCurrentAccessorModels()
AccessorModel instances that have been
added, but for which no BufferViewModel has been created
yet.AccessorModel instancespublic int getNumCurrentBufferViewModels()
BufferViewModel instances that have been
added, but for which no BufferModel has been created
yet.BufferViewModel instancespublic AccessorModel createAccessorModel(java.lang.String idPrefix, float[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix of the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, int[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_INTidPrefix - The ID prefix of the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, short[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_SHORTidPrefix - The ID prefix for the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, byte[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_BYTEidPrefix - The ID prefix for the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, int componentType, java.lang.String type, java.nio.ByteBuffer byteBuffer)
AccessorModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix of the AccessorModelcomponentType - The component type, as a GL constanttype - The type of the data, as a string corresponding to
the ElementType of the accessorbyteBuffer - The actual dataAccessorModelpublic void addAccessorModel(java.lang.String idPrefix,
DefaultAccessorModel accessorModel)
AccessorModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix of the AccessorModelaccessorModel - The AccessorModelGltfException - If the given accessor model already has an
associated buffer viewpublic BufferViewModel createArrayBufferViewModel(java.lang.String idPrefix)
BufferViewModel in the BufferStructure that
is currently being built. The target will be the GL constant for GL_ARRAY_BUFFER.idPrefix - The ID prefix for the BufferViewModelBufferViewModelpublic BufferViewModel createArrayElementBufferViewModel(java.lang.String idPrefix)
BufferViewModel in the BufferStructure that
is currently being built. The target will be the GL constant for GL_ELEMENT_ARRAY_BUFFER.idPrefix - The ID prefix for the BufferViewModelBufferViewModelpublic BufferViewModel createBufferViewModel(java.lang.String idPrefix, java.lang.Integer target)
BufferViewModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix for the BufferViewModeltarget - The BufferViewModel.getTarget()BufferViewModelpublic void addBufferViewModel(java.lang.String idPrefix,
DefaultBufferViewModel bufferViewModel)
BufferViewModel in the BufferStructure
that is currently being built. All AccessorModel instances
that have been created until now and not yet added to a
BufferViewModel will be assigned to the given model.idPrefix - The ID prefix for the BufferViewModelbufferViewModel - The BufferViewModel to addpublic BufferViewModel createImageBufferViewModel(java.lang.String idPrefix, java.nio.ByteBuffer imageData)
BufferViewModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix for the BufferViewModelimageData - The iamge dataBufferViewModeljava.lang.IllegalStateException - When there are pending accessor modelspublic BufferModel createBufferModel(java.lang.String idPrefix, java.lang.String uri)
BufferModel in the BufferStructure that
is currently being built.
If no buffer view models have been created (at all, or after
this method has previously been called), then this call will
not have any effect, and null will be returned.idPrefix - The ID prefix for the BufferModeluri - The BufferModel.getUri()BufferModelpublic void addBufferModel(java.lang.String idPrefix,
DefaultBufferModel bufferModel)
BufferModel in the BufferStructure
that is currently being built. All BufferViewModel instances
that have been created until now and not yet added to a
BufferModel will be assigned to the given model.idPrefix - The ID prefix for the BufferModelbufferModel - The BufferModelpublic BufferStructure build()
BufferStructure instance that was created with
this builder.BufferStructurejava.lang.IllegalStateException - If there are buffer views that have
not yet been combined into a bufferCopyright © 2024. All Rights Reserved.