Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged Point Features + Hover Highlight Styles #150

Merged
merged 37 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
09ab728
Added first implementations for PointMergeService.
josephbirkner Aug 7, 2024
34c36ae
Continued implementation of PointMergeService.
josephbirkner Aug 14, 2024
7b9c407
Add pointMergeGridCellSize to style.
josephbirkner Aug 14, 2024
fe06332
Refactor feature primitive IDs, add hover highlights.
josephbirkner Aug 16, 2024
2458f9a
FeatureLayerVisualization now creates new compound feature IDs.
josephbirkner Aug 19, 2024
84147ef
Apply options in feature filter expression.
josephbirkner Aug 20, 2024
fa59377
Update default style.
josephbirkner Aug 20, 2024
9a56356
Finished FeatureLayerVisualization changes for merged point features.
josephbirkner Aug 28, 2024
019c636
Fix picking for merged features.
josephbirkner Aug 29, 2024
424d3b6
Fix merged feature tile contributions.
josephbirkner Aug 29, 2024
337b284
Run ctest in CI.
josephbirkner Aug 31, 2024
e867432
Essential bugfixes for merged feature inspection and presentation.
josephbirkner Aug 31, 2024
8623f59
Fix FeatureTile.has function.
josephbirkner Aug 31, 2024
12096f6
Fix multi-selection panel header.
josephbirkner Aug 31, 2024
b9b627f
Fix jump-to-feature-reference.
josephbirkner Aug 31, 2024
73110bb
Simplify PointMergeService.
josephbirkner Aug 31, 2024
d85bc74
cmake: Conditionally forward toolchain file
johannes-wolf Sep 2, 2024
e0b8d92
Fix CMake list usage
johannes-wolf Sep 2, 2024
fc97c8d
Remove emsdk include from non-wasm header
johannes-wolf Sep 2, 2024
1858760
cmake: Run build-ui for emsdk builds only
johannes-wolf Sep 2, 2024
a1c5376
cmake: Fail on no-tests
johannes-wolf Sep 2, 2024
5f73f21
cmake: Enable testing
johannes-wolf Sep 2, 2024
8303e21
Feature Inspector: Always expand section nodes
johannes-wolf Aug 30, 2024
c1e4d6e
Feature Inspector: Show feature section source ref
johannes-wolf Aug 30, 2024
317c7dd
Inspector Panel: Reset source data selection
johannes-wolf Aug 30, 2024
fa08678
Inspector Panel: Fix source data click-through
johannes-wolf Aug 30, 2024
52f82bd
Update Github actions.
josephbirkner Sep 2, 2024
de497ec
Cesium Build fixes.
josephbirkner Sep 3, 2024
86de59c
Debug multi-selection refactoring.
josephbirkner Sep 4, 2024
3c8378c
Additional test fixes.
josephbirkner Sep 4, 2024
7827e1f
Update default style.
josephbirkner Sep 4, 2024
9961eff
Improved (hover-)highlight/(re-)selection behavior. Still got some bugs.
josephbirkner Sep 4, 2024
702cc24
Run tests in test folder.
josephbirkner Sep 5, 2024
c10e688
Fix picking/highlighting bugs.
josephbirkner Sep 5, 2024
e82482c
Update default style to improve z-ordering.
josephbirkner Sep 5, 2024
b5e381b
Add merged-point-visualization docs.
josephbirkner Sep 5, 2024
0ff9530
Refactor feature iteration to allow jump to feature
Waguramu Sep 10, 2024
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 .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-release

on:
push:
branches:
- 'feature/renderer-wasm-demo'
pull_request:
workflow_dispatch:

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: build-test

on:
push:
pull_request:
workflow_dispatch:

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install build dependencies
run: sudo apt-get install ninja-build

- name: Compile
run: |
mkdir build-test && cd build-test
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .

- name: Run Tests
run: |
cd build-test/test
ctest --verbose --no-tests=error
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ FetchContent_MakeAvailable(yaml-cpp)
include(cmake/cesium.cmake)

# Erdblick Core Library

add_subdirectory(libs/core)

if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
add_subdirectory(test)
else()
# Angular Build
add_custom_target(erdblick-ui ALL
COMMAND bash "${CMAKE_SOURCE_DIR}/build-ui.bash" "${CMAKE_SOURCE_DIR}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
DEPENDS erdblick-core)
endif()

# Angular Build

