Main Page | Class Hierarchy | Class List | Directories | Class Members

osgEphemeris::EphemerisModel Class Reference

The highest level class in the osgEphemeris library allowing for the setting of parameters which control the placement of heavenly bodies, namely the Sun, Moon, Stars and Planets, in the virtual scene. More...

List of all members.

Public Types

enum  Members {
  SUN_LIGHT_SOURCE = 0x01, SKY_DOME = 0x02, GROUND_PLANE = 0x04, MOON = 0x08,
  PLANETS = 0x10, STAR_FIELD = 0x20, ALL_MEMBERS, DEFAULT_MEMBERS
}

Public Member Functions

 EphemerisModel ()
 EphemerisModel (const EphemerisModel &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Node (osgEphemerisModel, EphemerisModel)
void setEphemerisData (EphemerisData *data)
EphemerisDatagetEphemerisData ()
void setMembers (unsigned int bit_map_of_members)
unsigned int getMembers () const
void setAutoDateTime (bool flag)
bool getAutoDateTime () const
void setUseEphemerisEngine (bool flag)
bool getUseEphemerisEngine () const
void setSkyDomeRadius (double radius_in_meters)
double getSkyDomeRadius () const
void setSkyDomeCenter (osg::Vec3 center)
osg::Vec3 getSkyDomeCenter ()
void setSunLightNum (unsigned int num)
unsigned int getSunLightNum () const
void setMoveWithEyePoint (bool flag)
bool getMoveWithEyePoint () const
void setLatitude (double latitude)
double getLatitude () const
void setLongitude (double longitude)
double getLongitude () const
void setLatitudeLongitude (double latitude, double longitude)
void getLatitudeLongitude (double &latitude, double &longitude) const
void setLatitudeLongitudeAltitude (double latitude, double longitude, double altitude)
void getLatitudeLongitudeAltitude (double &latitude, double &longitude, double &altitude) const
void setDateTime (const DateTime &dateTime)
DateTime getDateTime () const
void setEphemerisUpdateCallback (EphemerisUpdateCallback *updateCallback)
const EphemerisUpdateCallbackgetEphemerisUpdateCallback () const
void update ()
virtual void traverse (osg::NodeVisitor &nv)

Classes

class  MoveWithEyePointTransform
class  UpdateCallback


Detailed Description

The highest level class in the osgEphemeris library allowing for the setting of parameters which control the placement of heavenly bodies, namely the Sun, Moon, Stars and Planets, in the virtual scene.

EphemersModel is the programming interface to set the parameters for controlling the placement of heavenly bodies, namely the Sun, the Moon, Stars and Planets in the virtual scene.

EphemerisModel initializes a SkyDome which controls the sky color and provides a surface for projection of the texture of the Sun. It also retains a pointer to EphemerisData, which contains the actual parameters for computing the positions of the heavenly bodies, namely latitude, longitude, altitude, date and time.

EphemerisModel by default uses an EphemerisEngine to process the information about heavenly body position.

EphemerisModel also defines a light, for which it controls the position and colors, representing the light from the Sun.

EphermerisModel is intended to be a ground bound or near ground bound view presentation of heavenly bodies and not intended for space-based observation of heavenly bodies.

EphemerisModel derives from osg::Group and contains an internal traverse() method where it does internal updates at run-time.


Constructor & Destructor Documentation

osgEphemeris::EphemerisModel::EphemerisModel  ) 
 

The default constructor

osgEphemeris::EphemerisModel::EphemerisModel const EphemerisModel copy,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY
 

The copy contructor


Member Function Documentation

bool osgEphemeris::EphemerisModel::getAutoDateTime  )  const
 

Return whether AutoDateTime is set. Returns True if set, False if not

DateTime osgEphemeris::EphemerisModel::getDateTime  )  const
 

Get the current date and time setting in a DateTime struct

const EphemerisUpdateCallback* osgEphemeris::EphemerisModel::getEphemerisUpdateCallback  )  const
 

Return a pointer to the current EphemerisUpdateCallback

double osgEphemeris::EphemerisModel::getLatitude  )  const
 

Get the current eyepoint latitude in degrees.

void osgEphemeris::EphemerisModel::getLatitudeLongitude double &  latitude,
double &  longitude
const
 

Get both the latitude and longitude of the current eyepoint

void osgEphemeris::EphemerisModel::getLatitudeLongitudeAltitude double &  latitude,
double &  longitude,
double &  altitude
const
 

Get the latitude, longitude, and altitude of the current eyepoint

double osgEphemeris::EphemerisModel::getLongitude  )  const
 

Get the current eyepoint longitude in degrees.

unsigned int osgEphemeris::EphemerisModel::getMembers  )  const
 

Returns as an integer the bitmask representing the set of members currently configured.

bool osgEphemeris::EphemerisModel::getMoveWithEyePoint  )  const
 

Return whether MoveWithEyePoint is set.

osg::Vec3 osgEphemeris::EphemerisModel::getSkyDomeCenter  ) 
 

Returns an osg::Vec3 of the position of the center of the SkyDomeCenter. It should be noted that this is a static parameter that was set at initialization time and does not return the actual center of the skydome if setMoveWithEyePoint is set to true.

