diff --git a/src/mol-geo/geometry/direct-volume/direct-volume.ts b/src/mol-geo/geometry/direct-volume/direct-volume.ts index 50dfc577d7e0cca54bd64994313d39bdc6d0d0af..9196992727d879ac5cb66b068762c3892a7102c2 100644 --- a/src/mol-geo/geometry/direct-volume/direct-volume.ts +++ b/src/mol-geo/geometry/direct-volume/direct-volume.ts @@ -75,10 +75,9 @@ export namespace DirectVolume { renderMode: PD.Select('Render Mode', '', 'isosurface', RenderModeOptions), controlPoints: PD.Text('Control Points', '', '0.19:0.1, 0.2:0.5, 0.21:0.1, 0.4:0.3'), } - export const DefaultProps = PD.getDefaultValues(Params) - export type Props = typeof DefaultProps + export type Params = typeof Params - export async function createValues(ctx: RuntimeContext, directVolume: DirectVolume, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: Props): Promise<DirectVolumeValues> { + export async function createValues(ctx: RuntimeContext, directVolume: DirectVolume, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: PD.Values<Params>): Promise<DirectVolumeValues> { const { gridTexture, gridTextureDim } = directVolume const { bboxSize, bboxMin, bboxMax, gridDimension, transform: gridTransform } = directVolume @@ -126,7 +125,7 @@ export namespace DirectVolume { } } - export function updateValues(values: DirectVolumeValues, props: Props) { + export function updateValues(values: DirectVolumeValues, props: PD.Values<Params>) { const vertices = new Float32Array(values.aPosition.ref.value) transformPositionArray(values.uTransform.ref.value, vertices, 0, vertices.length / 3) const boundingSphere = calculateBoundingSphere( diff --git a/src/mol-geo/geometry/geometry.ts b/src/mol-geo/geometry/geometry.ts index 7e364387cb763ca6a9bb2e4e1c398ba355849be0..79d665d114c1c20ae252c670b44a4eb79abbf5d8 100644 --- a/src/mol-geo/geometry/geometry.ts +++ b/src/mol-geo/geometry/geometry.ts @@ -72,12 +72,11 @@ export namespace Geometry { colorTheme: PD.Select<BuiltInColorThemeName>('Color Name', '', 'uniform', BuiltInColorThemeOptions), sizeTheme: PD.Select<BuiltInSizeThemeName>('Size Name', '', 'uniform', BuiltInSizeThemeOptions), } - export const DefaultProps = PD.getDefaultValues(Params) - export type Props = typeof DefaultProps + export type Params = typeof Params export type Counts = { drawCount: number, groupCount: number, instanceCount: number } - export function createValues(props: Props, counts: Counts) { + export function createValues(props: PD.Values<Params>, counts: Counts) { return { uAlpha: ValueCell.create(props.alpha), uHighlightColor: ValueCell.create(Color.toArrayNormalized(props.highlightColor, Vec3.zero(), 0)), @@ -88,7 +87,7 @@ export namespace Geometry { } } - export function updateValues(values: BaseValues, props: Props) { + export function updateValues(values: BaseValues, props: PD.Values<Params>) { if (Color.fromNormalizedArray(values.uHighlightColor.ref.value, 0) !== props.highlightColor) { ValueCell.update(values.uHighlightColor, Color.toArrayNormalized(props.highlightColor, values.uHighlightColor.ref.value, 0)) } @@ -102,14 +101,14 @@ export namespace Geometry { // -export function createRenderableState(props: Geometry.Props): RenderableState { +export function createRenderableState(props: PD.Values<Geometry.Params>): RenderableState { return { visible: true, depthMask: props.depthMask } } -export function updateRenderableState(state: RenderableState, props: Geometry.Props) { +export function updateRenderableState(state: RenderableState, props: PD.Values<Geometry.Params>) { state.depthMask = props.depthMask } diff --git a/src/mol-geo/geometry/lines/lines.ts b/src/mol-geo/geometry/lines/lines.ts index 4c5a48a7313b0a431ba858066795b32a77a2d1e5..0cf5bfef2f08438d53b8d9ec5c7ffebdad0d7435 100644 --- a/src/mol-geo/geometry/lines/lines.ts +++ b/src/mol-geo/geometry/lines/lines.ts @@ -97,10 +97,9 @@ export namespace Lines { ...Geometry.Params, lineSizeAttenuation: PD.Boolean('Line Size Attenuation', '', false), } - export const DefaultProps = PD.getDefaultValues(Params) - export type Props = typeof DefaultProps + export type Params = typeof Params - export async function createValues(ctx: RuntimeContext, lines: Lines, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: Props): Promise<LinesValues> { + export async function createValues(ctx: RuntimeContext, lines: Lines, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: PD.Values<Params>): Promise<LinesValues> { const { instanceCount, groupCount } = locationIt const color = await createColors(ctx, locationIt, theme.color) const size = await createSizes(ctx, locationIt, theme.size) @@ -138,7 +137,7 @@ export namespace Lines { } } - export function updateValues(values: LinesValues, props: Props) { + export function updateValues(values: LinesValues, props: PD.Values<Params>) { const boundingSphere = Sphere3D.addSphere( calculateBoundingSphere( values.aStart.ref.value, Math.floor(values.aStart.ref.value.length / 3), diff --git a/src/mol-geo/geometry/mesh/mesh.ts b/src/mol-geo/geometry/mesh/mesh.ts index 0c1a8f5cf5556010e58731ced5275e18481845ed..0f79107459636a383fec52ecbe335c4c4e90dd2b 100644 --- a/src/mol-geo/geometry/mesh/mesh.ts +++ b/src/mol-geo/geometry/mesh/mesh.ts @@ -345,10 +345,9 @@ export namespace Mesh { flipSided: PD.Boolean('Flip Sided', '', false), flatShaded: PD.Boolean('Flat Shaded', '', false), } - export const DefaultProps = PD.getDefaultValues(Params) - export type Props = typeof DefaultProps + export type Params = typeof Params - export async function createValues(ctx: RuntimeContext, mesh: Mesh, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: Props): Promise<MeshValues> { + export async function createValues(ctx: RuntimeContext, mesh: Mesh, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: PD.Values<Params>): Promise<MeshValues> { const { instanceCount, groupCount } = locationIt const color = await createColors(ctx, locationIt, theme.color) const marker = createMarkers(instanceCount * groupCount) @@ -377,7 +376,7 @@ export namespace Mesh { } } - export function updateValues(values: MeshValues, props: Props) { + export function updateValues(values: MeshValues, props: PD.Values<Params>) { const boundingSphere = calculateBoundingSphere( values.aPosition.ref.value, Math.floor(values.aPosition.ref.value.length / 3), values.aTransform.ref.value, values.instanceCount.ref.value diff --git a/src/mol-geo/geometry/points/points.ts b/src/mol-geo/geometry/points/points.ts index 616e7e057ed2e98404bb6185d41e127ba2fc08c9..2b245338dfa71a2b02edfa155d69bbbb59742c39 100644 --- a/src/mol-geo/geometry/points/points.ts +++ b/src/mol-geo/geometry/points/points.ts @@ -61,10 +61,9 @@ export namespace Points { pointFilledCircle: PD.Boolean('Point Filled Circle', '', false), pointEdgeBleach: PD.Numeric('Point Edge Bleach', '', 0.2, 0, 1, 0.05), } - export const DefaultProps = PD.getDefaultValues(Params) - export type Props = typeof DefaultProps + export type Params = typeof Params - export async function createValues(ctx: RuntimeContext, points: Points, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: Props): Promise<PointsValues> { + export async function createValues(ctx: RuntimeContext, points: Points, transform: TransformData, locationIt: LocationIterator, theme: Theme, props: PD.Values<Params>): Promise<PointsValues> { const { instanceCount, groupCount } = locationIt const color = await createColors(ctx, locationIt, theme.color) const size = await createSizes(ctx, locationIt, theme.size) @@ -93,7 +92,7 @@ export namespace Points { } } - export function updateValues(values: PointsValues, props: Props) { + export function updateValues(values: PointsValues, props: PD.Values<Params>) { const boundingSphere = calculateBoundingSphere( values.aPosition.ref.value, Math.floor(values.aPosition.ref.value.length / 3), values.aTransform.ref.value, values.instanceCount.ref.value