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

Method prepared

io/GltfWriter.cpp:91–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91void GltfWriter::prepared(PointTableRef table)
92{
93 const bool hasNormals = table.layout()->hasDim(Dimension::Id::NormalX) &&
94 table.layout()->hasDim(Dimension::Id::NormalY) &&
95 table.layout()->hasDim(Dimension::Id::NormalZ);
96
97 if (!hasNormals && m_writeNormals)
98 {
99 log()->get(LogLevel::Warning) << getName() << ": Option 'normals' is set to "
100 "true, but one or more of the normal dimensions are missing. Not writing vertex "
101 "normals." << std::endl;
102 m_writeNormals = false;
103 }
104
105 // Only color vertices if color dimensions are present and the option is
106 // enabled
107 const bool hasColors = table.layout()->hasDim(Dimension::Id::Red) &&
108 table.layout()->hasDim(Dimension::Id::Green) &&
109 table.layout()->hasDim(Dimension::Id::Blue);
110
111 if (!hasColors && m_colorVertices)
112 {
113 log()->get(LogLevel::Warning) << getName() << ": Option 'colors' is set to "
114 "true, but one or more color dimensions are missing. Not writing vertex "
115 "colors." << std::endl;
116 m_colorVertices = false;
117 }
118}
119
120
121void GltfWriter::ready(PointTableRef table)

Callers

nothing calls this directly

Calls 4

hasDimMethod · 0.80
getNameFunction · 0.70
logFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected