15 #include <QSharedPointer>
82 "[Classif] Synthetic flag",
83 "[Classif] Key-point flag",
84 "[Classif] Withheld flag",
85 "[Classif] Overlap flag",
91 typedef QSharedPointer<LasField>
Shared;
95 double defaultVal = 0,
98 uint8_t _minPointFormat = 0)
114 std::vector<LasField>& fieldsToSave,
118 std::vector<LasField> lasFields;
119 lasFields.reserve(14);
135 lasFields.emplace_back(
LAS_TIME, 0, 0, -1.0,
158 QString sfName = QString(
sf->
getName()).toUpper();
159 bool outBounds =
false;
160 for (
size_t j = 0; j < lasFields.size(); ++j) {
162 if (sfName == lasFields[j].
getName().toUpper()) {
166 if (sfMin < lasFields[j].
minValue ||
171 QString(
"[LAS] Found a '%1' scalar field, "
172 "but its values outbound LAS "
173 "specifications (%2-%3)...")
175 .arg(lasFields[j].minValue)
176 .arg(lasFields[j].maxValue));
180 fieldsToSave.push_back(lasFields[j]);
181 fieldsToSave.back().sf =
sf;
185 fieldsToSave.back().minPointFormat);
191 }
catch (
const std::bad_alloc&) {
200 switch (pointFormat) {
212 return 20 + 8 + 6 + 29;
222 return 30 + 6 + 2 + 29;
230 return pointFormat >= 6 ? 4 : 2;
236 bool allowLegacyFormats =
true) {
297 QString sanitizedStr = str;
298 sanitizedStr.replace(
'=',
"_eq_");
299 sanitizedStr.replace(
' ',
"__");
301 if (sanitizedStr.size() > 32) {
302 sanitizedStr = sanitizedStr.left(32);
309 QString desanitizedStr = str;
310 desanitizedStr.replace(
"_eq_",
"=");
311 desanitizedStr.replace(
"__",
" ");
313 return desanitizedStr;
static const char LAS_VERSION_MAJOR_META_DATA[]
static const char LAS_OFFSET_X_META_DATA[]
static const char LAS_SCALE_X_META_DATA[]
const char LAS_FIELD_NAMES[][28]
static const char LAS_OFFSET_Y_META_DATA[]
static const char LAS_PROJECT_UUID_META_DATA[]
static const char LAS_SCALE_Z_META_DATA[]
static const char LAS_SCALE_Y_META_DATA[]
static const char LAS_OFFSET_Z_META_DATA[]
static const char LAS_POINT_FORMAT_META_DATA[]
static const char LAS_GLOBAL_ENCODING_META_DATA[]
static const char LAS_VERSION_MINOR_META_DATA[]
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
A scalar field associated to display-related parameters.
double getGlobalShift() const
Returns the global shift (if any)
ScalarField * getScalarField(int index) const
Returns a pointer to a specific scalar field.
unsigned getNumberOfScalarFields() const
Returns the number of associated (and active) scalar fields.
ScalarType & getValue(std::size_t index)
const char * getName() const
Returns scalar field name.
static bool ValidValue(ScalarType value)
Returns whether a scalar value is valid or not.
ScalarType getMax() const
Returns the maximum value.
double getSafeValue(unsigned index) const
virtual QString getName() const
Returns official field name.
LasField(LAS_FIELDS fieldType=LAS_INVALID, double defaultVal=0, double min=0.0, double max=-1.0, uint8_t _minPointFormat=0)
Default constructor.
static QString DesanitizeString(const QString &str)
static bool GetLASFields(ccPointCloud *cloud, std::vector< LasField > &fieldsToSave, uint8_t &minPointFormat)
Returns the (compliant) LAS fields in a point cloud.
static uint8_t UpdateMinPointFormat(uint8_t minPointFormat, bool withRGB, bool withFWF, bool allowLegacyFormats=true)
QSharedPointer< LasField > Shared
Shared type.
static unsigned GetFormatRecordLength(uint8_t pointFormat)
static QString SanitizeString(const QString &str)
static uint8_t VersionMinorForPointFormat(uint8_t pointFormat)