OSVR-Core
|
Container for easy manipulation of nested transforms. More...
#include <GeneralizedTransform.h>
Public Member Functions | |
OSVR_COMMON_EXPORT | GeneralizedTransform () |
Empty transformation. | |
OSVR_COMMON_EXPORT | GeneralizedTransform (Json::Value const &transform) |
Construct from a normalized alias/transform as Json. More... | |
OSVR_COMMON_EXPORT void | nest (Json::Value const &transform) |
Process the given transform as "inner" to any existing transform. More... | |
OSVR_COMMON_EXPORT void | wrap (Json::Value const &transform) |
Wrap a single new layer of transform around the existing ones, if any. More... | |
OSVR_COMMON_EXPORT bool | empty () const |
Is this an empty transform? | |
OSVR_COMMON_EXPORT Json::Value | get () const |
Get a "reconstituted" version of the transformation. | |
OSVR_COMMON_EXPORT Json::Value | get (std::string const &leaf) const |
Get the reconstituted transformation with the specified leaf as the final child. More... | |
void | resize (const_iterator newEnd) |
A shrinking resize. | |
Container for easy manipulation of nested transforms.
Stores the levels of the transform in outer-inner order, with the "child" key/value removed and only re-created in get().
osvr::common::GeneralizedTransform::GeneralizedTransform | ( | Json::Value const & | transform | ) |
Construct from a normalized alias/transform as Json.
Must be one or more levels of nested objects (under the "child" key) with other arbitrary data in the object describing the transformation taking place at that level.
Json::Value osvr::common::GeneralizedTransform::get | ( | std::string const & | leaf | ) | const |
Get the reconstituted transformation with the specified leaf as the final child.
If leaf is empty, behaves like get()
void osvr::common::GeneralizedTransform::nest | ( | Json::Value const & | transform | ) |
Process the given transform as "inner" to any existing transform.
We only nest objects, sorry.
void osvr::common::GeneralizedTransform::wrap | ( | Json::Value const & | transform | ) |
Wrap a single new layer of transform around the existing ones, if any.