Loading...
Searching...
No Matches
BALL::VIEW::MeshBuffer Class Reference
Visualisation » Renderer

`#include <BALL/VIEW/RENDERING/vertexBuffer.h>`

## Public Types

typedef GLuint | Buffer[4]

## Public Member Functions

| MeshBuffer ()
| MeshBuffer (const MeshBuffer &mesh_buffer)
virtual | ~MeshBuffer ()
const MeshBuffer & | operator= (const MeshBuffer &buffer)
const Mesh * | getMesh ()
| Get the Mesh for this buffer object.
void | setMesh (const Mesh &mesh)
| Set the Mesh which shall be drawn with this buffer object.
bool | initialize ()
| Transfer all vertex, normal, index and color data of the mesh into the vertex buffer object.
bool | draw ()
| Draw the mesh from the buffer.
void | clear ()
| Unset the mesh pointer and clear the buffer.
void | clearBuffer ()
| Free the reserved (and filled) vertex buffer.
bool | isBusy () const
| Return true, if currently updateing or drawing.

## Static Public Member Functions

static bool | initGL ()
static void | setGLRenderer (GLRenderer *renderer)

## Protected Attributes

const Mesh * | mesh_
Buffer | buffer_
bool | filled_
bool | busy_
bool | multiple_colors_
ColorRGBA | color_
Size | vertices_
Size | triangles_

## Static Protected Attributes

static GLRenderer * | gl_renderer_

## Detailed Description

Wrapper class to draw BALLView Mesh instances with OpenGL vertex buffer objects. Vertex Buffer Objects are an OpenGL extension available since OpenGL version 1.5.

  See http://oss.sgi.com/projects/ogl-sample/registry/EXT/pixel_buffer_object.txt

  Vertex Buffer Objects can drasticaly increase drawing speed for triangulated surfaces (up to 5 fold) compared with OpenGL display lists. To ensure a maximum of platform independence we use method pointers in the source file. These must be initialised by calling MeshBuffer::initGL() (See below).

Definition at line 42 of file vertexBuffer.h.

## Member Typedef Documentation

## Buffer

typedef GLuint BALL::VIEW::MeshBuffer::Buffer[4]

Definition at line 48 of file vertexBuffer.h.

## Constructor & Destructor Documentation

## MeshBuffer() [1/2]

BALL::VIEW::MeshBuffer::MeshBuffer | ( |  | ) |

## MeshBuffer() [2/2]

BALL::VIEW::MeshBuffer::MeshBuffer | ( | const MeshBuffer & | mesh_buffer | ) |

## ~MeshBuffer()

virtual BALL::VIEW::MeshBuffer::~MeshBuffer | ( |  | ) |

virtual

## Member Function Documentation

## clear()

void BALL::VIEW::MeshBuffer::clear | ( |  | ) |

Unset the mesh pointer and clear the buffer.

## clearBuffer()

void BALL::VIEW::MeshBuffer::clearBuffer | ( |  | ) |

Free the reserved (and filled) vertex buffer.

## draw()

bool BALL::VIEW::MeshBuffer::draw | ( |  | ) |

Draw the mesh from the buffer.

## getMesh()

const Mesh * BALL::VIEW::MeshBuffer::getMesh | ( |  | ) |

inline

Get the Mesh for this buffer object.

Definition at line 68 of file vertexBuffer.h.

## initGL()

bool BALL::VIEW::MeshBuffer::initGL | ( |  | ) |

static

Initialise the GL needed methods. Call this method one time after having a valid GL context (e.g. in GLRenderer::init).

## initialize()

bool BALL::VIEW::MeshBuffer::initialize | ( |  | ) |

Transfer all vertex, normal, index and color data of the mesh into the vertex buffer object.

## isBusy()

bool BALL::VIEW::MeshBuffer::isBusy | ( |  | ) | const

inline

Return true, if currently updateing or drawing.

Definition at line 86 of file vertexBuffer.h.

## operator=()

const MeshBuffer & BALL::VIEW::MeshBuffer::operator= | ( | const MeshBuffer & | buffer | ) |

## setGLRenderer()

void BALL::VIEW::MeshBuffer::setGLRenderer | ( | GLRenderer * | renderer | ) |

inline static

Set the GLRender. This GLRender pointer is used to know if to draw the mesh transparent solid or transparent, as solid triangles or as points. Meshes can currently not drawn in wireframe mode with vertex buffer.

Definition at line 93 of file vertexBuffer.h.

## setMesh()

void BALL::VIEW::MeshBuffer::setMesh | ( | const Mesh & | mesh | ) |

inline

Set the Mesh which shall be drawn with this buffer object.

Definition at line 71 of file vertexBuffer.h.

## Member Data Documentation

## buffer_

Buffer BALL::VIEW::MeshBuffer::buffer_

protected

Definition at line 98 of file vertexBuffer.h.

## busy_

bool BALL::VIEW::MeshBuffer::busy_

protected

Definition at line 101 of file vertexBuffer.h.

## color_

ColorRGBA BALL::VIEW::MeshBuffer::color_

protected

Definition at line 103 of file vertexBuffer.h.

## filled_

bool BALL::VIEW::MeshBuffer::filled_

protected

Definition at line 99 of file vertexBuffer.h.

## gl_renderer_

GLRenderer* BALL::VIEW::MeshBuffer::gl_renderer_

static protected

Definition at line 100 of file vertexBuffer.h.

## mesh_

const Mesh* BALL::VIEW::MeshBuffer::mesh_

protected

Definition at line 97 of file vertexBuffer.h.

## multiple_colors_

bool BALL::VIEW::MeshBuffer::multiple_colors_

protected

Definition at line 102 of file vertexBuffer.h.

## triangles_

Size BALL::VIEW::MeshBuffer::triangles_

protected

Definition at line 105 of file vertexBuffer.h.

## vertices_

Size BALL::VIEW::MeshBuffer::vertices_

protected

Definition at line 104 of file vertexBuffer.h.