From: <ha...@us...> - 2006-08-05 00:41:58
|
Revision: 5366 Author: hansonr Date: 2006-08-04 17:41:52 -0700 (Fri, 04 Aug 2006) ViewCVS: http://svn.sourceforge.net/jmol/?rev=5366&view=rev Log Message: ----------- bob200603 10.x.38b 11.0 beta minor fix for draw -- fixes PERP when not FIXED. May not be the final story. When there are multiple models, some meshes have multiple model-based sections. This may not be optimal. Modified Paths: -------------- branches/bob200603/Jmol/src/org/jmol/viewer/Draw.java Modified: branches/bob200603/Jmol/src/org/jmol/viewer/Draw.java =================================================================== --- branches/bob200603/Jmol/src/org/jmol/viewer/Draw.java 2006-08-04 23:11:32 UTC (rev 5365) +++ branches/bob200603/Jmol/src/org/jmol/viewer/Draw.java 2006-08-05 00:41:52 UTC (rev 5366) @@ -223,7 +223,7 @@ currentMesh.setPolygonCount(1); currentMesh.ptCenters = null; currentMesh.modelFlags = null; - addFixedPoints(); + addModelPoints(-1); nPoly = setPolygons(nPoly); } else { // multiple copies, one for each model involved @@ -248,11 +248,16 @@ return true; } - private void addFixedPoints() { + void addPoint(Point3f newPt) { + ptList[nPoints++] = new Point3f(newPt); + if (nPoints > MAX_POINTS) + nPoints = MAX_POINTS; + } + + private void addModelPoints(int iModel) { nPoints = ncoord; // {x,y,z} points are already defined in ptList - // add in $drawID references as overall centers or individual points - // under certain circumstances + // $drawID references may be fixed or not for (int i = 0; i < nidentifiers; i++) { Mesh m = meshes[ptIdentifiers[i]]; if (isPlane || isPerpendicular || useVertices[i]) { @@ -264,32 +269,14 @@ addPoint(m.vertices[ipt]); } } else { - addPoint(m.ptCenter); + if (iModel < 0 || m.ptCenters == null || m.ptCenters[iModel] == null) + addPoint(m.ptCenter); + else + addPoint(m.ptCenters[iModel]); } } - // add in (atom set) references as overall average centers - for (int i = 0; i < nbitsets; i++) - addPoint(viewer.getAtomSetCenter(ptBitSets[i])); - } - - void addPoint(Point3f newPt) { - ptList[nPoints++] = new Point3f(newPt); - if (nPoints > MAX_POINTS) - nPoints = MAX_POINTS; - } - - private void addModelPoints(int iModel) { - nPoints = ncoord; - // {x,y,z} points are already defined in ptList - // $drawID references may be fixed or not - for (int i = 0; i < nidentifiers; i++) { - if (meshes[ptIdentifiers[i]].ptCenters == null - || meshes[ptIdentifiers[i]].ptCenters[iModel] == null) { - addPoint(meshes[ptIdentifiers[i]].ptCenter); - } else { - addPoint(meshes[ptIdentifiers[i]].ptCenters[iModel]); - } - } + if (iModel < 0) + return; // (atom set) references must be filtered for relevant model // note that if a model doesn't have a relevant point, one may // get a line instead of a plane, a point instead of a line, etc. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |