Skip to content

Commit 6fbdd79

Browse files
committed
Try to avoid some odd C++11 that do not work well in all compilers
1 parent 74cec9b commit 6fbdd79

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

lib/proc3d/src/proc3d.cpp

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the Modelica3D package.
3-
3+
44
Copyright (C) 2012-current year Christoph Höger and Technical University of Berlin
55
66
This program is free software: you can redistribute it and/or modify
@@ -50,11 +50,12 @@ namespace proc3d {
5050
/* setup ops */
5151

5252
void proc3d_load_object(void* context, const char* name, const char* filename, const double x, const double y, const double z) {
53-
getContext(context)->setupOps.push(LoadObject(name, filename, boost::array<double, 3>{{x,y,z}}));
53+
boost::array<double, 3> arr = boost::array<double, 3>({x,y,z});
54+
getContext(context)->setupOps.push(LoadObject(name, filename, arr));
5455
}
55-
56+
5657
void proc3d_create_group(void* context, const char* name) {
57-
getContext(context)->setupOps.push(CreateGroup(name));
58+
getContext(context)->setupOps.push(CreateGroup(name));
5859
}
5960

6061
void proc3d_create_material(void* context, const char* name, const double r, const double g, const double b, const double a) {
@@ -65,22 +66,25 @@ namespace proc3d {
6566
getContext(context)->setupOps.push(CreateSphere(name, radius));
6667
}
6768

68-
void proc3d_create_box(void* context, const char* name,
69-
const double x, const double y, const double z,
70-
const double width, const double length, const double height) {
71-
getContext(context)->setupOps.push(CreateBox(name, width, length, height, boost::array<double, 3>{{x,y,z}}));
69+
void proc3d_create_box(void* context, const char* name,
70+
const double x, const double y, const double z,
71+
const double width, const double length, const double height) {
72+
boost::array<double, 3> arr = boost::array<double, 3>({x,y,z});
73+
getContext(context)->setupOps.push(CreateBox(name, width, length, height, arr));
7274
}
7375

7476
void proc3d_create_plane(void* context, const char* name, const double width, const double length) {
7577
getContext(context)->setupOps.push(CreatePlane(name, width, length));
7678
}
7779

7880
void proc3d_create_cylinder(void* context, const char* name, const double x, const double y, const double z, const double height, const double radius) {
79-
getContext(context)->setupOps.push(CreateCylinder{name, radius, height, boost::array<double, 3>{{x,y,z}}});
81+
boost::array<double, 3> arr = boost::array<double, 3>({x,y,z});
82+
getContext(context)->setupOps.push(CreateCylinder{name, radius, height, arr});
8083
}
8184

8285
void proc3d_create_cone(void* context, const char* name, const double x, const double y, const double z, const double height, const double radius) {
83-
getContext(context)->setupOps.push(CreateCone(name, radius, height, boost::array<double, 3>{{x,y,z}}));
86+
boost::array<double, 3> arr = boost::array<double, 3>({x,y,z});
87+
getContext(context)->setupOps.push(CreateCone(name, radius, height, arr));
8488
}
8589

8690
void proc3d_add_to_group(void* context, const char* name, const char* target) {
@@ -97,11 +101,11 @@ namespace proc3d {
97101
getContext(context)->deltaOps.push(RotateEuler(name, time, x, y, z));
98102
}
99103

100-
void proc3d_set_rotation_matrix(void* context, const char* name,
101-
const double r11, const double r12, const double r13,
102-
const double r21, const double r22, const double r23,
103-
const double r31, const double r32, const double r33,
104-
const double time) {
104+
void proc3d_set_rotation_matrix(void* context, const char* name,
105+
const double r11, const double r12, const double r13,
106+
const double r21, const double r22, const double r23,
107+
const double r31, const double r32, const double r33,
108+
const double time) {
105109
boost::numeric::ublas::bounded_matrix<double, 3, 3> m;
106110
//TODO: This can probably be rewritten with some fancy boost function, I just can't figure out which one ...
107111
m(0,0) = r11; m(0,1) = r12; m(0,2) = r13;

0 commit comments

Comments
 (0)