Maya 1.0
|
This class implements a scene construction framework based on MayaResources. More...
#include <maya.h>
Public Member Functions | |
MayaSceneStack () | |
Create an empty scene. More... | |
MayaSceneStack (const MayaGeometry &) | |
Create a scene stack from an object. More... | |
~MayaSceneStack () | |
Empty. | |
void | AddGeometryToAtlas (const QString &) |
Add the current geometry to the atlas. More... | |
void | AddGeometryToAtlas (const QString &, const MayaGeometry &) |
Add a given geometry to the atlas. More... | |
void | AddInstanceToAtlas (const QString &, const QString &) |
Add a given geometry to the atlas. More... | |
void | AddInstanceToScene (const QString &) |
Add an instance to the scene. More... | |
void | AddInstanceToScene (const QString &, const FrameScaled &) |
Add an instance to the scene. More... | |
void | AddGeometryToScene (const QString &) |
Add the current geometry to the scene. More... | |
MayaGeometryAll | GetScene () const |
Create the scene as a MayaGeometryAll. More... | |
QString | GetText (bool=false) const |
Get the text information. More... | |
Public Member Functions inherited from MayaGeometryStack | |
MayaGeometryStack () | |
Create an empty object. More... | |
MayaGeometryStack (const MayaGeometry &) | |
Create a geometry stack from a given object. More... | |
~MayaGeometryStack () | |
Empty. | |
void | Push () |
Push the current geometry generation state. More... | |
void | Pop () |
Pop a previously pushed geometry generation state. More... | |
void | PopAll () |
Pop all previously pushed geometry generation states and resets to original frame. | |
void | Transform (const FrameScaled &) |
Apply a given transformation to the next geometric operations. More... | |
void | Translate (const Vector &) |
Apply a given translation to the next geometric operations. More... | |
void | Rotate (const Vector &) |
Apply a given Euler rotation to the next geometric operations. More... | |
void | Scale (const Vector &) |
Apply a given scale to the next geometric operations. More... | |
void | AddTriangle (const Vector &, const Vector &, const Vector &) |
Add a triangle to the geometry. More... | |
void | AddQuadrangle (const Vector &, const Vector &, const Vector &, const Vector &) |
Add a quadrangle to the geometry. More... | |
void | AddGeometry (const MayaGeometryStack &) |
Add a given object to the shape. More... | |
FrameScaled | GetFrame () const |
Get the current building frame. | |
Public Member Functions inherited from MayaGeometry | |
MayaGeometry () | |
Creates an empty mesh structure. | |
MayaGeometry (const QString &, const MayaMaterial &=MayaMaterial::None) | |
Creates an empty mesh structure. More... | |
MayaGeometry (const QString &, const QVector< Vector > &, const QVector< Vector > &, const QVector< MayaIndexVertexData > &, const MayaMaterial &=MayaMaterial::None) | |
Creates a mesh given an array of vertices and normals, and an array of integers defining the (possibly smooth) triangles of the mesh. More... | |
MayaGeometry (const QString &, const QVector< Vector > &, const QVector< Vector > &, const QVector< Vector > &, const QVector< MayaIndexVertexData > &, const MayaMaterial &=MayaMaterial::None) | |
Creates a mesh. More... | |
MayaGeometry (const QString &, const QVector< Vector > &, const QVector< Vector > &, const QVector< Vector2 > &, const QVector< MayaIndexVertexData > &, const MayaMaterial &=MayaMaterial::None) | |
Creates a mesh given an array of vertices, normals and colors, and an array of integers defining the (possibly smooth) triangles of the mesh. More... | |
MayaGeometry (const QString &, const Mesh &, const MayaMaterial &=MayaMaterial::None) | |
Creates an geometry from a mesh. More... | |
MayaGeometry (const QString &, const MeshColor &, const MayaMaterial &=MayaMaterial::None) | |
Creates an geometry from a mesh. More... | |
MayaGeometry (const QString &, const Mesh2 &, const MayaMaterial &=MayaMaterial::None) | |
Creates an geometry from a mesh. More... | |
MayaGeometry (const QString &, const QVector< Triangle > &, const MayaMaterial &=MayaMaterial::None) | |
Creates a geometry from a set of triangles. More... | |
~MayaGeometry () | |
Empty. | |
MayaGeometry (const QString &, const Vector *, int, const Vector *, int, const int *, int, const MayaMaterial &=MayaMaterial::None) | |
Create a mesh. More... | |
void | AddTriangle (const Vector &, const Vector &, const Vector &) |
Adds a triangle to the mesh. More... | |
void | AddSmoothTriangle (const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &) |
Adds a smooth triangle to the mesh. More... | |
void | SetName (const QString &) |
Set the name. More... | |
void | SetMaterial (const MayaMaterial &) |
Set the MayaMaterial. More... | |
void | Merge (const MayaGeometry &) |
Merges an argument mesh with the existing mesh. More... | |
Triangle | GetTriangle (int) const |
Get the i-th triangle from the mesh as a flat triangle. More... | |
QVector< Triangle > | GetTriangles () const |
Returns the geometry as a set of triangles. | |
QString | GetName () const |
Get the name of the geometry. | |
MayaMaterial | GetMaterial () const |
Get the material of the geometry. | |
Box | GetBox () const |
Compute the bounding box of the object. | |
MayaGeometry & | Transform (const FrameScaled &) |
Transforms the geometry given a transformation operator. More... | |
MayaGeometry & | InverseTransform (const FrameScaled &) |
Inverse transforms the geometry given a transformation operator. More... | |
bool | Load_OBJ (const QString &) |
Loads the geometry from a OBJ file into a single MayaGeometry. More... | |
bool | find_MTL_Address (const QString &url, const QString &name, QString &nameR, QString &nameA) |
Loads the geometrys from an .obj file into a MayaGeometryAll. More... | |
bool | Save_OBJ (const QString &) const |
Save the geometry as a Maya .obj file. More... | |
bool | Save_OBJ_forVUE (const QString &url) const |
Save the geometry as a Maya .obj file. !!!! Y up for VUE. More... | |
bool | Save_OBJ (QTextStream &, int=1, int=1, int=1) const |
Save the geometry as a Maya .obj file (QTextStream). More... | |
bool | Save_PLY (const QString &) const |
Save the geometry as a Maya .obj file. More... | |
bool | Save_PBRT (QTextStream &) const |
Save the geometry as a pbrt file (QTextStream). More... | |
MayaStatistics | GetStatistics () const |
Compute the statistics of the object. More... | |
QString | GetText (int=0, bool=false) const |
Get the text information. More... | |
const Vector & | GetVertex (int, int) const |
Get the k-th vertex of the i-th triangle. More... | |
const Vector & | GetVertex (int) const |
Get the i-th vertec in the array. More... | |
const Vector & | GetNormal (int, int) const |
Get the normal of the k-th vertexof the i-th triangle. More... | |
const Vector & | GetNormal (int) const |
Get the i-th normal in the array. More... | |
const Vector & | GetColor (int, int) const |
Get the color of the k-th vertex of the i-th triangle. More... | |
const Vector & | GetColor (int) const |
Get the i-th color in the array. More... | |
const Vector2 & | GetUV (int, int) const |
Get the i-th UV in the array. More... | |
const Vector2 & | GetUV (int) const |
Get the i-th UV in the array. More... | |
void | Clear () |
Clear every data and set a neutral grey material. | |
void | generatePlannarZ_Mapping (Box2) |
Apply a planar mapping onto the object. More... | |
void | generatePlannarMapping (const Vector &dir, const double &step) |
Apply a planar mapping onto the object using a given normal direction. More... | |
Protected Attributes | |
MayaResources | atlas |
Set of resources. | |
MayaInstanceAll | scene |
The scene. | |
Protected Attributes inherited from MayaGeometryStack | |
FrameScaled | theframe |
Current transformation. | |
QVector< FrameScaled > | stackframe |
Stack of frames. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MayaGeometry | |
static MayaGeometryAll | CreateVectorField (const VectorField &, const double &=1.0) |
Create a set of arrows representing a vector field. More... | |
static MayaGeometry | extrusion8new (const QString &, QVector< Vector >, double, double, double) |
Warning Extrusion en pointillés | |
static MayaGeometry | extrusion5new (const QString &, Vector, Vector, QVector< QVector< Vector > >, QVector< QVector< Vector > >) |
Warning Extrusion d'un ensemble de contours autour d'une position et en fonction d'une direction ou chaque contour a une normale. | |
static MayaGeometry | extrusion4new (const QString &, Vector, Vector, QVector< QVector< Vector > >) |
Warning Extrusion d'un ensemble de contours autour d'une position et en fonction d'une direction. | |
static MayaGeometry | extrusion3new (const QString &, QVector< Vector >, QVector< QVector< Vector > >, QVector< int >, QVector< double >) |
Warning Extrusion le long d'une courbe en utilisant différents profils. Le choix des profils est paramétré par des indices et des distances. | |
static MayaGeometry | extrusion9new (const QString &, Vector, QVector< Vector >, double, double, double) |
extrusion circulaire | |
Public Attributes inherited from MayaGeometry | |
QString | name |
Signature of the object. | |
QVector< Vector > | vertex |
Array of vertices. | |
QVector< Vector > | normal |
Array of normals. | |
QVector< Vector > | color |
Array of colors. | |
QVector< Vector2 > | UVmap |
Array of UVs. | |
QVector< MayaIndexVertexData > | indexes |
Array of integers referencing vertices, normals, colors and UV. | |
MayaMaterial | mat |
Material of the object. | |
Protected Member Functions inherited from MayaGeometryStack | |
void | Reserve (int, int, int) |
Reserves some space for the vertex, normal and triangle arrays. More... | |
void | AddTriangleOffset (int, int, int, int) |
Append a triangle to the set. More... | |
Protected Member Functions inherited from MayaGeometry | |
void | AddTriangle (int, int, int, int) |
Add a triangle to the geometry. More... | |
void | AddSmoothTriangle (int, int, int, int, int, int) |
Add a smooth triangle to the geometry. More... | |
void | AddQuadrangle (int, int, int, int, int) |
Add a quadrangle to the geometry. More... | |
This class implements a scene construction framework based on MayaResources.
MayaSceneStack::MayaSceneStack | ( | ) |
Create an empty scene.
This function initializes the vertex and normal transforms to identity.
MayaSceneStack::MayaSceneStack | ( | const MayaGeometry & | geometry | ) |
Create a scene stack from an object.
The starting geometry is retrieved from the argument object. This function initializes the vertex and normal transforms to identity. Resources are empty.
geometry | Input geometry. |
void MayaSceneStack::AddGeometryToAtlas | ( | const QString & | name | ) |
Add the current geometry to the atlas.
Note that this function does not clear the current geometry, which can be done by calling MayaGEometry::Clear().
name | Name of the geometry. |
References MayaResources::Append(), atlas, MayaGeometry::name, and MayaGeometry::SetName().
Referenced by AddGeometryToScene().
void MayaSceneStack::AddGeometryToAtlas | ( | const QString & | name, |
const MayaGeometry & | mg | ||
) |
Add a given geometry to the atlas.
name | Name of the instance that will be associated to the geometry. |
mg | Geometry. |
References MayaResources::Append(), atlas, and MayaGeometry::name.
void MayaSceneStack::AddGeometryToScene | ( | const QString & | name | ) |
Add the current geometry to the scene.
This is a convenience function that is the same as the following code:
name | Name of the instance. |
References AddGeometryToAtlas(), AddInstanceToScene(), FrameScaled::Id, and MayaGeometry::name.
void MayaSceneStack::AddInstanceToAtlas | ( | const QString & | name, |
const QString & | url | ||
) |
Add a given geometry to the atlas.
This function is more efficient than adding the geometry directly as the geometry is loaded only if the entry does not exist.
name | Name of the instance that will be associated to the geometry. |
url | Url of the geometry. |
References MayaResources::Append(), atlas, and MayaGeometry::name.
void MayaSceneStack::AddInstanceToScene | ( | const QString & | name | ) |
Add an instance to the scene.
This function uses the current frame. It is the same as:
name | Name of the instance. |
References MayaInstanceAll::Append(), MayaGeometryStack::GetFrame(), MayaGeometry::name, and scene.
Referenced by AddGeometryToScene().
void MayaSceneStack::AddInstanceToScene | ( | const QString & | name, |
const FrameScaled & | frame | ||
) |
Add an instance to the scene.
This function uses the argument frame to locate the instance in the scene.
name | Name of the instance. |
frame | The frame. |
References MayaInstanceAll::Append(), MayaGeometry::name, and scene.
MayaGeometryAll MayaSceneStack::GetScene | ( | ) | const |
Create the scene as a MayaGeometryAll.
This function relies on the constructor MayaGeometryAll(const MayaResource&, const MayaInstanceAll&).
QString MayaSceneStack::GetText | ( | bool | html = false | ) | const |
Get the text information.
html | Flag to specify syntax highlighting. |
References atlas, MayaResources::GetText(), MayaInstanceAll::GetText(), MayaGeometry::GetText(), and scene.