37
37
38
38
namespace e57
39
39
{
40
- // ! Indicates to use FloatNode instead of ScaledIntegerNode in fields that can use both.
41
- constexpr double E57_NOT_SCALED_USE_FLOAT = 0.0 ;
42
-
43
- // ! Indicates to use ScaledIntegerNode instead of FloatNode in fields that can use both.
44
- constexpr double E57_NOT_SCALED_USE_INTEGER = -1.0 ;
45
-
46
40
// ! @cond documentNonPublic The following isn't part of the API, and isn't documented.
47
41
class ReaderImpl ;
48
42
class WriterImpl ;
@@ -305,6 +299,15 @@ namespace e57
305
299
GroupingByLine groupingByLine; // !< Grouping information by row or column index
306
300
};
307
301
302
+ // ! @brief Used to set the type of node in some PointStandardizedFieldsAvailable fields.
303
+ enum class NumericalNodeType
304
+ {
305
+ Integer = 0 , // /< Use IntegerNode
306
+ ScaledInteger, // /< Use ScaledIntegerNode
307
+ Float, // /< Use FloatNode with floats
308
+ Double, // /< Use FloatNode with doubles
309
+ };
310
+
308
311
// ! @brief Used to interrogate if standardized fields are available
309
312
struct E57_DLL PointStandardizedFieldsAvailable
310
313
{
@@ -326,14 +329,15 @@ namespace e57
326
329
// ! E57_FLOAT_MAX or E57_DOUBLE_MAX. If using a ScaledIntegerNode then this needs to be a maximum range value.
327
330
double pointRangeMaximum = DOUBLE_MAX;
328
331
329
- // ! @brief Controls the type of Node used for the PointRecord cartesian and range fields
330
- // ! @details The value determines which type of Node to use and whether to use floats or doubles.
331
- // ! Value | Node Type
332
- // ! -- | --
333
- // ! < 0.0 | FloatNode using doubles
334
- // ! == 0.0 (e57::E57_NOT_SCALED_USE_FLOAT) | FloatNode using floats (@em default)
335
- // ! > 0.0 | ScaledIntegerNode with the value as the scale setting
336
- double pointRangeScaledInteger = E57_NOT_SCALED_USE_FLOAT;
332
+ // / @brief Controls the type of Node used for the PointRecord cartesian and range fields
333
+ // / @details Accepts NumericalNodeType::ScaledInteger, NumericalNodeType::Float, and
334
+ // / NumericalNodeType::Double.
335
+ NumericalNodeType pointRangeNodeType = NumericalNodeType::Float;
336
+
337
+ // / @brief Sets the scale if using scaled integers for point fields
338
+ // / @details If pointRangeNodeType == NumericalNodeType::ScaledInteger, it will use this value
339
+ // / to scale the numbers and it must be > 0.0.
340
+ double pointRangeScale = 0.0 ;
337
341
338
342
// ! Indicates that the PointRecord angle fields should be configured with this minimum value E57_FLOAT_MIN or
339
343
// ! E57_DOUBLE_MIN. If using a ScaledIntegerNode then this needs to be a minimum angle value.
@@ -343,14 +347,15 @@ namespace e57
343
347
// ! E57_DOUBLE_MAX. If using a ScaledIntegerNode then this needs to be a maximum angle value.
344
348
double angleMaximum = DOUBLE_MAX;
345
349
346
- // ! @brief Controls the type of Node used for the PointRecord angle fields
347
- // ! @details The value determines which type of Node to use and whether to use floats or doubles.
348
- // ! Value | Node Type
349
- // ! -- | --
350
- // ! < 0.0 | FloatNode using doubles
351
- // ! == 0.0 (e57::E57_NOT_SCALED_USE_FLOAT) | FloatNode using floats (@em default)
352
- // ! > 0.0 | ScaledIntegerNode with the value as the scale setting
353
- double angleScaledInteger = E57_NOT_SCALED_USE_FLOAT;
350
+ // / @brief Controls the type of Node used for the PointRecord angle fields
351
+ // / @details Accepts NumericalNodeType::ScaledInteger, NumericalNodeType::Float, and
352
+ // / NumericalNodeType::Double.
353
+ NumericalNodeType angleNodeType = NumericalNodeType::Float;
354
+
355
+ // / @brief Sets the scale if using scaled integers for angle fields
356
+ // / @details If angleNodeType == NumericalNodeType::ScaledInteger, it will use this value
357
+ // / to scale the numbers and it must be > 0.0.
358
+ double angleScale = 0.0 ;
354
359
355
360
bool rowIndexField = false ; // !< Indicates that the PointRecord @a rowIndex field is active
356
361
@@ -381,36 +386,46 @@ namespace e57
381
386
// ! E57_UINT32_MAX, E57_DOUBLE_MAX or E57_DOUBLE_MAX.
382
387
double timeMaximum = DOUBLE_MAX;
383
388
384
- // ! @brief Controls the type of Node used for the PointRecord @a timeStamp fields
385
- // ! @details The value determines which type of Node to use and whether to use floats or doubles.
386
- // ! Value | Node Type
387
- // ! -- | --
388
- // ! < 0.0 | IntegerNode
389
- // ! == 0.0 (e57::E57_NOT_SCALED_USE_FLOAT) | FloatNode using floats if (::timeMaximum == E57_FLOAT_MAX)
390
- // ! == 0.0 | FloatNode using doubles if (::timeMaximum == E57_DOUBLE_MAX) (@em default)
391
- // ! > 0.0 | ScaledIntegerNode with the value as the scale setting
392
- double timeScaledInteger = E57_NOT_SCALED_USE_FLOAT;
393
-
394
- bool intensityField = false ; // !< Indicates that the PointRecord @a intensity field is active
395
- bool isIntensityInvalidField = false ; // !< Indicates that the PointRecord @a isIntensityInvalid field is active
396
-
397
- // ! @brief Controls the type of Node used for the PointRecord @a intensity fields
398
- // ! @details The value determines which type of Node to use.
399
- // ! Value | Node Type
400
- // ! -- | --
401
- // ! < 0.0 | IntegerNode
402
- // ! == 0.0 (e57::E57_NOT_SCALED_USE_FLOAT) | FloatNode using floats (@em default)
403
- // ! > 0.0 | ScaledIntegerNode with the value as the scale setting
404
- double intensityScaledInteger = E57_NOT_SCALED_USE_INTEGER;
405
-
406
- bool colorRedField = false ; // !< Indicates that the PointRecord @a colorRed field is active
407
- bool colorGreenField = false ; // !< Indicates that the PointRecord @a colorGreen field is active
408
- bool colorBlueField = false ; // !< Indicates that the PointRecord @a colorBlue field is active
409
- bool isColorInvalidField = false ; // !< Indicates that the PointRecord @a isColorInvalid field is active
410
-
411
- bool normalXField = false ; // !< Indicates that the PointRecord @a nor:normalX field is active
412
- bool normalYField = false ; // !< Indicates that the PointRecord @a nor:normalY field is active
413
- bool normalZField = false ; // !< Indicates that the PointRecord @a nor:normalZ field is active
389
+ // / @brief Controls the type of Node used for the PointRecord time fields
390
+ // / @details Accepts NumericalNodeType::Integer, NumericalNodeType::ScaledInteger, NumericalNodeType::Float, and
391
+ // / NumericalNodeType::Double.
392
+ NumericalNodeType timeNodeType = NumericalNodeType::Float;
393
+
394
+ // / @brief Sets the scale if using scaled integers for time fields
395
+ // / @details If timeNodeType == NumericalNodeType::ScaledInteger, it will use this value
396
+ // / to scale the numbers and it must be > 0.0.
397
+ double timeScale = 0.0 ;
398
+
399
+ // / Indicates that the PointRecord @a intensity field is active
400
+ bool intensityField = false ;
401
+ // / Indicates that the PointRecord @a isIntensityInvalid field is active
402
+ bool isIntensityInvalidField = false ;
403
+
404
+ // / @brief Controls the type of Node used for the PointRecord intensity fields
405
+ // / @details Accepts NumericalNodeType::Integer, NumericalNodeType::ScaledInteger, NumericalNodeType::Float, and
406
+ // / NumericalNodeType::Double.
407
+ NumericalNodeType intensityNodeType = NumericalNodeType::Float;
408
+
409
+ // / @brief Sets the scale if using scaled integers for intensity fields
410
+ // / @details If intensityNodeType == NumericalNodeType::ScaledInteger, it will use this value
411
+ // / to scale the numbers and it must be > 0.0.
412
+ double intensityScale = 0.0 ;
413
+
414
+ // / Indicates that the PointRecord @a colorRed field is active
415
+ bool colorRedField = false ;
416
+ // / Indicates that the PointRecord @a colorGreen field is active
417
+ bool colorGreenField = false ;
418
+ // / Indicates that the PointRecord @a colorBlue field is active
419
+ bool colorBlueField = false ;
420
+ // / Indicates that the PointRecord @a isColorInvalid field is active
421
+ bool isColorInvalidField = false ;
422
+
423
+ // / Indicates that the PointRecord @a nor:normalX field is active
424
+ bool normalXField = false ;
425
+ // / Indicates that the PointRecord @a nor:normalY field is active
426
+ bool normalYField = false ;
427
+ // / Indicates that the PointRecord @a nor:normalZ field is active
428
+ bool normalZField = false ;
414
429
};
415
430
416
431
// ! @brief Stores the top-level information for a single lidar scan
@@ -478,12 +493,15 @@ namespace e57
478
493
{
479
494
static_assert ( std::is_floating_point<COORDTYPE>::value, " Floating point type required." );
480
495
481
- // ! @brief Default constructor does not manage any memory or adjust min/max for floats.
496
+ // ! @brief Default constructor does not manage any memory, adjust min/max for floats, or validate data .
482
497
Data3DPointsData_t () = default ;
483
498
484
- // ! @brief Constructor which allocates buffers for all valid fields in the given Data3D header
485
- // ! This constructor will also adjust the min/max fields in the data3D pointFields if we are using floats.
486
- // ! @param [in] data3D Completed header which indicates the fields we are using
499
+ // / @brief Constructor which allocates buffers for all valid fields in the given Data3D header.
500
+ // / @details This constructor will also adjust the min/max fields in the data3D pointFields if we are using
501
+ // / floats, and run some validation on the Data3D.
502
+ // / @param [in] data3D Completed header which indicates the fields we are using
503
+ // / @throw ::ErrorValueOutOfBounds
504
+ // / @throw ::ErrorInvalidNodeType
487
505
explicit Data3DPointsData_t ( e57 ::Data3D &data3D );
488
506
489
507
// ! @brief Destructor will delete any memory allocated using the Data3DPointsData_t( const e57::Data3D & )
@@ -502,8 +520,8 @@ namespace e57
502
520
// ! Value = 0 if the point is considered valid, 1 otherwise
503
521
int8_t *cartesianInvalidState = nullptr ;
504
522
505
- // ! Pointer to a buffer with the Point response intensity. Unit is unspecified.
506
- float *intensity = nullptr ;
523
+ // / @brief Pointer to a buffer with the Point response intensity. Unit is unspecified.
524
+ double *intensity = nullptr ;
507
525
508
526
// ! Value = 0 if the intensity is considered valid, 1 otherwise
509
527
int8_t *isIntensityInvalid = nullptr ;
0 commit comments