24 #define mDAGTriangleForceSingleThread 40 DAGTriangleTree(
const DAGTriangleTree&);
41 virtual ~DAGTriangleTree();
42 DAGTriangleTree&
operator=(
const DAGTriangleTree&);
54 bool isOK()
const {
return triangles_.size(); }
58 bool insertPoint(
int pointidx,
int& dupid);
59 int insertPoint(
const Coord&,
int& dupid);
61 const Coord getInitCoord(
int vetexidx)
const;
62 bool getTriangle(
const Coord&,
int& dupid,
75 bool normalize=
true)
const;
77 bool getConnectionAndWeights(
int ptidx,
TypeSet<int>& conns,
79 bool normailze=
true)
const;
101 char searchTriangle(
const Coord& pt,
int start,
int& t0,
103 char searchFurther(
const Coord& pt,
int& nti0,
int& dupid)
const;
105 void splitTriangleInside(
int ci,
int ti);
112 int getNeighbor(
int v0,
int v1,
int ti)
const;
113 int searchChild(
int v0,
int v1,
int ti)
const;
114 char isInside(
const Coord& pt,
int ti,
int& dupid)
const;
122 int coordindices_[3];
123 int childindices_[3];
126 bool hasChildren()
const;
162 #ifdef mDAGTriangleForceSingleThread 170 {
return tr(
"Points triangulated"); }
196 double maxdist=
mUdf(
double),
197 bool dointerpolate=
true);
224 const int nrknots = knots.
size();
230 for(
int idx=nrknots-1, idy=0; idy<nrknots; idx=idy++ )
231 area += (knots[idx].x*knots[idy].y - knots[idy].x*knots[idx].y);
237 for (
int idx=0; idx<nrknots; idx++ )
242 for(
int idx=0; idx<nrknots; idx++ )
243 ci += (nrknots-1-idx);
248 int cursize = nrknots;
249 int errcheck = 2*cursize;
251 for(
int idx=cursize-1; cursize>2; )
253 if ( 0 >= (errcheck--) )
256 const int idx0 = cursize<=idx ? 0 : idx;
257 idx = cursize<=idx0+1 ? 0 : idx0+1;
258 const int idx1 = cursize<=idx+1 ? 0 : idx+1;
260 const Coord& pos0 = knots[ci[idx0]];
261 const Coord& pos = knots[ci[idx]];
262 const Coord& pos1 = knots[ci[idx1]];
263 if ( (((pos.
x-pos0.
x)*(pos1.
y-pos0.
y)) -
264 ((pos.
y-pos0.
y)*(pos1.
x-pos0.
x)))<0 )
268 for (
int idy=0; idy<cursize; idy++ )
270 if( (idy==idx0) || (idy==idx) || (idy==idx1) )
287 for(
int i=idx, j=idx+1; j<cursize; i++, j++ )
291 errcheck = 2*cursize;
#define mExpClass(module)
Definition: commondefs.h:160
TypeSet< int > perimeter_
Definition: delaunay.h:215
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:26
Reference: "Parallel Incremental Delaunay Triangulation", by Kohout J.2005.
Definition: delaunay.h:36
TypeSet< double > cornerweights1_
Definition: delaunay.h:210
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
bool isOK() const
Definition: delaunay.h:54
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
int maxNrThreads() const
Definition: delaunay.h:163
Interval< od_int64 > calcscope_
Definition: delaunay.h:176
TypeSet< DAGTriangle > triangles_
Definition: delaunay.h:134
Definition: uistring.h:89
Threads::ReadWriteLock coordlock_
Definition: delaunay.h:139
static int cNoTriangle()
Definition: delaunay.h:96
static char cIsOutside()
Definition: delaunay.h:91
A cartesian coordinate in 2D space.
Definition: coord.h:25
TypeSet< Coord > * coordlist_
Definition: delaunay.h:136
bool ownscoordlist_
Definition: delaunay.h:137
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
double epsilon_
Definition: delaunay.h:133
TypeSet< double > cornerweights2_
Definition: delaunay.h:212
od_int64 * permutation_
Definition: delaunay.h:173
static char cError()
Definition: delaunay.h:94
TypeSet< double > cornerweights0_
Definition: delaunay.h:208
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
T y
Definition: geometry.h:67
void setEpsilon(double err)
Definition: delaunay.h:80
DAGTriangleTree & tree_
Definition: delaunay.h:175
static int cNoVertex()
Definition: delaunay.h:87
bool PolygonTriangulate(const TypeSet< Coord > &knots, TypeSet< int > &res)
Definition: delaunay.h:222
static int cInitVertex1()
Definition: delaunay.h:98
void dataIsRandom(bool yn)
Definition: delaunay.h:157
The parallel triangulation works for only one processor now.
Definition: delaunay.h:150
static char cIsInside()
Definition: delaunay.h:92
const DAGTriangleTree & triangles_
Definition: delaunay.h:206
Definition: delaunay.h:116
Coord initcenter_
Definition: delaunay.h:213
size_type size() const
Definition: typeset.h:254
bool israndom_
Definition: delaunay.h:174
od_ostream & operator=(const od_ostream &s)
Definition: od_ostream.h:41
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:207
T x
Definition: geometry.h:66
uiString uiMessage() const
will be message() again in 7.x
Definition: delaunay.h:171
OpendTect.
Definition: commontypes.h:29
PtrPolicy
Definition: odmemory.h:22
TypeSet< int > corner2_
Definition: delaunay.h:211
static char cIsDuplicate()
Definition: delaunay.h:93
const TypeSet< Coord > & coordList() const
Definition: delaunay.h:49
TypeSet< int > corner1_
Definition: delaunay.h:209
static int cInitVertex2()
Definition: delaunay.h:99
Threads::ReadWriteLock trianglelock_
Definition: delaunay.h:131
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: delaunay.h:169
TypeSet< double > perimeterazimuth_
Definition: delaunay.h:216
bool isDataRandom()
Definition: delaunay.h:156
static int cInitVertex0()
Definition: delaunay.h:97
bool multithreadsupport_
Definition: delaunay.h:129
For a given triangulated geometry(set of points), interpolating any point located in or nearby the go...
Definition: delaunay.h:187