16 #ifndef QGS3DSCENEEXPORTER_H
17 #define QGS3DSCENEEXPORTER_H
19 #include <Qt3DCore/QEntity>
20 #include <Qt3DRender/QAttribute>
21 #include <Qt3DExtras/QPlaneGeometry>
22 #include <Qt3DRender/QSceneLoader>
23 #include <Qt3DRender/QMesh>
31 class QgsTerrainTileEntity;
32 class QgsTerrainEntity;
38 class QgsTerrainTextureGenerator;
72 bool parseVectorLayerEntity( Qt3DCore::QEntity *entity,
QgsVectorLayer *layer );
75 void parseTerrain( QgsTerrainEntity *terrain,
const QString &layer );
78 void save(
const QString &sceneName,
const QString &sceneFolderPath );
107 float scale()
const {
return mScale; }
111 QVector<Qgs3DExportObject *> processInstancedPointGeometry( Qt3DCore::QEntity *entity,
const QString &objectNamePrefix );
113 QVector<Qgs3DExportObject *> processSceneLoaderGeometries( Qt3DRender::QSceneLoader *sceneLoader,
const QString &objectNamePrefix );
115 Qgs3DExportObject *processGeometryRenderer( Qt3DRender::QGeometryRenderer *mesh,
const QString &objectNamePrefix,
float sceneScale = 1.0f, QVector3D sceneTranslation = QVector3D( 0.0f, 0.0f, 0.0f ) );
117 void processEntityMaterial( Qt3DCore::QEntity *entity,
Qgs3DExportObject *
object );
119 QVector<Qgs3DExportObject *> processLines( Qt3DCore::QEntity *entity,
const QString &objectNamePrefix );
121 Qgs3DExportObject *processPoints( Qt3DCore::QEntity *entity,
const QString &objectNamePrefix );
124 QgsTerrainTileEntity *getFlatTerrainEntity( QgsTerrainEntity *terrain, QgsChunkNode *node );
126 QgsTerrainTileEntity *getDemTerrainEntity( QgsTerrainEntity *terrain, QgsChunkNode *node );
128 QgsTerrainTileEntity *getMeshTerrainEntity( QgsTerrainEntity *terrain, QgsChunkNode *node );
131 void parseDemTile( QgsTerrainTileEntity *tileEntity,
const QString &layerName );
133 void parseFlatTile( QgsTerrainTileEntity *tileEntity,
const QString &layerName );
135 void parseMeshTile( QgsTerrainTileEntity *meshEntity,
const QString &layerName );
137 QString getObjectName(
const QString &name );
139 QMap<QString, int> usedObjectNamesCounter;
140 QVector<Qgs3DExportObject *> mObjects;
142 bool mSmoothEdges =
false;
143 int mTerrainResolution = 128;
144 bool mExportNormals =
true;
145 bool mExportTextures =
false;
146 int mTerrainTextureResolution = 512;
154 #endif // QGS3DSCENEEXPORTER_H