Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Start of 3D map configuration widget
- Loading branch information
Showing
16 changed files
with
193 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "qgs3dmapconfigwidget.h" | ||
|
||
#include "map3d.h" | ||
#include "demterraingenerator.h" | ||
|
||
#include "qgsrasterlayer.h" | ||
//#include "qgsproject.h" | ||
|
||
Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( const Map3D *map, QWidget *parent ) | ||
: QWidget( parent ) | ||
, mMap( nullptr ) | ||
{ | ||
setupUi( this ); | ||
|
||
mMap = new Map3D( *map ); | ||
|
||
cboTerrainLayer->setAllowEmptyLayer( true ); | ||
cboTerrainLayer->setFilters( QgsMapLayerProxyModel::RasterLayer ); | ||
|
||
TerrainGenerator *terrainGen = mMap->terrainGenerator.get(); | ||
if ( terrainGen && terrainGen->type() == TerrainGenerator::Dem ) | ||
{ | ||
DemTerrainGenerator *demTerrainGen = static_cast<DemTerrainGenerator *>( terrainGen ); | ||
spinTerrainResolution->setValue( demTerrainGen->resolution() ); | ||
cboTerrainLayer->setLayer( demTerrainGen->layer() ); | ||
} | ||
else | ||
{ | ||
cboTerrainLayer->setLayer( nullptr ); | ||
spinTerrainResolution->setEnabled( false ); | ||
} | ||
|
||
spinTerrainScale->setValue( mMap->zExaggeration ); | ||
spinMapResolution->setValue( mMap->tileTextureSize ); | ||
spinScreenError->setValue( mMap->maxTerrainError ); | ||
chkShowTileInfo->setChecked( mMap->drawTerrainTileInfo ); | ||
chkShowBoundingBoxes->setChecked( mMap->showBoundingBoxes ); | ||
} | ||
|
||
Qgs3DMapConfigWidget::~Qgs3DMapConfigWidget() | ||
{ | ||
delete mMap; | ||
} | ||
|
||
Map3D *Qgs3DMapConfigWidget::map() | ||
{ | ||
// TODO: update terrain settings | ||
|
||
mMap->zExaggeration = spinTerrainScale->value(); | ||
mMap->tileTextureSize = spinMapResolution->value(); | ||
mMap->maxTerrainError = spinScreenError->value(); | ||
mMap->drawTerrainTileInfo = chkShowTileInfo->isChecked(); | ||
mMap->showBoundingBoxes = chkShowBoundingBoxes->isChecked(); | ||
|
||
return mMap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef QGS3DMAPCONFIGWIDGET_H | ||
#define QGS3DMAPCONFIGWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
#include <ui_map3dconfigwidget.h> | ||
|
||
class Map3D; | ||
|
||
class Qgs3DMapConfigWidget : public QWidget, private Ui::Map3DConfigWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
//! construct widget. does not take ownership of the passed map. | ||
explicit Qgs3DMapConfigWidget( const Map3D *map, QWidget *parent = nullptr ); | ||
~Qgs3DMapConfigWidget(); | ||
|
||
Map3D *map(); | ||
|
||
signals: | ||
|
||
public slots: | ||
|
||
private: | ||
Map3D *mMap; | ||
}; | ||
|
||
#endif // QGS3DMAPCONFIGWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters