Voronoi Class Reference
[Voronoi]

calculate voronoi diagram of a point-set and some geometric centers based on the voronoi regions More...

#include <Voronoi.h>

List of all members.

Public Member Functions

 Voronoi ()
 ~Voronoi ()
void insert (Position p)
 adds a point to the voronoi diagram
bool valid ()
 valid if voronoi diagram has 2 or more regions
bool scanToFill (Scan &scan, Angle angRangeMin, Angle angRangeMax, Angle angRes)
 check if the scan needs to be filled
void fillScan (Scan &scan, Decimal linRangeMax, Angle angRes)
 fills the scan with the max range when passing from 240° to 360°
vector< PositionintersectScan (Scan &scan, Position p, Decimal limitedRange, bool limitedRangeOn=true, bool useSectors=true)
 find the intersection between: the scan, the voronoi region, a disk
Position centroid ()
 find centroid
Position weightedNormal (Decimal limitedRange, Decimal limitedRangeEps, Angle angRes, bool limitTarget=true)
 compute a point on the direction where the robot can increase the area of its voronoi region
Position circumCenter (Decimal &radius)
 compute the circumcenter
void clear ()
 clear the voronoi diagram
void setGV (CGAL::Geomview_stream *gvs)
 set the pointer to the Geomview stream
void setDW (DraWin *dwp, unsigned int dwpList)
 set the pointer to the DraWin source
void setDWPose (Pose dwpPose)
 set orientation and position (pose) needed for rototranslation in draWin
void setDWPointSize (Decimal s)
 set the size of points
void setDWDiskSize (Decimal s)
 set the size of disk
void setDWColor (Color c)
 set the color
void drawDiagram ()
 draw the voronoi diagram
void drawSites ()
 draw sites of the voronoi diagram
void drawDisk (Position p)
 draw disk
void drawSegment (Position source, Position target)
 draw a segment
void drawCircle (Position center, Decimal radius, int sampling=1)
 draw circle
void drawScan (int sampling=1)
 draw scan
void drawLimitedScan (int sampling=1)
 draw limited scan
void drawVoronoiScan (int sampling=1)
 draw voronoi scan
void drawVoronoiScanPoints (int sampling=1)
 draw voronoi scan points
void drawRegionEdges (Position p)
 draw region edges
void drawRegionSectors (Position center, Decimal radius, int sampling=1)
 draw region edge sectors
bool clearPlot ()
 clear the plot
Position pointToPosition (Point_2 point)
 convert a Point_2 to a Position
Point_2 positionToPoint (Position point)
 convert a Position to a Point_2


Detailed Description

calculate voronoi diagram of a point-set and some geometric centers based on the voronoi regions

algorithm: calculates voronoi diagram of a point-set input: point-set, scan; output: heterogeneous geometric centers (centroid, circumcenter) or directions (weighted normal)

Author:
Fabrizio Ramundo

Constructor & Destructor Documentation

Voronoi::Voronoi (  )  [inline]

default constructor

Voronoi::~Voronoi (  )  [inline]

destructor


Member Function Documentation

void Voronoi::insert ( Position  p  ) 

adds a point to the voronoi diagram

Returns:
void
Parameters:
[in] p position of the point to add

bool Voronoi::valid (  ) 

valid if voronoi diagram has 2 or more regions

Returns:
bool

bool Voronoi::scanToFill ( Scan scan,
Angle  angRangeMin,
Angle  angRangeMax,
Angle  angRes 
)

check if the scan needs to be filled

Returns:
bool
Parameters:
[in] scan 
[in] angRangeMin min range
[in] angRangeMax max range
[in] angRes angular resolution

void Voronoi::fillScan ( Scan scan,
Decimal  linRangeMax,
Angle  angRes 
)

fills the scan with the max range when passing from 240° to 360°

Returns:
void
Parameters:
[in] scan 
[in] linRangeMax max range
[in] angRes angular resolution

vector< Position > Voronoi::intersectScan ( Scan scan,
Position  p,
Decimal  limitedRange,
bool  limitedRangeOn = true,
bool  useSectors = true 
)

find the intersection between: the scan, the voronoi region, a disk

Returns:
vector containing the positions of the scan points after the intersection
Parameters:
[in] scan 
[in] p position of a point inside the voronoi region to intersect
[in] limitedRange radius of the disk to intersect
[in] limitedRangeOn enables or disables intersection with the limitedRange disk
[in] useSectors enables or disables edge sectors optimization

Position Voronoi::centroid (  ) 

find centroid

Returns:
position

Position Voronoi::weightedNormal ( Decimal  limitedRange,
Decimal  limitedRangeEps,
Angle  angRes,
bool  limitTarget = true 
)

compute a point on the direction where the robot can increase the area of its voronoi region

Returns:
target position
Parameters:
[in] limitedRange radius of the disk used for the intersection with the scan (ref. intersectScan)
[in] limitedRangeEps resolution
[in] angRes angular resolution
[in] limitTarget target limited to be inside the disk?

Position Voronoi::circumCenter ( Decimal radius  ) 

compute the circumcenter

Returns:
target position
Parameters:
[out] radius of circumference

void Voronoi::clear (  ) 

clear the voronoi diagram

Returns:
void

void Voronoi::setGV ( CGAL::Geomview_stream *  gvs  ) 

set the pointer to the Geomview stream

Returns:
void
Parameters:
[in] CGAL::Geomview_stream* pointer to GV stream

void Voronoi::setDW ( DraWin dwp,
unsigned int  dwpList 
)

set the pointer to the DraWin source

Returns:
void
Parameters:
[in] DraWin* pointer to DW
[in] dwpList draWin list

void Voronoi::setDWPose ( Pose  dwpPose  ) 

set orientation and position (pose) needed for rototranslation in draWin

Returns:
void
Parameters:
[in] dwpPose pose of the robot

void Voronoi::setDWPointSize ( Decimal  s  ) 

set the size of points

Returns:
void
Parameters:
[in] s size of points

void Voronoi::setDWDiskSize ( Decimal  s  ) 

set the size of disk

Returns:
void
Parameters:
[in] s size of disk

void Voronoi::setDWColor ( Color  c  ) 

set the color

Returns:
void
Parameters:
[in] c color

void Voronoi::drawDiagram (  ) 

draw the voronoi diagram

Returns:
void

void Voronoi::drawSites (  ) 

draw sites of the voronoi diagram

Returns:
void

void Voronoi::drawDisk ( Position  p  ) 

draw disk

Returns:
void
Parameters:
[in] p position

void Voronoi::drawSegment ( Position  source,
Position  target 
)

draw a segment

Returns:
void
Parameters:
[in] source segment start point
[in] target segment end point

void Voronoi::drawCircle ( Position  center,
Decimal  radius,
int  sampling = 1 
)

draw circle

Returns:
void
Parameters:
[in] center of circumference
[in] radius of circumference
[in] sampling coefficient

void Voronoi::drawScan ( int  sampling = 1  ) 

draw scan

Returns:
void
Parameters:
[in] sampling coefficient

void Voronoi::drawLimitedScan ( int  sampling = 1  ) 

draw limited scan

Returns:
void
Parameters:
[in] sampling coefficient

void Voronoi::drawVoronoiScan ( int  sampling = 1  ) 

draw voronoi scan

Returns:
void
Parameters:
[in] sampling coefficient

void Voronoi::drawVoronoiScanPoints ( int  sampling = 1  ) 

draw voronoi scan points

Returns:
void
Parameters:
[in] sampling coefficient

void Voronoi::drawRegionEdges ( Position  p  ) 

draw region edges

Returns:
void
Parameters:
[in] p position

void Voronoi::drawRegionSectors ( Position  center,
Decimal  radius,
int  sampling = 1 
)

draw region edge sectors

Returns:
void
Parameters:
[in] center of region
[in] radius of the sectors
[in] sampling coefficient

bool Voronoi::clearPlot (  ) 

clear the plot

Returns:
bool

Position Voronoi::pointToPosition ( Point_2  point  ) 

convert a Point_2 to a Position

Returns:
Position
Parameters:
[in] point 

Point_2 Voronoi::positionToPoint ( Position  point  ) 

convert a Position to a Point_2

Returns:
Point_2
Parameters:
[in] point 


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

Generated on Mon Feb 20 07:01:10 2017 for MIP by  doxygen 1.5.6