|
@@ -20,6 +20,7 @@ import { Mat4 } from 'mol-math/linear-algebra';
|
|
import { BaseGeometry } from 'mol-geo/geometry/base';
|
|
import { BaseGeometry } from 'mol-geo/geometry/base';
|
|
import { Visual } from './visual';
|
|
import { Visual } from './visual';
|
|
import { Overpaint } from 'mol-theme/overpaint';
|
|
import { Overpaint } from 'mol-theme/overpaint';
|
|
|
|
+import { Transparency } from 'mol-theme/transparency';
|
|
|
|
|
|
// export interface RepresentationProps {
|
|
// export interface RepresentationProps {
|
|
// visuals?: string[]
|
|
// visuals?: string[]
|
|
@@ -146,19 +147,22 @@ namespace Representation {
|
|
pickable: boolean
|
|
pickable: boolean
|
|
/** Overpaint applied to the representation's renderobjects */
|
|
/** Overpaint applied to the representation's renderobjects */
|
|
overpaint: Overpaint
|
|
overpaint: Overpaint
|
|
|
|
+ /** Per group transparency applied to the representation's renderobjects */
|
|
|
|
+ transparency: Transparency
|
|
/** Controls if the representation's renderobjects are synced automatically with GPU or not */
|
|
/** Controls if the representation's renderobjects are synced automatically with GPU or not */
|
|
syncManually: boolean
|
|
syncManually: boolean
|
|
/** A transformation applied to the representation's renderobjects */
|
|
/** A transformation applied to the representation's renderobjects */
|
|
transform: Mat4
|
|
transform: Mat4
|
|
}
|
|
}
|
|
export function createState(): State {
|
|
export function createState(): State {
|
|
- return { visible: false, alphaFactor: 0, pickable: false, syncManually: false, transform: Mat4.identity(), overpaint: Overpaint.Empty }
|
|
|
|
|
|
+ return { visible: false, alphaFactor: 0, pickable: false, syncManually: false, transform: Mat4.identity(), overpaint: Overpaint.Empty, transparency: Transparency.Empty }
|
|
}
|
|
}
|
|
export function updateState(state: State, update: Partial<State>) {
|
|
export function updateState(state: State, update: Partial<State>) {
|
|
if (update.visible !== undefined) state.visible = update.visible
|
|
if (update.visible !== undefined) state.visible = update.visible
|
|
if (update.alphaFactor !== undefined) state.alphaFactor = update.alphaFactor
|
|
if (update.alphaFactor !== undefined) state.alphaFactor = update.alphaFactor
|
|
if (update.pickable !== undefined) state.pickable = update.pickable
|
|
if (update.pickable !== undefined) state.pickable = update.pickable
|
|
if (update.overpaint !== undefined) state.overpaint = update.overpaint
|
|
if (update.overpaint !== undefined) state.overpaint = update.overpaint
|
|
|
|
+ if (update.transparency !== undefined) state.transparency = update.transparency
|
|
if (update.syncManually !== undefined) state.syncManually = update.syncManually
|
|
if (update.syncManually !== undefined) state.syncManually = update.syncManually
|
|
if (update.transform !== undefined) Mat4.copy(state.transform, update.transform)
|
|
if (update.transform !== undefined) Mat4.copy(state.transform, update.transform)
|
|
}
|
|
}
|
|
@@ -322,6 +326,9 @@ namespace Representation {
|
|
if (state.overpaint !== undefined) {
|
|
if (state.overpaint !== undefined) {
|
|
// TODO
|
|
// TODO
|
|
}
|
|
}
|
|
|
|
+ if (state.transparency !== undefined) {
|
|
|
|
+ // TODO
|
|
|
|
+ }
|
|
if (state.transform !== undefined) Visual.setTransform(renderObject, state.transform)
|
|
if (state.transform !== undefined) Visual.setTransform(renderObject, state.transform)
|
|
|
|
|
|
Representation.updateState(currentState, state)
|
|
Representation.updateState(currentState, state)
|