37 case DataType::UShort:
38 case DataType::UInt32:
42 case DataType::UInt64:
44 return QVariant::LongLong;
46 case DataType::Double:
47 return QVariant::Double;
49 return QVariant::Invalid;
57 return QObject::tr(
"Unsigned Character" );
59 return QObject::tr(
"Character" );
61 return QObject::tr(
"Short" );
62 case DataType::UShort:
63 return QObject::tr(
"Unsigned Short" );
65 return QObject::tr(
"Float" );
67 return QObject::tr(
"Integer" );
68 case DataType::UInt32:
69 return QObject::tr(
"Unsigned Integer" );
71 return QObject::tr(
"Long Integer" );
72 case DataType::UInt64:
73 return QObject::tr(
"Unsigned Long Integer" );
74 case DataType::Double:
75 return QObject::tr(
"Double" );
88 case DataType::UShort:
90 case DataType::UInt32:
92 case DataType::UInt64:
94 case DataType::Double:
100 void QgsPointCloudAttribute::updateSize()
104 case DataType::UChar:
108 case DataType::Short:
109 case DataType::UShort:
112 case DataType::Float:
115 case DataType::Int32:
116 case DataType::UInt32:
119 case DataType::Int64:
120 case DataType::UInt64:
123 case DataType::Double:
144 mCachedAttributes.insert( attribute.
name().toUpper(), CachedAttributeData( mAttributes.size(), mSize ) );
145 mAttributes.push_back( attribute );
146 mSize += attribute.
size();
151 for (
const auto &attributeName : matchingNames )
153 if (
indexOf( attributeName ) == -1 )
156 const auto attr = otherCollection.
find( attributeName, offset );
170 const auto it = mCachedAttributes.constFind( attributeName.toUpper() );
171 if ( it != mCachedAttributes.constEnd() )
174 return &mAttributes.at( it->index );
183 const auto it = mCachedAttributes.constFind( name.toUpper() );
184 if ( it != mCachedAttributes.constEnd() )
198 fields.
append(
QgsField( attribute.name(), attribute.variantType(), attribute.displayType() ) );
203 template <
typename T>
210 value = *( data + offset );
214 value = *
reinterpret_cast< const quint32 *
>( data + offset );
218 value = *
reinterpret_cast< const qint32 *
>( data + offset );
222 value = *
reinterpret_cast< const quint64 *
>( data + offset );
226 value = *
reinterpret_cast< const qint64 *
>( data + offset );
230 value = *
reinterpret_cast< const short *
>( data + offset );
234 value = *
reinterpret_cast< const unsigned short *
>( data + offset );
238 value =
static_cast< T
>( *
reinterpret_cast< const float *
>( data + offset ) );
242 value = *
reinterpret_cast< const double *
>( data + offset );
260 _attribute( ptr, i * pointRecordSize + xOffset, xType, x );
261 x = indexOffset.
x() + indexScale.
x() * x;
263 _attribute( ptr, i * pointRecordSize + yOffset, yType, y );
264 y = indexOffset.
y() + indexScale.
y() * y;
266 _attribute( ptr, i * pointRecordSize + zOffset, zType, z );
267 z = indexOffset.
z() + indexScale.
z() * z;
273 const QVector<QgsPointCloudAttribute> attributes = attributeCollection.
attributes();
276 const QString attributeName = attr.name();
278 attributeCollection.
find( attributeName, attributeOffset );
279 switch ( attr.type() )
284 const char value = *( data + recordOffset + attributeOffset );
285 map[ attributeName ] = value;
291 const quint32 value = *
reinterpret_cast< const quint32 *
>( data + recordOffset + attributeOffset );
292 map[ attributeName ] = value;
297 const qint32 value = *
reinterpret_cast< const qint32 *
>( data + recordOffset + attributeOffset );
298 map[ attributeName ] = value;
304 const quint64 value = *
reinterpret_cast< const quint64 *
>( data + recordOffset + attributeOffset );
305 map[ attributeName ] = value;
310 const qint64 value = *
reinterpret_cast< const qint64 *
>( data + recordOffset + attributeOffset );
311 map[ attributeName ] = value;
317 const short value = *
reinterpret_cast< const short *
>( data + recordOffset + attributeOffset );
318 map[ attributeName ] = value;
324 const unsigned short value = *
reinterpret_cast< const unsigned short *
>( data + recordOffset + attributeOffset );
325 map[ attributeName ] = value;
331 const float value = *
reinterpret_cast< const float *
>( data + recordOffset + attributeOffset );
332 map[ attributeName ] = value;
338 const double value = *
reinterpret_cast< const double *
>( data + recordOffset + attributeOffset );
339 map[ attributeName ] = value;