OpendTect-6_4  6.4
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
DAGTriangleTree Class Reference

Reference: "Parallel Incremental Delaunay Triangulation", by Kohout J.2005. More...

Classes

struct  DAGTriangle
 

Public Member Functions

 DAGTriangleTree ()
 
 DAGTriangleTree (const DAGTriangleTree &)
 
virtual ~DAGTriangleTree ()
 
DAGTriangleTreeoperator= (const DAGTriangleTree &)
 
bool setCoordList (const TypeSet< Coord > *OD)
 
bool setCoordList (TypeSet< Coord > *, OD::PtrPolicy)
 
const TypeSet< Coord > & coordList () const
 
bool setBBox (const Interval< double > &xrg, const Interval< double > &yrg)
 
bool isOK () const
 
bool init ()
 
bool insertPoint (int pointidx, int &dupid)
 
int insertPoint (const Coord &, int &dupid)
 
const Coord getInitCoord (int vetexidx) const
 
bool getTriangle (const Coord &, int &dupid, TypeSet< int > &vertexindices) const
 
bool getCoordIndices (TypeSet< int > &) const
 
bool getSurroundingIndices (TypeSet< int > &) const
 
bool getConnections (int pointidx, TypeSet< int > &) const
 
bool getWeights (int pointidx, const TypeSet< int > &conns, TypeSet< double > &weights, bool normalize=true) const
 
bool getConnectionAndWeights (int ptidx, TypeSet< int > &conns, TypeSet< double > &weights, bool normailze=true) const
 
void setEpsilon (double err)
 
void dumpTo (od_ostream &) const
 Dumps all triangles to stream;. More...
 
void dumpTriangulationToIV (od_ostream &) const
 

Static Public Member Functions

static bool computeCoordRanges (const TypeSet< Coord > &, Interval< double > &, Interval< double > &)
 
static int cNoVertex ()
 

Protected Member Functions

char searchTriangle (const Coord &pt, int start, int &t0, int &dupid) const
 
char searchFurther (const Coord &pt, int &nti0, int &dupid) const
 
void splitTriangleInside (int ci, int ti)
 
void legalizeTriangles (TypeSet< char > &v0s, TypeSet< char > &v1s, TypeSet< int > &tis)
 
int getNeighbor (int v0, int v1, int ti) const
 
int searchChild (int v0, int v1, int ti) const
 
char isInside (const Coord &pt, int ti, int &dupid) const
 

Static Protected Member Functions

static char cIsOutside ()
 
static char cIsInside ()
 
static char cIsDuplicate ()
 
static char cError ()
 
static int cNoTriangle ()
 
static int cInitVertex0 ()
 
static int cInitVertex1 ()
 
static int cInitVertex2 ()
 

Protected Attributes

bool multithreadsupport_
 
Threads::ReadWriteLock trianglelock_
 
double epsilon_
 
TypeSet< DAGTriangletriangles_
 
TypeSet< Coord > * coordlist_
 
bool ownscoordlist_
 
Threads::ReadWriteLock coordlock_
 
Coord initialcoords_ [3]
 

Detailed Description

Reference: "Parallel Incremental Delaunay Triangulation", by Kohout J.2005.

For the triangulation, it will skip undefined or duplicated points, all the points should be in random order. We use Kohout's pessimistic method to triangulate. The problem is that the pessimistic method only give a 10% speed increase, while the locks slows it down. The parallel code is thus disabled with a macro.

Constructor & Destructor Documentation

DAGTriangleTree::DAGTriangleTree ( )
DAGTriangleTree::DAGTriangleTree ( const DAGTriangleTree )
virtual DAGTriangleTree::~DAGTriangleTree ( )
virtual

Member Function Documentation

static char DAGTriangleTree::cError ( )
inlinestaticprotected
static int DAGTriangleTree::cInitVertex0 ( )
inlinestaticprotected
static int DAGTriangleTree::cInitVertex1 ( )
inlinestaticprotected
static int DAGTriangleTree::cInitVertex2 ( )
inlinestaticprotected
static char DAGTriangleTree::cIsDuplicate ( )
inlinestaticprotected
static char DAGTriangleTree::cIsInside ( )
inlinestaticprotected
static char DAGTriangleTree::cIsOutside ( )
inlinestaticprotected
static int DAGTriangleTree::cNoTriangle ( )
inlinestaticprotected
static int DAGTriangleTree::cNoVertex ( )
inlinestatic
static bool DAGTriangleTree::computeCoordRanges ( const TypeSet< Coord > &  ,
Interval< double > &  ,
Interval< double > &   
)
static
const TypeSet<Coord>& DAGTriangleTree::coordList ( ) const
inline
void DAGTriangleTree::dumpTo ( od_ostream ) const

Dumps all triangles to stream;.

void DAGTriangleTree::dumpTriangulationToIV ( od_ostream ) const
bool DAGTriangleTree::getConnectionAndWeights ( int  ptidx,
TypeSet< int > &  conns,
TypeSet< double > &  weights,
bool  normailze = true 
) const

Calculate inverse distance weight for each conns.

bool DAGTriangleTree::getConnections ( int  pointidx,
TypeSet< int > &   
) const

Points on the edge of the geometry shape.

bool DAGTriangleTree::getCoordIndices ( TypeSet< int > &  ) const

Coord indices are sorted in threes, i.e ci[0], ci[1], ci[2] is the first triangle ci[3], ci[4], ci[5] is the second triangle.

const Coord DAGTriangleTree::getInitCoord ( int  vetexidx) const
int DAGTriangleTree::getNeighbor ( int  v0,
int  v1,
int  ti 
) const
protected

Check neighbor triangle of the edge v0-v1 in ti, where v0, v1 are local vetex indices 0, 1, 2.

bool DAGTriangleTree::getSurroundingIndices ( TypeSet< int > &  ) const
bool DAGTriangleTree::getTriangle ( const Coord ,
int &  dupid,
TypeSet< int > &  vertexindices 
) const

search triangle contains the point.return crds.

bool DAGTriangleTree::getWeights ( int  pointidx,
const TypeSet< int > &  conns,
TypeSet< double > &  weights,
bool  normalize = true 
) const
bool DAGTriangleTree::init ( )
bool DAGTriangleTree::insertPoint ( int  pointidx,
int &  dupid 
)
int DAGTriangleTree::insertPoint ( const Coord ,
int &  dupid 
)
char DAGTriangleTree::isInside ( const Coord pt,
int  ti,
int &  dupid 
) const
protected
bool DAGTriangleTree::isOK ( ) const
inline
void DAGTriangleTree::legalizeTriangles ( TypeSet< char > &  v0s,
TypeSet< char > &  v1s,
TypeSet< int > &  tis 
)
protected

ci is assumed to be inside the triangle ti.

DAGTriangleTree& DAGTriangleTree::operator= ( const DAGTriangleTree )
int DAGTriangleTree::searchChild ( int  v0,
int  v1,
int  ti 
) const
protected
char DAGTriangleTree::searchFurther ( const Coord pt,
int &  nti0,
int &  dupid 
) const
protected
char DAGTriangleTree::searchTriangle ( const Coord pt,
int  start,
int &  t0,
int &  dupid 
) const
protected
bool DAGTriangleTree::setBBox ( const Interval< double > &  xrg,
const Interval< double > &  yrg 
)
bool DAGTriangleTree::setCoordList ( const TypeSet< Coord > *  OD)
bool DAGTriangleTree::setCoordList ( TypeSet< Coord > *  ,
OD::PtrPolicy   
)
void DAGTriangleTree::setEpsilon ( double  err)
inline
void DAGTriangleTree::splitTriangleInside ( int  ci,
int  ti 
)
protected

Member Data Documentation

TypeSet<Coord>* DAGTriangleTree::coordlist_
protected
Threads::ReadWriteLock DAGTriangleTree::coordlock_
mutableprotected
double DAGTriangleTree::epsilon_
protected
Coord DAGTriangleTree::initialcoords_[3]
protected

-2,-3,-4 are their indices.

bool DAGTriangleTree::multithreadsupport_
protected
bool DAGTriangleTree::ownscoordlist_
protected
Threads::ReadWriteLock DAGTriangleTree::trianglelock_
mutableprotected
TypeSet<DAGTriangle> DAGTriangleTree::triangles_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019