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

The MayaGeometrySet class provides a geometric instance linked to several frames. More...

#include <maya.h>

Inheritance diagram for MayaGeometrySet:
MayaGeometry

Public Member Functions

 MayaGeometrySet ()
 Empty.
 
 MayaGeometrySet (const QString &, const MayaMaterial &=MayaMaterial::None)
 Create a geometry set. More...
 
 MayaGeometrySet (const QString &, const FrameScaled &, const MayaMaterial &=MayaMaterial::None)
 Create a geometry set and one instance. More...
 
 MayaGeometrySet (const MayaGeometry &)
 Create a set of geometric instances. More...
 
 MayaGeometrySet (const MayaGeometry &, const FrameScaled &)
 Create a set of geometric instances. More...
 
 MayaGeometrySet (const MayaGeometry &, const QVector< FrameScaled > &)
 Create a set of geometric instances. More...
 
 MayaGeometrySet (const MayaGeometry &, const QVector< Vector > &)
 Create a set of geometric instances. More...
 
 ~MayaGeometrySet ()
 Empty.
 
void Append (const FrameScaled &)
 Adds a frame to the list of instances. More...
 
void SetName (const QString &)
 Set the name. More...
 
void SetFrames (QVector< FrameScaled >)
 Set the set of frames that define the locations of the instances. More...
 
void ApplyFrames (QVector< FrameScaled >)
 Add a frame to the list of instances. More...
 
void Rotate (const Vector &)
 Rotates a set of geometrical objects. More...
 
void Translate (const Vector &)
 Translates a set of geometrical objects. More...
 
void Scale (const Vector &)
 Scales a set of geometrical objects. More...
 
void Clear ()
 Clear the instance set.
 
void Remove (int)
 Remove a given instance from the set. More...
 
QString GetName () const
 Get the name of the geometry set.
 
Box GetBox () const
 Compute the bounding box.
 
FrameScaled GetFrameScaled (int) const
 Get the i-th frame. More...
 
QVector< FrameScaledGetFrames () const
 Get the set of frames.
 
int count () const
 Get the number of frames in the instance set.
 
MayaGeometry Collapse () const
 Merge all the instances into a signel Maya geometry structure.
 
bool Save_VueScript (QTextStream &out) const
 Export instances in Vue Software format.
 
bool Save_VUE (QTextStream &out) const
 Save the instances as a Vue python script. More...
 
MayaStatistics GetStatistics () const
 Compute the statistics of the geometry set. More...
 
QString GetText (int=0, bool=false) const
 Get the text information. More...
 
- 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< TriangleGetTriangles () 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.
 
MayaGeometryTransform (const FrameScaled &)
 Transforms the geometry given a transformation operator. More...
 
MayaGeometryInverseTransform (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 VectorGetVertex (int, int) const
 Get the k-th vertex of the i-th triangle. More...
 
const VectorGetVertex (int) const
 Get the i-th vertec in the array. More...
 
const VectorGetNormal (int, int) const
 Get the normal of the k-th vertexof the i-th triangle. More...
 
const VectorGetNormal (int) const
 Get the i-th normal in the array. More...
 
const VectorGetColor (int, int) const
 Get the color of the k-th vertex of the i-th triangle. More...
 
const VectorGetColor (int) const
 Get the i-th color in the array. More...
 
const Vector2GetUV (int, int) const
 Get the i-th UV in the array. More...
 
const Vector2GetUV (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...
 

Static Public Member Functions

static MayaGeometrySet CreateVoxel (const Voxel &, bool=false)
 Create a set of cubes representing a voxel. More...
 
- 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
 

Protected Attributes

QVector< FrameScaledframes
 Array of frames.
 

Additional Inherited Members

- Public Attributes inherited from MayaGeometry
QString name
 Signature of the object.
 
QVector< Vectorvertex
 Array of vertices.
 
QVector< Vectornormal
 Array of normals.
 
QVector< Vectorcolor
 Array of colors.
 
QVector< Vector2UVmap
 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 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...
 

Detailed Description

The MayaGeometrySet class provides a geometric instance linked to several frames.

Constructor & Destructor Documentation

◆ MayaGeometrySet() [1/6]

MayaGeometrySet::MayaGeometrySet ( const QString &  name,
const MayaMaterial mo = MayaMaterial::None 
)
inline

Create a geometry set.

Parameters
nameName.
moMaterial.

◆ MayaGeometrySet() [2/6]

MayaGeometrySet::MayaGeometrySet ( const QString &  name,
const FrameScaled frame,
const MayaMaterial mo = MayaMaterial::None 
)
inline

Create a geometry set and one instance.

Parameters
nameName.
frameFrame of the instance.
moMaterial.

References frames.

◆ MayaGeometrySet() [3/6]

MayaGeometrySet::MayaGeometrySet ( const MayaGeometry mg)

Create a set of geometric instances.

Note that no reference to the geometric object is created.

Parameters
mgGeometric object.

◆ MayaGeometrySet() [4/6]

MayaGeometrySet::MayaGeometrySet ( const MayaGeometry mg,
const FrameScaled mf 
)

Create a set of geometric instances.

One reference to the geometric instance is created using the argument frame.

Parameters
mgGeometric object.
mfFrame.

References frames.

◆ MayaGeometrySet() [5/6]

MayaGeometrySet::MayaGeometrySet ( const MayaGeometry mg,
const QVector< FrameScaled > &  mfs 
)

Create a set of geometric instances.

Several references to the geometric instance are created using the argument set of frames.

Parameters
mgGeometric object.
mfsSet of frames.

References frames.

◆ MayaGeometrySet() [6/6]

MayaGeometrySet::MayaGeometrySet ( const MayaGeometry mg,
const QVector< Vector > &  mfs 
)

Create a set of geometric instances.

Several references to the geometric instance are created using the argument set of frames.

Parameters
mgGeometric object.
mfsSet of translation vectors.

References frames, and FrameScaled::Translation().

Member Function Documentation

◆ Append()

void MayaGeometrySet::Append ( const FrameScaled frame)

Adds a frame to the list of instances.

Parameters
frameThe frame.

References frames.

Referenced by MayaGeometry::CreateVectorField(), and CreateVoxel().

◆ ApplyFrames()

void MayaGeometrySet::ApplyFrames ( QVector< FrameScaled set)

Add a frame to the list of instances.

Parameters
setThe set of frames.

References frames.

◆ CreateVoxel()

MayaGeometrySet MayaGeometrySet::CreateVoxel ( const Voxel voxel,
bool  surface = false 
)
static

Create a set of cubes representing a voxel.

Parameters
voxelThe voxel.
boolsurface Only produce cubes that participate to the visible surface.

References Append(), Voxel::at(), Array::Cell(), Array::CellSize(), Array::CellSizeX(), Array::CellSizeY(), Array::CellSizeZ(), Box::Center(), MayaGeometry::MayaGeometry(), SetName(), FrameScaled::Translation(), and Array::UnitCell().

◆ GetFrameScaled()

FrameScaled MayaGeometrySet::GetFrameScaled ( int  i) const
inline

Get the i-th frame.

Parameters
iIndex.

References frames.

Referenced by MayaGpuAll::Append(), and MayaGeometryAll::Append().

◆ GetStatistics()

MayaStatistics MayaGeometrySet::GetStatistics ( ) const

Compute the statistics of the geometry set.

Returns
The statistics.

References frames, MayaGeometry::indexes, and MayaGeometry::vertex.

Referenced by MayaGpuSet::MayaGpuSet().

◆ GetText()

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

Get the text information.

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

References frames, and GetName().

◆ Remove()

void MayaGeometrySet::Remove ( int  i)
inline

Remove a given instance from the set.

Parameters
iInstance index.

References frames.

◆ Rotate()

void MayaGeometrySet::Rotate ( const Vector r)

Rotates a set of geometrical objects.

This function simply updates the frame of the object.

Parameters
rRotation vector in Euler coordinates.

References frames.

◆ Save_VUE()

bool MayaGeometrySet::Save_VUE ( QTextStream &  out) const

Save the instances as a Vue python script.

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

References frames, and Math::Pi.

◆ Scale()

void MayaGeometrySet::Scale ( const Vector s)

Scales a set of geometrical objects.

This function simply updates the frame of the object.

Parameters
sScaling vector.

References frames.

◆ SetFrames()

void MayaGeometrySet::SetFrames ( QVector< FrameScaled frames)
inline

Set the set of frames that define the locations of the instances.

Parameters
framesSet of frames.

References frames.

◆ SetName()

void MayaGeometrySet::SetName ( const QString &  n)
inline

Set the name.

Parameters
nName.

References MayaGeometry::name.

Referenced by CreateVoxel().

◆ Translate()

void MayaGeometrySet::Translate ( const Vector t)

Translates a set of geometrical objects.

This function simply updates the frame of the object.

Parameters
tTranslation vector.

References frames.