sparkle::Group Class Reference
[Sparkle Library]

Basic grouping of shapes. More...

#include <group.h>

Inherits sparkle::SceneObject.

Collaboration diagram for sparkle::Group:

Collaboration graph
[legend]
List of all members.

Public Member Functions

ctors/dtor
 Group ()
 ~Group ()
Modifiers
int addShape (Shape *newShape)
int removeShape (Shape *shapeToRemove)
void setName (std::string newName)
Getters
Not necessarily const

int numOfShapes () const
ShapeshapeAt (int index)
std::string name () const
double momentOfInertia ()

Protected Attributes

std::vector< Shape * > shapes
std::string groupName

Detailed Description

Basic grouping of shapes.

A simple logical grouping of shapes to easily create more complex shapes. The shapes will be rigidly fixed together.

It is optional to assign a shape to a group.


Constructor & Destructor Documentation

Group::Group  ) 
 

Create a group with no members

Group::~Group  ) 
 

Deconstructor


Member Function Documentation

int Group::addShape Shape newShape  ) 
 

Add a new shape to the group

Parameters:
newShape The new shape to be added
Returns:
The number of shapes in the group

int Group::removeShape Shape shapeToRemove  ) 
 

Removes the specified shape from the group

Parameters:
shapeToRemove The new shape to be removed
Returns:
The number of shapes in the group

void sparkle::Group::setName std::string  newName  )  [inline]
 

Set the name of the group

Parameters:
newName New name

int sparkle::Group::numOfShapes  )  const [inline]
 

Returns:
The number of shapes in the group

Shape* sparkle::Group::shapeAt int  index  )  [inline]
 

Parameters:
index The index of the shape within the group
Returns:
A pointer to the shape at index

std::string sparkle::Group::name  )  const [inline]
 

Returns:
The name of the group

double Group::momentOfInertia  ) 
 

Calculates the moment of inertia for the whole group using the parallel-axis theorem

Returns:
The moment of inertia of the whole group


Member Data Documentation

std::vector<Shape*> sparkle::Group::shapes [protected]
 

List of shapes in the group

std::string sparkle::Group::groupName [protected]
 

Name of group


Hosted by SourceForge.net Logo Generated on Sat Sep 16 01:51:09 2006 for Sparkle by Doxygen 1.4.6.