• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョンbfddb708b2491c57b0595383c7f5b20abf4fd70f (tree)
日時2014-11-17 00:47:03
作者toshinagata1964 <toshinagata1964@a2be...>
コミッターtoshinagata1964

ログメッセージ

Handling of the surface normals was incomplete. Fixed.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@587 a2be9bc6-48de-4e38-9406-05402d4bc13c

変更サマリ

差分

--- a/MolLib/Molecule.c
+++ b/MolLib/Molecule.c
@@ -1858,6 +1858,7 @@ MoleculeLoadMbsfFile(Molecule *mp, const char *fname, char **errbuf)
18581858 break;
18591859 if (mp->mview == NULL)
18601860 continue; /* Skip */
1861+ redo:
18611862 if (strcmp(buf, "line\n") == 0) {
18621863 ibuf[0] = kMainViewGraphicLine;
18631864 } else if (strcmp(buf, "poly\n") == 0) {
@@ -1918,12 +1919,12 @@ MoleculeLoadMbsfFile(Molecule *mp, const char *fname, char **errbuf)
19181919 }
19191920 if (j > 0)
19201921 NewArray(&gp->normals, &gp->nnormals, sizeof(GLfloat) * 3, j);
1921- } else if (i >= gp->npoints + 3 && i < gp->npoints + gp->nnormals + 3) {
1922+ } else if (i >= gp->npoints + 4 && i < gp->npoints + gp->nnormals + 4) {
19221923 if (sscanf(buf, "%lf %lf %lf", &dbuf[0], &dbuf[1], &dbuf[2]) < 3) {
19231924 s_append_asprintf(errbuf, "line %d: the normal vector cannot be read for graphic object", lineNumber);
19241925 goto err_exit;
19251926 }
1926- j = (i - gp->npoints - 3) * 3;
1927+ j = (i - gp->npoints - 4) * 3;
19271928 gp->normals[j++] = dbuf[0];
19281929 gp->normals[j++] = dbuf[1];
19291930 gp->normals[j] = dbuf[2];
@@ -1932,8 +1933,9 @@ MoleculeLoadMbsfFile(Molecule *mp, const char *fname, char **errbuf)
19321933 }
19331934 MainView_insertGraphic(mp->mview, -1, gp);
19341935 free(gp);
1935- if (buf[0] == '\n')
1936+ if (buf[0] == '\n' || buf[0] == 0)
19361937 break;
1938+ goto redo;
19371939 }
19381940 continue;
19391941 } else if (strncmp(buf, "!:@", 3) == 0) {
旧リポジトリブラウザで表示