Maya 1.0
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
MayaGeometryAll Class Reference

Set of instances along with their frame lists. More...

#include <maya.h>

Public Member Functions

 MayaGeometryAll ()
 Empty.
 
 MayaGeometryAll (const MayaGeometry &)
 Creates a set of geometries from a unique geometry. More...
 
 MayaGeometryAll (const MayaGeometrySet &)
 Create a set of geometries from a set of geometry. More...
 
 MayaGeometryAll (const QVector< MayaGeometrySet > &)
 Create a set of instances of geometries from a set of geometry. More...
 
 MayaGeometryAll (const MayaResources &, const MayaInstanceSet &)
 Create a complex geometry by combining an atlas and a set of instances. More...
 
 MayaGeometryAll (const MayaResources &, const MayaInstanceAll &)
 Create a complex geometry by combining an atlas and a set of instances. More...
 
 ~MayaGeometryAll ()
 Empty.
 
void Append (const MayaGeometry &)
 Add an instance to the scene. More...
 
void Append (const MayaGeometrySet &)
 Add an instance set to the scene. More...
 
void Append (const QString &, const FrameScaled &)
 Add an instance to the scene with a given name and frame.
 
void SetFramesToAll (QVector< FrameScaled >)
 Set the frames to the entire geometry. More...
 
void SetMaterial (const MayaMaterial &)
 Set the same material for all the objects. More...
 
void SetMaterial_EqualName (const QString &, const MayaMaterial &)
 Set the material of all the instances whose name exactly matches the given string. More...
 
void SetMaterial_ContainsName (const QString &n, const MayaMaterial &mo)
 Set the material of all the instances whose name contains the given string. More...
 
MayaGeometry GetGeometryByName (const QString &n)
 gets the merged geometry of all objects whose name contains the given string. More...
 
void Rotate (const Vector &)
 Rotate all instances. More...
 
void Translate (const Vector &)
 Translate all instances. More...
 
void Scale (const Vector &)
 Scale all instances. More...
 
void Remove (const QString &)
 Clears one instance given its name. More...
 
void Clear ()
 Clears all instances.
 
void Append (const MayaGeometryAll &)
 Append a set of instances. More...
 
int count () const
 Get the number of instances.
 
QList< QString > GetNames () const
 Get the list of names of the instances in the geometry.
 
MayaGeometrySetoperator[] (const QString &)
 Get the MayaGeometrySet of the geometry. More...
 
int GetSetSize () const
 Get the size of instances.
 
Box GetBox () const
 Return the Bounding Box of each MayaGeometrySet.
 
MayaGeometry Collapse () const
 Merge all the instances into a single geometry. More...
 
bool GetMayaGeometrySet (const QString &, MayaGeometrySet &)
 Get one instance given its name. More...
 
bool GetMayaGeometrySet (const QString &, QVector< MayaGeometrySet > &)
 Get a set of geometrical elements. More...
 
bool Load_OBJ (const QString &)
 Loads the geometrys from an .obj file into a MayaGeometryAll. Experimental. More...
 
bool find_MTL_Address (const QString &, const QString &, QString &, QString &)
 Loads the geometrys from an .obj file into a MayaGeometryAll. More...
 
bool Save_OBJ (const QString &, const bool &=true) const
 Save the geometry as a Maya .obj file (MayaGeometryAll->MayaGeometry). More...
 
bool Save_OBJ_Collapse (const QString &) const
 Save a single geometry as a Maya .obj file (Collapse the MayaGeomeryAll). More...
 
bool Save_PBRT (const QString &) const
 Save the geometry as a .pbrt file (MayaGeometryAll->MayaGeometry). More...
 
bool Save_VUE (const QString &) const
 Save the instances as a Vue python script. More...
 
bool Save_XML_Instances (const QString &) const
 Save instances positions into an XML file compatible with Mitsuba. More...
 
bool Save_XML_Object (const QString &, const QString &id) const
 Save instances positions into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated. More...
 
bool Save_XML_Object (const QString &, const QString &id, const QString &objbasename, const QString &texturepath, const QString &relPath) const
 Save objects into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated, don't export materials (use Save_XML_Materials() in addition) More...
 
bool Save_XML (const QString &, const Camera &, const QString &instancefilename=QString(""), bool=false, const QString &=QString(""), bool objectonly=false) const
 Save scene into an XML file. More...
 
bool Save_VueScript (const QString &) const
 Export instances in Vue Software format. More...
 
MayaStatistics GetStatistics () const
 Compute the statistics of the geometry. More...
 
