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

A collection of interconnected 3D points used to express path through 3D space. More...

#include <path.h>

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

Public Member Functions

 Path ()
 Blank constructor.
 
 Path (Point3DIterator Begin, Point3DIterator End)
 Create a Path from an iterator range. More...
 
 Path (const Point3DContainer &DataSet)
 Create a Path from a Point3DContainer instance. More...
 
 ~Path ()
 Class destructor.
 
PathAddPoint (const Vector3 &ToAdd)
 Adds a point to this path. More...
 
PathAddPoint (const Real X, const Real Y, const Real Z)
 Adds a point to this path. More...
 
PathAppendPath (const Path &Other)
 Appends all the points from another path to this path. More...
 
PathAppendPathRel (const Path &Other)
 Appends all the points from another path to this path with their positions relative to the position of the last point in this path. More...
 
template<template< class > class Interpolator>
void AppendTrack (const Track< Interpolator< Vector3 > > &Curve, const Whole NumPoints)
 Appends the contents of a 3D track to this shape. More...
 
PathClose ()
 Connects the last point in this path to the first point. More...
 
Shape ConvertToShape () const
 Converts the path to a 2D shape, dropping the Z component. More...
 
Path ExtractSubPath (const Whole First, const Whole Last)
 Extracts a part of the path as a new path. More...
 
MeshGenerateMesh (const String &Name, const String &Group) const
 Outputs a mesh representing this path. More...
 
Vector3 GetAvgDirection (const Whole Index) const
 Gets the averaged direction from the specified point to both the next and previous points in the sequence. More...
 
Vector3 GetDirectionAfter (const Whole Index) const
 Gets the direction of a point to the next point in the sequence. More...
 
Vector3 GetDirectionBefore (const Whole Index) const
 Gets the direction from a point to the previous point in the sequence. More...
 
Real GetLengthAtPoint (const Whole PointIndex) const
 Gets the total length to the point in this path at an index. More...
 
const Vector3GetPoint (const Integer Index) const
 Safely gets a point in this path. More...
 
Point3DContainerGetPoints ()
 Gets all of the points in this path. More...
 
const Point3DContainerGetPoints () const
 Gets all of the points in this path. More...
 
Integer GetSegCount () const
 Gets the number of segments in this path. More...
 
Real GetTotalLength () const
 Gets the total length of all segments in this path. More...
 
PathInsertPoint (const Whole Index, const Real X, const Real Y, const Real Z)
 Inserts a point to the path. More...
 
PathInsertPoint (const Whole Index, const Vector3 &Point)
 Inserts a point to the path. More...
 
Boole IsClosed () const
 Gets whether or not the final point in this path connects to the first point. More...
 
PathReflect (const Vector3 &Normal)
 Reflect all points in this path against a zero-origined plane with a given normal. More...
 
PathReverse ()
 Reverses direction/ordering of the segments in this path. More...
 
PathScale (const Real Scaling)
 Applies the given scale to all the points in this path. More...
 
PathScale (const Real ScaleX, const Real ScaleY, const Real ScaleZ)
 Applies the given scale to all the points in this path. More...
 
PathScale (const Vector3 &Scaling)
 Applies the given scale to all the points in this path. More...
 
PathTranslate (const Vector3 &Trans)
 Applies the given translation to all the points in this path. More...
 
PathTranslate (const Real TransX, const Real TransY, const Real TransZ)
 Applies the given translation to all the points in this path. More...
 

Static Public Member Functions

static void BuildFromSegmentSoup (const LineSeg3DVec &Segments, PathContainer &GeneratedPaths)
 Generates one or more paths from a series of segments. More...
 

Protected Attributes

Boole Closed
 Whether or not the end of this path connects to the beginning of this path. More...
 
Point3DContainer Points
 A container storing all of the points in this path. More...
 

Detailed Description

A collection of interconnected 3D points used to express path through 3D space.

Definition at line 93 of file path.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::Procedural::Path::Path ( Point3DIterator  Begin,
Point3DIterator  End 
)

Create a Path from an iterator range.

Parameters
BeginAn iterator pointing to the beginning of a range to copy.
Endan iterator pointing to one past the rang to copy.

Definition at line 89 of file path.cpp.

Mezzanine::Graphics::Procedural::Path::Path ( const Point3DContainer DataSet)

Create a Path from a Point3DContainer instance.

Parameters
DataSetA collection of points to copy.

Definition at line 94 of file path.cpp.

Member Function Documentation

Path & Mezzanine::Graphics::Procedural::Path::AddPoint ( const Vector3 ToAdd)

Adds a point to this path.

Parameters
ToAddThe location of the point to add.
Returns
Returns a reference to this.

Definition at line 275 of file path.cpp.

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

Adds a point to this path.

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

Definition at line 281 of file path.cpp.

Path & Mezzanine::Graphics::Procedural::Path::AppendPath ( const Path Other)

Appends all the points from another path to this path.

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

Definition at line 193 of file path.cpp.

Path & Mezzanine::Graphics::Procedural::Path::AppendPathRel ( const Path Other)

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

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

Definition at line 199 of file path.cpp.

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

