OpendTect-6_4  6.4
array2dinterpol.h
Go to the documentation of this file.
1 #ifndef array2dinterpol_h
2 #define array2dinterpol_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: April 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "algomod.h"
17 #include "paralleltask.h"
18 
19 #include "arrayndalgo.h"
20 #include "enums.h"
21 #include "factory.h"
22 #include "odmemory.h"
23 #include "polygon.h"
24 #include "rowcol.h"
25 
26 class TrcKeySampling;
27 template <class T> class Array2D;
28 namespace Stats { class CalcSetup; }
29 
36 public:
37  virtual ~Array2DInterpol();
39 
40  enum FillType { HolesOnly, ConvexHull, Full, Polygon };
42 
43  void setFillType(FillType);
44  FillType getFillType() const;
45  void setRowStep(float r);
46  void setColStep(float r);
47  void setOrigin(const RowCol&);
48  void setSampling(const TrcKeySampling&);
50 
51  void setMaxHoleSize(float);
52  float getMaxHoleSize() const;
53 
54  void setClassification(bool);
55  bool isClassification() const;
56 
57  void setMask(const Array2D<bool>*,
69  virtual uiString infoMsg() const
70  { return uiString::emptyString(); }
71 
73  {
74  public:
75  virtual ~ArrayAccess() {}
76  virtual void set(od_int64 target, const od_int64* sources,
77  const float* weights, int nrsrc,
78  bool isclassification) = 0;
79  virtual bool isDefined(od_int64) const = 0;
80  virtual int getSize(char dim) const = 0;
81  };
82 
83  virtual bool nothingToFill() const { return false; }
84  virtual bool setArray(Array2D<float>&,TaskRunner* =0);
86  virtual bool canUseArrayAccess() const { return false; }
87  virtual bool setArray(ArrayAccess&,TaskRunner* =0);
89 
92  void setTrendOrder(PolyTrend::Order ord);
93  bool trimArray(int step,Array2D<char>& edgesmask);
94 
95  void doPolygonCrop();
96 
97  virtual bool fillPar(IOPar&) const;
98  virtual bool usePar(const IOPar&);
99 
101  { return uiStrings::sGridding(); }
102 
103  static const char* sKeyFillType();
104  static const char* sKeyRowStep();
105  static const char* sKeyColStep();
106  static const char* sKeyOrigin();
107  static const char* sKeyNrRows();
108  static const char* sKeyNrCols();
109  static const char* sKeyNrCells();
110  static const char* sKeyMaxHoleSz();
111  static const char* sKeyPolyNrofNodes();
112  static const char* sKeyPolyNode();
113  static const char* sKeyCropPolygon();
114 
115 protected:
116  Array2DInterpol();
117 
118  bool doPrepare(int);
119  void getNodesToFill(const bool* isdef, bool* shouldinterpol,
120  TaskRunner*) const;
127  bool isDefined(int idx) const;
130  virtual void setFrom(od_int64 target, const od_int64* sources,
131  const float* weights, int nrsrc);
133  void floodFillArrFrom(int seed, const bool* isdef,
134  bool* shouldinterpol) const;
138  void excludeBigHoles( const bool* isdef, bool* shouldinterpol )const;
145  float rowstep_;
146  float colstep_;
147  int nrrows_;
148  int nrcols_;
149  int nrcells_;
151 
154 
159 
162  bool croppoly_;
163 };
164 
165 #endif
#define mExpClass(module)
Definition: commondefs.h:160
const Array2D< bool > * mask_
Definition: array2dinterpol.h:155
Base class for two dimensional array interpolators.
Definition: array2dinterpol.h:34
Setup for the Stats::RunCalc and Stats::ParallelCalc objects.
Definition: statruncalc.h:38
int nrcols_
Definition: array2dinterpol.h:148
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
int nrcells_
Definition: array2dinterpol.h:149
PolyTrend * trend_
Definition: array2dinterpol.h:160
ArrayAccess * arrsetter_
Definition: array2dinterpol.h:144
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
static const uiString & emptyString()
Definition: uistring.h:109
Definition: uistring.h:89
Definition: array2dinterpol.h:72
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
float colstep_
Definition: array2dinterpol.h:146
RowCol origin_
Definition: array2dinterpol.h:150
virtual bool canUseArrayAccess() const
Definition: array2dinterpol.h:86
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool isclassification_
Definition: array2dinterpol.h:157
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Class that can execute a task.
Definition: task.h:169
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
virtual bool nothingToFill() const
Definition: array2dinterpol.h:83
ODPolygon< double > * poly_
Definition: array2dinterpol.h:161
float maxholesize_
Definition: array2dinterpol.h:153
static uiString sGridding()
Definition: uistrings.h:318
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:426
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
IdxPair used for its row() and col().
Definition: rowcol.h:25
uiString uiMessage() const
will be message() again in 7.x
Definition: array2dinterpol.h:100
virtual uiString infoMsg() const
Definition: array2dinterpol.h:69
Array2D< float > * arr_
Definition: array2dinterpol.h:143
int nrrows_
Definition: array2dinterpol.h:147
virtual ~ArrayAccess()
Definition: array2dinterpol.h:75
bool maskismine_
Definition: array2dinterpol.h:156
PtrPolicy
Definition: odmemory.h:22
Statistics.
Definition: array2dinterpol.h:28
Stats::CalcSetup * statsetup_
Definition: array2dinterpol.h:158
FillType filltype_
Definition: array2dinterpol.h:152
FillType
Definition: array2dinterpol.h:40
Definition: seistype.h:26
Order
Definition: arrayndalgo.h:1061
bool croppoly_
Definition: array2dinterpol.h:162
Polynomial trend with order 0 (mean), 1 (linear) or 2 (parabolic) The trend is derived from a set of ...
Definition: arrayndalgo.h:1054
float rowstep_
Definition: array2dinterpol.h:145
Definition: odmemory.h:22

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