Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

PointTexCoordComparator Class Reference

List of all members.

Public Member Functions

bool operator() (const Vertex &a, const Vertex &b) const
 PointTexCoordComparator (uint32 _posOffset, uint32 _texCoordOffset, bool _wrap)

Private Attributes

uint32 posOffset
uint32 texCoordOffset
bool wrap

Constructor & Destructor Documentation

PointTexCoordComparator::PointTexCoordComparator uint32  _posOffset,
uint32  _texCoordOffset,
bool  _wrap
[inline]
 

Definition at line 150 of file cmodfix.cpp.

References posOffset, texCoordOffset, and wrap.

00152                                         :
00153         posOffset(_posOffset),
00154         texCoordOffset(_texCoordOffset),
00155         wrap(_wrap)
00156     {
00157     }


Member Function Documentation

bool PointTexCoordComparator::operator() const Vertex a,
const Vertex b
const [inline]
 

Definition at line 159 of file cmodfix.cpp.

References posOffset, Point2< T >::x, Point3< T >::x, Point2< T >::y, Point3< T >::y, and Point3< T >::z.

00160     {
00161         const char* adata = reinterpret_cast<const char*>(a.attributes);
00162         const char* bdata = reinterpret_cast<const char*>(b.attributes);
00163         const Point3f* p0 = reinterpret_cast<const Point3f*>(adata + posOffset);
00164         const Point3f* p1 = reinterpret_cast<const Point3f*>(bdata + posOffset);
00165         const Point2f* tc0 = reinterpret_cast<const Point2f*>(adata + posOffset);
00166         const Point2f* tc1 = reinterpret_cast<const Point2f*>(bdata + posOffset);
00167         if (p0->x < p1->x)
00168         {
00169             return true;
00170         }
00171         else if (p0->x > p1->x)
00172         {
00173             return false;
00174         }
00175         else
00176         {
00177             if (p0->y < p1->y)
00178             {
00179                 return true;
00180             }
00181             else if (p0->y > p1->y)
00182             {
00183                 return false;
00184             }
00185             else
00186             {
00187                 if (p0->z < p1->z)
00188                 {
00189                     return true;
00190                 }
00191                 else if (p0->z > p1->z)
00192                 {
00193                     return false;
00194                 }
00195                 else
00196                 {
00197                     if (tc0->x < tc1->x)
00198                         return true;
00199                     else if (tc0->x > tc1->x)
00200                         return false;
00201                     else
00202                         return tc0->y < tc1->y;
00203                 }
00204             }
00205         }
00206     }


Member Data Documentation

uint32 PointTexCoordComparator::posOffset [private]
 

Definition at line 209 of file cmodfix.cpp.

Referenced by operator()(), and PointTexCoordComparator().

uint32 PointTexCoordComparator::texCoordOffset [private]
 

Definition at line 210 of file cmodfix.cpp.

Referenced by PointTexCoordComparator().

bool PointTexCoordComparator::wrap [private]
 

Definition at line 211 of file cmodfix.cpp.

Referenced by PointTexCoordComparator().


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:31 2006 for Celestia by  doxygen 1.4.1