Skip to content

Commit 7fd5ef6

Browse files
committed
Merge branch 'angular-example'
2 parents 56a2b4b + 0072010 commit 7fd5ef6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+11785
-185
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

examples/simple-angular/.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
16+
# IDEs and editors
17+
/.idea
18+
.project
19+
.classpath
20+
.c9/
21+
*.launch
22+
.settings/
23+
*.sublime-workspace
24+
25+
# IDE - VSCode
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
.history/*
32+
33+
# misc
34+
/.sass-cache
35+
/connect.lock
36+
/coverage
37+
/libpeerconnection.log
38+
npm-debug.log
39+
yarn-error.log
40+
testem.log
41+
/typings
42+
43+
# System Files
44+
.DS_Store
45+
Thumbs.db

examples/simple-angular/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# IfcjsAngularExample
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.0.5.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ifcjs-angular-example": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:application": {
10+
"strict": true
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/ifcjs-angular-example",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"assets": [
26+
"src/favicon.ico",
27+
"src/assets"
28+
],
29+
"styles": [{
30+
"input": "src/my-theme.scss"
31+
},
32+
"src/styles.css"
33+
],
34+
"scripts": []
35+
},
36+
"configurations": {
37+
"production": {
38+
"budgets": [
39+
{
40+
"type": "initial",
41+
"maximumWarning": "500kb",
42+
"maximumError": "1mb"
43+
},
44+
{
45+
"type": "anyComponentStyle",
46+
"maximumWarning": "2kb",
47+
"maximumError": "4kb"
48+
}
49+
],
50+
"fileReplacements": [
51+
{
52+
"replace": "src/environments/environment.ts",
53+
"with": "src/environments/environment.prod.ts"
54+
}
55+
],
56+
"outputHashing": "all"
57+
},
58+
"development": {
59+
"buildOptimizer": false,
60+
"optimization": false,
61+
"vendorChunk": true,
62+
"extractLicenses": false,
63+
"sourceMap": true,
64+
"namedChunks": true
65+
}
66+
},
67+
"defaultConfiguration": "production"
68+
},
69+
"serve": {
70+
"builder": "@angular-devkit/build-angular:dev-server",
71+
"configurations": {
72+
"production": {
73+
"browserTarget": "ifcjs-angular-example:build:production"
74+
},
75+
"development": {
76+
"browserTarget": "ifcjs-angular-example:build:development"
77+
}
78+
},
79+
"defaultConfiguration": "development"
80+
},
81+
"extract-i18n": {
82+
"builder": "@angular-devkit/build-angular:extract-i18n",
83+
"options": {
84+
"browserTarget": "ifcjs-angular-example:build"
85+
}
86+
},
87+
"test": {
88+
"builder": "@angular-devkit/build-angular:karma",
89+
"options": {
90+
"main": "src/test.ts",
91+
"polyfills": "src/polyfills.ts",
92+
"tsConfig": "tsconfig.spec.json",
93+
"karmaConfig": "karma.conf.js",
94+
"assets": [
95+
"src/favicon.ico",
96+
"src/assets"
97+
],
98+
"styles": [
99+
"src/styles.css"
100+
],
101+
"scripts": []
102+
}
103+
}
104+
}
105+
}
106+
},
107+
"defaultProject": "ifcjs-angular-example"
108+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"name": "web-ifc",
3+
"version": "0.0.19",
4+
"description": "ifc loading on the web",
5+
"main": "web-ifc-api.js",
6+
"watch": {
7+
"build-viewer": {
8+
"patterns": [
9+
"./examples/viewer"
10+
],
11+
"extensions": "ts"
12+
},
13+
"build-web-ifc-api-mjs": {
14+
"patterns": [
15+
"./src"
16+
],
17+
"extensions": "ts"
18+
}
19+
},
20+
"scripts": {
21+
"gen-schema": "cd src/schema && node gen.js",
22+
"setup-env": "emsdk_env",
23+
"init-repo": "git clone https://github.com/g-truc/glm ./src/wasm/deps/glm && git clone https://github.com/mapbox/earcut.hpp ./src/wasm/deps/earcut && git clone https://github.com/executionunit/csgjs-cpp ./src/wasm/deps/scgjs-cpp && npm run gen-schema",
24+
"build-release": "npm run build-wasm-release && npm run build-api && npm run add-wasm-path",
25+
"build-debug": "npm run build-wasm-debug && npm run build-api && npm run add-wasm-path",
26+
"release_publish": "npm run build-release && cd dist && npm publish",
27+
28+
"build-wasm-debug": "em++ --bind -O3 -g4 -std=c++17 --source-map-base http://localhost:5000/web-ifc-js/wasm-lib/ -flto -fno-exceptions ./src/wasm/web-ifc-api.cpp -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=1 -s FORCE_FILESYSTEM=1 -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"FS\"] -O3 -o dist/web-ifc.js",
29+
"build-wasm-release": "em++ --bind -O3 -std=c++17 -flto -fno-exceptions ./src/wasm/web-ifc-api.cpp -s ALLOW_MEMORY_GROWTH=1 -s FORCE_FILESYSTEM=1 -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"FS\"] -O3 -o dist/web-ifc.js",
30+
31+
"build-api": "cpy src/*.ts dist && npm run build-ts-api && npm run build-web-ifc-api-mjs && npm run build-web-ifc-api-node && npm run copy-to-dist",
32+
"build-ts-api": "tsc --emitDeclarationOnly && cpy dist/web-ifc-api.d.ts dist && cpy dist/web-ifc-api.d.ts dist --rename=web-ifc-api-node.d.ts",
33+
"build-web-ifc-api-mjs": "esbuild dist/web-ifc-api.ts --bundle --format=esm --external:path --external:fs --outfile=./dist/web-ifc-api.js",
34+
"build-web-ifc-api-node": "esbuild dist/web-ifc-api.ts --bundle --platform=node --outfile=./dist/web-ifc-api-node.js",
35+
"copy-to-dist": "cpy README.md dist && cpy package.json dist && cpy src/ifc2x4.ts dist",
36+
37+
"build-viewer": "npm run bundle-viewer && npm run copy-wasm-viewer",
38+
"bundle-viewer": "esbuild ./examples/viewer/web-ifc-viewer.ts --bundle --platform=node --outfile=./examples/viewer/web-ifc-viewer.js",
39+
"copy-wasm-viewer": "cpy dist/web-ifc.wasm examples/viewer",
40+
"add-wasm-path": "node src/utils/add-wasm-path.js",
41+
"serve-viewer": "serve examples/viewer",
42+
"dev": "concurrently --kill-others \"npm-watch\" \"npm run serve-viewer\""
43+
},
44+
"author": "tomvandig",
45+
"files": [
46+
"web-ifc.wasm",
47+
"web-ifc-api-node.js",
48+
"web-ifc-api-node.d.ts",
49+
"web-ifc-api.js",
50+
"web-ifc-api.d.ts",
51+
"ifc2x4.d.ts",
52+
"ifc2x4_helper.d.ts"
53+
],
54+
"devDependencies": {
55+
"@types/three": "^0.125.3",
56+
"three": "^0.126.0",
57+
"concurrently": "^6.0.0",
58+
"cpy-cli": "^3.1.1",
59+
"esbuild": "^0.8.49",
60+
"npm-watch": "^0.7.0",
61+
"serve": "^11.3.2",
62+
"typescript": "^4.1.5"
63+
},
64+
65+
"browser": {
66+
"crypto": false,
67+
"path": false,
68+
"fs": false
69+
}
70+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
22+
clearContext: false // leave Jasmine Spec Runner output visible in browser
23+
},
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
28+
dir: require('path').join(__dirname, './coverage/ifcjs-angular-example'),
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'text-summary' }
33+
]
34+
},
35+
reporters: ['progress', 'kjhtml'],
36+
port: 9876,
37+
colors: true,
38+
logLevel: config.LOG_INFO,
39+
autoWatch: true,
40+
browsers: ['Chrome'],
41+
singleRun: false,
42+
restartOnFileChange: true
43+
});
44+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "ifcjs-angular-example",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "npm run config-web-ifc && ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test",
10+
"config-web-ifc": "cpy config/package.json ../../node_modules/web-ifc"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "^12.0.5",
15+
"@angular/cdk": "^12.0.5",
16+
"@angular/common": "~12.0.5",
17+
"@angular/compiler": "~12.0.5",
18+
"@angular/core": "~12.0.5",
19+
"@angular/forms": "~12.0.5",
20+
"@angular/material": "^12.0.5",
21+
"@angular/platform-browser": "~12.0.5",
22+
"@angular/platform-browser-dynamic": "~12.0.5",
23+
"@angular/router": "~12.0.5",
24+
"hammerjs": "^2.0.8",
25+
"rxjs": "~6.6.0",
26+
"tslib": "^2.1.0",
27+
"web-ifc-viewer": "^1.0.11",
28+
"zone.js": "~0.11.4"
29+
},
30+
"devDependencies": {
31+
"@angular-devkit/build-angular": "~12.0.5",
32+
"@angular/cli": "~12.0.5",
33+
"@angular/compiler-cli": "~12.0.5",
34+
"@types/jasmine": "~3.6.0",
35+
"@types/node": "^12.11.1",
36+
"jasmine-core": "~3.7.0",
37+
"karma": "~6.3.0",
38+
"karma-chrome-launcher": "~3.1.0",
39+
"karma-coverage": "~2.0.3",
40+
"karma-jasmine": "~4.0.0",
41+
"karma-jasmine-html-reporter": "^1.5.0",
42+
"typescript": "~4.2.3"
43+
}
44+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.navbar-button {
2+
position: absolute;
3+
margin: 1rem;
4+
}
5+
6+
#viewer-container {
7+
width: 100vw;
8+
height: 100vh;
9+
}
10+
11+
.stats{
12+
visibility: collapse;
13+
right: 0;
14+
}

0 commit comments

Comments
 (0)