Skip to content
Permalink
Browse files

make functions in qgspointcloud3dsymbol.cpp

  • Loading branch information
NEDJIMAbelgacem committed Nov 15, 2020
1 parent 623f6cd commit 270e64adfa74bcad415fd1dbfac6a36bf30cacdd
Showing with 51 additions and 75 deletions.
  1. +43 −43 src/3d/symbols/qgspointcloud3dsymbol.cpp
  2. +8 −32 src/3d/symbols/qgspointcloud3dsymbol.h
@@ -17,46 +17,46 @@

// TODO: For some reason whwn I define function on a .cpp file they don't get included in the qgis_app target

//QgsPointCloud3DSymbol::QgsPointCloud3DSymbol()
//: QgsAbstract3DSymbol()
//{

//}

//QgsPointCloud3DSymbol::~QgsPointCloud3DSymbol() { }

//QgsAbstract3DSymbol *QgsPointCloud3DSymbol::clone() const
//{
// // TODO: fix memory leak
// QgsPointCloud3DSymbol *result = new QgsPointCloud3DSymbol;
// result->mEnabled = mEnabled;
// result->mPointSize = mPointSize;
// copyBaseSettings( result );
// return result;
//}

//void QgsPointCloud3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
//{
// Q_UNUSED( context )

// elem.setAttribute( QStringLiteral( "enabled" ), mEnabled );
// elem.setAttribute( QStringLiteral( "point-size" ), mPointSize );
//}

//void QgsPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
//{
// Q_UNUSED( context )

// mEnabled = elem.attribute( "enabled", QStringLiteral( "0" ) ).toInt();
// mPointSize = elem.attribute( "point-size", QStringLiteral( "5.0" ) ).toFloat();
//}

//void QgsPointCloud3DSymbol::setIsEnabled( bool enabled )
//{
// mEnabled = enabled;
//}

//void QgsPointCloud3DSymbol::setPointSize( float size )
//{
// mPointSize = size * 1.0f;
//}
QgsPointCloud3DSymbol::QgsPointCloud3DSymbol()
: QgsAbstract3DSymbol()
{

}

QgsPointCloud3DSymbol::~QgsPointCloud3DSymbol() { }

QgsAbstract3DSymbol *QgsPointCloud3DSymbol::clone() const
{
// TODO: fix memory leak
QgsPointCloud3DSymbol *result = new QgsPointCloud3DSymbol;
result->mEnabled = mEnabled;
result->mPointSize = mPointSize;
copyBaseSettings( result );
return result;
}

void QgsPointCloud3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const
{
Q_UNUSED( context )

elem.setAttribute( QStringLiteral( "enabled" ), mEnabled );
elem.setAttribute( QStringLiteral( "point-size" ), mPointSize );
}

void QgsPointCloud3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
{
Q_UNUSED( context )

mEnabled = elem.attribute( "enabled", QStringLiteral( "0" ) ).toInt();
mPointSize = elem.attribute( "point-size", QStringLiteral( "5.0" ) ).toFloat();
}

void QgsPointCloud3DSymbol::setIsEnabled( bool enabled )
{
mEnabled = enabled;
}

void QgsPointCloud3DSymbol::setPointSize( float size )
{
mPointSize = size * 1.0f;
}
@@ -35,64 +35,40 @@ class _3D_EXPORT QgsPointCloud3DSymbol : public QgsAbstract3DSymbol
{
public:
//! Constructor for QgsPointCloud3DSymbol
QgsPointCloud3DSymbol() : QgsAbstract3DSymbol() { }
~QgsPointCloud3DSymbol() override = default;
QgsPointCloud3DSymbol();
//! Destructor for QgsPointCloud3DSymbol
~QgsPointCloud3DSymbol() override;

QString type() const override { return "pointcloud"; }
QgsAbstract3DSymbol *clone() const override SIP_FACTORY
{
// TODO: use unique_ptr
QgsPointCloud3DSymbol *result = new QgsPointCloud3DSymbol;
result->mEnabled = mEnabled;
result->mPointSize = mPointSize;
copyBaseSettings( result );
return result;
}
QgsAbstract3DSymbol *clone() const override SIP_FACTORY;

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

void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override
{
Q_UNUSED( context )

elem.setAttribute( QStringLiteral( "enabled" ), mEnabled );
elem.setAttribute( QStringLiteral( "point-size" ), mPointSize );
}

void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override
{
Q_UNUSED( context )

mEnabled = elem.attribute( "enabled", QStringLiteral( "0" ) ).toInt();
mPointSize = elem.attribute( "point-size", QStringLiteral( "5.0" ) ).toFloat();
}
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;

/**
* Returns whether rendering for this symbol is enabled
* \see setIsEnabled( bool enabled )
* \since QGIS 3.18
*/
bool isEnabled() const { return mEnabled; }

/**
* Sets whether rendering for this symbol is enabled
* \see isEnabled()
* \since QGIS 3.18
*/
void setIsEnabled( bool enabled ) { mEnabled = enabled; }
void setIsEnabled( bool enabled );

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

/**
* Sets the point size
* \see pointSize()
* \since QGIS 3.18
*/
void setPointSize( float size ) { mPointSize = size; }
void setPointSize( float size );

private:
bool mEnabled = true;

0 comments on commit 270e64a

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