Shape Struct Reference
[Shapes]

Base class for Shape objects. More...

#include <Shape.h>

Inheritance diagram for Shape:

Inheritance graph
[legend]
Collaboration diagram for Shape:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ShapeType {
  ST_CIRCLE, ST_CONVEX, ST_POLY, ST_POINT,
  ST_LINE, ST_NONE
}
 Type of shape. More...

Public Member Functions

 Shape ()
 Construct new Shape of type Shape::ST_NONE.
 Shape (const std::string &name)
 Construct a Shape with a given name.
 Shape (const Shape &copy)
 Copy constructor for Shapes.
virtual ShapeType type ()
 Get the type of a Shape.
virtual void getDataPoints (std::vector< Vector2f > &points) const
 Get locations of the points that construct the Shape.
virtual const VertexgetPoint (int idx) const
 Get a const reference to a vertex at a specific index.
virtual VertexgetPoint (int idx)
 Get a reference to a vertex at a specific index.
virtual std::vector< Vertex > & getPoints ()
 Get the vertices that make up this object.

Public Attributes

boost::signal< void(Shape
*, Shape *, b2Contact *) 
Collision )
 Collision signal that occurs when two Shapes collide.
AppearanceProperties Appearance
 Contains the visual properties for this object.
PhysicsProperties Physics
 Contains the physical properties for this object.

Friends

class SceneNode


Detailed Description

Base class for Shape objects.

Shapes are a type of Node with a geometrical representation.


Member Enumeration Documentation

Type of shape.

Returned by the type() method.

Contains the following:

Enumerator:
ST_CIRCLE  Circle primitive
ST_CONVEX  Convex polygon
ST_POLY  Arbitrary polygon
ST_POINT  Point
ST_LINE  Line connecting two points
ST_NONE  No shape


Constructor & Destructor Documentation

Shape::Shape (  )  [inline]

Construct new Shape of type Shape::ST_NONE.

This sort of Shape has no geometrical representation.

Shape::Shape ( const std::string &  name  )  [inline]

Construct a Shape with a given name.

See also:
Node::Node ( const std::string& name )


Member Function Documentation

virtual ShapeType Shape::type (  )  [inline, virtual]

Get the type of a Shape.

Returns:
type of the shape

Reimplemented in Circle, Line, Point, Poly, Quad, and Tri.

virtual void Shape::getDataPoints ( std::vector< Vector2f > &  points  )  const [virtual]

Get locations of the points that construct the Shape.

Parameters:
points vector of points to fill

Reimplemented from Node.

virtual const Vertex& Shape::getPoint ( int  idx  )  const [inline, virtual]

Get a const reference to a vertex at a specific index.

See also:
Vertex
Parameters:
idx index of point to get

virtual Vertex& Shape::getPoint ( int  idx  )  [inline, virtual]

Get a reference to a vertex at a specific index.

See also:
Vertex
Parameters:
idx index of point to get

virtual std::vector<Vertex>& Shape::getPoints (  )  [virtual]

Get the vertices that make up this object.

These are the same vertices that are used to draw the object. Modifying these will modify the appearance of the object.

See also:
Vertex


Member Data Documentation

boost::signal<void (Shape*, Shape*, b2Contact*) Shape::Collision)

Collision signal that occurs when two Shapes collide.

Connect to this signal to be notified of collision events for this Shape.

See also:
boost::signal, b2Contact

Contains the visual properties for this object.

See also:
AppearanceProperties

Contains the physical properties for this object.

See also:
PhysicsProperties


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

Generated on Fri Feb 22 15:56:24 2008 for Scene2D by  doxygen 1.5.5