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

Method getType

io/PlyWriter.cpp:121–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120
121std::string PlyWriter::getType(Dimension::Type type) const
122{
123 static std::map<Dimension::Type, std::string> sizedTypes =
124 {
125 { Dimension::Type::Signed8, "int8" },
126 { Dimension::Type::Unsigned8, "uint8" },
127 { Dimension::Type::Signed16, "int16" },
128 { Dimension::Type::Unsigned16, "uint16" },
129 { Dimension::Type::Signed32, "int32" },
130 { Dimension::Type::Unsigned32, "uint32" },
131 { Dimension::Type::Float, "float32" },
132 { Dimension::Type::Double, "float64" }
133 };
134 static std::map<Dimension::Type, std::string> types =
135 {
136 { Dimension::Type::Signed8, "char" },
137 { Dimension::Type::Unsigned8, "uchar" },
138 { Dimension::Type::Signed16, "short" },
139 { Dimension::Type::Unsigned16, "ushort" },
140 { Dimension::Type::Signed32, "int" },
141 { Dimension::Type::Unsigned32, "uint" },
142 { Dimension::Type::Float, "float" },
143 { Dimension::Type::Double, "double" }
144 };
145
146 try
147 {
148 return m_sizedTypes ? sizedTypes.at(type) : types.at(type);
149 }
150 catch (std::out_of_range&)
151 {
152 throwError("Can't write dimension of type '" +
153 Dimension::interpretationName(type) + "'.");
154 }
155 return "";
156}
157
158
159void PlyWriter::writeHeader(PointLayoutPtr layout, point_count_t pointCount, point_count_t faceCount) const

Callers

nothing calls this directly

Calls 2

interpretationNameFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected