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
de782def
Commit
de782def
authored
2 years ago
by
Michal Malý
Browse files
Options
Downloads
Patches
Plain Diff
ReDNATCO plugin stage 26
parent
3dda801c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/apps/rednatco/api.ts
+8
-2
8 additions, 2 deletions
src/apps/rednatco/api.ts
src/apps/rednatco/index.tsx
+2
-0
2 additions, 0 deletions
src/apps/rednatco/index.tsx
src/apps/rednatco/viewer.ts
+7
-7
7 additions, 7 deletions
src/apps/rednatco/viewer.ts
with
17 additions
and
9 deletions
src/apps/rednatco/api.ts
+
8
−
2
View file @
de782def
...
...
@@ -93,21 +93,27 @@ export namespace ReDNATCOMspApi {
Events
.
StructureLoaded
;
export
namespace
Queries
{
export
type
Type
=
'
current-filter
'
|
'
selected-step
'
;
export
type
Type
=
'
current-filter
'
|
'
current-model-number
'
|
'
selected-step
'
;
export
type
CurrentFilter
=
{
type
:
'
current-filter
'
,
filter
:
Filters
.
All
}
export
function
CurrentFilter
(
filter
:
Filters
.
All
):
CurrentFilter
{
return
{
type
:
'
current-filter
'
,
filter
};
}
export
type
CurrentModelNumber
=
{
type
:
'
current-model-number
'
,
num
:
number
};
export
function
CurrentModelNumber
(
num
:
number
):
CurrentModelNumber
{
return
{
type
:
'
current-model-number
'
,
num
};
}
export
type
SelectedStep
=
{
type
:
'
selected-step
'
,
name
:
string
,
rmsd
?:
number
}
export
function
SelectedStep
(
name
:
string
,
rmsd
?:
number
):
SelectedStep
{
return
{
type
:
'
selected-step
'
,
name
,
rmsd
};
}
}
export
type
Response
=
Queries
.
CurrentFilter
|
Queries
.
SelectedStep
;
export
type
Response
=
Queries
.
CurrentFilter
|
Queries
.
CurrentModelNumber
|
Queries
.
SelectedStep
;
export
type
ResponseTypes
=
{
'
current-filter
'
:
Queries
.
CurrentFilter
,
'
current-model-number
'
:
Queries
.
CurrentModelNumber
,
'
selected-step
'
:
Queries
.
SelectedStep
,
}
...
...
This diff is collapsed.
Click to expand it.
src/apps/rednatco/index.tsx
+
2
−
0
View file @
de782def
...
...
@@ -151,6 +151,8 @@ export class ReDNATCOMsp extends React.Component<ReDNATCOMsp.Props, State> {
apiQuery
(
type
:
Api
.
Queries
.
Type
):
Api
.
Response
{
if
(
type
===
'
current-filter
'
)
{
return
Api
.
Queries
.
CurrentFilter
(
this
.
currentFilter
);
}
else
if
(
type
===
'
current-model-number
'
)
{
return
Api
.
Queries
.
CurrentModelNumber
(
this
.
viewer
!
.
currentModelNumber
());
}
else
if
(
type
===
'
selected-step
'
)
{
if
(
this
.
selectedStep
)
return
Api
.
Queries
.
SelectedStep
(
this
.
selectedStep
.
name
,
this
.
selectedStep
.
rmsd
);
...
...
This diff is collapsed.
Click to expand it.
src/apps/rednatco/viewer.ts
+
7
−
7
View file @
de782def
...
...
@@ -263,13 +263,6 @@ export class ReDNATCOMspViewer {
this
.
app
=
app
;
}
private
currentModelNumber
()
{
const
model
=
this
.
plugin
.
state
.
data
.
cells
.
get
(
IDs
.
ID
(
'
model
'
,
''
,
BaseRef
))?.
obj
;
if
(
!
model
)
return
-
1
;
return
(
model
as
StateObject
<
Model
>
).
data
.
modelNum
;
}
private
focusOnLoci
(
loci
:
StructureElement
.
Loci
)
{
if
(
!
this
.
plugin
.
canvas3d
)
return
;
...
...
@@ -668,6 +661,13 @@ export class ReDNATCOMspViewer {
await
b
.
commit
();
}
currentModelNumber
()
{
const
model
=
this
.
plugin
.
state
.
data
.
cells
.
get
(
IDs
.
ID
(
'
model
'
,
''
,
BaseRef
))?.
obj
;
if
(
!
model
)
return
-
1
;
return
(
model
as
StateObject
<
Model
>
).
data
.
modelNum
;
}
focusOnSelectedStep
()
{
// Focus camera on the selection
const
sel
=
this
.
plugin
.
state
.
data
.
cells
.
get
(
IDs
.
ID
(
'
superposition
'
,
''
,
NtCSupSel
));
...
...
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