Skip to content
Permalink
Browse files

Fixing documentation

  • Loading branch information
NEDJIMAbelgacem committed Jul 4, 2020
1 parent b6f1603 commit 8c25af7a2736c77275fd6f39ca71469bdd5b7289
Showing with 31 additions and 31 deletions.
  1. +9 −9 src/3d/qgs3dmapexportsettings.h
  2. +15 −15 src/3d/qgs3dsceneexporter.h
  3. +7 −7 src/3d/qgsexportobject.h
@@ -31,25 +31,25 @@ class _3D_EXPORT Qgs3DMapExportSettings : public QObject
{
Q_OBJECT
public:
// Constructor
//! Constructor
Qgs3DMapExportSettings( QObject *parent = nullptr );

// Returns the scene name
//! Returns the scene name
QString sceneName() const { return mSceneName; }
// Returns the scene folder path
//! Returns the scene folder path
QString sceneFolderPath() const { return mSceneFolderPath; }
// Returns the terrain resolution
//! Returns the terrain resolution
int terrrainResolution() const { return mTerrainResolution; }
// Returns whether triangles edges will look smooth
//! Returns whether triangles edges will look smooth
bool smoothEdges() const { return mSmoothEdges; }

// Sets the scene name
//! Sets the scene name
void setSceneName( const QString &sceneName ) { mSceneName = sceneName; }
// Sets the scene's .obj file folder path
//! Sets the scene's .obj file folder path
void setSceneFolderPath( const QString &sceneFolderPath ) { mSceneFolderPath = sceneFolderPath; }
// Sets the terrain resolution
//! Sets the terrain resolution
void setTerrainResolution( int resolution ) { mTerrainResolution = resolution; }
// Sets whether triangles edges will look smooth
//! Sets whether triangles edges will look smooth
void setSmoothEdges( bool smoothEdges ) { mSmoothEdges = smoothEdges; }
private:
QString mSceneName;
@@ -43,41 +43,41 @@ class Qgs3DSceneExporter : public Qt3DCore::QEntity
public:
Qgs3DSceneExporter( Qt3DCore::QNode *parent = nullptr );

// Creates necessary export objects from entity if it represents valid entity
// If the entity doesn't define exportable object it will be ignored
//! Creates necessary export objects from entity if it represents valid entity
//! If the entity doesn't define exportable object it will be ignored
void parseEntity( Qt3DCore::QEntity *entity );
// Creates terrain export objects from the terrain entity
//! Creates terrain export objects from the terrain entity
void parseEntity( QgsTerrainEntity *terrain );
void saveToFile( const QString &filePath );

// Sets whether the triangles will look smooth
//! Sets whether the triangles will look smooth
void setSmoothEdges( bool smoothEdges ) { mSmoothEdges = smoothEdges; }
// Returns whether the triangles will look smooth
//! Returns whether the triangles will look smooth
bool smoothEdges() { return mSmoothEdges; }

// Sets the terrian resolution
//! Sets the terrian resolution
void setTerrainResolution( int resolution ) { mTerrainResolution = resolution; }
// Returns the terrain resolution
//! Returns the terrain resolution
int terrainResolution() { return mTerrainResolution; }

private:
// Processes the attribute directly by taking a position buffer and converting it to QgsExportObject
//! Processes the attribute directly by taking a position buffer and converting it to QgsExportObject
void processAttribute( Qt3DRender::QAttribute *attribute );
// processes the tessellated polygons geometry and constructs QgsExportObject from it
//! Processes the tessellated polygons geometry and constructs QgsExportObject from it
void process( QgsTessellatedPolygonGeometry *geom );

// Returns a tile entity that contains the geometry to be exported and necessary scaling parameters
//! Returns a tile entity that contains the geometry to be exported and necessary scaling parameters
QgsTerrainTileEntity *getFlatTerrainEntity( QgsTerrainEntity *terrain, QgsChunkNode *node );
// Returns a tile entity that contains the geometry to be exported and necessary scaling parameters
//! Returns a tile entity that contains the geometry to be exported and necessary scaling parameters
QgsTerrainTileEntity *getDemTerrainEntity( QgsTerrainEntity *terrain, QgsChunkNode *node );

// constructs a QgsExportObject from the DEM tile entity
//! Constructs a QgsExportObject from the DEM tile entity
void parseDemTile( QgsTerrainTileEntity *tileEntity );
// constructs a QgsExportObject from the flat tile entity
//! Constructs a QgsExportObject from the flat tile entity
void parseFlatTile( QgsTerrainTileEntity *tileEntity );

// Creates tile entity that contains the geometry to be exported and necessary scaling parameters
// THis function is needed because we need to generate geometry according to terrain resolution
//! Creates tile entity that contains the geometry to be exported and necessary scaling parameters
//! This function is needed because we need to generate geometry according to terrain resolution
QgsTerrainTileEntity *createDEMTileEntity( QgsTerrainEntity *terrain, QgsChunkNode *node );
private:
QVector<QgsExportObject *> mObjects;
@@ -44,20 +44,20 @@ class QgsExportObject : public QObject
*/
QgsExportObject( const QString &name, const QString &parentName = QString(), QObject *parent = nullptr );

// Returns whether object edges will look smooth
//! Returns whether object edges will look smooth
bool smoothEdges() { return mSmoothEdges; }
// Sets whether triangles edges will look smooth
//! Sets whether triangles edges will look smooth
void setSmoothEdges( bool smoothEdges ) { mSmoothEdges = smoothEdges; }

// Sets positions coordinates from just one positions buffer (generates faces automatically) and does the translation and scaling
//! Sets positions coordinates from just one positions buffer (generates faces automatically) and does the translation and scaling
void setupPositionCoordinates( const QVector<float> &positionsBuffer, float scale = 1.0f, const QVector3D translation = QVector3D( 0, 0, 0 ) );
// Sets positions coordinates from just one positions buffer and indexes buffer and does the translation and scaling
//! Sets positions coordinates from just one positions buffer and indexes buffer and does the translation and scaling
void setupPositionCoordinates( const QVector<float> &positionsBuffer, const QVector<unsigned int> &facesIndexes, float scale = 1.0f, const QVector3D translation = QVector3D( 0, 0, 0 ) );
// Updates the box bounds explained with the current object bounds
// This expands the bounding box if the current object outside the bounds of the already established bounds
//! Updates the box bounds explained with the current object bounds
//! This expands the bounding box if the current object outside the bounds of the already established bounds
void objectBounds( float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ );

// Saves the current object to the output stream while scaling the object and centering it to be visible in exported scene
//! Saves the current object to the output stream while scaling the object and centering it to be visible in exported scene
void saveTo( QTextStream &out, int scale, const QVector3D &center );
private:
QString mName;

0 comments on commit 8c25af7

Please sign in to comment.
You can’t perform that action at this time.