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
3726f28e
Commit
3726f28e
authored
2 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
defer calculation of more scene properties
parent
ead25d6a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-gl/scene.ts
+26
-10
26 additions, 10 deletions
src/mol-gl/scene.ts
with
26 additions
and
10 deletions
src/mol-gl/scene.ts
+
26
−
10
View file @
3726f28e
/**
* Copyright (c) 2018-202
2
mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-202
3
mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author David Sehnal <david.sehnal@gmail.com>
...
...
@@ -105,6 +105,10 @@ namespace Scene {
let
boundingSphereDirty
=
true
;
let
boundingSphereVisibleDirty
=
true
;
let
markerAverageDirty
=
true
;
let
opacityAverageDirty
=
true
;
let
hasOpaqueDirty
=
true
;
let
markerAverage
=
0
;
let
opacityAverage
=
0
;
let
hasOpaque
=
false
;
...
...
@@ -165,9 +169,9 @@ namespace Scene {
}
renderables
.
sort
(
renderableSort
);
markerAverage
=
calculateMarkerAverage
()
;
opacityAverage
=
calculateOpacityAverage
()
;
hasOpaque
=
calculateHasOpaque
()
;
markerAverage
Dirty
=
true
;
opacityAverage
Dirty
=
true
;
hasOpaque
Dirty
=
true
;
return
true
;
}
...
...
@@ -189,9 +193,9 @@ namespace Scene {
const
newVisibleHash
=
computeVisibleHash
();
if
(
newVisibleHash
!==
visibleHash
)
{
boundingSphereVisibleDirty
=
true
;
markerAverage
=
calculateMarkerAverage
()
;
opacityAverage
=
calculateOpacityAverage
()
;
hasOpaque
=
calculateHasOpaque
()
;
markerAverage
Dirty
=
true
;
opacityAverage
Dirty
=
true
;
hasOpaque
Dirty
=
true
;
visibleHash
=
newVisibleHash
;
return
true
;
}
else
{
...
...
@@ -268,9 +272,9 @@ namespace Scene {
}
else
{
syncVisibility
();
}
markerAverage
=
calculateMarkerAverage
()
;
opacityAverage
=
calculateOpacityAverage
()
;
hasOpaque
=
calculateHasOpaque
()
;
markerAverage
Dirty
=
true
;
opacityAverage
Dirty
=
true
;
hasOpaque
Dirty
=
true
;
},
add
:
(
o
:
GraphicsRenderObject
)
=>
commitQueue
.
add
(
o
),
remove
:
(
o
:
GraphicsRenderObject
)
=>
commitQueue
.
remove
(
o
),
...
...
@@ -311,12 +315,24 @@ namespace Scene {
return
boundingSphereVisible
;
},
get
markerAverage
()
{
if
(
markerAverageDirty
)
{
markerAverage
=
calculateMarkerAverage
();
markerAverageDirty
=
true
;
}
return
markerAverage
;
},
get
opacityAverage
()
{
if
(
opacityAverageDirty
)
{
opacityAverage
=
calculateOpacityAverage
();
opacityAverageDirty
=
true
;
}
return
opacityAverage
;
},
get
hasOpaque
()
{
if
(
hasOpaqueDirty
)
{
hasOpaque
=
calculateHasOpaque
();
hasOpaqueDirty
=
true
;
}
return
hasOpaque
;
},
};
...
...
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