Viewer
A plugin-based viewer for learning Computer Graphics and OpenGL
Scene Class Reference

The Scene class represents a 3D scene as a flat collection of 3D objects. More...

#include <scene.h>

List of all members.

Public Member Functions

 Scene ()
const vector< Object > & objects () const
void addObject (Object &)
int selectedObject () const
void setSelectedObject (int index)
void computeBoundingBox ()
Box boundingBox () const

Detailed Description

A scene is basically a vector of 3D objects.


Constructor & Destructor Documentation

Constructs an empty scene.


Member Function Documentation

void Scene::addObject ( Object o)

Adds an object to the scene.

Returns the value of the bounding box property. This property is undefined unless boundingBox() has been called for this scene.

Recomputes the bounding box of the scene, as the bounding box of its objects.

const vector< Object > & Scene::objects ( ) const

Returns a constant reference (read-only) to the vector of objects forming the scene.

int Scene::selectedObject ( ) const

If an object is selected, returns the index of that selected object (from 0 to number of objects - 1). Otherwise returns -1.

void Scene::setSelectedObject ( int  index)

Sets the selected object by indicating its index. Only one object can be seleted at any given time.

Parameters:
indexis the position of the selected object in the vector of objects.

The documentation for this class was generated from the following files:
 All Classes Functions