Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/merged-features' into merged-fea…
Browse files Browse the repository at this point in the history
…tures
  • Loading branch information
josephbirkner committed Sep 2, 2024
2 parents 958ac06 + bc46ac9 commit ee3e0ea
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 19 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ jobs:

- name: Compile
run: |
mkdir build
cd build
mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
- name: Run Tests
run: |
cd build
ctest --verbose
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
)
7 changes: 6 additions & 1 deletion cmake/cesium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,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 +63,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
10 changes: 6 additions & 4 deletions erdblick_app/app/feature.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ interface Column {
/>
<ng-template ngFor let-item [ngForOf]="rowData.sourceDataReferences">
<p-button
(click)="showSourceData(item)"
(click)="showSourceData($event, item)"
[rounded]="true"
severity="secondary"
label="{{ item.qualifier.substring(0, 1).toUpperCase() }}"
Expand Down Expand Up @@ -230,8 +229,9 @@ export class FeaturePanelComponent implements OnInit {
expandTreeNodes(nodes: TreeTableNode[], parent: any = null): void {
nodes.forEach(node => {
const isTopLevelNode = parent === null;
const isSection = node.data && node.data["type"] === this.InspectionValueType.SECTION.value;
const hasSingleChild = node.children && node.children.length === 1;
node.expanded = isTopLevelNode || hasSingleChild;
node.expanded = isTopLevelNode || isSection || hasSingleChild;

if (node.children) {
this.expandTreeNodes(node.children, node);
Expand Down Expand Up @@ -341,7 +341,9 @@ export class FeaturePanelComponent implements OnInit {
}
}

showSourceData(sourceDataRef: any) {
showSourceData(event: any, sourceDataRef: any) {
event.stopPropagation();

const layerId = sourceDataRef.layerId;
const tileId = sourceDataRef.tileId;
const address = sourceDataRef.address;
Expand Down
4 changes: 3 additions & 1 deletion erdblick_app/app/inspection.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ export class InspectionPanelComponent
});

this.inspectionService.selectedSourceData.pipe(distinctUntilChanged(selectedSourceDataEqualTo)).subscribe(selection => {
if (selection)
if (selection) {
this.reset();
this.pushSourceDataInspector(selection);
}
})
}

Expand Down
3 changes: 3 additions & 0 deletions erdblick_app/app/inspection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ export class InspectionService {
if (section.hasOwnProperty("info")) {
node.data["info"] = section.info;
}
if (section.hasOwnProperty("sourceDataReferences")) {
node.data["sourceDataReferences"] = section.sourceDataReferences;
}
node.children = convertToTreeTableNodes(section.children);
treeNodes.push(node);
}
Expand Down
2 changes: 0 additions & 2 deletions libs/core/include/erdblick/sourcedata.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <emscripten/bind.h>

#include "mapget/model/sourcedatalayer.h"
#include "cesium-interface/object.h"

Expand Down
5 changes: 5 additions & 0 deletions libs/core/src/inspection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ JsValue InspectionConverter::convert(model_ptr<Feature> const& featurePtr)
stringPool_ = featurePtr->model().strings();
featureId_ = featurePtr->id()->toString();

// Top-Level Feature Item
auto featureScope = push("Feature", "", ValueType::Section);
featureScope->value_ = JsValue(featurePtr->id()->toString());
convertSourceDataReferences(featurePtr->sourceDataReferences(), *featureScope);

// Identifiers section.
{
auto scope = push(convertStringView("Identifiers"), "", ValueType::Section);
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
project(test.erdblick)
enable_testing()

if (NOT TARGET Catch2)
FetchContent_Declare(Catch2
Expand Down

0 comments on commit ee3e0ea

Please sign in to comment.