Skip to content
Permalink
Browse files

Expose QgsPointCloudAttribute/QgsPointCloudAttributeCollection to sip

  • Loading branch information
nyalldawson committed Nov 9, 2020
1 parent d5ef807 commit d0d7aa6ca918597b4d45af028ba8420483d80eb4
@@ -0,0 +1,142 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudattribute.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsPointCloudAttribute
{
%Docstring

Attribute for point cloud data
pair of name and size in bytes

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointcloudattribute.h"
%End
public:
enum DataType
{
Char,
Short,
Int32,
Float,
Double,
};

QgsPointCloudAttribute();
%Docstring
Ctor
%End
QgsPointCloudAttribute( const QString &name, DataType type );
%Docstring
Ctor
%End

QString name() const;
%Docstring
Returns name of the attribute
%End

size_t size() const;
%Docstring
Returns size of the attribute in bytes
%End

DataType type() const;
%Docstring
Returns the data type
%End

QString displayType() const;
%Docstring
Returns the type to use when displaying this field.

This will be used when the full datatype with details has to displayed to the user.

.. seealso:: :py:func:`type`
%End

static bool isNumeric( DataType type );
%Docstring
Returns ``True`` if the specified data ``type`` is numeric.
%End

SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsPointCloudAttribute: %1 (%2)>" ).arg( sipCpp->name() ).arg( sipCpp->displayType() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};

class QgsPointCloudAttributeCollection
{
%Docstring

Collection of point cloud attributes

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointcloudattribute.h"
%End
public:
QgsPointCloudAttributeCollection();
%Docstring
Ctor
%End
QgsPointCloudAttributeCollection( const QVector<QgsPointCloudAttribute> &attributes );
%Docstring
Ctor with given attributes
%End
void push_back( const QgsPointCloudAttribute &attribute );
%Docstring
Adds extra attribute
%End

QVector<QgsPointCloudAttribute> attributes() const;
%Docstring
Returns all attributes
%End

int count() const;
%Docstring
Returns the number of attributes present in the collection.
%End

const QgsPointCloudAttribute &at( int index ) const;
%Docstring
Returns the attribute at the specified ``index``.
%End

const QgsPointCloudAttribute *find( const QString &attributeName, int &offset ) const;
%Docstring
Finds the attribute with the name

Returns None if not found
%End

size_t pointRecordSize() const;
%Docstring
Returns total size of record
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/pointcloud/qgspointcloudattribute.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -23,8 +23,6 @@
#include <QString>
#include <QVector>

#define SIP_NO_FILE

/**
* \ingroup core
*
@@ -74,6 +72,14 @@ class CORE_EXPORT QgsPointCloudAttribute
*/
static bool isNumeric( DataType type );

#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
QString str = QStringLiteral( "<QgsPointCloudAttribute: %1 (%2)>" ).arg( sipCpp->name() ).arg( sipCpp->displayType() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
% End
#endif

private:
void updateSize();

@@ -120,7 +126,7 @@ class CORE_EXPORT QgsPointCloudAttributeCollection
const QgsPointCloudAttribute *find( const QString &attributeName, int &offset ) const;

//! Returns total size of record
std::size_t pointRecordSize() const { return mSize; }
size_t pointRecordSize() const { return mSize; }

private:
std::size_t mSize = 0;

0 comments on commit d0d7aa6

Please sign in to comment.
You can’t perform that action at this time.