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
458aad01
Commit
458aad01
authored
2 years ago
by
dsehnal
Browse files
Options
Downloads
Patches
Plain Diff
Volume.PickingGranuality custom property
parent
9e313246
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/cli/structure-info/volume.ts
+1
-1
1 addition, 1 deletion
src/cli/structure-info/volume.ts
src/mol-model/volume/volume.ts
+10
-0
10 additions, 0 deletions
src/mol-model/volume/volume.ts
src/mol-repr/volume/isosurface.ts
+3
-3
3 additions, 3 deletions
src/mol-repr/volume/isosurface.ts
with
14 additions
and
4 deletions
src/cli/structure-info/volume.ts
+
1
−
1
View file @
458aad01
...
...
@@ -38,7 +38,7 @@ function print(volume: Volume) {
}
async
function
doMesh
(
volume
:
Volume
,
filename
:
string
)
{
const
mesh
=
await
Task
.
create
(
''
,
runtime
=>
createVolumeIsosurfaceMesh
({
runtime
},
volume
,
Theme
.
createEmpty
(),
{
isoValue
:
Volume
.
IsoValue
.
absolute
(
1.5
)
,
pickingGranularity
:
'
voxels
'
})).
run
();
const
mesh
=
await
Task
.
create
(
''
,
runtime
=>
createVolumeIsosurfaceMesh
({
runtime
},
volume
,
Theme
.
createEmpty
(),
{
isoValue
:
Volume
.
IsoValue
.
absolute
(
1.5
)
})).
run
();
console
.
log
({
vc
:
mesh
.
vertexCount
,
tc
:
mesh
.
triangleCount
});
// Export the mesh in OBJ format.
...
...
This diff is collapsed.
Click to expand it.
src/mol-model/volume/volume.ts
+
10
−
0
View file @
458aad01
...
...
@@ -219,4 +219,14 @@ export namespace Volume {
return
Sphere3D
.
expand
(
bs
,
bs
,
Mat4
.
getMaxScaleOnAxis
(
transform
)
*
10
);
}
}
export
type
PickingGranuality
=
'
surface
'
|
'
voxel
'
;
export
const
PickingGranuality
=
{
set
(
volume
:
Volume
,
granuality
:
PickingGranuality
)
{
volume
.
_propertyData
[
'
__picking_granuality__
'
]
=
granuality
;
},
get
(
volume
:
Volume
):
PickingGranuality
{
return
volume
.
_propertyData
[
'
__picking_granuality__
'
]
??
'
voxel
'
;
}
};
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-repr/volume/isosurface.ts
+
3
−
3
View file @
458aad01
...
...
@@ -32,8 +32,7 @@ import { BaseGeometry } from '../../mol-geo/geometry/base';
import
{
ValueCell
}
from
'
../../mol-util/value-cell
'
;
export
const
VolumeIsosurfaceParams
=
{
isoValue
:
Volume
.
IsoValueParam
,
pickingGranularity
:
PD
.
Select
<
'
voxels
'
|
'
surfaces
'
>
(
'
voxels
'
,
[[
'
voxels
'
,
'
Voxels
'
],
[
'
surfaces
'
,
'
Surfaces
'
]]),
isoValue
:
Volume
.
IsoValueParam
};
export
type
VolumeIsosurfaceParams
=
typeof
VolumeIsosurfaceParams
export
type
VolumeIsosurfaceProps
=
PD
.
Values
<
VolumeIsosurfaceParams
>
...
...
@@ -67,8 +66,9 @@ function getLoci(volume: Volume, props: VolumeIsosurfaceProps) {
function
getIsosurfaceLoci
(
pickingId
:
PickingId
,
volume
:
Volume
,
props
:
VolumeIsosurfaceProps
,
id
:
number
)
{
const
{
objectId
,
groupId
}
=
pickingId
;
if
(
id
===
objectId
)
{
if
(
props
.
p
ickingGranu
larity
===
'
surface
s
'
)
{
if
(
Volume
.
P
ickingGranu
ality
.
get
(
volume
)
===
'
surface
'
)
{
return
Volume
.
Isosurface
.
Loci
(
volume
,
props
.
isoValue
);
}
else
{
return
Volume
.
Cell
.
Loci
(
volume
,
Interval
.
ofSingleton
(
groupId
as
Volume
.
CellIndex
));
...
...
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