|
QGIS API Documentation 4.1.0-Master (376402f9aeb)
|
Manages the data of each object of the scene (positions, normals, texture coordinates ...) since each object. More...
#include <qgs3dexportobject.h>
Public Types | |
| enum | ObjectType { TriangularFaces , LineStrip , Points } |
| The type of exported geometry. More... | |
Public Member Functions | |
| Qgs3DExportObject (const QString &name) | |
| Qgs3DExportObject Constructs an export object that will be filled with coordinates later. | |
| QVector< unsigned int > | indexes () const |
| Returns the vertex indexes. | |
| QString | name () const |
| Returns the object name. | |
| QVector< float > | normals () const |
| Returns the vertex normal coordinates. | |
| void | objectBounds (float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ) const |
| 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. | |
| QString | saveMaterial (QTextStream &mtlOut, const QString &folder) const |
| saves the texture of the object and material information | |
| void | saveTo (QTextStream &out, float scale, const QVector3D ¢er, const Qgis::Export3DSceneFormat &exportFormat=Qgis::Export3DSceneFormat::Obj, int precision=6, QString materialName=QString()) const |
| Exports the 3D object to an OBJ or STL compatible output stream. | |
| void | setName (const QString &name) |
| Sets the object name. | |
| void | setSmoothEdges (bool smoothEdges) |
| Sets whether triangles edges will look smooth. | |
| void | setTextureImage (const QImage &image) |
| Sets the texture image used by the object. | |
| void | setupLine (const QVector< float > &positionsBuffer) |
| sets line indexes and positions coordinates | |
| void | setupMaterial (QgsAbstractMaterialSettings *material) |
| Sets the material parameters (diffuse color, shininess...) to be exported in the .mtl file. | |
| void | setupNormalCoordinates (const QVector< float > &normalsBuffer, const QMatrix4x4 &transform) |
| Sets normal coordinates for each vertex. | |
| void | setupPoint (const QVector< float > &positionsBuffer) |
| sets point positions coordinates | |
| void | setupTextureCoordinates (const QVector< float > &texturesBuffer) |
| Sets texture coordinates for each vertex. | |
| void | setupTriangle (const QVector< float > &positionsBuffer, const QVector< uint > &facesIndexes, const QMatrix4x4 &transform) |
| sets triangle indexes and positions coordinates | |
| bool | smoothEdges () const |
| Returns whether object edges will look smooth. | |
| QImage | textureImage () const |
| Returns the texture image used by the object. | |
| QVector< float > | texturesUV () const |
| Returns the vertex texture coordinates. | |
| ObjectType | type () const |
| Returns the object type. | |
| QVector< float > | vertexPosition () const |
| Returns the vertex coordinates. | |
Manages the data of each object of the scene (positions, normals, texture coordinates ...) since each object.
Definition at line 42 of file qgs3dexportobject.h.
The type of exported geometry.
| Enumerator | |
|---|---|
| TriangularFaces | |
| LineStrip | |
| Points | |
Definition at line 46 of file qgs3dexportobject.h.
|
inline |
Qgs3DExportObject Constructs an export object that will be filled with coordinates later.
| name | The name of the parent (Will be useful to define scene hierarchy) |
Definition at line 58 of file qgs3dexportobject.h.
|
inline |
Returns the vertex indexes.
Definition at line 136 of file qgs3dexportobject.h.
|
inline |
Returns the object name.
Definition at line 63 of file qgs3dexportobject.h.
|
inline |
Returns the vertex normal coordinates.
Definition at line 130 of file qgs3dexportobject.h.
| void Qgs3DExportObject::objectBounds | ( | float & | minX, |
| float & | minY, | ||
| float & | minZ, | ||
| float & | maxX, | ||
| float & | maxY, | ||
| float & | maxZ ) const |
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.
Definition at line 124 of file qgs3dexportobject.cpp.
| QString Qgs3DExportObject::saveMaterial | ( | QTextStream & | mtlOut, |
| const QString & | folder ) const |
saves the texture of the object and material information
Definition at line 287 of file qgs3dexportobject.cpp.
| void Qgs3DExportObject::saveTo | ( | QTextStream & | out, |
| float | scale, | ||
| const QVector3D & | center, | ||
| const Qgis::Export3DSceneFormat & | exportFormat = Qgis::Export3DSceneFormat::Obj, | ||
| int | precision = 6, | ||
| QString | materialName = QString() ) const |
Exports the 3D object to an OBJ or STL compatible output stream.
This function writes the 3D object's geometry to the specified output stream, applying a uniform scaling and translating it so that the model is centered and properly visible in the exported scene.
| out | The output text stream where the data will be written. |
| scale | The uniform scale factor applied to all vertices. |
| center | The target center position to which the object will be translated. |
| exportFormat | The desired export format (OBJ or STL). Defaults to OBJ. |
| precision | The number of decimal digits used when writing floating-point values (default: 6). |
| materialName | Optional name of the material to associate with the object (default: empty). This parameter has no effect when exporting to STL, as this format does not support materials. |
Definition at line 140 of file qgs3dexportobject.cpp.
|
inline |
Sets the object name.
Definition at line 65 of file qgs3dexportobject.h.
|
inline |
Sets whether triangles edges will look smooth.
Definition at line 73 of file qgs3dexportobject.h.
|
inline |
Sets the texture image used by the object.
Definition at line 92 of file qgs3dexportobject.h.
| void Qgs3DExportObject::setupLine | ( | const QVector< float > & | positionsBuffer | ) |
sets line indexes and positions coordinates
Definition at line 63 of file qgs3dexportobject.cpp.
| void Qgs3DExportObject::setupMaterial | ( | QgsAbstractMaterialSettings * | material | ) |
Sets the material parameters (diffuse color, shininess...) to be exported in the .mtl file.
Definition at line 114 of file qgs3dexportobject.cpp.
| void Qgs3DExportObject::setupNormalCoordinates | ( | const QVector< float > & | normalsBuffer, |
| const QMatrix4x4 & | transform ) |
Sets normal coordinates for each vertex.
Definition at line 80 of file qgs3dexportobject.cpp.
| void Qgs3DExportObject::setupPoint | ( | const QVector< float > & | positionsBuffer | ) |
sets point positions coordinates
Definition at line 74 of file qgs3dexportobject.cpp.
| void Qgs3DExportObject::setupTextureCoordinates | ( | const QVector< float > & | texturesBuffer | ) |
Sets texture coordinates for each vertex.
Definition at line 108 of file qgs3dexportobject.cpp.
| void Qgs3DExportObject::setupTriangle | ( | const QVector< float > & | positionsBuffer, |
| const QVector< uint > & | facesIndexes, | ||
| const QMatrix4x4 & | transform ) |
sets triangle indexes and positions coordinates
Definition at line 44 of file qgs3dexportobject.cpp.
|
inline |
Returns whether object edges will look smooth.
Definition at line 71 of file qgs3dexportobject.h.
|
inline |
Returns the texture image used by the object.
Definition at line 94 of file qgs3dexportobject.h.
|
inline |
Returns the vertex texture coordinates.
Definition at line 133 of file qgs3dexportobject.h.
|
inline |
Returns the object type.
Definition at line 68 of file qgs3dexportobject.h.
|
inline |
Returns the vertex coordinates.
Definition at line 127 of file qgs3dexportobject.h.