 |
OpendTect
6.6
|
Go to the documentation of this file.
14 #define mInsertStart( idxvar, type, nrfunc ) \
15 int idxvar = type##Index(type); \
16 if ( idxvar<-nrtoinsert || idxvar>nrfunc-1+nrtoinsert ) \
18 errmsg() = toUiString( \
19 "Cannot insert row or column that is not connected to existing rows."); \
22 const bool addedinfront = idxvar<0; \
26 origin_.type() -= step_.type()*nrtoinsert; \
29 const int curnrrows = nrRows(); \
30 const int curnrcols = nrCols()
33 #define mReplaceVariable( variable ) \
34 if ( new##variable ) \
37 variable = new##variable; \
41 #define mCloneRowVariable( type, variable, interpolfunc, udf ) \
42 Array2D<type>* new##variable = variable \
43 ? new Array2DImpl<type>(curnrrows+nrtoinsert,curnrcols) : 0; \
44 for ( int idx=0; new##variable && idx<curnrrows+nrtoinsert; idx++ ) \
46 for ( int idy=0; idy<curnrcols; idy++ ) \
48 if ( idx>=rowidx && idx<rowidx+nrtoinsert ) \
50 if ( idx>=curnrrows || idx<nrtoinsert ) \
51 new##variable->set(idx,idy, udf ); \
54 const float relrow = origin_.row() + \
55 ((float) idx-rowidx)/(nrtoinsert+1)*step_.row(); \
56 const Coord param( relrow, origin_.col()+idy*step_.col() ); \
57 new##variable->set(idx,idy,(type) interpolfunc); \
62 const int sourcerow = idx>rowidx ? idx-nrtoinsert : idx; \
63 new##variable->set(idx,idy,variable->get(sourcerow,idy)); \
67 mReplaceVariable( variable )
72 #define mCloneColVariable( type, variable, interpolfunc, udf ) \
73 Array2D<type>* new##variable = variable \
74 ? new Array2DImpl<type>(curnrrows,curnrcols+nrtoinsert) : 0; \
75 for ( int idx=0; new##variable && idx<curnrrows; idx++ ) \
77 for ( int idy=0; idy<curnrcols+nrtoinsert; idy++ ) \
79 if ( idy>=colidx && idy<colidx+nrtoinsert ) \
81 if ( idy>=curnrcols || idy<nrtoinsert ) \
82 new##variable->set(idx,idy, udf ); \
85 const float relcol = origin_.col() + \
86 ((float) idy-colidx)/(nrtoinsert+1)*step_.col(); \
87 const Coord param( origin_.row()+idx*step_.row(), relcol ); \
88 new##variable->set(idx,idy,(type) interpolfunc); \
93 const int sourcecol = idy>colidx ? idy-nrtoinsert : idy; \
94 new##variable->set(idx,idy,variable->get(idx,sourcecol)); \
98 mReplaceVariable( variable )
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021