QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
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) |
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) |
saves the texture of the object and material information | |
void | saveTo (QTextStream &out, float scale, const QVector3D ¢er, int precision=6) |
Saves the current object to the output stream while scaling the object and centering it to be visible in exported scene. | |
void | setMaterialParameter (const QString ¶meter, const QString &value) |
Sets a material parameter to be exported in the .mtl file. | |
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 | setType (ObjectType type) |
Sets the object type. | |
void | setupFaces (const QVector< uint > &facesIndexes) |
Sets the faces in facesIndexes to the faces in the object. | |
void | setupLine (const QVector< uint > &facesIndexes) |
sets line vertex indexes | |
void | setupMaterial (QgsAbstractMaterialSettings *material) |
Sets the material parameters (diffuse color, shininess...) from phong material. | |
void | setupNormalCoordinates (const QVector< float > &normalsBuffer, const QMatrix4x4 &transform) |
Sets normal coordinates for each vertex. | |
void | setupPositionCoordinates (const QVector< float > &positionsBuffer, const QMatrix4x4 &transform) |
Sets positions coordinates and does the translation, rotation and scaling. | |
void | setupTextureCoordinates (const QVector< float > &texturesBuffer) |
Sets texture coordinates for each vertex. | |
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.
3
Definition at line 40 of file qgs3dexportobject.h.
The type of exported geometry.
Enumerator | |
---|---|
TriangularFaces | |
LineStrip | |
Points |
Definition at line 44 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 56 of file qgs3dexportobject.h.
|
inline |
Returns the vertex indexes.
Definition at line 118 of file qgs3dexportobject.h.
|
inline |
Returns the object name.
Definition at line 60 of file qgs3dexportobject.h.
|
inline |
Returns the vertex normal coordinates.
Definition at line 112 of file qgs3dexportobject.h.
void Qgs3DExportObject::objectBounds | ( | float & | minX, |
float & | minY, | ||
float & | minZ, | ||
float & | maxX, | ||
float & | maxY, | ||
float & | maxZ | ||
) |
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 111 of file qgs3dexportobject.cpp.
QString Qgs3DExportObject::saveMaterial | ( | QTextStream & | mtlOut, |
const QString & | folder | ||
) |
saves the texture of the object and material information
Definition at line 214 of file qgs3dexportobject.cpp.
void Qgs3DExportObject::saveTo | ( | QTextStream & | out, |
float | scale, | ||
const QVector3D & | center, | ||
int | precision = 6 |
||
) |
Saves the current object to the output stream while scaling the object and centering it to be visible in exported scene.
Definition at line 127 of file qgs3dexportobject.cpp.
|
inline |
Sets a material parameter to be exported in the .mtl file.
Definition at line 101 of file qgs3dexportobject.h.
|
inline |
Sets the object name.
Definition at line 62 of file qgs3dexportobject.h.
|
inline |
Sets whether triangles edges will look smooth.
Definition at line 72 of file qgs3dexportobject.h.
|
inline |
Sets the texture image used by the object.
Definition at line 89 of file qgs3dexportobject.h.
|
inline |
Sets the object type.
Definition at line 67 of file qgs3dexportobject.h.
void Qgs3DExportObject::setupFaces | ( | const QVector< uint > & | facesIndexes | ) |
Sets the faces in facesIndexes to the faces in the object.
Definition at line 64 of file qgs3dexportobject.cpp.
void Qgs3DExportObject::setupLine | ( | const QVector< uint > & | facesIndexes | ) |
sets line vertex indexes
Definition at line 69 of file qgs3dexportobject.cpp.
void Qgs3DExportObject::setupMaterial | ( | QgsAbstractMaterialSettings * | material | ) |
Sets the material parameters (diffuse color, shininess...) from phong material.
Definition at line 102 of file qgs3dexportobject.cpp.
void Qgs3DExportObject::setupNormalCoordinates | ( | const QVector< float > & | normalsBuffer, |
const QMatrix4x4 & | transform | ||
) |
Sets normal coordinates for each vertex.
Definition at line 76 of file qgs3dexportobject.cpp.
void Qgs3DExportObject::setupPositionCoordinates | ( | const QVector< float > & | positionsBuffer, |
const QMatrix4x4 & | transform | ||
) |
Sets positions coordinates and does the translation, rotation and scaling.
Definition at line 54 of file qgs3dexportobject.cpp.
void Qgs3DExportObject::setupTextureCoordinates | ( | const QVector< float > & | texturesBuffer | ) |
Sets texture coordinates for each vertex.
Definition at line 97 of file qgs3dexportobject.cpp.
|
inline |
Returns whether object edges will look smooth.
Definition at line 70 of file qgs3dexportobject.h.
|
inline |
Returns the texture image used by the object.
Definition at line 91 of file qgs3dexportobject.h.
|
inline |
Returns the vertex texture coordinates.
Definition at line 115 of file qgs3dexportobject.h.
|
inline |
Returns the object type.
Definition at line 65 of file qgs3dexportobject.h.
|
inline |
Returns the vertex coordinates.
Definition at line 109 of file qgs3dexportobject.h.