Skip to content

Commit 9e9e2fe

Browse files
committed
reformat
1 parent e099bd5 commit 9e9e2fe

30 files changed

+189
-192
lines changed

.clang-format

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Language: Cpp
22
Standard: Cpp11
33
IndentWidth: 4
44
TabWidth: 4
5-
UseTab: Always
5+
UseTab: ForIndentation
66
ColumnLimit: 120
77
AccessModifierOffset: 0
88
AlignEscapedNewlinesLeft: true
@@ -37,4 +37,4 @@ SpacesBeforeTrailingComments: 4
3737
SpacesInAngles: false
3838
SpacesInCStyleCastParentheses: false
3939
SpacesInContainerLiterals: true
40-
SpacesInParentheses: false
40+
SpacesInParentheses: false

gltfpp/include/Accessor.h

+26-26
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,40 @@
99
namespace gltfpp {
1010
inline namespace v1 {
1111
BETTER_ENUM(AccessorComponentType,
12-
int,
13-
BYTE = 5120,
14-
UNSIGNED_BYTE = 5121,
15-
SHORT = 5122,
16-
UNSIGNED_SHORT = 5123,
17-
UNSIGNED_INT = 5125,
18-
FLOAT = 5126)
12+
int,
13+
BYTE = 5120,
14+
UNSIGNED_BYTE = 5121,
15+
SHORT = 5122,
16+
UNSIGNED_SHORT = 5123,
17+
UNSIGNED_INT = 5125,
18+
FLOAT = 5126)
1919

2020
BETTER_ENUM(AccessorType, int, SCALAR, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4)
2121

2222
constexpr auto AccessorTypeComponentCount =
23-
boost::hana::make_map(boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::SCALAR>, 1),
24-
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::VEC2>, 2),
25-
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::VEC3>, 3),
26-
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::VEC4>, 4),
27-
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::MAT2>, 4),
28-
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::MAT3>, 9),
29-
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::MAT4>, 16));
23+
boost::hana::make_map(boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::SCALAR>, 1),
24+
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::VEC2>, 2),
25+
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::VEC3>, 3),
26+
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::VEC4>, 4),
27+
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::MAT2>, 4),
28+
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::MAT3>, 9),
29+
boost::hana::make_pair(boost::hana::int_c<(int)AccessorType::MAT4>, 16));
3030

3131
struct Accessor {
3232
BOOST_HANA_DEFINE_STRUCT(Accessor,
33-
(bool, normalized),
34-
(std::vector<double>, min),
35-
(std::vector<double>, max),
36-
(option<std::string>, name),
37-
(option<nlohmann::json>, sparse),
38-
(option<nlohmann::json>, extensions),
39-
(option<nlohmann::json>, extras),
40-
(ptrdiff_t, byteOffset),
41-
(size_t, count),
42-
(AccessorComponentType, componentType));
33+
(bool, normalized),
34+
(std::vector<double>, min),
35+
(std::vector<double>, max),
36+
(option<std::string>, name),
37+
(option<nlohmann::json>, sparse),
38+
(option<nlohmann::json>, extensions),
39+
(option<nlohmann::json>, extras),
40+
(ptrdiff_t, byteOffset),
41+
(size_t, count),
42+
(AccessorComponentType, componentType));
4343
BufferView const *bufferView;
4444
};
4545

4646
auto parse(Accessor &) noexcept;
47-
} // namespace v1
48-
} // namespace gltfpp
47+
} // namespace v1
48+
} // namespace gltfpp

gltfpp/include/Animation.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ namespace gltfpp {
3838
};
3939
#endif
4040
BOOST_HANA_DEFINE_STRUCT(Animation,
41-
(std::vector<int>, channels),
42-
(std::vector<int>, samplers),
43-
(option<std::string>, name),
44-
(option<nlohmann::json>, extensions),
45-
(option<nlohmann::json>, extras));
41+
(std::vector<int>, channels),
42+
(std::vector<int>, samplers),
43+
(option<std::string>, name),
44+
(option<nlohmann::json>, extensions),
45+
(option<nlohmann::json>, extras));
4646
};
47-
} // namespace v1
48-
} // namespace gltfpp
47+
} // namespace v1
48+
} // namespace gltfpp

gltfpp/include/Asset.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ namespace gltfpp {
77
inline namespace v1 {
88
struct Asset {
99
BOOST_HANA_DEFINE_STRUCT(Asset,
10-
(option<std::string>, copyright),
11-
(option<std::string>, generator),
12-
(option<std::string>, minVersion),
13-
(std::string, version),
10+
(option<std::string>, copyright),
11+
(option<std::string>, generator),
12+
(option<std::string>, minVersion),
13+
(std::string, version),
1414

15-
(option<nlohmann::json>, extensions),
16-
(option<nlohmann::json>, extras));
15+
(option<nlohmann::json>, extensions),
16+
(option<nlohmann::json>, extras));
1717
};
18-
} // namespace v1
19-
} // namespace gltfpp
18+
} // namespace v1
19+
} // namespace gltfpp

gltfpp/include/Buffer.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace gltfpp {
1010
inline namespace v1 {
1111
struct Buffer {
1212
BOOST_HANA_DEFINE_STRUCT(Buffer,
13-
(option<URI>, uri),
14-
(option<std::string>, name),
15-
(option<nlohmann::json>, extensions),
16-
(option<nlohmann::json>, extras));
13+
(option<URI>, uri),
14+
(option<std::string>, name),
15+
(option<nlohmann::json>, extensions),
16+
(option<nlohmann::json>, extras));
1717
};
1818

1919
auto parse(Buffer &b) noexcept;
20-
} // namespace v1
21-
} // namespace gltfpp
20+
} // namespace v1
21+
} // namespace gltfpp

gltfpp/include/BufferView.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ namespace gltfpp {
1313

1414
struct BufferView {
1515
BufferView()
16-
: byteStride{0} {
16+
: byteStride{0} {
1717
}
1818

1919
BOOST_HANA_DEFINE_STRUCT(BufferView,
20-
(option<BufferViewTarget>, target),
21-
(option<std::string>, name),
22-
(defaulted<uint8_t>, byteStride),
23-
(option<nlohmann::json>, extensions),
24-
(option<nlohmann::json>, extras));
20+
(option<BufferViewTarget>, target),
21+
(option<std::string>, name),
22+
(defaulted<uint8_t>, byteStride),
23+
(option<nlohmann::json>, extensions),
24+
(option<nlohmann::json>, extras));
2525
gsl::span<byte const> span;
2626
Buffer const *buffer;
2727
};
2828

2929
auto parse(BufferView &) noexcept;
30-
} // namespace v1
31-
} // namespace gltfpp
30+
} // namespace v1
31+
} // namespace gltfpp

gltfpp/include/Camera.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ namespace gltfpp {
77
BETTER_ENUM(CameraType, int, perspective, orthographic)
88
struct Camera {
99
BOOST_HANA_DEFINE_STRUCT(Camera,
10-
(CameraType, type),
11-
(option<std::string>, name),
12-
(option<nlohmann::json>, orthographic),
13-
(option<nlohmann::json>, perspective),
14-
(option<nlohmann::json>, extras),
15-
(option<nlohmann::json>, extensions));
10+
(CameraType, type),
11+
(option<std::string>, name),
12+
(option<nlohmann::json>, orthographic),
13+
(option<nlohmann::json>, perspective),
14+
(option<nlohmann::json>, extras),
15+
(option<nlohmann::json>, extensions));
1616
};
17-
} // namespace v1
18-
} // namespace gltfpp
17+
} // namespace v1
18+
} // namespace gltfpp

gltfpp/include/Error.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ namespace gltfpp {
1111
gltf_error() = default;
1212
inline gltf_error(cases error);
1313
};
14-
} // namespace v1
15-
} // namespace gltfpp
14+
} // namespace v1
15+
} // namespace gltfpp
1616

