Skip to content

Commit ae2e13d

Browse files
committed
add vscode config; address some eslint suggestions
1 parent d0a7cb8 commit ae2e13d

18 files changed

+281
-269
lines changed

.eslintrc

+51-46
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
11
{
2-
"extends": "happiness",
3-
"globals": {
4-
"THREE": false,
5-
"TWEEN": false,
6-
"$": false,
7-
"XMLHttpRequest": false,
8-
"requestAnimationFrame": false,
9-
"Blob": false,
10-
"i18n": false,
11-
"URL": false,
12-
"Stats": false,
13-
"ProgressBar": false,
14-
"d3": false,
15-
"btoa": false,
16-
"alert": false,
17-
"ol": false,
18-
"proj4": false,
19-
"shapefile": false,
20-
"Worker": false,
21-
"Image": false,
22-
"LASFile": false,
23-
"LASDecoder": false,
24-
"BinaryHeap": false,
25-
"Potree": true,
26-
"initSidebar": true,
27-
"HoverMenu": true,
28-
"HoverMenuItem": true,
29-
"LRU": true,
30-
"viewer": true
31-
},
32-
"rules": {
33-
"no-lone-blocks": "off",
34-
"space-before-function-paren": "off",
35-
"space-before-blocks": "off",
36-
"indent": "off",
37-
"no-trailing-spaces": "off",
38-
"keyword-spacing": "off",
39-
"no-multiple-empty-lines" : "off",
40-
"key-spacing": "off",
41-
"spaced-comment": "off",
42-
"quotes": "off",
43-
"space-in-parens": "off"
44-
},
45-
"parserOptions": {
46-
"ecmaVersion": 6
47-
}
2+
"extends": "happiness",
3+
"globals": {
4+
"THREE": false,
5+
"TWEEN": false,
6+
"$": false,
7+
"XMLHttpRequest": false,
8+
"requestAnimationFrame": false,
9+
"Blob": false,
10+
"i18n": false,
11+
"URL": false,
12+
"Stats": false,
13+
"ProgressBar": false,
14+
"d3": false,
15+
"btoa": false,
16+
"alert": false,
17+
"ol": false,
18+
"proj4": false,
19+
"shapefile": false,
20+
"Worker": false,
21+
"Image": false,
22+
"LASFile": false,
23+
"LASDecoder": false,
24+
"BinaryHeap": false,
25+
"performance": false,
26+
"Potree": true,
27+
"initSidebar": true,
28+
"HoverMenu": true,
29+
"HoverMenuItem": true,
30+
"LRU": true,
31+
"viewer": true
32+
},
33+
"rules": {
34+
"no-lone-blocks": "off",
35+
"space-before-function-paren": "off",
36+
"space-before-blocks": "off",
37+
"indent": "off",
38+
"no-trailing-spaces": "off",
39+
"keyword-spacing": "off",
40+
"no-multiple-empty-lines" : "off",
41+
"key-spacing": "off",
42+
"spaced-comment": "off",
43+
"quotes": "off",
44+
"space-in-parens": "off",
45+
"padded-blocks": "off",
46+
"comma-dangle": "off",
47+
"object-property-newline": "off",
48+
"eol-last": "off"
49+
},
50+
"parserOptions": {
51+
"ecmaVersion": 6
52+
}
4853
}

.vscode/settings.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"workbench.editor.enablePreview": false,
3+
"files.associations": {
4+
"*.vs": "cpp",
5+
"*.fs": "cpp"
6+
},
7+
"editor.fontSize": 16,
8+
"editor.autoIndent": false,
9+
"editor.detectIndentation": false,
10+
"editor.renderWhitespace": "all",
11+
"editor.insertSpaces": false,
12+
}

src/PointCloudOctree.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ Potree.PointCloudOctree = class extends Potree.PointCloudTree {
8484
this.updateMatrixWorld(true);
8585
box = Potree.utils.computeTransformedBoundingBox(box, this.matrixWorld);
8686

87-
let bWidth = box.max.z - box.min.z;
88-
let bMin = box.min.z; // - 0.2 * bWidth;
89-
let bMax = box.max.z; // + 0.2 * bWidth;
87+
let bMin = box.min.z;
88+
let bMax = box.max.z;
9089
this.material.heightMin = bMin;
9190
this.material.heightMax = bMax;
9291
}

