Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/Main/src/Core/Scheduler/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import PriorityQueue from 'js-priority-queue';
import DataSourceProvider from 'Provider/DataSourceProvider';
import TileProvider from 'Provider/TileProvider';
import $3dTilesProvider from 'Provider/3dTilesProvider';
import PointCloudProvider from 'Provider/PointCloudProvider';
import URLBuilder from 'Provider/URLBuilder';
Expand Down Expand Up @@ -122,7 +121,6 @@ Scheduler.prototype.constructor = Scheduler;

Scheduler.prototype.initDefaultProviders = function initDefaultProviders() {
// Register all providers
this.addProtocolProvider('tile', TileProvider);
this.addProtocolProvider('3d-tiles', $3dTilesProvider);
this.addProtocolProvider('pointcloud', PointCloudProvider);
};
Expand Down
19 changes: 7 additions & 12 deletions packages/Main/src/Layer/TiledGeometryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,18 +430,13 @@ class TiledGeometryLayer extends GeometryLayer {
// TODO: pendingSubdivision mechanism is fragile, get rid of it
node.pendingSubdivision = true;

const command = {
/* mandatory */
view: context.view,
requester: node,
layer: this,
priority: 10000,
/* specific params */
extentsSource: extents,
redraw: false,
};

return context.scheduler.execute(command).then((children) => {
const promises = [];

for (const extent of extents) {
promises.push(this.convert(node, extent));
}

return Promise.all(promises).then((children) => {
for (const child of children) {
node.add(child);
child.updateMatrixWorld(true);
Expand Down
21 changes: 0 additions & 21 deletions packages/Main/src/Provider/TileProvider.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/Main/src/Utils/DEMUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function _readZCorrect(layer, texture, uv, tileDimensions, tileOwnerDimensions)
// 'modulo' is the gap (in [0, 1]) between 2 successive vertices in the geometry
// e.g if you have 5 vertices, the only possible values for u (or v) are: 0, 0.25, 0.5, 0.75, 1
// so modulo would be 0.25
// note: currently the number of segments is hard-coded to 16 (see TileProvider) => 17 vertices
// note: currently the number of segments is hard-coded to 16 (see TileBuilder) => 17 vertices
const modulo = (tileDimensions.x / tileOwnerDimensions.x) / (17 - 1);
let u = Math.floor(uv.x / modulo) * modulo;
let v = Math.floor(uv.y / modulo) * modulo;
Expand Down
19 changes: 0 additions & 19 deletions packages/Main/test/unit/dataSourceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { globalExtentTMS } from 'Core/Tile/TileGrid';
import OBB from 'Renderer/OBB';
import DataSourceProvider from 'Provider/DataSourceProvider';
import Fetcher from 'Provider/Fetcher';
import TileProvider from 'Provider/TileProvider';
import WMTSSource from 'Source/WMTSSource';
import WMSSource from 'Source/WMSSource';
import WFSSource from 'Source/WFSSource';
Expand Down Expand Up @@ -210,24 +209,6 @@ describe('Provide in Sources', function () {
}).catch(done);
});

it('should get 4 TileMesh from TileProvider', (done) => {
const tile = new TileMesh(geom, material, planarlayer, extent, zoom);
material.visible = true;
nodeLayer.level = EMPTY_TEXTURE_ZOOM;
tile.parent = { };

planarlayer.subdivideNode(context, tile);
TileProvider.executeCommand(context.scheduler.commands[0])
.then((tiles) => {
assert.equal(tiles.length, 4);
assert.equal(tiles[0].extent.west, tile.extent.east * 0.5);
assert.equal(tiles[0].extent.east, tile.extent.east);
assert.equal(tiles[0].extent.north, tile.extent.north);
assert.equal(tiles[0].extent.south, tile.extent.north * 0.5);
done();
}).catch(done);
});

it('should get 3 meshs with WFS source and DataSourceProvider', (done) => {
const tile = new TileMesh(geom, material, planarlayer, extent, featureLayer.zoom.min);
material.visible = true;
Expand Down
24 changes: 0 additions & 24 deletions packages/Main/test/unit/tilemesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import TileMesh from 'Core/TileMesh';
import PlanarLayer from 'Core/Prefab/Planar/PlanarLayer';
import Tile from 'Core/Tile/Tile';
import { globalExtentTMS } from 'Core/Tile/TileGrid';
import TileProvider from 'Provider/TileProvider';
import { newTileGeometry } from 'Core/Prefab/TileBuilder';
import OBB from 'Renderer/OBB';
import ElevationLayer from 'Layer/ElevationLayer';
Expand Down Expand Up @@ -65,17 +64,6 @@ describe('TileMesh', function () {
assert.equal(res, tree[1][0]);
});

it('subdivide tile by 4 tiles', function (done) {
const tile = planarlayer.object3d.children[0];
planarlayer.subdivideNode(context, tile);
const command = context.scheduler.commands[0];
TileProvider.executeCommand(command).then((tiles) => {
context.scheduler.commands = [];
assert.equal(tiles.length, 4);
done();
});
});

it('Choose the right typed Array', function (done) {
const paramsGeometry = {
extent: planarlayer.object3d.children[0].extent,
Expand All @@ -100,18 +88,6 @@ describe('TileMesh', function () {
Promise.all([a, b]).then(() => done());
});

it('catch error when subdivide tile without material', function (done) {
const tile = planarlayer.object3d.children[0];
tile.pendingSubdivision = false;
tile.material = undefined;
planarlayer.subdivideNode(context, tile);
const command = context.scheduler.commands[0];
TileProvider.executeCommand(command).catch((error) => {
assert.ok(error.isCancelledCommandException);
done();
});
});

it('should find the correct common ancestor between two tiles of different level', function () {
const res = tree[2][0].findCommonAncestor(tree[3][4]);
assert.equal(res, tree[1][0]);
Expand Down
Loading