| 162 | } |
| 163 | |
| 164 | void RadiusAssignFilter::filter(PointView& view) |
| 165 | { |
| 166 | PointRef pointTemp(view, 0); |
| 167 | |
| 168 | // Create reference domain view |
| 169 | refView = view.makeNew(); |
| 170 | if (m_referenceDomain.empty()) |
| 171 | for (PointId id = 0; id < view.size(); ++id) |
| 172 | refView->appendPoint(view, id); |
| 173 | else |
| 174 | { |
| 175 | for (PointId id = 0; id < view.size(); ++id) |
| 176 | { |
| 177 | for (DimRange& r : m_referenceDomain) |
| 178 | { |
| 179 | pointTemp.setPointId(id); |
| 180 | if (r.valuePasses(pointTemp.getFieldAs<double>(r.m_id))) |
| 181 | { |
| 182 | refView->appendPoint(view, id); |
| 183 | break; |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | // Process all points (mark them if they need to be updated) |
| 190 | for (PointId id = 0; id < view.size(); ++id) |
| 191 | { |
| 192 | pointTemp.setPointId(id); |
| 193 | doOne(pointTemp); |
| 194 | } |
| 195 | |
| 196 | |
| 197 | for (auto id: m_ptsToUpdate) |
| 198 | { |
| 199 | pointTemp.setPointId(id); |
| 200 | for (expr::AssignStatement& expr : m_updateExpr) |
| 201 | if (expr.conditionalExpr().eval(pointTemp)) |
| 202 | pointTemp.setField(expr.identExpr().eval(), expr.valueExpr().eval(pointTemp)); |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | |
| 207 | } // namespace pdal |
nothing calls this directly
no test coverage detected