27 #if defined(HAVE_CONFIG_H)
30 #if defined(HAVE_GL_GL_H)
32 #elif defined(HAVE_OPENGL_GL_H)
33 #include <OpenGL/gl.h>
48 int ib, itri, i, j, ithread, nequator0;
49 std::vector<std::vector<std::vector<std::vector<GLfloat> > > > kveq_v;
53 *
terminal << wxT(
" band # of equator\n");
54 for (ib = 0; ib <
nb; ib++) {
56 #pragma omp parallel default(none) \
57 shared(nb,ib,nmlp,kvp,ntri,eqvec,kveq_v) \
58 private(itri,i,j,ithread)
61 GLfloat a[3][3], prod[3];
62 std::vector<std::vector<GLfloat> > kveq_0;
65 for (i = 0; i < 2; i++) kveq_0.at(i).resize(3);
68 kveq_v.at(ithread).resize(0);
71 for (itri = 0; itri <
ntri[ib]; ++itri) {
73 for (i = 0; i < 3; ++i) {
75 for (j = 0; j < 3; ++j) prod[i] +=
eqvec[j] *
nmlp[ib][itri][i][j];
79 for (i = 0; i < 3; ++i) {
80 for (j = 0; j < 3; ++j) {
81 a[i][j] = (0.f - prod[sw[j]]) / (prod[sw[i]] - prod[sw[j]]);
85 if ((prod[sw[0]] < 0.0 && 0.0 <= prod[sw[1]])
86 || (prod[sw[0]] <= 0.0 && 0.0 < prod[sw[1]])) {
87 for (i = 0; i < 3; ++i) {
88 kveq_0.at(0).at(i) =
kvp[ib][itri][sw[0]][i] * a[0][1] +
kvp[ib][itri][sw[1]][i] * a[1][0];
89 kveq_0.at(1).at(i) =
kvp[ib][itri][sw[0]][i] * a[0][2] +
kvp[ib][itri][sw[2]][i] * a[2][0];
91 kveq_v.at(ithread).push_back(kveq_0);
93 else if ((prod[sw[1]] < 0.0 && 0.0 <= prod[sw[2]])
94 || (prod[sw[1]] <= 0.0 && 0.0 < prod[sw[2]])) {
95 for (i = 0; i < 3; ++i) {
96 kveq_0.at(0).at(i) =
kvp[ib][itri][sw[0]][i] * a[0][2] +
kvp[ib][itri][sw[2]][i] * a[2][0];
97 kveq_0.at(1).at(i) =
kvp[ib][itri][sw[1]][i] * a[1][2] +
kvp[ib][itri][sw[2]][i] * a[2][1];
99 kveq_v.at(ithread).push_back(kveq_0);
107 for (ithread = 0; ithread <
nthreads; ithread++)
108 nequator[ib] += kveq_v.at(ithread).size();
115 for (itri = 0; itri <
nequator[ib]; ++itri) {
116 kveq[ib][itri] =
new GLfloat * [2];
117 for (i = 0; i < 2; ++i)
118 kveq[ib][itri][i] =
new GLfloat[3];
124 for (ithread = 0; ithread <
nthreads; ithread++) {
125 for (itri = 0; itri < kveq_v.at(ithread).size(); ++itri) {
126 for (i = 0; i < 2; ++i) {
127 for (j = 0; j < 3; ++j) {
128 kveq[ib][nequator0][i][j] = kveq_v.at(ithread).at(itri).at(i).at(j);