|
OOFEM 3.0
|
#include <geotoolbox.h>
Classes | |
| struct | node |
Public Member Functions | |
| Graph () | |
| ~Graph () | |
| void | clip (Polygon &result, const Polygon &a, const Polygon &b) |
Protected Types | |
| enum | nodeStatus { NS_Vertex , NS_IntersectionVertex , NS_Intersection } |
Protected Member Functions | |
| void | insert (node *ins, node *first, node *last) |
| node * | createNode (double x, double y, node *next, node *prev, node *nextPoly, node *neighbor, nodeStatus st, int entry, int visited, double alpha) |
| node * | next_node (node *p) |
| node * | prev_node (node *p) |
| node * | last_node (node *p) |
| node * | first (node *p) |
| void | remove (node *n) |
| double | dist (double x1, double y1, double x2, double y2) |
| int | testIfIntersect (node *p1, node *p2, node *q1, node *q2, double *alpha_p, double *alpha_q, double *xint, double *yint) |
| int | testIfCoincident (node *p1, node *p2, node *q1, node *q2, double *alpha_1, double *alpha_2) |
| int | testPoint (node *poly, double x, double y) const |
| bool | belongs (node *n, node *v1, node *v2) |
| bool | intersectionExist (node *p1, node *p2, node *q1, node *q2) |
| void | removeIntersectionIfExist (node *p1, node *p2, node *q1, node *q2) |
| int | vertex2IntersectionVertex (node *v, node *l1, node *l2) |
| void | testNewIntersectionVertexEdgeCollapse (node *v, node *l1, node *l2) |
| bool | testCollapsedEdge (node *p1, node *p2) |
| void | merge2vertex (node *v1, node *v2) |
| void | printYourself () |
| void | clear () |
Protected Attributes | |
| node * | s |
| node * | c |
Class representing the special graph constructed from two polygons that is used to perform boolean operation on polygons (polygon clipping in current implementation). In short, the graph contains polygon vertices and intersections of polygon edges. Then graph edges represent the edges between graph nodes (graph edge correspond to polygon edge if this edge has no intersection with other edges of second polygon, or single polygon edge can be represented by two or more graph edges if intersections are present). Each polygon vertex representing intersection contain link to its twin representing the same intersection on second polygon. This allows to perform traversal walk over graph edges and vertices that can represent various boolean operations. This class is a part of geometry toolbox.
Definition at line 191 of file geotoolbox.h.
|
protected |
| Enumerator | |
|---|---|
| NS_Vertex | |
| NS_IntersectionVertex | |
| NS_Intersection | |
Definition at line 194 of file geotoolbox.h.
|
inline |
Definition at line 211 of file geotoolbox.h.
| oofem::Graph::~Graph | ( | ) |
Definition at line 224 of file geotoolbox.C.
References clear().
Definition at line 1415 of file geotoolbox.C.
References oofem::Graph::node::neighbor, next_node(), NS_Intersection, NS_Vertex, prev_node(), and oofem::Graph::node::status.
Referenced by clip(), and testNewIntersectionVertexEdgeCollapse().
|
protected |
Definition at line 231 of file geotoolbox.C.
References c, oofem::Graph::node::next, and s.
Referenced by ~Graph().
Definition at line 575 of file geotoolbox.C.
References oofem::Polygon::addVertex(), belongs(), c, oofem::Polygon::clear(), oofem::Vertex::coords, createNode(), oofem::Graph::node::entry, first(), insert(), merge2vertex(), oofem::Graph::node::neighbor, oofem::Graph::node::next, next_node(), NS_Intersection, NS_IntersectionVertex, NS_Vertex, oofem::Graph::node::prev, printYourself(), s, oofem::Vertex::setCoords(), oofem::Graph::node::status, testCollapsedEdge(), testIfCoincident(), testIfIntersect(), testNewIntersectionVertexEdgeCollapse(), testPoint(), THROW_GT_EXCEPTIONM, vertex2IntersectionVertex(), oofem::Graph::node::visited, oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by oofem::TR1_2D_CBS::truncateMatVolume(), oofem::TR1_2D_SUPG2::truncateMatVolume(), oofem::TR1_2D_SUPG2_AXI::truncateMatVolume(), and oofem::TR1_2D_SUPG::truncateMatVolume().
|
protected |
Create new node struct
Definition at line 1444 of file geotoolbox.C.
References oofem::Graph::node::alpha, oofem::Graph::node::entry, oofem::Graph::node::neighbor, oofem::Graph::node::next, oofem::Graph::node::nextPoly, oofem::Graph::node::prev, oofem::Graph::node::status, oofem::Graph::node::visited, oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by clip().
|
protected |
Definition at line 1438 of file geotoolbox.C.
Referenced by testCollapsedEdge(), testIfCoincident(), and testIfIntersect().
|
protected |
Definition at line 1391 of file geotoolbox.C.
References oofem::Graph::node::entry, oofem::Graph::node::next, NS_Intersection, NS_IntersectionVertex, oofem::Graph::node::status, and oofem::Graph::node::visited.
Definition at line 1470 of file geotoolbox.C.
References oofem::Graph::node::alpha, first(), oofem::Graph::node::next, and oofem::Graph::node::prev.
Referenced by clip().
Definition at line 1496 of file geotoolbox.C.
References oofem::Graph::node::neighbor, oofem::Graph::node::next, NS_Intersection, oofem::Graph::node::prev, and oofem::Graph::node::status.
|
protected |
Definition at line 1378 of file geotoolbox.C.
References oofem::Graph::node::next.
Definition at line 1670 of file geotoolbox.C.
References oofem::Graph::node::entry, oofem::Graph::node::neighbor, NS_Intersection, NS_IntersectionVertex, remove(), oofem::Graph::node::status, and THROW_GT_EXCEPTIONM.
Referenced by clip(), and vertex2IntersectionVertex().
|
protected |
Definition at line 1367 of file geotoolbox.C.
References oofem::Graph::node::next, NS_Intersection, and oofem::Graph::node::status.
Referenced by belongs(), clip(), removeIntersectionIfExist(), testNewIntersectionVertexEdgeCollapse(), and vertex2IntersectionVertex().
|
protected |
Definition at line 1355 of file geotoolbox.C.
References NS_Intersection, oofem::Graph::node::prev, and oofem::Graph::node::status.
Referenced by belongs(), removeIntersectionIfExist(), testNewIntersectionVertexEdgeCollapse(), and vertex2IntersectionVertex().
|
protected |
Definition at line 1747 of file geotoolbox.C.
References c, oofem::Graph::node::entry, oofem::Graph::node::next, NS_IntersectionVertex, NS_Vertex, s, oofem::Graph::node::status, oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by clip().
|
protected |
Definition at line 1484 of file geotoolbox.C.
References oofem::Graph::node::entry, oofem::Graph::node::neighbor, oofem::Graph::node::next, and oofem::Graph::node::prev.
|
protected |
Definition at line 1524 of file geotoolbox.C.
References oofem::Graph::node::neighbor, oofem::Graph::node::next, next_node(), NS_Intersection, oofem::Graph::node::prev, prev_node(), and oofem::Graph::node::status.
Referenced by vertex2IntersectionVertex().
Definition at line 1514 of file geotoolbox.C.
References dist(), GT_EPS, oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by clip().
|
protected |
Definition at line 255 of file geotoolbox.C.
References dist(), GT_EPS, GT_TEPS, oofem::min(), oofem::sgn(), oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by clip().
|
protected |
Definition at line 463 of file geotoolbox.C.
References dist(), GT_EPS, GT_TEPS, oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by clip().
|
protected |
Definition at line 1594 of file geotoolbox.C.
References oofem::Graph::node::alpha, belongs(), oofem::Graph::node::entry, oofem::Graph::node::neighbor, oofem::Graph::node::next, next_node(), NS_Intersection, NS_IntersectionVertex, oofem::Graph::node::prev, prev_node(), and oofem::Graph::node::status.
Referenced by clip().
|
protected |
Definition at line 1718 of file geotoolbox.C.
References oofem::Graph::node::next, s, oofem::Graph::node::x, and oofem::Graph::node::y.
Referenced by clip().
Definition at line 1549 of file geotoolbox.C.
References merge2vertex(), oofem::Graph::node::neighbor, oofem::Graph::node::next, next_node(), NS_IntersectionVertex, oofem::Graph::node::prev, prev_node(), removeIntersectionIfExist(), oofem::Graph::node::status, and THROW_GT_EXCEPTIONM.
Referenced by clip().
|
protected |
Definition at line 209 of file geotoolbox.h.
Referenced by clear(), clip(), Graph(), and printYourself().
|
protected |
Definition at line 209 of file geotoolbox.h.
Referenced by clear(), clip(), Graph(), printYourself(), and testPoint().