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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
c87fe6ce
Commit
c87fe6ce
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
support StructureElement in eachPolymerGapElement
parent
e1d1490d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-repr/structure/visual/util/polymer.ts
+27
-11
27 additions, 11 deletions
src/mol-repr/structure/visual/util/polymer.ts
with
27 additions
and
11 deletions
src/mol-repr/structure/visual/util/polymer.ts
+
27
−
11
View file @
c87fe6ce
...
@@ -154,7 +154,7 @@ export function getPolymerGapElementLoci(pickingId: PickingId, structureGroup: S
...
@@ -154,7 +154,7 @@ export function getPolymerGapElementLoci(pickingId: PickingId, structureGroup: S
export
function
eachPolymerGapElement
(
loci
:
Loci
,
structureGroup
:
StructureGroup
,
apply
:
(
interval
:
Interval
)
=>
boolean
)
{
export
function
eachPolymerGapElement
(
loci
:
Loci
,
structureGroup
:
StructureGroup
,
apply
:
(
interval
:
Interval
)
=>
boolean
)
{
let
changed
=
false
let
changed
=
false
if
(
!
Link
.
isLoci
(
loci
))
return
false
if
(
Link
.
isLoci
(
loci
))
{
const
{
structure
,
group
}
=
structureGroup
const
{
structure
,
group
}
=
structureGroup
if
(
!
Structure
.
areEquivalent
(
loci
.
structure
,
structure
))
return
false
if
(
!
Structure
.
areEquivalent
(
loci
.
structure
,
structure
))
return
false
const
groupCount
=
group
.
units
[
0
].
gapElements
.
length
const
groupCount
=
group
.
units
[
0
].
gapElements
.
length
...
@@ -168,5 +168,21 @@ export function eachPolymerGapElement(loci: Loci, structureGroup: StructureGroup
...
@@ -168,5 +168,21 @@ export function eachPolymerGapElement(loci: Loci, structureGroup: StructureGroup
}
}
}
}
}
}
}
else
if
(
StructureElement
.
isLoci
(
loci
))
{
const
{
structure
,
group
}
=
structureGroup
if
(
!
Structure
.
areEquivalent
(
loci
.
structure
,
structure
))
return
false
const
groupCount
=
group
.
units
[
0
].
gapElements
.
length
for
(
const
e
of
loci
.
elements
)
{
const
unitIdx
=
group
.
unitIndexMap
.
get
(
e
.
unit
.
id
)
if
(
unitIdx
!==
undefined
)
{
OrderedSet
.
forEach
(
e
.
indices
,
v
=>
{
const
idx
=
OrderedSet
.
indexOf
(
e
.
unit
.
gapElements
,
e
.
unit
.
elements
[
v
])
if
(
idx
!==
-
1
)
{
if
(
apply
(
Interval
.
ofSingleton
(
unitIdx
*
groupCount
+
idx
)))
changed
=
true
}
})
}
}
}
return
changed
return
changed
}
}
\ 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