QString GetText (int=0, bool=false) const
 Get the text information. More...
 

Static Public Member Functions

static MayaGeometryAll CreateVoxelSurface (const Voxel &)
 Create a set of visible surface patches representing the surface voxel. More...
 

Protected Attributes

QMap< QString, MayaGeometrySetinstances
 Map between the name of the geometric instances and the MayaGeometrySet structure. A map is used instead of an array to speed up instance search given an input name.
 

Friends

class MayaGpuAll
 

Detailed Description

Set of instances along with their frame lists.

Constructor & Destructor Documentation

◆ MayaGeometryAll() [1/5]

MayaGeometryAll::MayaGeometryAll ( const MayaGeometry mg)

Creates a set of geometries from a unique geometry.

This function creates a single geometry entry and a unique reference with identity frame.

Parameters
mgInput geometry.

References Append().

◆ MayaGeometryAll() [2/5]

MayaGeometryAll::MayaGeometryAll ( const MayaGeometrySet mgs)

Create a set of geometries from a set of geometry.

Parameters
mgsInput set of geometry.

References Append().

◆ MayaGeometryAll() [3/5]

MayaGeometryAll::MayaGeometryAll ( const QVector< MayaGeometrySet > &  s)

Create a set of instances of geometries from a set of geometry.

Parameters
sInput set of geometry.

References Append(), and instances.

◆ MayaGeometryAll() [4/5]

MayaGeometryAll::MayaGeometryAll ( const MayaResources atlas,
const MayaInstanceSet mis 
)

Create a complex geometry by combining an atlas and a set of instances.

Parameters
atlasThe atlas of models.
misThe set of instances.

References Append(), MayaInstanceSet::GetFrameScaleds(), MayaInstance::GetName(), MayaResources::GetRessource(), and SetFramesToAll().

◆ MayaGeometryAll() [5/5]

MayaGeometryAll::MayaGeometryAll ( const MayaResources atlas,
const MayaInstanceAll mia 
)

Create a complex geometry by combining an atlas and a set of instances.

Traverses the set of instances and replace instance by the geometry in the atlas whenever an entry exists.

Parameters
atlasThe atlas of models.
miaMultiple instance object.

References Append(), MayaInstanceAll::GetFrameScaleds(), MayaResources::GetRessource(), MayaInstanceAll::instances, and SetFramesToAll().

Member Function Documentation

◆ Append() [1/3]

void MayaGeometryAll::Append ( const MayaGeometry in)

Add an instance to the scene.

This function checks if the object already exists in the collection of models. If it already exists, it simply creates a reference to it, otherwise it creates a new entry.

Parameters
inThe instance.

References MayaGeometry::GetName(), FrameScaled::Id, and instances.

Referenced by Append(), and MayaGeometryAll().

◆ Append() [2/3]

void MayaGeometryAll::Append ( const MayaGeometryAll scene)

Append a set of instances.

Parameters
sceneThe set of instances.

References Append(), and instances.

◆ Append() [3/3]

void MayaGeometryAll::Append ( const MayaGeometrySet in)

Add an instance set to the scene.

This function checks if the object already exists in the collection of models. If so, it simply creates a reference to it, otherwise it creates a new entry.

Parameters
inThe instance.

References MayaGeometrySet::count(), MayaGeometrySet::GetFrameScaled(), MayaGeometrySet::GetName(), and instances.

◆ Collapse()

MayaGeometry MayaGeometryAll::Collapse ( ) const

Merge all the instances into a single geometry.

Note that the resulting geometry can be huge if many instances were used.

References instances, and MayaGeometry::Merge().

Referenced by Save_OBJ_Collapse().

◆ CreateVoxelSurface()

MayaGeometryAll MayaGeometryAll::CreateVoxelSurface ( const Voxel voxel)
static

Create a set of visible surface patches representing the surface voxel.

This function differs from MayaGeometrySet::CreateVoxel(const Voxel&) in the sense that there will be no coplanar faces between neighboring cubes.

See also
CreateVoxel(const Voxel&)
Parameters
voxelThe voxel.

References MayaInstanceAll::Append(), MayaResources::Append(), Voxel::at(), Array::Cell(), Array::CellSizeX(), Array::CellSizeY(), Array::CellSizeZ(), Box::Center(), MayaGeometryAll(), FrameScaled::Translation(), and Array::UnitCell().

◆ find_MTL_Address()

bool MayaGeometryAll::find_MTL_Address ( const QString &  url,
const QString &  name,
QString &  nameR,
QString &  nameA 
)

