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

Method addDimensions

plugins/e57/io/E57Reader.cpp:106–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void E57Reader::addDimensions(PointLayoutPtr layout)
107{
108 auto supportedFields = e57plugin::supportedE57Types();
109 auto numScans = m_data3D->childCount();
110 std::unique_ptr<Scan> tempScan;
111
112 for (auto& dimension : supportedFields)
113 {
114 // Check if any of the scan have this dimension.
115 // If any of the scan have this dimension, we cannot ignore it.
116 for (auto p = 0; p < numScans; ++p)
117 {
118 tempScan.reset(new Scan((StructureNode)m_data3D->get(p)));
119 auto proto = tempScan->getPointPrototype();
120 if (proto.isDefined(dimension))
121 {
122 layout->registerDim(e57plugin::e57ToPdal(dimension));
123 break;
124 }
125 }
126 }
127
128 if (layout->hasDim(Dimension::Id::SphericalRange) &&
129 layout->hasDim(Dimension::Id::SphericalAzimuth) &&
130 layout->hasDim(Dimension::Id::SphericalElevation))
131 {
132 layout->registerDim(Dimension::Id::X);
133 layout->registerDim(Dimension::Id::Y);
134 layout->registerDim(Dimension::Id::Z);
135 }
136
137 m_extraDims.reset(new e57plugin::ExtraDims());
138 m_extraDims->parse(m_extraDimsSpec);
139 auto i = m_extraDims->begin();
140 while (i != m_extraDims->end())
141 {
142 i->m_id = Dimension::Id::Unknown;
143 // Remove extra dims which are already in layout.
144 if (layout->hasDim(e57plugin::e57ToPdal(i->m_name)))
145 {
146 i = m_extraDims->deleteDim(i);
147 continue;
148 }
149
150 // Check if any of the scan have this dimension.
151 // If any of the scan have this dimension, we cannot ignore it.
152 for (auto p = 0; p < numScans; ++p)
153 {
154 tempScan.reset(new Scan((StructureNode)m_data3D->get(p)));
155 auto proto = tempScan->getPointPrototype();
156 if (proto.isDefined(i->m_name))
157 {
158 i->m_id = layout->registerOrAssignDim(i->m_name, i->m_type);
159 break;
160 }
161 }
162
163 if (i->m_id == Dimension::Id::Unknown)

Callers

nothing calls this directly

Calls 15

supportedE57TypesFunction · 0.85
e57ToPdalFunction · 0.85
getPointPrototypeMethod · 0.80
registerDimMethod · 0.80
hasDimMethod · 0.80
deleteDimMethod · 0.80
registerOrAssignDimMethod · 0.80
logFunction · 0.50
childCountMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
isDefinedMethod · 0.45

Tested by

no test coverage detected