158 |
vector<CoordSys *> cs; |
vector<CoordSys *> cs; |
159 |
vector<float> params; |
vector<float> params; |
160 |
|
|
161 |
|
int maxcs; |
162 |
|
|
163 |
int nparams(int typecode) ; |
int nparams(int typecode) ; |
164 |
int nprevious(int typecode) ; |
int nprevious(int typecode) ; |
165 |
CoordSys *create(int typecode) ; |
CoordSys *create(int typecode) ; |
174 |
} |
} |
175 |
} |
} |
176 |
} |
} |
177 |
|
class iterator { |
178 |
|
int ind; |
179 |
|
CoordSet *parent; |
180 |
|
|
181 |
|
void incr() { |
182 |
|
ind++; |
183 |
|
while(parent->get(ind) == 0 && ind < parent->maxcs) |
184 |
|
ind++; |
185 |
|
} |
186 |
|
public: |
187 |
|
iterator(int ind, CoordSet *parent) : ind(ind), parent(parent) { } |
188 |
|
int operator*() { |
189 |
|
return ind; |
190 |
|
} |
191 |
|
iterator& operator++() { |
192 |
|
incr(); |
193 |
|
return *this; |
194 |
|
} |
195 |
|
iterator operator++(int) { |
196 |
|
iterator tmp = *this; |
197 |
|
incr(); |
198 |
|
return tmp; |
199 |
|
} |
200 |
|
bool operator==(const iterator &it) const { return ind == it.ind; } |
201 |
|
bool operator!=(const iterator &it) const { return ind != it.ind; } |
202 |
|
|
203 |
|
}; |
204 |
|
/** Return an iterator pointing to the first coordinate system |
205 |
|
* (not root, i.e. not 0). |
206 |
|
*/ |
207 |
|
iterator begin(); |
208 |
|
/** Return an iterator pointing one past the last coordinate system. |
209 |
|
*/ |
210 |
|
iterator end(); |
211 |
/** Set the coordinate systems. |
/** Set the coordinate systems. |
212 |
* @param points1 floats: the parameters of the coordinate |
* @param points1 floats: the parameters of the coordinate |
213 |
* systems. |
* systems. |