LCOV - code coverage report
Current view: top level - core/pointcloud - qgspointcloudlayerelevationproperties.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 0 2 0.0 %
Date: 2021-04-10 08:29:14 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /***************************************************************************
       2                 :            :                          qgspointcloudlayerelevationproperties.h
       3                 :            :                          ---------------
       4                 :            :     begin                : November 2020
       5                 :            :     copyright            : (C) 2020 by Nyall Dawson
       6                 :            :     email                : nyall dot dawson dot com
       7                 :            :  ***************************************************************************/
       8                 :            : 
       9                 :            : /***************************************************************************
      10                 :            :  *                                                                         *
      11                 :            :  *   This program is free software; you can redistribute it and/or modify  *
      12                 :            :  *   it under the terms of the GNU General Public License as published by  *
      13                 :            :  *   the Free Software Foundation; either version 2 of the License, or     *
      14                 :            :  *   (at your option) any later version.                                   *
      15                 :            :  *                                                                         *
      16                 :            :  ***************************************************************************/
      17                 :            : 
      18                 :            : 
      19                 :            : #ifndef QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
      20                 :            : #define QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H
      21                 :            : 
      22                 :            : #include "qgis_core.h"
      23                 :            : #include "qgis_sip.h"
      24                 :            : #include "qgsmaplayerelevationproperties.h"
      25                 :            : 
      26                 :            : /**
      27                 :            :  * \class QgsPointCloudLayerElevationProperties
      28                 :            :  * \ingroup core
      29                 :            :  * \brief Point cloud layer specific subclass of QgsMapLayerElevationProperties.
      30                 :            :  *
      31                 :            :  * \since QGIS 3.18
      32                 :            :  */
      33                 :            : class CORE_EXPORT QgsPointCloudLayerElevationProperties : public QgsMapLayerElevationProperties
      34                 :            : {
      35                 :            : 
      36                 :            :     Q_OBJECT
      37                 :            : 
      38                 :            :   public:
      39                 :            : 
      40                 :            :     /**
      41                 :            :      * Constructor for QgsPointCloudLayerElevationProperties, with the specified \a parent object.
      42                 :            :      */
      43                 :            :     QgsPointCloudLayerElevationProperties( QObject *parent SIP_TRANSFERTHIS );
      44                 :            : 
      45                 :            :     bool hasElevation() const override;
      46                 :            :     QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
      47                 :            :     bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
      48                 :            :     bool isVisibleInZRange( const QgsDoubleRange &range ) const override;
      49                 :            :     QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
      50                 :            : 
      51                 :            :     /**
      52                 :            :      * Returns the z offset, which is a fixed offset amount which should be added to z values from
      53                 :            :      * the layer.
      54                 :            :      *
      55                 :            :      * This can be used to correct or manually adjust for incorrect elevation values in a point cloud layer.
      56                 :            :      *
      57                 :            :      * \note Any scaling specified via zScale() is applied before any offset value specified via zOffset()
      58                 :            :      *
      59                 :            :      * \see setZOffset()
      60                 :            :      */
      61                 :          0 :     double zOffset() const { return mZOffset; }
      62                 :            : 
      63                 :            :     /**
      64                 :            :      * Sets the z \a offset, which is a fixed offset amount which will be added to z values from
      65                 :            :      * the layer.
      66                 :            :      *
      67                 :            :      * This can be used to correct or manually adjust for incorrect elevation values in a point cloud layer.
      68                 :            :      *
      69                 :            :      * \note Any scaling specified via zScale() is applied before any offset value specified via zOffset()
      70                 :            :      *
      71                 :            :      * \see zOffset()
      72                 :            :      */
      73                 :            :     void setZOffset( double offset ) { mZOffset = offset; }
      74                 :            : 
      75                 :            :     /**
      76                 :            :      * Returns the z scale, which is a scaling factor which should be applied to z values from
      77                 :            :      * the layer.
      78                 :            :      *
      79                 :            :      * This can be used to correct or manually adjust for incorrect elevation values in a point cloud layer, such
      80                 :            :      * as conversion of elevation values in feet to meters.
      81                 :            :      *
      82                 :            :      * \note Any scaling specified via zScale() is applied before any offset value specified via zOffset()
      83                 :            :      *
      84                 :            :      * \see setZScale()
      85                 :            :      */
      86                 :          0 :     double zScale() const { return mZScale; }
      87                 :            : 
      88                 :            :     /**
      89                 :            :      * Sets the z \a scale, which is a scaling factor which will be applied to z values from
      90                 :            :      * the layer.
      91                 :            :      *
      92                 :            :      * This can be used to correct or manually adjust for incorrect elevation values in a point cloud layer, such
      93                 :            :      * as conversion of elevation values in feet to meters.
      94                 :            :      *
      95                 :            :      * \note Any scaling specified via zScale() is applied before any offset value specified via zOffset()
      96                 :            :      *
      97                 :            :      * \see zScale()
      98                 :            :      */
      99                 :            :     void setZScale( double scale ) { mZScale = scale; }
     100                 :            : 
     101                 :            :   private:
     102                 :            : 
     103                 :            :     double mZScale = 1.0;
     104                 :            :     double mZOffset = 0.0;
     105                 :            : };
     106                 :            : 
     107                 :            : #endif // QGSPOINTCLOUDLAYERELEVATIONPROPERTIES_H

Generated by: LCOV version 1.14