[Kstars-devel] KDE/kdeedu/kstars/kstars/tools
Jason Harris
kstars at 30doradus.org
Sun Jul 13 16:40:24 CEST 2008
Hi,
On Sun, Jul 13, 2008 at 12:42 AM, Akarsh Simha <akarshsimha at gmail.com> wrote:
> What about comets and asteroids for the "solar system only" objects? I
> plan to extend it to that as well.
>
Yes. In my original message, I suggest using a subclassed FindDialog
in this case as well. Probably both kinds of FindDialogs can be
implemented with the same subclass, just add a couple of bool
paramaters to the ctor:
ConjunctFindDialogUI::ConjunctFindDialogUI( QWidget *parent, bool
solarSystemOnly, bool restrictEcLat ) {
setupUi( this );
FilterType->addItem( i18n ("Any") );
if ( ! solarSystemOnly ) {
FilterType->addItem( i18n ("Stars") );
FilterType->addItem( i18n ("Open Clusters") );
FilterType->addItem( i18n ("Globular Clusters") );
FilterType->addItem( i18n ("Gaseous Nebulae") );
FilterType->addItem( i18n ("Planetary Nebulae") );
FilterType->addItem( i18n ("Galaxies") );
FilterType->addItem( i18n ("Constellations") );
}
FilterType->addItem( i18n ("Solar System") );
FilterType->addItem( i18n ("Comets") );
FilterType->addItem( i18n ("Asteroids") );
SearchList->setMinimumWidth( 256 );
SearchList->setMinimumHeight( 320 );
}
ConjunctFindDialog::ConjunctFindDialog( QWidget* parent, bool
solarSystemOnly, bool restrictEcLat )
: KDialog( parent ), timer(0)
{
ui = new ConjunctFindDialogUI( this, solarSystemOnly, restrictEcLat );
...
}
You'll have to modify the "case 0:" code in init() because we don't
really want *All* object types if solarSystemOnly is true. A similar
change is required in initSelection().
That may be all you need for solarSystemOnly. restrictEcLat is a bit
more tricky. Checking every object's ecliptic latitude before adding
t to the list is going to be *slow*. To streamline it, you could
pre-cache a list of objects with EcLat < |Xmax|, where Xmax is the
maximum ecl. lat. of the object that deviates the most from the
ecliptic (either the moon or pluto, not sure which). Actually, comets
and asteroids have huge ecliptic deviations; they can essentially be
found anywhere. So maybe we should forget about restrictEcLat...
regards,
Jason
> Regards
> Akarsh
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIebHpkAo+aFFLL8MRAiINAJ9YYajZiAw5VCgG+xJfspg2wKXR4wCgpC9+
> xnL7u1N8MpNP7Zz7OwTS/3c=
> =nV/Z
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Kstars-devel mailing list
> Kstars-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kstars-devel
>
>
More information about the Kstars-devel
mailing list