+ struct SideIterator // iterator on UVPtStruct of a Side
+ {
+ const UVPtStruct *uvPtr, *uvEnd;
+ int dPtr, counter;
+ SideIterator(): uvPtr(0), uvEnd(0), dPtr(0), counter(0) {}
+ void Init( const Side& side ) {
+ dPtr = counter = 0;
+ uvPtr = uvEnd = 0;
+ if ( side.NbPoints() > 0 ) {
+ uvPtr = & side.First();
+ uvEnd = & side.Last();
+ dPtr = ( uvEnd > uvPtr ) ? +1 : -1;
+ uvEnd += dPtr;
+ }
+ }
+ bool More() const { return uvPtr != uvEnd; }
+ void Next() { uvPtr += dPtr; ++counter; }
+ UVPtStruct& UVPt() const { return (UVPtStruct&) *uvPtr; }
+ UVPtStruct& operator[](int i) { return (UVPtStruct&) uvPtr[ i*dPtr]; }
+ int Count() const { return counter; }
+ };