Class GraphSplitter2d
This class is used to bisect an existing DGraph2 with infinite lines. This is easier than inserting new segments, which can be done using Arrangement2d.
Computations are done in double precision. Use at your own risk.
[TODO]
- computation of signs for a split-line is currently O(N). If inserting many parallel lines, can improve this using standard sorting.
 
Inherited Members
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class GraphSplitter2d
  Constructors
GraphSplitter2d(DGraph2)
Declaration
public GraphSplitter2d(DGraph2 graph)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DGraph2 | graph | 
Fields
Graph
Declaration
public DGraph2 Graph
  Field Value
| Type | Description | 
|---|---|
| DGraph2 | 
InsertedEdgesID
default ID for new edges, can override in specific functions
Declaration
public int InsertedEdgesID
  Field Value
| Type | Description | 
|---|---|
| Int32 | 
InsideTestF
when inserting new segments, we check if their midpoint passes this test
Declaration
public Func<Vector2d, bool> InsideTestF
  Field Value
| Type | Description | 
|---|---|
| Func<Vector2d, Boolean> | 
OnVertexTol
tolerance for WhichSide(vtx) tests
Declaration
public double OnVertexTol
  Field Value
| Type | Description | 
|---|---|
| Double | 
Methods
do_split(Line2d, Boolean, Int32)
Declaration
protected virtual void do_split(Line2d line, bool insert_edges, int insert_gid)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Line2d | line | |
| Boolean | insert_edges | |
| Int32 | insert_gid | 
InsertLine(Line2d, Int32)
split all graph edges that intersect line, and insert segments connecting these points
Declaration
public void InsertLine(Line2d line, int insert_edges_id = -1)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Line2d | line | |
| Int32 | insert_edges_id |