H3D API
2.4.1
|
The Convert namespace contains help functions for parsing a string and converting it to a X3D field value. More...
Classes | |
class | X3DFieldConversionError |
An exception for errors when string to convert to a field value is invalid for the field type. More... | |
class | UnimplementedConversionType |
An exception for errors when the conversion from a string to the type that we try convert to is not implemented. More... | |
Functions | |
const char * | skipWhitespaces (const char *s) |
Skip whitespaces at the beginning of a string. More... | |
const char * | skipWhitespacesAndCommas (const char *s) |
Skip whitespaces and commas at the beginning of a string. More... | |
string | getQuoteEnclosedStringValue (const char *s, const char *&rest) |
Works the same way as getValue<string>() but with the exception that the string given is within double quotes. More... | |
template<class Type > | |
Type | getValue (const char *s, const char *&rest) |
Function that reads characters from a char * and converts them to a given type. More... | |
template<> | |
string | getValue< string > (const char *s, const char *&rest) |
Template specialization to handle the type 'string'. More... | |
template<> | |
bool | getValue< bool > (const char *s, const char *&rest) |
Template specialization to handle the type 'bool'. More... | |
template<> | |
double | getValue< double > (const char *s, const char *&rest) |
Template specialization to handle the type 'double'. More... | |
template<> | |
float | getValue< float > (const char *s, const char *&rest) |
Template specialization to handle the type 'float'. More... | |
template<> | |
int | getValue< int > (const char *s, const char *&rest) |
Template specialization to handle the type 'int'. More... | |
template<> | |
RGB | getValue< RGB > (const char *s, const char *&rest) |
Template specialization to handle the type 'RGB'. More... | |
template<> | |
RGBA | getValue< RGBA > (const char *s, const char *&rest) |
Template specialization to handle the type 'RGBA'. More... | |
template<> | |
Rotation | getValue< Rotation > (const char *s, const char *&rest) |
Template specialization to handle the type 'Rotation'. More... | |
template<> | |
Quaternion | getValue< Quaternion > (const char *s, const char *&rest) |
Template specialization to handle the type 'Quaternion'. More... | |
template<> | |
Matrix4f | getValue< Matrix4f > (const char *s, const char *&rest) |
Template specialization to handle the type 'Matrix4f'. More... | |
template<> | |
Matrix3f | getValue< Matrix3f > (const char *s, const char *&rest) |
Template specialization to handle the type 'Matrix3f'. More... | |
template<> | |
Matrix4d | getValue< Matrix4d > (const char *s, const char *&rest) |
Template specialization to handle the type 'Matrix4d'. More... | |
template<> | |
Matrix3d | getValue< Matrix3d > (const char *s, const char *&rest) |
Template specialization to handle the type 'Matrix3f'. More... | |
template<> | |
Vec4f | getValue< Vec4f > (const char *s, const char *&rest) |
Template specialization to handle the type 'Vec4f'. More... | |
template<> | |
Vec4d | getValue< Vec4d > (const char *s, const char *&rest) |
Template specialization to handle the type 'Vec4d'. More... | |
template<> | |
Vec3f | getValue< Vec3f > (const char *s, const char *&rest) |
Template specialization to handle the type 'Vec3f'. More... | |
template<> | |
Vec3d | getValue< Vec3d > (const char *s, const char *&rest) |
Template specialization to handle the type 'Vec3d'. More... | |
template<> | |
Vec2f | getValue< Vec2f > (const char *s, const char *&rest) |
Template specialization to handle the type 'Vec2f'. More... | |
template<> | |
Vec2d | getValue< Vec2d > (const char *s, const char *&rest) |
Template specialization to handle the type 'Vec2d'. More... | |
double | atof (const char *s) |
The same as standard atof function with the difference that the decimal point is always . More... | |
The Convert namespace contains help functions for parsing a string and converting it to a X3D field value.
|
inline |
The same as standard atof function with the difference that the decimal point is always .
regardless of locale settings.
On success, the function returns the converted floating point number as a double value. If no valid conversion could be performed, the function returns zero (0.0).
References getValue< double >().
|
inline |
Works the same way as getValue<string>() but with the exception that the string given is within double quotes.
The resulting value will be the string inside the quotes.
Referenced by H3D::X3D::X3DStringToVector< vector< string > >().
|
inline |
Function that reads characters from a char * and converts them to a given type.
It will use as many characters from the char * as possible to build the value. Used by H3D::X3D::X3DStringToVector and H3D::X3D::X3DStringToValue to read values. The default implementation just returns an exception. Each type that is supported must have a template specialization handling it.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
Referenced by H3D::TypedRefCountField< RefCountedType, BaseRefCountType >::getValue(), H3D::H3DFakeHapticsDevice::GetValueSafeField< BaseField >::getValue(), H3D::ThreadSafeSField< BaseField >::getValue(), H3D::ThreadSafeRefSField< BaseField >::getValue(), H3D::ThreadSafeMField< BaseField >::getValue(), H3D::MFBool::getValueAsString(), H3D::MFString::getValueAsString(), H3D::X3DTexture2DNode::SFImage::getValueAsString(), H3D::Collision::movingSphereIntersect(), H3D::Extrusion::render(), H3D::Contour2D::renderTrimmedCurve(), H3D::MagneticGeometryEffect::traverseSG(), H3D::SpringEffect::traverseSG(), H3D::ColorInterpolator::SFValue::update(), H3D::CoordinateInterpolator::MFValue::update(), H3D::DynamicTransform::SFMatrix4f::update(), H3D::GeometryGroup::IsTouched::update(), H3D::H3DHapticsDevice::TrackerPosition::update(), H3D::H3DHapticsDevice::TrackerOrientation::update(), H3D::H3DHapticsDevice::TrackerAngularVelocity::update(), H3D::H3DWindowNode::WindowSizeChanged::update(), H3D::HumanHand::SFBound::update(), H3D::NurbsCurve::SFBound::update(), H3D::SpaceWareSensor::ScaleRotation::update(), H3D::SpaceWareSensor::ScaleTranslation::update(), H3D::SpaceWareSensor::AccumulateRotation::update(), H3D::SpaceWareSensor::AccumulateTranslation::update(), H3D::Text::SFBound::update(), H3D::TimeSensor::TimeHandler::update(), H3D::X3DTimeDependentNode::TimeHandler::update(), H3D::X3DViewpointNode::SFSumVec3f::update(), H3D::X3DViewpointNode::SFSumRotation::update(), H3D::X3D::X3DStringToVector(), and H3D::X3DTimeDependentNode::X3DTimeDependentNode().
|
inline |
Template specialization to handle the type 'bool'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References skipWhitespaces().
|
inline |
Template specialization to handle the type 'double'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References H3DPow().
Referenced by atof(), and getValue< float >().
|
inline |
Template specialization to handle the type 'float'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References getValue< double >().
|
inline |
Template specialization to handle the type 'int'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
Referenced by H3D::X3D::X3DStringTo2DImage(), and H3D::X3D::X3DStringTo3DImage().
|
inline |
Template specialization to handle the type 'Matrix3f'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Matrix3f'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Matrix4d'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Matrix4f'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Quaternion'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'RGB'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'RGBA'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Rotation'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References Rotation().
|
inline |
Template specialization to handle the type 'string'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
Referenced by H3D::X3D::X3DStringToVector< vector< string > >().
|
inline |
Template specialization to handle the type 'Vec2d'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References Vec2d().
|
inline |
Template specialization to handle the type 'Vec2f'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References Vec2f().
|
inline |
Template specialization to handle the type 'Vec3d'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References Vec3d().
|
inline |
Template specialization to handle the type 'Vec3f'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Vec4d'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
|
inline |
Template specialization to handle the type 'Vec4f'.
s | The string to convert. |
rest | Return value pointing at the first character in the string not used in the conversion. |
References Vec4f().
|
inline |
Skip whitespaces at the beginning of a string.
s | The string to skip whitespace in |
Referenced by getValue< bool >(), H3D::X3D::X3DStringTo2DImage(), H3D::X3D::X3DStringTo3DImage(), H3D::X3D::X3DStringToValue(), H3D::X3D::X3DStringToVector(), and H3D::X3D::X3DStringToVector< vector< string > >().
|
inline |
Skip whitespaces and commas at the beginning of a string.
s | The string to skip whitespace in |
Referenced by H3D::X3D::X3DStringToVector(), and H3D::X3D::X3DStringToVector< vector< string > >().