double osgEphemeris::EphemerisModel::getSkyDomeRadius  )  const
 

Return the size in meters of the SkyDomeRadius

unsigned int osgEphemeris::EphemerisModel::getSunLightNum  )  const
 

Return which OpenGL light number is being used for the Sun light source.

bool osgEphemeris::EphemerisModel::getUseEphemerisEngine  )  const
 

Return whether the use of the internal EphemerisEngine is set.

void osgEphemeris::EphemerisModel::setAutoDateTime bool  flag  ) 
 

Set whether the EphemerisModel should auto update its date and time using the computer's clock.

Parameters:
flag If True, EphemerisModel will set the heavenely bodies' position according the current date and time as set by the computer's clock. If False, date and time will not be updated internally. Defaults to True.

void osgEphemeris::EphemerisModel::setDateTime const DateTime dateTime  ) 
 

Set the current date and time by passing a DateTime struct

void osgEphemeris::EphemerisModel::setEphemerisData EphemerisData data  ) 
 

This sets the source pointer to the Ephemeris data. By default, EphemerisModel will initialize the internal EphemerisData pointer by attaching to the shared memory mapped file defined by EphemerisData::getDefaultShmemFile(). This call may be made if the user intends to use a different EphemerisData source

void osgEphemeris::EphemerisModel::setEphemerisUpdateCallback EphemerisUpdateCallback updateCallback  ) 
 

Set the Ephemeris Update Callback.

Parameters:
updateCallback is a pointer to an osgEphemeris::EphmerisUpdateCallback derived class. This callback's () operator will be called during run-time and passed a pointer to the EphemerisModel's EphemerisData, to provide a mechanism to dynamically update the EphemerisData.

void osgEphemeris::EphemerisModel::setLatitude double  latitude  ) 
 

Set the current eyepoint latitude in degrees.

void osgEphemeris::EphemerisModel::setLatitudeLongitude double  latitude,
double  longitude
 

Set both the latitude and longitude of the current eyepoint

void osgEphemeris::EphemerisModel::setLatitudeLongitudeAltitude double  latitude,
double  longitude,
double  altitude
 

Set the latitude, longitude, and altitude of the current eyepoint

void osgEphemeris::EphemerisModel::setLongitude double  longitude  ) 
 

Set the current eyepoint longitude in degrees.

void osgEphemeris::EphemerisModel::setMembers unsigned int  bit_map_of_members  ) 
 

Control the members of the Ephemeris Model, which are, in their entirety, The sunlight source, a sky dome, a ground plane, the moon, the planets, the stars (in a star field). By default, the sunlight source, skydome, moon and starfield are included, excluding the ground plane and planets.

The bitmap may be set by setting any of the bits defined in

SUN_LIGHT_SOURCE SKY_DOME GROUND_PLANE MOON PLANTES STAR_FIELD

ALL_MEMBERS combines SUN_LIGHT_SOURCE | SKY_DOME | GROUND_PLANE | MOON | PLANETS | STAR_FIELD.

DEFAULT_MEMBERS combines SUN_LIGHT_SOURCE | SKY_DOME | MOON | STAR_FIELD.

void osgEphemeris::EphemerisModel::setMoveWithEyePoint bool  flag  ) 
 

Set whether EphemerisModel should move the SkyDome and all components to be continually centered around the eyepoint. Default is True.

void osgEphemeris::EphemerisModel::setSkyDomeCenter osg::Vec3  center  ) 
 

Set the position of the center of the skydome in 3 space.

Parameters:
center An osg::Vec3 containing the x,y,z position in 3 space of the SkyDome center. Note that this should be used even when setMoveWithEyePoint() is set to true because of datbase size initialization regardless of run-time updates.

void osgEphemeris::EphemerisModel::setSkyDomeRadius double  radius_in_meters  ) 
 

Set the size of the SkyDomeRadius.

Parameters:
radius_in_meters The desired radius of the SkyDome in meters. Note that internally, EphemerisModel uses a scaling factor from the default SkyDome radius size of "distance from the earth to the moon", in meters. Therefore, the radius must be specified in meters.
(I know, this sucks a little)

void osgEphemeris::EphemerisModel::setSunLightNum unsigned int  num  ) 
 

Set which OpenGL light number should be used for the Sun light source.

void osgEphemeris::EphemerisModel::setUseEphemerisEngine bool  flag  ) 
 

Set whether the EphemerisModel should use the internal EphemerisEngine.

Parameters:
flag If True, the heavenly body positions will be updated by the internal EphemerisEngine. If False, they will not. Defaults to True.
This is useful if the user wants to run an external EphemersEngine on a separate processor, for example.

virtual void osgEphemeris::EphemerisModel::traverse osg::NodeVisitor &  nv  )  [virtual]
 

Used internally

void osgEphemeris::EphemerisModel::update  ) 
 

Effect an update. Used internally by the internal UpdateCallback


The documentation for this class was generated from the following file:
Generated on Sun Feb 26 20:00:03 2006 for osgEphemeris by  doxygen 1.4.1