Public Types | Public Member Functions | List of all members
gazebo::common::SubMesh Class Reference

A child mesh. More...

#include <Mesh.hh>

Public Types

enum  PrimitiveType {
  POINTS, LINES, LINESTRIPS, TRIANGLES,
  TRIFANS, TRISTRIPS
}
 An enumeration of the geometric mesh primitives. More...
 

Public Member Functions

 SubMesh ()
 Constructor. More...
 
 SubMesh (const SubMesh *_mesh)
 Copy Constructor. More...
 
virtual ~SubMesh ()
 Destructor. More...
 
void AddIndex (unsigned int _i)
 Add an index to the mesh. More...
 
void AddNodeAssignment (unsigned int _vertex, unsigned int _node, float _weight)
 Add a vertex - skeleton node assignment. More...
 
void AddNormal (const math::Vector3 &_n) GAZEBO_DEPRECATED(6.0)
 Add a normal to the mesh. More...
 
void AddNormal (const ignition::math::Vector3d &_n)
 Add a normal to the mesh. More...
 
void AddNormal (double _x, double _y, double _z)
 Add a normal to the mesh. More...
 
void AddTexCoord (double _u, double _v)
 Add a texture coord to the mesh. More...
 
void AddVertex (const math::Vector3 &_v) GAZEBO_DEPRECATED(6.0)
 Add a vertex to the mesh. More...
 
void AddVertex (const ignition::math::Vector3d &_v)
 Add a vertex to the mesh. More...
 
void AddVertex (double _x, double _y, double _z)
 Add a vertex to the mesh. More...
 
void Center (const math::Vector3 &_center=math::Vector3::Zero) GAZEBO_DEPRECATED(6.0)
 Move the center of the submesh to the given coordinate. More...
 
void Center (const ignition::math::Vector3d &_center=ignition::math::Vector3d::Zero)
 Move the center of the submesh to the given coordinate. More...
 
void CopyNormals (const std::vector< math::Vector3 > &_norms) GAZEBO_DEPRECATED(6.0)
 Copy normals from a vector. More...
 
void CopyNormals (const std::vector< ignition::math::Vector3d > &_norms)
 Copy normals from a vector. More...
 
void CopyVertices (const std::vector< math::Vector3 > &_verts) GAZEBO_DEPRECATED(6.0)
 Copy vertices from a vector. More...
 
void CopyVertices (const std::vector< ignition::math::Vector3d > &_verts)
 Copy vertices from a vector. More...
 
void FillArrays (float **_vertArr, int **_indArr) const
 Put all the data into flat arrays. More...
 
void GenSphericalTexCoord (const math::Vector3 &_center) GAZEBO_DEPRECATED(6.0)
 Generate texture coordinates using spherical projection from center. More...
 
void GenSphericalTexCoord (const ignition::math::Vector3d &_center)
 Generate texture coordinates using spherical projection from center. More...
 
unsigned int GetIndex (unsigned int _i) const
 Get an index. More...
 
unsigned int GetIndexCount () const
 Return the number of indicies. More...
 
unsigned int GetMaterialIndex () const
 Get the material index. More...
 
math::Vector3 GetMax () const GAZEBO_DEPRECATED(6.0)
 Get the maximum X, Y, Z values. More...
 
unsigned int GetMaxIndex () const
 Get the highest index value. More...
 
math::Vector3 GetMin () const GAZEBO_DEPRECATED(6.0)
 Get the minimum X, Y, Z values from all the vertices. More...
 
std::string GetName () const
 Get the name of this mesh. More...
 
NodeAssignment GetNodeAssignment (unsigned int _i) const
 Get a vertex - skeleton node assignment. More...
 
unsigned int GetNodeAssignmentsCount () const
 Return the number of vertex - skeleton node assignments. More...
 
math::Vector3 GetNormal (unsigned int _i) const GAZEBO_DEPRECATED(6.0)
 Get a normal. More...
 
unsigned int GetNormalCount () const
 Return the number of normals. More...
 
