16#ifndef Qgs3DExportObject_H
17#define Qgs3DExportObject_H
59 QString
name()
const {
return mName; }
61 void setName(
const QString &name ) { mName = name; }
74 void setupPositionCoordinates(
const QVector<float> &positionsBuffer,
float scale = 1.0f,
const QVector3D &translation = QVector3D( 0, 0, 0 ) );
76 void setupFaces(
const QVector<uint> &facesIndexes );
78 void setupLine(
const QVector<uint> &facesIndexes );
81 void setupNormalCoordinates(
const QVector<float> &normalsBuffer );
83 void setupTextureCoordinates(
const QVector<float> &texturesBuffer );
97 void objectBounds(
float &minX,
float &minY,
float &minZ,
float &maxX,
float &maxY,
float &maxZ );
100 void setMaterialParameter(
const QString ¶meter,
const QString &value ) { mMaterialParameters[parameter] = value; }
103 void saveTo( QTextStream &out,
float scale,
const QVector3D ¢er,
int precision = 6 );
105 QString saveMaterial( QTextStream &mtlOut,
const QString &folder );
111 QVector<float>
normals()
const {
return mNormals;}
117 QVector<unsigned int>
indexes()
const {
return mIndexes; }
121 ObjectType mType = ObjectType::TriangularFaces;
123 QVector<float> mVertexPosition;
124 QVector<float> mNormals;
125 QVector<float> mTexturesUV;
126 QVector<unsigned int> mIndexes;
127 QMap<QString, QString> mMaterialParameters;
129 QImage mTextureImage;
131 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.