1
1
/*
2
2
This file is part of the Modelica3D package.
3
-
3
+
4
4
Copyright (C) 2012-current year Christoph Höger and Technical University of Berlin
5
5
6
6
This program is free software: you can redistribute it and/or modify
@@ -50,11 +50,12 @@ namespace proc3d {
50
50
/* setup ops */
51
51
52
52
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));
54
55
}
55
-
56
+
56
57
void proc3d_create_group (void * context, const char * name) {
57
- getContext (context)->setupOps .push (CreateGroup (name));
58
+ getContext (context)->setupOps .push (CreateGroup (name));
58
59
}
59
60
60
61
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 {
65
66
getContext (context)->setupOps .push (CreateSphere (name, radius));
66
67
}
67
68
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));
72
74
}
73
75
74
76
void proc3d_create_plane (void * context, const char * name, const double width, const double length) {
75
77
getContext (context)->setupOps .push (CreatePlane (name, width, length));
76
78
}
77
79
78
80
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});
80
83
}
81
84
82
85
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));
84
88
}
85
89
86
90
void proc3d_add_to_group (void * context, const char * name, const char * target) {
@@ -97,11 +101,11 @@ namespace proc3d {
97
101
getContext (context)->deltaOps .push (RotateEuler (name, time, x, y, z));
98
102
}
99
103
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) {
105
109
boost::numeric::ublas::bounded_matrix<double , 3 , 3 > m;
106
110
// TODO: This can probably be rewritten with some fancy boost function, I just can't figure out which one ...
107
111
m (0 ,0 ) = r11; m (0 ,1 ) = r12; m (0 ,2 ) = r13;
0 commit comments