Skip to content

Commit

Permalink
feat: virtual node
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshh committed Jul 17, 2023
1 parent 88a1b62 commit d6dc9b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/neuroglancer/datasource/graphene/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ import {Uint64} from 'neuroglancer/util/uint64';
import {makeDeleteButton} from 'neuroglancer/widget/delete_button';
import {DependentViewContext} from 'neuroglancer/widget/dependent_view_widget';
import {makeIcon} from 'neuroglancer/widget/icon';
import {TrackableBoolean, TrackableBooleanCheckbox} from 'neuroglancer/trackable_boolean';
import {makeDeleteButton} from 'neuroglancer/widget/delete_button';
import {VertexPositionFormat} from 'neuroglancer/mesh/base';

function vec4FromVec3(vec: vec3, alpha = 0) {
Expand Down
9 changes: 7 additions & 2 deletions src/neuroglancer/mesh/multiscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function getDesiredMultiscaleMeshChunks(
const size = 1 << lod;
const rowOffset = row * 5;
const gridX = octree[rowOffset], gridY = octree[rowOffset + 1], gridZ = octree[rowOffset + 2],
childBegin = octree[rowOffset + 3], childEndAndEmpty = octree[rowOffset + 4];
childBeginAndVirtual = octree[rowOffset + 3], childEndAndEmpty = octree[rowOffset + 4];
let xLower = gridX * size * chunkShape[0] + chunkGridSpatialOrigin[0],
yLower = gridY * size * chunkShape[1] + chunkGridSpatialOrigin[1],
zLower = gridZ * size * chunkShape[2] + chunkGridSpatialOrigin[2];
Expand All @@ -152,13 +152,18 @@ export function getDesiredMultiscaleMeshChunks(
const pixelSize = minW / scaleFactor;

if (priorLodScale === 0 || pixelSize * detailCutoff < priorLodScale) {
const lodScale = lodScales[lod];
let lodScale = lodScales[lod];
if ((childBeginAndVirtual & (1 << 31)) !== 0) {
lodScale = 0;
}

if (lodScale !== 0) {
callback(lod, row, lodScale / pixelSize, (childEndAndEmpty >>> 31));
}

if (lod > 0 && (lodScale === 0 || pixelSize * detailCutoff < lodScale)) {
const nextPriorLodScale = lodScale === 0 ? priorLodScale : lodScale;
const childBegin = (childBeginAndVirtual & 0x7FFFFFFF) >>> 0;
const childEnd = (childEndAndEmpty & 0x7FFFFFFF) >>> 0;
for (let childRow = childBegin; childRow < childEnd; ++childRow) {
handleChunk(lod - 1, childRow, nextPriorLodScale);
Expand Down

0 comments on commit d6dc9b3

Please sign in to comment.