Advertisement
Guest User

satitem.cpp

a guest
May 23rd, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 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. GeoDataCoordinates coordinates0 = GeoDataCoordinates( 0, 0, 20000.0 * 1000, GeoDataCoordinates::Degree );
  36. coordinates0.setType(1);
  37. coordinates0.setTime(20);
  38. m_track->addPoint( m_clock->dateTime(), coordinates0);
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement