67 #ifndef _graphicsproceduralmultipath_cpp
68 #define _graphicsproceduralmultipath_cpp
70 #include "Graphics/Procedural/multipath.h"
71 #include "Graphics/Procedural/path.h"
118 this->
Paths.at(PathIndex) = ToSet;
126 std::map< Vector3, PathIntersection, Vector3LengthCompare >
IntersectionMap;
130 for(
ConstPoint3DIterator PointIt = PathPoints.begin() ; PointIt != PathPoints.end() ; ++PointIt )
133 if( IntersectionMap.find(*PointIt) == IntersectionMap.end() ) {
135 Intersect.push_back(Coord);
136 IntersectionMap[*PointIt] = Intersect;
138 IntersectionMap[*PointIt].push_back(Coord);
142 for( std::map< Vector3, PathIntersection, Vector3LengthCompare >::iterator IntersectionIt = IntersectionMap.begin() ; IntersectionIt != IntersectionMap.end() ; ++IntersectionIt )
144 if( IntersectionIt->second.size() > 1 ) {
145 for( PathIntersection::iterator PointIt = IntersectionIt->second.begin() ; PointIt != IntersectionIt->second.end() ; ++PointIt )
157 const Path& RetPath = this->
Paths[PathIndex];
159 std::vector<Integer> TempIntersections;
162 if( (*IntersectIt).first.PathIndex == PathIndex ) {
163 TempIntersections.push_back( (*IntersectIt).first.PointIndex );
166 std::sort(TempIntersections.begin(),TempIntersections.end());
168 for( std::vector<Integer>::iterator IntersectIt = TempIntersections.begin() ; IntersectIt != TempIntersections.end() ; ++IntersectIt )
170 if( (*IntersectIt) - 1 > BeginIndex ) {
171 RetSegments.push_back(
PathSegment(BeginIndex,(*IntersectIt) - 1) );
173 BeginIndex = (*IntersectIt) + 1;
186 this->
Paths.push_back(ToAdd);
194 this->
Paths.push_back( *PathIt );
201 return this->
Paths.at(Index);
206 return this->
Paths.at(Index);
211 return this->
Paths.size();
MultiPath & AddMultiPath(const MultiPath &Other)
Append every path of another MultiShape to this MultiPath.
Path & GetPath(const Whole Index)
Gets a path by index.
const IntersectionMap & GetIntersectionsMap() const
Gets the container storing all calculated intersections based on their path coordinate.
bool Boole
Generally acts a single bit, true or false.
std::vector< Vector3 > Point3DContainer
Basic container type for the storage of 3D points.
MultiPath & CalculateIntersections()
Generates all the known intersections between the paths in this MultiPath.
IntersectionVector Intersections
Container storing all known intersections.
const IntersectionVector & GetIntersections() const
Gets the container storing all calculated intersections.
A convenience class for tracking points in a MultiPath.
int Integer
A datatype used to represent any integer close to.
PathCoordinate()
Blank constructor.
IntersectionMap UniqueIntersections
Container storing all intersections based on their coordinate.
std::vector< PathCoordinate > PathIntersection
Convenience type used to represent the intersection of two or more paths.
PathContainer Paths
Container storing all of the Paths that form this MultiPath.
Boole operator<(const PathCoordinate &Other) const
Less-than comparison operator.
Whole PathIndex
The index of the path where this coordinate is located.
Whole PointIndex
The index of the point in the path where this coordinate is located.
MultiPath & AddPath(const Path &ToAdd)
Adds a path to this MultiPath.
MultiPath()
Class constructor.
PathSegmentContainer GetNoIntersectionParts(const Whole PathIndex) const
Gets segments from a specific sub-path that do not intersect other Paths of this MultiPath.
std::map< PathCoordinate, PathIntersection > IntersectionMap
Container type for the storage of unique intersections.
std::vector< PathSegment > PathSegmentContainer
Container type for segments in a Path.
~MultiPath()
Class destructor.
MultiPath & SetPath(const Whole PathIndex, const Path &ToSet)
Sets a path at a specific index.
std::vector< PathIntersection > IntersectionVector
Container type for the storage of intersections.
~PathCoordinate()
Class destructor.
PathContainer::iterator PathIterator
Iterator type for Path instances being stored in this class.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
A grouping of individual 3D curves used to express complicated structures.
Integer GetSegCount() const
Gets the number of segments in this path.
Point3DContainer::const_iterator ConstPoint3DIterator
Const Iterator type for a Point3DContainer.
Whole GetNumPaths() const
Gets the number of shapes in this MultiPath.
std::pair< Whole, Whole > PathSegment
Convenience type for a pair of indexes to express a segment of a Path.
void RemoveAllPaths()
Removes all shapes from this MultiPath.
A collection of interconnected 3D points used to express path through 3D space.
PathContainer::const_iterator ConstPathIterator
Const Iterator type for Path instances being stored in this class.