• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Member Functions | Static Public Member Functions | List of all members
SkyQPainter Class Reference

#include <skyqpainter.h>

Inheritance diagram for SkyQPainter:
Inheritance graph
[legend]

Public Member Functions

 SkyQPainter (QPaintDevice *pd, const QSize &canvasSize)
 
 SkyQPainter (QPaintDevice *pd)
 
 SkyQPainter (QWidget *widget, QPaintDevice *pd=0)
 
virtual ~SkyQPainter ()
 
virtual void begin ()
 
virtual bool drawDeepSkyObject (DeepSkyObject *obj, bool drawImage=false)
 
virtual void drawDeepSkySymbol (const QPointF &pos, int type, float size, float e, float positionAngle)
 
virtual void drawFlags ()
 
virtual void drawHorizon (bool filled, SkyPoint *labelPoint=0, bool *drawLabel=0)
 
virtual void drawObservingList (const QList< SkyObject * > &obs)
 
virtual bool drawPlanet (KSPlanetBase *planet)
 
virtual bool drawPointSource (SkyPoint *loc, float mag, char sp= 'A')
 
virtual void drawPointSource (const QPointF &pos, float size, char sp= 'A')
 
virtual void drawSatellite (Satellite *sat)
 
virtual void drawSkyBackground ()
 
virtual void drawSkyLine (SkyPoint *a, SkyPoint *b)
 
virtual void drawSkyPolygon (LineList *list)
 
virtual void drawSkyPolyline (LineList *list, SkipList *skipList=0, LineListLabel *label=0)
 
virtual bool drawSupernova (Supernova *sup)
 
virtual void end ()
 
bool getVectorStars () const
 
virtual void setBrush (const QBrush &brush)
 
virtual void setPen (const QPen &pen)
 
void setVectorStars (bool vectorStars)
 
- Public Member Functions inherited from SkyPainter
 SkyPainter ()
 
virtual ~SkyPainter ()
 
void setSizeMagLimit (float sizeMagLim)
 
float starWidth (float mag) const
 

Static Public Member Functions

static void initStarImages ()
 

Additional Inherited Members

- Protected Attributes inherited from SkyPainter
SkyMap * m_sm
 

Detailed Description

The QPainter-based painting backend.

This class implements the SkyPainter interface using a QPainter. For documentation,

See also
SkyPainter.

Definition at line 32 of file skyqpainter.h.

Constructor & Destructor Documentation

SkyQPainter::SkyQPainter ( QPaintDevice *  pd,
const QSize &  canvasSize 
)

Creates a SkyQPainter with the given QPaintDevice and uses the dimensions of the paint device as canvas dimensions.

Parameters
pdthe painting device. Cannot be 0
canvasSizethe size of the canvas

Definition at line 87 of file skyqpainter.cpp.

SkyQPainter::SkyQPainter ( QPaintDevice *  pd)

Creates a SkyQPainter with the given QPaintDevice and given canvas size.

Parameters
pdthe painting device. Cannot be 0

Definition at line 78 of file skyqpainter.cpp.

SkyQPainter::SkyQPainter ( QWidget *  widget,
QPaintDevice *  pd = 0 
)
explicit

Creates a SkyQPainter given a QWidget and an optional QPaintDevice.

Parameters
widgetthe QWidget that provides the canvas size, and also the paint device unless pd is specified
pdthe painting device. If 0, then widget will be used.

Definition at line 96 of file skyqpainter.cpp.

SkyQPainter::~SkyQPainter ( )
virtual

Definition at line 106 of file skyqpainter.cpp.

Member Function Documentation

void SkyQPainter::begin ( )
virtual

Begin painting.

Note
this function must be called before painting anything.
See also
end()

Implements SkyPainter.

Definition at line 110 of file skyqpainter.cpp.

bool SkyQPainter::drawDeepSkyObject ( DeepSkyObject *  obj,
bool  drawImage = false 
)
virtual

Draw a deep sky object.

Parameters
objthe object to draw
drawImageif true, try to draw the image of the object
Returns
true if it was drawn

Implements SkyPainter.

Definition at line 424 of file skyqpainter.cpp.

void SkyQPainter::drawDeepSkySymbol ( const QPointF &  pos,
int  type,
float  size,
float  e,
float  positionAngle 
)
virtual

Definition at line 468 of file skyqpainter.cpp.

void SkyQPainter::drawFlags ( )
virtual

Draw flags.

Implements SkyPainter.

Definition at line 718 of file skyqpainter.cpp.

void SkyQPainter::drawHorizon ( bool  filled,
SkyPoint *  labelPoint = 0,
bool *  drawLabel = 0 
)
virtual

Implements SkyPainter.

Definition at line 750 of file skyqpainter.cpp.

void SkyQPainter::drawObservingList ( const QList< SkyObject * > &  obs)
virtual

Draw the symbols for the observing list.

Parameters
obsthe oberving list

Implements SkyPainter.

Definition at line 703 of file skyqpainter.cpp.

bool SkyQPainter::drawPlanet ( KSPlanetBase *  planet)
virtual

Draw a planet.

Parameters
planetthe planet to draw
Returns
true if it was drawn

Implements SkyPainter.

Definition at line 320 of file skyqpainter.cpp.

bool SkyQPainter::drawPointSource ( SkyPoint *  loc,
float  mag,
char  sp = 'A' 
)
virtual

Draw a point source (e.g., a star).

Parameters
locthe location of the source in the sky
magthe magnitude of the source
spthe spectral class of the source
Returns
true if a source was drawn

Implements SkyPainter.

Definition at line 371 of file skyqpainter.cpp.

void SkyQPainter::drawPointSource ( const QPointF &  pos,
float  size,
char  sp = 'A' 
)
virtual

This function exists so that we can draw other objects (e.g., planets) as point sources.

Definition at line 386 of file skyqpainter.cpp.

void SkyQPainter::drawSatellite ( Satellite *  sat)
virtual

Draw a satellite.

Implements SkyPainter.

Definition at line 766 of file skyqpainter.cpp.

void SkyQPainter::drawSkyBackground ( )
virtual

Draw the sky background.

Implements SkyPainter.

Definition at line 124 of file skyqpainter.cpp.

void SkyQPainter::drawSkyLine ( SkyPoint *  a,
SkyPoint *  b 
)
virtual

Draw a line between points in the sky.

Parameters
athe first point
bthe second point
Note
this function will skip lines not on screen and clip lines that are only partially visible.

Implements SkyPainter.

Definition at line 231 of file skyqpainter.cpp.

void SkyQPainter::drawSkyPolygon ( LineList *  list)
virtual

Draw a polygon in the sky.

Parameters
lista list of points in the sky
See also
drawSkyPolyline()

Implements SkyPainter.

Definition at line 282 of file skyqpainter.cpp.

void SkyQPainter::drawSkyPolyline ( LineList *  list,
SkipList *  skipList = 0,
LineListLabel *  label = 0 
)
virtual

Draw a polyline in the sky.

Parameters
lista list of points in the sky
skipLista SkipList object used to control skipping line segments
labela pointer to the label for this line
Note
it's more efficient to use this than repeated calls to drawSkyLine(), because it avoids an extra points->size() -2 projections.

Implements SkyPainter.

Definition at line 249 of file skyqpainter.cpp.

bool SkyQPainter::drawSupernova ( Supernova *  sup)
virtual

Draw a Supernova.

Implements SkyPainter.

Definition at line 796 of file skyqpainter.cpp.

void SkyQPainter::end ( )
virtual

End and finalize painting.

Note
this function must be called after painting anything.
it is not guaranteed that anything will actually be drawn until end() is called.
See also
begin();

Implements SkyPainter.

Definition at line 119 of file skyqpainter.cpp.

bool SkyQPainter::getVectorStars ( ) const
inline

Definition at line 65 of file skyqpainter.h.

void SkyQPainter::initStarImages ( )
static

Recalculates the star pixmaps.

Definition at line 140 of file skyqpainter.cpp.

void SkyQPainter::setBrush ( const QBrush &  brush)
virtual

Set the brush of the painter.

Implements SkyPainter.

Definition at line 135 of file skyqpainter.cpp.

void SkyQPainter::setPen ( const QPen &  pen)
virtual

Set the pen of the painter.

Implements SkyPainter.

Definition at line 130 of file skyqpainter.cpp.

void SkyQPainter::setVectorStars ( bool  vectorStars)
inline
Parameters
vectorStarsDraw stars as vector graphics whenever possible.
Note
Drawing stars as vectors is slower, but is better when saving .svg files. Set to true only when you are drawing on a canvas where speed doesn't matter. Definitely not when drawing on the SkyMap.

Definition at line 64 of file skyqpainter.h.


The documentation for this class was generated from the following files:
  • skyqpainter.h
  • skyqpainter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal