/[gzz]/gzz/gfx/libcoords/Coords.hxx
ViewVC logotype

Diff of /gzz/gfx/libcoords/Coords.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by tjl, Tue Oct 29 14:09:32 2002 UTC revision 1.21 by tjl, Tue Oct 29 19:55:36 2002 UTC
# Line 158  namespace Coords { Line 158  namespace Coords {
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) ;
# Line 172  namespace Coords { Line 174  namespace Coords {
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.

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26