PrimitiveType GetPrimitiveType () const
 Get the primitive type. More...
 
math::Vector2d GetTexCoord (unsigned int _i) const GAZEBO_DEPRECATED(6.0)
 Get a tex coord. More...
 
unsigned int GetTexCoordCount () const
 Return the number of texture coordinates. More...
 
math::Vector3 GetVertex (unsigned int _i) const GAZEBO_DEPRECATED(6.0)
 Get a vertex. More...
 
unsigned int GetVertexCount () const
 Return the number of vertices. More...
 
unsigned int GetVertexIndex (const math::Vector3 &_v) const GAZEBO_DEPRECATED(6.0)
 Get the index of the vertex. More...
 
unsigned int GetVertexIndex (const ignition::math::Vector3d &_v) const
 Get the index of the vertex. More...
 
bool HasVertex (const math::Vector3 &_v) const GAZEBO_DEPRECATED(6.0)
 Return true if this submesh has the vertex. More...
 
bool HasVertex (const ignition::math::Vector3d &_v) const
 Return true if this submesh has the vertex. More...
 
ignition::math::Vector3d Max () const
 Get the maximum X, Y, Z values from all the vertices. More...
 
ignition::math::Vector3d Min () const
 Get the minimum X, Y, Z values from all the vertices. More...
 
ignition::math::Vector3d Normal (unsigned int _i) const
 Get a normal. More...
 
void RecalculateNormals ()
 Recalculate all the normals. More...
 
void Scale (double _factor)
 Scale all vertices by _factor. More...
 
void SetIndexCount (unsigned int _count)
 Resize the index array. More...
 
void SetMaterialIndex (unsigned int _index)
 Set the material index. More...
 
void SetName (const std::string &_n)
 Set the name of this mesh. More...
 
void SetNormal (unsigned int _i, const math::Vector3 &_n) GAZEBO_DEPRECATED(6.0)
 Set a normal. More...
 
void SetNormal (unsigned int _i, const ignition::math::Vector3d &_n)
 Set a normal. More...
 
void SetNormalCount (unsigned int _count)
 Resize the normal array. More...
 
void SetPrimitiveType (PrimitiveType _type)
 Set the primitive type. More...
 
void SetScale (const math::Vector3 &_factor) GAZEBO_DEPRECATED(6.0)
 Scale all vertices by the _factor vector. More...
 
void SetScale (const ignition::math::Vector3d &_factor)
 Scale all vertices by the _factor vector. More...
 
void SetTexCoord (unsigned int _i, const math::Vector2d &_t) GAZEBO_DEPRECATED(6.0)
 Set a tex coord. More...
 
void SetTexCoord (unsigned int _i, const ignition::math::Vector2d &_t)
 Set a tex coord. More...
 
void SetTexCoordCount (unsigned int _count)
 Resize the texture coordinate array. More...
 
void SetVertex (unsigned int _i, const math::Vector3 &_v) GAZEBO_DEPRECATED(6.0)
 Set a vertex. More...
 
void SetVertex (unsigned int _i, const ignition::math::Vector3d &_v)
 Set a vertex. More...
 
void SetVertexCount (unsigned int _count)
 Resize the vertex array. More...
 
ignition::math::Vector2d TexCoord (unsigned int _i) const
 Get a tex coord. More...
 
void Translate (const math::Vector3 &_vec) GAZEBO_DEPRECATED(6.0)
 Move all vertices by _vec. More...
 
void Translate (const ignition::math::Vector3d &_vec)
 Move all vertices by _vec. More...
 
ignition::math::Vector3d Vertex (unsigned int _i) const
 Get a vertex. More...
 

Detailed Description

A child mesh.

Member Enumeration Documentation

An enumeration of the geometric mesh primitives.

Enumerator
POINTS 
LINES 
LINESTRIPS 
TRIANGLES 
TRIFANS 
TRISTRIPS 

Constructor & Destructor Documentation

