Skip to content
Permalink
Browse files

Standardise names for static variables

All non-const variables are prefixed with "s", all const
statics are ALL_CAPS
  • Loading branch information
nyalldawson committed Jan 14, 2017
1 parent 231f6af commit b5480633e40684c9c8b3ec4c48953849fea76f02
Showing with 1,307 additions and 1,304 deletions.
  1. +30 −0 doc/api_break.dox
  2. +2 −2 python/core/__init__.py
  3. +5 −5 python/core/qgis.sip
  4. +1 −1 python/core/qgsdataitem.sip
  5. +1 −1 python/core/qgsfeaturerequest.sip
  6. +1 −1 python/core/symbology-ng/qgscolorbrewerpalette.sip
  7. +2 −2 python/core/symbology-ng/qgsgraduatedsymbolrenderer.sip
  8. +1 −1 python/gui/attributetable/qgsfeaturelistviewdelegate.sip
  9. +2 −2 python/gui/qgsexpressionbuilderwidget.sip
  10. +4 −4 python/sip_helpers/qgissiphelper.cpp
  11. +3 −3 scripts/process_contexthelp.py
  12. +4 −4 scripts/process_function_template.py
  13. +2 −2 src/analysis/interpolation/DualEdgeTriangulation.cc
  14. +5 −5 src/analysis/interpolation/DualEdgeTriangulation.h
  15. +3 −3 src/analysis/interpolation/NormVecDecorator.h
  16. +13 −13 src/app/main.cpp
  17. +5 −5 src/app/nodetool/qgsnodeeditor.cpp
  18. +1 −1 src/app/nodetool/qgsselectedfeature.h
  19. +33 −33 src/app/qgisapp.cpp
  20. +2 −2 src/app/qgisapp.h
  21. +7 −7 src/app/qgscustomization.cpp
  22. +2 −2 src/app/qgscustomization.h
  23. +2 −2 src/app/qgsmergeattributesdialog.cpp
  24. +1 −1 src/app/qgsmergeattributesdialog.h
  25. +2 −2 src/app/qgsoptions.h
  26. +4 −4 src/app/qgspluginregistry.cpp
  27. +1 −1 src/app/qgspluginregistry.h
  28. +9 −9 src/app/qgsstatisticalsummarydockwidget.cpp
  29. +3 −3 src/app/qgsstatisticalsummarydockwidget.h
  30. +6 −6 src/auth/basic/qgsauthbasicmethod.cpp
  31. +1 −1 src/auth/basic/qgsauthbasicmethod.h
  32. +8 −8 src/auth/identcert/qgsauthidentcertmethod.cpp
  33. +1 −1 src/auth/identcert/qgsauthidentcertmethod.h
  34. +8 −8 src/auth/pkipaths/qgsauthpkipathsmethod.cpp
  35. +1 −1 src/auth/pkipaths/qgsauthpkipathsmethod.h
  36. +8 −8 src/auth/pkipkcs12/qgsauthpkcs12method.cpp
  37. +1 −1 src/auth/pkipkcs12/qgsauthpkcs12method.h
  38. +14 −14 src/core/auth/qgsauthconfig.cpp
  39. +5 −5 src/core/auth/qgsauthconfig.h
  40. +14 −14 src/core/auth/qgsauthmanager.cpp
  41. +20 −20 src/core/auth/qgsauthmanager.h
  42. +2 −9 src/core/composer/qgscomposermodel.cpp
  43. +6 −6 src/core/dxf/qgsdxfexport.cpp
  44. +1 −1 src/core/dxf/qgsdxfexport.h
  45. +6 −6 src/core/fieldformatter/qgsdatetimefieldformatter.cpp
  46. +3 −3 src/core/fieldformatter/qgsdatetimefieldformatter.h
  47. +2 −2 src/core/fieldformatter/qgsvaluemapfieldformatter.cpp
  48. +1 −1 src/core/fieldformatter/qgsvaluemapfieldformatter.h
  49. +1 −1 src/core/geometry/qgsgeos.h
  50. +5 −5 src/core/geometry/qgswkbtypes.cpp
  51. +1 −1 src/core/geometry/qgswkbtypes.h
  52. +7 −7 src/core/gps/parse.c
  53. +3 −3 src/core/layertree/qgslayertreemodellegendnode.cpp
  54. +1 −1 src/core/layertree/qgslayertreemodellegendnode.h
  55. +5 −5 src/core/qgis.cpp
  56. +5 −9 src/core/qgis.h
  57. +1 −1 src/core/qgsconnectionpool.h
  58. +7 −7 src/core/qgscontexthelp.cpp
  59. +2 −2 src/core/qgscontexthelp.h
  60. +96 −96 src/core/qgscoordinatereferencesystem.cpp
  61. +12 −12 src/core/qgscoordinatereferencesystem.h
  62. +5 −5 src/core/qgscredentials.cpp
  63. +1 −1 src/core/qgscredentials.h
  64. +2 −2 src/core/qgscrscache.cpp
  65. +27 −27 src/core/qgsdataitem.cpp
  66. +3 −3 src/core/qgsdataitem.h
  67. +106 −106 src/core/qgsexpression.cpp
  68. +8 −8 src/core/qgsexpression.h
  69. +3 −3 src/core/qgsfeaturerequest.cpp
  70. +1 −1 src/core/qgsfeaturerequest.h
  71. +8 −8 src/core/qgsnetworkaccessmanager.cpp
  72. +1 −1 src/core/qgsnetworkaccessmanager.h
  73. +30 −30 src/core/qgsnetworkdiskcache.cpp
  74. +2 −2 src/core/qgsnetworkdiskcache.h
  75. +10 −10 src/core/qgsogcutils.cpp
  76. +1 −1 src/core/qgspallabeling.cpp
  77. +1 −1 src/core/qgspallabeling.h
  78. +11 −11 src/core/qgsproject.cpp
  79. +8 −8 src/core/qgspythonrunner.cpp
  80. +1 −1 src/core/qgspythonrunner.h
  81. +5 −5 src/core/qgsscalecalculator.cpp
  82. +7 −7 src/core/qgsslconnect.cpp
  83. +1 −1 src/core/qgsslconnect.h
  84. +2 −2 src/core/qgssqliteexpressioncompiler.cpp
  85. +11 −11 src/core/qgssqlstatement.cpp
  86. +3 −3 src/core/qgssqlstatement.h
  87. +5 −5 src/core/qgsvectordataprovider.cpp
  88. +1 −1 src/core/qgsvectordataprovider.h
  89. +4 −4 src/core/raster/qgsrasterblock.cpp
  90. +1 −1 src/core/raster/qgsrasterblock.h
  91. +0 −3 src/core/raster/qgsrasterdataprovider.h
  92. +1 −1 src/core/symbology-ng/qgscolorbrewerpalette.cpp
  93. +4 −4 src/core/symbology-ng/qgscolorbrewerpalette.h
  94. +18 −18 src/core/symbology-ng/qgscptcityarchive.cpp
  95. +3 −3 src/core/symbology-ng/qgscptcityarchive.h
  96. +6 −6 src/core/symbology-ng/qgsfillsymbollayer.cpp
  97. +3 −3 src/core/symbology-ng/qgsgraduatedsymbolrenderer.cpp
  98. +2 −2 src/core/symbology-ng/qgsgraduatedsymbolrenderer.h
  99. +1 −1 src/core/symbology-ng/qgslinesymbollayer.cpp
  100. +1 −1 src/core/symbology-ng/qgsmarkersymbollayer.cpp
  101. +1 −1 src/core/symbology-ng/qgsmarkersymbollayer.h
  102. +8 −8 src/core/symbology-ng/qgsstyle.cpp
  103. +1 −1 src/core/symbology-ng/qgsstyle.h
  104. +2 −2 src/core/symbology-ng/qgssvgcache.cpp
  105. +2 −2 src/core/symbology-ng/qgssvgcache.h
  106. +6 −3 src/core/symbology-ng/qgssymbollayer.h
  107. +10 −10 src/gui/attributetable/qgsfeaturelistviewdelegate.cpp
  108. +1 −1 src/gui/attributetable/qgsfeaturelistviewdelegate.h
  109. +6 −6 src/gui/editorwidgets/qgsdatetimeeditconfig.cpp
  110. +5 −5 src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp
  111. +1 −1 src/gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.cpp
  112. +2 −2 src/gui/editorwidgets/qgsvaluemapwidgetwrapper.cpp
  113. +2 −2 src/gui/effects/qgseffectstackpropertieswidget.cpp
  114. +2 −2 src/gui/qgsadvanceddigitizingdockwidget.cpp
  115. +2 −2 src/gui/qgsadvanceddigitizingdockwidget.h
  116. +4 −4 src/gui/qgscolorbutton.cpp
  117. +4 −4 src/gui/qgscolorschemelist.cpp
  118. +4 −4 src/gui/qgscolorswatchgrid.cpp
  119. +4 −4 src/gui/qgscolorwidgets.cpp
  120. +5 −5 src/gui/qgscomposerruler.cpp
  121. +2 −2 src/gui/qgscomposerruler.h
  122. +6 −6 src/gui/qgsexpressionbuilderwidget.cpp
  123. +4 −4 src/gui/qgsexpressionbuilderwidget.h
  124. +4 −4 src/gui/qgsgradientstopeditor.cpp
  125. +4 −4 src/gui/qgsmaplayeractionregistry.cpp
  126. +1 −1 src/gui/qgsmaplayeractionregistry.h
  127. +18 −18 src/gui/qgsrasterformatsaveoptionswidget.cpp
  128. +1 −1 src/gui/qgsrasterformatsaveoptionswidget.h
  129. +4 −4 src/gui/qgsshortcutsmanager.cpp
  130. +1 −1 src/gui/qgsshortcutsmanager.h
  131. +2 −2 src/gui/symbology-ng/qgsgraduatedsymbolrendererwidget.cpp
  132. +2 −2 src/gui/symbology-ng/qgssymbolselectordialog.cpp
  133. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrycheck.cpp
  134. +2 −2 src/plugins/geometry_checker/qgsgeometrycheckfactory.h
  135. +1 −1 src/plugins/geometry_checker/utils/qgsfeaturepool.cpp
  136. +1 −1 src/plugins/geometry_checker/utils/qgsfeaturepool.h
  137. +1 −1 src/plugins/grass/qgsgrassplugin.cpp
  138. +31 −31 src/plugins/grass/qgsgrassselect.cpp
  139. +7 −7 src/plugins/grass/qgsgrassselect.h
  140. +3 −3 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  141. +5 −5 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  142. +2 −2 src/providers/delimitedtext/qgsdelimitedtextprovider.h
  143. +2 −2 src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
  144. +15 −15 src/providers/gdal/qgsgdaldataitems.cpp
  145. +4 −4 src/providers/gpx/qgsgpxprovider.cpp
  146. +2 −2 src/providers/gpx/qgsgpxprovider.h
  147. +8 −8 src/providers/grass/qgis.v.in.cpp
  148. +79 −79 src/providers/grass/qgsgrass.cpp
  149. +12 −12 src/providers/grass/qgsgrass.h
  150. +2 −2 src/providers/grass/qgsgrassprovider.cpp
  151. +1 −1 src/providers/grass/qgsgrassprovider.h
  152. +9 −21 src/providers/grass/qgsgrassprovidermodule.cpp
  153. +2 −2 src/providers/grass/qgsgrassprovidermodule.h
  154. +5 −5 src/providers/grass/qgsgrassvectormap.cpp
  155. +2 −2 src/providers/grass/qgsgrassvectormap.h
  156. +5 −5 src/providers/ogr/qgsogrconnpool.cpp
  157. +1 −1 src/providers/ogr/qgsogrconnpool.h
  158. +134 −134 src/providers/ogr/qgsogrprovider.cpp
  159. +2 −2 src/providers/postgres/qgspostgresconn.cpp
  160. +1 −1 src/providers/postgres/qgspostgresconn.h
  161. +2 −2 src/providers/postgres/qgspostgresexpressioncompiler.cpp
  162. +2 −2 src/providers/postgres/qgspostgresfeatureiterator.cpp
  163. +1 −1 src/providers/postgres/qgspostgresfeatureiterator.h
  164. +3 −3 src/providers/postgres/qgspostgresprovider.h
  165. +9 −9 src/providers/spatialite/qgsspatialiteconnection.cpp
  166. +1 −1 src/providers/spatialite/qgsspatialiteconnection.h
  167. +4 −4 src/providers/virtual/qgsvirtuallayerblob.cpp
  168. +1 −1 src/providers/virtual/qgsvirtuallayerblob.h
  169. +4 −4 src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
  170. +0 −4 src/providers/wcs/qgswcsdataitems.cpp
  171. +6 −6 src/providers/wfs/qgswfsshareddata.cpp
  172. +12 −12 src/providers/wfs/qgswfsutils.cpp
  173. +2 −2 src/providers/wfs/qgswfsutils.h
  174. +4 −4 src/server/qgsconfigcache.cpp
  175. +4 −4 src/server/qgsmslayercache.cpp
  176. +4 −4 src/server/qgsserverlogger.cpp
  177. +1 −1 src/server/qgsserverlogger.h
  178. +2 −2 src/server/services/DummyService/dummy.cpp
  179. +2 −2 src/server/services/wms/qgswms.cpp
  180. +4 −4 tests/bench/main.cpp
  181. +9 −9 tests/src/core/testqgsauthconfig.cpp
  182. +29 −29 tests/src/core/testqgsauthcrypto.cpp
  183. +18 −18 tests/src/core/testqgscoordinatereferencesystem.cpp
  184. +3 −3 tests/src/core/testqgsexpression.cpp
  185. +2 −2 tests/src/core/testqgslegendrenderer.cpp
  186. +1 −1 tests/src/python/test_qgsexpression.py
  187. +2 −2 tests/src/python/test_qgsgraduatedsymbolrenderer.py
