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

BrighterStarPredicate Struct Reference

Collaboration diagram for BrighterStarPredicate:

Collaboration graph
List of all members.

Public Member Functions

bool operator() (const Star *star0, const Star *star1) const
bool operator() (const Star *star0, const Star *star1) const

Public Attributes

Point3f pos
UniversalCoord ucPos

Member Function Documentation

bool BrighterStarPredicate::operator() const Star star0,
const Star star1
const [inline]
 

Definition at line 104 of file winstarbrowser.cpp.

References Point3< T >::distanceTo(), pos, toMicroLY(), and ucPos.

00105     {
00106         float d0 = pos.distanceTo(star0->getPosition());
00107         float d1 = pos.distanceTo(star1->getPosition());
00108 
00109         // If the stars are closer than one light year, use
00110         // a more precise distance estimate.
00111         if (d0 < 1.0f)
00112             d0 = (toMicroLY(star0->getPosition()) - ucPos).length() * 1e-6f;
00113         if (d1 < 1.0f)
00114             d1 = (toMicroLY(star1->getPosition()) - ucPos).length() * 1e-6f;
00115 
00116         return (star0->getApparentMagnitude(d0) <
00117                 star1->getApparentMagnitude(d1));
00118     }

bool BrighterStarPredicate::operator() const Star star0,
const Star star1
const [inline]
 

Definition at line 42 of file starbrowser.cpp.

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

00043     {
00044         Point3f p0 = star0->getPosition();
00045         Point3f p1 = star1->getPosition();
00046         Vec3f v0(p0.x * 1e6 - pos.x, p0.y * 1e6 - pos.y, p0.z * 1e6 - pos.z);
00047         Vec3f v1(p1.x * 1e6 - pos.x, p1.y * 1e6 - pos.y, p1.z * 1e6 - pos.z);
00048         float d0 = v0.length();
00049         float d1 = v1.length();
00050 
00051         return (star0->getApparentMagnitude(d0) <
00052                 star1->getApparentMagnitude(d1));
00053     }


Member Data Documentation

Point3f BrighterStarPredicate::pos
 

Definition at line 102 of file winstarbrowser.cpp.

Referenced by InitStarBrowserItems(), StarBrowser::listStars(), and operator()().

UniversalCoord BrighterStarPredicate::ucPos
 

Definition at line 103 of file winstarbrowser.cpp.

Referenced by InitStarBrowserItems(), StarBrowser::listStars(), and operator()().


The documentation for this struct was generated from the following files:
Generated on Sat Jan 14 22:33:07 2006 for Celestia by  doxygen 1.4.1