Skip to content

Commit

Permalink
move point size to QgsPointCloud3DSymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Dec 3, 2020
1 parent d97b291 commit f4b9f72
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 97 deletions.
57 changes: 15 additions & 42 deletions python/3d/auto_generated/symbols/qgspointcloud3dsymbol.sip.in
Expand Up @@ -62,6 +62,20 @@ see setLayer( :py:class:`QgsPointCloudLayer` *layer )
%Docstring
Sets the point cloud layer object used by the symbol
see :py:func:`~QgsPointCloud3DSymbol.layer`
%End

float pointSize() const;
%Docstring
Returns the point size of the point cloud

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

void setPointSize( float size );
%Docstring
Sets the point size

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

QgsPointCloud3DSymbol::RenderingStyle renderingStyle() const;
Expand All @@ -70,6 +84,7 @@ Returns the rendering style used to render the point cloud
%End

protected:
float mPointSize = 2.0f;
};

class QgsSingleColorPointCloud3DSymbol : QgsPointCloud3DSymbol
Expand Down Expand Up @@ -102,20 +117,6 @@ Constructor for QgsSingleColorPointCloud3DSymbol
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );


float pointSize() const;
%Docstring
Returns the point size of the point cloud

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

void setPointSize( float size );
%Docstring
Sets the point size

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

QColor singleColor() const;
%Docstring
Returns the color used by the renderer when using SingleColor rendering mode
Expand Down Expand Up @@ -162,20 +163,6 @@ Constructor for QgsColorRampPointCloud3DSymbol
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );


float pointSize() const;
%Docstring
Returns the point size of the point cloud

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

void setPointSize( float size );
%Docstring
Sets the point size

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

QString renderingParameter() const;
%Docstring
Returns the parameter used to select the color of the point cloud
Expand Down Expand Up @@ -256,20 +243,6 @@ Constructor for QgsRGBPointCloud3DSymbol

virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );


float pointSize() const;
%Docstring
Returns the point size of the point cloud

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

void setPointSize( float size );
%Docstring
Sets the point size

.. seealso:: :py:func:`pointSize`
%End
};

/************************************************************************
Expand Down
20 changes: 5 additions & 15 deletions src/3d/symbols/qgspointcloud3dsymbol.cpp
Expand Up @@ -31,6 +31,11 @@ void QgsPointCloud3DSymbol::setLayer( QgsPointCloudLayer *layer )
mLayer = layer;
}

void QgsPointCloud3DSymbol::setPointSize( float size )
{
mPointSize = size;
}

// QgsSingleColorPointCloud3DSymbol

QgsSingleColorPointCloud3DSymbol::QgsSingleColorPointCloud3DSymbol( QgsPointCloudLayer *layer )
Expand Down Expand Up @@ -70,11 +75,6 @@ void QgsSingleColorPointCloud3DSymbol::readXml( const QDomElement &elem, const Q
mSingleColor.setBlueF( elem.attribute( "single-color-blue", QStringLiteral( "1.0" ) ).toFloat() );
}

void QgsSingleColorPointCloud3DSymbol::setPointSize( float size )
{
mPointSize = size;
}

void QgsSingleColorPointCloud3DSymbol::setSingleColor( QColor color )
{
mSingleColor = color;
Expand Down Expand Up @@ -136,11 +136,6 @@ void QgsColorRampPointCloud3DSymbol::setRenderingParameter( const QString &param
mRenderingParameter = parameter;
}

void QgsColorRampPointCloud3DSymbol::setPointSize( float size )
{
mPointSize = size;
}

QgsColorRampShader QgsColorRampPointCloud3DSymbol::colorRampShader() const
{
return mColorRampShader;
Expand Down Expand Up @@ -187,8 +182,3 @@ void QgsRGBPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWr
mPointSize = elem.attribute( "point-size", QStringLiteral( "2.0" ) ).toFloat();
}

void QgsRGBPointCloud3DSymbol::setPointSize( float size )
{
mPointSize = size;
}

53 changes: 13 additions & 40 deletions src/3d/symbols/qgspointcloud3dsymbol.h
Expand Up @@ -74,12 +74,25 @@ class _3D_EXPORT QgsPointCloud3DSymbol : public QgsAbstract3DSymbol
*/
void setLayer( QgsPointCloudLayer *layer );

/**
* Returns the point size of the point cloud
* \see setPointSize( float size )
*/
float pointSize() const { return mPointSize; }

/**
* Sets the point size
* \see pointSize()
*/
void setPointSize( float size );

//! Returns the rendering style used to render the point cloud
QgsPointCloud3DSymbol::RenderingStyle renderingStyle() const { return mRenderingStyle; }

protected:
QgsPointCloud3DSymbol::RenderingStyle mRenderingStyle = QgsPointCloud3DSymbol::NoRendering;
QgsPointCloudLayer *mLayer = nullptr;
float mPointSize = 2.0f;
};

/**
Expand All @@ -102,18 +115,6 @@ class _3D_EXPORT QgsSingleColorPointCloud3DSymbol : public QgsPointCloud3DSymbol
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;

/**
* Returns the point size of the point cloud
* \see setPointSize( float size )
*/
float pointSize() const { return mPointSize; }

/**
* Sets the point size
* \see pointSize()
*/
void setPointSize( float size );

/**
* Returns the color used by the renderer when using SingleColor rendering mode
* \see setSingleColor( QColor color )
Expand All @@ -127,7 +128,6 @@ class _3D_EXPORT QgsSingleColorPointCloud3DSymbol : public QgsPointCloud3DSymbol
void setSingleColor( QColor color );

private:
float mPointSize = 2.0f;
QColor mSingleColor = Qt::blue;
};

Expand All @@ -151,18 +151,6 @@ class _3D_EXPORT QgsColorRampPointCloud3DSymbol : public QgsPointCloud3DSymbol
void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;

/**
* Returns the point size of the point cloud
* \see setPointSize( float size )
*/
float pointSize() const { return mPointSize; }

/**
* Sets the point size
* \see pointSize()
*/
void setPointSize( float size );

/**
* Returns the parameter used to select the color of the point cloud
* \see setRenderingParameter( const QString &parameter )
Expand Down Expand Up @@ -206,7 +194,6 @@ class _3D_EXPORT QgsColorRampPointCloud3DSymbol : public QgsPointCloud3DSymbol
void setColorRampShaderMinMax( double min, double max );

private:
float mPointSize = 2.0f;
QString mRenderingParameter;
QgsColorRampShader mColorRampShader;
double mColorRampShaderMin = 0.0;
Expand All @@ -232,20 +219,6 @@ class _3D_EXPORT QgsRGBPointCloud3DSymbol : public QgsPointCloud3DSymbol

void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;

/**
* Returns the point size of the point cloud
* \see setPointSize( float size )
*/
float pointSize() const { return mPointSize; }

/**
* Sets the point size
* \see pointSize()
*/
void setPointSize( float size );
private:
float mPointSize = 2.0f;
};

#endif // QGSPOINTCLOUD3DSYMBOL_H

0 comments on commit f4b9f72

Please sign in to comment.