Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::MultiShape Class Reference

A grouping of individual 2D shapes used to express more elaborate shapes. More...

#include <multishape.h>

+ Collaboration diagram for Mezzanine::Graphics::Procedural::MultiShape:

Public Types

typedef LineSegmentContainer::const_iterator ConstLineSegmentIterator
 Const Iterator type for LineSegment2D instances being stored in this class.
 
typedef ShapeContainer::const_iterator ConstShapeIterator
 Const Iterator type for Shape instances being stored in this class.
 
typedef std::vector< LineSegment2DLineSegmentContainer
 Basic container type for LineSegment2D storage in this class.
 
typedef LineSegmentContainer::iterator LineSegmentIterator
 Iterator type for LineSegment2D instances being stored in this class.
 
typedef std::vector< ShapeShapeContainer
 Basic container type for Shape storage in this class.
 
typedef ShapeContainer::iterator ShapeIterator
 Iterator type for Shape instances being stored in this class.
 

Public Member Functions

 MultiShape ()
 Blank constructor.
 
 MultiShape (const Shape &ToAdd)
 Single shape constructor. More...
 
 MultiShape (const ShapeContainer &ToAdd)
 Multiple shape constructor. More...
 
 ~MultiShape ()
 Class destructor.
 
MultiShapeAddMultiShape (const MultiShape &Other)
 Append every shape of another MultiShape to this MultiShape. More...
 
MultiShapeAddShape (const Shape &ToAdd)
 Adds a shape to this MultiShape. More...
 
void BuildFromSegmentSoup (const LineSegmentContainer &Segments)
 Creates this MultiShape from a listing of segments. More...
 
MultiShapeClose ()
 Closes each shape in this MultiShape. More...
 
MeshGenerateMesh (const String &Name, const String &Group)
 Outputs a mesh representing this MultiShape. More...
 
Whole GetNumShapes () const
 Gets the number of shapes in this MultiShape. More...
 
Point2DContainer GetPoints () const
 Gets a container of all the points in this MultiShape. More...
 
ShapeGetShape (const Whole Index)
 Gets a shape by index. More...
 
const ShapeGetShape (const Whole Index) const
 Gets a shape by index. More...
 
Boole IsClosed () const
 Gets whether or not every Shape in this MultiShape is closed. More...
 
Boole IsOutsideRealOutside () const
 Gets whether the currently set OutSide is the real Outside. More...
 
Boole IsPointInside (const Vector2 &Point) const
 Gets whether or not a point is inside this MultiShape. More...
 
void RemoveAllShapes ()
 Removes all shapes from this MultiShape.
 

Protected Attributes

ShapeContainer Shapes
 Container storing all of the Shapes that form this MultiShape. More...
 

Detailed Description

A grouping of individual 2D shapes used to express more elaborate shapes.

There are a number of assumptions that are made and are not checked against; the shapes must not cross each other.

Definition at line 87 of file multishape.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::Procedural::MultiShape::MultiShape ( const Shape ToAdd)

Single shape constructor.

Parameters
ToAddThe shape to be added to this MultiShape.

Definition at line 88 of file multishape.cpp.

Mezzanine::Graphics::Procedural::MultiShape::MultiShape ( const ShapeContainer ToAdd)

Multiple shape constructor.

Parameters
ToAddA container of shapes that will all be added to this MultiShape.

Definition at line 91 of file multishape.cpp.

Member Function Documentation

MultiShape & Mezzanine::Graphics::Procedural::MultiShape::AddMultiShape ( const MultiShape Other)

Append every shape of another MultiShape to this MultiShape.

Parameters
OtherThe other MultiShape to append.
Returns
Returns a reference to this.

Definition at line 304 of file multishape.cpp.

MultiShape & Mezzanine::Graphics::Procedural::MultiShape::AddShape ( const Shape ToAdd)

Adds a shape to this MultiShape.

Parameters
ToAddThe shape to be added.
Returns
Returns a reference to this.

Definition at line 298 of file multishape.cpp.

void Mezzanine::Graphics::Procedural::MultiShape::BuildFromSegmentSoup ( const LineSegmentContainer Segments)

Creates this MultiShape from a listing of segments.

Parameters
SegmentsThe segments to form this MultiShape from.

Definition at line 116 of file multishape.cpp.

MultiShape & Mezzanine::Graphics::Procedural::MultiShape::Close ( )

Closes each shape in this MultiShape.

Returns
Returns a reference to this.

Definition at line 278 of file multishape.cpp.

Mesh * Mezzanine::Graphics::Procedural::MultiShape::GenerateMesh ( const String Name,
const String Group 
)

Outputs a mesh representing this MultiShape.

Parameters
NameThe name of the mesh to be generated.
GroupThe name of the resource group to create the mesh in.
Returns
Returns a pointer to the new mesh.

Definition at line 100 of file multishape.cpp.

Whole Mezzanine::Graphics::Procedural::MultiShape::GetNumShapes ( ) const

Gets the number of shapes in this MultiShape.

Returns
Returns a Whole representing the number of shapes currently stored in this MultiShape.

Definition at line 317 of file multishape.cpp.

Point2DContainer Mezzanine::Graphics::Procedural::MultiShape::GetPoints ( ) const

Gets a container of all the points in this MultiShape.

Returns
Returns a vector of Vector2's representing each point in this MultiShape.

Definition at line 187 of file multishape.cpp.

Shape & Mezzanine::Graphics::Procedural::MultiShape::GetShape ( const Whole  Index)

Gets a shape by index.

Parameters
IndexThe index of the shape to retrieve.
Returns
Returns a reference to the shape at the specified index.

Definition at line 311 of file multishape.cpp.

const Shape & Mezzanine::Graphics::Procedural::MultiShape::GetShape ( const Whole  Index) const

Gets a shape by index.

Parameters
IndexThe index of the shape to retrieve.
Returns
Returns a const reference to the shape at the specified index.

Definition at line 314 of file multishape.cpp.

Boole Mezzanine::Graphics::Procedural::MultiShape::IsClosed ( ) const

Gets whether or not every Shape in this MultiShape is closed.

Returns
Returns true if every Shape in this MultiShape is closed, false otherwise.

Definition at line 285 of file multishape.cpp.

Boole Mezzanine::Graphics::Procedural::MultiShape::IsOutsideRealOutside ( ) const

Gets whether the currently set OutSide is the real Outside.

Returns
Returns true if the detected OutSide matches the currently set OutSide, false otherwise.

Definition at line 249 of file multishape.cpp.

Boole Mezzanine::Graphics::Procedural::MultiShape::IsPointInside ( const Vector2 Point) const

Gets whether or not a point is inside this MultiShape.

Note
This assumes that all of the shapes in that multishape are closed and that they don't contradict each other, ie a point cannot be outside and inside at the same time.
Parameters
PointThe location in 2D space to check.
Returns
Returns true if the point is inside this MultiShape, false otherwise.

Definition at line 198 of file multishape.cpp.

Member Data Documentation

ShapeContainer Mezzanine::Graphics::Procedural::MultiShape::Shapes
protected

Container storing all of the Shapes that form this MultiShape.

Definition at line 105 of file multishape.h.


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