Appends the contents of a 3D 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 3D curved track of points to append to this shape.
NumPointsThe number of points along the curve to generate for this shape.

Definition at line 148 of file path.h.

void Mezzanine::Graphics::Procedural::Path::BuildFromSegmentSoup ( const LineSeg3DVec Segments,
PathContainer GeneratedPaths 
)
static

Generates one or more paths from a series of segments.

Parameters
SegmentsThe segments to use to generate paths.
GeneratedPathsA container to be populated with the paths that are generated.

Definition at line 105 of file path.cpp.

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

Connects the last point in this path to the first point.

Returns
Returns a reference to this.

Definition at line 261 of file path.cpp.

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

Converts the path to a 2D shape, dropping the Z component.

Returns
Returns a shape where the X and Y components are copied, and the Z component is dropped for each point.

Definition at line 383 of file path.cpp.

Path Mezzanine::Graphics::Procedural::Path::ExtractSubPath ( const Whole  First,
const Whole  Last 
)

Extracts a part of the path as a new path.

Parameters
FirstThe first index of this path to be in the new path.
LastThe last index of this path to be in the new path.
Returns
Returns a reference to this.

Definition at line 213 of file path.cpp.

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

Outputs a mesh representing this path.

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 179 of file path.cpp.

Vector3 Mezzanine::Graphics::Procedural::Path::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 Vector3 containing the averaged direction for both the next and previous points from the specified point.

Definition at line 375 of file path.cpp.

Vector3 Mezzanine::Graphics::Procedural::Path::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 Vector3 containing the direction from the specified point to the next point.

Definition at line 353 of file path.cpp.

Vector3 Mezzanine::Graphics::Procedural::Path::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 Vector3 containing the direction from the specified point to the previous point.

Definition at line 364 of file path.cpp.

Real Mezzanine::Graphics::Procedural::Path::GetLengthAtPoint ( const Whole  PointIndex) const

Gets the total length to the point in this path at an index.

Parameters
PointIndexThe point to retrieve the length to.
Returns
Returns a Real representing the combined length of each segment to the point at the specified index.

Definition at line 237 of file path.cpp.

const Vector3 & Mezzanine::Graphics::Procedural::Path::GetPoint ( const Integer  Index) const

Safely gets a point in this path.

Parameters
IndexThe index of the point to retrieve. Negative values will be clamped to zero.
Returns
Returns a const reference to the Vector3 at the specified index.

Definition at line 299 of file path.cpp.

Point3DContainer & Mezzanine::Graphics::Procedural::Path::GetPoints ( )

Gets all of the points in this path.

Returns
Returns a reference to the container storing each point in this path.

Definition at line 308 of file path.cpp.

const Point3DContainer & Mezzanine::Graphics::Procedural::Path::GetPoints ( ) const

Gets all of the points in this path.

Returns
Returns a const reference to the container storing each point in this path.

Definition at line 311 of file path.cpp.

Integer Mezzanine::Graphics::Procedural::Path::GetSegCount ( ) const

Gets the number of segments in this path.

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

Definition at line 221 of file path.cpp.

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

Gets the total length of all segments in this path.

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

Definition at line 226 of file path.cpp.

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

Inserts a point to the path.

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.
YThe position of the point to insert on the Z axis.
Returns
Returns a reference to this.

Definition at line 287 of file path.cpp.

Path & Mezzanine::Graphics::Procedural::Path::InsertPoint ( const Whole  Index,
const Vector3 Point 
)

Inserts a point to the path.

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

Definition at line 293 of file path.cpp.

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

Gets whether or not the final point in this path connects to the first point.

Returns
Returns true if this path is currently closed.

Definition at line 267 of file path.cpp.

Path & Mezzanine::Graphics::Procedural::Path::Reflect ( const Vector3 Normal)

Reflect all points in this path against a zero-origined plane with a given normal.

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

Definition at line 248 of file path.cpp.

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

Reverses direction/ordering of the segments in this path.

Returns
Returns a reference to this.

Definition at line 255 of file path.cpp.

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

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

Note
This will only transfrom the points currently in this path, 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 329 of file path.cpp.

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

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

Note
This will only transfrom the points currently in this path, 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.
ScaleZThe amount of scaling to be applied on the Z axis.
Returns
Returns a reference to this.

Definition at line 334 of file path.cpp.

Path & Mezzanine::Graphics::Procedural::Path::Scale ( const Vector3 Scaling)

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

Note
This will only transfrom the points currently in this path, 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 345 of file path.cpp.

Path & Mezzanine::Graphics::Procedural::Path::Translate ( const Vector3 Trans)

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

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

Definition at line 317 of file path.cpp.

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

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

Note
This will only transfrom the points currently in this path, 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.
TransZThe amount of translation to apply on the Z axis.
Returns
Returns a reference to this.

Definition at line 324 of file path.cpp.

Member Data Documentation

Boole Mezzanine::Graphics::Procedural::Path::Closed
protected

Whether or not the end of this path connects to the beginning of this path.

Definition at line 101 of file path.h.

Point3DContainer Mezzanine::Graphics::Procedural::Path::Points
protected

A container storing all of the points in this path.

Definition at line 98 of file path.h.


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