Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::PrintConfig Class Reference

This class contains configuration options for printing elements. More...

#include <PrintConfig.hh>

Public Member Functions

 PrintConfig ()
 Default constructor. All options are set to false by default. More...
 
bool operator== (const PrintConfig &_config) const
 Return true if both PrintConfig objects contain the same values. More...
 
int OutPrecision () const
 Retrieve the output stream's set precision value. More...
 
bool PreserveIncludes () const
 Check if tags are to be preserved or expanded. More...
 
bool RotationInDegrees () const
 Returns whether or not pose rotations should be printed in degrees. More...
 
std::optional< unsigned int > RotationSnapToDegrees () const
 Returns the current degree value that pose rotations will snap to when printed. More...
 
std::optional< double > RotationSnapTolerance () const
 Returns the tolerance for snapping degree values when printed. More...
 
void SetOutPrecision (int _precision)
 Set precision of output stream for float / double types. More...
 
void SetPreserveIncludes (bool _preserve)
 Set print config to preserve tags. More...
 
void SetRotationInDegrees (bool _value)
 Sets the option for printing pose rotations in degrees if true, otherwise they will be printed as radians by default. More...
 
bool SetRotationSnapToDegrees (unsigned int _interval, double _tolerance)
 Sets the option for printing pose rotation in degrees as well as snapping the rotation to the desired interval, with the provided tolerance. More...
 
bool SetRotationSnapToDegrees (unsigned int _interval, double _tolerance, sdf::Errors &_errors)
 Sets the option for printing pose rotation in degrees as well as snapping the rotation to the desired interval, with the provided tolerance. More...
 

Detailed Description

This class contains configuration options for printing elements.

Constructor & Destructor Documentation

◆ PrintConfig()

sdf::SDF_VERSION_NAMESPACE::PrintConfig::PrintConfig ( )

Default constructor. All options are set to false by default.

Member Function Documentation

◆ operator==()

bool sdf::SDF_VERSION_NAMESPACE::PrintConfig::operator== ( const PrintConfig _config) const

Return true if both PrintConfig objects contain the same values.

Parameters
[in]_configPrintConfig to compare.
Returns
True if 'this' == _config.

◆ OutPrecision()

int sdf::SDF_VERSION_NAMESPACE::PrintConfig::OutPrecision ( ) const

Retrieve the output stream's set precision value.

Returns
The output stream's precision.

◆ PreserveIncludes()

bool sdf::SDF_VERSION_NAMESPACE::PrintConfig::PreserveIncludes ( ) const

Check if tags are to be preserved or expanded.

Returns
True if tags are preserved. False if they are to be expanded.

◆ RotationInDegrees()

bool sdf::SDF_VERSION_NAMESPACE::PrintConfig::RotationInDegrees ( ) const

Returns whether or not pose rotations should be printed in degrees.

Returns
True if pose rotations are printed in degrees, false otherwise.

◆ RotationSnapToDegrees()

std::optional<unsigned int> sdf::SDF_VERSION_NAMESPACE::PrintConfig::RotationSnapToDegrees ( ) const

Returns the current degree value that pose rotations will snap to when printed.

Returns
The assigned degrees interval value to snap to. If it has not been assigned, a nullopt will be returned.

◆ RotationSnapTolerance()

std::optional<double> sdf::SDF_VERSION_NAMESPACE::PrintConfig::RotationSnapTolerance ( ) const

Returns the tolerance for snapping degree values when printed.

Returns
The assigned tolerance value which allows snapping to happen. If it has not been assigned, a nullopt will be returned.

◆ SetOutPrecision()

void sdf::SDF_VERSION_NAMESPACE::PrintConfig::SetOutPrecision ( int  _precision)

Set precision of output stream for float / double types.

By default, the output stream uses maximum precision.

Parameters
[in]_precisionThe new precision value. To set back to maximum precision, use std::numeric_limits<int>::max().

◆ SetPreserveIncludes()

void sdf::SDF_VERSION_NAMESPACE::PrintConfig::SetPreserveIncludes ( bool  _preserve)

Set print config to preserve tags.

Parameters
[in]_preserveTrue to preserve tags. False to expand included model.

◆ SetRotationInDegrees()

void sdf::SDF_VERSION_NAMESPACE::PrintConfig::SetRotationInDegrees ( bool  _value)

Sets the option for printing pose rotations in degrees if true, otherwise they will be printed as radians by default.

Parameters
[in]_valueWhether to print pose rotations in degrees.

◆ SetRotationSnapToDegrees() [1/2]

bool sdf::SDF_VERSION_NAMESPACE::PrintConfig::SetRotationSnapToDegrees ( unsigned int  _interval,
double  _tolerance 
)

Sets the option for printing pose rotation in degrees as well as snapping the rotation to the desired interval, with the provided tolerance.

Parameters
[in]_intervalDegrees interval to snap to, this value must be larger than 0, and less than or equal to 360.
[in]_toleranceTolerance which snapping occurs, this value must be larger than 0, less than 360, and less than the provided interval.
Returns
True, unless any of the provided values are not valid.

◆ SetRotationSnapToDegrees() [2/2]

bool sdf::SDF_VERSION_NAMESPACE::PrintConfig::SetRotationSnapToDegrees ( unsigned int  _interval,
double  _tolerance,
sdf::Errors _errors 
)

Sets the option for printing pose rotation in degrees as well as snapping the rotation to the desired interval, with the provided tolerance.

Parameters
[in]_intervalDegrees interval to snap to, this value must be larger than 0, and less than or equal to 360.
[in]_toleranceTolerance which snapping occurs, this value must be larger than 0, less than 360, and less than the provided interval.
[out]_errorsVector of Errors.
Returns
True, unless any of the provided values are not valid.

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