[Kstars-devel] kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Sat Aug 30 02:55:25 CEST 2003
CVS commit by harris:
Implemented Arbitrary Zoom feature. Hold down CTRL key + LMB while
dragging the mouse. A rectangle will be drawn on the map centered on the
initial click position, and passing through the current cursor position.
The rectangle's aspect ratio is fixed to that of the SkyMap widget. When
you let go of LMB, the display will be zoomed so that the region defined
by the rectangle fills the display. If you release CTRL and continue
dragging the mouse, the operation is canceled.
To get this working, I have added a function SkyMap::drawOverlays(
QPixmap* ). This is a container function that calls draw routines for all
items that are not part of the actual sky map, but are drawn on top of it.
Currently, drawOverlays calls drawBoxes(), drawTargetSymbol(),
drawTelescopeSymbols(), and the new function drawZoomBox(); each passes a
reference to the sky's QPainter.
The cool thing about drawOverlay() is that the overlay objects can be
updated *much* more rapidly than the skymap itself. Just call
SkyMap::update() instead of SkyMap::forceUpdate() to use the stored Sky
pixmap instead of recomputing it. Without this separation, updating the
ZoomBox as the mouse moves would not be practical.
Future ideas for drawOverlay() include things like:
+ Transient labeling of objects as the mouse hovers over them
(could even have the label fade away after the mouse moves :).
+ Mouse cursor's RA,Dec coords drawn next to mouse cursor,
instead of in the status bar.
+ DCOP functions to add arbitrary text, lines, points, arrows, etc.
(useful for classroom demos?)
TODO:
- Should have a similar Zoom-out function, but how?
- Change the mouse cursor to a "zoom" cursor in this mode?
CCMAIL: kstars-devel at kde.org
M +2 -7 skymap.cpp 1.109
M +11 -3 skymap.h 1.46
M +170 -155 skymapdraw.cpp 1.31
M +64 -10 skymapevents.cpp 1.68
More information about the Kstars-devel
mailing list