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

A collection of interconnected 2D points used to express an arbitrary 2D shape. More...

#include <shape.h>

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

Public Types

typedef IntersectionContainer::const_iterator ConstIntersectionIterator
 Const Iterator type for Intersections stored in this class.
 
typedef std::vector< IntersectionInShapeIntersectionContainer
 Basic container type for the storage of Intersections in this class.
 
typedef IntersectionContainer::iterator IntersectionIterator
 Iterator type for Intersections stored in this class.
 

Public Member Functions

 Shape ()
 Class constructor.
 
 ~Shape ()
 Class destructor.
 
void _AppendToManualObject (Ogre::ManualObject *Object) const
 Appends the shape vertices to a manual object being edited. More...
 
ShapeAddPoint (const Vector2 &Point)
 Adds a point to the shape. More...
 
ShapeAddPoint (const Real X, const Real Y)
 Adds a point to the shape. More...
 
ShapeAddPointRel (const Vector2 &Point)
 Adds a point to the shape, relative to the last position added. More...
 
ShapeAddPointRel (const Real X, const Real Y)
 Adds a point to the shape, relative to the last position added. More...
 
ShapeAppendShape (const Shape &Other)
 Appends all the points from another shape to this shape. More...
 
ShapeAppendShapeRel (const Shape &Other)
 Appends all the points from another shape to this shape with their positions relative to the position of the last point in this shape. More...
 
template<template< class > class Interpolator>
void AppendTrack (const Track< Interpolator< Vector2 > > &Curve, const Whole NumPoints)
 Appends the contents of a 2D track to this shape. More...
 
MultiShape BooleanDifference (const Shape &Other) const
 Computes the difference between this shape and another one. More...
 
MultiShape BooleanIntersect (const Shape &Other) const
 Computes the intersection between this shape and another one. More...
 
MultiShape BooleanUnion (const Shape &Other) const
 Computes the union between this shape and another one. More...
 
ShapeClose ()
 Makes this a closed shape, connecting the last point to the first point. More...
 
Path ConvertToPath () const
 Converts the shape to a 3D path. More...
 
Shape ExtractSubShape (const Whole First, const Whole Last)
 Extracts a part of the shape as a new shape. More...
 
Real FindBoundingRadius () const
 Computes the radius of a bounding circle centered on the origin of this shape. More...
 
Procedural::ShapeSide FindRealOutSide () const
 On a closed shape, find if the outside is located on the right or on the left. More...
 
MeshGenerateMesh (const String &Name, const String &Group) const
 Outputs a mesh representing this shape. More...
 
Vector2 GetAvgDirection (const Whole Index) const
 Gets the averaged direction from the specified point to both the next and previous points in the sequence. More...
 
Vector2 GetAvgNormal (const Whole Index) const
 Gets the averaged normal of the segments before and after the specified point. More...
 
Whole GetBoundedIndex (const Integer Index) const
 Converts a potentially unsafe Integer index into a safe Whole index. More...
 
Vector2 GetDirectionAfter (const Whole Index) const
 Gets the direction of a point to the next point in the sequence. More...
 
Vector2 GetDirectionBefore (const Whole Index) const
 Gets the direction from a point to the previous point in the sequence. More...
 
Vector2 GetNormalAfter (const Whole Index) const
 Gets the normal of the segment after the specified point. More...
 
Vector2 GetNormalBefore (const Whole Index) const
 Gets the normal of the segment before the specified point. More...
 
Procedural::ShapeSide GetOutSide () const
 Gets which side is the OutSide of this shape. More...
 
const Vector2GetPoint (const Integer Index) const
 Gets a point by index which can be out of bounds and will wrap. More...
 
Whole GetPointCount () const
 Gets the number of points in this shape. More...
 
Point2DContainer GetPoints () const
 Gets a copy of raw vector data of this shape. More...
 
Point2DContainerGetPointsReference ()
 Gets raw vector data of this shape as a non-const reference. More...
 
