-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
103 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* global describe, it */ | ||
import assert from 'assert'; | ||
import { Group, Mesh } from 'three'; | ||
import { getObjectToUpdateForAttachedLayers } from '../src/Provider/3dTilesProvider'; | ||
|
||
describe('getObjectToUpdateForAttachedLayers', function () { | ||
it('should correctly return all children', function () { | ||
const layer = { }; | ||
const tile = { | ||
content: new Group(), | ||
layer, | ||
}; | ||
|
||
for (let i = 0; i < 3; i++) { | ||
const mesh = new Mesh(); | ||
mesh.layer = layer; | ||
tile.content.add(mesh); | ||
} | ||
|
||
const result = getObjectToUpdateForAttachedLayers(tile); | ||
assert.ok(Array.isArray(result.elements)); | ||
assert.ok(result.elements.length, 3); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* global describe, it */ | ||
import assert from 'assert'; | ||
import { getObjectToUpdateForAttachedLayers } from '../src/Provider/PointCloudProvider'; | ||
|
||
describe('getObjectToUpdateForAttachedLayers', function () { | ||
it('should correctly no-parent for the root', function () { | ||
const meta = { | ||
obj: 'a', | ||
}; | ||
assert.equal(getObjectToUpdateForAttachedLayers(meta).element, 'a'); | ||
}); | ||
it('should correctly return the element and its parent', function () { | ||
const meta = { | ||
obj: 'a', | ||
parent: { | ||
obj: 'b', | ||
}, | ||
}; | ||
const result = getObjectToUpdateForAttachedLayers(meta); | ||
assert.equal(result.element, 'a'); | ||
assert.equal(result.parent, 'b'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters