[Kstars-devel] Refined patch for wishlist 178232: List all objects within a rectangle

Abhijit Apte abhijit.apte at gmail.com
Mon Feb 8 14:54:10 CET 2010


Hi Alexey,

Attaching the patch with your comments incorporated.

Rgds
-Abhi

On Fri, Feb 5, 2010 at 9:36 PM, Khudyakov Alexey
<alexey.skladnoy at gmail.com>wrote:

> В сообщении от Пятница 05 февраля 2010 07:23:24 Abhijit Apte написал:
> > Two reasons:
> > 1) Have added the function skyRegion() as a separate function because
> later
> > on we can scale it up to support a user-defined region.. Then one has to
> >  do, is to write overloaded functions for skyRegion(). Say user wants to
> >  select from a circular region or a polygon for instance. I think it's
> fine
> >  to add this skyRegion() function for now.
> >
> Valid argument. But shouln'd it belong to SkyMesh then? It doesn't use
> SkyMapComposite at all.
>
>
> > 2) The problem with making SkyPoint p1 and p2 const:
> > While filling up the list with operator<<, it'd become a problem since
> >  QList is instantiated with SkyPoint* whereas the arguments are of type
> >  "const SkyPoint*".
> >
> /home/kde-devel/kde/src/KDE/refactor/kdeedu/kstars/kstars/skycomponents/sky
> > mapcomposite.cpp: In member function ‘QList<SkyObject*>
> > SkyMapComposite::findObjectsInArea(const SkyPoint&, const SkyPoint&)’:
> >
> /home/kde-devel/kde/src/KDE/refactor/kdeedu/kstars/kstars/skycomponents/sky
> > mapcomposite.cpp:348: error: invalid conversion from ‘const SkyPoint*’ to
> >  ‘SkyPoint*’
> >
> /home/kde-devel/kde/src/KDE/refactor/kdeedu/kstars/kstars/skycomponents/sky
> > mapcomposite.cpp:348: error:   initializing argument 1 of ‘QVector<T>&
> > QVector<T>::operator<<(const T&) [with T = SkyPoint*]’
> >
> Just copy them. It's possible to use const_cast. But copying is more robust
> and cheap anyway.
>
> SkyPoint p1copy = p1;
> SkyPoint p2copy = p2;
>
>
>
> > > 4. If object doesn't visible it shouldn't get listed. You can use
> > > `selected()'
> > > to determine whether component visible.
> >
> > You mean the objects below horizon?
> > I didn't quite understand this -- I noticed each component has this
> > selected() function. Did you mean the following because the component
> views
> > can be toggled from toolbar?? If you are referring to it, it's a good
> catch
> > ! :)
> > if( m_Stars->selected() ) m_Stars->findObjectsInArea(p1,p2)
> > if( m_DeepSky->selected() ) m_DeepSky->findObjectsInArea(p1,p2)
> >
> Exactly
> _______________________________________________
> Kstars-devel mailing list
> Kstars-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kstars-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kstars-devel/attachments/20100208/eec4b8a8/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_8feb.diff
Type: text/x-patch
Size: 15480 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20100208/eec4b8a8/attachment.diff 


More information about the Kstars-devel mailing list