Static Public Member Functions

Detailed Description

Provides functions for performing openGL drawing operations.

All coordinates are converted using the StelProjector instance passed at construction. Because openGL is not thread safe, only one instance of StelPainter can exist at a time, enforcing thread safety. As a coding rule, no openGL calls should be performed when no instance of StelPainter exist. Typical usage is to create a local instance of StelPainter where drawing operations are needed.

Draw a small circle arc between points start and stop with rotation point in rotCenter.

The angle between start and stop must be < 180 deg. Each time the small circle crosses the edge of the viewport, the viewportEdgeIntersectCallback is called with the screen 2d position, direction of the currently drawn arc toward the inside of the viewport. If rotCenter is equal to 0,0,0, the method draws a great circle.

void StelPainter::drawCircle

(

double

x,

double

y,

double

r

)

const

Draw a simple circle, 2d viewport coordinates in pixel.

void StelPainter::drawSprite2dMode

(

double

x,

double

y,

double

size

)

const

Draw a square using the current texture at the given projected 2d position.

Parameters:

x

x position in the viewport in pixel.

y

y position in the viewport in pixel.

size

the size of a square side in pixel.

void StelPainter::drawSprite2dMode

(

double

x,

double

y,

double

size,

double

rotation

)

const

Draw a rotated square using the current texture at the given projected 2d position.

Parameters:

x

x position in the viewport in pixel.

y

y position in the viewport in pixel.

size

the size of a square side in pixel.

rotation

rotation angle in degree.

void StelPainter::drawRectSprite2dMode

(

double

x,

double

y,

double

sizex,

double

sizey,

double

rotation

)

const

Draw a rotated rectangle using the current texture at the given projected 2d position.

Parameters:

x

x position in the viewport in pixel.

y

y position in the viewport in pixel.

sizex

the size of the rectangle x side in pixel.

sizey

the size of the rectangle y side in pixel.

rotation

rotation angle in degree.

void StelPainter::drawPoint2d

(

double

x,

double

y

)

const

Draw a GL_POINT at the given position.

Parameters:

x

x position in the viewport in pixels.

y

y position in the viewport in pixels.

void StelPainter::sSphere

(

GLdouble

radius,

GLdouble

oneMinusOblateness,

GLint

slices,

GLint

stacks,

int

orientInside = 0

)

const

Re-implementation of gluSphere : glu is overridden for non-standard projection.

void StelPainter::sCylinder

(

GLdouble

radius,

GLdouble

height,

GLint

slices,

GLint

stacks,

int

orientInside = 0

)

const

Re-implementation of gluCylinder : glu is overridden for non-standard projection.

void StelPainter::sFanDisk

(

double

radius,

int

innerFanSlices,

int

level

)

const

Draw a disk with a special texturing mode having texture center at center of disk.

The disk is made up of concentric circles with increasing refinement. The number of slices of the outmost circle is (innerFanSlices<<level).

Parameters:

radius

the radius of the disk.

innerFanSlices

the number of slices.

level

the numbe of concentric circles.

void StelPainter::sDisk

(

GLdouble

radius,

GLint

slices,

GLint

stacks,

int

orientInside = 0

)

const

Draw a disk with a special texturing mode having texture center at center.