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>
50 int ib, itri, i, j, ithread, nnl0;
51 std::vector<std::vector<std::vector<std::vector<GLfloat> > > > kvnl_v;
55 *
terminal << wxT(
" band # of nodeline\n");
56 for (ib = 0; ib <
nb; ib++) {
58 #pragma omp parallel default(none) \
59 shared(nb,ib,matp,kvp,ntri,kvnl_v) \
60 private(itri,i,j,ithread)
63 GLfloat a[3][3], matps[3];
64 std::vector<std::vector<GLfloat> > kvnl0;
67 for (i = 0; i < 2; i++)kvnl0.at(i).resize(3);
70 kvnl_v.at(ithread).resize(0);
73 for (itri = 0; itri <
ntri[ib]; ++itri) {
75 for (i = 0; i < 3; ++i) matps[i] =
matp[ib][itri][i][0];
78 for (i = 0; i < 3; ++i) {
79 for (j = 0; j < 3; ++j) {
80 a[i][j] = (0.f -
matp[ib][itri][sw[j]][0])
81 / (
matp[ib][itri][sw[i]][0] -
matp[ib][itri][sw[j]][0]);
85 if ((
matp[ib][itri][sw[0]][0] < 0.0 && 0.0 <=
matp[ib][itri][sw[1]][0])
86 || (
matp[ib][itri][sw[0]][0] <= 0.0 && 0.0 <
matp[ib][itri][sw[1]][0])) {
87 for (i = 0; i < 3; ++i) {
88 kvnl0.at(0).at(i) =
kvp[ib][itri][sw[0]][i] * a[0][1] +
kvp[ib][itri][sw[1]][i] * a[1][0];
89 kvnl0.at(1).at(i) =
kvp[ib][itri][sw[0]][i] * a[0][2] +
kvp[ib][itri][sw[2]][i] * a[2][0];
91 kvnl_v.at(ithread).push_back(kvnl0);
93 else if ((
matp[ib][itri][sw[1]][0] < 0.0 && 0.0 <=
matp[ib][itri][sw[2]][0])
94 || (
matp[ib][itri][sw[1]][0] <= 0.0 && 0.0 <
matp[ib][itri][sw[2]][0])) {
95 for (i = 0; i < 3; ++i) {
96 kvnl0.at(0).at(i) =
kvp[ib][itri][sw[0]][i] * a[0][2] +
kvp[ib][itri][sw[2]][i] * a[2][0];
97 kvnl0.at(1).at(i) =
kvp[ib][itri][sw[1]][i] * a[1][2] +
kvp[ib][itri][sw[2]][i] * a[2][1];
99 kvnl_v.at(ithread).push_back(kvnl0);
107 for (ithread = 0; ithread <
nthreads; ithread++)
108 nnl[ib] += kvnl_v.at(ithread).size();
109 *
terminal << wxString::Format(wxT(
" %d %d\n"), ib + 1,
nnl[ib]);
111 kvnl[ib] =
new GLfloat * *[
nnl[ib]];
113 for (itri = 0; itri <
nnl[ib]; ++itri) {
114 kvnl[ib][itri] =
new GLfloat *[2];
115 for (i = 0; i < 2; ++i) {
116 kvnl[ib][itri][i] =
new GLfloat[3];
123 for (ithread = 0; ithread <
nthreads; ithread++){
124 for (itri = 0; itri < kvnl_v.at(ithread).size(); ++itri) {
125 for (i = 0; i < 2; ++i) {
126 for (j = 0; j < 3; j++) {
127 kvnl[ib][nnl0][i][j] = kvnl_v.at(ithread).at(itri).at(i).at(j);