Skip to content

Commit

Permalink
Merge pull request #60586 from dvdkon/pointcloudindex-remove-clone
Browse files Browse the repository at this point in the history
Remove unused clone() method from QgsAbstractPointCloudIndex
  • Loading branch information
ptitjano authored Feb 13, 2025
2 parents d08c757 + 1647b75 commit ddf579a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 78 deletions.
24 changes: 0 additions & 24 deletions src/core/pointcloud/qgscopcpointcloudindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ QgsCopcPointCloudIndex::QgsCopcPointCloudIndex() = default;

QgsCopcPointCloudIndex::~QgsCopcPointCloudIndex() = default;

std::unique_ptr<QgsAbstractPointCloudIndex> QgsCopcPointCloudIndex::clone() const
{
QgsCopcPointCloudIndex *clone = new QgsCopcPointCloudIndex;
QMutexLocker locker( &mHierarchyMutex );
copyCommonProperties( clone );
return std::unique_ptr<QgsAbstractPointCloudIndex>( clone );
}

void QgsCopcPointCloudIndex::load( const QString &urlString )
{
QUrl url = urlString;
Expand Down Expand Up @@ -432,22 +424,6 @@ QgsPointCloudNode QgsCopcPointCloudIndex::getNode( const QgsPointCloudNodeId &id
return QgsPointCloudNode( id, pointCount, children, bounds.width() / mSpan, bounds );
}

void QgsCopcPointCloudIndex::copyCommonProperties( QgsCopcPointCloudIndex *destination ) const
{
QgsAbstractPointCloudIndex::copyCommonProperties( destination );

// QgsCopcPointCloudIndex specific fields
destination->mIsValid = mIsValid;
destination->mAccessType = mAccessType;
destination->mUri = mUri;
if ( mAccessType == Qgis::PointCloudAccessType::Local )
destination->mCopcFile.open( QgsLazDecoder::toNativePath( mUri ), std::ios::binary );
destination->mCopcInfoVlr = mCopcInfoVlr;
destination->mHierarchyNodePos = mHierarchyNodePos;
destination->mOriginalMetadata = mOriginalMetadata;
destination->mLazInfo.reset( new QgsLazInfo( *mLazInfo ) );
}

QByteArray QgsCopcPointCloudIndex::readRange( uint64_t offset, uint64_t length ) const
{
if ( mAccessType == Qgis::PointCloudAccessType::Local )
Expand Down
8 changes: 0 additions & 8 deletions src/core/pointcloud/qgscopcpointcloudindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class CORE_EXPORT QgsCopcPointCloudIndex: public QgsAbstractPointCloudIndex
explicit QgsCopcPointCloudIndex();
~QgsCopcPointCloudIndex();

std::unique_ptr<QgsAbstractPointCloudIndex> clone() const override;

void load( const QString &fileName ) override;

bool hasNode( const QgsPointCloudNodeId &n ) const override;
Expand Down Expand Up @@ -77,12 +75,6 @@ class CORE_EXPORT QgsCopcPointCloudIndex: public QgsAbstractPointCloudIndex
*/
QgsPointCloudStatistics metadataStatistics() const override;

/**
* Copies common properties to the \a destination index
* \since QGIS 3.26
*/
void copyCommonProperties( QgsCopcPointCloudIndex *destination ) const;

/**
* Returns one datapoint, "CopcGpsTimeFlag": The gps time flag from global_encoding field in LAS header,
* 0 indicates GPS week time (seconds passed since the beginning of the week)
Expand Down
25 changes: 0 additions & 25 deletions src/core/pointcloud/qgseptpointcloudindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ QgsEptPointCloudIndex::QgsEptPointCloudIndex()

QgsEptPointCloudIndex::~QgsEptPointCloudIndex() = default;

std::unique_ptr<QgsAbstractPointCloudIndex> QgsEptPointCloudIndex::clone() const
{
QgsEptPointCloudIndex *clone = new QgsEptPointCloudIndex;
QMutexLocker locker( &mHierarchyMutex );
copyCommonProperties( clone );
return std::unique_ptr<QgsAbstractPointCloudIndex>( clone );
}

void QgsEptPointCloudIndex::load( const QString &urlString )
{
QUrl url = urlString;
Expand Down Expand Up @@ -651,23 +643,6 @@ Qgis::PointCloudAccessType QgsEptPointCloudIndex::accessType() const
return mAccessType;
}

void QgsEptPointCloudIndex::copyCommonProperties( QgsEptPointCloudIndex *destination ) const
{
QgsAbstractPointCloudIndex::copyCommonProperties( destination );

// QgsEptPointCloudIndex specific fields
destination->mIsValid = mIsValid;
destination->mAccessType = mAccessType;
destination->mDataType = mDataType;
destination->mUrlDirectoryPart = mUrlDirectoryPart;
destination->mWkt = mWkt;
destination->mHierarchyNodes = mHierarchyNodes;
destination->mPointCount = mPointCount;
destination->mMetadataStats = mMetadataStats;
destination->mAttributeClasses = mAttributeClasses;
destination->mOriginalMetadata = mOriginalMetadata;
}

#undef PROVIDER_KEY
#undef PROVIDER_DESCRIPTION

Expand Down
8 changes: 0 additions & 8 deletions src/core/pointcloud/qgseptpointcloudindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class CORE_EXPORT QgsEptPointCloudIndex: public QgsAbstractPointCloudIndex
explicit QgsEptPointCloudIndex();
~QgsEptPointCloudIndex();

std::unique_ptr<QgsAbstractPointCloudIndex> clone() const override;

void load( const QString &fileName ) override;

std::unique_ptr<QgsPointCloudBlock> nodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request ) override;
Expand All @@ -58,12 +56,6 @@ class CORE_EXPORT QgsEptPointCloudIndex: public QgsAbstractPointCloudIndex
bool isValid() const override;
Qgis::PointCloudAccessType accessType() const override;

/**
* Copies common properties to the \a destination index
* \since QGIS 3.26
*/
void copyCommonProperties( QgsEptPointCloudIndex *destination ) const;

protected:
bool loadSchema( const QByteArray &dataJson );
void loadManifest( const QByteArray &manifestJson );
Expand Down
5 changes: 0 additions & 5 deletions src/core/pointcloud/qgspointcloudeditingindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ QgsPointCloudEditingIndex::QgsPointCloudEditingIndex( QgsPointCloudLayer *layer
mIsValid = true;
}

std::unique_ptr<QgsAbstractPointCloudIndex> QgsPointCloudEditingIndex::clone() const
{
return nullptr;
}

void QgsPointCloudEditingIndex::load( const QString & )
{
return;
Expand Down
1 change: 0 additions & 1 deletion src/core/pointcloud/qgspointcloudeditingindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class CORE_EXPORT QgsPointCloudEditingIndex : public QgsAbstractPointCloudIndex
//! Ctor
explicit QgsPointCloudEditingIndex( QgsPointCloudLayer *layer );

std::unique_ptr<QgsAbstractPointCloudIndex> clone() const override;
void load( const QString &fileName ) override;
bool isValid() const override;
Qgis::PointCloudAccessType accessType() const override;
Expand Down
7 changes: 0 additions & 7 deletions src/core/pointcloud/qgspointcloudindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,6 @@ class CORE_EXPORT QgsAbstractPointCloudIndex
explicit QgsAbstractPointCloudIndex();
virtual ~QgsAbstractPointCloudIndex();

/**
* Returns a clone of the current point cloud index object
* \note It is the responsibility of the caller to handle the ownership and delete the object.
* \since QGIS 3.26
*/
virtual std::unique_ptr<QgsAbstractPointCloudIndex> clone() const = 0;

//! Loads the index from the file
virtual void load( const QString &fileName ) = 0;

Expand Down

0 comments on commit ddf579a

Please sign in to comment.