Advertisement
Guest User

SatItem.cpp

a guest
May 16th, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. #include "satitem.h"
  2.  
  3. #include <GeoDataStyle.h>
  4. #include <GeoDataDocument.h>
  5.  
  6. #include <QDebug>
  7.  
  8. SatItem::SatItem(const MarbleClock* clock, GeoDataTreeModel* geoDataTreeModel)
  9.     : i(0),
  10.       m_clock(clock)
  11. {
  12.     m_track_line_string = new GeoDataLineString();
  13.     //m_track = new GeoDataTrack();
  14.     QString satelliteName("test");
  15.     geoDataPlacemark = new GeoDataPlacemark(satelliteName);
  16.  
  17.     geoDataPlacemark->setVisualCategory( GeoDataFeature::Satellite );
  18.     geoDataPlacemark->setGeometry( m_track_line_string );
  19.     //geoDataPlacemark->setGeometry( m_track );
  20.     GeoDataStyle *style = new GeoDataStyle( *geoDataPlacemark->style() );
  21.     geoDataPlacemark->setStyle( style );
  22.     geoDataPlacemark->style()->lineStyle().setColor( oxygenBrickRed4 );
  23.     geoDataPlacemark->style()->lineStyle().setPenStyle( Qt::SolidLine );
  24.     geoDataPlacemark->style()->labelStyle().setGlow( true );
  25.  
  26.  
  27.     GeoDataDocument *geoDataContainer = new GeoDataDocument();
  28.     geoDataContainer->setFileName("container_" + satelliteName);
  29.     geoDataContainer->append( geoDataPlacemark );
  30.     geoDataTreeModel->addDocument(geoDataContainer);
  31. }
  32.  
  33. void SatItem::update()
  34. {
  35.     if (360 < i)
  36.         return;
  37.     GeoDataCoordinates coordinates = GeoDataCoordinates( i, 0, 20000.0 * 1000, GeoDataCoordinates::Degree );
  38.     m_track_line_string->append(coordinates);
  39.     //m_track->addPoint(m_clock->dateTime(), coordinates);
  40.     i++;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement