OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::Graph Class Reference

Class representing the special graph constructed from two polygons that is used to perform boolean operation on polygons (polygon clipping in current implementation). More...

#include <geotoolbox.h>

+ Collaboration diagram for oofem::Graph:

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)
 
nodecreateNode (double x, double y, node *next, node *prev, node *nextPoly, node *neighbor, nodeStatus st, int entry, int visited, double alpha)
 Create new node struct. More...
 
nodenext_node (node *p)
 
nodeprev_node (node *p)
 
nodelast_node (node *p)
 
nodefirst (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

nodes
 
nodec
 

Detailed Description

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.

Member Enumeration Documentation

enum oofem::Graph::nodeStatus
protected
Enumerator
NS_Vertex 
NS_IntersectionVertex 
NS_Intersection 

Definition at line 194 of file geotoolbox.h.

Constructor & Destructor Documentation

oofem::Graph::Graph ( )
inline

Definition at line 211 of file geotoolbox.h.

oofem::Graph::~Graph ( )

Definition at line 224 of file geotoolbox.C.

References oofem::Polygon::clear().

Member Function Documentation

bool oofem::Graph::belongs ( node n,
node v1,
node v2 
)
protected

Definition at line 1415 of file geotoolbox.C.

References oofem::Graph::node::neighbor, and oofem::Graph::node::status.

void oofem::Graph::clear ( )
protected

Definition at line 231 of file geotoolbox.C.

References oofem::Graph::node::next.

Graph::node * oofem::Graph::createNode ( double  x,
double  y,
node next,
node prev,
node nextPoly,
node neighbor,
nodeStatus  st,
int  entry,
int  visited,
double  alpha 
)
protected
double oofem::Graph::dist ( double  x1,
double  y1,
double  x2,
double  y2 
)
protected

Definition at line 1438 of file geotoolbox.C.

Graph::node * oofem::Graph::first ( node p)
protected
void oofem::Graph::insert ( node ins,
node first,
node last 
)
protected
bool oofem::Graph::intersectionExist ( node p1,
node p2,
node q1,
node q2 
)
protected
Graph::node * oofem::Graph::last_node ( node p)
protected

Definition at line 1378 of file geotoolbox.C.

References oofem::Graph::node::next.

void oofem::Graph::merge2vertex ( node v1,
node v2 
)
protected
Graph::node * oofem::Graph::next_node ( node p)
protected

Definition at line 1367 of file geotoolbox.C.

References oofem::Graph::node::next, and oofem::Graph::node::status.

Graph::node * oofem::Graph::prev_node ( node p)
protected

Definition at line 1355 of file geotoolbox.C.

References oofem::Graph::node::prev, and oofem::Graph::node::status.

void oofem::Graph::printYourself ( )
protected
void oofem::Graph::remove ( node n)
protected
void oofem::Graph::removeIntersectionIfExist ( node p1,
node p2,
node q1,
node q2 
)
protected
bool oofem::Graph::testCollapsedEdge ( node p1,
node p2 
)
protected

Definition at line 1514 of file geotoolbox.C.

References GT_EPS, oofem::Graph::node::x, and oofem::Graph::node::y.

int oofem::Graph::testIfCoincident ( node p1,
node p2,
node q1,
node q2,
double *  alpha_1,
double *  alpha_2 
)
protected
int oofem::Graph::testIfIntersect ( node p1,
node p2,
node q1,
node q2,
double *  alpha_p,
double *  alpha_q,
double *  xint,
double *  yint 
)
protected

Definition at line 463 of file geotoolbox.C.

References GT_EPS, GT_TEPS, oofem::Graph::node::x, and oofem::Graph::node::y.

void oofem::Graph::testNewIntersectionVertexEdgeCollapse ( node v,
node l1,
node l2 
)
protected
int oofem::Graph::testPoint ( node poly,
double  x,
double  y 
) const
protected
int oofem::Graph::vertex2IntersectionVertex ( node v,
node l1,
node l2 
)
protected

Member Data Documentation

node * oofem::Graph::c
protected

Definition at line 209 of file geotoolbox.h.

node* oofem::Graph::s
protected

Definition at line 209 of file geotoolbox.h.


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:36 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011