Skip to content
Permalink
Browse files

Fixes after review

  • Loading branch information
wonder-sk committed Sep 13, 2018
1 parent 2085dfa commit e22939edb3736c07bab0a00379eb7e328415dd0b
@@ -78,7 +78,7 @@ class _3D_EXPORT Qgs3DMapScene : public Qt3DCore::QEntity
//! Returns the current state of the scene
SceneState sceneState() const { return mSceneState; }

//! Registers an object that will get results of pick events on 3D entities. Does not take ownerhip of the pick handler. Adds object picker components to 3D entities.
//! Registers an object that will get results of pick events on 3D entities. Does not take ownership of the pick handler. Adds object picker components to 3D entities.
void registerPickHandler( Qgs3DMapScenePickHandler *pickHandler );
//! Unregisters previously registered pick handler. Pick handler is not deleted. Also removes object picker components from 3D entities.
void unregisterPickHandler( Qgs3DMapScenePickHandler *pickHandler );
@@ -1,3 +1,18 @@
/***************************************************************************
qgs3dmapscenepickhandler.h
--------------------------------------
Date : Sep 2018
Copyright : (C) 2018 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGS3DMAPSCENEPICKHANDLER_H
#define QGS3DMAPSCENEPICKHANDLER_H

@@ -19,7 +34,7 @@ class QgsVectorLayer;
class Qgs3DMapScenePickHandler
{
public:
virtual ~Qgs3DMapScenePickHandler() {}
virtual ~Qgs3DMapScenePickHandler() = default;

//! Called when user clicked a 3D entity belonging to a feature of a vector layer
virtual void handlePickOnVectorLayer( QgsVectorLayer *vlayer, QgsFeatureId id, const QVector3D &worldIntersection ) = 0;
@@ -114,7 +114,7 @@ static int binary_search( uint v, const uint *data, int count )
}


QgsFeatureId QgsTessellatedPolygonGeometry::triangleIndexToFeatureId( uint triangleIndex )
QgsFeatureId QgsTessellatedPolygonGeometry::triangleIndexToFeatureId( uint triangleIndex ) const
{
int i = binary_search( triangleIndex, mTriangleIndexStartingIndices.constData(), mTriangleIndexStartingIndices.count() );
Q_ASSERT( i != -1 );
@@ -63,7 +63,7 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
void setPolygons( const QList<QgsPolygon *> &polygons, const QList<QgsFeatureId> &featureIds, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon = QList<float>() );

//! Returns ID of the feature to which given triangle index belongs (used for picking)
QgsFeatureId triangleIndexToFeatureId( uint triangleIndex );
QgsFeatureId triangleIndexToFeatureId( uint triangleIndex ) const;

private:

@@ -60,9 +60,8 @@ Qgs3DMapToolIdentify::Qgs3DMapToolIdentify( Qgs3DMapCanvas *canvas )
mPickHandler.reset( new Qgs3DMapToolIdentifyPickHandler( this ) );
}

Qgs3DMapToolIdentify::~Qgs3DMapToolIdentify()
{
}
Qgs3DMapToolIdentify::~Qgs3DMapToolIdentify() = default;


void Qgs3DMapToolIdentify::mousePressEvent( QMouseEvent *event )
{

0 comments on commit e22939e

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