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
198e2f20
Commit
198e2f20
authored
5 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
support for currentSelection in StructureSelectionHelper and surroundings query
parent
6ae3d411
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-plugin/util/structure-selection-helper.ts
+20
-2
20 additions, 2 deletions
src/mol-plugin/util/structure-selection-helper.ts
with
20 additions
and
2 deletions
src/mol-plugin/util/structure-selection-helper.ts
+
20
−
2
View file @
198e2f20
...
...
@@ -7,7 +7,7 @@
import
{
MolScriptBuilder
as
MS
}
from
'
../../mol-script/language/builder
'
;
import
{
StateSelection
}
from
'
../../mol-state
'
;
import
{
PluginStateObject
}
from
'
../state/objects
'
;
import
{
QueryContext
,
StructureSelection
,
StructureQuery
}
from
'
../../mol-model/structure
'
;
import
{
QueryContext
,
StructureSelection
,
StructureQuery
,
StructureElement
}
from
'
../../mol-model/structure
'
;
import
{
compile
}
from
'
../../mol-script/runtime/query/compiler
'
;
import
{
Loci
}
from
'
../../mol-model/loci
'
;
import
{
PluginContext
}
from
'
../context
'
;
...
...
@@ -185,6 +185,17 @@ const coarse = MS.struct.modifier.union([
})
])
const
surroundings
=
MS
.
struct
.
modifier
.
union
([
MS
.
struct
.
modifier
.
exceptBy
({
0
:
MS
.
struct
.
modifier
.
includeSurroundings
({
0
:
MS
.
internal
.
generator
.
current
(),
radius
:
5
,
'
as-whole-residues
'
:
true
}),
by
:
MS
.
internal
.
generator
.
current
()
})
])
export
const
StructureSelectionQueries
=
{
all
,
polymer
,
...
...
@@ -202,6 +213,7 @@ export const StructureSelectionQueries = {
connectedOnly
,
modified
,
coarse
,
surroundings
,
}
export
const
CompiledStructureSelectionQueries
=
(
function
()
{
...
...
@@ -241,7 +253,13 @@ export class StructureSelectionHelper {
for
(
const
so
of
this
.
structures
)
{
const
s
=
so
.
obj
!
.
data
const
result
=
compiled
(
new
QueryContext
(
s
))
const
current
=
this
.
plugin
.
helpers
.
structureSelectionManager
.
get
(
s
)
const
currentSelection
=
Loci
.
isEmpty
(
current
)
?
StructureSelection
.
Empty
(
s
)
:
StructureSelection
.
Singletons
(
s
,
StructureElement
.
Loci
.
toStructure
(
current
))
const
result
=
compiled
(
new
QueryContext
(
s
,
{
currentSelection
}))
const
loci
=
StructureSelection
.
toLociWithSourceUnits
(
result
)
this
.
_set
(
modifier
,
loci
)
}
...
...
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