const Point2DContainerGetPointsReference () const
 Gets raw vector data of this shape as a const reference. More...
 
Vector2 GetPosition (const Whole Index, const Real Coord) const
 Gets the position on a segment.

Exceptions
Ifthe provided index is out of bounds or the Coord is outside of the range 0-1 then a PARAMETERS_EXCEPTION will be thrown.
More...
 
Vector2 GetPosition (Real Coord) const
 Gets the position at the specified length along the shape.

Exceptions
Ifthe shape has less than 2 points then a PARAMETERS_EXCEPTION will be thrown.
More...
 
Whole GetSegCount () const
 Gets the number of segments in this shape. More...
 
Real GetTotalLength () const
 Gets the total length of all segments in this shape. More...
 
ShapeInsertPoint (const Whole Index, const Real X, const Real Y)
 Inserts a point to the shape. More...
 
ShapeInsertPoint (const Whole Index, const Vector2 &Point)
 Inserts a point to the shape. More...
 
Boole IsClosed () const
 Gets whether or not this shape is closed. More...
 
Boole IsOutsideRealOutside () const
 Gets whether the currently set OutSide is the real Outside. More...
 
Boole IsPointInside (const Vector2 &Point) const
 Tells whether a point is inside a shape or not. More...
 
ShapeMirror (Boole Flip=false)
 Create a symetric copy of the points in this shape at the origin point. More...
 
ShapeMirrorAroundAxis (const Vector2 &Axis, Boole Flip=false)
 Create a symetric copy of the points in this shape at an arbitrary axis. More...
 
ShapeMirrorAroundPoint (const Real X, const Real Y, Boole Flip=false)
 Create a symetric copy of the points in this shape at an arbitrary point. More...
 
ShapeMirrorAroundPoint (const Vector2 &Point, Boole Flip=false)
 Create a symetric copy of the points in this shape at an arbitrary point. More...
 
ShapeReflect (const Vector2 &Normal)
 Reflect all points in this shape against a zero-origined line with a given normal. More...
 
ShapeReset ()
 Clears all points from this shape. More...
 
ShapeReverse ()
 Reverses direction/ordering of the segments in this shape. More...
 
ShapeRotate (const Real Angle)
 Applies the given rotation to all the points in this shape. More...
 
ShapeScale (const Real Scaling)
 Applies the given scale to all the points in this shape. More...
 
ShapeScale (const Real ScaleX, const Real ScaleY)
 Applies the given scale to all the points in this shape. More...
 
ShapeScale (const Vector2 &Scaling)
 Applies the given scale to all the points in this shape. More...
 
ShapeSetOutSide (const Procedural::ShapeSide Side)
 Sets which side is the OutSide of this shape. More...
 
ShapeSwitchSide ()
 Toggles the currently set "OutSide". More...
 
MultiShape Thicken (const Real Amount)
 Applies a "thickness" to a shape, ie a bit like the extruder, but in 2D. More...
 
ShapeTranslate (const Vector2 &Trans)
 Applies the given translation to all the points in this shape. More...
 
ShapeTranslate (const Real TransX, const Real TransY)
 Applies the given translation to all the points in this shape. More...
 

Protected Member Functions

MultiShape _BooleanOperation (const Shape &Other, const Procedural::BooleanOperation OpType) const
 Performs a boolean operation between this shape and another shape. More...
 
void _FindAllIntersections (const Shape &Other, IntersectionContainer &Intersections) const
 Finds all detectable intersections between this shape and another shape. More...
 
Boole _FindWhereToGo (const Shape *InputShapes[], const Procedural::BooleanOperation OpType, const IntersectionInShape &Intersection, UInt8 &ShapeSelector, Char8 &IsIncreasing, Whole &CurrentSegment) const
 Determines which segment to follow when an intersection is encountered. More...
 
Char8 _IsIncreasing (const Real Dot, const Procedural::BooleanOperation OpType, const Char8 ShapeSelector) const
 Gets whether or not the segment being operated on is to be incremented. More...
 
Boole _IsLookingForOutside (const Procedural::BooleanOperation OpType, const Char8 ShapeSelector) const
 Gets whether or not the current boolean operation is looking for outside edges of the two shapes being processed. More...
 

Protected Attributes

Boole Closed
 Whether or not the first point and last point should be connected, closing the shape. More...
 
Procedural::ShapeSide OutSide
 Sets which extreme side of this shape is to be considered the outside of the shape. Useful when a shape is not closed. More...
 
Point2DContainer Points
 Container storing all of the points that form this shape. More...
 

Detailed Description

A collection of interconnected 2D points used to express an arbitrary 2D shape.

Definition at line 95 of file shape.h.

Member Function Documentation

void Mezzanine::Graphics::Procedural::Shape::_AppendToManualObject ( Ogre::ManualObject *  Object) const

Appends the shape vertices to a manual object being edited.

Parameters
ObjectThe manual object to append to.

Definition at line 928 of file shape.cpp.

MultiShape Mezzanine::Graphics::Procedural::Shape::_BooleanOperation ( const Shape Other,
const Procedural::BooleanOperation  OpType 
) const
protected

Performs a boolean operation between this shape and another shape.

Parameters
OtherThe other shape to perform the boolean operation with.
OpTypeThe type of boolean operation to perform.
Returns
Returns a MultiShape containing the results of the boolean operation.

Definition at line 137 of file shape.cpp.

void Mezzanine::Graphics::Procedural::Shape::_FindAllIntersections ( const Shape Other,
IntersectionContainer Intersections 
) const
protected

Finds all detectable intersections between this shape and another shape.

Parameters
OtherThe other shape to compare with this one.
IntersectionsA container of to be populated with the known intersections between this shape and another.

Definition at line 389 of file shape.cpp.

Boole Mezzanine::Graphics::Procedural::Shape::_FindWhereToGo ( const Shape InputShapes[],
const Procedural::BooleanOperation  OpType,
const IntersectionInShape Intersection,
UInt8 ShapeSelector,
Char8 IsIncreasing,
Whole CurrentSegment 
) const
protected

Determines which segment to follow when an intersection is encountered.

Parameters
InputShapesAn array of shapes being operated on.
OpTypeThe type of boolean operation being performed.
IntersectionThe intersection that was encountered.
ShapeSelectorA 0 or 1 that is the index of the shape that owns the segment to advance along.
IsIncreasingA -1 or 1 indicating whether the segment being operated on is to be incremented.
CurrentSegmentThe index of the line segment in the intersection to advance along.
Returns
Returns true if a valid segment to follow was found, or false if not viable segments were found.

Definition at line 308 of file shape.cpp.

Char8 Mezzanine::Graphics::Procedural::Shape::_IsIncreasing ( const Real  Dot,
const Procedural::BooleanOperation  OpType,
const Char8  ShapeSelector 
) const
protected

Gets whether or not the segment being operated on is to be incremented.

Parameters
DotThe Dot Product of the directions from the two points in an intersection.
OpTypeThe type of boolean operation being performed.
ShapeSelectorA 0 or 1 describing which shape the current edge being processed belongs to.
Returns
Returns 1 if the shape is being increased, or -1 if the shape is being decreased.

Definition at line 295 of file shape.cpp.

Boole Mezzanine::Graphics::Procedural::Shape::_IsLookingForOutside ( const Procedural::BooleanOperation  OpType,
const Char8  ShapeSelector 
) const
protected

Gets whether or not the current boolean operation is looking for outside edges of the two shapes being processed.

Parameters
OpTypeThe type of boolean operation being performed.
ShapeSelectorA 0 or 1 describing which shape the current edge being processed belongs to.
Returns
Returns true if the current operation is seeking the outside edges of the two shapes, or false if it's seeking the inner edges.

Definition at line 284 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::AddPoint ( const Vector2 Point)

Adds a point to the shape.

Parameters
PointThe point to be added.
Returns
Returns a reference to this.

Definition at line 650 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::AddPoint ( const Real  X,
const Real  Y 
)

Adds a point to the shape.

Parameters
XThe position of the point to add on the X axis.
YThe position of the point to add on the Y axis.
Returns
Returns a reference to this.

Definition at line 656 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::AddPointRel ( const Vector2 Point)

Adds a point to the shape, relative to the last position added.

Parameters
PointThe position of the point to be added that is in local space of the last position added.
Returns
Returns a reference to this.

Definition at line 662 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::AddPointRel ( const Real  X,
const Real  Y 
)

Adds a point to the shape, relative to the last position added.

Parameters
XThe relative position of the point to add on the X axis.
YThe relative position of the point to add on the Y axis.
Returns
Returns a reference to this.

Definition at line 672 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::AppendShape ( const Shape Other)

Appends all the points from another shape to this shape.

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

Definition at line 440 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::AppendShapeRel ( const Shape Other)

Appends all the points from another shape to this shape with their positions relative to the position of the last point in this shape.

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

Definition at line 446 of file shape.cpp.

template<template< class > class Interpolator>
void Mezzanine::Graphics::Procedural::Shape::AppendTrack ( const Track< Interpolator< Vector2 > > &  Curve,
const Whole  NumPoints 
)
inline

Appends the contents of a 2D track to this shape.

Remarks
Low values for NumPoints will cause curves to look blocky. How how it should be depends on the resolution of the curve you want.
Parameters
CurveThe 2D curved track of points to append to this shape.
NumPointsThe number of points along the curve to generate for this shape.

Definition at line 183 of file shape.h.

MultiShape Mezzanine::Graphics::Procedural::Shape::BooleanDifference ( const Shape Other) const

Computes the difference between this shape and another one.

Remarks
Both shapes must be closed.
Exceptions
Thiswill throw an exception if either shape is not closed or contains less than 2 points. A INVALID_STATE_EXCEPTION will be thrown if the calling shape is invalid, or a PARAMETERS_EXCEPTION if the parameter shape is invalid.
Parameters
OtherThe shape against which the diffenrence is computed.
Returns
The difference of two shapes, as a new shape.

Definition at line 922 of file shape.cpp.

MultiShape Mezzanine::Graphics::Procedural::Shape::BooleanIntersect ( const Shape Other) const

Computes the intersection between this shape and another one.

Remarks
Both shapes must be closed.
Exceptions
Thiswill throw an exception if either shape is not closed or contains less than 2 points. A INVALID_STATE_EXCEPTION will be thrown if the calling shape is invalid, or a PARAMETERS_EXCEPTION if the parameter shape is invalid.
Parameters
OtherThe shape against which the intersection is computed.
Returns
The intersection of two shapes, as a new shape.

Definition at line 916 of file shape.cpp.

MultiShape Mezzanine::Graphics::Procedural::Shape::BooleanUnion ( const Shape Other) const

Computes the union between this shape and another one.

Remarks
Both shapes must be closed.
Exceptions
Thiswill throw an exception if either shape is not closed or contains less than 2 points. A INVALID_STATE_EXCEPTION will be thrown if the calling shape is invalid, or a PARAMETERS_EXCEPTION if the parameter shape is invalid.
Parameters
OtherThe shape against which the union is computed.
Returns
The union of two shapes, as a new shape.

Definition at line 919 of file shape.cpp.

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

Makes this a closed shape, connecting the last point to the first point.

Returns
Returns a reference to this.

Definition at line 623 of file shape.cpp.

Path Mezzanine::Graphics::Procedural::Shape::ConvertToPath ( ) const

Converts the shape to a 3D path.

Returns
Returns a path where: 3D.X = 2D.X, 3D.Y = 0, 3D.Z = 2D.Y for each point in this shape.

Definition at line 872 of file shape.cpp.

Shape Mezzanine::Graphics::Procedural::Shape::ExtractSubShape ( const Whole  First,
const Whole  Last 
)

Extracts a part of the shape as a new shape.

Parameters
FirstThe first index of this shape to be in the new shape.
LastThe last index of this shape to be in the new shape.
Returns
Returns a new shape containing the specified points from this shape.

Definition at line 460 of file shape.cpp.

Real Mezzanine::Graphics::Procedural::Shape::FindBoundingRadius ( ) const

Computes the radius of a bounding circle centered on the origin of this shape.

Returns
Returns a Real representing the bounding radius of this shape.

Definition at line 522 of file shape.cpp.

Procedural::ShapeSide Mezzanine::Graphics::Procedural::Shape::FindRealOutSide ( ) const

On a closed shape, find if the outside is located on the right or on the left.

Note
If the outside can easily be guessed in your context, you'd rather use SetOutside(), which doesn't need any computation.

Also note that this is a guess made by the algorithm.
Returns
Returns a ShapeSide enum value describing which side of this shape is the OutSide.

Definition at line 844 of file shape.cpp.

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

Outputs a mesh representing this shape.

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 427 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetAvgDirection ( const Whole  Index) const

Gets the averaged direction from the specified point to both the next and previous points in the sequence.

Parameters
IndexThe index of the point to retrieve the direction for.
Returns
Returns a Vector2 containing the averaged direction for both the next and previous points from the specified point.

Definition at line 795 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetAvgNormal ( const Whole  Index) const

Gets the averaged normal of the segments before and after the specified point.

Parameters
IndexThe index of the point to retrieve the normal for.
Returns
Returns the averaged normal of the segment before and after the specified index.

Definition at line 816 of file shape.cpp.

Whole Mezzanine::Graphics::Procedural::Shape::GetBoundedIndex ( const Integer  Index) const

Converts a potentially unsafe Integer index into a safe Whole index.

Parameters
IndexThe index to be converted.
Returns
Returns the converted safe index.

Definition at line 704 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetDirectionAfter ( const Whole  Index) const

Gets the direction of a point to the next point in the sequence.

Parameters
IndexThe index of the point to retrieve the direction for.
Returns
Returns a Vector2 containing the direction from the specified point to the next point.

Definition at line 773 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetDirectionBefore ( const Whole  Index) const

Gets the direction from a point to the previous point in the sequence.

Parameters
IndexThe index of the point to retrieve the direction for.
Returns
Returns a Vector2 containing the direction from the specified point to the previous point.

Definition at line 784 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetNormalAfter ( const Whole  Index) const

Gets the normal of the segment after the specified point.

Parameters
IndexThe index of the point to retrieve the normal for.
Returns
Returns the normal of the segment after the specified index.

Definition at line 800 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetNormalBefore ( const Whole  Index) const

Gets the normal of the segment before the specified point.

Parameters
IndexThe index of the point to retrieve the normal for.
Returns
Returns the normal of the segment before the specified index.

Definition at line 808 of file shape.cpp.

Procedural::ShapeSide Mezzanine::Graphics::Procedural::Shape::GetOutSide ( ) const

Gets which side is the OutSide of this shape.

Returns
Returns a ShapeSide enum value describing which side of this shape is the OutSide.

Definition at line 833 of file shape.cpp.

const Vector2 & Mezzanine::Graphics::Procedural::Shape::GetPoint ( const Integer  Index) const

Gets a point by index which can be out of bounds and will wrap.

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

Definition at line 694 of file shape.cpp.

Whole Mezzanine::Graphics::Procedural::Shape::GetPointCount ( ) const

Gets the number of points in this shape.

Returns
Returns a Whole representing the number of points in this shape.

Definition at line 699 of file shape.cpp.

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

Gets a copy of raw vector data of this shape.

Returns
Returns a new Point2DContainer storing a copy of all the points in this shape.

Definition at line 712 of file shape.cpp.

Point2DContainer & Mezzanine::Graphics::Procedural::Shape::GetPointsReference ( )

Gets raw vector data of this shape as a non-const reference.

Returns
Returns a reference to the container storing all of the points in this shape.

Definition at line 715 of file shape.cpp.

const Point2DContainer & Mezzanine::Graphics::Procedural::Shape::GetPointsReference ( ) const

Gets raw vector data of this shape as a const reference.

Returns
Returns a const reference to the container storing all of the points in this shape.

Definition at line 718 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetPosition ( const Whole  Index,
const Real  Coord 
) const

Gets the position on a segment.

Exceptions
Ifthe provided index is out of bounds or the Coord is outside of the range 0-1 then a PARAMETERS_EXCEPTION will be thrown.

Parameters
IndexThe index of the point starting the segment to retrieve the point from.
CoordThe relative point on the specified segment to get the position of.
Returns
Returns a Vector2 containing the point at the specified position.

Definition at line 530 of file shape.cpp.

Vector2 Mezzanine::Graphics::Procedural::Shape::GetPosition ( Real  Coord) const

Gets the position at the specified length along the shape.

Exceptions
Ifthe shape has less than 2 points then a PARAMETERS_EXCEPTION will be thrown.

Parameters
CoordThe length position to get the 2D position of.
Returns
Returns a Vector2 containing the position of the point at the specified length.

Definition at line 541 of file shape.cpp.

Whole Mezzanine::Graphics::Procedural::Shape::GetSegCount ( ) const

Gets the number of segments in this shape.

Returns
Returns a Whole containing the number of segments that form this shape.

Definition at line 472 of file shape.cpp.

Real Mezzanine::Graphics::Procedural::Shape::GetTotalLength ( ) const

Gets the total length of all segments in this shape.

Returns
Returns a Real representing the combined length of each segment in this shape.

Definition at line 475 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::InsertPoint ( const Whole  Index,
const Real  X,
const Real  Y 
)

Inserts a point to the shape.

Parameters
Indexthe index before the inserted point.
XThe position of the point to insert on the X axis.
YThe position of the point to insert on the Y axis.
Returns
Returns a reference to this.

Definition at line 682 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::InsertPoint ( const Whole  Index,
const Vector2 Point 
)

Inserts a point to the shape.

Parameters
Indexthe index before the inserted point.
PointThe point to be inserted.
Returns
Returns a reference to this.

Definition at line 688 of file shape.cpp.

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

Gets whether or not this shape is closed.

Returns
Returns true if the last point is connected to the first, false otherwise.

Definition at line 629 of file shape.cpp.

Boole Mezzanine::Graphics::Procedural::Shape::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 864 of file shape.cpp.

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

Tells whether a point is inside a shape or not.

Parameters
PointThe point to check.
Returns
Returns true if the point is inside this shape, false otherwise.

Definition at line 486 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Mirror ( Boole  Flip = false)

Create a symetric copy of the points in this shape at the origin point.

Parameters
FlipIf true then this will process the points in this shape in reverse order.
Returns
Returns a reference to this.

Definition at line 561 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::MirrorAroundAxis ( const Vector2 Axis,
Boole  Flip = false 
)

Create a symetric copy of the points in this shape at an arbitrary axis.

Parameters
AxisThe axis to mirror at.
FlipIf true then this will process the points in this shape in reverse order.
Returns
Returns a reference to this.

Definition at line 590 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::MirrorAroundPoint ( const Real  X,
const Real  Y,
Boole  Flip = false 
)

Create a symetric copy of the points in this shape at an arbitrary point.

Parameters
XThe position on the X axis to mirror at.
YThe position on the Y axis to mirror at.
FlipIf true then this will process the points in this shape in reverse order.
Returns
Returns a reference to this.

Definition at line 566 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::MirrorAroundPoint ( const Vector2 Point,
Boole  Flip = false 
)

Create a symetric copy of the points in this shape at an arbitrary point.

