16#ifndef Qgs3DExportObject_H
17#define Qgs3DExportObject_H
60 QString
name()
const {
return mName; }
62 void setName(
const QString &name ) { mName = name; }
75 void setupPositionCoordinates(
const QVector<float> &positionsBuffer,
const QMatrix4x4 &transform );
77 void setupFaces(
const QVector<uint> &facesIndexes );
79 void setupLine(
const QVector<uint> &facesIndexes );
82 void setupNormalCoordinates(
const QVector<float> &normalsBuffer,
const QMatrix4x4 &transform );
84 void setupTextureCoordinates(
const QVector<float> &texturesBuffer );
98 void objectBounds(
float &minX,
float &minY,
float &minZ,
float &maxX,
float &maxY,
float &maxZ );
101 void setMaterialParameter(
const QString ¶meter,
const QString &value ) { mMaterialParameters[parameter] = value; }
104 void saveTo( QTextStream &out,
float scale,
const QVector3D ¢er,
int precision = 6 );
106 QString saveMaterial( QTextStream &mtlOut,
const QString &folder );
112 QVector<float>
normals()
const {
return mNormals; }
118 QVector<unsigned int>
indexes()
const {
return mIndexes; }
122 ObjectType mType = ObjectType::TriangularFaces;
124 QVector<float> mVertexPosition;
125 QVector<float> mNormals;
126 QVector<float> mTexturesUV;
127 QVector<unsigned int> mIndexes;
128 QMap<QString, QString> mMaterialParameters;
130 QImage mTextureImage;
132 bool mSmoothEdges =
false;
Manages the data of each object of the scene (positions, normals, texture coordinates ....
QVector< float > texturesUV() const
Returns the vertex texture coordinates.
QImage textureImage() const
Returns the texture image used by the object.
void setMaterialParameter(const QString ¶meter, const QString &value)
Sets a material parameter to be exported in the .mtl file.
QVector< unsigned int > indexes() const
Returns the vertex indexes.
void setType(ObjectType type)
Sets the object type.
Qgs3DExportObject(const QString &name)
Qgs3DExportObject Constructs an export object that will be filled with coordinates later.
QVector< float > vertexPosition() const
Returns the vertex coordinates.
ObjectType type() const
Returns the object type.
ObjectType
The type of exported geometry.
QString name() const
Returns the object name.
QVector< float > normals() const
Returns the vertex normal coordinates.
void setTextureImage(const QImage &image)
Sets the texture image used by the object.
bool smoothEdges() const
Returns whether object edges will look smooth.
void setName(const QString &name)
Sets the object name.
void setSmoothEdges(bool smoothEdges)
Sets whether triangles edges will look smooth.
@ Points
Point based rendering, requires point data.