gazebo::common::SubMesh::SubMesh ( )

Constructor.

gazebo::common::SubMesh::SubMesh ( const SubMesh _mesh)

Copy Constructor.

virtual gazebo::common::SubMesh::~SubMesh ( )
virtual

Destructor.

Member Function Documentation

void gazebo::common::SubMesh::AddIndex ( unsigned int  _i)

Add an index to the mesh.

Parameters
[in]_ithe new vertex index
void gazebo::common::SubMesh::AddNodeAssignment ( unsigned int  _vertex,
unsigned int  _node,
float  _weight 
)

Add a vertex - skeleton node assignment.

Parameters
[in]_vertexthe vertex index
[in]_nodethe node index
[in]_weightthe weight (between 0 and 1)
void gazebo::common::SubMesh::AddNormal ( const math::Vector3 _n)

Add a normal to the mesh.

Parameters
[in]_nthe normal
Deprecated:
See AddNormal function that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::AddNormal ( const ignition::math::Vector3d &  _n)

Add a normal to the mesh.

Parameters
[in]_nthe normal
void gazebo::common::SubMesh::AddNormal ( double  _x,
double  _y,
double  _z 
)

Add a normal to the mesh.

Parameters
[in]_xposition along x
[in]_yposition along y
[in]_zposition along z
void gazebo::common::SubMesh::AddTexCoord ( double  _u,
double  _v 
)

Add a texture coord to the mesh.

Parameters
[in]_uposition along u
[in]_vposition along v
void gazebo::common::SubMesh::AddVertex ( const math::Vector3 _v)

Add a vertex to the mesh.

Parameters
[in]_vthe new position
Deprecated:
See AddVertex function that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::AddVertex ( const ignition::math::Vector3d &  _v)

Add a vertex to the mesh.

Parameters
[in]_vthe new position
void gazebo::common::SubMesh::AddVertex ( double  _x,
double  _y,
double  _z 
)

Add a vertex to the mesh.

Parameters
[in]_xposition along x
[in]_yposition along y
[in]_zposition along z
void gazebo::common::SubMesh::Center ( const math::Vector3 _center = math::Vector3::Zero)

Move the center of the submesh to the given coordinate.

This will move all the vertices.

Parameters
[in]_centerLocation of the mesh center.
Deprecated:
See Center function that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::Center ( const ignition::math::Vector3d &  _center = ignition::math::Vector3d::Zero)

Move the center of the submesh to the given coordinate.

This will move all the vertices.

Parameters
[in]_centerLocation of the mesh center.
void gazebo::common::SubMesh::CopyNormals ( const std::vector< math::Vector3 > &  _norms)

Copy normals from a vector.

Parameters
[in]_normsto copy from
Deprecated:
See CopyNormals that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::CopyNormals ( const std::vector< ignition::math::Vector3d > &  _norms)

Copy normals from a vector.

Parameters
[in]_normsto copy from
void gazebo::common::SubMesh::CopyVertices ( const std::vector< math::Vector3 > &  _verts)

Copy vertices from a vector.

Parameters
[in]_vertsthe vertices to copy from
Deprecated:
See CopyVertices that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::CopyVertices ( const std::vector< ignition::math::Vector3d > &  _verts)

Copy vertices from a vector.

Parameters
[in]_vertsthe vertices to copy from
void gazebo::common::SubMesh::FillArrays ( float **  _vertArr,
int **  _indArr 
) const

Put all the data into flat arrays.

Parameters
[in]_verArr
[in]_indArr
void gazebo::common::SubMesh::GenSphericalTexCoord ( const math::Vector3 _center)

Generate texture coordinates using spherical projection from center.

Parameters
[in]_center
Deprecated:
See GenSphericalTexCoord that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::GenSphericalTexCoord ( const ignition::math::Vector3d &  _center)

Generate texture coordinates using spherical projection from center.

Parameters
[in]_center
unsigned int gazebo::common::SubMesh::GetIndex ( unsigned int  _i) const

Get an index.

