[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/marble
From: Inge Wallin <inge () lysator ! liu ! se>
Date: 2007-05-06 19:54:31
Message-ID: 1178481271.181066.387.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 661849 by ingwa:
Cleaning: Make KAtlasGlobe use m_ for all members.
M +4 -1 ChangeLog
M +49 -45 src/katlasglobe.cpp
M +13 -9 src/katlasglobe.h
--- trunk/playground/base/marble/ChangeLog #661848:661849
@@ -1,5 +1,8 @@
+06.05.07 - ingwa
+ Cleaning: Make KAtlasGlobe use m_ for all members.
+
05.05.07 - tackat
- Added the KDE interface
+ Added the KDE interface
29.04.07 - ingwa
Cleaned measuretool.{h,cpp}
--- trunk/playground/base/marble/src/katlasglobe.cpp #661848:661849
@@ -21,7 +21,7 @@
KAtlasGlobe::KAtlasGlobe( QWidget* parent )
: m_parent(parent)
{
- texmapper = 0;
+ m_texmapper = 0;
m_placemarkpainter = 0;
m_placecontainer = 0;
@@ -29,7 +29,7 @@
m_justModified = false;
- m_pPlanetAxis = Quaternion( 1.0, 0.0, 0.0, 0.0 );
+ m_planetAxis = Quaternion( 1.0, 0.0, 0.0, 0.0 );
m_coastimg = new QImage( 10, 10, QImage::Format_ARGB32_Premultiplied );
m_maptheme = new MapTheme();
@@ -52,19 +52,21 @@
}
setMapTheme( selectedmap );
- veccomposer = new VectorComposer();
- gridmap = new GridMap();
- texcolorizer = new TextureColorizer(KAtlasDirs::path("seacolors.leg"), \
KAtlasDirs::path("landcolors.leg")); + m_veccomposer = new VectorComposer();
+ m_gridmap = new GridMap();
+ m_texcolorizer = new TextureColorizer( KAtlasDirs::path( "seacolors.leg" ),
+ KAtlasDirs::path( "landcolors.leg" ) );
- placemarkmanager = new PlaceMarkManager();
- m_placecontainer = placemarkmanager->getPlaceContainer();
+ m_placemarkmanager = new PlaceMarkManager();
+ m_placecontainer = m_placemarkmanager->getPlaceContainer();
- m_placemarkmodel = new PlaceMarkModel( this );
+ m_placemarkmodel = new PlaceMarkModel( this );
m_placemarkmodel->setContainer( m_placecontainer );
}
-KAtlasGlobe::~KAtlasGlobe(){
- delete texmapper;
+KAtlasGlobe::~KAtlasGlobe()
+{
+ delete m_texmapper;
}
@@ -108,12 +110,13 @@
#endif
}
- if ( texmapper == 0 )
- texmapper = new TextureMapper( "maps/earth/" + m_maptheme->tilePrefix() );
+ if ( m_texmapper == 0 )
+ m_texmapper = new TextureMapper( "maps/earth/"
+ + m_maptheme->tilePrefix() );
else
- texmapper->setMap( "maps/earth/" + m_maptheme->tilePrefix() );
+ m_texmapper->setMap( "maps/earth/" + m_maptheme->tilePrefix() );
- texmapper->setMaxTileLevel( TileLoader::maxPartialTileLevel( \
m_maptheme->tilePrefix() ) ); + m_texmapper->setMaxTileLevel( \
TileLoader::maxPartialTileLevel( m_maptheme->tilePrefix() ) );
if ( m_placecontainer == 0)
m_placecontainer = new PlaceContainer("placecontainer");
@@ -137,9 +140,9 @@
QImage::Format_ARGB32_Premultiplied );
m_canvasimg->fill( Qt::transparent );
- texmapper->resizeMap(m_canvasimg);
- veccomposer->resizeMap(m_coastimg);
- gridmap->resizeMap(m_coastimg);
+ m_texmapper->resizeMap( m_canvasimg );
+ m_veccomposer->resizeMap( m_coastimg );
+ m_gridmap->resizeMap( m_coastimg );
QRadialGradient grad1( QPointF( m_canvasimg->width() / 2,
m_canvasimg->height() / 2 ),
@@ -164,16 +167,17 @@
{
if ( needsUpdate() || m_canvasimg->isNull() || m_justModified == true ) {
- texmapper->mapTexture(m_canvasimg, m_radius, m_pPlanetAxis);
+ m_texmapper->mapTexture( m_canvasimg, m_radius, m_planetAxis );
if ( m_maptheme->bitmaplayer().dem == "true" ){
m_coastimg->fill(Qt::transparent);
// Create VectorMap
- veccomposer->drawTextureMap( m_coastimg, m_radius, m_pPlanetAxis );
+ m_veccomposer->drawTextureMap( m_coastimg, m_radius,
+ m_planetAxis );
// Recolorize the heightmap using the VectorMap
- texcolorizer->colorize( m_canvasimg, m_coastimg, m_radius );
+ m_texcolorizer->colorize( m_canvasimg, m_coastimg, m_radius );
}
}
@@ -183,22 +187,22 @@
if ( m_maptheme->vectorlayer().enabled == true ) {
// Add further Vectors
- veccomposer->paintVectorMap( painter, m_radius, m_pPlanetAxis );
+ m_veccomposer->paintVectorMap( painter, m_radius, m_planetAxis );
}
// if ( m_maptheme->vectorlayer().enabled == true ){
QPen gridpen( QColor( 255, 255, 255, 128 ) );
- gridmap->createGrid( m_radius, m_pPlanetAxis );
+ m_gridmap->createGrid( m_radius, m_planetAxis );
- gridmap->setPen( gridpen );
- gridmap->paintGridMap( painter, true );
+ m_gridmap->setPen( gridpen );
+ m_gridmap->paintGridMap( painter, true );
- gridmap->createTropics( m_radius, m_pPlanetAxis );
+ m_gridmap->createTropics( m_radius, m_planetAxis );
gridpen.setStyle( Qt::DotLine );
- gridmap->setPen( gridpen );
- gridmap->paintGridMap( painter, true );
+ m_gridmap->setPen( gridpen );
+ m_gridmap->paintGridMap( painter, true );
// }
@@ -207,12 +211,12 @@
m_canvasimg->width() / 2,
m_canvasimg->height()/ 2,
m_radius, m_placecontainer,
- m_pPlanetAxis );
+ m_planetAxis );
}
- m_pPlanetAxisUpdated = m_pPlanetAxis;
- m_radiusUpdated = m_radius;
- m_justModified = false;
+ m_planetAxisUpdated = m_planetAxis;
+ m_radiusUpdated = m_radius;
+ m_justModified = false;
}
@@ -254,21 +258,21 @@
void KAtlasGlobe::rotateTo(const uint& phi, const uint& theta, const uint& psi)
{
- m_pPlanetAxis.createFromEuler( (float)(phi) / RAD2INT,
- (float)(theta) / RAD2INT,
- (float)(psi) / RAD2INT );
+ m_planetAxis.createFromEuler( (float)(phi) / RAD2INT,
+ (float)(theta) / RAD2INT,
+ (float)(psi) / RAD2INT );
}
void KAtlasGlobe::rotateTo(const float& phi, const float& theta)
{
- m_pPlanetAxis.createFromEuler( (phi + 180.0) * M_PI / 180.0,
- (theta + 180.0) * M_PI / 180.0, 0.0 );
+ m_planetAxis.createFromEuler( (phi + 180.0) * M_PI / 180.0,
+ (theta + 180.0) * M_PI / 180.0, 0.0 );
}
void KAtlasGlobe::rotateBy(const Quaternion& incRot)
{
- m_pPlanetAxis = incRot * m_pPlanetAxis;
+ m_planetAxis = incRot * m_planetAxis;
}
void KAtlasGlobe::rotateBy(const float& phi, const float& theta)
@@ -276,16 +280,16 @@
Quaternion rotPhi( 1.0, phi, 0.0, 0.0 );
Quaternion rotTheta( 1.0, 0.0, theta, 0.0 );
- m_pPlanetAxis = rotTheta * m_pPlanetAxis;
- m_pPlanetAxis *= rotPhi;
- m_pPlanetAxis.normalize();
+ m_planetAxis = rotTheta * m_planetAxis;
+ m_planetAxis *= rotPhi;
+ m_planetAxis.normalize();
}
int KAtlasGlobe::northPoleY()
{
Quaternion northPole = GeoPoint( 0.0f, (float)( -M_PI*0.5 ) ).quaternion();
- Quaternion invPlanetAxis = m_pPlanetAxis.inverse();
+ Quaternion invPlanetAxis = m_planetAxis.inverse();
northPole.rotateAroundAxis(invPlanetAxis);
@@ -295,7 +299,7 @@
int KAtlasGlobe::northPoleZ()
{
Quaternion northPole = GeoPoint( 0.0f, (float)( -M_PI*0.5 ) ).quaternion();
- Quaternion invPlanetAxis = m_pPlanetAxis.inverse();
+ Quaternion invPlanetAxis = m_planetAxis.inverse();
northPole.rotateAroundAxis(invPlanetAxis);
@@ -306,7 +310,7 @@
int& x, int& y )
{
Quaternion qpos = GeoPoint( lng, lat ).quaternion();
- Quaternion invRotAxis = m_pPlanetAxis.inverse();
+ Quaternion invRotAxis = m_planetAxis.inverse();
qpos.rotateAroundAxis(invRotAxis);
@@ -321,9 +325,9 @@
void KAtlasGlobe::addPlaceMarkFile( QString filename )
{
- placemarkmanager->loadKml( filename );
+ m_placemarkmanager->loadKml( filename );
- m_placecontainer = placemarkmanager->getPlaceContainer();
+ m_placecontainer = m_placemarkmanager->getPlaceContainer();
m_placemarkmodel->setContainer( m_placecontainer );
}
--- trunk/playground/base/marble/src/katlasglobe.h #661848:661849
@@ -12,6 +12,7 @@
#ifndef KATLASGLOBE_H
#define KATLASGLOBE_H
+
#include <QtCore/QAbstractListModel>
#include <QtCore/QObject>
#include <QtGui/QPainter>
@@ -29,6 +30,7 @@
#include "texcolorizer.h"
#include "placemarkpainter.h"
+
class PlaceMark;
class PlaceMarkManager;
@@ -36,6 +38,7 @@
@author Torsten Rahn
*/
+
class KAtlasGlobe : public QObject
{
Q_OBJECT
@@ -53,7 +56,7 @@
int radius(){ return m_radius; };
void setRadius(const int&);
- Quaternion getPlanetAxis(){ return m_pPlanetAxis; };
+ Quaternion getPlanetAxis(){ return m_planetAxis; };
// This method provides a way to center on lat = +90(N) - -90(S) and lng = \
+180(W) - -180(E) @@ -72,7 +75,7 @@
bool screenCoordinates( const float lng, const float lat, int& x, int& y );
- bool needsUpdate() const { return !( m_radius == m_radiusUpdated && \
m_pPlanetAxis == m_pPlanetAxisUpdated ); } + bool needsUpdate() const { return !( \
m_radius == m_radiusUpdated && m_planetAxis == m_planetAxisUpdated ); }
void addPlaceMarkFile( QString filename );
@@ -93,18 +96,19 @@
// View and paint stuff
MapTheme *m_maptheme;
- TextureColorizer *texcolorizer;
- TextureMapper *texmapper;
- VectorComposer *veccomposer;
- GridMap *gridmap;
+ TextureColorizer *m_texcolorizer;
+ TextureMapper *m_texmapper;
+ VectorComposer *m_veccomposer;
+ GridMap *m_gridmap;
- PlaceMarkManager *placemarkmanager;
+ // Places on the map
+ PlaceMarkManager *m_placemarkmanager;
PlaceMarkModel *m_placemarkmodel;
PlaceMarkPainter *m_placemarkpainter;
PlaceContainer *m_placecontainer;
- Quaternion m_pPlanetAxis;
- Quaternion m_pPlanetAxisUpdated;
+ Quaternion m_planetAxis;
+ Quaternion m_planetAxisUpdated;
int m_radius;
int m_radiusUpdated;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic