30 #if defined(HAVE_CONFIG_H)
33 #if defined(HAVE_GL_GL_H)
35 #elif defined(HAVE_OPENGL_GL_H)
36 #include <OpenGL/gl.h>
55 int kbr, i, lbr, nbr0;
56 GLfloat bmat[3][3], rhs[3], prod, thr, det;
60 for (kbr = nbr0; kbr < 26; ++kbr) {
62 for (i = 0; i<3; ++i) bmat[0][i] =
bragg[ibr][i];
63 for (i = 0; i<3; ++i) bmat[1][i] =
bragg[jbr][i];
64 for (i = 0; i<3; ++i) bmat[2][i] =
bragg[kbr][i];
69 thr = sqrtf(rhs[0] * rhs[1] * rhs[2]) * 0.001f;
74 if (fabsf(det) < thr)
continue;
78 prod = (vert2[0] - rhs[0]) * (vert2[0] - rhs[0])
79 + (vert2[1] - rhs[1]) * (vert2[1] - rhs[1])
80 + (vert2[2] - rhs[2]) * (vert2[2] - rhs[2]);
81 if (prod < thr)
continue;
86 for (lbr = 0; lbr < 26; ++lbr) {
87 prod =
bragg[lbr][0] * rhs[0]
88 +
bragg[lbr][1] * rhs[1]
89 +
bragg[lbr][2] * rhs[2];
91 if (prod >
brnrm[lbr] + thr) {
99 for (i = 0; i<3; ++i) vert[i] = rhs[i];
114 int ii, kk, bzflag, nbzcorner, nn;
115 GLfloat thr = (GLfloat)0.0001, prod, bzc[676][3];
120 for (ibzl = 0; ibzl <
nbzl; ibzl++) {
121 for (ii = 0; ii < 2; ii++) {
124 for (ibzc = 0; ibzc < nbzcorner; ibzc++) {
126 for (kk = 0; kk < 3; kk++) prod += (
bzl[ibzl][ii][kk] - bzc[ibzc][kk]) * (
bzl[ibzl][ii][kk] - bzc[ibzc][kk]);
127 if (prod < thr) bzflag = 1;
131 for (kk = 0; kk < 3; kk++) bzc[nbzcorner][kk] =
bzl[ibzl][ii][kk];
137 *
terminal << wxString::Format(wxT(
" Number of corners of 1st BZ : %d\n"), nbzcorner);
143 for (ibr = 0; ibr < 26; ibr++) {
146 for (ibzc = 0; ibzc < nbzcorner; ibzc++) {
147 prod =
bragg[ibr][0] * bzc[ibzc][0] +
bragg[ibr][1] * bzc[ibzc][1] +
bragg[ibr][2] * bzc[ibzc][2];
148 if (fabsf(prod -
brnrm[ibr]) < thr) nn += 1;
156 *
terminal << wxString::Format(wxT(
" Number of plane of 1st BZ : %d\n"),
nbragg);
166 int ibr, jbr, nbr, i, j, lvert;
171 for (ibr = 0; ibr < 26; ++ibr) {
172 for (jbr = 0; jbr < 26; ++jbr) {
174 for (i = 0; i<3; ++i) vert[1][i] = 0.0;
177 if (lvert == 0)
continue;
181 if (lvert == 0)
continue;
183 for (i = 0; i < 2; ++i)
for (j = 0; j < 3; ++j)
bzl[
nbzl][i][j] = vert[i][j];