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
bbad6f98
Commit
bbad6f98
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
some docs
parent
c15a1bff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-model/structure/structure/unit/links/data.ts
+5
-0
5 additions, 0 deletions
src/mol-model/structure/structure/unit/links/data.ts
with
5 additions
and
0 deletions
src/mol-model/structure/structure/unit/links/data.ts
+
5
−
0
View file @
bbad6f98
...
@@ -18,10 +18,13 @@ namespace IntraUnitLinks {
...
@@ -18,10 +18,13 @@ namespace IntraUnitLinks {
}
}
class
InterUnitBonds
{
class
InterUnitBonds
{
/** Number of inter-unit bonds */
readonly
bondCount
:
number
readonly
bondCount
:
number
/** Array of inter-unit bonds */
readonly
bonds
:
ReadonlyArray
<
InterUnitBonds
.
Bond
>
readonly
bonds
:
ReadonlyArray
<
InterUnitBonds
.
Bond
>
private
readonly
bondKeyIndex
:
Map
<
string
,
number
>
private
readonly
bondKeyIndex
:
Map
<
string
,
number
>
/** Get an array of unit-pair-bonds that are linked to the given unit */
getLinkedUnits
(
unit
:
Unit
):
ReadonlyArray
<
InterUnitBonds
.
UnitPairBonds
>
{
getLinkedUnits
(
unit
:
Unit
):
ReadonlyArray
<
InterUnitBonds
.
UnitPairBonds
>
{
if
(
!
this
.
map
.
has
(
unit
.
id
))
return
emptyArray
;
if
(
!
this
.
map
.
has
(
unit
.
id
))
return
emptyArray
;
return
this
.
map
.
get
(
unit
.
id
)
!
;
return
this
.
map
.
get
(
unit
.
id
)
!
;
...
@@ -34,11 +37,13 @@ class InterUnitBonds {
...
@@ -34,11 +37,13 @@ class InterUnitBonds {
return
index
!==
undefined
?
index
:
-
1
return
index
!==
undefined
?
index
:
-
1
}
}
/** Get inter-unit bond given a pair of indices and units */
getBond
(
indexA
:
StructureElement
.
UnitIndex
,
unitA
:
Unit
,
indexB
:
StructureElement
.
UnitIndex
,
unitB
:
Unit
):
InterUnitBonds
.
Bond
|
undefined
{
getBond
(
indexA
:
StructureElement
.
UnitIndex
,
unitA
:
Unit
,
indexB
:
StructureElement
.
UnitIndex
,
unitB
:
Unit
):
InterUnitBonds
.
Bond
|
undefined
{
const
index
=
this
.
getBondIndex
(
indexA
,
unitA
,
indexB
,
unitB
)
const
index
=
this
.
getBondIndex
(
indexA
,
unitA
,
indexB
,
unitB
)
return
index
!==
-
1
?
this
.
bonds
[
index
]
:
undefined
return
index
!==
-
1
?
this
.
bonds
[
index
]
:
undefined
}
}
/** Get inter-unit bond given a link-location */
getBondFromLocation
(
l
:
Link
.
Location
)
{
getBondFromLocation
(
l
:
Link
.
Location
)
{
return
this
.
getBond
(
l
.
aIndex
,
l
.
aUnit
,
l
.
bIndex
,
l
.
bUnit
);
return
this
.
getBond
(
l
.
aIndex
,
l
.
aUnit
,
l
.
bIndex
,
l
.
bUnit
);
}
}
...
...
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