Skip to content
Christian Haettich edited this page Jan 24, 2016 · 3 revisions

Adding and Removing Satellites

Adding

// inserts a satellite with 
// id=0, azimuth = 0 degree, elevation = 90 degree
// label=QString("")
// outercolor=Qt::red
// innerColor=Qt::lightGray
// fontColor=Qt::black
// sate = SatelliteState::Visible
skyplotWidget->insert( 0 );

// inserts a satellite with the same setup as above, but with
// id=1, azimuth = 20 degree, elevation = 45 degree
skyplotWidget->insert( 1, 20, 45 );

// inserts a satellite with 
// id=2, azimuth = 80 degree, elevation = 15 degree,
// label = "3",
// outerColor= Qt::red,
// innerColor=Qt::yellow,
// fontColor=Qt::blue
// and with half-visible but marked state
skyplotWidget->insert( 2, 80, 15,  QString( "3" ), Qt::red, Qt::yellow, Qt::blue,
      SkyplotWidget::SatelliteState::HalfVisible |
      SkyplotWidget::SatelliteState::Marked 
         );

Removing

// removes satellite with id==2
skyplotWidget->remove( 2 );

Existance check

// returns true if there is a satellite with id==2
skyplotWidget->contains( 2 );

Modifying Satellites

Modifying the position

// changes the position of satellite with id == 3 to azimuth = 120.5 and elevation = 45.0
skyplotWidget->setAzimuth( 3, 120.5 );
skyplotWidget->setElevation( 3, 45.0 );

Modifying the label

// changes the label to 'x4'
skyplotWidget->setLabel( 4, QString('x4') );

Modifying the color

// changes the color of the ring (the border, only visible when state is marked)
skyplotWidget->setOuterColor( 5, Qt::red );

// changes the color of the filling of the circle
skyplotWidget->setInnerColor( 5, Qt::yellow );

// changes the color of the label
skyplotWidget->setFontColor( 5, Qt::blue );

Change the state

// set satellite with id==6 as visible
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::Visible );

// set satellite with id==6 as half-visible
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::HalfVisible );

// set satellite with id==6 as half-visible and flashing
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::HalfVisible |
                            SkyplotWidget::SatelliteState::Flashing  );

// set satellite with id==6 as half-visible, flashing and marked
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::HalfVisible |
                            SkyplotWidget::SatelliteState::Flashing    |
                            SkyplotWidget::SatelliteState::Marked );


// Invisible beats everything else. 
// The following will result in an invisible satellite
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::Invisible
                            SkyplotWidget::SatelliteState::HalfVisible );
// and Visible beats visible. So the following 
// will be fully visible:
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::Visible
                            SkyplotWidget::SatelliteState::HalfVisible );

// If no visibility is defined, the satellite will not be visible, e.g.
skyplotWidget->setState( 6, SkyplotWidget::SatelliteState::Flashing );

Iterating over all IDs

// sets all satellites into the half-visible state
for( auto id : skyplotWidget->ids() )
{
   skyplotWidget->setState( id, SkyplotWidget::SatelliteState::HalfVisible );
}

Modifying the Widget

// set the margin between the 0 degree circle and the boarder
void     setMarginScale    ( float          scale ); 

// set the size of the satellites relative to the widget size
void     setSatelliteScale ( float          scale );

// set the font size relative to the widget size
void     setFontScale      ( float          scale );

// set the grid color
void     setGridColor      ( const QColor & color );

// set the gird width
void     setGridWidth      ( int            width );

// set the number of elevation ellipses
void     setEllipses       ( int               no );

// set the number of azimuth crosses
void     setCrosses        ( int               no );

// set the margin of the grid-labels
void     setTextMargin     ( int           margin );

// set the blinking interval
void     setBlinkIntervall ( int        intervall );

// turn on/off grid labels
void     setWithGridLabels ( int       withLabels );

// turn on/off anti-aliasing
void     setAntialiased    ( int      antialiased );