From 624e0f06b8ed198f3487f6340cbfc24df4cb9db5 Mon Sep 17 00:00:00 2001 From: m-schuetz Date: Wed, 27 Dec 2017 22:13:20 +0100 Subject: [PATCH] improve annotations --- examples/ca13_feature_test.html | 272 ++++++++++++++++++++++++++++++ resources/icons/return_number.svg | 80 +++++++++ resources/icons/rgb.png | Bin 0 -> 2307 bytes resources/icons/rgb.svg | 140 +++++++++++++++ src/Annotation.js | 2 +- src/viewer/EDLRenderer.js | 5 +- src/viewer/potree.css | 22 ++- src/viewer/viewer.js | 8 +- 8 files changed, 513 insertions(+), 16 deletions(-) create mode 100644 examples/ca13_feature_test.html create mode 100644 resources/icons/return_number.svg create mode 100644 resources/icons/rgb.png create mode 100644 resources/icons/rgb.svg diff --git a/examples/ca13_feature_test.html b/examples/ca13_feature_test.html new file mode 100644 index 00000000..7270bdd6 --- /dev/null +++ b/examples/ca13_feature_test.html @@ -0,0 +1,272 @@ + + + + + + + + Potree Viewer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ + + + + + diff --git a/resources/icons/return_number.svg b/resources/icons/return_number.svg new file mode 100644 index 00000000..f8089d28 --- /dev/null +++ b/resources/icons/return_number.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/resources/icons/rgb.png b/resources/icons/rgb.png new file mode 100644 index 0000000000000000000000000000000000000000..a62faf5237ed0429604813fe729a946c7928c65a GIT binary patch literal 2307 zcmV+e3HHS1mC2M^_sl4@(Fr>pL{=iYm6E%13A29V~Vha9uG=<&1ofBkSj>&7K4 zIy-S&anJlKer@=#IlXIsj~K5%45L1jJ9oaCsP4JK7s@L*^g+xsV{r`mXF2;*k)Ogb zw^r-dU8i!p)aI+()Sr*k^MCG=I&3&5lc4)3i5yj@Bkq*%io2Xs$laIwxjtRn*YAo) zpg#%7CjvM%eXKg6^gd+fu{=}X@^x>fYW^cVv{1r_C}RzRwndXM*g-QBoHy`6&ADJ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SGlipt7IoBQoI d+rK`4 + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/Annotation.js b/src/Annotation.js index ee0afc1d..1ecad691 100644 --- a/src/Annotation.js +++ b/src/Annotation.js @@ -83,7 +83,7 @@ Potree.Annotation = class extends THREE.EventDispatcher { a => a.showIn === undefined || a.showIn.includes('scene')); for (let action of actions) { - this.elTitle.css('padding', '1px 3px 0px 8px'); + //this.elTitle.css('padding', '1px 3px 0px 8px'); let elButton = $(``); this.elTitlebar.append(elButton); diff --git a/src/viewer/EDLRenderer.js b/src/viewer/EDLRenderer.js index 29472621..0a7ebc82 100644 --- a/src/viewer/EDLRenderer.js +++ b/src/viewer/EDLRenderer.js @@ -50,6 +50,7 @@ class EDLRenderer { let width = viewer.scaleFactor * viewer.renderArea.clientWidth; let height = viewer.scaleFactor * viewer.renderArea.clientHeight; + let pixelRatio = viewer.renderer.getPixelRatio(); let aspect = width / height; viewer.scene.cameraP.aspect = aspect; @@ -64,10 +65,10 @@ class EDLRenderer { viewer.scene.cameraScreenSpace.top = 1/aspect; viewer.scene.cameraScreenSpace.bottom = -1/aspect; - viewer.scene.cameraScreenSpace.updateProjectionMatrix(); + viewer.scene.cameraScreenSpace.updateProjectionMatrix(); viewer.renderer.setSize(width, height); - this.rtColor.setSize(width, height); + this.rtColor.setSize(width * pixelRatio , height * pixelRatio); } render () { diff --git a/src/viewer/potree.css b/src/viewer/potree.css index b781c348..5d1203c7 100644 --- a/src/viewer/potree.css +++ b/src/viewer/potree.css @@ -166,10 +166,13 @@ a:hover, a:visited, a:link, a:active{ color: white; background-color: black; border-radius: 1.5em; + border: 1px solid rgba(255, 255, 255, 0.7); font-size: 1em; opacity: 1; margin: auto; display: table; + padding: 1px 8px; + cursor: pointer; } .annotation-expand{ @@ -179,17 +182,23 @@ a:hover, a:visited, a:link, a:active{ } .annotation-action-icon{ - width: 24px; - height: 24px; - filter: invert(1); + width: 20px; + height: 20px; display: inline-block; vertical-align: middle; line-height: 1.5em; text-align: center; font-family: Arial; font-weight: bold; - padding: 1px 8px 0px 1px; - cursor: default; + cursor: pointer; +} + +.annotation-action-icon:hover{ + filter: drop-shadow(0px 0px 1px white); + width: 24px; + height: 24px; + cursor: pointer; + } .annotation-item { @@ -226,8 +235,7 @@ a:hover, a:visited, a:link, a:active{ line-height: 1.5em; font-family: Arial; font-weight: bold; - padding: 1px 8px 0px 8px; - cursor: default; + cursor: pointer; white-space: nowrap; } diff --git a/src/viewer/viewer.js b/src/viewer/viewer.js index bb7e0bfb..7a9a768d 100644 --- a/src/viewer/viewer.js +++ b/src/viewer/viewer.js @@ -1435,11 +1435,7 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{ screenPos.copy(position).project(this.scene.getActiveCamera()); screenPos.x = this.renderArea.clientWidth * (screenPos.x + 1) / 2; screenPos.y = this.renderArea.clientHeight * (1 - (screenPos.y + 1) / 2); - - //screenPos.x = Math.floor(screenPos.x - element[0].clientWidth / 2); - //screenPos.y = Math.floor(screenPos.y - annotation.elTitlebar[0].clientHeight / 2); - screenPos.x = Math.floor(screenPos.x); - screenPos.y = Math.floor(screenPos.y); + // SCREEN SIZE if(viewer.scene.cameraMode == Potree.CameraMode.PERSPECTIVE) { @@ -1451,7 +1447,7 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{ screenSize = Potree.utils.projectedRadiusOrtho(radius, viewer.scene.cameraO.projectionMatrix, this.renderArea.clientWidth, this.renderArea.clientHeight); } } - + element[0].style.left = screenPos.x + "px"; element[0].style.top = screenPos.y + "px";