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
157f51d9
Commit
157f51d9
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
added spacefill repr
parent
f62a431e
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
+3
-1
3 additions, 1 deletion
src/mol-repr/structure/registry.ts
src/mol-repr/structure/representation/spacefill.ts
+38
-25
38 additions, 25 deletions
src/mol-repr/structure/representation/spacefill.ts
with
41 additions
and
26 deletions
src/mol-repr/structure/registry.ts
+
3
−
1
View file @
157f51d9
...
...
@@ -10,6 +10,7 @@ import { CartoonRepresentationProvider } from './representation/cartoon';
import
{
BallAndStickRepresentationProvider
}
from
'
./representation/ball-and-stick
'
;
import
{
MolecularSurfaceRepresentationProvider
}
from
'
./representation/molecular-surface
'
;
import
{
CarbohydrateRepresentationProvider
}
from
'
./representation/carbohydrate
'
;
import
{
SpacefillRepresentationProvider
}
from
'
./representation/spacefill
'
;
export
class
StructureRepresentationRegistry
extends
RepresentationRegistry
<
Structure
>
{
constructor
()
{
...
...
@@ -24,8 +25,9 @@ export class StructureRepresentationRegistry extends RepresentationRegistry<Stru
export
const
BuiltInStructureRepresentations
=
{
'
cartoon
'
:
CartoonRepresentationProvider
,
'
ball-and-stick
'
:
BallAndStickRepresentationProvider
,
'
molecular-surface
'
:
MolecularSurfaceRepresentationProvider
,
'
carbohydrate
'
:
CarbohydrateRepresentationProvider
,
'
molecular-surface
'
:
MolecularSurfaceRepresentationProvider
,
'
spacefill
'
:
SpacefillRepresentationProvider
,
}
export
type
BuiltInStructureRepresentationsName
=
keyof
typeof
BuiltInStructureRepresentations
export
const
BuiltInStructureRepresentationsNames
=
Object
.
keys
(
BuiltInStructureRepresentations
)
...
...
This diff is collapsed.
Click to expand it.
src/mol-repr/structure/representation/spacefill.ts
+
38
−
25
View file @
157f51d9
//
/**
//
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
//
*
//
* @author Alexander Rose <alexander.rose@weirdbyte.de>
//
*/
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
// import { ElementSphereVisual, ElementSphereParams } from '../visual/element-sphere';
// import { UnitsRepresentation } from '../units-representation';
// import { ParamDefinition as PD } from 'mol-util/param-definition';
// import { StructureRepresentation } from '../representation';
// import { Representation } from 'mol-repr/representation';
// import { ThemeRegistryContext } from 'mol-theme/theme';
// import { Structure } from 'mol-model/structure';
import
{
ElementSphereVisual
,
ElementSphereParams
}
from
'
../visual/element-sphere
'
;
import
{
UnitsRepresentation
}
from
'
../units-representation
'
;
import
{
ParamDefinition
as
PD
}
from
'
mol-util/param-definition
'
;
import
{
StructureRepresentation
,
StructureRepresentationProvider
}
from
'
../representation
'
;
import
{
RepresentationParamsGetter
,
RepresentationContext
,
Representation
}
from
'
mol-repr/representation
'
;
import
{
ThemeRegistryContext
}
from
'
mol-theme/theme
'
;
import
{
Structure
}
from
'
mol-model/structure
'
;
import
{
UnitKind
,
UnitKindOptions
}
from
'
../visual/util/common
'
;
// export const SpacefillParams = {
// ...ElementSphereParams,
// }
// export function getSpacefillParams(ctx: ThemeRegistryContext, structure: Structure) {
// return SpacefillParams // TODO return copy
// }
// export type SpacefillProps = PD.DefaultValues<typeof SpacefillParams>
const
SpacefillVisuals
=
{
'
element-sphere
'
:
(
ctx
:
RepresentationContext
,
getParams
:
RepresentationParamsGetter
<
Structure
,
ElementSphereParams
>
)
=>
UnitsRepresentation
(
'
Sphere mesh
'
,
ctx
,
getParams
,
ElementSphereVisual
),
}
// export type SpacefillRepresentation = StructureRepresentation<SpacefillProps>
export
const
SpacefillParams
=
{
...
ElementSphereParams
,
unitKinds
:
PD
.
MultiSelect
<
UnitKind
>
([
'
atomic
'
,
'
gaussians
'
],
UnitKindOptions
),
}
export
type
SpacefillParams
=
typeof
SpacefillParams
export
function
getSpacefillParams
(
ctx
:
ThemeRegistryContext
,
structure
:
Structure
)
{
return
PD
.
clone
(
SpacefillParams
)
}
// export function SpacefillRepresentation(defaultProps: SpacefillProps): SpacefillRepresentation {
// return Representation.createMulti('Spacefill', defaultProps, [
// UnitsRepresentation('Sphere mesh', defaultProps, ElementSphereVisual)
// ])
// }
\ No newline at end of file
export
type
SpacefillRepresentation
=
StructureRepresentation
<
SpacefillParams
>
export
function
SpacefillRepresentation
(
ctx
:
RepresentationContext
,
getParams
:
RepresentationParamsGetter
<
Structure
,
SpacefillParams
>
):
SpacefillRepresentation
{
return
Representation
.
createMulti
(
'
Spacefill
'
,
ctx
,
getParams
,
SpacefillVisuals
as
unknown
as
Representation
.
Def
<
Structure
,
SpacefillParams
>
)
}
export
const
SpacefillRepresentationProvider
:
StructureRepresentationProvider
<
typeof
SpacefillParams
>
=
{
label
:
'
Spacefill
'
,
description
:
'
Displays atoms as spheres.
'
,
factory
:
SpacefillRepresentation
,
getParams
:
getSpacefillParams
,
defaultValues
:
PD
.
getDefaultValues
(
SpacefillParams
),
defaultColorTheme
:
'
element-symbol
'
,
defaultSizeTheme
:
'
physical
'
}
\ No newline at end of file
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