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

Static Public Member Functions

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

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

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() [1/2]

DAGTriangleTree::DAGTriangleTree ( )

◆ DAGTriangleTree() [2/2]

DAGTriangleTree::DAGTriangleTree ( const DAGTriangleTree )

◆ ~DAGTriangleTree()

virtual DAGTriangleTree::~DAGTriangleTree ( )
virtual

Member Function Documentation

◆ cError()

static char DAGTriangleTree::cError ( )
inlinestaticprotected

◆ cInitVertex0()

static int DAGTriangleTree::cInitVertex0 ( )
inlinestaticprotected

◆ cInitVertex1()

static int DAGTriangleTree::cInitVertex1 ( )
inlinestaticprotected

◆ cInitVertex2()

static int DAGTriangleTree::cInitVertex2 ( )
inlinestaticprotected

◆ cIsDuplicate()

static char DAGTriangleTree::cIsDuplicate ( )
inlinestaticprotected

◆ cIsInside()

static char DAGTriangleTree::cIsInside ( )
inlinestaticprotected

◆ cIsOutside()

static char DAGTriangleTree::cIsOutside ( )
inlinestaticprotected

◆ cNoTriangle()

static int DAGTriangleTree::cNoTriangle ( )
inlinestaticprotected

◆ cNoVertex()

static int DAGTriangleTree::cNoVertex ( )
inlinestatic

◆ computeCoordRanges()

static bool DAGTriangleTree::computeCoordRanges ( const TypeSet< Coord > &  ,
Interval< double > &  ,
Interval< double > &   
)
static

◆ coordList()

const TypeSet<Coord>& DAGTriangleTree::coordList ( ) const
inline

◆ dumpTo()

void DAGTriangleTree::dumpTo ( od_ostream ) const

Dumps all triangles to stream;.

◆ dumpTriangulationToIV()

void DAGTriangleTree::dumpTriangulationToIV ( od_ostream ) const

◆ getConnectionAndWeights()

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

Calculate inverse distance weight for each conns.

◆ getConnections()

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

Points on the edge of the geometry shape.

◆ getCoordIndices()

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.

◆ getInitCoord()

const Coord DAGTriangleTree::getInitCoord ( int  vetexidx) const

◆ getNeighbor()

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.

◆ getSurroundingIndices()

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

◆ getTriangle()

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

search triangle contains the point.return crds.

◆ getWeights()

bool DAGTriangleTree::getWeights ( int  pointidx,
const TypeSet< int > &  conns,
TypeSet< double > &  weights,
bool  normalize = true 
) const

◆ init()

bool DAGTriangleTree::init ( )

◆ insertPoint() [1/2]

int DAGTriangleTree::insertPoint ( const Coord ,
int &  dupid 
)

◆ insertPoint() [2/2]

bool DAGTriangleTree::insertPoint ( int  pointidx,
int &  dupid 
)

◆ isInside()

char DAGTriangleTree::isInside ( const Coord pt,
int  ti,
int &  dupid 
) const
protected

◆ isOK()

bool DAGTriangleTree::isOK ( ) const
inline

◆ legalizeTriangles()

void DAGTriangleTree::legalizeTriangles ( TypeSet< char > &  v0s,
TypeSet< char > &  v1s,
TypeSet< int > &  tis 
)
protected

ci is assumed to be inside the triangle ti.

◆ operator=()

DAGTriangleTree& DAGTriangleTree::operator= ( const DAGTriangleTree )

◆ searchChild()

int DAGTriangleTree::searchChild ( int  v0,
int  v1,
int  ti 
) const
protected

◆ searchFurther()

char DAGTriangleTree::searchFurther ( const Coord pt,
int &  nti0,
int &  dupid 
) const
protected

◆ searchTriangle()

char DAGTriangleTree::searchTriangle ( const Coord pt,
int  start,
int &  t0,
int &  dupid 
) const
protected

◆ setBBox()

bool DAGTriangleTree::setBBox ( const Interval< double > &  xrg,
const Interval< double > &  yrg 
)

◆ setCoordList() [1/2]

bool DAGTriangleTree::setCoordList ( const TypeSet< Coord > *  OD)

◆ setCoordList() [2/2]

bool DAGTriangleTree::setCoordList ( TypeSet< Coord > *  ,
OD::PtrPolicy   
)

◆ setEpsilon()

void DAGTriangleTree::setEpsilon ( double  err)
inline

◆ splitTriangleInside()

void DAGTriangleTree::splitTriangleInside ( int  ci,
int  ti 
)
protected

Member Data Documentation

◆ coordlist_

TypeSet<Coord>* DAGTriangleTree::coordlist_
protected

◆ coordlock_

Threads::ReadWriteLock DAGTriangleTree::coordlock_
mutableprotected

◆ epsilon_

double DAGTriangleTree::epsilon_
protected

◆ initialcoords_

Coord DAGTriangleTree::initialcoords_[3]
protected

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

◆ multithreadsupport_

bool DAGTriangleTree::multithreadsupport_
protected

◆ ownscoordlist_

bool DAGTriangleTree::ownscoordlist_
protected

◆ trianglelock_

Threads::ReadWriteLock DAGTriangleTree::trianglelock_
mutableprotected

◆ triangles_

TypeSet<DAGTriangle> DAGTriangleTree::triangles_
protected

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