|
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. | |
| MayaSceneStack (const MayaGeometry &) | |
| Create a scene stack from an object. | |
| ~MayaSceneStack () | |
| Empty. | |
| void | AddGeometryToAtlas (const QString &) |
| Add the current geometry to the atlas. | |
| void | AddGeometryToAtlas (const QString &, const MayaGeometry &) |
| Add a given geometry to the atlas. | |
| void | AddInstanceToAtlas (const QString &, const QString &) |
| Add a given geometry to the atlas. | |
| void | AddInstanceToScene (const QString &) |
| Add an instance to the scene. | |
| void | AddInstanceToScene (const QString &, const FrameScaled &) |
| Add an instance to the scene. | |
| void | AddGeometryToScene (const QString &) |
| Add the current geometry to the scene. | |
| MayaGeometryAll | GetScene () const |
| Create the scene as a MayaGeometryAll. | |
| QString | GetText (bool=false) const |
| Get the text information. | |
Public Member Functions inherited from MayaGeometryStack | |
| MayaGeometryStack () | |
| Create an empty object. | |
| MayaGeometryStack (const MayaGeometry &) | |
| Create a geometry stack from a given object. | |
| ~MayaGeometryStack () | |
| Empty. | |
| void | Push () |
| Push the current geometry generation state. | |
| void | Pop () |
| Pop a previously pushed geometry generation state. | |
| 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. | |
| void | Translate (const Vector &) |
| Apply a given translation to the next geometric operations. | |
| void | Rotate (const Vector &) |
| Apply a given Euler rotation to the next geometric operations. | |
| void | Scale (const Vector &) |
| Apply a given scale to the next geometric operations. | |
| void | AddTriangle (const Vector &, const Vector &, const Vector &) |
| Add a triangle to the geometry. | |
| void | AddGeometry (const MayaGeometryStack &) |
| Add a given object to the shape. | |
| FrameScaled | GetFrame () const |
| Get the current building frame. | |
Public Member Functions inherited from MayaGeometry | |
| MayaGeometry (const QString &=QString("None"), const MayaMaterial &=MayaMaterial::None) | |
| Creates an empty mesh structure. | |
| 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. | |
| MayaGeometry (const QString &, const QVector< Vector > &, const QVector< Vector > &, const QVector< Vector > &, const QVector< MayaIndexVertexData > &, const MayaMaterial &=MayaMaterial::None) | |
| Creates a mesh. | |
| 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. | |
| MayaGeometry (const QString &, const Mesh &, const MayaMaterial &=MayaMaterial::None) | |
| Creates an geometry from a mesh. | |
| MayaGeometry (const QString &, const MeshColor &, const MayaMaterial &=MayaMaterial::None) | |
| Creates an geometry from a mesh. | |
| MayaGeometry (const QString &, const Mesh2 &, const MayaMaterial &=MayaMaterial::None) | |
| Creates an geometry from a mesh. | |
| MayaGeometry (const QString &, const QVector< Triangle > &, const MayaMaterial &=MayaMaterial::None) | |
| Creates a geometry from a set of triangles. | |
| ~MayaGeometry () | |
| Empty. | |
| MayaGeometry (const QString &, const Vector *, int, const Vector *, int, const int *, int, const MayaMaterial &=MayaMaterial::None) | |
| Create a mesh. | |
| void | AddTriangle (const Vector &, const Vector &, const Vector &) |
| Adds a triangle to the mesh. | |
| void | AddSmoothTriangle (const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &) |
| Adds a smooth triangle to the mesh. | |
| void | SetName (const QString &) |
| Set the name. | |
| void | SetMaterial (const MayaMaterial &) |
| Set the MayaMaterial. | |
| void | Merge (const MayaGeometry &) |
| Merges an argument mesh with the existing mesh. | |
| Triangle | GetTriangle (int) const |
| Get the i-th triangle from the mesh as a flat triangle. | |
| 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. | |
| MayaGeometry & | InverseTransform (const FrameScaled &) |
| Inverse transforms the geometry given a transformation operator. | |
| bool | Load_OBJ (const QString &) |
| Loads the geometry from a OBJ file into a single MayaGeometry. | |
| bool | find_MTL_Address (const QString &url, const QString &name, QString &nameR, QString &nameA) |
| Loads the geometrys from an .obj file into a MayaGeometryAll. | |
| bool | Save_OBJ (const QString &) const |
| Save the geometry as a Maya .obj file. | |
| bool | Save_OBJ_forVUE (const QString &url) const |
| Save the geometry as a Maya .obj file. !!!! Y up for VUE. | |
| bool | Save_OBJ (QTextStream &, int=1, int=1, int=1) const |
| Save the geometry as a Maya .obj file (QTextStream). | |
| bool | Save_PLY (const QString &) const |
| Save the geometry as a Maya .obj file. | |
| bool | Save_PBRT (QTextStream &) const |
| Save the geometry as a pbrt file (QTextStream). | |
| MayaStatistics | GetStatistics () const |
| Compute the statistics of the object. | |
| QString | GetText (int=0, bool=false) const |
| Get the text information. | |
| const Vector & | GetVertex (int, int) const |
| Get the k-th vertex of the i-th triangle. | |
| const Vector & | GetVertex (int) const |
| Get the i-th vertec in the array. | |
| const Vector & | GetNormal (int, int) const |
| Get the normal of the k-th vertexof the i-th triangle. | |
| const Vector & | GetNormal (int) const |
| Get the i-th normal in the array. | |
| const Vector & | GetColor (int, int) const |
| Get the color of the k-th vertex of the i-th triangle. | |
| const Vector & | GetColor (int) const |
| Get the i-th color in the array. | |
| const Vector2 & | GetUV (int, int) const |
| Get the i-th UV in the array. | |
| const Vector2 & | GetUV (int) const |
| Get the i-th UV in the array. | |
| void | Clear () |
| Clear every data and set a neutral grey material. | |
| void | generatePlannarZ_Mapping (Box2) |
| Apply a planar mapping onto the object. | |
| void | generatePlannarMapping (const Vector &dir, const double &step) |
| Apply a planar mapping onto the object using a given normal direction. | |
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. | |
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. | |
| void | AddTriangleOffset (int, int, int, int) |
| Append a triangle to the set. | |
Protected Member Functions inherited from MayaGeometry | |
| void | AddTriangle (int, int, int, int) |
| Add a triangle to the geometry. | |
| void | AddSmoothTriangle (int, int, int, int, int, int) |
| Add a smooth triangle to the geometry. | |
| void | AddQuadrangle (int, int, int, int, int) |
| Add a quadrangle to the geometry. | |
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. |
References MayaGeometry::MayaGeometry(), and MayaGeometryStack::MayaGeometryStack().
| 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 atlas, MayaGeometry::MayaGeometry(), 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 atlas, MayaGeometry::MayaGeometry(), 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 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 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 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, MayaGeometry::GetText(), and scene.