Parameters
PointThe position to mirror at.
FlipIf true then this will process the points in this shape in reverse order.
Returns
Returns a reference to this.

Definition at line 571 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Reflect ( const Vector2 Normal)

Reflect all points in this shape against a zero-origined line with a given normal.

Parameters
NormalThe normal to reflect all points on.
Returns
Returns a reference to this.

Definition at line 616 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Reset ( )

Clears all points from this shape.

Returns
Returns a reference to this.

Definition at line 641 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Reverse ( )

Reverses direction/ordering of the segments in this shape.

Returns
Returns a reference to this.

Definition at line 634 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Rotate ( const Real  Angle)

Applies the given rotation to all the points in this shape.

Note
This will only transfrom the points currently in this shape, not any additional points made after calling this.
Parameters
AngleThe amount of rotation to be applied in radians.
Returns
Returns a reference to this.

Definition at line 736 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Scale ( const Real  Scaling)

Applies the given scale to all the points in this shape.

Note
This will only transfrom the points currently in this shape, not any additional points made after calling this.
Parameters
ScalingThe amount of scaling to apply to each axis.
Returns
Returns a reference to this.

Definition at line 750 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Scale ( const Real  ScaleX,
const Real  ScaleY 
)

Applies the given scale to all the points in this shape.

Note
This will only transfrom the points currently in this shape, not any additional points made after calling this.
Parameters
ScaleXThe amount of scaling to be applied on the X axis.
ScaleYThe amount of scaling to be applied on the Y axis.
Returns
Returns a reference to this.

Definition at line 755 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Scale ( const Vector2 Scaling)

Applies the given scale to all the points in this shape.

Note
This will only transfrom the points currently in this shape, not any additional points made after calling this.
Parameters
ScalingThe amount of scaling to apply to each axis.
Returns
Returns a reference to this.

Definition at line 765 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::SetOutSide ( const Procedural::ShapeSide  Side)

Sets which side is the OutSide of this shape.

Note
This is used for such things as normal generation. Default is right, which corresponds to placing points anti-clockwise.
Parameters
SideA ShapeSide enum value describing which side of this shape is the OutSide.
Returns
Returns a reference to this.

Definition at line 827 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::SwitchSide ( )

Toggles the currently set "OutSide".

Returns
Returns a reference to this.

Definition at line 838 of file shape.cpp.

MultiShape Mezzanine::Graphics::Procedural::Shape::Thicken ( const Real  Amount)

Applies a "thickness" to a shape, ie a bit like the extruder, but in 2D.

Parameters
AmountThe amount of thickness to be applied to this shape.
Returns
Returns a MultiShape instance that is the thickened shape.

Definition at line 884 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Translate ( const Vector2 Trans)

Applies the given translation to all the points in this shape.

Note
This will only transfrom the points currently in this shape, not any additional points made after calling this.
Parameters
TransThe amount of translation to apply.
Returns
Returns a reference to this.

Definition at line 724 of file shape.cpp.

Shape & Mezzanine::Graphics::Procedural::Shape::Translate ( const Real  TransX,
const Real  TransY 
)

Applies the given translation to all the points in this shape.

Note
This will only transfrom the points currently in this shape, not any additional points made after calling this.
Parameters
TransXThe amount of translation to apply on the X axis.
TransYThe amount of translation to apply on the Y axis.
Returns
Returns a reference to this.

Definition at line 731 of file shape.cpp.

Member Data Documentation

Boole Mezzanine::Graphics::Procedural::Shape::Closed
protected

Whether or not the first point and last point should be connected, closing the shape.

Definition at line 113 of file shape.h.

Procedural::ShapeSide Mezzanine::Graphics::Procedural::Shape::OutSide
protected

Sets which extreme side of this shape is to be considered the outside of the shape. Useful when a shape is not closed.

Definition at line 110 of file shape.h.

Point2DContainer Mezzanine::Graphics::Procedural::Shape::Points
protected

Container storing all of the points that form this shape.

Definition at line 107 of file shape.h.


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