ContRap-Libraries
Public Member Functions

crp::GLScene Class Reference

Class GLScene is a container for OpenGL primitives. More...

#include <glscene.h>

Inheritance diagram for crp::GLScene:
crp::GLPrimitive

Public Member Functions

 GLScene ()
 Creates an empty scene.
 ~GLScene ()
 Cleans up the memory.
bool load_primitives (const std::string &file_name)
 Loads primitives from file.
void add_primitive (const SPtr< GLPrimitive > &primitive)
 Adds a new primitive to the scene.
void remove_primitive (const SPtr< GLPrimitive > &primitive)
 Removes a new primitive from the scene.
void clear ()
 Removes all primitives from the scene.
std::vector< SPtr< GLPrimitive > > & get_primitives ()
 Returns the list of primitives.
virtual GLPrimitiveType get_type () const
 Type of the primitive.
virtual void make_display_list (int flags) const
 Performs operations needed to create a display list of the model.
int add_texture (GLTexture *texture)
 Adds a texture to the scene.

Detailed Description

Class GLScene is a container for OpenGL primitives.

Its purpose is mainly the interchange of primitive collections for now.


Constructor & Destructor Documentation

crp::GLScene::GLScene ( )

Creates an empty scene.

crp::GLScene::~GLScene ( )

Cleans up the memory.


Member Function Documentation

void crp::GLScene::add_primitive ( const SPtr< GLPrimitive > &  primitive)

Adds a new primitive to the scene.

Parameters:
primitivePrimitive to add
int crp::GLScene::add_texture ( GLTexture texture)

Adds a texture to the scene.

Parameters:
texturePointer to a texture
void crp::GLScene::clear ( )

Removes all primitives from the scene.

std::vector<SPtr<GLPrimitive> >& crp::GLScene::get_primitives ( )

Returns the list of primitives.

Returns:
Vector of primitives
virtual GLPrimitiveType crp::GLScene::get_type ( ) const [inline, virtual]

Type of the primitive.

Returns:
Type name of the primitive

Implements crp::GLPrimitive.

bool crp::GLScene::load_primitives ( const std::string &  file_name)

Loads primitives from file.

Parameters:
file_nameName of the file to load
Returns:
True if succeeded
virtual void crp::GLScene::make_display_list ( int  flags) const [virtual]

Performs operations needed to create a display list of the model.

Parameters:
flagsStyle flags used to filter out drawing

Implements crp::GLPrimitive.

void crp::GLScene::remove_primitive ( const SPtr< GLPrimitive > &  primitive)

Removes a new primitive from the scene.

Parameters:
primitivePrimitive to remove

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