NuTo
Numerics Tool
Public Member Functions | List of all members
Polygon Class Reference

#include <DelaunayVoronoi.h>

Public Member Functions

 Polygon ()
 
 Polygon (std::vector< Eigen::Vector2d > rPoints)
 
std::vector< Eigen::Vector2d > GetPoints ()
 
void SortAndRemoveDoublicates ()
 
void UpdateEdges ()
 
bool PointIsInside (Eigen::Vector2d rPoint) const
 counts the intersections with the edges. The point rPoint is inside the polygon if that number is odd. More...
 
bool SegmentIntersects (Eigen::Vector2d rP0, Eigen::Vector2d rP1) const
 returns true, if the polygon intersects the segment rP0-rP1 More...
 
Eigen::Vector2d GetClosestIntersection (Eigen::Vector2d rPoint, Eigen::Vector2d rDirection) const
 A line from rPoint in rDirection may intersect multiple times with the polygon. More...
 
int GetEdgeIndex (Eigen::Vector2d rPoint) const
 Returns the index of the edge that contains rPoint. More...
 
Eigen::Vector2d GetPointOnBothEdges (int rEdge1, int rEdge2) const
 Returns a boundary point that is contained by both rEdge1 and rEdge2. More...
 
std::vector< Eigen::Vector2d > GetOtherPointsOnBoundary (Eigen::Vector2d rPoint) const
 returns all mPoints except rPoint More...
 
void AddIntersectionWithBoundary (const Polygon &rBoundary, const Eigen::Vector2d &rIP)
 add points to this polygon if it intersects with the boundary If the polygon contains two neighboring points that are located on different edges of rBoundary the polygon must include at least one point of rBoundary. More...
 

Constructor & Destructor Documentation

Polygon::Polygon ( )
inline
Polygon::Polygon ( std::vector< Eigen::Vector2d >  rPoints)
inline

Member Function Documentation

void Polygon::AddIntersectionWithBoundary ( const Polygon rBoundary,
const Eigen::Vector2d &  rIP 
)
inline

add points to this polygon if it intersects with the boundary If the polygon contains two neighboring points that are located on different edges of rBoundary the polygon must include at least one point of rBoundary.

Read further comments...

Eigen::Vector2d Polygon::GetClosestIntersection ( Eigen::Vector2d  rPoint,
Eigen::Vector2d  rDirection 
) const
inline

A line from rPoint in rDirection may intersect multiple times with the polygon.

This method returns the closest one to rPoint.

int Polygon::GetEdgeIndex ( Eigen::Vector2d  rPoint) const
inline

Returns the index of the edge that contains rPoint.

std::vector<Eigen::Vector2d> Polygon::GetOtherPointsOnBoundary ( Eigen::Vector2d  rPoint) const
inline

returns all mPoints except rPoint

Eigen::Vector2d Polygon::GetPointOnBothEdges ( int  rEdge1,
int  rEdge2 
) const
inline

Returns a boundary point that is contained by both rEdge1 and rEdge2.

std::vector<Eigen::Vector2d> Polygon::GetPoints ( )
inline
bool Polygon::PointIsInside ( Eigen::Vector2d  rPoint) const
inline

counts the intersections with the edges. The point rPoint is inside the polygon if that number is odd.

bool Polygon::SegmentIntersects ( Eigen::Vector2d  rP0,
Eigen::Vector2d  rP1 
) const
inline

returns true, if the polygon intersects the segment rP0-rP1

void Polygon::SortAndRemoveDoublicates ( )
inline
void Polygon::UpdateEdges ( )
inline

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