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
b40df2f1
Commit
b40df2f1
authored
5 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
sequence, on state tree change improvments
parent
884cb0d9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mol-model/structure/structure/structure.ts
+5
-0
5 additions, 0 deletions
src/mol-model/structure/structure/structure.ts
src/mol-plugin/ui/sequence.tsx
+3
-1
3 additions, 1 deletion
src/mol-plugin/ui/sequence.tsx
src/mol-state/tree/spine.ts
+2
-2
2 additions, 2 deletions
src/mol-state/tree/spine.ts
with
10 additions
and
3 deletions
src/mol-model/structure/structure/structure.ts
+
5
−
0
View file @
b40df2f1
...
@@ -513,6 +513,11 @@ namespace Structure {
...
@@ -513,6 +513,11 @@ namespace Structure {
return
areEquivalent
(
a
.
parent
||
a
,
b
.
parent
||
b
)
return
areEquivalent
(
a
.
parent
||
a
,
b
.
parent
||
b
)
}
}
/** Check if the structures or their parents are equal */
export
function
areParentsEqual
(
a
:
Structure
,
b
:
Structure
)
{
return
(
a
.
parent
||
a
)
===
(
b
.
parent
||
b
)
}
export
class
ElementLocationIterator
implements
Iterator
<
StructureElement
>
{
export
class
ElementLocationIterator
implements
Iterator
<
StructureElement
>
{
private
current
=
StructureElement
.
create
();
private
current
=
StructureElement
.
create
();
private
unitIndex
=
0
;
private
unitIndex
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/mol-plugin/ui/sequence.tsx
+
3
−
1
View file @
b40df2f1
...
@@ -128,7 +128,9 @@ export class SequenceView extends PluginUIComponent<{ }, SequenceViewState> {
...
@@ -128,7 +128,9 @@ export class SequenceView extends PluginUIComponent<{ }, SequenceViewState> {
this
.
subscribe
(
this
.
plugin
.
state
.
behavior
.
currentObject
,
o
=>
{
this
.
subscribe
(
this
.
plugin
.
state
.
behavior
.
currentObject
,
o
=>
{
const
current
=
this
.
plugin
.
state
.
dataState
.
cells
.
get
(
o
.
ref
)
!
;
const
current
=
this
.
plugin
.
state
.
dataState
.
cells
.
get
(
o
.
ref
)
!
;
this
.
spine
.
current
=
current
this
.
spine
.
current
=
current
this
.
setState
(
this
.
getInitialState
())
if
(
!
Structure
.
areParentsEqual
(
this
.
state
.
structure
,
this
.
getStructure
()))
{
this
.
setState
(
this
.
getInitialState
())
}
});
});
this
.
subscribe
(
this
.
plugin
.
events
.
state
.
object
.
updated
,
({
ref
,
state
})
=>
{
this
.
subscribe
(
this
.
plugin
.
events
.
state
.
object
.
updated
,
({
ref
,
state
})
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/mol-state/tree/spine.ts
+
2
−
2
View file @
b40df2f1
...
@@ -36,15 +36,15 @@ namespace StateTreeSpine {
...
@@ -36,15 +36,15 @@ namespace StateTreeSpine {
getRootOfType
<
T
extends
StateObject
.
Ctor
>
(
t
:
T
):
StateObject
.
From
<
T
>
|
undefined
{
getRootOfType
<
T
extends
StateObject
.
Ctor
>
(
t
:
T
):
StateObject
.
From
<
T
>
|
undefined
{
if
(
!
this
.
_current
)
return
void
0
;
if
(
!
this
.
_current
)
return
void
0
;
let
cell
=
this
.
_current
;
let
cell
=
this
.
_current
;
// check current first
let
ret
:
StateObjectCell
|
undefined
=
void
0
;
let
ret
:
StateObjectCell
|
undefined
=
void
0
;
while
(
true
)
{
while
(
true
)
{
cell
=
this
.
cells
.
get
(
cell
.
transform
.
parent
)
!
;
if
(
!
cell
.
obj
)
return
void
0
;
if
(
!
cell
.
obj
)
return
void
0
;
if
(
cell
.
obj
.
type
===
t
.
type
)
{
if
(
cell
.
obj
.
type
===
t
.
type
)
{
ret
=
cell
;
ret
=
cell
;
}
}
if
(
cell
.
transform
.
ref
===
StateTransform
.
RootRef
)
return
ret
?
ret
.
obj
as
StateObject
.
From
<
T
>
:
void
0
;
if
(
cell
.
transform
.
ref
===
StateTransform
.
RootRef
)
return
ret
?
ret
.
obj
as
StateObject
.
From
<
T
>
:
void
0
;
cell
=
this
.
cells
.
get
(
cell
.
transform
.
parent
)
!
;
// assign parent for next check
}
}
}
}
...
...
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