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

Method prepared

io/PlyWriter.cpp:75–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75void PlyWriter::prepared(PointTableRef table)
76{
77 FlexWriter::validateFilename(table);
78
79 PointLayoutPtr layout = table.layout();
80
81 if (m_precisionArg->set() && m_format != Format::Ascii)
82 throwError("Option 'precision' can only be set of the 'storage_mode' "
83 "is ascii.");
84
85 m_dims.clear();
86 if (m_dimNames.size())
87 {
88 for (auto& dimspec : m_dimNames)
89 {
90 Dimension::Type type;
91 StringList parts = Utils::split2(dimspec, '=');
92 std::string name = parts[0];
93 Utils::trim(name);
94 dimspec = Utils::tolower(name);
95 auto id = layout->findDim(name);
96 if (id == Dimension::Id::Unknown)
97 throwError("Unknown dimension '" + name + "' in provided "
98 "dimension list.");
99 if (parts.size() == 1)
100 type = layout->dimType(id);
101 else if (parts.size() == 2)
102 {
103 Utils::trim(parts[1]);
104 type = Dimension::type(parts[1]);
105 }
106 else
107 throwError("Invalid format for dimension specification for "
108 "dimension '" + name + "'. " "Must be 'name[=type]'.");
109 m_dims.emplace_back(id, type);
110 }
111 }
112 else
113 {
114 m_dims = layout->dimTypes();
115 for (const auto& dim : m_dims)
116 m_dimNames.push_back(Utils::tolower(layout->dimName(dim.m_id)));
117 }
118}
119
120
121std::string PlyWriter::getType(Dimension::Type type) const

Callers

nothing calls this directly

Calls 11

validateFilenameFunction · 0.85
trimFunction · 0.85
tolowerFunction · 0.85
dimNameMethod · 0.80
typeFunction · 0.50
setMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45
findDimMethod · 0.45
dimTypeMethod · 0.45
dimTypesMethod · 0.45

Tested by

no test coverage detected