mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
isosurface params fixes/tweaks
This commit is contained in:
@@ -16,6 +16,7 @@ function paramInfo(param: PD.Any, offset: number): string {
|
||||
case 'boolean': return 'true/false';
|
||||
case 'number': return 'Numeric value';
|
||||
case 'converted': return paramInfo(param.converted, offset);
|
||||
case 'conditioned': return getParams(param.conditionParams, offset);
|
||||
case 'multi-select': return `Array of ${oToS(param.options)}`;
|
||||
case 'color': return 'Color as 0xrrggbb';
|
||||
case 'color-scale': return `One of ${oToS(param.options)}`;
|
||||
|
||||
@@ -15,7 +15,7 @@ import { DensityServer_Data_Database } from 'mol-io/reader/cif/schema/density-se
|
||||
import { Table } from 'mol-data/db';
|
||||
import { StringBuilder } from 'mol-util';
|
||||
import { Task } from 'mol-task';
|
||||
import { createVolumeIsosurfaceMesh } from 'mol-repr/volume/isosurface-mesh';
|
||||
import { createVolumeIsosurfaceMesh } from 'mol-repr/volume/isosurface';
|
||||
import { createEmptyTheme } from 'mol-theme/theme';
|
||||
|
||||
require('util.promisify').shim();
|
||||
@@ -39,7 +39,7 @@ function print(data: Volume) {
|
||||
}
|
||||
|
||||
async function doMesh(data: Volume, filename: string) {
|
||||
const mesh = await Task.create('', runtime => createVolumeIsosurfaceMesh({ runtime }, data.volume, createEmptyTheme(), { isoValue: VolumeIsoValue.calcAbsolute(data.volume.dataStats, 1.5) } )).run();
|
||||
const mesh = await Task.create('', runtime => createVolumeIsosurfaceMesh({ runtime }, data.volume, createEmptyTheme(), { isoValue: VolumeIsoValue.absolute(data.volume.dataStats, 1.5) } )).run();
|
||||
console.log({ vc: mesh.vertexCount, tc: mesh.triangleCount });
|
||||
|
||||
// Export the mesh in OBJ format.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { RepresentationProvider, RepresentationRegistry, Representation } from '../representation';
|
||||
import { VolumeData } from 'mol-model/volume';
|
||||
import { IsosurfaceRepresentationProvider } from './isosurface-mesh';
|
||||
import { IsosurfaceRepresentationProvider } from './isosurface';
|
||||
import { DirectVolumeRepresentationProvider } from './direct-volume';
|
||||
|
||||
export class VolumeRepresentationRegistry extends RepresentationRegistry<VolumeData, Representation.State> {
|
||||
|
||||
@@ -203,7 +203,7 @@ export namespace ParamDefinition {
|
||||
type: 'conditioned',
|
||||
select: Select<string>,
|
||||
conditionParams: C
|
||||
conditionForValue(v: T): keyof C
|
||||
conditionForValue(v: T): keyof C
|
||||
conditionedValue(v: T, condition: keyof C): T,
|
||||
}
|
||||
export function Conditioned<T, P extends Base<T>, C = { [k: string]: P }>(defaultValue: T, conditionParams: C, conditionForValue: (v: T) => keyof C, conditionedValue: (v: T, condition: keyof C) => T): Conditioned<T, P, C> {
|
||||
|
||||
Reference in New Issue
Block a user