add_custom_target(erdblick-ui ALL
COMMAND bash "${CMAKE_SOURCE_DIR}/build-ui.bash" "${CMAKE_SOURCE_DIR}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
DEPENDS erdblick-core
)
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Each rule within the YAML `rules` array can have the following fields:
|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|--------------------------------------|
| `geometry` | List of geometry type(s) or single type the rule applies to. | At least one of `"point"`,`"mesh"`, `"line"`, `"polygon"`. | `["point", "mesh"]`, `line` |
| `aspect` | Specifies the aspect to which the rule applies: `"feature"`, `"relation"`, or `"attribute"`. | String | `"feature"`, `"relation"` |
| `mode` | Specifies the mode: `"normal"` or `"highlight"`. | String | `"normal"`, `"highlight"` |
| `mode` | Specifies the highlight mode: `"none"` or `"hover"` or `"selection"`. | String | `"none"`, `"hover"` |
| `type` | A regular expression to match against a feature type. | String | `"Lane\|Boundary"` |
| `filter` | A [simfil](https://github.com/klebert-engineering/simfil) filter expression over the feature's JSON representation. | String | `*roadClass == 4` |
| `selectable` | Indicates if the feature is selectable. | Boolean | `true`, `false` |
Expand All @@ -80,6 +80,7 @@ Each rule within the YAML `rules` array can have the following fields:
| `flat` | Clamps the feature to the ground (Does not work for meshes). | Boolean | `true`, `false` |
| `outline-color` | Point outline color. | String | `green`, `#fff` |
| `outline-width` | Point outline width in px. | Float | `3.6` |
| `point-merge-grid-cell` | WGS84/altutide meter tolerance for merging point visualizations. | Array of three Floats. | `[0.000000084, 0.000000084, 0.01]` |
| `near-far-scale` | For points, indicate (`near-alt-meters`, `near-scale`, `far-alt-meters`, `far-scale`). | Array of four Floats. | `[1.5e2,10,8.0e6,0]` |
| `offset` | Apply a fixed offset to each shape-point in meters. Can be used for z-ordering. | Array of three Floats. | `[0, 0, 5]` |
| `arrow` | For arrow-heads: One of `none`, `forward`, `backward`, `double`. Not compatible with `dashed`. | String | `single` |
Expand Down Expand Up @@ -230,6 +231,17 @@ For attributes, style expressions (e.g. `color-expression`) are evaluated in a c
set the `offset` field. The spatial `offset` will be multiplied, so it is possible to "stack" attributes
over a feature.

### About Merged Point Visualizations

By setting `point-merge-grid-cell`, a tolerance may be defined which allows merging the visual representations
of point features which share the same 3D spatial cell, map, layer, and style rule. This has two advantages:

* **Multi-Selection**: When selecting the merged representation, a multi-selection of all merged features happens.
* **Logical Evaluation using `$mergeCount`**: In some map formats, it may be desirable to apply a style based on the number of merged points.
This may be done to display a warning, or to check a matching requirement.
To this end, the `$mergeCount` variable is injected into each simfil evaluation context of a merged-point style rule.
Check out the default style for an example.

### About `first-of`

Normally, all style rules from a style sheet are naively applied to all matching features.
Expand Down
14 changes: 11 additions & 3 deletions cmake/cesium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ set(CESIUM_LIBS
CesiumGltf
CesiumGltfWriter)

# Use fetch content for cloning the repository durring
# Use fetch content for cloning the repository during
# configure phase. We do not call `FetchContent_MakeAvailable`,
# but instead use `ExternalProject_Add` to compile Cesium in
# isolation.
FetchContent_Declare(cesiumnative_src
GIT_REPOSITORY "https://github.com/Klebert-Engineering/cesium-native.git"
GIT_TAG "main"
GIT_SUBMODULES_RECURSE YES
GIT_PROGRESS YES)
GIT_PROGRESS YES
PATCH_COMMAND git reset --hard HEAD && git -C extern/draco reset --hard HEAD && git apply "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cesium.patch"
UPDATE_DISCONNECTED YES
UPDATE_COMMAND "")

FetchContent_GetProperties(cesiumnative_src)
if (NOT cesiumnative_src_POPULATED)
Expand All @@ -49,6 +52,11 @@ foreach (lib ${CESIUM_LIBS})
endforeach()
message(STATUS "cesium byproducts: ${CESIUM_BYPRODUCTS}")

set(CESIUM_EXTRA_ARGS)
if (CMAKE_TOOLCHAIN_FILE)
list(APPEND CESIUM_EXTRA_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()

ExternalProject_Add(cesiumnative
SOURCE_DIR ${cesiumnative_src_SOURCE_DIR}
CMAKE_ARGS
Expand All @@ -58,8 +66,8 @@ ExternalProject_Add(cesiumnative
-DCESIUM_TRACING_ENABLED=OFF
-DDRACO_JS_GLUE=OFF
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
${CESIUM_EXTRA_ARGS}
BUILD_BYPRODUCTS
${CESIUM_BYPRODUCTS}
INSTALL_COMMAND ""
Expand Down
47 changes: 47 additions & 0 deletions cmake/cesium.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
index c928fdf..cf6a63b 100644
--- a/extern/draco/src/draco/io/file_utils.h
+++ b/extern/draco/src/draco/io/file_utils.h
@@ -17,6 +17,7 @@

#include <string>
#include <vector>
+#include <cstdint>

namespace draco {

diff --git a/CesiumAsync/include/CesiumAsync/CacheItem.h b/CesiumAsync/include/CesiumAsync/CacheItem.h
index 20d1ca80..bd47492b 100644
--- a/CesiumAsync/include/CesiumAsync/CacheItem.h
+++ b/CesiumAsync/include/CesiumAsync/CacheItem.h
@@ -9,6 +9,7 @@
#include <ctime>
#include <map>
#include <vector>
+#include <cstdint>

namespace CesiumAsync {

diff --git a/CesiumAsync/include/CesiumAsync/IAssetResponse.h b/CesiumAsync/include/CesiumAsync/IAssetResponse.h
index 10519057..0944b26b 100644
--- a/CesiumAsync/include/CesiumAsync/IAssetResponse.h
+++ b/CesiumAsync/include/CesiumAsync/IAssetResponse.h
@@ -8,6 +8,7 @@
#include <cstddef>
#include <map>
#include <string>
+#include <cstdint>

namespace CesiumAsync {

diff --git a/CesiumIonClient/src/fillWithRandomBytes.h b/CesiumIonClient/src/fillWithRandomBytes.h
index 55765c72..654d09df 100644
--- a/CesiumIonClient/src/fillWithRandomBytes.h
+++ b/CesiumIonClient/src/fillWithRandomBytes.h
@@ -1,6 +1,7 @@
#pragma once

#include <gsl/span>
+#include <cstdint>

namespace CesiumIonClient {

60 changes: 55 additions & 5 deletions config/styles/default-style.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,65 @@
name: DefaultStyle
version: 1.0
options:
- label: Show Meshes/Polygons
id: showMesh
- label: Show Points
id: showPoint
- label: Show Lines
id: showLine

rules:
# Normal styles
- geometry: ["mesh", "polygon"]
filter: showMesh
color: teal
opacity: 0.8
- geometry: ["point", "line"]
offset: [0, 0, -0.4]
- geometry: ["line"]
filter: showLine
color: moccasin
opacity: 1.0
width: 1.0
- geometry: ["point", "line", "mesh", "polygon"]
width: 5.0
offset: [0, 0, -0.2]
- geometry: ["point"]
point-merge-grid-cell: [0.000000084, 0.000000084, 0.01]
filter: showPoint
color-expression: "$mergeCount > 1 and 'brown' or 'moccasin'"
opacity: 1.0
width: 15.0

# Hover/Selection styles
- geometry: ["mesh", "polygon"]
color: orange
opacity: 1.0
mode: hover
offset: [0, 0, -0.3]
- geometry: ["line"]
color: orange
opacity: 1.0
width: 10.0
mode: hover
offset: [0, 0, -0.1]
- geometry: ["point"]
color: orange
opacity: 1.0
width: 20.0
mode: hover
offset: [0, 0, 0.1]
- geometry: ["mesh", "polygon"]
color: red
opacity: 1.0
mode: selection
offset: [0, 0, -0.3]
- geometry: ["line"]
color: red
opacity: 1.0
width: 10.0
mode: selection
offset: [0, 0, -0.1]
- geometry: ["point"]
color: red
opacity: 1.0
width: 4.0
mode: highlight
width: 20.0
mode: selection
offset: [0, 0, 0.1]
4 changes: 4 additions & 0 deletions erdblick_app/app/cesium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export type Viewer = Cesium.Viewer;
export const Viewer = Cesium.Viewer;
export type PrimitiveCollection = Cesium.PrimitiveCollection;
export const PrimitiveCollection = Cesium.PrimitiveCollection;
export type PointPrimitiveCollection = Cesium.PointPrimitiveCollection;
export const PointPrimitiveCollection = Cesium.PointPrimitiveCollection;
export type LabelCollection = Cesium.LabelCollection;
export const LabelCollection = Cesium.LabelCollection;
export type BillboardCollection = Cesium.BillboardCollection;
export const BillboardCollection = Cesium.BillboardCollection;
export type Billboard = Cesium.Billboard;
Expand Down
Loading
Loading