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

Simulation Class Reference

#include <simulation.h>

Collaboration diagram for Simulation:

Collaboration graph
List of all members.

Public Member Functions

ObserveraddObserver ()
void cancelMotion ()
void centerSelection (double centerTime=0.5)
void centerSelectionCO (double centerTime=0.5)
void changeOrbitDistance (float d)
void chase ()
Selection findObject (std::string s, bool i18n=false)
Selection findObjectFromPath (std::string s, bool i18n=false)
void follow ()
void geosynchronousFollow ()
ObservergetActiveObserver ()
double getArrivalTime () const
float getFaintestVisible () const
FrameOfReference getFrame () const
SolarSystemgetNearestSolarSystem () const
std::vector< std::stringgetObjectCompletion (std::string s, bool withLocations=false)
ObservergetObserver ()
Observer::ObserverMode getObserverMode () const
double getRealTime () const
Selection getSelection () const
void getSelectionLongLat (double &distance, double &longitude, double &latitude)
bool getSyncTime () const
float getTargetSpeed ()
double getTime () const
double getTimeScale () const
Selection getTrackedObject () const
UniversegetUniverse () const
void gotoLocation (const RigidTransform &transform, double duration)
void gotoSelection (double gotoTime, double distance, Vec3f up, astro::CoordinateSystem upFrame)
void gotoSelection (double gotoTime, Vec3f up, astro::CoordinateSystem upFrame)
void gotoSelectionLongLat (double gotoTime, double distance, float longitude, float latitude, Vec3f up)
void gotoSurface (double duration)
void orbit (Quatf q)
void phaseLock ()
Selection pickObject (Vec3f pickRay, float tolerance=0.0f)
void removeObserver (Observer *)
void render (Renderer &, Observer &)
void render (Renderer &)
void reverseObserverOrientation ()
void rotate (Quatf q)
void selectPlanet (int)
void setActiveObserver (Observer *)
void setFaintestVisible (float)
void setFrame (const FrameOfReference &)
void setFrame (astro::CoordinateSystem, const Selection &)
void setObserverMode (Observer::ObserverMode)
void setObserverOrientation (const Quatf &)
void setObserverPosition (const UniversalCoord &)
void setSelection (const Selection &)
void setSyncTime (bool)
void setTargetSpeed (float s)
void setTime (double t)
void setTimeScale (double)
void setTrackedObject (const Selection &)
 Simulation (Universe *)
void synchronizeTime ()
void update (double dt)
 ~Simulation ()

Private Member Functions

SolarSystemgetSolarSystem (const Star *star)

Private Attributes

ObserveractiveObserver
SolarSystemclosestSolarSystem
float faintestVisible
std::vector< Observer * > observers
double realTime
Selection selection
bool syncTime
double timeScale
Universeuniverse

Constructor & Destructor Documentation

Simulation::Simulation Universe  ) 
 

Definition at line 19 of file simulation.cpp.

References activeObserver, and observers.

00019                                           :
00020     realTime(0.0),
00021     timeScale(1.0),
00022     syncTime(true),
00023     universe(_universe),
00024     closestSolarSystem(NULL),
00025     selection(),
00026     faintestVisible(5.0f)
00027 {
00028     activeObserver = new Observer();
00029     observers.insert(observers.end(), activeObserver);
00030 }

Simulation::~Simulation  ) 
 

Definition at line 33 of file simulation.cpp.

References observers.

00034 {
00035     for (vector<Observer*>::iterator iter = observers.begin();
00036          iter != observers.end(); iter++)
00037     {
00038         delete *iter;
00039     }
00040 }


Member Function Documentation

Observer * Simulation::addObserver  ) 
 

Definition at line 184 of file simulation.cpp.

References observers.

Referenced by CelestiaCore::splitView().

00185 {
00186     Observer* o = new Observer();
00187     observers.insert(observers.end(), o);
00188     return o;
00189 }

void Simulation::cancelMotion  ) 
 

Definition at line 339 of file simulation.cpp.

References activeObserver, and Observer::cancelMotion().

Referenced by CelestiaCore::activateFavorite().

00340 {
00341     activeObserver->cancelMotion();
00342 }