Loads the geometrys from an .obj file into a MayaGeometryAll.

Parameters
urlFile name (which should contain the extension .obj). ‍/ bool MayaGeometryAll::Load_OBJ(const QString& url) { return Load_OBJ(url); //// Clear arrays //int cptV = 0, cptN = 0, cptUV = 0; //QVector<Vector> vertex, normal; //QVector<Vector2> UVmap; //QVector<MayaIndexVertexData> indexes; //QString nameS(""), nameMTLFile(""), nameMTLMat(""), nameFileMat(""), nameFileAlpha("");

//// Set of regular expressions //QRegularExpression rex_FMname("mtllib\\s*(\\w*\\.mtl)"); // Material name file //QRegularExpression rex_Oname("o\\s*(\\w+)"); // Object name //QRegularExpression rex_G("g"); // Start group //QRegularExpression rex_Gname("g\\s*(\\w+)"); // Group name //QRegularExpression rex_Mname("usemtl\\s*(\\w*)"); // Material name //QRegularExpression rexv("v\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)"); // Vertex //QRegularExpression rexn("vn\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)"); // Normals //QRegularExpression rext("vt\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)"); // Texture coordinates //QRegularExpression rex_v("f\\s+(\\d*)\\s+(\\d*)\\s+(\\d*)"); // Triangles with Vertex //QRegularExpression rex_vt("f\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)"); // Triangles with Vertex/texture-coordinate //QRegularExpression rex_vtn("f\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)");// Triangles with Vertex/texture-coordinate/normal //QRegularExpression rex_vn("f\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)"); // Triangles with Vertex/normal

//QRegularExpression rex_v4("f\\s+(\\d*)\\s+(\\d*)\\s+(\\d*)\\s+(\\d*)"); // Quadrangles with Vertex //QRegularExpression rex_vt4("f\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)"); // Quadrangles with Vertex/texture-coordinate //QRegularExpression rex_vtn4("f\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)");// Quadrangles with Vertex/texture-coordinate/normal //QRegularExpression rex_vn4("f\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)"); // Quadrangles with Vertex/normal

//QFile data(url); //if (!data.open(QFile::ReadOnly)) { // std::cout << "OBJ File Not Found, url : " << url.toUtf8().data() << std::endl; // return false; //} //QFileInfo data_fi(data); //QString name = data_fi.baseName(); //QString address = data_fi.absolutePath().append("/");

//std::cout << "ERROR OBJ : use File Not Found, url : " << url.toUtf8().data() << std::endl;

//QTextStream in(&data); //// Since cap(0) from the regular expression corresponds to the matching substring //// We need to start with cap(1) to get the matching components // //// TODO QT6 ////while (!in.atEnd()) ////{ //// QString line = in.readLine();

//// // Material name file //// if (rex_FMname.indexIn(line, 0) > -1) { //// nameMTLFile = rex_FMname.cap(1); //// } //// // Material name //// else if (rex_Mname.indexIn(line, 0) > -1) { //// nameMTLMat = rex_Mname.cap(1); //// find_MTL_Address(QString(address + nameMTLFile), nameMTLMat, nameFileMat, nameFileAlpha); //// } //// // Object name //// else if (rex_Oname.indexIn(line, 0) > -1) { //// QString oName = rex_Oname.cap(1); //// } //// // Group name //// else if (rex_Gname.indexIn(line, 0) > -1) { //// nameS = rex_Gname.cap(1); //// } //// // Start group //// else if (rex_G.indexIn(line, 0) > -1) { //// if (indexes.size() > 0) //// { //// MayaGeometry mg; //// QString str(name + nameS.append(QString().setNum(count()))); //// // Create Object //// if (UVmap.size() > 0 && nameFileMat.size() > 0) { //// QImage tex(address + nameFileMat); //// if (tex.isNull()) //// { //// qDebug() << "Errors loading images : " << QString(address + nameFileMat) <<"\n"; //// return false; //// } //// if (nameFileAlpha.size() > 0) { // we have an alpha mask //// QImage alpha(address + nameFileAlpha); //// if (alpha.isNull()) //// { //// qDebug() << "Errors loading alpha channel image : " << QString(address + nameFileAlpha) <<"\n"; //// return false; //// } //// MayaMaterial mo = MayaMaterial(ShaderTextureUV, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50., tex,alpha); //// mg = MayaGeometry(str, vertex, normal, UVmap, indexes, mo); //// } //// else { //// MayaMaterial mo = MayaMaterial(ShaderTextureUV, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50., tex); //// mg = MayaGeometry(str, vertex, normal, UVmap, indexes, mo); //// } ////
//// } //// else if (UVmap.size() > 0) { //// MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); //// mg = MayaGeometry(str, vertex, normal, indexes, mo); //// UVmap.clear(); //// } //// else { //// MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); //// mg = MayaGeometry(str, vertex, normal, indexes, mo); //// }

//// Append(mg);

//// cptV += vertex.size(); //// cptN += normal.size(); //// cptUV += UVmap.size() / 2;

//// if (cptV != cptN || cptV != cptUV) //// std::cout << "Number of vertex != Number of Normal or Number of UV";

//// // New object //// vertex.clear(); //// normal.clear(); //// UVmap.clear(); //// indexes.clear(); //// } //// } //// // Vertex //// else if (rexv.indexIn(line, 0) > -1) //// { //// Vector q = Vector(rexv.cap(1).toDouble(), rexv.cap(2).toDouble(), rexv.cap(3).toDouble()); //// vertex.append(q); //// } //// // Normal //// else if (rexn.indexIn(line, 0) > -1) //// { //// Vector q = Vector(rexn.cap(1).toDouble(), rexn.cap(2).toDouble(), rexn.cap(3).toDouble()); //// normal.append(q); //// } //// // Texture //// else if (rext.indexIn(line, 0) > -1) //// { //// Vector2 q = Vector2(rexn.cap(1).toDouble(), rexn.cap(2).toDouble()); //// UVmap.append(q); //// } //// // Quadrangles : Vertex //// else if (rex_v4.indexIn(line, 0) > -1) {/* Not used ‍/ } //// // Quadrangles : Vertex/texture-coordinate //// else if (rex_vt4.indexIn(line, 0) > -1) {/ Not used *‍/ } //// // Quadrangles : Vertex/texture-coordinate/normal //// else if (rex_vtn4.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn4.cap(1).toInt() - 1 - cptV, rex_vtn4.cap(3).toInt() - 1 - cptN, -1, rex_vtn4.cap(2).toInt() - 1 - cptUV); //// MayaIndexVertexData mi2(rex_vtn4.cap(4).toInt() - 1 - cptV, rex_vtn4.cap(6).toInt() - 1 - cptN, -1, rex_vtn4.cap(5).toInt() - 1 - cptUV); //// MayaIndexVertexData mi3(rex_vtn4.cap(7).toInt() - 1 - cptV, rex_vtn4.cap(9).toInt() - 1 - cptN, -1, rex_vtn4.cap(8).toInt() - 1 - cptUV); //// MayaIndexVertexData mi4(rex_vtn4.cap(10).toInt() - 1 - cptV, rex_vtn4.cap(12).toInt() - 1 - cptN, -1, rex_vtn4.cap(11).toInt() - 1 - cptUV);

//// // Triangle1 //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3);

//// // Triangle2 //// indexes.append(mi1); //// indexes.append(mi3); //// indexes.append(mi4); //// } //// // Quadrangles : Vertex/normal //// else if (rex_vn4.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn.cap(1).toInt() - 1 - cptV, rex_vtn.cap(2).toInt() - 1 - cptN); //// MayaIndexVertexData mi2(rex_vtn.cap(3).toInt() - 1 - cptV, rex_vtn.cap(4).toInt() - 1 - cptN); //// MayaIndexVertexData mi3(rex_vtn.cap(5).toInt() - 1 - cptV, rex_vtn.cap(6).toInt() - 1 - cptN); //// MayaIndexVertexData mi4(rex_vtn.cap(7).toInt() - 1 - cptV, rex_vtn.cap(8).toInt() - 1 - cptN);

//// // Triangle1 //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3);

//// // Triangle2 //// indexes.append(mi1); //// indexes.append(mi3); //// indexes.append(mi4); //// } //// // Triangles : Vertex //// else if (rex_v.indexIn(line, 0) > -1) {/* Not used ‍/ } //// // Triangles : Vertex/texture-coordinate //// else if (rex_vt.indexIn(line, 0) > -1) {/ Not used *‍/ } //// // Triangles : Vertex/texture-coordinate/normal //// else if (rex_vtn.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn.cap(1).toInt() - 1 - cptV, rex_vtn.cap(3).toInt() - 1 - cptN, -1, rex_vtn.cap(2).toInt() - 1 - cptUV); //// MayaIndexVertexData mi2(rex_vtn.cap(4).toInt() - 1 - cptV, rex_vtn.cap(6).toInt() - 1 - cptN, -1, rex_vtn.cap(5).toInt() - 1 - cptUV); //// MayaIndexVertexData mi3(rex_vtn.cap(7).toInt() - 1 - cptV, rex_vtn.cap(9).toInt() - 1 - cptN, -1, rex_vtn.cap(8).toInt() - 1 - cptUV);

//// // Triangle //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3);

//// } //// // Triangles : Vertex/normal //// else if (rex_vn.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn.cap(1).toInt() - 1 - cptV, rex_vtn.cap(2).toInt() - 1 - cptN); //// MayaIndexVertexData mi2(rex_vtn.cap(3).toInt() - 1 - cptV, rex_vtn.cap(4).toInt() - 1 - cptN); //// MayaIndexVertexData mi3(rex_vtn.cap(5).toInt() - 1 - cptV, rex_vtn.cap(6).toInt() - 1 - cptN);

//// // Triangle //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3); //// } ////}

//if (indexes.size() > 0) //{ // MayaGeometry mg; // QString str(name + nameS.append(QString().setNum(count()))); // // Create Object // if (UVmap.size() > 0 && nameFileMat.size() > 0) { // QImage tex(address + nameFileMat); // if (tex.isNull()) // { // qDebug() << "Errors loading images : " << QString(address + nameFileMat) <<"\n"; // return false; // }

// MayaMaterial mo = MayaMaterial(ShaderTextureUV, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50., tex); // mg = MayaGeometry(str, vertex, normal, UVmap, indexes, mo); // } // else if (UVmap.size() > 0) { // MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); // mg = MayaGeometry(str, vertex, normal, indexes, mo); // } // else { // MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); // mg = MayaGeometry(str, vertex, normal, indexes, mo); // } // //mg.Transform(FrameScaled::FromMaya); // Append(mg); //}

//data.close(); //return true; }

/*!

Loads the geometrys from an .obj file into a MayaGeometryAll.

Parameters
urlFile name (which should contain the extension .obj).
nameName of the current material.
nameRTexture name of the diffuse map.
nameATexture name of the alpha map.
Returns
A boolean checking if loading has been successful.

Referenced by Load_OBJ().

◆ GetGeometryByName()

MayaGeometry MayaGeometryAll::GetGeometryByName ( const QString &  n)

gets the merged geometry of all objects whose name contains the given string.

Parameters
nString that will be searched and matched with the names.

References instances, and MayaGeometry::Merge().

◆ GetMayaGeometrySet() [1/2]

bool MayaGeometryAll::GetMayaGeometrySet ( const QString &  n,
MayaGeometrySet mgs 
)

Get one instance given its name.

Parameters
nName of the instance.
mgsGeometry set.

References instances.

◆ GetMayaGeometrySet() [2/2]

bool MayaGeometryAll::GetMayaGeometrySet ( const QString &  n,
QVector< MayaGeometrySet > &  mgs 
)

Get a set of geometrical elements.

Parameters
nName.
mgsSet of objects.

References instances.

◆ GetStatistics()

MayaStatistics MayaGeometryAll::GetStatistics ( ) const

Compute the statistics of the geometry.

Returns
The statistics.

References instances.

◆ GetText()

QString MayaGeometryAll::GetText ( int  spaces = 0,
bool  html = false 
) const

Get the text information.

Parameters
spacesSpacing for indenting the text.
htmlFlag to specify syntax highlighting.

References instances.

◆ Load_OBJ()

bool MayaGeometryAll::Load_OBJ ( const QString &  url)

Loads the geometrys from an .obj file into a MayaGeometryAll. Experimental.

Parameters
urlFile name (which should contain the extension .obj).

References count(), and find_MTL_Address().

Referenced by MayaResources::Append().

◆ operator[]()

MayaGeometrySet & MayaGeometryAll::operator[] ( const QString &  n)
inline

Get the MayaGeometrySet of the geometry.

Parameters
nName.

References instances.

◆ Remove()

void MayaGeometryAll::Remove ( const QString &  n)

Clears one instance given its name.

Parameters
nName of the instance.

References instances.

◆ Rotate()

void MayaGeometryAll::Rotate ( const Vector r)

Rotate all instances.

Parameters
rRotation vector.

References instances.

◆ Save_OBJ()

bool MayaGeometryAll::Save_OBJ ( const QString &  url,
const bool &  eraseTexture = true 
) const

Save the geometry as a Maya .obj file (MayaGeometryAll->MayaGeometry).

Parameters
urlFilename.
eraseTextureBoolean to confirm or not to erase the existing texture.
Returns
A boolean indicating whether the file has been successfully created or not.

References instances, MayaGeometry::Save_OBJ(), and MayaGeometry::SetName().

◆ Save_OBJ_Collapse()

bool MayaGeometryAll::Save_OBJ_Collapse ( const QString &  url) const

Save a single geometry as a Maya .obj file (Collapse the MayaGeomeryAll).

Parameters
urlFilename.
Returns
A boolean indicating whether the file has been successfully created or not.

References Collapse(), and MayaGeometry::Save_OBJ().

◆ Save_PBRT()

bool MayaGeometryAll::Save_PBRT ( const QString &  url) const

Save the geometry as a .pbrt file (MayaGeometryAll->MayaGeometry).

Parameters
urlFilename.
Returns
A boolean indicating whether the file has been successfully created or not.

References instances, MayaGeometry::Save_PBRT(), and MayaGeometry::SetName().

◆ Save_VUE()

bool MayaGeometryAll::Save_VUE ( const QString &  url) const

Save the instances as a Vue python script.

Parameters
urlFilename.
Returns
A boolean indicating whether the file has been successfully created or not.

References instances.

◆ Save_VueScript()

bool MayaGeometryAll::Save_VueScript ( const QString &  url) const

Export instances in Vue Software format.

Returns
String of the file.

References instances.

◆ Save_XML()

bool MayaGeometryAll::Save_XML ( const QString &  url,
const Camera camera,
const QString &  instancefilename = QString(""),
bool  use_normals = false,
const QString &  shape = QString(""),
bool  objectonly = false 
) const

Save scene into an XML file.

The XML format is compatible with Mitsuba.

Parameters
urlFilename.
cameraThe camera.
instancefilenameWhat ?
use_normalsWhat ?
shapeWhat ?
Returns
A boolean indicating whether the file has been successfully created or not.

References Camera::At(), MayaMaterial::diffuse, Camera::Eye(), instances, and Camera::Up().

◆ Save_XML_Instances()

bool MayaGeometryAll::Save_XML_Instances ( const QString &  url) const

Save instances positions into an XML file compatible with Mitsuba.

Parameters
urlFilename.
Returns
A boolean indicating whether the file has been successfully created or not.

References instances.

◆ Save_XML_Object() [1/2]

bool MayaGeometryAll::Save_XML_Object ( const QString &  url,
const QString &  id 
) const

Save instances positions into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated.

Parameters
urlFilename.
Returns
A boolean indicating whether the file has been successfully created or not.

References MayaMaterial::diffuse, and instances.

◆ Save_XML_Object() [2/2]

bool MayaGeometryAll::Save_XML_Object ( const QString &  url,
const QString &  id,
const QString &  objbasename,
const QString &  texturepath,
const QString &  relPath 
) const

Save objects into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated, don't export materials (use Save_XML_Materials() in addition)

Parameters
urlFilename.
ididentifier of the object
objbasenamethe basename of the object (that shares textures)
texturepaththe path where all the textures should be stored
Returns
A boolean indicating whether the file has been successfully created or not.

References instances, and MayaMaterial::name.

◆ Scale()

void MayaGeometryAll::Scale ( const Vector s)

Scale all instances.

Parameters
sScaling vector.

References instances.

◆ SetFramesToAll()

void MayaGeometryAll::SetFramesToAll ( QVector< FrameScaled s)

Set the frames to the entire geometry.

Parameters
sSet of frames.

References instances.

Referenced by MayaGeometryAll().

◆ SetMaterial()

void MayaGeometryAll::SetMaterial ( const MayaMaterial mo)

Set the same material for all the objects.

Parameters
moMaterial.

References instances.

◆ SetMaterial_ContainsName()

void MayaGeometryAll::SetMaterial_ContainsName ( const QString &  n,
const MayaMaterial mo 
)

Set the material of all the instances whose name contains the given string.

Parameters
nString that will be searched and matched with the names.
moMaterial.

References instances.

◆ SetMaterial_EqualName()

void MayaGeometryAll::SetMaterial_EqualName ( const QString &  n,
const MayaMaterial mo 
)

Set the material of all the instances whose name exactly matches the given string.

Parameters
nString that will be searched and matched with the names.
moMaterial.

References instances.

◆ Translate()

void MayaGeometryAll::Translate ( const Vector t)

Translate all instances.

Parameters
tTranslation vector.

References instances.