27 virtual od_int64 getStorageSize()
const = 0;
32 bool storageOK()
const;
33 bool updateStorageSize();
60 { copyFrom(ai);
return *
this; }
62 { copyFrom(ai);
return *
this; }
67 bool isOK()
const {
return base::storageOK(); }
70 {
return base::setStorageInternal(vs); }
81 {
return setSize( ((
int)sz) ); }
84 T*
arr() {
return base::ptr_; }
85 const T*
arr()
const {
return base::ptr_; }
88 const T*
getData_()
const {
return base::ptr_; }
112 { copyFrom(ai);
return *
this; }
114 { copyFrom(ai);
return *
this; }
116 bool isOK()
const {
return base::storageOK(); }
121 T
get(int,int)
const;
128 bool setSize(
int,
int);
131 const T**
get2DData()
const {
return (
const T**) ptr2d_; }
134 void updateStorage();
139 void updateCachePointers();
160 { copyFrom(ai);
return *
this; }
162 { copyFrom(ai);
return *
this; }
164 bool isOK()
const {
return base::storageOK(); }
168 void set(int,int,int,T);
169 T
get(int,int,int)
const;
175 bool setSize(
int,
int,
int);
178 const T***
get3DData()
const {
return (
const T***) ptr3d_; }
181 void updateStorage();
186 void updateCachePointers();
212 { copyFrom(ai);
return *
this; }
214 { copyFrom(ai);
return *
this; }
217 bool isOK()
const {
return base::storageOK(); }
220 {
return base::setStorageInternal(vs); }
222 void setND(
const int*,T);
223 T getND(
const int*)
const;
230 bool setSize(
const int*);
243 template <
class T>
inline 250 template <
class T>
inline 264 template <
class T>
inline 278 template <
class T>
inline 300 template <
class T>
inline 305 template <
class T>
inline 325 pErrMsg(
"Cannot store in array without storage" );
333 template <
class T>
inline 341 template <
class T>
inline 350 template <
class T>
inline 359 template <
class T>
inline 371 template <
class T>
inline 382 template <
class T>
inline 392 template <
class T>
inline 395 if ( ni.
getNDim() != 1 )
return false;
400 template <
class T>
inline 409 template <
class T>
inline 418 template <
class T>
inline 427 template <
class T>
inline 437 template <
class T>
inline 447 template <
class T>
inline 469 template <
class T>
inline 488 template <
class T>
inline 497 template <
class T>
inline 507 template <
class T>
inline 510 if ( ni.
getNDim() != 2 )
return false;
515 template <
class T>
inline 524 template <
class T>
inline 532 template <
class T>
inline 547 for (
int idx=0; idx<n1; idx++, offset+=n2 )
552 template <
class T>
inline 561 template <
class T>
inline 570 template <
class T>
inline 580 template <
class T>
inline 590 template <
class T>
inline 609 template <
class T>
inline 617 return ptr3d_[p0][p1][p2];
624 template <
class T>
inline 634 template <
class T>
inline 642 template <
class T>
inline 645 if ( ni.
getNDim() != 3 )
return false;
650 template <
class T>
inline 659 template <
class T>
inline 667 template <
class T>
inline 680 template <
class T>
inline 692 for (
int idx=0; idx<n1; idx++ )
698 for (
int idy=0; idy<n2; idy++, offset+=n3 )
708 template <
class T>
inline 716 template <
class T>
inline 725 template <
class T>
inline 738 template <
class T>
inline 751 template <
class T>
inline 764 template <
class T>
inline 776 template <
class T>
inline 784 for (
int idx=0; idx<ndim; idx++ )
791 template <
class T>
inline 795 for (
int idx=0; idx<ndim; idx++ )
803 template <
class T>
inline 817 template <
class T>
inline 825 {
delete out;
return 0; }
827 const bool success =
clone( oth, *out );
829 {
delete out;
return 0; }
835 template <
class T>
inline 859 if ( inp1d && out1d )
860 { *out1d = *inp1d;
return true; }
866 if ( inp2d && out2d )
867 { *out2d = *inp2d;
return true; }
873 if ( inp3d && out3d )
874 { *out3d = *inp3d;
return true; }
879 if ( inpnd && outnd )
895 const int* pos = iter.
getPos();
897 }
while ( iter.next() );
Array1D ( Subclass of ArrayND ) is a one dimensional array.
Definition: arraynd.h:101
void copyFrom(const ArrayND< T > &)
Definition: arrayndimpl.h:739
virtual bool validPos(int, int, int) const
virtual uint64_t getTotalSz() const
virtual int getNDim() const =0
static ArrayND< T > * create(const ArrayNDInfo &nsz)
Definition: arrayndimpl.h:804
virtual bool setSize(int dim, int nsz)
T * ptr_
Definition: arrayndimpl.h:42
Array1DImpl(int sz)
Definition: arrayndimpl.h:334
T ** ptr2d_
Definition: arrayndimpl.h:142
#define mDeclareAndTryAlloc(tp, var, stmt)
Creates variable, try to alloc and catch bad_alloc.
Definition: commondefs.h:248
const Array2DInfo & info() const
Definition: arrayndimpl.h:124
bool isOK() const
Definition: arrayndimpl.h:67
virtual uint64_t getOffset(int, int) const
bool isOK() const
Definition: arrayndimpl.h:164
Valueseries that allocates its data in smaller chunks. By doing this, it performs better in environme...
Definition: valseries.h:164
bool setStorage(ValueSeries< T > *vs)
Definition: arrayndimpl.h:69
void updateCachePointers()
Definition: arrayndimpl.h:533
const ValueSeries< T > * getStorage_() const
Definition: arrayndimpl.h:89
virtual int64_t getStorageSize() const =0
virtual bool validPos(const int *) const
Contains the information about the size of Array3D, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:118
ArrayNDImpl(const ArrayNDInfo &)
Definition: arrayndimpl.h:709
virtual bool setSize(int dim, int sz)
const ValueSeries< T > * getStorage() const
Definition: arraynd.h:46
#define od_int64
Definition: plftypes.h:36
const T * getData_() const
Definition: arrayndimpl.h:182
~ArrayImplBase()
Definition: arrayndimpl.h:30
const ArrayNDInfo & info() const
Definition: arrayndimpl.h:225
void updateCachePointers()
Definition: arrayndimpl.h:681
T * arr()
Definition: arrayndimpl.h:84
T ** get2DData()
Definition: arrayndimpl.h:130
Implementation of Array2D.
Definition: arrayndimpl.h:102
const Array3DInfo & info() const
Definition: arrayndimpl.h:172
const T * getData_() const
Definition: arrayndimpl.h:135
Contains the information about the size of ArrayND, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:23
Contains the information about the size of Array1D, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:71
virtual int getSize(int dim) const
Definition: arrayndinfo.h:258
bool updateStorageSize()
Definition: arrayndimpl.h:279
T get(int, int) const
Definition: arrayndimpl.h:470
bool getDataFrom(const ArrayND< T > &templ)
Definition: arrayndimpl.h:306
bool canChangeNrDims() const
Definition: arrayndimpl.h:227
virtual bool setSize(int64_t)
Definition: valseries.h:53
virtual bool validPos(int, int) const
virtual void setND(const int *, T)=0
void set(int pos, T)
Definition: arrayndimpl.h:360
void updateStorage()
Definition: arrayndimpl.h:660
bool setSize(int, int, int)
Definition: arrayndimpl.h:651
Array3DInfoImpl in_
Definition: arrayndimpl.h:191
void deleteAndZeroArrPtr(T *&ptr, bool isowner=true)
Definition: ptrman.h:37
static ArrayND< T > * clone(const ArrayND< T > &)
Definition: arrayndimpl.h:818
virtual T * arr()
3rd party access
Definition: typeset.h:92
virtual int getSize(int dim) const =0
Array2DImpl(int sz0, int sz1)
Definition: arrayndimpl.h:410
const T * getData() const
Definition: arraynd.h:55
virtual T getND(const int *) const =0
const T * arr() const
Definition: arrayndimpl.h:85
virtual const Array3DInfo & info() const =0
bool canSetInfo() const
Definition: arrayndimpl.h:173
Array3DImpl(int sz0, int sz1, int sz2)
Definition: arrayndimpl.h:553
const ValueSeries< T > * getStorage_() const
Definition: arrayndimpl.h:136
virtual uint64_t getOffset(int, int, int) const
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
bool setInfo(const ArrayNDInfo &)
Definition: arrayndimpl.h:777
bool setStorage(ValueSeries< T > *vs)
Definition: arrayndimpl.h:489
bool setSize(int)
Definition: arrayndimpl.h:401
void eraseCache()
Definition: arrayndimpl.h:668
TypeSet< T ** > cachestor_
Definition: arrayndimpl.h:189
int64_t getStorageSize() const
Definition: arrayndimpl.h:90
T *** get3DData()
Definition: arrayndimpl.h:177
bool setInfo(const ArrayNDInfo &)
Definition: arrayndimpl.h:508
Implementation of Array3DInfo.
Definition: arrayndinfo.h:193
Interface to a series of values.
Definition: odmemory.h:17
bool setStorageNoResize(ValueSeries< T > *)
Definition: arrayndimpl.h:251
#define mTryAlloc(var, stmt)
Catches bad_alloc and sets ptr to null as normal.
Definition: commondefs.h:241
void copyFrom(const Array3D< T > &)
Definition: arrayndimpl.h:625
bool storageOK() const
Definition: arrayndimpl.h:301
const T *** get3DData() const
Definition: arrayndimpl.h:178
int64_t getStorageSize() const
Definition: arrayndimpl.h:237
virtual bool validPos(int pos) const
Definition: arrayndinfo.h:79
bool setSize(const int *)
Definition: arrayndimpl.h:792
Definition: arrayndimpl.h:24
Contains the information about the size of Array2D, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:95
Implementation of ArrayND.
Definition: arrayndimpl.h:200
void updateStorage()
Definition: arrayndimpl.h:525
const T * getData_() const
Definition: arrayndimpl.h:88
virtual ArrayNDInfo * clone() const =0
virtual uint64_t getOffset(const int *) const
#define mDynamicCastGet(typ, out, in)
Definition: commondefs.h:131
bool canSetInfo() const
Definition: arrayndimpl.h:125
ArrayImplBase< T > base
Definition: arrayndimpl.h:53
#define od_uint64
Definition: plftypes.h:37
ArrayImplBase< T > base
Definition: arrayndimpl.h:152
An ArrayND is an array with a given number of dimensions and a size.
Definition: arraynd.h:33
bool canSetStorage() const
Definition: arrayndimpl.h:117
Iterates through all samples in an ArrayND.
Definition: arraynd.h:179
bool setInfo(const ArrayNDInfo &)
Definition: arrayndimpl.h:643
ValueSeries< T > * clone() const
Definition: arrayndimpl.h:64
const T ** get2DData() const
Definition: arrayndimpl.h:131
virtual bool setSize(int dim, int nsz)
size_type size() const
Definition: typeset.h:254
const ValueSeries< T > * getStorage_() const
Definition: arrayndimpl.h:236
T *** ptr3d_
Definition: arrayndimpl.h:190
bool setSize(int64_t sz)
Definition: arrayndimpl.h:80
ValueSeries< T > * stor_
Definition: arrayndimpl.h:41
static uiHor3DInterpol * create(uiParent *)
void copyFrom(const Array2D< T > &)
Definition: arrayndimpl.h:498
virtual bool setInfo(const ArrayNDInfo &)
Definition: arraynd.h:68
virtual const Array1DInfo & info() const =0
Array2DInfoImpl in_
Definition: arrayndimpl.h:141
bool isOK() const
Definition: arrayndimpl.h:217
void copyFrom(const Array1D< T > &)
Definition: arrayndimpl.h:383
Implementation of Array1DInfo.
Definition: arrayndinfo.h:140
bool setStorage(ValueSeries< T > *vs)
Definition: arrayndimpl.h:219
const int * getPos() const
Definition: arraynd.h:191
virtual bool setSize(int dim, int nsz)
void forceCrash(bool withdump)
bool setSize(int, int)
Definition: arrayndimpl.h:516
Implementation of Array3D.
Definition: arrayndimpl.h:151
Implementation of Array2DInfo.
Definition: arrayndinfo.h:166
bool canSetInfo() const
Definition: arrayndimpl.h:77
virtual void erase()
Definition: typeset.h:339
const ValueSeries< T > * getStorage_() const
Definition: arrayndimpl.h:183
bool canSetStorage() const
Definition: arrayndimpl.h:71
const T * getData_() const
Definition: arrayndimpl.h:235
bool canSetStorage() const
Definition: arrayndimpl.h:218
void set(int, int, T)
Definition: arrayndimpl.h:448
Array1DInfoImpl in_
Definition: arrayndimpl.h:92
~Array3DImpl()
Definition: arrayndimpl.h:158
virtual const ArrayNDInfo & info() const =0
int64_t getStorageSize() const
Definition: arrayndimpl.h:137
virtual int getSize(int dim) const
Definition: arrayndinfo.h:252
virtual bool isOK() const
Definition: arraynd.h:327
bool setInfo(const ArrayNDInfo &)
Definition: arrayndimpl.h:393
Implementation of Array1D.
Definition: arrayndimpl.h:52
#define mClass(module)
Definition: commondefs.h:164
virtual const Array2DInfo & info() const =0
#define pErrMsg(msg)
Definition: errmsg.h:60
T get(int, int, int) const
Definition: arrayndimpl.h:610
bool canSetInfo() const
Definition: arrayndimpl.h:226
const Array1DInfo & info() const
Definition: arrayndimpl.h:76
virtual void getAll(T *ptr) const
Definition: arraynd.h:507
ArrayImplBase< T > base
Definition: arrayndimpl.h:201
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
ArrayImplBase< T > base
Definition: arrayndimpl.h:103
void set(int, int, int, T)
Definition: arrayndimpl.h:591
~Array2DImpl()
Definition: arrayndimpl.h:109
bool isOK() const
Definition: arrayndimpl.h:116
T getND(const int *) const
Definition: arrayndimpl.h:765
int64_t getStorageSize() const
Definition: arrayndimpl.h:184
ArrayNDInfo * in_
Definition: arrayndimpl.h:239
bool setStorageInternal(ValueSeries< T > *)
Definition: arrayndimpl.h:265
void setND(const int *, T)
Definition: arrayndimpl.h:752
T get(int pos) const
Definition: arrayndimpl.h:372
bool setStorage(ValueSeries< T > *vs)
Definition: arrayndimpl.h:635
~ArrayNDImpl()
Definition: arrayndimpl.h:734
bool canSetStorage() const
Definition: arrayndimpl.h:165
ArrayImplBase()
Definition: arrayndimpl.h:244