 |
OpendTect
6.6
|
Go to the documentation of this file.
28 template <
class T,
class TT>
40 TT*
to,
int sz0,
int sz1,
bool fromhasudfs,
66 int sz0,
int sz1,
bool fromhasudfs,
72 inline od_int64 nrIterations()
const;
79 {
return tr(
"Data columns resampled"); }
96 template <
class T,
class TT>
inline
101 {
set( from,
to, fromhasudfs, rectinfrom ); }
104 template <
class T,
class TT>
inline
106 TT*
to,
int sz0,
int sz1,
bool fromhasudfs,
109 {
set( from,
to, sz0, sz1, fromhasudfs, rectinfrom ); }
112 template <
class T,
class TT>
inline
117 {
set( from,
to, sz0, sz1, fromhasudfs, rectinfrom ); }
120 #define mUpdateResampler \
122 func_.set( from, fromhasudfs ); \
123 updateScale( rectinfromptr )
125 template <
class T,
class TT>
inline
132 toptr_ =
to.getData();
136 else if (
to.getStorage() )
140 tovs_ =
to.getStorage();
155 template <
class T,
class TT>
inline
157 int sz0,
int sz1,
bool fromhasudfs,
164 toinfo_.setSize(
mXDim, sz0 );
165 toinfo_.setSize(
mYDim, sz1 );
171 template <
class T,
class TT>
inline
173 int sz0,
int sz1,
bool fromhasudfs,
189 toinfo_.setSize(
mXDim, sz0 );
190 toinfo_.setSize(
mYDim, sz1 );
195 template <
class T,
class TT>
inline
199 const int xsize = toinfo_.getSize(
mXDim );
200 const int ysize = toinfo_.getSize(
mYDim );
204 mCast(
float,from_->info().getSize(
mYDim)-1) );
210 if ( rectinfrom.
contains( nrect, 1e-3 ) )
214 xsampling_.start = rectinfrom.
left();
215 xsampling_.step = rectinfrom.
width()/(xsize-1);
217 ysampling_.start = rectinfrom.
left();
218 ysampling_.step = rectinfrom.
height()/(ysize-1);
222 template <
class T,
class TT>
inline
225 return toinfo_.getSize(
mXDim );
230 template <
class T,
class TT>
inline
233 const int ysize = toinfo_.getSize(
mYDim );
236 TT* toptr = toptr_ ? toptr_+offset : 0;
237 for (
int idx=
mCast(
int,start); idx<=stop; idx++ )
239 const float sourcex = xsampling_.atIndex( idx );
240 for (
int idy=0; idy<ysize; idy++ )
242 const float sourcey = ysampling_.atIndex( idy );
244 const TT val = interpolate_
245 ? func_.getValue( sourcex, sourcey )
253 tovs_->setValue( offset++, val );
255 to_->set( idx, idy , val );
260 if ( localnrdone>100 )
262 addToNrDone( localnrdone );
267 addToNrDone( localnrdone );
274 #undef mUpdateResampler
bool doWork(od_int64, od_int64, int)
Definition: array2dresample.h:231
void sortCorners(bool leftislow=true, bool topislow=true)
Definition: geometry.h:633
Array2D< TT > * to_
Definition: array2dresample.h:82
T to(const F &fr)
Definition: convert.h:34
#define od_int64
Definition: plftypes.h:35
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: array2dresample.h:78
SamplingData< float > xsampling_
Definition: array2dresample.h:87
Array2DInfoImpl toinfo_
Definition: array2dresample.h:83
bool interpolate_
Definition: array2dresample.h:89
od_int64 nrIterations() const
Definition: array2dresample.h:223
const Array2D< T > * from_
Definition: array2dresample.h:81
#define mODTextTranslationClass(clss)
Definition: uistring.h:40
SamplingData< float > ysampling_
Definition: array2dresample.h:88
Fills an Array2D from another Array2D of another size. Usage:
Definition: array2dresample.h:30
T left() const
Definition: geometry.h:583
Floating-point rectangle class.
Definition: geometry.h:230
#define mClass(module)
Definition: commondefs.h:181
Array2DFunc< TT, float, T > func_
Definition: array2dresample.h:86
#define mXDim
Definition: array2dresample.h:92
#define mYDim
Definition: array2dresample.h:93
ValueSeries< TT > * tovs_
Definition: array2dresample.h:85
bool contains(const Point2D< T > &p, T eps) const
Definition: geometry.h:242
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:27
void updateScale(const Geom::PosRectangle< float > *)
Definition: array2dresample.h:196
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mCast(tp, v)
Definition: commondefs.h:137
T width() const
Definition: geometry.h:573
Implementation of Array2DInfo.
Definition: arrayndinfo.h:212
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
#define mUpdateResampler
Definition: array2dresample.h:120
void set(const Array2D< T > &from, Array2D< TT > &to, bool fromhasudfs, const Geom::PosRectangle< float > *rectinfrom=0)
Definition: array2dresample.h:126
T height() const
Definition: geometry.h:578
mODTextTranslationClass(Array2DReSampler) public Array2DReSampler(const Array2D< T > &from, TT *to, int sz0, int sz1, bool fromhasudfs, const Geom::PosRectangle< float > *rectinfrom=0)
Definition: array2dresample.h:105
void setInterpolate(bool yn)
Definition: array2dresample.h:73
#define mNINT32(x)
Definition: commondefs.h:58
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:140
TT * toptr_
Definition: array2dresample.h:84
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021