Navigation Menu

Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Sep 13, 2018
1 parent 2085dfa commit e22939e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/3d/qgs3dmapscene.h
Expand Up @@ -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 );
Expand Down
17 changes: 16 additions & 1 deletion src/3d/qgs3dmapscenepickhandler.h
@@ -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

Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgstessellatedpolygongeometry.cpp
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgstessellatedpolygongeometry.h
Expand Up @@ -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:

Expand Down
5 changes: 2 additions & 3 deletions src/app/3d/qgs3dmaptoolidentify.cpp
Expand Up @@ -60,9 +60,8 @@ Qgs3DMapToolIdentify::Qgs3DMapToolIdentify( Qgs3DMapCanvas *canvas )
mPickHandler.reset( new Qgs3DMapToolIdentifyPickHandler( this ) );
}

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


void Qgs3DMapToolIdentify::mousePressEvent( QMouseEvent *event )
{
Expand Down

0 comments on commit e22939e

Please sign in to comment.