1717
namespace std {
1818
template <>
1919
struct is_error_code_enum<gltfpp::gltf_error::cases> : std::true_type {};
20-
} // namespace std
20+
} // namespace std
2121

2222
namespace gltfpp {
2323
inline namespace v1 {
@@ -55,21 +55,21 @@ namespace gltfpp {
5555
case gltf_error::unimplemented:
5656
return std::errc::function_not_supported;
5757
case gltf_error::decode_error:
58-
return std::errc::bad_message; // TODO
58+
return std::errc::bad_message; // TODO
5959
default:
6060
return std::error_condition(error, *this);
6161
}
6262
}
6363
};
64-
} // namespace detail
64+
} // namespace detail
6565

6666
inline detail::gltf_error_category const &gltf_error_category() {
6767
static detail::gltf_error_category c;
6868
return c;
6969
}
7070

7171
gltf_error::gltf_error(gltf_error::cases e)
72-
: std::error_code{e, gltf_error_category()} {
72+
: std::error_code{e, gltf_error_category()} {
7373
}
7474

7575
inline gltf_error make_error_code(gltf_error::cases e) {
@@ -96,5 +96,5 @@ namespace gltfpp {
9696
}
9797
return empty_t{};
9898
}
99-
} // namespace v1
100-
} // namespace gltfpp
99+
} // namespace v1
100+
} // namespace gltfpp

gltfpp/include/Image.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ namespace gltfpp {
88
inline namespace v1 {
99
struct Image {
1010
BOOST_HANA_DEFINE_STRUCT(Image,
11-
(option<std::string>, name),
12-
(option<nlohmann::json>, extensions),
13-
(option<nlohmann::json>, extras));
11+
(option<std::string>, name),
12+
(option<nlohmann::json>, extensions),
13+
(option<nlohmann::json>, extras));
1414

1515
boost::variant<std::vector<byte>, BufferView *> data;
1616
std::string mimeType;
1717
};
18-
} // namespace v1
19-
} // namespace gltfpp
18+
} // namespace v1
19+
} // namespace gltfpp

gltfpp/include/Material.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ namespace gltfpp {
88
struct Material {
99
struct PBRMetalllicRoughness {
1010
BOOST_HANA_DEFINE_STRUCT(PBRMetalllicRoughness,
11-
(std::array<double, 3>, baseColorFactor),
12-
(Texture, baseColorTexture),
13-
(double, metallicFactor),
14-
(double, roughnessFactor),
15-
(Texture, metallicRoughnessTexture));
11+
(std::array<double, 3>, baseColorFactor),
12+
(Texture, baseColorTexture),
13+
(double, metallicFactor),
14+
(double, roughnessFactor),
15+
(Texture, metallicRoughnessTexture));
1616
};
1717

1818
BOOST_HANA_DEFINE_STRUCT(Material,
19-
(std::vector<Texture>, textures),
20-
(option<std::string>, name),
21-
(option<nlohmann::json>, extensions),
22-
(option<nlohmann::json>, extras),
23-
(PBRMetalllicRoughness, pbrMetallicRoughness),
24-
(std::array<double, 3>, emissiveFactor));
19+
(std::vector<Texture>, textures),
20+
(option<std::string>, name),
21+
(option<nlohmann::json>, extensions),
22+
(option<nlohmann::json>, extras),
23+
(PBRMetalllicRoughness, pbrMetallicRoughness),
24+
(std::array<double, 3>, emissiveFactor));
2525
};
26-
} // namespace v1
27-
} // namespace gltfpp
26+
} // namespace v1
27+
} // namespace gltfpp