void Simulation::centerSelection double  centerTime = 0.5  ) 
 

Definition at line 344 of file simulation.cpp.

References activeObserver, Observer::centerSelection(), and selection.

Referenced by CelestiaCore::charEntered(), and CelestiaCore::mouseButtonUp().

00345 {
00346     activeObserver->centerSelection(selection, centerTime);
00347 }

void Simulation::centerSelectionCO double  centerTime = 0.5  ) 
 

Definition at line 349 of file simulation.cpp.

References activeObserver, Observer::centerSelectionCO(), and selection.

Referenced by CelestiaCore::charEntered().

00350 {
00351     activeObserver->centerSelectionCO(selection, centerTime);
00352 }

void Simulation::changeOrbitDistance float  d  ) 
 

Definition at line 267 of file simulation.cpp.

References activeObserver, Observer::changeOrbitDistance(), and selection.

Referenced by CelestiaCore::mouseMove(), and CelestiaCore::tick().

00268 {
00269     activeObserver->changeOrbitDistance(selection, d);
00270 }

void Simulation::chase  ) 
 

Definition at line 369 of file simulation.cpp.

References activeObserver, Observer::chase(), and selection.

Referenced by CelestiaCore::charEntered().

00370 {
00371     activeObserver->chase(selection);
00372 }

Selection Simulation::findObject std::string  s,
bool  i18n = false
 

Definition at line 419 of file simulation.cpp.

References closestSolarSystem, Selection::empty(), Universe::find(), SolarSystem::getStar(), selection, and universe.

Referenced by FindObjectProc().

00420 {
00421     Selection path[2];
00422     int nPathEntries = 0;
00423 
00424     if (!selection.empty())
00425         path[nPathEntries++] = selection;
00426 
00427     if (closestSolarSystem != NULL)
00428         path[nPathEntries++] = Selection(closestSolarSystem->getStar());
00429 
00430     return universe->find(s, path, nPathEntries, i18n);
00431 }

Selection Simulation::findObjectFromPath std::string  s,
bool  i18n = false
 

Definition at line 437 of file simulation.cpp.

References closestSolarSystem, Selection::empty(), Universe::findPath(), SolarSystem::getStar(), selection, and universe.

Referenced by CelestiaCore::activateFavorite(), celestia_find(), CelestiaCore::charEntered(), Url::goTo(), EclipseFinderDlg::gotoEclipse(), GotoObject(), GotoObjectProc(), LongLatDialog::slotApply(), CelestialBrowser::slotRightClickOnStar(), TourGuideGoto(), TourGuideProc(), and Url::Url().

00438 {
00439     Selection path[2];
00440     int nPathEntries = 0;
00441 
00442     if (!selection.empty())
00443         path[nPathEntries++] = selection;
00444 
00445     if (closestSolarSystem != NULL)
00446         path[nPathEntries++] = Selection(closestSolarSystem->getStar());
00447 
00448     return universe->findPath(s, path, nPathEntries, i18n);
00449 }

void Simulation::follow  ) 
 

Definition at line 354 of file simulation.cpp.

References activeObserver, Observer::follow(), and selection.

Referenced by CelestiaCore::charEntered(), GotoObject(), LongLatDialog::slotApply(), TourGuideGoto(), and TourGuideProc().

00355 {
00356     activeObserver->follow(selection);
00357 }

void Simulation::geosynchronousFollow  ) 
 

Definition at line 359 of file simulation.cpp.

References activeObserver, Observer::geosynchronousFollow(), and selection.

Referenced by CelestiaCore::charEntered(), and GotoObjectProc().

00360 {
00361     activeObserver->geosynchronousFollow(selection);
00362 }

Observer * Simulation::getActiveObserver  ) 
 

Definition at line 200 of file simulation.cpp.

References activeObserver.

Referenced by celestia_getobserver(), CelestiaCore::charEntered(), GetCurrentPreferences(), Url::goTo(), handleContextSurface(), KdeApp::initActions(), CelestiaCore::initSimulation(), KdePreferencesDialog::KdePreferencesDialog(), LocationsProc(), MainWindowProc(), CelestiaCore::mouseButtonUp(), CelestiaCore::mouseMove(), SelectionPopup::process(), KdeApp::queryExit(), CelestiaCore::renderOverlay(), LocationsDialog::SetControls(), KdePreferencesDialog::slotApply(), KdePreferencesDialog::slotCancel(), KdeApp::slotShowCityLocations(), KdeApp::slotShowCraterLocations(), KdeApp::slotShowLandingSiteLocations(), KdeApp::slotShowMareLocations(), KdeApp::slotShowMonsLocations(), KdeApp::slotShowObservatoryLocations(), KdeApp::slotShowOtherLocations(), KdeApp::slotShowTerraLocations(), KdeApp::slotShowVallisLocations(), CelestiaCore::splitView(), CelestiaCore::tick(), Url::Url(), and WinMain().

00201 {
00202     return activeObserver;
00203 }

double Simulation::getArrivalTime  )  const
 

Definition at line 108 of file simulation.cpp.

References activeObserver, and Observer::getArrivalTime().

Referenced by CelestiaCore::renderOverlay().

00109 {
00110     return activeObserver->getArrivalTime();
00111 }

float Simulation::getFaintestVisible  )  const
 

Definition at line 509 of file simulation.cpp.

References faintestVisible.

Referenced by celestia_getfaintestvisible(), CelestiaCore::charEntered(), GetCurrentPreferences(), KdePreferencesDialog::KdePreferencesDialog(), CelestiaCore::mouseMove(), KdeApp::queryExit(), and KdePreferencesDialog::slotApply().

00510 {
00511     return faintestVisible;
00512 }

FrameOfReference Simulation::getFrame  )  const
 

Definition at line 246 of file simulation.cpp.

References activeObserver, and Observer::getFrame().

Referenced by CelestiaCore::addFavorite(), CelestiaCore::charEntered(), CelestiaCore::renderOverlay(), CelestiaCore::tick(), and Url::Url().

00247 {
00248     return activeObserver->getFrame();
00249 }

SolarSystem * Simulation::getNearestSolarSystem  )  const
 

Definition at line 521 of file simulation.cpp.

References closestSolarSystem.

Referenced by EclipseFinder::CalculateEclipses(), and SolarSystemBrowserProc().

00522 {
00523     return closestSolarSystem;
00524 }

vector< std::string > Simulation::getObjectCompletion std::string  s,
bool  withLocations = false
 

Definition at line 452 of file simulation.cpp.

References closestSolarSystem, Selection::empty(), Universe::getCompletionPath(), Location::getParentBody(), Universe::getSolarSystem(), SolarSystem::getStar(), Selection::getType(), Selection::location(), selection, and universe.

Referenced by CelestiaCore::charEntered().

00453 {
00454     Selection path[2];
00455     int nPathEntries = 0;
00456 
00457     if (!selection.empty()) {
00458         if (selection.getType() == Selection::Type_Location)
00459         {
00460             path[nPathEntries++] = Selection(selection.location()->getParentBody());
00461         }
00462         else
00463         {
00464             path[nPathEntries++] = selection;
00465         }
00466     }
00467 
00468     if (closestSolarSystem != NULL &&
00469         closestSolarSystem != universe->getSolarSystem(selection))
00470     {
00471         path[nPathEntries++] = Selection(closestSolarSystem->getStar());
00472     }
00473 
00474     return universe->getCompletionPath(s, path, nPathEntries, withLocations);
00475 }

Observer & Simulation::getObserver  ) 
 

Definition at line 178 of file simulation.cpp.

References activeObserver.

Referenced by CelestiaCore::addFavorite(), CelestiaCore::charEntered(), SelectionPopup::init(), KdePreferencesDialog::KdePreferencesDialog(), KdePreferencesDialog::ltSubstract(), CelestiaCore::mouseMove(), StarBrowser::refresh(), RefreshItems(), CelestiaCore::renderOverlay(), CelestialBrowser::slotRefresh(), StarBrowser::StarBrowser(), CelestiaCore::tick(), and Url::Url().

00179 {
00180     return *activeObserver;
00181 }

Observer::ObserverMode Simulation::getObserverMode  )  const
 

Definition at line 225 of file simulation.cpp.

References activeObserver, and Observer::getMode().

Referenced by CelestiaCore::charEntered(), and CelestiaCore::renderOverlay().

00226 {
00227     return activeObserver->getMode();
00228 }

double Simulation::getRealTime  )  const
 

Definition at line 102 of file simulation.cpp.

References realTime.

Referenced by CelestiaCore::renderOverlay().

00103 {
00104     return realTime;
00105 }

Selection Simulation::getSelection  )  const
 

Definition at line 130 of file simulation.cpp.

References selection.

Referenced by CelestiaCore::activateFavorite(), AddBookmarkProc(), CelestiaCore::addFavorite(), celestia_getselection(), CelestiaCore::charEntered(), GotoObjectProc(), handleContextPlanet(), handleContextSurface(), KdePreferencesDialog::KdePreferencesDialog(), LongLatDialog::LongLatDialog(), KdePreferencesDialog::ltSubstract(), MainWindowProc(), menuMark(), menuUnMark(), CelestiaCore::mouseButtonUp(), CelestiaCore::mouseMove(), CelestiaCore::renderOverlay(), and Url::Url().

00131 {
00132     return selection;
00133 }

void Simulation::getSelectionLongLat double &  distance,
double &  longitude,
double &  latitude
 

Definition at line 325 of file simulation.cpp.

References activeObserver, distance(), Observer::getSelectionLongLat(), and selection.

Referenced by GotoObjectProc(), LongLatDialog::LongLatDialog(), and Url::Url().

00328 {
00329     activeObserver->getSelectionLongLat(selection, distance, longitude, latitude);
00330 }

SolarSystem* Simulation::getSolarSystem const Star star  )  [private]
 

bool Simulation::getSyncTime  )  const
 

Definition at line 488 of file simulation.cpp.

References syncTime.

Referenced by KdeApp::initActions(), MainWindowProc(), KdeApp::queryExit(), KdeApp::slotToggleSyncTime(), and syncMenusWithRendererState().

00489 {
00490     return syncTime;
00491 }

float Simulation::getTargetSpeed  ) 
 

Definition at line 278 of file simulation.cpp.

References activeObserver, and Observer::getTargetSpeed().

Referenced by CelestiaCore::charEntered(), CelestiaCore::keyDown(), KdePreferencesDialog::ltSubstract(), CelestiaCore::renderOverlay(), and CelestiaCore::tick().

00279 {
00280     return activeObserver->getTargetSpeed();
00281 }

double Simulation::getTime  )  const
 

Definition at line 78 of file simulation.cpp.

References activeObserver, and Observer::getTime().

Referenced by CelestiaCore::addFavorite(), celestia_gettime(), CelestiaCore::charEntered(), EclipseFinderDlg::EclipseFinderDlg(), EclipseFinderProc(), frame_from(), frame_to(), SetTimeDialog::init(), SelectionPopup::init(), KdePreferencesDialog::KdePreferencesDialog(), CelestiaCore::mouseMove(), object_getposition(), CelestiaCore::renderOverlay(), CelestiaCore::setLightTravelDelay(), CelestialBrowser::slotRefresh(), CelestiaCore::tick(), and Url::Url().

00079 {
00080     return activeObserver->getTime();
00081 }

double Simulation::getTimeScale  )  const
 

Definition at line 478 of file simulation.cpp.

References timeScale.

Referenced by CelestiaCore::back(), celestia_gettimescale(), CelestiaCore::forward(), CelestiaCore::goToUrl(), and Url::Url().

00479 {
00480     return timeScale;
00481 }

Selection Simulation::getTrackedObject  )  const
 

Definition at line 151 of file simulation.cpp.

References activeObserver, and Observer::getTrackedObject().

Referenced by CelestiaCore::charEntered(), CelestiaCore::renderOverlay(), and Url::Url().

00152 {
00153     return activeObserver->getTrackedObject();
00154 }

Universe * Simulation::getUniverse  )  const
 

Definition at line 71 of file simulation.cpp.

References universe.

Referenced by celestia_getstar(), celestia_getstarcount(), celestia_mark(), celestia_unmark(), celestia_unmarkall(), CelestiaCore::charEntered(), SelectionPopup::getSelectionFromId(), Url::getSelectionName(), SelectionPopup::getSelectionName(), handlePopupMenu(), SelectionPopup::init(), SelectionPopup::insert(), StarBrowser::listStars(), MainWindowProc(), menuContext(), menuMark(), menuUnMark(), StarBrowser::nearestStar(), object_getchildren(), object_mark(), object_unmark(), SelectionPopup::process(), CelestiaCore::renderOverlay(), and CelestialBrowser::slotRefresh().

00072 {
00073     return universe;
00074 }

void Simulation::gotoLocation const RigidTransform transform,
double  duration
 

Definition at line 318 of file simulation.cpp.

References activeObserver, and Observer::gotoLocation().

Referenced by EclipseFinderProc(), eclipseGoto(), and EclipseFinderDlg::gotoEclipse().

00320 {
00321     activeObserver->gotoLocation(transform, duration);
00322 }

void Simulation::gotoSelection double  gotoTime,
double  distance,
Vec3f  up,
astro::CoordinateSystem  upFrame
 

Definition at line 299 of file simulation.cpp.

References activeObserver, distance(), Observer::gotoSelection(), and selection.

00303 {
00304     activeObserver->gotoSelection(selection, gotoTime, distance, up, upFrame);
00305 }

void Simulation::gotoSelection double  gotoTime,
Vec3f  up,
astro::CoordinateSystem  upFrame
 

Definition at line 283 of file simulation.cpp.

References activeObserver, Selection::getType(), Observer::gotoSelection(), Observer::gotoSelectionGC(), and selection.

Referenced by CelestiaCore::charEntered(), GotoObject(), GotoObjectProc(), TourGuideGoto(), and TourGuideProc().

00286 {
00287     if (selection.getType() == Selection::Type_Location)
00288     {
00289         activeObserver->gotoSelectionGC(selection,
00290                                         gotoTime, 0.0, 0.5,
00291                                         up, upFrame);
00292     }
00293     else
00294     {
00295         activeObserver->gotoSelection(selection, gotoTime, up, upFrame);
00296     }
00297 }

void Simulation::gotoSelectionLongLat double  gotoTime,
double  distance,
float  longitude,
float  latitude,
Vec3f  up
 

Definition at line 307 of file simulation.cpp.

References activeObserver, distance(), Observer::gotoSelectionLongLat(), and selection.

Referenced by Url::goTo(), GotoObject(), GotoObjectProc(), and LongLatDialog::slotApply().

00312 {
00313     activeObserver->gotoSelectionLongLat(selection, gotoTime, distance,
00314                                          longitude, latitude, up);
00315 }

void Simulation::gotoSurface double  duration  ) 
 

Definition at line 333 of file simulation.cpp.

References activeObserver, Observer::gotoSurface(), and selection.

Referenced by CelestiaCore::charEntered().

00334 {
00335     activeObserver->gotoSurface(selection, duration);
00336 };

void Simulation::orbit Quatf  q  ) 
 

Definition at line 259 of file simulation.cpp.

References activeObserver, Observer::orbit(), and selection.

Referenced by CelestiaCore::mouseMove(), and CelestiaCore::tick().

00260 {
00261     activeObserver->orbit(selection, q);
00262 }

void Simulation::phaseLock  ) 
 

Definition at line 364 of file simulation.cpp.

References activeObserver, Observer::phaseLock(), and selection.

Referenced by CelestiaCore::charEntered().

00365 {
00366     activeObserver->phaseLock(selection);
00367 }

Selection Simulation::pickObject Vec3f  pickRay,
float  tolerance = 0.0f
 

Definition at line 163 of file simulation.cpp.

References activeObserver, faintestVisible, Observer::getOrientation(), Observer::getPosition(), Observer::getTime(), Universe::pick(), Quaternion< T >::toMatrix4(), and universe.

Referenced by CelestiaCore::mouseButtonUp().

00164 {
00165     return universe->pick(activeObserver->getPosition(),
00166                           pickRay * activeObserver->getOrientation().toMatrix4(),
00167                           activeObserver->getTime(),
00168                           faintestVisible,
00169                           tolerance);
00170 }

void Simulation::removeObserver Observer  ) 
 

Definition at line 192 of file simulation.cpp.

References observers.

Referenced by CelestiaCore::deleteView(), and CelestiaCore::singleView().

00193 {
00194     vector<Observer*>::iterator iter = find(observers.begin(), observers.end(), o);
00195     if (iter != observers.end())
00196         observers.erase(iter);
00197 }

void Simulation::render Renderer ,
Observer
 

Definition at line 62 of file simulation.cpp.

References faintestVisible, selection, and universe.

00063 {
00064     renderer.render(observer,
00065                     *universe,
00066                     faintestVisible,
00067                     selection);
00068 }

void Simulation::render Renderer  ) 
 

Definition at line 53 of file simulation.cpp.

References activeObserver, faintestVisible, selection, and universe.

Referenced by CelestiaCore::draw().

00054 {
00055     renderer.render(*activeObserver,
00056                     *universe,
00057                     faintestVisible,
00058                     selection);
00059 }

void Simulation::reverseObserverOrientation  ) 
 

Definition at line 172 of file simulation.cpp.

References activeObserver, and Observer::reverseOrientation().

Referenced by CelestiaCore::charEntered().

00173 {
00174     activeObserver->reverseOrientation();
00175 }

void Simulation::rotate Quatf  q  ) 
 

Definition at line 252 of file simulation.cpp.

References activeObserver, and Observer::rotate().

Referenced by CelestiaCore::mouseMove().

00253 {
00254     activeObserver->rotate(q);
00255 }

void Simulation::selectPlanet int   ) 
 

Definition at line 379 of file simulation.cpp.

References Selection::body(), closestSolarSystem, PlanetarySystem::getBody(), SolarSystem::getPlanets(), Universe::getSolarSystem(), PlanetarySystem::getStar(), getSun(), Body::getSystem(), Selection::getType(), selection, setSelection(), Selection::star(), and universe.

Referenced by CelestiaCore::charEntered(), handleContextPlanet(), and MainWindowProc().

00380 {
00381     if (index < 0)
00382     {
00383         if (selection.getType() == Selection::Type_Body)
00384         {
00385             PlanetarySystem* system = selection.body()->getSystem();
00386             if (system != NULL)
00387                 setSelection(system->getStar());
00388         }
00389     }
00390     else
00391     {
00392         const Star* star = NULL;
00393         if (selection.getType() == Selection::Type_Star)
00394             star = selection.star();
00395         else if (selection.getType() == Selection::Type_Body)
00396             star = getSun(selection.body());
00397 
00398         SolarSystem* solarSystem = NULL;
00399         if (star != NULL)
00400             solarSystem = universe->getSolarSystem(star);
00401         else
00402             solarSystem = closestSolarSystem;
00403 
00404         if (solarSystem != NULL &&
00405             index < solarSystem->getPlanets()->getSystemSize())
00406         {
00407             setSelection(Selection(solarSystem->getPlanets()->getBody(index)));
00408         }
00409     }
00410 }

void Simulation::setActiveObserver Observer  ) 
 

Definition at line 206 of file simulation.cpp.

References activeObserver, and observers.

Referenced by CelestiaCore::charEntered(), CelestiaCore::deleteView(), CelestiaCore::pickView(), and CelestiaCore::singleView().

00207 {
00208     vector<Observer*>::iterator iter= find(observers.begin(), observers.end(), o);
00209     if (iter != observers.end())
00210         activeObserver = o;
00211 }

void Simulation::setFaintestVisible float   ) 
 

Definition at line 515 of file simulation.cpp.

References faintestVisible.

Referenced by CelestiaCore::initSimulation(), CelestiaCore::setFaintest(), CelestiaCore::setFaintestAutoMag(), KdePreferencesDialog::slotCancel(), KdeApp::slotFaintestVisible(), and WinMain().

00516 {
00517     faintestVisible = magnitude;
00518 }

void Simulation::setFrame const FrameOfReference  ) 
 

Definition at line 241 of file simulation.cpp.

References activeObserver, and Observer::setFrame().

00242 {
00243     activeObserver->setFrame(_frame);
00244 }

void Simulation::setFrame astro::CoordinateSystem  ,
const Selection
 

Definition at line 235 of file simulation.cpp.

References activeObserver, and Observer::setFrame().

Referenced by CelestiaCore::activateFavorite(), CelestiaCore::charEntered(), EclipseFinderProc(), eclipseGoto(), Url::goTo(), and EclipseFinderDlg::gotoEclipse().

00237 {
00238     activeObserver->setFrame(FrameOfReference(coordSys, sel));
00239 }

void Simulation::setObserverMode Observer::ObserverMode   ) 
 

Definition at line 230 of file simulation.cpp.

References activeObserver, and Observer::setMode().

Referenced by CelestiaCore::charEntered().

00231 {
00232     activeObserver->setMode(mode);
00233 }

void Simulation::setObserverOrientation const Quatf  ) 
 

Definition at line 219 of file simulation.cpp.

References activeObserver, and Observer::setOrientation().

Referenced by CelestiaCore::activateFavorite(), and Url::goTo().

00220 {
00221     activeObserver->setOrientation(orientation);
00222 }

void Simulation::setObserverPosition const UniversalCoord  ) 
 

Definition at line 214 of file simulation.cpp.

References activeObserver, and Observer::setPosition().

Referenced by CelestiaCore::activateFavorite(), and Url::goTo().

00215 {
00216     activeObserver->setPosition(pos);
00217 }

void Simulation::setSelection const Selection  ) 
 

Definition at line 136 of file simulation.cpp.

References Universe::markObject(), selection, universe, and Universe::unmarkObject().

Referenced by CelestiaCore::activateFavorite(), celestia_select(), CelestiaCore::charEntered(), FindObjectProc(), Url::goTo(), GotoObject(), GotoObjectProc(), handleContextPlanet(), handlePopupMenu(), MainWindowProc(), menuContext(), CelestiaCore::mouseButtonUp(), SelectionPopup::process(), selectPlanet(), LongLatDialog::slotApply(), SolarSystemBrowserProc(), StarBrowserProc(), TourGuideGoto(), and TourGuideProc().

00137 {
00138     if (sel != selection)
00139     {
00140         universe->unmarkObject(selection, 0);
00141         selection = sel;
00142         universe->markObject(selection,
00143                              10.0f,
00144                              Color(1.0f, 0.0f, 0.0f, 0.9f),
00145                              Marker::Diamond,
00146                              0);
00147     }
00148 }

void Simulation::setSyncTime bool   ) 
 

Definition at line 493 of file simulation.cpp.

References syncTime.

Referenced by KdeApp::initActions(), MainWindowProc(), and KdeApp::slotToggleSyncTime().

00494 {
00495     syncTime = sync;
00496 }

void Simulation::setTargetSpeed float  s  ) 
 

Definition at line 273 of file simulation.cpp.

References activeObserver, and Observer::setTargetSpeed().

Referenced by CelestiaCore::charEntered(), CelestiaCore::keyDown(), and CelestiaCore::tick().

00274 {
00275     activeObserver->setTargetSpeed(s);
00276 }

void Simulation::setTime double  t  ) 
 

Definition at line 84 of file simulation.cpp.

References activeObserver, observers, Observer::setTime(), and syncTime.

Referenced by CelestiaCore::activateFavorite(), celestia_settime(), CelestiaCore::charEntered(), SetTimeDialog::command(), EclipseFinderProc(), eclipseGoto(), Url::goTo(), EclipseFinderDlg::gotoEclipse(), CelestiaCore::setLightTravelDelay(), KdePreferencesDialog::slotApply(), KdeApp::slotSetTimeNow(), and CelestiaCore::start().

00085 {
00086     if (syncTime)
00087     {
00088         for (vector<Observer*>::iterator iter = observers.begin();
00089              iter != observers.end(); iter++)
00090         {
00091             (*iter)->setTime(jd);
00092         }
00093     }
00094     else
00095     {
00096         activeObserver->setTime(jd);
00097     }
00098 }

void Simulation::setTimeScale double   ) 
 

Definition at line 483 of file simulation.cpp.

References timeScale.

Referenced by celestia_settimescale(), CelestiaCore::charEntered(), and Url::goTo().

00484 {
00485     timeScale = _timeScale;
00486 }

void Simulation::setTrackedObject const Selection  ) 
 

Definition at line 157 of file simulation.cpp.

References activeObserver, and Observer::setTrackedObject().

Referenced by CelestiaCore::charEntered(), and Url::goTo().

00158 {
00159     activeObserver->setTrackedObject(sel);
00160 }

void Simulation::synchronizeTime  ) 
 

Definition at line 499 of file simulation.cpp.

References activeObserver, Observer::getTime(), and observers.

Referenced by MainWindowProc().

00500 {
00501     for (vector<Observer*>::iterator iter = observers.begin();
00502          iter != observers.end(); iter++)
00503     {
00504         (*iter)->setTime(activeObserver->getTime());
00505     }
00506 }

void Simulation::update double  dt  ) 
 

Definition at line 115 of file simulation.cpp.

References activeObserver, closestSolarSystem, Universe::getNearestSolarSystem(), Observer::getPosition(), observers, realTime, timeScale, universe, and Observer::update().

Referenced by EclipseFinderProc(), eclipseGoto(), Url::goTo(), EclipseFinderDlg::gotoEclipse(), KdePreferencesDialog::slotApply(), KdeApp::slotSetTimeNow(), CelestiaCore::start(), and CelestiaCore::tick().

00116 {
00117     realTime += dt;
00118 
00119     for (vector<Observer*>::iterator iter = observers.begin();
00120          iter != observers.end(); iter++)
00121     {
00122         (*iter)->update(dt, timeScale);
00123     }
00124 
00125     // Find the closest solar system
00126     closestSolarSystem = universe->getNearestSolarSystem(activeObserver->getPosition());
00127 }


Member Data Documentation

Observer* Simulation::activeObserver [private]
 

Definition at line 125 of file simulation.h.

Referenced by cancelMotion(), centerSelection(), centerSelectionCO(), changeOrbitDistance(), chase(), follow(), geosynchronousFollow(), getActiveObserver(), getArrivalTime(), getFrame(), getObserver(), getObserverMode(), getSelectionLongLat(), getTargetSpeed(), getTime(), getTrackedObject(), gotoLocation(), gotoSelection(), gotoSelectionLongLat(), gotoSurface(), orbit(), phaseLock(), pickObject(), render(), reverseObserverOrientation(), rotate(), setActiveObserver(), setFrame(), setObserverMode(), setObserverOrientation(), setObserverPosition(), setTargetSpeed(), setTime(), setTrackedObject(), Simulation(), synchronizeTime(), and update().

SolarSystem* Simulation::closestSolarSystem [private]
 

Definition at line 122 of file simulation.h.

Referenced by findObject(), findObjectFromPath(), getNearestSolarSystem(), getObjectCompletion(), selectPlanet(), and update().

float Simulation::faintestVisible [private]
 

Definition at line 128 of file simulation.h.

Referenced by getFaintestVisible(), pickObject(), render(), and setFaintestVisible().

std::vector<Observer*> Simulation::observers [private]
 

Definition at line 126 of file simulation.h.

Referenced by addObserver(), removeObserver(), setActiveObserver(), setTime(), Simulation(), synchronizeTime(), update(), and ~Simulation().

double Simulation::realTime [private]
 

Definition at line 116 of file simulation.h.

Referenced by getRealTime(), and update().

Selection Simulation::selection [private]
 

Definition at line 123 of file simulation.h.

Referenced by centerSelection(), centerSelectionCO(), changeOrbitDistance(), chase(), findObject(), findObjectFromPath(), follow(), geosynchronousFollow(), getObjectCompletion(), getSelection(), getSelectionLongLat(), gotoSelection(), gotoSelectionLongLat(), gotoSurface(), orbit(), phaseLock(), render(), selectPlanet(), and setSelection().

bool Simulation::syncTime [private]
 

Definition at line 118 of file simulation.h.

Referenced by getSyncTime(), setSyncTime(), and setTime().

double Simulation::timeScale [private]
 

Definition at line 117 of file simulation.h.

Referenced by getTimeScale(), setTimeScale(), and update().

Universe* Simulation::universe [private]
 

Definition at line 120 of file simulation.h.

Referenced by findObject(), findObjectFromPath(), getObjectCompletion(), getUniverse(), pickObject(), render(), selectPlanet(), setSelection(), and update().


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