@@ -475,6 +475,11 @@ QgsColorBrewerColorRampDialog {#qgis_api_break_3_0_QgsColorBrewerColorRam
and the new ramp can be retrieved after executing the dialog by calling ramp().
- Some internal methods which were previously public or protected were made private.

QgsColorBrewerPalette {#qgis_api_break_3_0_QgsColorBrewerPalette}
---------------------

- brewerString was renamed to BREWER_STRING

QgsColorButton {#qgis_api_break_3_0_QgsColorButton}
--------------

@@ -902,6 +907,11 @@ QgsExpression::Function {#qgis_api_break_3_0_QgsExpression_Function}
- `QStringList QgsExpression::Function::referencedColumns()` has been changed to `QSet<QString> QgsExpression::Function::referencedColumns( const NodeFunction* node )`
- `QgsExpression::Function::helptext()` has been renamed to `helpText()`

QgsExpressionItem {#qgis_api_break_3_0_QgsExpressionItem}
-----------------

- CustomSortRole was renamed to CUSTOM_SORT_ROLE
- ItemTypeRole was renamed to ITEM_TYPE_ROLE

QgsExpressionContextUtils {#qgis_api_break_3_0_QgsExpressionContextUtils}
-------------------------
@@ -924,6 +934,11 @@ None will need to be modified, as the method will return an empty geometry if th
- fields() no longer returns a pointer, but instead a QgsFields value.
- The duplicate method setFeatureId() was removed. Use setId() instead.

QgsFeatureListViewDelegate {#qgis_api_break_3_0_QgsFeatureListViewDelegate}
--------------------------

- sIconSize was rename to ICON_SIZE


QgsFeatureRendererV2 {#qgis_api_break_3_0_QgsFeatureRendererV2}
--------------------
@@ -940,6 +955,10 @@ QgsFeatureRendererV2 {#qgis_api_break_3_0_QgsFeatureRendererV2}
- originalSymbolsForFeature( QgsFeature& feat ) has been removed. The originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as originalSymbolsForFeature2 in PyQGIS bindings).
- copyPaintEffect() was removed. copyRendererData() should be used instead.

QgsFeatureRequest {#qgis_api_break_3_0_QgsFeatureRequest}
-----------------

- AllAttributes was renamed to ALL_ATTRIBUTES

QgsFieldCombobox {#qgis_api_break_3_0_QgsFieldCombobox}
----------------
@@ -1512,6 +1531,12 @@ QgsRenderContext {#qgis_api_break_3_0_QgsRenderContext}
be returned instead of a null pointer if no transformation is required.
- setCoordinateTransform() now takes a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should be used instead of a null pointer if no transformation is required.

QgsRendererRangeLabelFormat {#qgis_api_break_3_0_QgsRendererRangeLabelFormat}
---------------------------

- MaxPrecision was renamed to MAX_PRECISION
- MinPrecision was renamed to MIN_PRECISION


QgsRendererRegistry {#qgis_api_break_3_0_QgsRendererRegistry}
----------------------
@@ -1830,6 +1855,11 @@ QgsWMSLegendNode {#qgis_api_break_3_0_QgsWMSLegendNode}

- QgsWMSLegendNode has been renamed to QgsWmsLegendNode

QgsZipItem {#qgis_api_break_3_0_QgsZipItem}
----------

- mProviderNames was rename to sProviderNames


QgsRenderer {#qgis_api_break_3_0_QgsRenderer}
-----------
@@ -42,7 +42,7 @@ def _geometryNonZero(self):
QgsGeometry.__bool__ = _geometryNonZero


def register_function(function, arg_count, group, usesgeometry=False, referenced_columns=[QgsFeatureRequest.AllAttributes], **kwargs):
def register_function(function, arg_count, group, usesgeometry=False, referenced_columns=[QgsFeatureRequest.ALL_ATTRIBUTES], **kwargs):
"""
Register a Python function to be used as a expression function.
@@ -71,7 +71,7 @@ def myfunc(values, *args):
"""
class QgsExpressionFunction(QgsExpression.Function):

def __init__(self, func, name, args, group, helptext='', usesGeometry=True, referencedColumns=QgsFeatureRequest.AllAttributes, expandargs=False):
def __init__(self, func, name, args, group, helptext='', usesGeometry=True, referencedColumns=QgsFeatureRequest.ALL_ATTRIBUTES, expandargs=False):
QgsExpression.Function.__init__(self, name, args, group, helptext)
self.function = func
self.expandargs = expandargs
@@ -31,11 +31,11 @@ class Qgis
// Version constants
//
// Version string
static QString QGIS_VERSION;
static const QString QGIS_VERSION;
// Version number used for comparing versions using the "Check QGIS Version" function
static const int QGIS_VERSION_INT;
// Release name
static QString QGIS_RELEASE_NAME;
static const QString QGIS_RELEASE_NAME;
// The development version
static const char* QGIS_DEV_VERSION;

@@ -91,17 +91,17 @@ class Qgis

/** Default highlight buffer in mm.
* @note added in 2.3 */
static double DEFAULT_HIGHLIGHT_BUFFER_MM;
static const double DEFAULT_HIGHLIGHT_BUFFER_MM;

/** Default highlight line/outline minimum width in mm.
* @note added in 2.3 */
static double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;
static const double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM;

/** Fudge factor used to compare two scales. The code is often going from scale to scale
* denominator. So it looses precision and, when a limit is inclusive, can lead to errors.
* To avoid that, use this factor instead of using <= or >=.
* @note added in 2.15*/
static double SCALE_PRECISION;
static const double SCALE_PRECISION;
};

/** Converts a string to a double in a permissive way, e.g., allowing for incorrect
@@ -496,7 +496,7 @@ class QgsZipItem : QgsDataCollectionItem

//! @note not available via python bindings
// static QVector<dataItem_t *> mDataItemPtr;
static QStringList mProviderNames;
static QStringList sProviderNames;

static QString vsiPrefix( const QString& uri );

@@ -155,7 +155,7 @@ class QgsFeatureRequest
/**
* A special attribute that if set matches all attributes
*/
static const QString AllAttributes;
static const QString ALL_ATTRIBUTES;

//! construct a default request: for all features get attributes and geometries
QgsFeatureRequest();
@@ -11,5 +11,5 @@ class QgsColorBrewerPalette
static QList<int> listSchemeVariants( const QString& schemeName );

// extracted ColorBrewer data
static const char *brewerString;
static const char * BREWER_STRING;
};
@@ -76,8 +76,8 @@ class QgsRendererRangeLabelFormat
void setFromDomElement( QDomElement &element );
void saveToDomElement( QDomElement &element );

static const int MaxPrecision;
static const int MinPrecision;
static const int MAX_PRECISION;
static const int MIN_PRECISION;

};

@@ -4,7 +4,7 @@ class QgsFeatureListViewDelegate : QItemDelegate
#include <qgsfeaturelistviewdelegate.h>
%End
public:
static const int sIconSize;
static const int ICON_SIZE;

enum Element
{
@@ -43,9 +43,9 @@ class QgsExpressionItem : QStandardItem
QgsExpressionItem::ItemType getItemType() const;

//! Custom sort order role
static const int CustomSortRole;
static const int CUSTOM_SORT_ROLE;
//! Item type role
static const int ItemTypeRole;
static const int ITEM_TYPE_ROLE;
};

/** Search proxy used to filter the QgsExpressionBuilderWidget tree.
@@ -24,9 +24,9 @@

bool null_from_qvariant_converter( const QVariant *varp, PyObject **objp )
{
static bool watchdog = false;
static bool sWatchDog = false;

if ( watchdog )
if ( sWatchDog )
return false;

// If we deal with a NULL QVariant (and it's not a QByteArray which properly
@@ -35,10 +35,10 @@ bool null_from_qvariant_converter( const QVariant *varp, PyObject **objp )
// instead of a blacklist.
if ( varp->isNull() && varp->type() != QVariant::ByteArray )
{
watchdog = true;
sWatchDog = true;
PyObject* vartype = sipConvertFromEnum( varp->type(), sipType_QVariant_Type );
*objp = PyObject_Call(( PyObject * )sipTypeAsPyTypeObject( sipType_QVariant ), PyTuple_Pack( 1, vartype ), nullptr );
watchdog = false;
sWatchDog = false;
return true;
}
else
@@ -6,11 +6,11 @@
cpp.write(
"#include \"qgscontexthelp.h\"\n"
"#include <QCoreApplication>\n\n"
"QHash<QString, QString> QgsContextHelp::gContextHelpTexts;\n"
"QHash<QString, QString> QgsContextHelp::sContextHelpTexts;\n"
"\n"
"void QgsContextHelp::init()\n"
"{\n"
" if( !gContextHelpTexts.isEmpty() )\n"
" if( !sContextHelpTexts.isEmpty() )\n"
" return;\n"
)

@@ -20,7 +20,7 @@
# Protect from IOError: [Errno 21] Is a directory
continue
with open(f) as content:
cpp.write("\n gContextHelpTexts.insert( \"{0}\", QCoreApplication::translate( \"context_help\", \"{1}\") );".format(
cpp.write("\n sContextHelpTexts.insert( \"{0}\", QCoreApplication::translate( \"context_help\", \"{1}\") );".format(
n, content.read().replace("\\", "&#92;").replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n\"')))

cpp.write("\n}\n")
@@ -14,11 +14,11 @@
cpp.write(
"#include \"qgsexpression.h\"\n"
"\n"
"QHash<QString, QgsExpression::Help> QgsExpression::gFunctionHelpTexts;\n"
"QHash<QString, QgsExpression::Help> QgsExpression::sFunctionHelpTexts;\n"
"\n"
"void QgsExpression::initFunctionHelp()\n"
"{\n"
" if( !gFunctionHelpTexts.isEmpty() )\n"
" if( !sFunctionHelpTexts.isEmpty() )\n"
" return;"
)

@@ -76,7 +76,7 @@ def quote(v):
if len(list(v['arguments'])) < 1 or len(list(v['arguments'])) > 2:
raise BaseException("%s: 1 or 2 arguments expected for operator")

cpp.write("\n\n gFunctionHelpTexts.insert( {0},\n Help( {0}, tr( \"{1}\" ), tr( \"{2}\" ),\n QList<HelpVariant>()".format(
cpp.write("\n\n sFunctionHelpTexts.insert( {0},\n Help( {0}, tr( \"{1}\" ), tr( \"{2}\" ),\n QList<HelpVariant>()".format(
name, json_params['type'], json_params['description'])
)

@@ -119,7 +119,7 @@ def quote(v):
n = os.path.basename(f)

with open(f) as content:
cpp.write("\n\n gFunctionHelpTexts.insert( \"{0}\",\n Help( tr( \"{0}\" ), tr( \"group\" ), tr( \"{1}\" ), QList<HelpVariant>() ) );\n".format(
cpp.write("\n\n sFunctionHelpTexts.insert( \"{0}\",\n Help( tr( \"{0}\" ), tr( \"group\" ), tr( \"{1}\" ), QList<HelpVariant>() ) );\n".format(
n, content.read().replace("\\", "&#92;").replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n')))

cpp.write("\n}\n")
@@ -487,7 +487,7 @@ int DualEdgeTriangulation::baseEdgeOfTriangle( Point3D* point )

while ( true )
{
if ( runs > sNumBaseOfRuns )//prevents endless loops
if ( runs > MAX_BASE_ITERATIONS )//prevents endless loops
{
// QgsDebugMsg("warning, probable endless loop detected");
return -100;
@@ -2606,7 +2606,7 @@ bool DualEdgeTriangulation::pointInside( double x, double y )

while ( true )
{
if ( runs > sNumBaseOfRuns )//prevents endless loops
if ( runs > MAX_BASE_ITERATIONS )//prevents endless loops
{
QgsDebugMsg( QString( "warning, instability detected: Point coordinates: %1//%2" ).arg( x ).arg( y ) );
return false;
@@ -114,11 +114,11 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
//! Y-coordinate of the lower left corner of the bounding box
double yMin;
//! Default value for the number of storable points at the beginning
const static unsigned int mDefaultStorageForPoints = 100000;
static const unsigned int DEFAULT_STORAGE_FOR_POINTS = 100000;
//! Stores pointers to all points in the triangulations (including the points contained in the lines)
QVector<Point3D*> mPointVector;
//! Default value for the number of storable HalfEdges at the beginning
const static unsigned int mDefaultStorageForHalfEdges = 300006;
static const unsigned int DEFAULT_STORAGE_FOR_HALF_EDGES = 300006;
//! Stores pointers to the HalfEdges
QVector<HalfEdge*> mHalfEdge;
//! Association to an interpolator object
@@ -140,7 +140,7 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
//! Threshold for the leftOfTest to handle numerical instabilities
//const static double leftOfTresh=0.00001;
//! Security to prevent endless loops in 'baseEdgeOfTriangle'. It there are more iteration then this number, the point will not be inserted
const static int sNumBaseOfRuns = 300000;
static const int MAX_BASE_ITERATIONS = 300000;
//! Returns the number of an edge which points to the point with number 'point' or -1 if there is an error
int baseEdgeOfPoint( int point );
//! Returns the number of a HalfEdge from a triangle in which 'point' is in. If the number -10 is returned, this means, that 'point' is outside the convex hull. If -5 is returned, then numerical problems with the leftOfTest occurred (and the value of the possible edge is stored in the variable 'mUnstableEdge'. -20 means, that the inserted point is exactly on an edge (the number is stored in the variable 'mEdgeWithPoint'). -25 means, that the point is already in the triangulation (the number of the point is stored in the member 'mTwiceInsPoint'. If -100 is returned, this means that something else went wrong
@@ -194,8 +194,8 @@ inline DualEdgeTriangulation::DualEdgeTriangulation()
, mUnstableEdge( 0 )
, mTwiceInsPoint( 0 )
{
mPointVector.reserve( mDefaultStorageForPoints );
mHalfEdge.reserve( mDefaultStorageForHalfEdges );
mPointVector.reserve( DEFAULT_STORAGE_FOR_POINTS );
mHalfEdge.reserve( DEFAULT_STORAGE_FOR_HALF_EDGES );
}

inline DualEdgeTriangulation::DualEdgeTriangulation( int nop, Triangulation* decorator )
@@ -72,7 +72,7 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
protected:
//! Is true, if the normals already have been estimated
bool alreadyestimated;
const static unsigned int mDefaultStorageForNormals = 100000;
static const unsigned int DEFAULT_STORAGE_FOR_NORMALS = 100000;
//! Association with an interpolator object
TriangleInterpolator* mInterpolator;
//! Vector that stores the normals for the points. If 'estimateFirstDerivatives()' was called and there is a null pointer, this means, that the triangle point is on a breakline
@@ -83,12 +83,12 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
void setState( int pointno, PointState s );
};

inline NormVecDecorator::NormVecDecorator(): TriDecorator(), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<PointState>( mDefaultStorageForNormals ) )
inline NormVecDecorator::NormVecDecorator(): TriDecorator(), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) ), mPointState( new QVector<PointState>( DEFAULT_STORAGE_FOR_NORMALS ) )
{
alreadyestimated = false;
}

inline NormVecDecorator::NormVecDecorator( Triangulation* tin ): TriDecorator( tin ), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<PointState>( mDefaultStorageForNormals ) )
inline NormVecDecorator::NormVecDecorator( Triangulation* tin ): TriDecorator( tin ), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) ), mPointState( new QVector<PointState>( DEFAULT_STORAGE_FOR_NORMALS ) )
{
alreadyestimated = false;
}

0 comments on commit b548063

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