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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • apps
  • marble-ui
MarbleTest.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2006-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 #include "MarbleTest.h"
13 
14 #include <QCoreApplication>
15 #include <QTime>
16 #include <QMessageBox>
17 #include <QFileDialog>
18 
19 #include <MarbleGlobal.h>
20 #include <MarbleDebug.h>
21 #include <MarbleWidget.h>
22 #include <MarbleModel.h>
23 
24 using namespace Marble;
25 
26 MarbleTest::MarbleTest( MarbleWidget* marbleWidget )
27  : m_marbleWidget(marbleWidget)
28 {
29 }
30 
31 void MarbleTest::timeDemo()
32 {
33  QMessageBox::information(m_marbleWidget, QString( "Marble Speed Test" ), QString( "Press Ok to start test" ) );
34 
35  m_marbleWidget->setViewContext( Marble::Animation );
36 
37  for ( int k = 0; k < 10; ++k ) {
38  m_marbleWidget->moveRight( Instant );
39  QCoreApplication::flush();
40  m_marbleWidget->repaint();
41  }
42  for ( int k = 0; k < 10; ++k ) {
43  m_marbleWidget->moveLeft( Instant );
44  QCoreApplication::flush();
45  m_marbleWidget->repaint();
46  }
47 
48  qDebug() << "Starting Performance Test";
49 
50  QTime t;
51  t.start();
52 
53  for ( int j = 0; j < 10; ++j ) {
54  for ( int k = 0; k < 10; ++k ) {
55  m_marbleWidget->moveRight( Instant );
56  QCoreApplication::flush();
57  m_marbleWidget->repaint();
58  }
59  for ( int k = 0; k < 10; ++k ) {
60  m_marbleWidget->moveLeft( Instant );
61  QCoreApplication::flush();
62  m_marbleWidget->repaint();
63  }
64  }
65 
66  qDebug( "Timedemo finished in %ims", t.elapsed() );
67  qDebug() << QString("= %1 fps").arg(200*1000/(qreal)(t.elapsed()));
68 
69 }
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::MarbleWidget::moveLeft
void moveLeft(FlyToMode mode=Automatic)
Move left by the moveStep.
Definition: MarbleWidget.cpp:707
MarbleDebug.h
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
Marble::Animation
animated view (e.g. while rotating the globe)
Definition: MarbleGlobal.h:74
MarbleGlobal.h
Marble::MarbleWidget::setViewContext
void setViewContext(ViewContext viewContext)
Set the view context (i.e.
Definition: MarbleWidget.cpp:1129
MarbleTest.h
Marble::MarbleTest::timeDemo
void timeDemo()
Definition: MarbleTest.cpp:31
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::Instant
Change camera position immediately (no interpolation)
Definition: MarbleGlobal.h:171
Marble::MarbleTest::MarbleTest
MarbleTest(MarbleWidget *marbleWidget)
Definition: MarbleTest.cpp:26
Marble::MarbleWidget::moveRight
void moveRight(FlyToMode mode=Automatic)
Move right by the moveStep.
Definition: MarbleWidget.cpp:712
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • 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