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

Marker Class Reference

#include <marker.h>

Collaboration diagram for Marker:

Collaboration graph
List of all members.

Public Types

enum  Symbol {
  Diamond = 0, Triangle = 1, Square = 2, Plus = 3,
  X = 4
}

Public Member Functions

Color getColor () const
Selection getObject () const
UniversalCoord getPosition (double jd) const
int getPriority () const
float getSize () const
Symbol getSymbol () const
 Marker (const Selection &)
void render () const
void setColor (Color)
void setPriority (int)
void setSize (float)
void setSymbol (Symbol)
 ~Marker ()

Private Attributes

Color color
Selection obj
int priority
float size
Symbol symbol

Member Enumeration Documentation

enum Marker::Symbol
 

Enumeration values:
Diamond 
Triangle 
Square 
Plus 
X 

Definition at line 37 of file marker.h.

00038     {
00039         Diamond  = 0,
00040         Triangle = 1,
00041         Square   = 2,
00042         Plus     = 3,
00043         X        = 4
00044     };


Constructor & Destructor Documentation

Marker::Marker const Selection  ) 
 

Definition at line 17 of file marker.cpp.

00017                                  :
00018     obj(s),
00019     size(10.0f),
00020     color(Color::White),
00021     priority(0),
00022     symbol(Diamond)
00023 {
00024 }

Marker::~Marker  ) 
 

Definition at line 26 of file marker.cpp.

00027 {
00028 }


Member Function Documentation

Color Marker::getColor  )  const
 

Definition at line 43 of file marker.cpp.

References color.

00044 {
00045     return color;
00046 }

Selection Marker::getObject  )  const
 

Definition at line 37 of file marker.cpp.

References obj.

00038 {
00039     return obj;
00040 }

UniversalCoord Marker::getPosition double  jd  )  const
 

Definition at line 31 of file marker.cpp.

References Selection::getPosition(), and obj.

00032 {
00033     return obj.getPosition(jd);
00034 }

int Marker::getPriority  )  const
 

Definition at line 67 of file marker.cpp.

References priority.

Referenced by Universe::isMarked().

00068 {
00069     return priority;
00070 }

float Marker::getSize  )  const
 

Definition at line 55 of file marker.cpp.

References size.

Referenced by render().

00056 {
00057     return size;
00058 }

Marker::Symbol Marker::getSymbol  )  const
 

Definition at line 79 of file marker.cpp.

References symbol.

00080 {
00081     return symbol;
00082 }

void Marker::render  )  const
 

Definition at line 90 of file marker.cpp.

References Diamond, getSize(), Plus, Square, symbol, Triangle, and X.

00091 {
00092     float s = getSize() / 2.0f;
00093 
00094     switch (symbol)
00095     {
00096     case Diamond:
00097         glBegin(GL_LINE_LOOP);
00098         glVertex3f(0.0f,    s, 0.0f);
00099         glVertex3f(   s, 0.0f, 0.0f);
00100         glVertex3f(0.0f,   -s, 0.0f);
00101         glVertex3f(  -s, 0.0f, 0.0f);
00102         glEnd();
00103         break;
00104 
00105     case Plus:
00106         glBegin(GL_LINES);
00107         glVertex3f(0.0f,  s, 0.0f);
00108         glVertex3f(0.0f, -s, 0.0f);
00109         glVertex3f( s, 0.0f, 0.0f);
00110         glVertex3f(-s, 0.0f, 0.0f);
00111         glEnd();
00112         break;
00113 
00114     case X:
00115         glBegin(GL_LINES);
00116         glVertex3f(-s, -s, 0.0f);
00117         glVertex3f( s,  s, 0.0f);
00118         glVertex3f( s, -s, 0.0f);
00119         glVertex3f(-s,  s, 0.0f);
00120         glEnd();
00121         break;
00122 
00123     case Square:
00124         glBegin(GL_LINE_LOOP);
00125         glVertex3f(-s, -s, 0.0f);
00126         glVertex3f( s, -s, 0.0f);
00127         glVertex3f( s,  s, 0.0f);
00128         glVertex3f(-s,  s, 0.0f);
00129         glEnd();
00130         break;
00131 
00132     case Triangle:
00133         glBegin(GL_LINE_LOOP);
00134         glVertex3f(0.0f,  s, 0.0f);
00135         glVertex3f(   s, -s, 0.0f);
00136         glVertex3f(  -s, -s, 0.0f);
00137         glEnd();
00138         break;
00139     }
00140 }

void Marker::setColor Color   ) 
 

Definition at line 49 of file marker.cpp.

References color.

Referenced by Universe::markObject().

00050 {
00051     color = _color;
00052 }

void Marker::setPriority int   ) 
 

Definition at line 73 of file marker.cpp.

References priority.

Referenced by Universe::markObject().

00074 {
00075     priority = _priority;
00076 }

void Marker::setSize float   ) 
 

Definition at line 61 of file marker.cpp.

References size.

Referenced by Universe::markObject().

00062 {
00063     size = _size;
00064 }

void Marker::setSymbol Symbol   ) 
 

Definition at line 84 of file marker.cpp.

References symbol.

Referenced by Universe::markObject().

00085 {
00086     symbol = _symbol;
00087 }


Member Data Documentation

Color Marker::color [private]
 

Definition at line 54 of file marker.h.

Referenced by getColor(), and setColor().

Selection Marker::obj [private]
 

Definition at line 52 of file marker.h.

Referenced by getObject(), and getPosition().

int Marker::priority [private]
 

Definition at line 55 of file marker.h.

Referenced by getPriority(), and setPriority().

float Marker::size [private]
 

Definition at line 53 of file marker.h.

Referenced by getSize(), and setSize().

Symbol Marker::symbol [private]
 

Definition at line 56 of file marker.h.

Referenced by getSymbol(), render(), and setSymbol().


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