#include <body.h>
Collaboration diagram for PlanetarySystem:

Public Types | |
| typedef bool(* | TraversalFunc )(Body *, void *) |
| enum | TraversalResult { ContinueTraversal = 0, StopTraversal = 1 } |
Public Member Functions | |
| void | addBody (Body *body) |
| Body * | find (std::string, bool deepSearch=false, bool i18n=false) const |
| Body * | getBody (int i) const |
| std::vector< std::string > | getCompletion (const std::string &_name, bool rec=true) const |
| Body * | getPrimaryBody () const |
| Star * | getStar () const |
| int | getSystemSize () const |
| PlanetarySystem (Star *_star) | |
| PlanetarySystem (Body *_primary) | |
| void | removeBody (Body *body) |
| void | replaceBody (Body *oldBody, Body *newBody) |
| bool | traverse (TraversalFunc, void *) const |
Private Attributes | |
| Body * | primary |
| std::vector< Body * > | satellites |
| Star * | star |
|
|
|
|
|
Definition at line 41 of file body.h. 00042 {
00043 ContinueTraversal = 0,
00044 StopTraversal = 1
00045 };
|
|
|
Definition at line 613 of file body.cpp. References getStar(), Body::getSystem(), primary, and star. 00613 : primary(_primary) 00614 { 00615 if (primary != NULL && primary->getSystem() != NULL) 00616 star = primary->getSystem()->getStar(); 00617 else 00618 star = NULL; 00619 }
|
|
|
Definition at line 621 of file body.cpp.
|
|
|
Definition at line 627 of file body.cpp. References satellites. Referenced by createBody(), and LoadSolarSystemObjects(). 00628 {
00629 satellites.insert(satellites.end(), body);
00630 }
|
|
||||||||||||||||
|
Definition at line 661 of file body.cpp. References Body::getSatellites(), satellites, and UTF8StringCompare(). Referenced by Universe::findChildObject(), Universe::findObjectInContext(), and LoadSolarSystemObjects(). 00662 {
00663 for (vector<Body*>::const_iterator iter = satellites.begin();
00664 iter != satellites.end(); iter++)
00665 {
00666 if (UTF8StringCompare((*iter)->getName(i18n), _name) == 0)
00667 {
00668 return *iter;
00669 }
00670 else if (deepSearch && (*iter)->getSatellites() != NULL)
00671 {
00672 Body* body = (*iter)->getSatellites()->find(_name, deepSearch, i18n);
00673 if (body != NULL)
00674 return body;
00675 }
00676 }
00677
00678 return NULL;
00679 }
|
|
|
Definition at line 36 of file body.h. References satellites. Referenced by EclipseFinder::CalculateEclipses(), SelectionPopup::getSelectionFromId(), handleContextPlanet(), SelectionPopup::insert(), MainWindowProc(), object_getchildren(), Renderer::renderPlanet(), Simulation::selectPlanet(), CelestialBrowser::slotRefresh(), and traverse(). 00036 { return satellites[i]; };
|
|
||||||||||||
|
Definition at line 700 of file body.cpp. References Body::getSatellites(), satellites, and UTF8StringCompare(). Referenced by Universe::getCompletion(), and Universe::getCompletionPath(). 00701 {
00702 std::vector<std::string> completion;
00703
00704 for (vector<Body*>::const_iterator iter = satellites.begin();
00705 iter != satellites.end(); iter++)
00706 {
00707 if (UTF8StringCompare((*iter)->getName(true), _name, _name.length()) == 0)
00708 {
00709 completion.push_back((*iter)->getName(true));
00710 }
00711 if (rec && (*iter)->getSatellites() != NULL)
00712 {
00713 std::vector<std::string> bodies = (*iter)->getSatellites()->getCompletion(_name);
00714 completion.insert(completion.end(), bodies.begin(), bodies.end());
00715 }
00716 }
00717
00718 return completion;
00719 }
|
|
|
Definition at line 34 of file body.h. References primary. Referenced by Body::getEclipticalToEquatorial(), Body::getLocalToHeliocentric(), Selection::getName(), Url::getSelectionName(), Universe::getSolarSystem(), object_getinfo(), Renderer::renderPlanet(), and Observer::update(). 00034 { return primary; };
|
|
|
Definition at line 33 of file body.h. References star. Referenced by displayPlanetInfo(), EclipseFinderProc(), eclipseGoto(), Selection::getName(), Selection::getPosition(), Universe::getSolarSystem(), getSun(), EclipseFinderDlg::gotoEclipse(), object_getinfo(), PlanetarySystem(), Simulation::selectPlanet(), and Observer::update(). 00033 { return star; };
|
|
|
Definition at line 35 of file body.h. References satellites. Referenced by EclipseFinder::CalculateEclipses(), displayStarInfo(), SelectionPopup::getSelectionFromId(), handlePopupMenu(), SelectionPopup::insert(), menuContext(), object_getchildren(), Renderer::renderPlanet(), CelestialBrowser::slotRefresh(), and traverse(). 00035 { return satellites.size(); };
|
|
|
Definition at line 633 of file body.cpp. References satellites. Referenced by Body::~Body(). 00634 {
00635 for (vector<Body*>::iterator iter = satellites.begin();
00636 iter != satellites.end(); iter++)
00637 {
00638 if (*iter == body)
00639 {
00640 satellites.erase(iter);
00641 break;
00642 }
00643 }
00644 }
|
|
||||||||||||
|
Definition at line 647 of file body.cpp. References satellites. Referenced by LoadSolarSystemObjects(). 00648 {
00649 for (vector<Body*>::iterator iter = satellites.begin();
00650 iter != satellites.end(); iter++)
00651 {
00652 if (*iter == oldBody)
00653 {
00654 *iter = newBody;
00655 break;
00656 }
00657 }
00658 }
|
|
||||||||||||
|
Definition at line 682 of file body.cpp. References getBody(), Body::getSatellites(), and getSystemSize(). 00683 {
00684 for (int i = 0; i < getSystemSize(); i++)
00685 {
00686 Body* body = getBody(i);
00687 // assert(body != NULL);
00688 if (!func(body, info))
00689 return false;
00690 if (body->getSatellites() != NULL)
00691 {
00692 if (!body->getSatellites()->traverse(func, info))
00693 return false;
00694 }
00695 }
00696
00697 return true;
00698 }
|
|
|
Definition at line 55 of file body.h. Referenced by getPrimaryBody(), and PlanetarySystem(). |
|
|
Definition at line 56 of file body.h. Referenced by addBody(), find(), getBody(), getCompletion(), getSystemSize(), removeBody(), and replaceBody(). |
|
|
Definition at line 54 of file body.h. Referenced by getStar(), and PlanetarySystem(). |
1.4.1