• 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
  • tools
  • mapreproject
ReadOnlyMapDefinition.cpp
Go to the documentation of this file.
1 #include "ReadOnlyMapDefinition.h"
2 
3 #include "BilinearInterpolation.h"
4 #include "IntegerInterpolation.h"
5 #include "NearestNeighborInterpolation.h"
6 #include "NwwMapImage.h"
7 #include "SimpleMapImage.h"
8 
9 ReadOnlyMapDefinition::ReadOnlyMapDefinition()
10  : m_mapType( UnknownMapSource ),
11  m_interpolationMethod( UnknownInterpolationMethod ),
12  m_baseDirectory(),
13  m_tileLevel( -1 ),
14  m_cacheSizeBytes(),
15  m_filename()
16 {
17 }
18 
19 InterpolationMethod * ReadOnlyMapDefinition::createInterpolationMethod() const
20 {
21  switch ( m_interpolationMethod ) {
22  case IntegerInterpolationMethod:
23  return new IntegerInterpolation;
24  case NearestNeighborInterpolationMethod:
25  return new NearestNeighborInterpolation;
26  case AverageInterpolationMethod:
27  return NULL;
28  case BilinearInterpolationMethod:
29  return new BilinearInterpolation;
30  default:
31  return NULL;
32  }
33 }
34 
35 ReadOnlyMapImage * ReadOnlyMapDefinition::createReadOnlyMap() const
36 {
37  InterpolationMethod * const interpolationMethod = createInterpolationMethod();
38  if ( !interpolationMethod )
39  qFatal( "Unsupported interpolation method: '%i'", m_interpolationMethod );
40 
41  if ( m_mapType == NasaWorldWindMap ) {
42  NwwMapImage * const mapImage = new NwwMapImage( m_baseDirectory, m_tileLevel );
43  interpolationMethod->setMapImage( mapImage );
44  mapImage->setInterpolationMethod( interpolationMethod );
45  mapImage->setCacheSizeBytes( m_cacheSizeBytes );
46  return mapImage;
47  }
48  else if ( m_mapType == BathymetryMap ) {
49  SimpleMapImage * const mapImage = new SimpleMapImage( m_filename );
50  interpolationMethod->setMapImage( mapImage );
51  mapImage->setInterpolationMethod( interpolationMethod );
52  return mapImage;
53  }
54  else {
55  delete interpolationMethod;
56  return NULL;
57  }
58 }
SimpleMapImage.h
SimpleMapImage
Definition: SimpleMapImage.h:12
BilinearInterpolation
Definition: BilinearInterpolation.h:8
IntegerInterpolation
Definition: IntegerInterpolation.h:8
NasaWorldWindMap
Definition: mapreproject.h:11
ReadOnlyMapDefinition::ReadOnlyMapDefinition
ReadOnlyMapDefinition()
Definition: ReadOnlyMapDefinition.cpp:9
InterpolationMethod
Definition: InterpolationMethod.h:8
NwwMapImage::setCacheSizeBytes
void setCacheSizeBytes(int const cacheSizeBytes)
Definition: NwwMapImage.cpp:60
ReadOnlyMapImage
Definition: ReadOnlyMapImage.h:8
NearestNeighborInterpolationMethod
Definition: mapreproject.h:6
SimpleMapImage::setInterpolationMethod
virtual void setInterpolationMethod(InterpolationMethod *const interpolationMethod)
Definition: SimpleMapImage.cpp:28
IntegerInterpolationMethod
Definition: mapreproject.h:5
ReadOnlyMapDefinition::createReadOnlyMap
ReadOnlyMapImage * createReadOnlyMap() const
Definition: ReadOnlyMapDefinition.cpp:35
NearestNeighborInterpolation
Definition: NearestNeighborInterpolation.h:8
IntegerInterpolation.h
NwwMapImage
Definition: NwwMapImage.h:16
NearestNeighborInterpolation.h
UnknownMapSource
Definition: mapreproject.h:10
UnknownInterpolationMethod
Definition: mapreproject.h:4
BilinearInterpolation.h
NwwMapImage::setInterpolationMethod
void setInterpolationMethod(InterpolationMethod *const method)
Definition: NwwMapImage.cpp:65
InterpolationMethod::setMapImage
void setMapImage(ReadOnlyMapImage *const mapImage)
Definition: InterpolationMethod.h:22
BathymetryMap
Definition: mapreproject.h:12
NwwMapImage.h
BilinearInterpolationMethod
Definition: mapreproject.h:8
ReadOnlyMapDefinition.h
AverageInterpolationMethod
Definition: mapreproject.h:7
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 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