|
33 | 33 | #include "Common.h"
|
34 | 34 | #include "E57Version.h"
|
35 | 35 |
|
| 36 | +namespace |
| 37 | +{ |
| 38 | + /*! |
| 39 | + @brief Convert e57::NumericalNodeType into human-readable string. |
| 40 | +
|
| 41 | + @param inNodeType node type to convert |
| 42 | +
|
| 43 | + @return human-readable representation of node type or "Unknown: <node type int>". |
| 44 | + */ |
| 45 | + std::string _numericalNodeTypeStr( e57::NumericalNodeType inNodeType ) |
| 46 | + { |
| 47 | + switch ( inNodeType ) |
| 48 | + { |
| 49 | + case e57::NumericalNodeType::Integer: |
| 50 | + { |
| 51 | + return "Integer"; |
| 52 | + } |
| 53 | + |
| 54 | + case e57::NumericalNodeType::ScaledInteger: |
| 55 | + { |
| 56 | + return "ScaledInteger"; |
| 57 | + } |
| 58 | + |
| 59 | + case e57::NumericalNodeType::Float: |
| 60 | + { |
| 61 | + return "Float"; |
| 62 | + } |
| 63 | + |
| 64 | + case e57::NumericalNodeType::Double: |
| 65 | + { |
| 66 | + return "Double"; |
| 67 | + } |
| 68 | + |
| 69 | + default: |
| 70 | + return std::string( "Unknown: " ) |
| 71 | + .append( std::to_string( static_cast<int>( inNodeType ) ) ); |
| 72 | + } |
| 73 | + } |
| 74 | +} |
| 75 | + |
36 | 76 | namespace e57
|
37 | 77 | {
|
38 | 78 | /*!
|
@@ -829,6 +869,11 @@ namespace e57
|
829 | 869 | return FloatNode( imf_, 0.0, PrecisionDouble, pointRangeMin, pointRangeMax );
|
830 | 870 | }
|
831 | 871 | }
|
| 872 | + |
| 873 | + throw E57_EXCEPTION2( |
| 874 | + ErrorInvalidNodeType, |
| 875 | + std::string( "Invalid pointRangeNodeType type: " ) |
| 876 | + .append( _numericalNodeTypeStr( data3DHeader.pointFields.pointRangeNodeType ) ) ); |
832 | 877 | };
|
833 | 878 |
|
834 | 879 | if ( data3DHeader.pointFields.cartesianXField )
|
@@ -885,6 +930,11 @@ namespace e57
|
885 | 930 | return FloatNode( imf_, 0.0, PrecisionDouble, angleMin, angleMax );
|
886 | 931 | }
|
887 | 932 | }
|
| 933 | + |
| 934 | + throw E57_EXCEPTION2( |
| 935 | + ErrorInvalidNodeType, |
| 936 | + std::string( "Invalid angleNodeType type: " ) |
| 937 | + .append( _numericalNodeTypeStr( data3DHeader.pointFields.angleNodeType ) ) ); |
888 | 938 | };
|
889 | 939 |
|
890 | 940 | if ( data3DHeader.pointFields.sphericalAzimuthField )
|
|
0 commit comments