#include <starbrowser.h>
Collaboration diagram for StarBrowser:

Public Types | |
| enum | { NearestStars = 0, BrighterStars = 1, BrightestStars = 2, StarsWithPlanets = 3 } |
Public Member Functions | |
| std::vector< const Star * > * | listStars (unsigned int) |
| const Star * | nearestStar (void) |
| void | refresh () |
| bool | setPredicate (int pred) |
| void | setSimulation (Simulation *_appSim) |
| StarBrowser (HINSTANCE, HWND, CelestiaCore *) | |
| StarBrowser (Simulation *_appSim, int pred=NearestStars) | |
| StarBrowser () | |
| ~StarBrowser () | |
Public Attributes | |
| CelestiaCore * | appCore |
| HWND | hwnd |
| int | nStars |
| HWND | parent |
| Point3f | pos |
| UniversalCoord | ucPos |
Private Attributes | |
| Simulation * | appSim |
| int | predicate |
|
|
Definition at line 27 of file starbrowser.h. 00027 {
00028 NearestStars = 0,
00029 BrighterStars = 1,
00030 BrightestStars = 2,
00031 StarsWithPlanets = 3,
00032 };
|
|
|
Definition at line 241 of file starbrowser.cpp. References NearestStars. 00241 : 00242 pos(0.0, 0.0, 0.0), 00243 ucPos(0.0, 0.0, 0.0), 00244 appSim(NULL), 00245 predicate(NearestStars) 00246 { 00247 } }
|
|
||||||||||||
|
Definition at line 231 of file starbrowser.cpp. References appSim, Simulation::getObserver(), Observer::getPosition(), pos, predicate, and ucPos. 00231 : 00232 appSim(_appSim) 00233 { 00234 ucPos = appSim->getObserver().getPosition(); 00235 pos = (Point3f) ucPos; 00236 00237 predicate = pred; 00238 }
|
|
||||||||||||||||
|
Definition at line 592 of file winstarbrowser.cpp. References appCore, appInstance, DefaultListStars, fromMicroLY(), Simulation::getObserver(), Observer::getPosition(), CelestiaCore::getSimulation(), hwnd, IDD_STARBROWSER, NearestStars, nStars, parent, pos, predicate, StarBrowserProc(), and ucPos. 00594 : 00595 appCore(_appCore), 00596 parent(_parent) 00597 { 00598 ucPos = appCore->getSimulation()->getObserver().getPosition(); 00599 pos = fromMicroLY((Point3f) ucPos); 00600 00601 predicate = NearestStars; 00602 nStars = DefaultListStars; 00603 00604 hwnd = CreateDialogParam(appInstance, 00605 MAKEINTRESOURCE(IDD_STARBROWSER), 00606 parent, 00607 StarBrowserProc, 00608 reinterpret_cast<LONG>(this)); 00609 }
|
|
|
Definition at line 612 of file winstarbrowser.cpp. References hwnd. 00613 {
00614 SetWindowLong(hwnd, DWL_USER, 0);
00615 }
|
|
|
Definition at line 160 of file starbrowser.cpp. References appSim, BrighterStars, BrightestStars, findStars(), Universe::getSolarSystemCatalog(), Universe::getStarCatalog(), Simulation::getUniverse(), MIN, NearestStars, CloserStarPredicate::pos, SolarSystemPredicate::pos, pos, BrighterStarPredicate::pos, predicate, SolarSystemPredicate::solarSystems, StarsWithPlanets, ucPos, and BrighterStarPredicate::ucPos. Referenced by CelestialBrowser::slotRefresh(). 00161 {
00162 Universe* univ = appSim->getUniverse();
00163 switch(predicate)
00164 {
00165 case BrighterStars:
00166 {
00167 BrighterStarPredicate brighterPred;
00168 brighterPred.pos = pos;
00169 brighterPred.ucPos = ucPos;
00170 return findStars(*(univ->getStarCatalog()), brighterPred, nStars);
00171 }
00172 break;
00173
00174 case BrightestStars:
00175 {
00176 BrightestStarPredicate brightestPred;
00177 return findStars(*(univ->getStarCatalog()), brightestPred, nStars);
00178 }
00179 break;
00180
00181 case StarsWithPlanets:
00182 {
00183 SolarSystemCatalog* solarSystems = univ->getSolarSystemCatalog();
00184 if (solarSystems == NULL)
00185 return NULL;
00186 SolarSystemPredicate solarSysPred;
00187 solarSysPred.pos = pos;
00188 solarSysPred.solarSystems = solarSystems;
00189 return findStars(*(univ->getStarCatalog()), solarSysPred,
00190 MIN(nStars, solarSystems->size()));
00191 }
00192 break;
00193
00194 case NearestStars:
00195 default:
00196 {
00197 CloserStarPredicate closerPred;
00198 closerPred.pos = pos;
00199 return findStars(*(univ->getStarCatalog()), closerPred, nStars);
00200 }
00201 break;
00202 }
00203
00204 return NULL; // keep compiler happy
00205 }
|
|
|
Definition at line 147 of file starbrowser.cpp. References appSim, findStars(), Universe::getStarCatalog(), Simulation::getUniverse(), pos, CloserStarPredicate::pos, and stars. 00148 {
00149 Universe* univ = appSim->getUniverse();
00150 CloserStarPredicate closerPred;
00151 closerPred.pos = pos;
00152 std::vector<const Star*>* stars = findStars(*(univ->getStarCatalog()), closerPred, 1);
00153 const Star *star = (*stars)[0];
00154 delete stars;
00155 return star;
00156 }
|
|
|
Definition at line 217 of file starbrowser.cpp. References appSim, Simulation::getObserver(), Observer::getPosition(), pos, and ucPos. Referenced by setSimulation(), and CelestialBrowser::slotRefresh(). 00218 {
00219 ucPos = appSim->getObserver().getPosition();
00220 pos = (Point3f) ucPos;
00221 }
|
|
|
Definition at line 208 of file starbrowser.cpp. References predicate, and StarsWithPlanets. Referenced by radioClicked(), CelestialBrowser::slotBrighter(), CelestialBrowser::slotBrightest(), CelestialBrowser::slotNearest(), and CelestialBrowser::slotWithPlanets(). 00209 {
00210 if ((pred < NearestStars) || (pred > StarsWithPlanets))
00211 return false;
00212 predicate = pred;
00213 return true;
00214 }
|
|
|
Definition at line 224 of file starbrowser.cpp. References appSim, and refresh(). Referenced by CelestialBrowser::CelestialBrowser(), and dialogStarBrowser().
|
|
|
Definition at line 25 of file winstarbrowser.h. Referenced by StarBrowser(), and StarBrowserProc(). |
|
|
Definition at line 50 of file starbrowser.h. Referenced by listStars(), nearestStar(), refresh(), setSimulation(), and StarBrowser(). |
|
|
Definition at line 27 of file winstarbrowser.h. Referenced by StarBrowser(), WinMain(), and ~StarBrowser(). |
|
|
Definition at line 36 of file winstarbrowser.h. Referenced by StarBrowser(), and StarBrowserProc(). |
|
|
Definition at line 26 of file winstarbrowser.h. Referenced by StarBrowser(), and StarBrowserProc(). |
|
|
Definition at line 32 of file winstarbrowser.h. Referenced by listStars(), nearestStar(), refresh(), StarBrowser(), and StarBrowserProc(). |
|
|
Definition at line 35 of file winstarbrowser.h. Referenced by listStars(), setPredicate(), StarBrowser(), and StarBrowserProc(). |
|
|
Definition at line 33 of file winstarbrowser.h. Referenced by listStars(), refresh(), StarBrowser(), and StarBrowserProc(). |
1.4.1