22 #define mDAGTriangleForceSingleThread 38 DAGTriangleTree(
const DAGTriangleTree&);
39 virtual ~DAGTriangleTree();
40 DAGTriangleTree&
operator=(
const DAGTriangleTree&);
52 bool isOK()
const {
return triangles_.size(); }
56 bool insertPoint(
int pointidx,
int& dupid);
57 int insertPoint(
const Coord&,
int& dupid);
59 const Coord getInitCoord(
int vetexidx)
const;
60 bool getTriangle(
const Coord&,
int& dupid,
73 bool normalize=
true)
const;
75 bool getConnectionAndWeights(
int ptidx,
TypeSet<int>& conns,
77 bool normailze=
true)
const;
99 char searchTriangle(
const Coord& pt,
int start,
int& t0,
101 char searchFurther(
const Coord& pt,
int& nti0,
int& dupid)
const;
103 void splitTriangleInside(
int ci,
int ti);
110 int getNeighbor(
int v0,
int v1,
int ti)
const;
111 int searchChild(
int v0,
int v1,
int ti)
const;
112 char isInside(
const Coord& pt,
int ti,
int& dupid)
const;
120 int coordindices_[3];
121 int childindices_[3];
124 bool hasChildren()
const;
160 #ifdef mDAGTriangleForceSingleThread 168 {
return tr(
"Points triangulated"); }
194 double maxdist=
mUdf(
double),
195 bool dointerpolate=
true);
222 const int nrknots = knots.
size();
228 for(
int idx=nrknots-1, idy=0; idy<nrknots; idx=idy++ )
229 area += (knots[idx].x_*knots[idy].y_ - knots[idy].x_*knots[idx].y_);
235 for (
int idx=0; idx<nrknots; idx++ )
240 for(
int idx=0; idx<nrknots; idx++ )
241 ci += (nrknots-1-idx);
246 int cursize = nrknots;
247 int errcheck = 2*cursize;
249 for(
int idx=cursize-1; cursize>2; )
251 if ( 0 >= (errcheck--) )
254 const int idx0 = cursize<=idx ? 0 : idx;
255 idx = cursize<=idx0+1 ? 0 : idx0+1;
256 const int idx1 = cursize<=idx+1 ? 0 : idx+1;
258 const Coord& pos0 = knots[ci[idx0]];
259 const Coord& pos = knots[ci[idx]];
260 const Coord& pos1 = knots[ci[idx1]];
261 if ( (((pos.
x_-pos0.
x_)*(pos1.
y_-pos0.
y_)) -
262 ((pos.
y_-pos0.
y_)*(pos1.
x_-pos0.
x_)))<0 )
266 for (
int idy=0; idy<cursize; idy++ )
268 if( (idy==idx0) || (idy==idx) || (idy==idx1) )
285 for(
int i=idx, j=idx+1; j<cursize; i++, j++ )
289 errcheck = 2*cursize;
#define mExpClass(module)
Definition: commondefs.h:157
TypeSet< int > perimeter_
Definition: delaunay.h:213
Lock that permits multiple readers to lock the object at the same time, but it will not allow any rea...
Definition: thread.h:141
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:25
uiString nrDoneText() const
Definition: delaunay.h:167
Reference: "Parallel Incremental Delaunay Triangulation", by Kohout J.2005.
Definition: delaunay.h:34
TypeSet< double > cornerweights1_
Definition: delaunay.h:208
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
bool isOK() const
Definition: delaunay.h:52
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
od_ostream & operator=(const od_ostream &)=delete
#define od_int64
Definition: plftypes.h:34
int maxNrThreads() const
Definition: delaunay.h:161
Interval< od_int64 > calcscope_
Definition: delaunay.h:174
TypeSet< DAGTriangle > triangles_
Definition: delaunay.h:132
Definition: uistring.h:88
Threads::ReadWriteLock coordlock_
Definition: delaunay.h:137
static int cNoTriangle()
Definition: delaunay.h:94
static char cIsOutside()
Definition: delaunay.h:89
TypeSet< Coord > * coordlist_
Definition: delaunay.h:134
bool ownscoordlist_
Definition: delaunay.h:135
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:64
double epsilon_
Definition: delaunay.h:131
TypeSet< double > cornerweights2_
Definition: delaunay.h:210
od_int64 * permutation_
Definition: delaunay.h:171
Set of (small) copyable elements.
Definition: commontypes.h:26
static char cError()
Definition: delaunay.h:92
TypeSet< double > cornerweights0_
Definition: delaunay.h:206
uiString message() const
Definition: delaunay.h:169
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
void setEpsilon(double err)
Definition: delaunay.h:78
DAGTriangleTree & tree_
Definition: delaunay.h:173
static int cNoVertex()
Definition: delaunay.h:85
bool PolygonTriangulate(const TypeSet< Coord > &knots, TypeSet< int > &res)
Definition: delaunay.h:220
static int cInitVertex1()
Definition: delaunay.h:96
void dataIsRandom(bool yn)
Definition: delaunay.h:155
T x_
Definition: geometry.h:80
The parallel triangulation works for only one processor now.
Definition: delaunay.h:148
static char cIsInside()
Definition: delaunay.h:90
const DAGTriangleTree & triangles_
Definition: delaunay.h:204
Definition: delaunay.h:114
Coord initcenter_
Definition: delaunay.h:211
bool israndom_
Definition: delaunay.h:172
bool pointInTriangle2D(const Coord &p, const Coord &a, const Coord &b, const Coord &c, double epsilon)
Definition: trigonometry.h:187
TypeSet< int > corner0_
Definition: delaunay.h:205
OpendTect.
Definition: commontypes.h:25
PtrPolicy
Definition: odmemory.h:20
TypeSet< int > corner2_
Definition: delaunay.h:209
static char cIsDuplicate()
Definition: delaunay.h:91
const TypeSet< Coord > & coordList() const
Definition: delaunay.h:47
TypeSet< int > corner1_
Definition: delaunay.h:207
static int cInitVertex2()
Definition: delaunay.h:97
Threads::ReadWriteLock trianglelock_
Definition: delaunay.h:129
2D point or vector class.
Definition: commontypes.h:58
TypeSet< double > perimeterazimuth_
Definition: delaunay.h:214
bool isDataRandom()
Definition: delaunay.h:154
static int cInitVertex0()
Definition: delaunay.h:95
T y_
Definition: geometry.h:81
bool multithreadsupport_
Definition: delaunay.h:127
For a given triangulated geometry(set of points), interpolating any point located in or nearby the go...
Definition: delaunay.h:185