 |
OpendTect
6.6
|
Go to the documentation of this file.
23 #define mDAGTriangleForceSingleThread
53 bool isOK()
const {
return triangles_.size(); }
74 bool normalize=
true)
const;
78 bool normailze=
true)
const;
121 int coordindices_[3];
122 int childindices_[3];
161 #ifdef mDAGTriangleForceSingleThread
169 {
return tr(
"Points triangulated"); }
195 double maxdist=
mUdf(
double),
196 bool dointerpolate=
true);
223 const int nrknots = knots.size();
229 for(
int idx=nrknots-1, idy=0; idy<nrknots; idx=idy++ )
230 area += (knots[idx].x*knots[idy].y - knots[idy].x*knots[idx].y);
236 for (
int idx=0; idx<nrknots; idx++ )
241 for(
int idx=0; idx<nrknots; idx++ )
242 ci += (nrknots-1-idx);
247 int cursize = nrknots;
248 int errcheck = 2*cursize;
250 for(
int idx=cursize-1; cursize>2; )
252 if ( 0 >= (errcheck--) )
255 const int idx0 = cursize<=idx ? 0 : idx;
256 idx = cursize<=idx0+1 ? 0 : idx0+1;
257 const int idx1 = cursize<=idx+1 ? 0 : idx+1;
259 const Coord& pos0 = knots[ci[idx0]];
260 const Coord& pos = knots[ci[idx]];
261 const Coord& pos1 = knots[ci[idx1]];
262 if ( (((pos.
x-pos0.
x)*(pos1.
y-pos0.
y)) -
263 ((pos.
y-pos0.
y)*(pos1.
x-pos0.
x)))<0 )
267 for (
int idy=0; idy<cursize; idy++ )
269 if( (idy==idx0) || (idy==idx) || (idy==idx1) )
286 for(
int i=idx, j=idx+1; j<cursize; i++, j++ )
290 errcheck = 2*cursize;
Threads::ReadWriteLock coordlock_
Definition: delaunay.h:138
virtual ~DAGTriangleTree()
void dumpTriangulationToIV(od_ostream &) const
int getNeighbor(int v0, int v1, int ti) const
void legalizeTriangles(TypeSet< char > &v0s, TypeSet< char > &v1s, TypeSet< int > &tis)
bool doWork(od_int64, od_int64, int)
static int cInitVertex1()
Definition: delaunay.h:97
DAGTriangle & operator=(const DAGTriangle &)
bool PolygonTriangulate(const TypeSet< Coord > &knots, TypeSet< int > &res)
Definition: delaunay.h:221
For a given triangulated geometry(set of points), interpolating any point located in or nearby the go...
Definition: delaunay.h:187
Interval< od_int64 > calcscope_
Definition: delaunay.h:175
bool getWeights(int pointidx, const TypeSet< int > &conns, TypeSet< double > &weights, bool normalize=true) const
Lock that permits multiple readers to lock the object at the same time, but it will not allow any rea...
Definition: thread.h:143
#define od_int64
Definition: plftypes.h:35
TypeSet< int > corner0_
Definition: delaunay.h:206
TypeSet< int > perimeter_
Definition: delaunay.h:214
DAGTriangleTree & tree_
Definition: delaunay.h:174
OpendTect.
Definition: commontypes.h:28
const Coord getInitCoord(int vetexidx) const
#define mExpClass(module)
Definition: commondefs.h:177
The parallel triangulation works for only one processor now.
Definition: delaunay.h:150
bool operator==(const DAGTriangle &) const
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: delaunay.h:168
Reference: "Parallel Incremental Delaunay Triangulation", by Kohout J.2005.
Definition: delaunay.h:36
TypeSet< double > cornerweights1_
Definition: delaunay.h:209
DAGTriangleTree(const DAGTriangleTree &)
bool multithreadsupport_
Definition: delaunay.h:128
bool isDataRandom()
Definition: delaunay.h:155
bool setCoordList(const TypeSet< Coord > *OD)
DAGTriangleTree & operator=(const DAGTriangleTree &)
char searchTriangle(const Coord &pt, int start, int &t0, int &dupid) const
bool setCoordList(TypeSet< Coord > *, OD::PtrPolicy)
od_int64 nrIterations() const
static bool computeCoordRanges(const TypeSet< Coord > &, Interval< double > &, Interval< double > &)
static char cError()
Definition: delaunay.h:93
static int cInitVertex2()
Definition: delaunay.h:98
bool isOK() const
Definition: delaunay.h:53
Threads::ReadWriteLock trianglelock_
Definition: delaunay.h:130
bool getConnectionAndWeights(int ptidx, TypeSet< int > &conns, TypeSet< double > &weights, bool normailze=true) const
TypeSet< double > cornerweights0_
Definition: delaunay.h:207
bool ownscoordlist_
Definition: delaunay.h:136
A cartesian coordinate in 2D space.
Definition: coord.h:25
od_int64 * permutation_
Definition: delaunay.h:172
const DAGTriangleTree & triangles_
Definition: delaunay.h:205
bool setFromAzimuth(const TypeSet< int > &tmpvertices, const Coord &, TypeSet< int > &vertices, TypeSet< double > &weights)
void setCalcScope(const Interval< int > &rg)
void dataIsRandom(bool yn)
Definition: delaunay.h:156
int maxNrThreads() const
Definition: delaunay.h:162
TypeSet< Coord > * coordlist_
Definition: delaunay.h:135
static char cIsInside()
Definition: delaunay.h:91
int insertPoint(const Coord &, int &dupid)
double epsilon_
Definition: delaunay.h:132
Triangle2DInterpolator(const DAGTriangleTree &)
TypeSet< double > cornerweights2_
Definition: delaunay.h:211
TypeSet< double > perimeterazimuth_
Definition: delaunay.h:215
uiString uiMessage() const
will be message() again in 7.x
Definition: delaunay.h:170
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
char isInside(const Coord &pt, int ti, int &dupid) const
bool getTriangle(const Coord &, int &dupid, TypeSet< int > &vertexindices) const
bool israndom_
Definition: delaunay.h:173
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
static char cIsDuplicate()
Definition: delaunay.h:92
void dumpTo(od_ostream &) const
Dumps all triangles to stream;.
TypeSet< int > corner2_
Definition: delaunay.h:210
T y
Definition: geometry.h:68
static int cNoTriangle()
Definition: delaunay.h:95
static int cNoVertex()
Definition: delaunay.h:86
Coord initcenter_
Definition: delaunay.h:212
bool getCoordIndices(TypeSet< int > &) const
static char cIsOutside()
Definition: delaunay.h:90
T x
Definition: geometry.h:67
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
DelaunayTriangulator(DAGTriangleTree &)
PtrPolicy
Definition: odmemory.h:21
bool pointInTriangle2D(const Coord &p, const Coord &a, const Coord &b, const Coord &c, double epsilon)
Definition: trigonometry.h:186
const TypeSet< Coord > & coordList() const
Definition: delaunay.h:48
bool getConnections(int pointidx, TypeSet< int > &) const
int searchChild(int v0, int v1, int ti) const
Definition: delaunay.h:116
bool setBBox(const Interval< double > &xrg, const Interval< double > &yrg)
bool getSurroundingIndices(TypeSet< int > &) const
mODTextTranslationClass(DelaunayTriangulator)
void splitTriangleInside(int ci, int ti)
OD class for stream write common access to the user log file, or std::cout in other than od_main.
Definition: od_ostream.h:26
TypeSet< int > corner1_
Definition: delaunay.h:208
bool computeWeights(const Coord &, TypeSet< int > &vertices, TypeSet< double > &weights, double maxdist=mUdf(double), bool dointerpolate=true)
char searchFurther(const Coord &pt, int &nti0, int &dupid) const
TypeSet< DAGTriangle > triangles_
Definition: delaunay.h:133
static int cInitVertex0()
Definition: delaunay.h:96
void setEpsilon(double err)
Definition: delaunay.h:79
bool insertPoint(int pointidx, int &dupid)
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021