mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-27 00:07:16 -05:00
Clean up after refactor
This commit is contained in:
parent
6598b21606
commit
0623832d3a
@ -182,12 +182,12 @@ int QgsPointCloudLayerChunkLoaderFactory::primitivesCount( QgsChunkNode *node )
|
||||
|
||||
static QgsBox3D nodeBoundsToBox3D( QgsBox3D nodeBounds, const QgsCoordinateTransform &coordinateTransform, double zValueOffset, double zValueScale )
|
||||
{
|
||||
QgsVector3D extentMin3D( static_cast<double>( nodeBounds.xMinimum() ),
|
||||
static_cast<double>( nodeBounds.yMinimum() ),
|
||||
static_cast<double>( nodeBounds.zMinimum() ) * zValueScale + zValueOffset );
|
||||
QgsVector3D extentMax3D( static_cast<double>( nodeBounds.xMaximum() ),
|
||||
static_cast<double>( nodeBounds.yMaximum() ),
|
||||
static_cast<double>( nodeBounds.zMaximum() ) * zValueScale + zValueOffset );
|
||||
QgsVector3D extentMin3D( nodeBounds.xMinimum(),
|
||||
nodeBounds.yMinimum(),
|
||||
nodeBounds.zMinimum() * zValueScale + zValueOffset );
|
||||
QgsVector3D extentMax3D( nodeBounds.xMaximum(),
|
||||
nodeBounds.yMaximum(),
|
||||
nodeBounds.zMaximum() * zValueScale + zValueOffset );
|
||||
QgsCoordinateTransform extentTransform = coordinateTransform;
|
||||
extentTransform.setBallparkTransformsAreAppropriate( true );
|
||||
try
|
||||
|
||||
@ -57,15 +57,12 @@ typedef Qt3DCore::QGeometry Qt3DQGeometry;
|
||||
#include <delaunator.hpp>
|
||||
|
||||
// pick a point that we'll use as origin for coordinates for this node's points
|
||||
static QgsVector3D originFromNodeBounds( QgsPointCloudIndex *pc, const QgsPointCloudNodeId &n, const QgsPointCloud3DRenderContext &context, const QgsPointCloudBlock *block )
|
||||
static QgsVector3D originFromNodeBounds( QgsPointCloudIndex *pc, const QgsPointCloudNodeId &n, const QgsPointCloud3DRenderContext &context )
|
||||
{
|
||||
const QgsVector3D blockScale = block->scale();
|
||||
const QgsVector3D blockOffset = block->offset();
|
||||
|
||||
QgsBox3D bounds = pc->getNode( n ).bounds();
|
||||
double nodeOriginX = bounds.xMinimum() * blockScale.x() + blockOffset.x();
|
||||
double nodeOriginY = bounds.yMinimum() * blockScale.y() + blockOffset.y();
|
||||
double nodeOriginZ = ( bounds.zMinimum() * blockScale.z() + blockOffset.z() ) * context.zValueScale() + context.zValueFixedOffset();
|
||||
double nodeOriginX = bounds.xMinimum();
|
||||
double nodeOriginY = bounds.yMinimum();
|
||||
double nodeOriginZ = bounds.zMinimum() * context.zValueScale() + context.zValueFixedOffset();
|
||||
try
|
||||
{
|
||||
context.coordinateTransform().transformInPlace( nodeOriginX, nodeOriginY, nodeOriginZ );
|
||||
@ -618,7 +615,7 @@ void QgsSingleColorPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *p
|
||||
if ( !output )
|
||||
output = &outNormal;
|
||||
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context, block.get() );
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
@ -743,7 +740,7 @@ void QgsColorRampPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc,
|
||||
if ( !output )
|
||||
output = &outNormal;
|
||||
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context, block.get() );
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
@ -865,7 +862,7 @@ void QgsRGBPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, const
|
||||
if ( !output )
|
||||
output = &outNormal;
|
||||
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context, block.get() );
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context );
|
||||
|
||||
int ir = 0;
|
||||
int ig = 0;
|
||||
@ -1035,7 +1032,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex
|
||||
if ( !output )
|
||||
output = &outNormal;
|
||||
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context, block.get() );
|
||||
output->positionsOrigin = originFromNodeBounds( pc, n, context );
|
||||
|
||||
const QSet<int> filteredOutValues = context.getFilteredOutValues();
|
||||
for ( int i = 0; i < count; ++i )
|
||||
|
||||
@ -124,7 +124,7 @@ QgsBox3D QgsPointCloudNode::bounds() const
|
||||
{
|
||||
const QgsBox3D rootBounds = mIndex.rootNodeBounds();
|
||||
const double d = rootBounds.xMaximum() - rootBounds.xMinimum();
|
||||
const double dLevel = ( double )d / pow( 2, mId.d() );
|
||||
const double dLevel = d / pow( 2, mId.d() );
|
||||
|
||||
const double xMin = rootBounds.xMinimum() + dLevel * mId.x();
|
||||
const double xMax = rootBounds.xMinimum() + dLevel * ( mId.x() + 1 );
|
||||
|
||||
@ -158,16 +158,21 @@ uint qHash( const QgsPointCloudCacheKey &key );
|
||||
class CORE_EXPORT QgsPointCloudNode
|
||||
{
|
||||
public:
|
||||
//! Constructs new node object. Should only be called by QgsPointCloudIndex::getNode()
|
||||
QgsPointCloudNode( const QgsPointCloudIndex &index, QgsPointCloudNodeId id, qint64 pointCount,
|
||||
QList<QgsPointCloudNodeId> childIds )
|
||||
: mIndex( index ), mId( id ), mPointCount( pointCount ), mChildIds( childIds )
|
||||
{
|
||||
}
|
||||
//! Returns node's ID (unique in index)
|
||||
QgsPointCloudNodeId id() const { return mId; }
|
||||
//! Returns number of points contained in node data
|
||||
qint64 pointCount() const { return mPointCount; }
|
||||
//! Returns IDs of child nodes
|
||||
QList<QgsPointCloudNodeId> children() const { return mChildIds; }
|
||||
//! Returns node's error in map units (used to determine in whether the node has enough detail for the current view)
|
||||
float error() const;
|
||||
//! Returns node's bounding cube in CRS coords
|
||||
QgsBox3D bounds() const;
|
||||
|
||||
private:
|
||||
@ -247,6 +252,7 @@ class CORE_EXPORT QgsPointCloudIndex
|
||||
//! Returns whether the octree contain given node
|
||||
virtual bool hasNode( const QgsPointCloudNodeId &n ) const;
|
||||
|
||||
//! Returns object for a given node
|
||||
virtual QgsPointCloudNode getNode( const QgsPointCloudNodeId &id ) const;
|
||||
|
||||
//! Returns all attributes that are stored in the file
|
||||
|
||||
@ -478,9 +478,9 @@ void TestQgsPointCloud3DRendering::testPointCloudFilteredClassification()
|
||||
// find a better fix in the future.
|
||||
QImage img = Qgs3DUtils::captureSceneImage( engine, scene );
|
||||
|
||||
QGSVERIFYIMAGECHECK( "pointcloud_3d_filtered_classification", "pointcloud_3d_filtered_classification", img, QString(), 80, QSize( 0, 0 ), 15 );
|
||||
|
||||
mLayer->setSubsetString( "" );
|
||||
|
||||
QGSVERIFYIMAGECHECK( "pointcloud_3d_filtered_classification", "pointcloud_3d_filtered_classification", img, QString(), 80, QSize( 0, 0 ), 15 );
|
||||
}
|
||||
|
||||
void TestQgsPointCloud3DRendering::testPointCloudFilteredSceneExtent()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user