38 #include <dime/Basic.h>
58 #ifdef _MSC_VER // Microsoft Visual C++
59 #pragma warning(disable:4251)
60 #pragma warning(disable:4275)
71 void append(
const T &value);
74 void insertElem(
const int idx,
const T &value);
75 void setElem(
const int index,
const T &value);
76 T getElem(
const int index)
const;
77 void getElem(
const int index, T &elem)
const;
78 T getLastElem()
const;
79 void getLastElem(T &elem)
const;
80 T &operator [](
const int index);
81 T operator [](
const int index)
const;
102 template <
class T>
inline
105 this->array =
new T[size];
110 template <
class T>
inline
113 delete [] this->array;
116 template <
class T>
inline void
119 int oldsize = this->size;
120 T *oldarray = this->array;
122 this->array =
new T[this->size];
123 for (
int i = 0; i < oldsize; i++) this->array[i] = oldarray[i];
127 template <
class T>
inline void
130 if (this->num >= this->size) growArray();
131 this->array[this->num++] = elem;
135 template <
class T>
inline void
138 while (this->size <= this->num+array.
count()) growArray();
139 for (
int i=0;i<array.
count();i++)
140 this->array[this->num++] = array[i];
143 template <
class T>
inline void
146 int newsize=this->num+array.
count();
148 if (this->size<=newsize) {
149 T *oldarray=this->array;
150 this->array=
new T[newsize];
152 for (i=0;i<array.
count(); i++) this->array[i] = array[i];
153 for (i=0;i<this->num;i++) this->array[i+array.
count()] = oldarray[i];
157 for (i=0;i<this->num;i++) this->array[array.
count()+i]=this->array[i];
158 for (i=0;i<array.
count();i++) this->array[i] = array[i];
160 this->num+=array.
count();
163 template <
class T>
inline void
169 for (
int i = n; i > idx; i--) {
170 this->array[i] = this->array[i-1];
172 this->array[idx] = elem;
176 template <
class T>
inline void
179 while (index >= this->size) growArray();
180 if (this->num <= index) this->num = index+1;
181 this->array[index] = elem;
184 template <
class T>
inline T
187 return this->array[index];
190 template <
class T>
inline void
193 elem = this->array[index];
196 template <
class T>
inline T
199 return this->array[this->num-1];
202 template <
class T>
inline void
205 elem = this->array[this->num-1];
208 template <
class T>
inline T &
211 while (index >= this->size) growArray();
212 if (this->num <= index) this->num = index + 1;
213 return this->array[index];
216 template <
class T>
inline T
219 return this->array[index];
222 template <
class T>
inline void
225 if (this->num <= 0 || index >= this->num)
return;
226 for (
int i = index; i < this->num-1; i++)
227 this->array[i] = this->array[i+1];
231 template <
class T>
inline void
234 this->array[index] = this->array[--this->num];
237 template <
class T>
inline void
241 for (
int i=0;i<this->num/2;i++) {
243 this->array[i]=this->array[this->num-1-i];
244 this->array[this->num-1-i]=tmp;
248 template <
class T>
inline void
251 if (count < this->num)
255 template <
class T>
inline int
261 template <
class T>
inline int
267 template <
class T>
inline T *
273 template <
class T>
inline const T *
279 template <
class T>
inline void
282 delete [] this->array;
283 this->array =
new T[initsize];
284 this->size = initsize;
288 template <
class T>
inline void
291 delete [] this->array;
297 template <
class T>
inline void
300 T *oldarray = this->array;
301 this->array =
new T[this->num];
302 for (
int i = 0; i < this->num; i++) this->array[i] = oldarray[i];
303 this->size = this->num;
307 #endif // ! DIME_ARRAY_H
The dimeEntity class is the superclass of all entity classes.
Definition: Entity.h:60
void freeMemory()
Definition: Array.h:289
The dimeArray class is internal / private.
Definition: Array.h:65
dxfdouble getThickness() const
Definition: ExtrusionEntity.h:91
const dimeVec3f & getExtrusionDir() const
Definition: ExtrusionEntity.h:79
int getNumSub() const
Definition: convert.h:63
void addLine(const dimeVec3f &v0, const dimeVec3f &v1, const dimeMatrix *const matrix=NULL)
Definition: layerdata.cpp:77
The dxfLayerData class handles all geometry for a given color index. DXF geometry is grouped into dif...
Definition: layerdata.h:41
int allocSize() const
Definition: Array.h:262
The dimeArc class handles an ARC entity.
Definition: Arc.h:40
void removeElemFast(const int index)
Definition: Array.h:232
The dimeMatrix class is for containing and operating on a four-by-four matrix.
Definition: Linear.h:158
The dimeState class manages various state variables while the model is traversed.
Definition: State.h:40
const T * constArrayPointer() const
Definition: Array.h:274
static void generateUCS(const dimeVec3f &givenaxis, dimeMatrix &m)
Definition: Entity.cpp:513
The dxfConverter class offers a simple interface for dxf converting. It makes it possible to extract ...
Definition: convert.h:44
void removeElem(const int index)
Definition: Array.h:223
The dimeParam class is a union of the different parameter types.
Definition: Basic.h:102
T * arrayPointer()
Definition: Array.h:268
int count() const
Definition: Array.h:256
virtual bool getRecord(const int groupcode, dimeParam ¶m, const int index=0) const
Definition: Arc.cpp:174
dxfdouble getMaxerr() const
Definition: convert.h:66
The dimeVec3f class is for containing and operating on a 3D vector / coordinate.
Definition: Linear.h:61
void setCount(const int count)
Definition: Array.h:249
void addQuad(const dimeVec3f &v0, const dimeVec3f &v1, const dimeVec3f &v2, const dimeVec3f &v3, const dimeMatrix *const matrix=NULL)
Definition: layerdata.cpp:165
void shrinkToFit()
Definition: Array.h:298
void makeEmpty(const int initsize=4)
Definition: Array.h:280
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Tue Mar 24 2020 14:02:59 for Dime by Doxygen 1.8.17.