| 173 | } |
| 174 | |
| 175 | void E57Reader::initialize() |
| 176 | { |
| 177 | try |
| 178 | { |
| 179 | arbiter::Arbiter arb; |
| 180 | arbiter::LocalHandle fileHandle = arb.getLocalHandle(m_filename); |
| 181 | m_imf.reset(new ImageFile(fileHandle.localPath(), "r")); |
| 182 | StructureNode root = m_imf->root(); |
| 183 | |
| 184 | if (!root.isDefined("/data3D")) |
| 185 | { |
| 186 | throwError("File doesn't contain 3D data"); |
| 187 | } |
| 188 | |
| 189 | const e57::ustring normalsExtension( |
| 190 | "http://www.libe57.org/E57_NOR_surface_normals.txt"); |
| 191 | e57::ustring _normalsExtension; |
| 192 | |
| 193 | // the extension may already be registered |
| 194 | if (!m_imf->extensionsLookupPrefix("nor", _normalsExtension)) |
| 195 | m_imf->extensionsAdd("nor", normalsExtension); |
| 196 | |
| 197 | m_data3D.reset(new VectorNode(root.get("/data3D"))); |
| 198 | |
| 199 | } |
| 200 | catch (E57Exception& e) |
| 201 | { |
| 202 | throwError(std::to_string(e.errorCode()) + " : " + e.context()); |
| 203 | } |
| 204 | catch (std::exception& e) |
| 205 | { |
| 206 | throwError(e.what()); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | void E57Reader::ready(PointTableRef& ref) |
| 211 | { |
nothing calls this directly
no test coverage detected