# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::Primitives Class Reference

This is the base class of DrawElements and DrawArrays which respectively wrap the OpenGL functions glDrawElements() and glDrawArrays(). More...

`#include <Primitives.hpp>`

Inheritance diagram for vl::Primitives:

List of all members.

## Public Member Functions
| Primitives ()
virtual const char * | className ()
| Returns the name of the class.
virtual | ~Primitives ()
void | setPrimitiveType (EPrimitiveType type)
EPrimitiveType | primitiveType () const
virtual void | render (bool use_vbo=true) const =0
virtual ref< Primitives > | clone () const =0
virtual void | deleteVBOs ()=0
virtual void | updateVBOs (bool discard_local_data=false)=0
virtual unsigned int | handle () const =0
virtual unsigned int | indexCount () const =0
virtual unsigned int | index (int i) const =0
virtual int | triangleCount () const =0
virtual int | lineCount () const =0
virtual int | pointCount () const =0
virtual void | sortTriangles ()
| Supported only by DrawElements.
int | instances () const
void | setInstances (int instances)
void | setEnabled (bool enable)
bool | isEnabled () const
## Protected Attributes
EPrimitiveType | mType
int | mInstances
bool | mEnabled

## Detailed Description

This is the base class of DrawElements and DrawArrays which respectively wrap the OpenGL functions glDrawElements() and glDrawArrays().

## Constructor & Destructor Documentation

vl::Primitives::Primitives | ( |  | ) | `[inline]`

virtual vl::Primitives::~Primitives | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual const char* vl::Primitives::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Reimplemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

void vl::Primitives::setPrimitiveType | ( | EPrimitiveType | type | ) | `[inline]`

Reimplemented in vl::DrawElements< index_type, Tgltype, arr_type >.

EPrimitiveType vl::Primitives::primitiveType | ( |  | ) | const`[inline]`

Reimplemented in vl::DrawElements< index_type, Tgltype, arr_type >.

virtual void vl::Primitives::render | ( | bool | use_vbo = `true` | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual ref<Primitives> vl::Primitives::clone | ( |  | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual void vl::Primitives::deleteVBOs | ( |  | ) | `[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual void vl::Primitives::updateVBOs | ( | bool | discard_local_data = `false` | ) | `[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual unsigned int vl::Primitives::handle | ( |  | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual unsigned int vl::Primitives::indexCount | ( |  | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual unsigned int vl::Primitives::index | ( | int | i | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual int vl::Primitives::triangleCount | ( |  | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual int vl::Primitives::lineCount | ( |  | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual int vl::Primitives::pointCount | ( |  | ) | const`[pure virtual]`

Implemented in vl::DrawArrays, and vl::DrawElements< index_type, Tgltype, arr_type >.

virtual void vl::Primitives::sortTriangles | ( |  | ) | `[inline, virtual]`

Supported only by DrawElements.

Reimplemented in vl::DrawElements< index_type, Tgltype, arr_type >.

int vl::Primitives::instances | ( |  | ) | const`[inline]`

void vl::Primitives::setInstances | ( | int | instances | ) | `[inline]`

void vl::Primitives::setEnabled | ( | bool | enable | ) | `[inline]`

bool vl::Primitives::isEnabled | ( |  | ) | const`[inline]`

## Member Data Documentation

EPrimitiveType vl::Primitives::mType`[protected]`

int vl::Primitives::mInstances`[protected]`

bool vl::Primitives::mEnabled`[protected]`

The documentation for this class was generated from the following file:

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Primitives.hpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 29 11:11:48 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.