Skip to content

Commit b856027

Browse files
committed
replaced some boost snippets, to improve compile time
1 parent 9bf80de commit b856027

12 files changed

+240
-100
lines changed

IfcPlusPlus/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if(UNIX)
2929
set(IFCPP_SOURCE_FILES
3030
src/ifcpp/IFC4/EntityFactory.cpp
3131
src/ifcpp/IFC4/TypeFactory.cpp
32+
src/ifcpp/model/BuildingGuid.cpp
3233
src/ifcpp/model/BuildingModel.cpp
3334
src/ifcpp/model/UnitConverter.cpp
3435
src/ifcpp/reader/AbstractReader.cpp
@@ -44,6 +45,7 @@ else(UNIX)
4445
set(IFCPP_SOURCE_FILES
4546
src/ifcpp/IFC4/EntityFactory.cpp
4647
src/ifcpp/IFC4/TypeFactory.cpp
48+
src/ifcpp/model/BuildingGuid.cpp
4749
src/ifcpp/model/BuildingModel.cpp
4850
src/ifcpp/model/UnitConverter.cpp
4951
src/ifcpp/reader/AbstractReader.cpp

IfcPlusPlus/src/ifcpp/geometry/Carve/ConverterOSG.h

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
2929
#include <ifcpp/model/StatusCallback.h>
3030
#include <ifcpp/IFC4/include/IfcCurtainWall.h>
3131
#include <ifcpp/IFC4/include/IfcFeatureElementSubtraction.h>
32+
#include <ifcpp/IFC4/include/IfcGloballyUniqueId.h>
3233
#include <ifcpp/IFC4/include/IfcProject.h>
3334
#include <ifcpp/IFC4/include/IfcPropertySetDefinitionSet.h>
3435
#include <ifcpp/IFC4/include/IfcRelAggregates.h>

IfcPlusPlus/src/ifcpp/geometry/OCC/RepresentationConverterOCC.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
1717

1818
#pragma once
1919

20-
#include <boost/unordered/unordered_set.hpp>
20+
#include <unordered_set>
2121
#include <BRepBuilderAPI_MakeFace.hxx>
2222

2323
#include <ifcpp/geometry/GeometrySettings.h>

IfcPlusPlus/src/ifcpp/geometry/OCC/SceneGraphConverterOCC.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
1717

1818
#pragma once
1919

20-
#include <boost/unordered/unordered_set.hpp>
20+
#include <unordered_set>
2121
#include <osg/Material>
2222
#include <osg/Geode>
2323
#include <osg/CullFace>

IfcPlusPlus/src/ifcpp/geometry/StylesConverter.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
1818
#pragma once
1919

2020
#include <map>
21-
#include <boost/algorithm/string.hpp>
2221

2322
#include <ifcpp/geometry/AppearanceData.h>
2423
#include <ifcpp/model/BasicTypes.h>
2524
#include <ifcpp/model/StatusCallback.h>
25+
#include <ifcpp/reader/ReaderUtil.h>
2626
#include <ifcpp/IFC4/include/IfcSpecularHighlightSelect.h>
2727
#include <ifcpp/IFC4/include/IfcSpecularExponent.h>
2828
#include <ifcpp/IFC4/include/IfcSpecularRoughness.h>
@@ -153,14 +153,14 @@ class StylesConverter : public StatusCallback
153153
if( draughting_predefined_color->m_Name )
154154
{
155155
std::wstring predefined_name = draughting_predefined_color->m_Name->m_value;
156-
if( boost::iequals( predefined_name, L"black" ) ) color.setColor( 0.0, 0.0, 0.0, 1.0 );
157-
else if( boost::iequals( predefined_name, L"red" ) ) color.setColor( 1.0, 0.0, 0.0, 1.0 );
158-
else if( boost::iequals( predefined_name, L"green" ) ) color.setColor( 0.0, 1.0, 0.0, 1.0 );
159-
else if( boost::iequals( predefined_name, L"blue" ) ) color.setColor( 0.0, 0.0, 1.0, 1.0 );
160-
else if( boost::iequals( predefined_name, L"yellow" ) ) color.setColor( 1.0, 1.0, 0.0, 1.0 );
161-
else if( boost::iequals( predefined_name, L"magenta" ) ) color.setColor( 1.0, 0.0, 1.0, 1.0 );
162-
else if( boost::iequals( predefined_name, L"cyan" ) ) color.setColor( 0.0, 1.0, 1.0, 1.0 );
163-
else if( boost::iequals( predefined_name, L"white" ) ) color.setColor( 1.0, 1.0, 1.0, 1.0 );
156+
if( std_iequal( predefined_name, L"black" ) ) color.setColor( 0.0, 0.0, 0.0, 1.0 );
157+
else if( std_iequal( predefined_name, L"red" ) ) color.setColor( 1.0, 0.0, 0.0, 1.0 );
158+
else if( std_iequal( predefined_name, L"green" ) ) color.setColor( 0.0, 1.0, 0.0, 1.0 );
159+
else if( std_iequal( predefined_name, L"blue" ) ) color.setColor( 0.0, 0.0, 1.0, 1.0 );
160+
else if( std_iequal( predefined_name, L"yellow" ) ) color.setColor( 1.0, 1.0, 0.0, 1.0 );
161+
else if( std_iequal( predefined_name, L"magenta" ) ) color.setColor( 1.0, 0.0, 1.0, 1.0 );
162+
else if( std_iequal( predefined_name, L"cyan" ) ) color.setColor( 0.0, 1.0, 1.0, 1.0 );
163+
else if( std_iequal( predefined_name, L"white" ) ) color.setColor( 1.0, 1.0, 1.0, 1.0 );
164164
}
165165
}
166166
return;
@@ -463,7 +463,7 @@ class StylesConverter : public StatusCallback
463463
if( !complex_property->m_UsageName ) return;
464464
if( vec_HasProperties.size() < 3 ) return;
465465
std::wstring usage_name = complex_property->m_UsageName->m_value;
466-
if( !boost::iequals( usage_name.c_str(), L"Color" ) ) return;
466+
if( !std_iequal( usage_name.c_str(), L"Color" ) ) return;
467467

468468
if( complex_property->m_HasProperties.size() > 2 )
469469
{

IfcPlusPlus/src/ifcpp/model/BuildingGuid.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
2424
#include "BuildingGuid.h"
2525

2626
///@brief Creates a GUID string with 36 characters including dashes, for example: "F103000C-9865-44EE-BE6E-CCC780B81423"
27-
std::basic_string<wchar_t> createGUID32_wstr()
27+
std::wstring createGUID32_wstr()
2828
{
2929
std::basic_stringstream<wchar_t> uuid_strs;
3030
uuid_strs << std::uppercase;
@@ -33,7 +33,7 @@ std::basic_string<wchar_t> createGUID32_wstr()
3333
return uuid_strs.str();
3434
}
3535

36-
std::basic_string<char> createGUID32()
36+
std::string createGUID32()
3737
{
3838
std::basic_stringstream<char> uuid_strs;
3939
uuid_strs << std::uppercase;
@@ -63,7 +63,7 @@ static const char base64mask[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -
6363
///@brief Compresses a GUID string
6464
///@details Expects a string with exactly 36 characters including dashes, for example: "F103000C-9865-44EE-BE6E-CCC780B81423"
6565
///@returns an IFC GUID string with 22 characters, for example: "3n0m0Cc6L4xhvkpCU0k1GZ"
66-
std::basic_string<wchar_t> compressGUID_wstr(const std::basic_string<wchar_t>& in)
66+
std::wstring compressGUID_wstr(const std::wstring& in)
6767
{
6868
static constexpr std::array<wchar_t, 64> base64Chars = {
6969
'0','1','2','3','4','5','6','7','8','9',
@@ -72,8 +72,8 @@ std::basic_string<wchar_t> compressGUID_wstr(const std::basic_string<wchar_t>& i
7272
'_','$'
7373
};
7474

75-
std::basic_string<wchar_t> temp;
76-
std::basic_string<wchar_t> result;
75+
std::wstring temp;
76+
std::wstring result;
7777
result.resize(23);
7878
result[0] = '0';
7979

@@ -102,7 +102,7 @@ std::basic_string<wchar_t> compressGUID_wstr(const std::basic_string<wchar_t>& i
102102
result.resize(22);
103103
return result;
104104
}
105-
std::basic_string<char> compressGUID(const std::basic_string<char>& in)
105+
std::string compressGUID(const std::string& in)
106106
{
107107
static constexpr std::array<char, 64> base64Chars = {
108108
'0','1','2','3','4','5','6','7','8','9',
@@ -111,8 +111,8 @@ std::basic_string<char> compressGUID(const std::basic_string<char>& in)
111111
'_','$'
112112
};
113113

114-
std::basic_string<char> temp;
115-
std::basic_string<char> result;
114+
std::string temp;
115+
std::string result;
116116
result.resize(23);
117117
result[0] = '0';
118118

@@ -145,7 +145,7 @@ std::basic_string<char> compressGUID(const std::basic_string<char>& in)
145145
///@brief Decompresses an IFC GUID string
146146
///@details Expects a string with exactly 22 characters, for example "3n0m0Cc6L4xhvkpCU0k1GZ"
147147
///@returns GUID string with 36 characters, including dashes, for example: "F103000C-9865-44EE-BE6E-CCC780B81423"
148-
std::basic_string<wchar_t> decompressGUID_wstr(const std::basic_string<wchar_t>& in )
148+
std::wstring decompressGUID_wstr(const std::wstring& in )
149149
{
150150
static constexpr std::array<wchar_t, 16> base16Chars = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' };
151151

@@ -167,7 +167,7 @@ std::basic_string<wchar_t> decompressGUID_wstr(const std::basic_string<wchar_t>&
167167
temp[ii_out] = '\0';
168168

169169
// add dashes: F103000C-9865-44EE-BE6E-CCC780B81423
170-
std::basic_string<wchar_t> result;
170+
std::wstring result;
171171
for (size_t ii = 1; ii < 36; ++ii)
172172
{
173173
if (ii == 9 || ii == 13 || ii == 17 || ii == 21)
@@ -181,7 +181,7 @@ std::basic_string<wchar_t> decompressGUID_wstr(const std::basic_string<wchar_t>&
181181
result.resize(36);
182182
return result;
183183
}
184-
std::basic_string<char> decompressGUID(const std::basic_string<char>& in)
184+
std::string decompressGUID(const std::string& in)
185185
{
186186
static constexpr std::array<char, 16> base16Chars = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' };
187187

@@ -203,7 +203,7 @@ std::basic_string<char> decompressGUID(const std::basic_string<char>& in)
203203
temp[ii_out] = '\0';
204204

205205
// add dashes: F103000C-9865-44EE-BE6E-CCC780B81423
206-
std::basic_string<char> result;
206+
std::string result;
207207
for (size_t ii = 1; ii < 36; ++ii)
208208
{
209209
if (ii == 9 || ii == 13 || ii == 17 || ii == 21)
@@ -222,15 +222,15 @@ std::basic_string<char> decompressGUID(const std::basic_string<char>& in)
222222
///@details Use desired character type as template parameter - char or wchar_t.
223223
///IFC uses a different base64 character set than RFC4648 - it starts with digits
224224
///instead of uppercase letters and uses '_' and '$' as last two characters.
225-
std::basic_string<wchar_t> createBase64Uuid_wstr()
225+
std::wstring createBase64Uuid_wstr()
226226
{
227-
std::basic_string<wchar_t> guid_uncompressed = createGUID32_wstr();
228-
std::basic_string<wchar_t> guid_compressed = compressGUID_wstr(guid_uncompressed);
227+
std::wstring guid_uncompressed = createGUID32_wstr();
228+
std::wstring guid_compressed = compressGUID_wstr(guid_uncompressed);
229229
return guid_compressed;
230230
}
231-
std::basic_string<char> createBase64Uuid()
231+
std::string createBase64Uuid()
232232
{
233-
std::basic_string<char> guid_uncompressed = createGUID32();
234-
std::basic_string<char> guid_compressed = compressGUID(guid_uncompressed);
233+
std::string guid_uncompressed = createGUID32();
234+
std::string guid_compressed = compressGUID(guid_uncompressed);
235235
return guid_compressed;
236236
}

IfcPlusPlus/src/ifcpp/model/BuildingGuid.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,26 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
2121
#include "GlobalDefines.h"
2222

2323
///@brief Creates a GUID string with 36 characters including dashes, for example: "F103000C-9865-44EE-BE6E-CCC780B81423"
24-
IFCQUERY_EXPORT std::basic_string<wchar_t> createGUID32_wstr();
25-
IFCQUERY_EXPORT std::basic_string<char> createGUID32();
24+
///@details These functions are non-template on purpose, to keep it simple and stupid, and to reduce compile time
25+
IFCQUERY_EXPORT std::wstring createGUID32_wstr();
26+
IFCQUERY_EXPORT std::string createGUID32();
2627

2728
///@brief Compresses a GUID string
2829
///@details Expects a string with exactly 36 characters including dashes, for example: "F103000C-9865-44EE-BE6E-CCC780B81423"
2930
///@returns an IFC GUID string with 22 characters, for example: "3n0m0Cc6L4xhvkpCU0k1GZ"
30-
IFCQUERY_EXPORT std::basic_string<wchar_t> compressGUID_wstr(const std::basic_string<wchar_t>& in);
31-
IFCQUERY_EXPORT std::basic_string<char> compressGUID(const std::basic_string<char>& in);
31+
IFCQUERY_EXPORT std::wstring compressGUID_wstr(const std::wstring& in);
32+
IFCQUERY_EXPORT std::string compressGUID(const std::string& in);
3233

3334
///@brief Decompresses an IFC GUID string
3435
///@details Expects a string with exactly 22 characters, for example "3n0m0Cc6L4xhvkpCU0k1GZ"
3536
///@returns GUID string with 36 characters, including dashes, for example: "F103000C-9865-44EE-BE6E-CCC780B81423"
36-
IFCQUERY_EXPORT std::basic_string<wchar_t> decompressGUID_wstr(const std::basic_string<wchar_t>& in);
37-
IFCQUERY_EXPORT std::basic_string<char> decompressGUID(const std::basic_string<char>& in);
37+
IFCQUERY_EXPORT std::wstring decompressGUID_wstr(const std::wstring& in);
38+
IFCQUERY_EXPORT std::string decompressGUID(const std::string& in);
3839

3940

4041
///@brief Create IFC GUID string with 22 characters, for example "3n0m0Cc6L4xhvkpCU0k1GZ"
4142
///@details Use desired character type as template parameter - char or wchar_t.
4243
///IFC uses a different base64 character set than RFC4648 - it starts with digits
4344
///instead of uppercase letters and uses '_' and '$' as last two characters.
44-
IFCQUERY_EXPORT std::basic_string<wchar_t> createBase64Uuid_wstr();
45-
IFCQUERY_EXPORT std::basic_string<char> createBase64Uuid();
45+
IFCQUERY_EXPORT std::wstring createBase64Uuid_wstr();
46+
IFCQUERY_EXPORT std::string createBase64Uuid();

IfcPlusPlus/src/ifcpp/model/BuildingModel.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
2020
#include <vector>
2121
#include <map>
2222
#include <string>
23-
#include <boost/unordered_map.hpp>
2423
#include "BasicTypes.h"
2524
#include "StatusCallback.h"
2625

IfcPlusPlus/src/ifcpp/model/UnitConverter.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
1818
#define _USE_MATH_DEFINES
1919
#include <cmath>
2020
#include <cstring>
21-
#include <boost/algorithm/string.hpp>
2221
#include "ifcpp/IFC4/include/IfcConversionBasedUnit.h"
2322
#include "ifcpp/IFC4/include/IfcLabel.h"
2423
#include "ifcpp/IFC4/include/IfcLengthMeasure.h"
@@ -34,6 +33,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
3433
#include "ifcpp/IFC4/include/IfcUnitEnum.h"
3534
#include "ifcpp/IFC4/include/IfcValue.h"
3635

36+
#include "ifcpp/reader/ReaderUtil.h"
3737
#include "UnitConverter.h"
3838

3939
UnitConverter::UnitConverter()
@@ -215,22 +215,22 @@ void UnitConverter::setIfcProject( shared_ptr<IfcProject> project )
215215
}
216216
}
217217

218-
if( boost::iequals( conversion_based_unit->m_Name->m_value.c_str(), L"INCH" ) )
218+
if( std_iequal( conversion_based_unit->m_Name->m_value.c_str(), L"INCH" ) )
219219
{
220220
m_length_unit_factor = 25.4*0.001; // 1 unit is 25.4 mm
221221
m_length_unit_found = true;
222222
}
223-
else if( boost::iequals( conversion_based_unit->m_Name->m_value.c_str(), L"FOOT" ) )
223+
else if( std_iequal( conversion_based_unit->m_Name->m_value.c_str(), L"FOOT" ) )
224224
{
225225
m_length_unit_factor = 304.8*0.001; // 1 unit is 304.8 mm
226226
m_length_unit_found = true;
227227
}
228-
else if( boost::iequals( conversion_based_unit->m_Name->m_value.c_str(), L"YARD" ) )
228+
else if( std_iequal( conversion_based_unit->m_Name->m_value.c_str(), L"YARD" ) )
229229
{
230230
m_length_unit_factor = 914*0.001; // 1 unit is 914 mm
231231
m_length_unit_found = true;
232232
}
233-
else if( boost::iequals( conversion_based_unit->m_Name->m_value.c_str(), L"MILE" ) )
233+
else if( std_iequal( conversion_based_unit->m_Name->m_value.c_str(), L"MILE" ) )
234234
{
235235
m_length_unit_factor = 1609*0.001; // 1 unit is 1609 mm
236236
m_length_unit_found = true;
@@ -256,7 +256,7 @@ void UnitConverter::setIfcProject( shared_ptr<IfcProject> project )
256256
}
257257
else if( conversion_based_unit->m_Name )
258258
{
259-
if( boost::iequals( conversion_based_unit->m_Name->m_value.c_str(), L"DEGREE" ) )
259+
if( std_iequal( conversion_based_unit->m_Name->m_value.c_str(), L"DEGREE" ) )
260260
{
261261
m_angular_unit = DEGREE;
262262
m_plane_angle_factor = M_PI / 180.0;

IfcPlusPlus/src/ifcpp/reader/ReaderSTEP.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ void ReaderSTEP::loadModelFromFile( const std::wstring& filePath, shared_ptr<Bui
108108
}
109109
std::wstring ext = filePath.substr(posDot + 1);
110110

111-
if( boost::iequals( ext, "ifc" ) )
111+
if( std_iequal( ext, L"ifc" ) )
112112
{
113113
// ok, nothing to do here
114114
}
115-
else if( boost::iequals( ext, "ifcXML" ) )
115+
else if( std_iequal( ext, L"ifcXML" ) )
116116
{
117117
// TODO: implement xml reader
118118
messageCallback( "ifcXML not yet implemented", StatusCallback::MESSAGE_TYPE_ERROR, __FUNC__ );
119119
return;
120120
}
121-
else if( boost::iequals( ext, "ifcZIP" ) || boost::iequals(ext, "zip") )
121+
else if( std_iequal( ext, L"ifcZIP" ) || std_iequal(ext, L"zip") )
122122
{
123123
std::string buffer;
124124
unzipFile(filePath, buffer);

0 commit comments

Comments
 (0)