Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
61a2602c
Commit
61a2602c
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
registered molecular surface representation
parent
be9a10b7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-repr/structure/registry.ts
+2
-0
2 additions, 0 deletions
src/mol-repr/structure/registry.ts
src/mol-repr/structure/representation/molecular-surface.ts
+52
-15
52 additions, 15 deletions
src/mol-repr/structure/representation/molecular-surface.ts
with
54 additions
and
15 deletions
src/mol-repr/structure/registry.ts
+
2
−
0
View file @
61a2602c
...
@@ -8,6 +8,7 @@ import { Structure } from 'mol-model/structure';
...
@@ -8,6 +8,7 @@ import { Structure } from 'mol-model/structure';
import
{
RepresentationProvider
,
RepresentationRegistry
}
from
'
../representation
'
;
import
{
RepresentationProvider
,
RepresentationRegistry
}
from
'
../representation
'
;
import
{
CartoonRepresentationProvider
}
from
'
./representation/cartoon
'
;
import
{
CartoonRepresentationProvider
}
from
'
./representation/cartoon
'
;
import
{
BallAndStickRepresentationProvider
}
from
'
./representation/ball-and-stick
'
;
import
{
BallAndStickRepresentationProvider
}
from
'
./representation/ball-and-stick
'
;
import
{
MolecularSurfaceRepresentationProvider
}
from
'
./representation/molecular-surface
'
;
export
class
StructureRepresentationRegistry
extends
RepresentationRegistry
<
Structure
>
{
export
class
StructureRepresentationRegistry
extends
RepresentationRegistry
<
Structure
>
{
constructor
()
{
constructor
()
{
...
@@ -22,6 +23,7 @@ export class StructureRepresentationRegistry extends RepresentationRegistry<Stru
...
@@ -22,6 +23,7 @@ export class StructureRepresentationRegistry extends RepresentationRegistry<Stru
export
const
BuiltInStructureRepresentations
=
{
export
const
BuiltInStructureRepresentations
=
{
'
cartoon
'
:
CartoonRepresentationProvider
,
'
cartoon
'
:
CartoonRepresentationProvider
,
'
ball-and-stick
'
:
BallAndStickRepresentationProvider
,
'
ball-and-stick
'
:
BallAndStickRepresentationProvider
,
'
molecular-surface
'
:
MolecularSurfaceRepresentationProvider
,
}
}
export
type
BuiltInStructureRepresentationsName
=
keyof
typeof
BuiltInStructureRepresentations
export
type
BuiltInStructureRepresentationsName
=
keyof
typeof
BuiltInStructureRepresentations
export
const
BuiltInStructureRepresentationsNames
=
Object
.
keys
(
BuiltInStructureRepresentations
)
export
const
BuiltInStructureRepresentationsNames
=
Object
.
keys
(
BuiltInStructureRepresentations
)
...
...
This diff is collapsed.
Click to expand it.
src/mol-repr/structure/representation/molecular-surface.ts
+
52
−
15
View file @
61a2602c
// /**
/**
// * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
// *
*
// * @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
// */
*/
// import { GaussianSurfaceVisual, GaussianSurfaceParams } from '../visual/gaussian-surface-mesh';
import
{
GaussianSurfaceVisual
,
GaussianSurfaceParams
}
from
'
../visual/gaussian-surface-mesh
'
;
// import { UnitsRepresentation } from '../units-representation';
import
{
UnitsRepresentation
}
from
'
../units-representation
'
;
// import { GaussianWireframeVisual, GaussianWireframeParams } from '../visual/gaussian-surface-wireframe';
import
{
GaussianWireframeVisual
,
GaussianWireframeParams
}
from
'
../visual/gaussian-surface-wireframe
'
;
// import { ParamDefinition as PD } from 'mol-util/param-definition';
import
{
ParamDefinition
as
PD
}
from
'
mol-util/param-definition
'
;
// import { GaussianDensityVolumeParams, GaussianDensityVolumeVisual } from '../visual/gaussian-density-volume';
import
{
GaussianDensityVolumeParams
,
GaussianDensityVolumeVisual
}
from
'
../visual/gaussian-density-volume
'
;
// import { StructureRepresentation } from '../representation';
import
{
StructureRepresentation
,
StructureRepresentationProvider
}
from
'
../representation
'
;
// import { Representation } from 'mol-repr/representation';
import
{
Representation
,
RepresentationParamsGetter
}
from
'
mol-repr/representation
'
;
// import { ThemeRegistryContext } from 'mol-theme/theme';
import
{
ThemeRegistryContext
}
from
'
mol-theme/theme
'
;
// import { Structure } from 'mol-model/structure';
import
{
Structure
}
from
'
mol-model/structure
'
;
import
{
BuiltInColorThemeOptions
,
getBuiltInColorThemeParams
}
from
'
mol-theme/color
'
;
const
MolecularSurfaceVisuals
=
{
'
gaussian-surface
'
:
(
getParams
:
RepresentationParamsGetter
<
Structure
,
GaussianSurfaceParams
>
)
=>
UnitsRepresentation
(
'
Gaussian surface
'
,
getParams
,
GaussianSurfaceVisual
),
'
gaussian-wireframe
'
:
(
getParams
:
RepresentationParamsGetter
<
Structure
,
GaussianWireframeParams
>
)
=>
UnitsRepresentation
(
'
Gaussian wireframe
'
,
getParams
,
GaussianWireframeVisual
),
'
gaussian-volume
'
:
(
getParams
:
RepresentationParamsGetter
<
Structure
,
GaussianDensityVolumeParams
>
)
=>
UnitsRepresentation
(
'
Gaussian volume
'
,
getParams
,
GaussianDensityVolumeVisual
)
}
type
MolecularSurfaceVisualName
=
keyof
typeof
MolecularSurfaceVisuals
const
MolecularSurfaceVisualOptions
=
Object
.
keys
(
MolecularSurfaceVisuals
).
map
(
name
=>
[
name
,
name
]
as
[
MolecularSurfaceVisualName
,
string
])
export
const
MolecularSurfaceParams
=
{
...
GaussianSurfaceParams
,
...
GaussianWireframeParams
,
...
GaussianDensityVolumeParams
,
colorTheme
:
PD
.
Mapped
(
'
polymer-index
'
,
BuiltInColorThemeOptions
,
getBuiltInColorThemeParams
),
visuals
:
PD
.
MultiSelect
<
MolecularSurfaceVisualName
>
([
'
gaussian-surface
'
],
MolecularSurfaceVisualOptions
),
}
PD
.
getDefaultValues
(
MolecularSurfaceParams
).
colorTheme
.
name
export
type
MolecularSurfaceParams
=
typeof
MolecularSurfaceParams
export
function
getMolecularSurfaceParams
(
ctx
:
ThemeRegistryContext
,
structure
:
Structure
)
{
return
PD
.
clone
(
MolecularSurfaceParams
)
}
export
type
MolecularSurfaceRepresentation
=
StructureRepresentation
<
MolecularSurfaceParams
>
export
function
MolecularSurfaceRepresentation
(
getParams
:
RepresentationParamsGetter
<
Structure
,
MolecularSurfaceParams
>
):
MolecularSurfaceRepresentation
{
return
Representation
.
createMulti
(
'
Molecular Surface
'
,
getParams
,
MolecularSurfaceVisuals
as
unknown
as
Representation
.
Def
<
Structure
,
MolecularSurfaceParams
>
)
}
export
const
MolecularSurfaceRepresentationProvider
:
StructureRepresentationProvider
<
MolecularSurfaceParams
>
=
{
label
:
'
Molecular Surface
'
,
description
:
'
Displays a gaussian molecular surface.
'
,
factory
:
MolecularSurfaceRepresentation
,
getParams
:
getMolecularSurfaceParams
,
defaultValues
:
PD
.
getDefaultValues
(
MolecularSurfaceParams
)
}
// export const MolecularSurfaceParams = {
// export const MolecularSurfaceParams = {
// ...GaussianSurfaceParams,
// ...GaussianSurfaceParams,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment