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
c59c02b8
Commit
c59c02b8
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
update point visual on coordinate changes
parent
0898c035
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-geo/representation/structure/visual/element-point.ts
+15
-3
15 additions, 3 deletions
src/mol-geo/representation/structure/visual/element-point.ts
with
15 additions
and
3 deletions
src/mol-geo/representation/structure/visual/element-point.ts
+
15
−
3
View file @
c59c02b8
...
...
@@ -13,7 +13,7 @@ import { RuntimeContext } from 'mol-task'
import
{
UnitsVisual
,
DefaultStructureProps
}
from
'
..
'
;
import
{
getElementLoci
,
StructureElementIterator
,
markElement
}
from
'
./util/element
'
;
import
{
createTransforms
,
createColors
,
createSizes
,
createUnitsPointRenderObject
}
from
'
./util/common
'
;
import
{
deepEqual
}
from
'
mol-util
'
;
import
{
deepEqual
,
UUID
}
from
'
mol-util
'
;
import
{
Interval
}
from
'
mol-data/int
'
;
import
{
PickingId
}
from
'
../../../util/picking
'
;
import
{
Loci
,
EmptyLoci
,
isEveryLoci
}
from
'
mol-model/loci
'
;
...
...
@@ -58,6 +58,7 @@ export function ElementPointVisual(): UnitsVisual<ElementPointProps> {
let
currentGroup
:
Unit
.
SymmetryGroup
let
locationIt
:
LocationIterator
let
vertices
:
ValueCell
<
Float32Array
>
let
currentConformationId
:
UUID
return
{
get
renderObject
()
{
return
renderObject
},
...
...
@@ -68,20 +69,31 @@ export function ElementPointVisual(): UnitsVisual<ElementPointProps> {
currentProps
=
Object
.
assign
({},
DefaultElementPointProps
,
props
)
currentGroup
=
group
locationIt
=
StructureElementIterator
.
fromGroup
(
group
)
vertices
=
await
createElementPointVertices
(
ctx
,
group
.
units
[
0
],
vertices
)
const
unit
=
group
.
units
[
0
]
currentConformationId
=
Unit
.
conformationId
(
unit
)
vertices
=
await
createElementPointVertices
(
ctx
,
unit
,
vertices
)
renderObject
=
await
createUnitsPointRenderObject
(
ctx
,
group
,
vertices
,
locationIt
,
currentProps
)
}
else
if
(
renderObject
)
{
if
(
group
)
currentGroup
=
group
const
newProps
=
{
...
currentProps
,
...
props
}
const
unit
=
currentGroup
.
units
[
0
]
let
updateTransform
=
false
let
createVertices
=
false
let
updateColor
=
false
let
updateSize
=
false
const
newConformationId
=
Unit
.
conformationId
(
unit
)
if
(
newConformationId
!==
currentConformationId
)
{
currentConformationId
=
newConformationId
createVertices
=
true
}
if
(
currentGroup
.
units
.
length
!==
locationIt
.
instanceCount
)
updateTransform
=
true
if
(
!
deepEqual
(
newProps
.
sizeTheme
,
currentProps
.
sizeTheme
))
createVertices
=
true
if
(
!
deepEqual
(
newProps
.
colorTheme
,
currentProps
.
colorTheme
))
updateColor
=
true
if
(
!
deepEqual
(
newProps
.
sizeTheme
,
currentProps
.
sizeTheme
))
updateSize
=
true
...
...
@@ -98,7 +110,7 @@ export function ElementPointVisual(): UnitsVisual<ElementPointProps> {
}
if
(
createVertices
)
{
await
createElementPointVertices
(
ctx
,
currentGroup
.
units
[
0
]
,
vertices
)
await
createElementPointVertices
(
ctx
,
unit
,
vertices
)
ValueCell
.
update
(
renderObject
.
values
.
aGroup
,
fillSerial
(
new
Float32Array
(
locationIt
.
groupCount
)))
// TODO reuse array
ValueCell
.
update
(
renderObject
.
values
.
drawCount
,
locationIt
.
groupCount
)
updateColor
=
true
...
...
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