gltfpp/include/Mesh.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@
77
namespace gltfpp {
88
inline namespace v1 {
99
BETTER_ENUM(PrimitiveMode,
10-
int,
11-
POINTS = 0,
12-
LINES = 1,
13-
LINE_LOOP = 2,
14-
LINE_STRIP = 3,
15-
TRIANGLES = 4,
16-
TRIANGLE_STRIP = 5,
17-
TRIANGLE_FAN = 6)
10+
int,
11+
POINTS = 0,
12+
LINES = 1,
13+
LINE_LOOP = 2,
14+
LINE_STRIP = 3,
15+
TRIANGLES = 4,
16+
TRIANGLE_STRIP = 5,
17+
TRIANGLE_FAN = 6)
1818

1919
struct Mesh {
2020
struct Primitive {
2121
BOOST_HANA_DEFINE_STRUCT(Primitive,
22-
//(std::unordered_map<std::string, int>, attributes),
23-
(Accessor *, indices),
24-
(Material *, material),
25-
(PrimitiveMode, mode),
26-
//(???, targets),
27-
(nlohmann::json, extensions),
28-
(nlohmann::json, extras));
22+
//(std::unordered_map<std::string, int>, attributes),
23+
(Accessor *, indices),
24+
(Material *, material),
25+
(PrimitiveMode, mode),
26+
//(???, targets),
27+
(nlohmann::json, extensions),
28+
(nlohmann::json, extras));
2929
};
3030
BOOST_HANA_DEFINE_STRUCT(Mesh);
3131
};
3232

3333
auto parse(Mesh::Primitive &p) noexcept;
34-
} // namespace v1
35-
} // namespace gltfpp
34+
} // namespace v1
35+
} // namespace gltfpp

gltfpp/include/Meta.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace gltfpp {
2525
using value_t = std::true_type;
2626
using type = Op<Args...>;
2727
};
28-
} // namespace detail
28+
} // namespace detail
2929

3030
template <template <typename...> class Op, typename... Args>
3131
using is_detected = typename detail::detector<nonesuch, void, Op, Args...>::value_t;
@@ -69,8 +69,8 @@ namespace gltfpp {
6969
template <typename T>
7070
struct is_nothrow_swappable<T, false> : std::false_type {};
7171

72-
} // namespace swappable
73-
} // namespace detail
72+
} // namespace swappable
73+
} // namespace detail
7474

7575
template <typename T>
7676
using is_swappable = detail::swappable::is_swappable<T>;
@@ -106,8 +106,8 @@ namespace gltfpp {
106106

107107
template <typename T>
108108
constexpr bool is_fundamental_json_type =
109-
!is_enumeration<T> &&
110-
disjunction<std::is_arithmetic<T>, is_any_of<T, std::string, nlohmann::json>>::value;
109+
!is_enumeration<T> &&
110+
disjunction<std::is_arithmetic<T>, is_any_of<T, std::string, nlohmann::json>>::value;
111111

112112
// Make this public as customization point?
113113
template <typename T>
@@ -116,6 +116,6 @@ namespace gltfpp {
116116
// FIXME proper concept checking
117117
template <typename T>
118118
constexpr bool is_field_aggregate = !is_fundamental_json_type<T> && !is_field_list<T> && !is_enumeration<T>;
119-
} // namespace detail
120-
} // namespace v1
121-
} // namespace gltfpp
119+
} // namespace detail
120+
} // namespace v1
121+
} // namespace gltfpp

gltfpp/include/Node.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ namespace gltfpp {
99
inline namespace v1 {
1010
struct Node {
1111
BOOST_HANA_DEFINE_STRUCT(Node,
12-
(std::vector<Node>, nodes),
13-
(std::vector<Mesh>, meshes),
14-
(Skin, skin),
15-
(Camera, camera));
12+
(std::vector<Node>, nodes),
13+
(std::vector<Mesh>, meshes),
14+
(Skin, skin),
15+
(Camera, camera));
1616
};
17-
} // namespace v1
18-
} // namespace gltfpp
17+
} // namespace v1
18+
} // namespace gltfpp

0 commit comments

Comments
 (0)