MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / parseDoubles

Function parseDoubles

pj_scene3D/widgets/src/urdf_parser.cpp:27–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25// Returns false if fewer than N tokens parse.
26template <std::size_t N>
27bool parseDoubles(const QString& text, std::array<double, N>& out) {
28 const QStringList toks = text.simplified().split(' ', Qt::SkipEmptyParts);
29 if (static_cast<std::size_t>(toks.size()) < N) {
30 return false;
31 }
32 for (std::size_t i = 0; i < N; ++i) {
33 bool ok = false;
34 out[i] = toks[static_cast<int>(i)].toDouble(&ok);
35 if (!ok) {
36 return false;
37 }
38 }
39 return true;
40}
41
42double attrDouble(const QDomElement& el, const QString& name, double fallback) {
43 if (!el.hasAttribute(name)) {

Callers 3

parseOriginIntoFunction · 0.85
parseGeometryFunction · 0.85
readColorRgbaFunction · 0.85

Calls 2

toDoubleMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected