Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

TStellarObjectList Class Reference

A list of stellar objects which can be sorted, merged, filtered etc. More...

#include <stolist.h>

Inheritance diagram for TStellarObjectList:

Inheritance graph
[legend]
Collaboration diagram for TStellarObjectList:

Collaboration graph
[legend]
List of all members.

Public Methods

 TStellarObjectList ()
 TStellarObjectList (const TStellarObjectList &List)
TStellarObjectList & Add (TStellarObject *pObject)
TStellarObjectList & Add (const TStellarObjectList &List)
double ApplyFilterMinDistance (const TPoint &Point, double dEpsilon=0.001)
int Filter (TStellarObjectList *newlist, const TSOLFilter &f, const bool clear=false) const
TStellarObjectList & operator= (TStellarObject *pObject)
TStellarObjectList & operator= (const TStellarObjectList &List)
TStellarObjectList operator+ (TStellarObject *pObject) const
TStellarObjectList operator+ (const TStellarObjectList &List) const
TStellarObjectList & operator+= (TStellarObject *pObject)
TStellarObjectList & operator+= (const TStellarObjectList &List)
void showContent () const
void SortByDistance (const TPoint &Pos)
void SortByID ()
void SortByName ()
void SortByType ()

Private Methods

bool CompareByDistance (TStellarObject *x, TStellarObject *y)

Private Attributes

TPoint fReferencePos

Friends

class TCompareByDistance

Detailed Description

A list of stellar objects which can be sorted, merged, filtered etc.

Author:
Jai Shaw <Jai@towersoft.com.au>, Marco Krohn <marco.krohn@gmx.de>
Version:
Id:
stolist.h,v 1.7 2002/05/11 23:59:58 mkrohn5 Exp
See also:
TStellarObject
FIXME: description of class


Constructor & Destructor Documentation

TStellarObjectList::TStellarObjectList  
 

Empty constructor.

TStellarObjectList::TStellarObjectList const TStellarObjectList &    List
 

The copy constructor.


Member Function Documentation

TStellarObjectList& TStellarObjectList::Add const TStellarObjectList &    List
 

Adds a list of stellar objects to the list.

Parameters:
List  The list of stellar object to add.
Returns:
The new stellar object list.

TStellarObjectList& TStellarObjectList::Add TStellarObject   pObject
 

Adds a stellar object to the list.

Parameters:
pObject  The stellar object to add.
Returns:
The new stellar object list.

double TStellarObjectList::ApplyFilterMinDistance const TPoint   Point,
double    dEpsilon = 0.001
 

Calculates for each stellar object the distance to a given point and keeps only the nearest objects in the list. If several objects have the same (min) distance they all stay in the list.

Parameters:
Point  Reference point to which the distance is measured.
dEpsilon  Due to rounding errors it might happen that objects which actually have the same distance have different distances. This parameter gives a certain tolerance such that all objects with distance < min_dist + dEpsilon stay in the list. FIXME: this feature is not yet implemented, but it should!
Returns:
The distance from the point to the closest object, or if the list is empty -1.

bool TStellarObjectList::CompareByDistance TStellarObject   x,
TStellarObject   y
[private]
 

Calculates the distance of both stellar objects to the reference point ReferencePos and returns true if x is closer to the reference point than y, otherwise false.

int TStellarObjectList::Filter TStellarObjectList *    newlist,
const TSOLFilter &    f,
const bool    clear = false
const
 

Apply a filter to a list and create a new (filtered) list.

Parameters:
newlist  pointer to the list where the result will be stored.
f  filter to be applied.
clear  whenether to clear or not "newlist" before adding the filter result. @ return then number of elements which satisfied the filter.

TStellarObjectList& TStellarObjectList::operator+= const TStellarObjectList &    List
 

Adds a list of stellar objects to the list. The same as Add.

Parameters:
List  The list of stellar object to add.
Returns:
The new stellar object list.

TStellarObjectList& TStellarObjectList::operator+= TStellarObject   pObject
 

Adds a stellar object to the list. The same as Add.

Parameters:
pObject  The stellar object to add.
Returns:
The new stellar object list.

void TStellarObjectList::showContent   const
 

For debugging only! Writes the stellar objects to the LOG stream.

void TStellarObjectList::SortByDistance const TPoint   Pos
 

Uses the distance to a given point to sort the list by distance.

Parameters:
Pos  The reference position.

void TStellarObjectList::SortByID  
 

Sorts the list by ID (FIXME ascending?).

void TStellarObjectList::SortByName  
 

Sorts the list by name (FIXME ascending?).

void TStellarObjectList::SortByType  
 

Sorts the list by type.


Member Data Documentation

TPoint TStellarObjectList::fReferencePos [private]
 

FIXME


The documentation for this class was generated from the following file:
Generated on Thu Jun 20 18:13:35 2002 for Stellar Legacy by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001