[Kstars-devel] RFC: Refactoring of SkyMap
Thomas Kabelmann
thomas.kabelmann at gmx.de
Thu Jul 28 13:49:00 CEST 2005
Hi Jason,
than I will start the work this weekend. Unfortunately I can't download the
repository from svn using my account. Last time I've worked on kstars cvs was
running and worked for me. Perhaps my account was disabled while moving to
svn or I've made a mistake in the svn command. I've tried "svn co
svn://kabelmann@svn.kde.org/home/kde/trunk/KDE/kdeedu" but I get following
message: "svn: Can't connect to host 'svn.kde.org': Connection refused". Do
you know, who is responsible for svn accounts, so that I can ask him?
Cheers,
Thomas
Am Mittwoch, 27. Juli 2005 18:15 schrieben Sie:
> Hi Thomas,
>
> I think this is a great idea.
>
> regards,
> Jason
>
> On Wednesday 27 July 2005 05:02 am, Thomas Kabelmann wrote:
> > Hi everyone,
> >
> > while looking in the code of current svn head, I found that class SkyMap
> > is a big mess. A "wc -l skymap*" says that ~5000 lines are in that class
> > (comments and free lines included).
> >
> > My idea for refactoring the class is following:
> > - split SkyMap into SkyMap + SkyMapElements
> > - SkyMap stores all data like focus and so on
> > - SkyMapElement is an interface for all drawable elements (like horizon,
> > milkyway, ...)
> > - each element implements this interface so the skymap can store all
> > elements in a list -- the advantage is, skymap doesn't need a member
> > variable for each element and adding new elements just require to add
> > this in the implemenation of skymap, not in the interface
> >
> > Here is some pseudo code for sketching my idea:
> >
> > class SkyMap
> > {
> > ...
> > SkyMap() {
> > elementList = new QList();
> > elementList.add(new Horizon());
> > ...
> > elementList.add(new CoordinatGrid());
> > }
> >
> > QList elementList;
> > paintEvent()
> > {
> > foreach (element in elementList)
> > element->draw();
> > }
> > }
> >
> > class SkyMapElement
> > {
> > SkyMap *map;
> > public:
> > SkyMapElement(SkyMap *m) { map = m; }
> > virtual void draw() = 0;
> > }
> >
> > class Horizon : SkyMapElement
> > {
> > void draw()
> > {
> > if (!Options::drawHorizon) return;
> > // insert drawing code here
> > }
> > }
> >
> > The API is perhaps not complete, it's just an idea at this time. Any
> > ideas, comments?
> >
> > Regards,
> > Thomas
> > _______________________________________________
> > 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