Back to FabImage Library website
You are here: Start » Function Reference » Geometry 2D » Geometry 2D Relations » CreatePointGraph

CreatePointGraph
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Creates a graph of points that lie close to each other.
Syntax
C++
C#
void fil::CreatePointGraph ( const ftl::Array<fil::Point2D>& inPoints, const int inMaxRank, float inMinDistance, ftl::Optional<float> inMaxDistance, ftl::Optional<float> inMaxRelativeDistance, ftl::Array<ftl::Array<int> >& outGraph, ftl::Array<ftl::Array<float> >& outDistances, ftl::Array<fil::Segment2D>& diagSegments )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | Input points | ||
![]() |
inMaxRank | const int | 1 - ![]() |
8 | Maximum connections going out of one point |
![]() |
inMinDistance | float | 0.0 - ![]() |
0.0f | Minimum distance between adjacent point in the graph |
![]() |
inMaxDistance | Optional<float> | 0.0 - ![]() |
10.0f | Maximum distance between adjacent point in the graph |
![]() |
inMaxRelativeDistance | Optional<float> | 1.0 - ![]() |
NIL | Maximum distance in relation to the shortest distance for a point |
![]() |
outGraph | Array<Array<int> >& | Graph of points (adjacency list) | ||
![]() |
outDistances | Array<Array<float> >& | Distances between adjacent points in the graph | ||
![]() |
diagSegments | Array<Segment2D>& | Graph edges, useful for visualization |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Minimum distance is greater than maximum distance in CreatePointGraph. |