OpendTect-6_4  6.4
array2dinterpolimpl.h
Go to the documentation of this file.
1 #ifndef array2dinterpolimpl_h
2 #define array2dinterpolimpl_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: Feb 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "algomod.h"
17 #include "array2dinterpol.h"
18 #include "rowcol.h"
19 #include "threadlock.h"
20 
21 class RowCol;
22 class DAGTriangleTree;
24 class Extension2DInterpolExecutor;
25 
26 
53 public:
54  mDefaultFactoryInstantiation(Array2DInterpol,
56  "InverseDistance", tr("Inverse distance") )
57 
60 
61  bool setArray(Array2D<float>&,TaskRunner*);
62  bool canUseArrayAccess() const { return true; }
63  bool setArray(ArrayAccess&,TaskRunner*);
64 
65  float getSearchRadius() const { return searchradius_; }
66  void setSearchRadius(float r) { searchradius_ = r; }
67 
68  void setStepSize(int n) { stepsize_ = n; }
69  int getStepSize() const { return stepsize_; }
70 
71  void setNrSteps(int n) { nrsteps_ = n; }
72  int getNrSteps() const { return nrsteps_; }
73 
74  void setCornersFirst(bool n) { cornersfirst_ = n; }
75  bool getCornersFirst() const { return cornersfirst_; }
76  bool nothingToFill() const { return nrIterations()<1; }
77 
78  virtual bool fillPar(IOPar&) const;
79  virtual bool usePar(const IOPar&);
80 
81  static const char* sKeySearchRadius();
82  static const char* sKeyCornersFirst();
83  static const char* sKeyStepSize();
84  static const char* sKeyNrSteps();
85 
86 protected:
87  virtual bool doWork(od_int64,od_int64,int);
88  od_int64 nrIterations() const { return totalnr_; }
89  uiString uiNrDoneText() const { return tr("Nodes gridded"); }
90 
91  bool doPrepare(int);
92  virtual bool initFromArray(TaskRunner*);
93  od_int64 getNextIdx();
94  void reportDone(od_int64);
95 
96  //settings
97  int nrsteps_;
98  int stepsize_;
101 
102  //workflow control stuff
108  int stepidx_;
109 
111  int totalnr_;
112 
113  //Working arrays
114  bool* curdefined_;
116  TypeSet<od_int64> definedidxs_; //Only when no radius
117  TypeSet<RowCol> neighbors_; //Only when radius
118  TypeSet<float> neighborweights_; //Only when radius
119 
120 
121  //Per support size
125 
126  //perstep
128  TypeSet<od_int64> nrsources_; //linked to todothisstep or zero
129 };
130 
131 
138 public:
139  mDefaultFactoryInstantiation(Array2DInterpol,
141  "Triangulation", ::toUiString(sFactoryKeyword()))
142 
145 
146  bool setArray(Array2D<float>&,TaskRunner*);
147  bool canUseArrayAccess() const { return true; }
148  bool setArray(ArrayAccess&,TaskRunner*);
149  bool nothingToFill() const { return nrIterations()<1; }
150 
151  bool doInterpolation() const { return dointerpolation_; }
152  void doInterpolation(bool yn) { dointerpolation_ = yn; }
153  float getMaxDistance() const { return maxdistance_; }
154  void setMaxDistance(float r) { maxdistance_ = r; }
155  bool isMaxInterPolChecked() const
156  { return ismaxdistfldchecked_; }
158  { ismaxdistfldchecked_ = yn; }
159 
160  virtual bool fillPar(IOPar&) const;
161  virtual bool usePar(const IOPar&);
162 
163  static const char* sKeyDoInterpol();
164  static const char* sKeyMaxDistance();
165 
166 protected:
167  int minThreadSize() const { return 10000; }
168  bool doWork(od_int64,od_int64,int);
169  od_int64 nrIterations() const { return totalnr_; }
170  uiString uiNrDoneText() const { return tr("Nodes gridded"); }
171 
172  bool doPrepare(int);
173  virtual bool initFromArray(TaskRunner*);
174  void getNextNodes(TypeSet<od_int64>&);
175 
176  //triangulation stuff
183 
184  //Working arrays
185  bool* curdefined_;
189 
190  //Work control
192 
196 };
197 
198 
205 public:
206  mDefaultFactoryInstantiation(Array2DInterpol,
207  ExtensionArray2DInterpol, "Extension",
208  ::toUiString(sFactoryKeyword()))
209 
212 
213  bool canUseArrayAccess() const { return true; }
214 
215  void setNrSteps(int n) { nrsteps_ = n; }
216  od_int64 getNrSteps() const { return nrsteps_; }
217 
218  bool fillPar(IOPar&) const;
219  bool usePar(const IOPar&);
220 
221  static const char* sKeyNrSteps();
222 
223 protected:
224 
225  bool doWork(od_int64,od_int64,int);
226  od_int64 nrIterations() const { return 1; }
227 
229 
230  Extension2DInterpolExecutor* executor_;
231  friend class Extension2DInterpolExecutor;
232 };
233 
234 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Is an object that faciliates many threads to wait for something to happen.
Definition: thread.h:108
int getStepSize() const
Definition: array2dinterpolimpl.h:69
TypeSet< BinID > cornerbid_
Definition: array2dinterpolimpl.h:195
TypeSet< od_int64 > definedidxs_
Definition: array2dinterpolimpl.h:116
Array 2D interpolator that works by extending the data into udf areas.
Definition: array2dinterpolimpl.h:203
int minThreadSize() const
Definition: array2dinterpolimpl.h:167
Base class for two dimensional array interpolators.
Definition: array2dinterpol.h:34
Reference: "Parallel Incremental Delaunay Triangulation", by Kohout J.2005.
Definition: delaunay.h:36
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
bool cornersfirst_
Definition: array2dinterpolimpl.h:99
TypeSet< int > coordlistindices_
Definition: array2dinterpolimpl.h:182
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Export_Basic uiString toUiString(ViewStyle)
bool dointerpolation_
Definition: array2dinterpolimpl.h:177
int stepidx_
Definition: array2dinterpolimpl.h:108
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: array2dinterpolimpl.h:170
int nrsteps_
Definition: array2dinterpolimpl.h:97
bool canUseArrayAccess() const
Definition: array2dinterpolimpl.h:147
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
int totalnr_
Definition: array2dinterpolimpl.h:111
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: array2dinterpolimpl.h:89
od_int64 prevsupportsize_
Definition: array2dinterpolimpl.h:124
bool * curdefined_
Definition: array2dinterpolimpl.h:185
#define mDefaultFactoryInstantiation(baseclss, clss, keywrd, usernm)
Definition: factory.h:289
bool * nodestofill_
Definition: array2dinterpolimpl.h:186
bool canUseArrayAccess() const
Definition: array2dinterpolimpl.h:213
float getSearchRadius() const
Definition: array2dinterpolimpl.h:65
TypeSet< float > cornerval_
Definition: array2dinterpolimpl.h:194
Definition: uistring.h:89
bool shouldend_
Definition: array2dinterpolimpl.h:107
void doInterpolation(bool yn)
Definition: array2dinterpolimpl.h:152
Threads::ConditionVar & condvar_
Definition: array2dinterpolimpl.h:106
bool * curdefined_
Definition: array2dinterpolimpl.h:114
od_int64 curnode_
Definition: array2dinterpolimpl.h:187
TypeSet< RowCol > neighbors_
Definition: array2dinterpolimpl.h:117
void setMaxDistance(float r)
Definition: array2dinterpolimpl.h:154
Definition: array2dinterpol.h:72
DAGTriangleTree * triangulation_
Definition: array2dinterpolimpl.h:180
bool getCornersFirst() const
Definition: array2dinterpolimpl.h:75
int nraddedthisstep_
Definition: array2dinterpolimpl.h:123
od_int64 nrIterations() const
Definition: array2dinterpolimpl.h:226
void setSearchRadius(float r)
Definition: array2dinterpolimpl.h:66
void setCornersFirst(bool n)
Definition: array2dinterpolimpl.h:74
int nrinitialdefined_
Definition: array2dinterpolimpl.h:110
void setMaxDistInterPolChecekd(bool yn)
Definition: array2dinterpolimpl.h:157
bool ismaxdistfldchecked_
Definition: array2dinterpolimpl.h:178
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
od_int64 getNrSteps() const
Definition: array2dinterpolimpl.h:216
int nrthreads_
Definition: array2dinterpolimpl.h:103
Threads::Lock curnodelock_
Definition: array2dinterpolimpl.h:188
Uses triangulation method to interpolate two dimensional arrays.
Definition: array2dinterpolimpl.h:136
TypeSet< int > corneridx_
Definition: array2dinterpolimpl.h:193
bool isMaxInterPolChecked() const
Definition: array2dinterpolimpl.h:155
float maxdistance_
Definition: array2dinterpolimpl.h:179
int stepsize_
Definition: array2dinterpolimpl.h:98
bool doInterpolation() const
Definition: array2dinterpolimpl.h:151
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
TypeSet< float > neighborweights_
Definition: array2dinterpolimpl.h:118
IdxPair used for its row() and col().
Definition: rowcol.h:25
int getNrSteps() const
Definition: array2dinterpolimpl.h:72
TypeSet< od_int64 > todothisstep_
Definition: array2dinterpolimpl.h:127
float searchradius_
Definition: array2dinterpolimpl.h:100
float getMaxDistance() const
Definition: array2dinterpolimpl.h:153
TypeSet< od_int64 > nrsources_
Definition: array2dinterpolimpl.h:128
od_int64 nrsteps_
Definition: array2dinterpolimpl.h:228
void setStepSize(int n)
Definition: array2dinterpolimpl.h:68
void setNrSteps(int n)
Definition: array2dinterpolimpl.h:215
bool nothingToFill() const
Definition: array2dinterpolimpl.h:149
od_int64 totalnr_
Definition: array2dinterpolimpl.h:191
od_int64 nrIterations() const
Definition: array2dinterpolimpl.h:88
bool waitforall_
Definition: array2dinterpolimpl.h:105
Interpolates 2D arrays using inverse distance method.
Definition: array2dinterpolimpl.h:51
TypeSet< od_int64 > addedwithcursuport_
Definition: array2dinterpolimpl.h:122
Extension2DInterpolExecutor * executor_
Definition: array2dinterpolimpl.h:230
int nrthreadswaiting_
Definition: array2dinterpolimpl.h:104
void setNrSteps(int n)
Definition: array2dinterpolimpl.h:71
od_int64 nrIterations() const
Definition: array2dinterpolimpl.h:169
bool canUseArrayAccess() const
Definition: array2dinterpolimpl.h:62
bool * nodestofill_
Definition: array2dinterpolimpl.h:115
Triangle2DInterpolator * triangleinterpolator_
Definition: array2dinterpolimpl.h:181
bool nothingToFill() const
Definition: array2dinterpolimpl.h:76
For a given triangulated geometry(set of points), interpolating any point located in or nearby the go...
Definition: delaunay.h:187

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