Parameters
[in]_i
unsigned int gazebo::common::SubMesh::GetIndexCount ( ) const

Return the number of indicies.

unsigned int gazebo::common::SubMesh::GetMaterialIndex ( ) const

Get the material index.

math::Vector3 gazebo::common::SubMesh::GetMax ( ) const

Get the maximum X, Y, Z values.

Returns
Max X,Y,Z values from all vertices in submesh
Deprecated:
See Max function that returns ignition::math::Vector3d.
unsigned int gazebo::common::SubMesh::GetMaxIndex ( ) const

Get the highest index value.

math::Vector3 gazebo::common::SubMesh::GetMin ( ) const

Get the minimum X, Y, Z values from all the vertices.

Returns
Min X,Y,Z values from all vertices in submesh
Deprecated:
See Min function that returns ignition::math::Vector3d.
std::string gazebo::common::SubMesh::GetName ( ) const

Get the name of this mesh.

Returns
the name
NodeAssignment gazebo::common::SubMesh::GetNodeAssignment ( unsigned int  _i) const

Get a vertex - skeleton node assignment.

Parameters
[in]_ithe index of the assignment
unsigned int gazebo::common::SubMesh::GetNodeAssignmentsCount ( ) const

Return the number of vertex - skeleton node assignments.

math::Vector3 gazebo::common::SubMesh::GetNormal ( unsigned int  _i) const

Get a normal.

Parameters
[in]_ithe normal index
Returns
the orientation of the normal, or throws an exception
Deprecated:
See Normal function that return ignition::math::Vector3d.
unsigned int gazebo::common::SubMesh::GetNormalCount ( ) const

Return the number of normals.

PrimitiveType gazebo::common::SubMesh::GetPrimitiveType ( ) const

Get the primitive type.

Returns
the primitive type
math::Vector2d gazebo::common::SubMesh::GetTexCoord ( unsigned int  _i) const

Get a tex coord.

Parameters
[in]_ithe texture index
Returns
the texture coordinates
Deprecated:
See TexCoord function that return ignition::math::Vector2d.
unsigned int gazebo::common::SubMesh::GetTexCoordCount ( ) const

Return the number of texture coordinates.

math::Vector3 gazebo::common::SubMesh::GetVertex ( unsigned int  _i) const

Get a vertex.

Parameters
[in]_ithe vertex index
Returns
the position or throws an exception
Deprecated:
See Vertex function that return an ignition::math::Vector3d.
unsigned int gazebo::common::SubMesh::GetVertexCount ( ) const

Return the number of vertices.

unsigned int gazebo::common::SubMesh::GetVertexIndex ( const math::Vector3 _v) const

Get the index of the vertex.

Parameters
[in]_v
Deprecated:
See GetVertexIndex function that accepts ignition::math::Vector3d.
unsigned int gazebo::common::SubMesh::GetVertexIndex ( const ignition::math::Vector3d &  _v) const

Get the index of the vertex.

Parameters
[in]_vVertex to check
Returns
Index of the vertex that matches _v.
bool gazebo::common::SubMesh::HasVertex ( const math::Vector3 _v) const

Return true if this submesh has the vertex.

Parameters
[in]_v
Returns
Return true if this submesh has the vertex
Deprecated:
See HasVertex function that accepts ignition::math::Vector3d.
bool gazebo::common::SubMesh::HasVertex ( const ignition::math::Vector3d &  _v) const

Return true if this submesh has the vertex.

Parameters
[in]_v
Returns
Return true if this submesh has the vertex
ignition::math::Vector3d gazebo::common::SubMesh::Max ( ) const

Get the maximum X, Y, Z values from all the vertices.

Returns
Max X,Y,Z values from all vertices in submesh
ignition::math::Vector3d gazebo::common::SubMesh::Min ( ) const

Get the minimum X, Y, Z values from all the vertices.

Returns
Min X,Y,Z values from all vertices in submesh
ignition::math::Vector3d gazebo::common::SubMesh::Normal ( unsigned int  _i) const

Get a normal.

Parameters
[in]_ithe normal index
Returns
the orientation of the normal, or throws an exception
void gazebo::common::SubMesh::RecalculateNormals ( )

Recalculate all the normals.

void gazebo::common::SubMesh::Scale ( double  _factor)

Scale all vertices by _factor.

Parameters
[in]_factorScaling factor
void gazebo::common::SubMesh::SetIndexCount ( unsigned int  _count)

Resize the index array.

Parameters
[in]_countthe new size of the array
void gazebo::common::SubMesh::SetMaterialIndex ( unsigned int  _index)

Set the material index.

Relates to the parent mesh material list

Parameters
[in]_index
void gazebo::common::SubMesh::SetName ( const std::string &  _n)

Set the name of this mesh.

Parameters
[in]_nthe name to set
void gazebo::common::SubMesh::SetNormal ( unsigned int  _i,
const math::Vector3 _n 
)

Set a normal.

Parameters
[in]_ithe normal index
[in]_nthe normal direction
Deprecated:
See SetNormal function that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::SetNormal ( unsigned int  _i,
const ignition::math::Vector3d &  _n 
)

Set a normal.

Parameters
[in]_ithe normal index
[in]_nthe normal direction
void gazebo::common::SubMesh::SetNormalCount ( unsigned int  _count)

Resize the normal array.

Parameters
[in]_countthe new size of the array
void gazebo::common::SubMesh::SetPrimitiveType ( PrimitiveType  _type)

Set the primitive type.

Parameters
[in]_typethe type
void gazebo::common::SubMesh::SetScale ( const math::Vector3 _factor)

Scale all vertices by the _factor vector.

Parameters
[in]_factorScaling vector
Deprecated:
See SetScale function accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::SetScale ( const ignition::math::Vector3d &  _factor)

Scale all vertices by the _factor vector.

Parameters
[in]_factorScaling vector
void gazebo::common::SubMesh::SetTexCoord ( unsigned int  _i,
const math::Vector2d _t 
)

Set a tex coord.

Parameters
[in]_i
[in]_t
Deprecated:
See SetTexCoord function that accepts ignition::math::Vector2d.
void gazebo::common::SubMesh::SetTexCoord ( unsigned int  _i,
const ignition::math::Vector2d &  _t 
)

Set a tex coord.

Parameters
[in]_i
[in]_t
void gazebo::common::SubMesh::SetTexCoordCount ( unsigned int  _count)

Resize the texture coordinate array.

Parameters
[in]_count
void gazebo::common::SubMesh::SetVertex ( unsigned int  _i,
const math::Vector3 _v 
)

Set a vertex.

Parameters
[in]_ithe index
[in]_vthe position
Deprecated:
See SetVertex function that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::SetVertex ( unsigned int  _i,
const ignition::math::Vector3d &  _v 
)

Set a vertex.

Parameters
[in]_ithe index
[in]_vthe position
void gazebo::common::SubMesh::SetVertexCount ( unsigned int  _count)

Resize the vertex array.

Parameters
[in]_countthe new size of the array
ignition::math::Vector2d gazebo::common::SubMesh::TexCoord ( unsigned int  _i) const

Get a tex coord.

Parameters
[in]_ithe texture index
Returns
the texture coordinates
void gazebo::common::SubMesh::Translate ( const math::Vector3 _vec)

Move all vertices by _vec.

Parameters
[in]_vecAmount to translate vertices.
Deprecated:
See Translate function that accepts ignition::math::Vector3d.
void gazebo::common::SubMesh::Translate ( const ignition::math::Vector3d &  _vec)

Move all vertices by _vec.

Parameters
[in]_vecAmount to translate vertices.
ignition::math::Vector3d gazebo::common::SubMesh::Vertex ( unsigned int  _i) const

Get a vertex.

Parameters
[in]_ithe vertex index
Returns
the position or throws an exception

The documentation for this class was generated from the following file: