|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mt4j.components.visibleComponents.GeometryInfo
public class GeometryInfo
A class which holds the vertices and eventually also the normals, colors, indices, displaylist ids,and vbo ids of the geometry.
Constructor Summary | |
---|---|
GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices) Creates a new GeometryInfo. |
|
GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices, int[] indices) Instantiates a new geometry info. |
|
GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices, Vector3D[] normals) Instantiates a new geometry info. |
|
GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices, Vector3D[] normals, int[] indices) Creates a new GeometryInfo with vertices, normals and indices. |
Method Summary | |
---|---|
void |
deleteAllVBOs() Deletes all VBOs of the geometry. |
void |
deleteDisplayLists() Delete the the displaylists of that geometry. |
void |
generateDisplayLists(boolean useTexture, processing.core.PImage texture, int fillDrawMode, boolean drawSmooth, float strokeWeight) Generates 2 openGL display lists for drawing this shape. |
void |
generateOrUpdateAllVBOs() Generates Vertex Buffer Objects (VBO) from the local buffers for Vertex, Texture, Color, StrokeColor and Normals. |
void |
generateOrUpdateBuffersLocal(StyleInfo styleInfo) Updates all draw buffers with the current settings |
java.nio.FloatBuffer |
getColorBuff() Gets the color buff. |
int[] |
getDisplayListIDs() Returns the IDs (names) of the display lists if they have been generated! |
java.nio.IntBuffer |
getIndexBuff() Gets the index buff. |
int[] |
getIndices() Gets the indices. |
Vector3D[] |
getNormals() Gets the normals. |
java.nio.FloatBuffer |
getNormalsBuff() Gets the normals buff. |
processing.core.PApplet |
getRenderer() Gets the renderer. |
java.nio.FloatBuffer |
getStrokeColBuff() Gets the stroke col buff. |
java.nio.FloatBuffer |
getTexBuff() Gets the tex buff. |
int |
getVBOColorName() Gets the vBO color name. |
int |
getVBONormalsName() Gets the vBO normals name. |
int |
getVBOStrokeColorName() Gets the vBO stroke color name. |
int |
getVBOTextureName() Gets the vBO texture name. |
int |
getVBOVerticesName() Gets the vBO vertices name. |
java.nio.FloatBuffer |
getVertBuff() Gets the vert buff. |
int |
getVertexCount() Gets the vertex count. |
Vertex[] |
getVertices() Returns the vertices of this shape without any transformations applied Caution: If you alter them in anyway, changes will only be consistent by calling the setNewVertices() method!. |
boolean |
isContainsNormals() Returns true, if a normals array for the geometry has been set. |
boolean |
isIndexed() Returns true, if an indices array for the geometry has been set. |
void |
reconstruct(Vertex[] vertices, Vector3D[] normals, int[] indices, boolean createOrUpdateOGLBuffers, boolean createOrUpdateVBO, StyleInfo styleInfo) Reconstructs the geometry with the given parameters. |
void |
setDisplayListIDs(int[] ids) Sets the display lists for this shape. |
void |
setIndices(int[] indices, boolean createOrUpdateOGLBuffers) Adds indices to the geometry. |
void |
setNormals(Vector3D[] normals, boolean createOrUpdateOGLBuffers, boolean createOrUpdateVBO) Adds normals to the geometry info. |
void |
setStrokeColorAll(float r, float g, float b, float a) Sets the stroke color all. |
void |
setVerticesColorAll(float r, float g, float b, float a) Sets the vertices color all. |
void |
updateColorVBO(java.nio.FloatBuffer colorBuffer) Update color vbo. |
void |
updateNormalsVBO(java.nio.FloatBuffer normalsBuffer, boolean setAsNewNormalBuffer, boolean setAsNewNormalArray) Update normals vbo. |
void |
updateStrokeColorVBO(java.nio.FloatBuffer strokeColorBuffer) Update stroke color vbo. |
void |
updateTextureBuffer(boolean updateVBO) Generates new texture buffer for openGL use. |
void |
updateTextureVBO(java.nio.FloatBuffer textureBuffer) Update texture vbo. |
void |
updateVertexVBO(java.nio.FloatBuffer vertexBuffer, boolean setAsNewVertexBuffer, boolean setAsNewVertexArray) Updates the vertex buffer objects and sets the specified vertexbuffer to the geometryinfo. |
void |
updateVerticesColorBuffer() Generates new color buffers for openGL use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices)
pApplet
- the appletvertices
- the verticespublic GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices, Vector3D[] normals)
pApplet
- the appletvertices
- the verticesnormals
- the normalspublic GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices, int[] indices)
pApplet
- the appletvertices
- the verticesindices
- the indicespublic GeometryInfo(processing.core.PApplet pApplet, Vertex[] vertices, Vector3D[] normals, int[] indices)
pApplet
- the appletvertices
- the verticesnormals
- the normalsindices
- the indicesMethod Detail |
---|
public void reconstruct(Vertex[] vertices, Vector3D[] normals, int[] indices, boolean createOrUpdateOGLBuffers, boolean createOrUpdateVBO, StyleInfo styleInfo)
vertices
- the verticesnormals
- the normalsindices
- the indicescreateOrUpdateOGLBuffers
- the create or update ogl bufferscreateOrUpdateVBO
- the create or update vbostyleInfo
- the style infopublic void setIndices(int[] indices, boolean createOrUpdateOGLBuffers)
indices
- the indicescreateOrUpdateOGLBuffers
- the create or update ogl bufferspublic int[] getIndices()
public boolean isIndexed()
public void setNormals(Vector3D[] normals, boolean createOrUpdateOGLBuffers, boolean createOrUpdateVBO)
normals
- the normalscreateOrUpdateOGLBuffers
- the create or update ogl bufferscreateOrUpdateVBO
- the create or update vbopublic Vector3D[] getNormals()
public boolean isContainsNormals()
public void generateOrUpdateBuffersLocal(StyleInfo styleInfo)
styleInfo
- the style infopublic java.nio.FloatBuffer getColorBuff()
public java.nio.IntBuffer getIndexBuff()
public java.nio.FloatBuffer getStrokeColBuff()
public java.nio.FloatBuffer getTexBuff()
public java.nio.FloatBuffer getVertBuff()
public java.nio.FloatBuffer getNormalsBuff()
public void generateOrUpdateAllVBOs()
If the geometry had vbos already, we should delete them first usually.
public void updateVertexVBO(java.nio.FloatBuffer vertexBuffer, boolean setAsNewVertexBuffer, boolean setAsNewVertexArray)
vertexBuffer
- the vertex buffersetAsNewVertexBuffer
- the set as new vertex buffersetAsNewVertexArray
- the set as new vertex arraypublic void updateTextureVBO(java.nio.FloatBuffer textureBuffer)
textureBuffer
- the texture bufferpublic void updateColorVBO(java.nio.FloatBuffer colorBuffer)
colorBuffer
- the color bufferpublic void updateStrokeColorVBO(java.nio.FloatBuffer strokeColorBuffer)
strokeColorBuffer
- the stroke color bufferpublic void updateNormalsVBO(java.nio.FloatBuffer normalsBuffer, boolean setAsNewNormalBuffer, boolean setAsNewNormalArray)
normalsBuffer
- the normals buffersetAsNewNormalBuffer
- the set as new normal buffersetAsNewNormalArray
- the set as new normal arraypublic void deleteAllVBOs()
public int getVBOVerticesName()
public int getVBOColorName()
public int getVBOTextureName()
public int getVBOStrokeColorName()
public int getVBONormalsName()
public void generateDisplayLists(boolean useTexture, processing.core.PImage texture, int fillDrawMode, boolean drawSmooth, float strokeWeight)
setUseDirectGL
has to be set to true first!setUseDisplayList()
useTexture
- the use texturetexture
- the texturefillDrawMode
- the fill draw modedrawSmooth
- the draw smoothstrokeWeight
- the stroke weightpublic void deleteDisplayLists()
public int[] getDisplayListIDs()
public void setDisplayListIDs(int[] ids)
glGenlists
ids
- the idspublic Vertex[] getVertices()
public void setVerticesColorAll(float r, float g, float b, float a)
r
- the rg
- the gb
- the ba
- the apublic void setStrokeColorAll(float r, float g, float b, float a)
r
- the rg
- the gb
- the ba
- the apublic void updateVerticesColorBuffer()
public void updateTextureBuffer(boolean updateVBO)
updateVBO
- the update vbopublic int getVertexCount()
public processing.core.PApplet getRenderer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |