Skip to content

Commit

Permalink
Merge pull request #114 from ndsev/inspection-converter
Browse files Browse the repository at this point in the history
Release 2024.3
  • Loading branch information
josephbirkner committed Jun 14, 2024
2 parents 81b0c45 + baf75c9 commit dbd6ab9
Show file tree
Hide file tree
Showing 59 changed files with 8,637 additions and 6,755 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ci/emsdk/
.idea
cmake-build-debug-wsl
clion-build-*
cmake-build-*
static
.angular
node_modules
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FetchContent_MakeAvailable(glm)

FetchContent_Declare(mapget
GIT_REPOSITORY "https://github.com/Klebert-Engineering/mapget"
GIT_TAG "main"
GIT_TAG "addon-datasources"
GIT_SHALLOW ON)
FetchContent_MakeAvailable(mapget)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rule that matches it.
### Custom Style Declarations

It is possible to apply own custom styles easily.
On build, Erdblick automatically picks up `.yaml` style files from `styles` directory (where you can drop your custom files)
On build, Erdblick automatically picks up `.yaml` style files from `config/styles` directory (where you can drop your custom files)
and bundles them in `static/bundle/styles` (in case you are using a pre-built Erdblick distribution,
you can directly put your styles in `static/bundle/styles`).

Expand All @@ -50,7 +50,7 @@ For Erdblick to apply custom styles, it expects the following declarations for t
]
}
```
where `url` field must be a path relative to `static/bundle/styles` and `id` is used to identify the particular style in GUI.
where `url` field must be a path relative to `config/styles` and `id` is used to identify the particular style in GUI.

It is also possible to export and import styles in GUI. Styles imported this way will persist in the local storage of the browser.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.2
2024.3
11 changes: 7 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
{
"glob": "**/*",
"input": "styles",
"input": "config/styles",
"output": "/bundle/styles"
},
{
Expand All @@ -55,22 +55,24 @@
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/cesium/Build/Cesium/Widgets/widgets.css",
"node_modules/material-icons/iconfont/material-icons.css",
"erdblick_app/styles.scss"
],
"scripts": [

],
"customWebpackConfig": {
"path": "./webpack.config.js"
}
},
"webWorkerTsConfig": "tsconfig.worker.json"
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "60mb"
"maximumError": "100mb"
},
{
"type": "anyComponentStyle",
Expand Down Expand Up @@ -126,7 +128,8 @@
"styles": [
"erdblick_app/styles.scss"
],
"scripts": []
"scripts": [],
"webWorkerTsConfig": "tsconfig.worker.json"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion build-ui.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ npm run lint
if [[ -z "$NG_DEVELOP" ]]; then
npm run build -- -c production
else
npm run build
npm run build --watch
fi

exit 0
1 change: 1 addition & 0 deletions ci/00_linux_setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ci_dir="$(realpath ${BASH_SOURCE[0]} | xargs -I{} dirname {})"
echo "Setting up Emscripten in: $ci_dir"
cd "$ci_dir"

export PATH=$PATH:"$ci_dir/../node_modules/.bin/"
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
Expand Down
1 change: 1 addition & 0 deletions ci/10_linux_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source "$ci_dir/emsdk/emsdk_env.sh"
cd "$ci_dir/.."

export EMSCRIPTEN="$ci_dir/emsdk/upstream/emscripten"
export PATH=$PATH:"$(pwd)/node_modules/.bin/"

rm -rf build && mkdir build
cd build
Expand Down
1 change: 1 addition & 0 deletions ci/20_linux_rebuild.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ci_dir="$(realpath ${BASH_SOURCE[0]} | xargs -I{} dirname {})"
source "$ci_dir/emsdk/emsdk_env.sh"

export EMSCRIPTEN="$ci_dir/emsdk/upstream/emscripten"
export PATH=$PATH:"$ci_dir/../node_modules/.bin/"

cd "$ci_dir/../build"
cmake --build . -- -j
1 change: 0 additions & 1 deletion config/.gitignore

This file was deleted.

15 changes: 15 additions & 0 deletions config/styles/default-style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: DefaultStyle
version: 1.0
rules:
- geometry: ["mesh", "polygon"]
color: teal
opacity: 0.8
- geometry: ["point", "line"]
color: moccasin
opacity: 1.0
width: 1.0
- geometry: ["point", "line", "mesh", "polygon"]
color: red
opacity: 1.0
width: 4.0
mode: highlight
32 changes: 6 additions & 26 deletions erdblick_app/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {JumpTargetService} from "./jump.service";
import {MapService} from "./map.service";
import {ActivatedRoute, NavigationEnd, Params, Router} from "@angular/router";
import {ParametersService} from "./parameters.service";
import {OverlayPanel} from "primeng/overlaypanel";
import {StyleService} from "./style.service";
import {filter} from "rxjs";

Expand All @@ -13,18 +12,11 @@ import {filter} from "rxjs";
template: `
<erdblick-view></erdblick-view>
<map-panel></map-panel>
<p-toast position="bottom-center" key="tc"></p-toast>
<p-overlayPanel #searchoverlay>
<search-menu-items></search-menu-items>
</p-overlayPanel>
<span class="p-input-icon-left search-input">
<i class="pi pi-search"></i>
<input type="text" pInputText [(ngModel)]="searchValue"
(click)="toggleSearchOverlay(searchValue, searchoverlay, $event)"
(ngModelChange)="setSearchTargetValue(searchValue)"/>
</span>
<p-toast position="top-center" key="tc"></p-toast>
<search-panel #searchoverlay></search-panel>
<pref-components></pref-components>
<inspection-panel></inspection-panel>
<coordinates-panel></coordinates-panel>
<div id="info">
{{ title }} {{ version }}
</div>
Expand Down Expand Up @@ -78,27 +70,15 @@ export class AppComponent {
}
const entries = [...Object.entries(parameters)];
entries.forEach(entry => entry[1] = JSON.stringify(entry[1]));
this.updateQueryParams(Object.fromEntries(entries));
this.updateQueryParams(Object.fromEntries(entries), this.parametersService.replaceUrl);
});
}

toggleSearchOverlay(value: string, searchOverlay: OverlayPanel, event: any) {
if (value) {
searchOverlay.show(event);
return;
}
searchOverlay.toggle(event);
}

setSearchTargetValue(value: string) {
this.jumpToTargetService.targetValueSubject.next(value);
}

updateQueryParams(params: Params): void {
updateQueryParams(params: Params, replaceUrl: boolean): void {
this.router.navigate([], {
queryParams: params,
queryParamsHandling: 'merge',
replaceUrl: true
replaceUrl: replaceUrl
});
}
}
34 changes: 30 additions & 4 deletions erdblick_app/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {MessageService} from "primeng/api";
import {InputNumberModule} from "primeng/inputnumber";
import {FieldsetModule} from "primeng/fieldset";
import {InfoMessageService} from "./info.service";
import {SearchMenuComponent} from "./search-menu.component";
import {SearchPanelComponent} from "./search.panel.component";
import {JumpTargetService} from "./jump.service";
import {MapService} from "./map.service";
import {InputSwitchModule} from "primeng/inputswitch";
Expand All @@ -35,7 +35,20 @@ import {PreferencesComponent} from "./preferences.component";
import {FileUploadModule} from "primeng/fileupload";
import {EditorComponent} from "./editor.component";
import {ErdblickViewComponent} from "./view.component";
import {CoordinatesPanelComponent} from "./coordinates.panel.component";
import {initializeLibrary} from "./wasm";
import {CheckboxModule} from "primeng/checkbox";
import {InputTextModule} from "primeng/inputtext";
import {SidePanelService} from "./sidepanel.service";
import {MenuModule} from "primeng/menu";
import {CardModule} from "primeng/card";
import {CoordinatesService} from "./coordinates.service";
import {FeatureSearchComponent} from "./feature.search.component";
import {ColorPickerModule} from "primeng/colorpicker";
import {ListboxModule} from "primeng/listbox";
import {FeatureSearchService} from "./feature.search.service";
import {ClipboardService} from "./clipboard.service";
import {MultiSelectModule} from "primeng/multiselect";

export function initializeServices(styleService: StyleService, mapService: MapService) {
return async () => {
Expand All @@ -48,12 +61,14 @@ export function initializeServices(styleService: StyleService, mapService: MapSe
@NgModule({
declarations: [
AppComponent,
SearchMenuComponent,
SearchPanelComponent,
MapPanelComponent,
InspectionPanelComponent,
PreferencesComponent,
EditorComponent,
ErdblickViewComponent
ErdblickViewComponent,
CoordinatesPanelComponent,
FeatureSearchComponent
],
imports: [
BrowserModule,
Expand All @@ -76,7 +91,14 @@ export function initializeServices(styleService: StyleService, mapService: MapSe
FieldsetModule,
InputSwitchModule,
SliderModule,
FileUploadModule
FileUploadModule,
CheckboxModule,
InputTextModule,
MenuModule,
CardModule,
ColorPickerModule,
ListboxModule,
MultiSelectModule
],
providers: [
{
Expand All @@ -91,6 +113,10 @@ export function initializeServices(styleService: StyleService, mapService: MapSe
JumpTargetService,
InspectionService,
ParametersService,
SidePanelService,
CoordinatesService,
FeatureSearchService,
ClipboardService
],
bootstrap: [AppComponent]
})
Expand Down
20 changes: 19 additions & 1 deletion erdblick_app/app/cesium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,33 @@ export type ScreenSpaceEventType = Cesium.ScreenSpaceEventType;
export const ScreenSpaceEventType = Cesium.ScreenSpaceEventType;
export type UrlTemplateImageryProvider = Cesium.UrlTemplateImageryProvider;
export const UrlTemplateImageryProvider = Cesium.UrlTemplateImageryProvider;
export type Rectangle = Cesium.Rectangle;
export const Rectangle = Cesium.Rectangle;
export type HeightReference = Cesium.HeightReference;
export const HeightReference = Cesium.HeightReference;
export type LabelStyle = Cesium.LabelStyle;
export const LabelStyle = Cesium.LabelStyle;
export type VerticalOrigin = Cesium.VerticalOrigin;
export const VerticalOrigin = Cesium.VerticalOrigin;
export type HorizontalOrigin = Cesium.HorizontalOrigin;
export const HorizontalOrigin = Cesium.HorizontalOrigin;
export type DistanceDisplayCondition = Cesium.DistanceDisplayCondition;
export const DistanceDisplayCondition = Cesium.DistanceDisplayCondition;
export type CallbackProperty = Cesium.CallbackProperty;
export const CallbackProperty = Cesium.CallbackProperty;
export type Viewer = Cesium.Viewer;
export const Viewer = Cesium.Viewer;
export type PrimitiveCollection = Cesium.PrimitiveCollection;
export const PrimitiveCollection = Cesium.PrimitiveCollection;
export type BillboardCollection = Cesium.BillboardCollection;
export const BillboardCollection = Cesium.BillboardCollection;
export type PointPrimitiveCollection = Cesium.PointPrimitiveCollection;
export const PointPrimitiveCollection = Cesium.PointPrimitiveCollection;
export type Entity = Cesium.Entity;
export const Entity = Cesium.Entity;
export type Camera = Cesium.Camera;
export const Camera = Cesium.Camera;

// Math is a namespace.

export const Math = Cesium.Math;
export const CesiumMath = Cesium.Math;
24 changes: 24 additions & 0 deletions erdblick_app/app/clipboard.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {Injectable} from "@angular/core";
import {InfoMessageService} from "./info.service";


@Injectable()
export class ClipboardService {

constructor(private messageService: InfoMessageService) {}

copyToClipboard(text: string) {
try {
navigator.clipboard.writeText(text).then(
() => {
this.messageService.showSuccess("Copied content to clipboard!");
},
() => {
this.messageService.showError("Could not copy content to clipboard.");
}
);
} catch (error) {
console.error(error);
}
}
}
Loading

0 comments on commit dbd6ab9

Please sign in to comment.