MCPcopy Create free account
hub / github.com/PDAL/PDAL / parse

Method parse

io/private/esri/Obb.cpp:103–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void Obb::parse(NL::json spec)
104{
105 verifyArray(spec, "center", 3);
106 verifyArray(spec, "halfSize", 3);
107 verifyArray(spec, "quaternion", 4);
108
109 double x = spec["center"][0].get<double>();
110 double y = spec["center"][1].get<double>();
111 double z = spec["center"][2].get<double>();
112 m_p = { x, y, z };
113
114 m_hx = spec["halfSize"][0].get<double>();
115 m_hy = spec["halfSize"][1].get<double>();
116 m_hz = spec["halfSize"][2].get<double>();
117
118 double qx = spec["quaternion"][0].get<double>();
119 double qy = spec["quaternion"][1].get<double>();
120 double qz = spec["quaternion"][2].get<double>();
121 double qw = spec["quaternion"][3].get<double>();
122
123 m_quat = Eigen::Quaterniond(qw, qx, qy, qz);
124 m_quat.normalize();
125
126 spec.erase("center");
127 spec.erase("halfSize");
128 spec.erase("quaternion");
129 if (spec.size())
130 {
131 throw EsriError("Invalid OBB: found invalid key '" +
132 spec.begin().key() + "'.");
133 }
134 m_valid = true;
135}
136
137void Obb::transform(const SrsTransform& xform)
138{

Callers 1

fromStringFunction · 0.45

Calls 5

EsriErrorClass · 0.85
eraseMethod · 0.45
sizeMethod · 0.45
keyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected