-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathGlobalVars.cpp
More file actions
49 lines (44 loc) · 1.31 KB
/
GlobalVars.cpp
File metadata and controls
49 lines (44 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "stdafx.h"
#include "GlobalVars.h"
#ifdef _DEBUG
CMemLeakDetect gMemLeakDetect; // comment this line to turn off the memory leaking detection tools
#endif
GlobalSettingsInfo m_globalSettings;
ReferenceCounter gReferenceCounter;
IUtils* m_utils;
IShapefile* m_shapefile;
char* UTF8_ENCODING_MARKER = "utf8";
// *****************************************************************
// getGeosHandle
// *****************************************************************
#ifdef GEOS_NEW
GEOSContextHandle_t _geosContextHandle = NULL;
GEOSContextHandle_t getGeosHandle()
{
if (!_geosContextHandle)
_geosContextHandle = OGRGeometry::createGEOSContext();
return _geosContextHandle;
}
#endif
// *****************************************************************
// GetUtils
// *****************************************************************
IUtils* GetUtils()
{
if (!m_utils)
{
CoCreateInstance(CLSID_Utils,NULL,CLSCTX_INPROC_SERVER,IID_IUtils,(void**)&m_utils);
}
return m_utils;
}
// *****************************************************************
// GetTempShapefile
// *****************************************************************
IShapefile* GetTempShapefile()
{
if (!m_shapefile)
{
CoCreateInstance(CLSID_Shapefile,NULL,CLSCTX_INPROC_SERVER,IID_IShapefile,(void**)&m_shapefile);
}
return m_shapefile;
}