src/Potree.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ Potree.resolveQueries = function (gl) {
7878
for (let name in Potree.timerQueries) {
7979
let queries = Potree.timerQueries[name];
8080

81-
let sum = 0;
82-
let n = 0;
8381
let remainingQueries = [];
8482
for(let query of queries){
8583

@@ -95,17 +93,11 @@ Potree.resolveQueries = function (gl) {
9593
resolved.set(name, []);
9694
}
9795
resolved.get(name).push(miliseconds);
98-
99-
//sum += miliseconds;
100-
//n++;
10196
}else{
10297
remainingQueries.push(query);
10398
}
10499
}
105100

106-
//let mean = sum / n;
107-
//console.log(`mean: ${mean.toFixed(3)}, samples: ${n}`);
108-
109101
if (remainingQueries.length === 0) {
110102
delete Potree.timerQueries[name];
111103
}else{
@@ -179,7 +171,7 @@ Potree.toMaterialName = function(materialID) {
179171
return 'Normal';
180172
} else if (materialID === Potree.PointColorType.PHONG) {
181173
return 'Phong';
182-
} else if (materialID === Potree.PointColorType.POINT_INDEX) {
174+
} else if (materialID === Potree.PointColorType.POINT_INDEX) {
183175
return 'Index';
184176
} else if (materialID === Potree.PointColorType.RGB_HEIGHT) {
185177
return 'RGB and Elevation';
@@ -210,7 +202,7 @@ Potree.getMeasurementIcon = function(measurement){
210202
} else if (measurement instanceof Potree.PolygonClipVolume) {
211203
return `${Potree.resourcePath}/icons/clip-polygon.svg`;
212204
}
213-
}
205+
};
214206

215207
Potree.Points = class Points {
216208
constructor () {
@@ -393,7 +385,7 @@ Potree.updateVisibilityStructures = function(pointclouds, camera, renderer) {
393385
'camObjPositions': camObjPositions,
394386
'priorityQueue': priorityQueue
395387
};
396-
}
388+
};
397389

398390
Potree.getDEMWorkerInstance = function () {
399391
if (!Potree.DEMWorkerInstance) {

src/ProfileRequest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ Potree.ProfileRequest = class ProfileRequest {
115115
Potree.getLRU().touch(node);
116116
this.highestLevelServed = Math.max(node.getLevel(), this.highestLevelServed);
117117

118-
let doTraverse = (node.level % node.pcoGeometry.hierarchyStepSize) === 0 && node.hasChildren;
119-
doTraverse = doTraverse || node.getLevel() === 0;
118+
let doTraverse = (node.level % node.pcoGeometry.hierarchyStepSize) === 0 && node.hasChildren;
119+
doTraverse = doTraverse || node.getLevel() === 0;
120120
if (doTraverse) {
121121
this.traverse(node);
122122
}

src/extensions/OrthographicCamera.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11

2-
THREE.OrthographicCamera.prototype.zoomTo = function( node, factor ){
2+
THREE.OrthographicCamera.prototype.zoomTo = function( node, factor = 1){
33

44
if ( !node.geometry && !node.boundingBox) {
55
return;
66
}
7-
var _factor = factor || 1;
8-
7+
98
// TODO
109

11-
let minWS = new THREE.Vector4(node.boundingBox.min.x, node.boundingBox.min.y, node.boundingBox.min.z, 1);
12-
let minVS = minWS.applyMatrix4(this.matrixWorldInverse);
10+
//let minWS = new THREE.Vector4(node.boundingBox.min.x, node.boundingBox.min.y, node.boundingBox.min.z, 1);
11+
//let minVS = minWS.applyMatrix4(this.matrixWorldInverse);
1312

14-
let right = node.boundingBox.max.x;
15-
let bottom = node.boundingBox.min.y;
16-
let top = node.boundingBox.max.y;
13+
//let right = node.boundingBox.max.x;
14+
//let bottom = node.boundingBox.min.y;
15+
//let top = node.boundingBox.max.y;
1716

1817
this.updateProjectionMatrix();
1918
};

0 commit comments

Comments
 (0)