| 46 | |
| 47 | template <typename COORDTYPE> |
| 48 | Data3DPointsData_t<COORDTYPE>::Data3DPointsData_t( Data3D &data3D ) : _selfAllocated( true ) |
| 49 | { |
| 50 | static_assert( std::is_floating_point<COORDTYPE>::value, "Floating point type required." ); |
| 51 | |
| 52 | _validateData3D( data3D ); |
| 53 | |
| 54 | constexpr bool cIsFloat = std::is_same<COORDTYPE, float>::value; |
| 55 | |
| 56 | // We need to adjust min/max for floats. |
| 57 | if ( cIsFloat ) |
| 58 | { |
| 59 | data3D.pointFields.pointRangeMinimum = FLOAT_MIN; |
| 60 | data3D.pointFields.pointRangeMaximum = FLOAT_MAX; |
| 61 | data3D.pointFields.angleMinimum = FLOAT_MIN; |
| 62 | data3D.pointFields.angleMaximum = FLOAT_MAX; |
| 63 | data3D.pointFields.timeMinimum = FLOAT_MIN; |
| 64 | data3D.pointFields.timeMaximum = FLOAT_MAX; |
| 65 | } |
| 66 | |
| 67 | // IF point range node type is not ScaledInteger |
| 68 | // THEN make sure the proper floating point type is set |
| 69 | if ( data3D.pointFields.pointRangeNodeType != NumericalNodeType::ScaledInteger ) |
| 70 | { |
| 71 | data3D.pointFields.pointRangeNodeType = |
| 72 | ( cIsFloat ? NumericalNodeType::Float : NumericalNodeType::Double ); |
| 73 | } |
| 74 | |
| 75 | // IF angle node type is not ScaledInteger |
| 76 | // THEN make sure the proper floating point type is set |
| 77 | if ( data3D.pointFields.angleNodeType != NumericalNodeType::ScaledInteger ) |
| 78 | { |
| 79 | data3D.pointFields.angleNodeType = |
| 80 | ( cIsFloat ? NumericalNodeType::Float : NumericalNodeType::Double ); |
| 81 | } |
| 82 | |
| 83 | const auto cPointCount = data3D.pointCount; |
| 84 | |
| 85 | if ( data3D.pointFields.cartesianXField ) |
| 86 | { |
| 87 | cartesianX = new COORDTYPE[cPointCount]; |
| 88 | } |
| 89 | |
| 90 | if ( data3D.pointFields.cartesianYField ) |
| 91 | { |
| 92 | cartesianY = new COORDTYPE[cPointCount]; |
| 93 | } |
| 94 | |
| 95 | if ( data3D.pointFields.cartesianZField ) |
| 96 | { |
| 97 | cartesianZ = new COORDTYPE[cPointCount]; |
| 98 | } |
| 99 | |
| 100 | if ( data3D.pointFields.cartesianInvalidStateField ) |
| 101 | { |
| 102 | cartesianInvalidState = new int8_t[cPointCount]; |
| 103 | } |
| 104 | |
| 105 | if ( data3D.pointFields.intensityField ) |
nothing calls this directly
no test coverage detected