Mesh represents a mesh shape, and is usually accessed through a Geometry. More...
#include <Mesh.hh>
Public Member Functions | |
Mesh () | |
Constructor. | |
std::optional< gz::math::Inertiald > | CalculateInertial (sdf::Errors &_errors, double _density, const sdf::ElementPtr _autoInertiaParams, const ParserConfig &_config) |
Calculate and return the Inertial values for the Mesh. | |
bool | CenterSubmesh () const |
Get whether the submesh should be centered at 0,0,0. | |
const sdf::ConvexDecomposition * | ConvexDecomposition () const |
Get the associated ConvexDecomposition object. | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. | |
const std::string & | FilePath () const |
The path to the file where this element was loaded from. | |
Errors | Load (ElementPtr _sdf) |
Load the mesh geometry based on a element pointer. | |
Errors | Load (sdf::ElementPtr _sdf, const ParserConfig &_config) |
Load the mesh geometry based on a element pointer. | |
MeshOptimization | Optimization () const |
Get the mesh's optimization method. | |
std::string | OptimizationStr () const |
Get the mesh's optimization method. | |
gz::math::Vector3d | Scale () const |
Get the mesh's scale factor. | |
void | SetCenterSubmesh (const bool _center) |
Set whether the submesh should be centered. | |
void | SetConvexDecomposition (const sdf::ConvexDecomposition &_convexDecomposition) |
Set the associated ConvexDecomposition object. | |
void | SetFilePath (const std::string &_filePath) |
Set the path to the file where this element was loaded from. | |
bool | SetOptimization (const std::string &_optimizationStr) |
Set the mesh optimization method. | |
void | SetOptimization (MeshOptimization _optimization) |
Set the mesh optimization method. | |
void | SetScale (const gz::math::Vector3d &_scale) |
Set the mesh's scale factor. | |
void | SetSubmesh (const std::string &_submesh) |
Set the mesh's submesh. | |
void | SetUri (const std::string &_uri) |
Set the mesh's URI. | |
std::string | Submesh () const |
A submesh, contained with the mesh at the specified URI, may optionally be specified. | |
sdf::ElementPtr | ToElement () const |
Create and return an SDF element filled with data from this mesh. | |
sdf::ElementPtr | ToElement (sdf::Errors &_errors) const |
Create and return an SDF element filled with data from this mesh. | |
std::string | Uri () const |
Get the mesh's URI. | |
sdf::SDF_VERSION_NAMESPACE::Mesh::Mesh | ( | ) |
Constructor.
std::optional< gz::math::Inertiald > sdf::SDF_VERSION_NAMESPACE::Mesh::CalculateInertial | ( | sdf::Errors & | _errors, |
double | _density, | ||
const sdf::ElementPtr | _autoInertiaParams, | ||
const ParserConfig & | _config | ||
) |
Calculate and return the Inertial values for the Mesh.
[out] | _errors | A vector of Errors object. Each object would contain an error code and an error message. |
[in] | _density | Density of the mesh in kg/m^3 |
[in] | _autoInertiaParams | ElementPtr to <auto_inertia_params> element |
[in] | _config | Parser Configuration |
bool sdf::SDF_VERSION_NAMESPACE::Mesh::CenterSubmesh | ( | ) | const |
Get whether the submesh should be centered at 0,0,0.
This will effectively remove any transformations on the submesh before the poses from parent links and models are applied. The return value is only applicable if a SubMesh has been specified.
const sdf::ConvexDecomposition * sdf::SDF_VERSION_NAMESPACE::Mesh::ConvexDecomposition | ( | ) | const |
Get the associated ConvexDecomposition object.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Mesh::Element | ( | ) | const |
const std::string & sdf::SDF_VERSION_NAMESPACE::Mesh::FilePath | ( | ) | const |
The path to the file where this element was loaded from.
Errors sdf::SDF_VERSION_NAMESPACE::Mesh::Load | ( | ElementPtr | _sdf | ) |
Errors sdf::SDF_VERSION_NAMESPACE::Mesh::Load | ( | sdf::ElementPtr | _sdf, |
const ParserConfig & | _config | ||
) |
MeshOptimization sdf::SDF_VERSION_NAMESPACE::Mesh::Optimization | ( | ) | const |
Get the mesh's optimization method.
std::string sdf::SDF_VERSION_NAMESPACE::Mesh::OptimizationStr | ( | ) | const |
Get the mesh's optimization method.
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::Mesh::Scale | ( | ) | const |
Get the mesh's scale factor.
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetCenterSubmesh | ( | const bool | _center | ) |
Set whether the submesh should be centered.
See CenterSubmesh() for more information.
[in] | _center | True to center the submesh. |
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetConvexDecomposition | ( | const sdf::ConvexDecomposition & | _convexDecomposition | ) |
Set the associated ConvexDecomposition object.
[in] | _convexDecomposition | The ConvexDecomposition object. |
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetFilePath | ( | const std::string & | _filePath | ) |
Set the path to the file where this element was loaded from.
\paramp[in] _filePath Full path to the file on disk.
bool sdf::SDF_VERSION_NAMESPACE::Mesh::SetOptimization | ( | const std::string & | _optimizationStr | ) |
Set the mesh optimization method.
[in] | _optimization | The mesh optimization method. |
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetOptimization | ( | MeshOptimization | _optimization | ) |
Set the mesh optimization method.
[in] | _optimization | The mesh optimization method. |
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetScale | ( | const gz::math::Vector3d & | _scale | ) |
Set the mesh's scale factor.
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetSubmesh | ( | const std::string & | _submesh | ) |
Set the mesh's submesh.
See Submesh() for more information.
[in] | _submesh | Name of the submesh. The name should match a submesh within the mesh at the specified URI. |
void sdf::SDF_VERSION_NAMESPACE::Mesh::SetUri | ( | const std::string & | _uri | ) |
Set the mesh's URI.
[in] | _uri | The URI of the mesh. |
std::string sdf::SDF_VERSION_NAMESPACE::Mesh::Submesh | ( | ) | const |
A submesh, contained with the mesh at the specified URI, may optionally be specified.
If specified, this submesh should be used instead of the entire mesh.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Mesh::ToElement | ( | ) | const |
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Mesh::ToElement | ( | sdf::Errors & | _errors | ) | const |
std::string sdf::SDF_VERSION_NAMESPACE::Mesh::Uri | ( | ) | const |
Get the mesh's URI.