UNPKG

biojs-vis-pdbviewer

Version:

A BioJS 2.0 component to view protein structures

27 lines (25 loc) 1.17 kB
Clazz.declarePackage ("J.renderbio"); Clazz.load (["J.renderbio.StrandsRenderer"], "J.renderbio.MeshRibbonRenderer", null, function () { c$ = Clazz.declareType (J.renderbio, "MeshRibbonRenderer", J.renderbio.StrandsRenderer); Clazz.overrideMethod (c$, "renderBioShape", function (bioShape) { if (this.wireframeOnly) this.renderStrands (); else this.renderMeshRibbon (); }, "J.shapebio.BioShape"); Clazz.defineMethod (c$, "renderMeshRibbon", function () { if (!this.setStrandCount ()) return; var offset = ((this.strandCount >> 1) * this.strandSeparation) + this.baseStrandOffset; this.render2Strand (false, offset, offset); this.renderStrands (); }); Clazz.defineMethod (c$, "render2Strand", function (doFill, offsetTop, offsetBottom) { this.getScreenControlPoints (); this.ribbonTopScreens = this.calcScreens (offsetTop); this.ribbonBottomScreens = this.calcScreens (-offsetBottom); for (var i = this.bsVisible.nextSetBit (0); i >= 0; i = this.bsVisible.nextSetBit (i + 1)) this.renderHermiteRibbon (doFill, i, false); this.vwr.freeTempScreens (this.ribbonTopScreens); this.vwr.freeTempScreens (this.ribbonBottomScreens); }, "~B,~N,~N"); });