|
OpendTect-6_4
6.4
|
Go to the documentation of this file. 1 #ifndef parametricsurfaceimpl_h 2 #define parametricsurfaceimpl_h 15 #define mInsertStart( idxvar, type, nrfunc ) \ 16 int idxvar = type##Index(type); \ 17 if ( idxvar<-nrtoinsert || idxvar>nrfunc-1+nrtoinsert ) \ 19 errmsg() = toUiString( \ 20 "Cannot insert row or column that is not connected to existing rows."); \ 23 const bool addedinfront = idxvar<0; \ 27 origin_.type() -= step_.type()*nrtoinsert; \ 30 const int curnrrows = nrRows(); \ 31 const int curnrcols = nrCols() 34 #define mReplaceVariable( variable ) \ 35 if ( new##variable ) \ 38 variable = new##variable; \ 42 #define mCloneRowVariable( type, variable, interpolfunc, udf ) \ 43 Array2D<type>* new##variable = variable \ 44 ? new Array2DImpl<type>(curnrrows+nrtoinsert,curnrcols) : 0; \ 45 for ( int idx=0; new##variable && idx<curnrrows+nrtoinsert; idx++ ) \ 47 for ( int idy=0; idy<curnrcols; idy++ ) \ 49 if ( idx>=rowidx && idx<rowidx+nrtoinsert ) \ 51 if ( idx>=curnrrows || idx<nrtoinsert ) \ 52 new##variable->set(idx,idy, udf ); \ 55 const float relrow = origin_.row() + \ 56 ((float) idx-rowidx)/(nrtoinsert+1)*step_.row(); \ 57 const Coord param( relrow, origin_.col()+idy*step_.col() ); \ 58 new##variable->set(idx,idy,(type) interpolfunc); \ 63 const int sourcerow = idx>rowidx ? idx-nrtoinsert : idx; \ 64 new##variable->set(idx,idy,variable->get(sourcerow,idy)); \ 68 mReplaceVariable( variable ) 73 #define mCloneColVariable( type, variable, interpolfunc, udf ) \ 74 Array2D<type>* new##variable = variable \ 75 ? new Array2DImpl<type>(curnrrows,curnrcols+nrtoinsert) : 0; \ 76 for ( int idx=0; new##variable && idx<curnrrows; idx++ ) \ 78 for ( int idy=0; idy<curnrcols+nrtoinsert; idy++ ) \ 80 if ( idy>=colidx && idy<colidx+nrtoinsert ) \ 82 if ( idy>=curnrcols || idy<nrtoinsert ) \ 83 new##variable->set(idx,idy, udf ); \ 86 const float relcol = origin_.col() + \ 87 ((float) idy-colidx)/(nrtoinsert+1)*step_.col(); \ 88 const Coord param( origin_.row()+idx*step_.row(), relcol ); \ 89 new##variable->set(idx,idy,(type) interpolfunc); \ 94 const int sourcecol = idy>colidx ? idy-nrtoinsert : idy; \ 95 new##variable->set(idx,idy,variable->get(idx,sourcecol)); \ 99 mReplaceVariable( variable )
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B. V. 2019