From 2980b60d740db28e9595bdd8dc2ed6d8e72b6aa4 Mon Sep 17 00:00:00 2001 From: Alexander Rose <alex.rose@rcsb.org> Date: Thu, 6 Sep 2018 18:06:35 -0700 Subject: [PATCH] wip, added distance-restraints to canvas example, marking --- src/apps/canvas/component/structure-representation.tsx | 1 + src/apps/canvas/structure-view.ts | 6 +++++- src/mol-view/viewer.ts | 8 +++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/apps/canvas/component/structure-representation.tsx b/src/apps/canvas/component/structure-representation.tsx index 0a0b12fe8..ce10f4d5a 100644 --- a/src/apps/canvas/component/structure-representation.tsx +++ b/src/apps/canvas/component/structure-representation.tsx @@ -53,6 +53,7 @@ export class StructureRepresentationComponent extends React.Component<StructureR await repr.createOrUpdate(props).run() this.props.viewer.add(repr) this.props.viewer.requestDraw() + console.log(this.props.viewer.stats) const newState = { ...this.state, diff --git a/src/apps/canvas/structure-view.ts b/src/apps/canvas/structure-view.ts index 32cfa02bf..a1a5de9e2 100644 --- a/src/apps/canvas/structure-view.ts +++ b/src/apps/canvas/structure-view.ts @@ -23,6 +23,7 @@ import { PointRepresentation } from 'mol-geo/representation/structure/representa import { StructureRepresentation } from 'mol-geo/representation/structure'; import { BehaviorSubject } from 'rxjs'; import { SpacefillRepresentation } from 'mol-geo/representation/structure/representation/spacefill'; +import { DistanceRestraintRepresentation } from 'mol-geo/representation/structure/representation/distance-restraint'; export interface StructureView { readonly viewer: Viewer @@ -68,8 +69,9 @@ export async function StructureView(viewer: Viewer, models: ReadonlyArray<Model> ballAndStick: false, carbohydrate: false, spacefill: false, + distanceRestraint: false, symmetryAxes: false, - polymerSphere: false, + // polymerSphere: false, } const structureRepresentations: { [k: string]: StructureRepresentation<any> } = { @@ -78,6 +80,7 @@ export async function StructureView(viewer: Viewer, models: ReadonlyArray<Model> ballAndStick: BallAndStickRepresentation(), carbohydrate: CarbohydrateRepresentation(), spacefill: SpacefillRepresentation(), + distanceRestraint: DistanceRestraintRepresentation(), } const symmetryAxes = ShapeRepresentation() @@ -241,6 +244,7 @@ export async function StructureView(viewer: Viewer, models: ReadonlyArray<Model> updated.next(null) viewer.requestDraw() + console.log(viewer.stats) } async function createSymmetryRepr() { diff --git a/src/mol-view/viewer.ts b/src/mol-view/viewer.ts index 95952a7fd..0580a883f 100644 --- a/src/mol-view/viewer.ts +++ b/src/mol-view/viewer.ts @@ -99,9 +99,7 @@ namespace Viewer { const ctx = createContext(gl) const scene = Scene.create(ctx) - // const controls = TrackballControls.create(input, scene, {}) const controls = TrackballControls.create(input, camera, {}) - // const renderer = Renderer.create(ctx, camera, { clearColor: 0xFFFFFF }) const renderer = Renderer.create(ctx, camera, { clearColor: Color(0x000000) }) const pickScale = 1 @@ -130,9 +128,9 @@ namespace Viewer { } function mark(loci: Loci, action: MarkerAction) { - // reprMap.forEach((roSet, repr) => repr.mark(loci, action)) - // scene.update() - // requestDraw() + reprMap.forEach((roSet, repr) => repr.mark(loci, action)) + scene.update() + requestDraw() } let nearPlaneDelta = 0 -- GitLab