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B;AAED,yFAAsB,EAAE,CAAC,eAAe,CAAC,sDAAS,CAAC;KAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC","sources":["./src/app/app-routing.module.ts","./src/app/app.component.ts","./src/app/app.module.ts","./src/app/auth/auth-routing.module.ts","./src/app/auth/auth.guard.ts","./src/app/auth/auth.module.ts","./src/app/auth/auth.service.ts","./src/app/auth/components/auth-layout/auth-layout.component.ts","./src/app/auth/components/change-password/change-password.component.ts","./src/app/auth/components/login/login.component.ts","./src/app/auth/components/password-request/password-request.component.ts","./src/app/auth/components/register/register.component.ts","./src/app/auth/components/remote-register/remote-register.component.ts","./src/app/editor/components/map-properties.component.ts","./src/app/editor/components/norme-modal.component.ts","./src/app/editor/components/print-preview.component.ts","./src/app/editor/editor.component.ts","./src/app/editor/editor.module.ts","./src/app/floorPlanner/diagram/connector-tool.ts","./src/app/floorPlanner/diagram/floor-planner.component.ts","./src/app/floorPlanner/diagram/floorplan-diagram.ts","./src/app/floorPlanner/diagram/wall-building-tool.ts","./src/app/floorPlanner/diagram/wall-reshaping-tool.ts","./src/app/floorPlanner/floor-planner.module.ts","./src/app/floorPlanner/inspector/data-inspector.component.ts","./src/app/floorPlanner/inspector/getset-functions.ts","./src/app/floorPlanner/inspector/prop-value.pipe.ts","./src/app/floorPlanner/inspector/property-choices.pipe.ts","./src/app/floorPlanner/models/elements.ts","./src/app/floorPlanner/node-label-dragging-tool.ts","./src/app/floorPlanner/tools.ts","./src/app/folio/components/folio-layers.component.ts","./src/app/folio/components/folio-list.component.ts","./src/app/folio/components/folio-properties.component.ts","./src/app/folio/components/folio-structure.component.ts","./src/app/folio/folio.constants.ts","./src/app/folio/folio.module.ts","./src/app/folio/folio.service.ts","./src/app/http-interceptors/auth-interceptor.ts","./src/app/http-interceptors/index.ts","./src/app/layout/app-layout.component.ts","./src/app/layout/layout-editor.component.ts","./src/app/layout/layout.module.ts","./src/app/layout/modal-layout.component.ts","./src/app/palette/components/all-palettes.component.ts","./src/app/palette/components/floorplan-palette.ts","./src/app/palette/components/palette.component.ts","./src/app/palette/components/squid-palette/squid-palette.component.ts","./src/app/palette/components/wall-palette.component.ts","./src/app/palette/palette.module.ts","./src/app/project/components/project-create.component.ts","./src/app/project/components/project-list.component.ts","./src/app/project/components/project-properties.component.ts","./src/app/project/components/project-select.component.ts","./src/app/project/project.module.ts","./src/app/project/project.service.ts","./src/app/project/services/project.guard.ts","./src/app/shared/components/error-page/error-page.component.ts","./src/app/shared/components/form-group checkbox/form-group-checkbox.component.ts","./src/app/shared/components/form-group-radio/form-group-radio.component.ts","./src/app/shared/components/form-group/form-group.component.ts","./src/app/shared/components/modals/modal-confirm.component.ts","./src/app/shared/components/modals/modal-info.component.ts","./src/app/shared/components/modals/modal-input.component.ts","./src/app/shared/components/modals/modal-spinner.component.ts","./src/app/shared/directive/has-feature.directive.ts","./src/app/shared/directive/is-in-role.directive.ts","./src/app/shared/directive/is-super-admin.directive.ts","./src/app/shared/guards/features.guard.ts","./src/app/shared/pipes/feature-value.pipe.ts","./src/app/shared/pipes/roles/is-in-role.pipe.ts","./src/app/shared/screen-tools.ts","./src/app/shared/services/features.service.ts","./src/app/shared/services/notify.service.ts","./src/app/shared/shared.module.ts","./src/app/test/app.component.ts","./src/app/user/components/user-profile/user-profile.component.ts","./src/app/user/user.module.ts","./src/app/user/user.service.ts","./src/environments/environment.ts","./src/main.ts"],"sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { RouterModule, Routes } from \"@angular/router\";\nimport { AuthGuard } from \"./auth/auth.guard\";\nimport { EditorComponent } from './editor/editor.component';\nimport { LayoutEditorComponent } from \"./layout/layout-editor.component\";\nimport { ProjectGuard } from \"./project/services/project.guard\";\nimport { ProjectSelectComponent } from \"./project/components/project-select.component\";\n\nconst routes: Routes = [\n {\n path: 'connect',\n loadChildren: () => import('./auth/auth.module').then((m) => m.AuthModule),\n },\n {\n path: \"editor\",\n component: LayoutEditorComponent,\n canActivate: [AuthGuard],\n children: [\n {\n path: \"\",\n component: ProjectSelectComponent\n },\n {\n path: \":projectId\",\n canActivate: [ProjectGuard],\n component: EditorComponent\n }\n ],\n },\n {\n path: 'admin',\n canActivate: [AuthGuard],\n loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule)\n },\n {\n path: \"**\",\n redirectTo: \"/connect/login\",\n },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'top' })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule { }\n","import { AfterViewInit, Component } from \"@angular/core\";\n\n@Component({\n selector: \"app-root\",\n templateUrl: \"./app.component.html\",\n})\nexport class AppComponent {}\n","import { CommonModule, registerLocaleData } from \"@angular/common\";\nimport { HttpClient, HttpClientModule } from \"@angular/common/http\";\nimport localeFr from '@angular/common/locales/fr';\nimport { APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';\nimport { BrowserModule } from \"@angular/platform-browser\";\nimport { BrowserAnimationsModule } from \"@angular/platform-browser/animations\";\nimport { RouterModule } from \"@angular/router\";\nimport { TranslateLoader, TranslateModule } from '@ngx-translate/core';\nimport { TranslateHttpLoader } from '@ngx-translate/http-loader';\nimport { AngularSvgIconModule } from \"angular-svg-icon\";\nimport { ToastrModule } from \"ngx-toastr\";\nimport { AppRoutingModule } from \"./app-routing.module\";\nimport { AppComponent } from \"./app.component\";\nimport { AuthModule } from \"./auth/auth.module\";\nimport { EditorModule } from \"./editor/editor.module\";\nimport { FloorPlannerModule } from \"./floorPlanner/floor-planner.module\";\nimport { FolioModule } from \"./folio/folio.module\";\nimport { httpInterceptorProviders } from \"./http-interceptors\";\nimport { LayoutModule } from \"./layout/layout.module\";\nimport { PaletteModule } from \"./palette/palette.module\";\nimport { ProjectModule } from \"./project/project.module\";\nimport { FeaturesService } from \"./shared/services/features.service\";\nimport { SharedModule } from \"./shared/shared.module\";\nimport { UserModule } from \"./user/user.module\";\n\n// the second parameter 'fr' is optional\nregisterLocaleData(localeFr, 'fr');\n\n// AoT requires an exported function for factories\nexport function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {\n return new TranslateHttpLoader(http);\n}\n\nexport function configFactory(config: FeaturesService) {\n return () => config.load();\n}\n\n@NgModule({\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n CommonModule,\n HttpClientModule,\n RouterModule,\n\n AngularSvgIconModule.forRoot(),\n ToastrModule.forRoot(),\n TranslateModule.forRoot({\n defaultLanguage: 'fr',\n loader: {\n provide: TranslateLoader,\n useFactory: HttpLoaderFactory,\n deps: [HttpClient],\n },\n }),\n\n AppRoutingModule,\n SharedModule,\n UserModule,\n FloorPlannerModule,\n LayoutModule,\n AuthModule,\n PaletteModule,\n EditorModule,\n ProjectModule,\n FolioModule,\n ],\n declarations: [AppComponent],\n providers: [\n httpInterceptorProviders,\n { provide: LOCALE_ID, useValue: 'fr' },\n FeaturesService,\n {\n provide: APP_INITIALIZER,\n useFactory: configFactory,\n deps: [FeaturesService],\n multi: true\n }\n ],\n bootstrap: [AppComponent],\n})\nexport class AppModule {\n\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { AuthLayoutComponent } from './components/auth-layout/auth-layout.component';\nimport { ChangePasswordComponent } from './components/change-password/change-password.component';\nimport { PasswordRequestComponent } from './components/password-request/password-request.component';\nimport { LoginComponent } from './components/login/login.component';\nimport { RegisterComponent } from './components/register/register.component';\nimport { RemoteRegisterComponent } from './components/remote-register/remote-register.component';\nimport { FeaturesService } from '../shared/services/features.service';\nimport { ErrorPageComponent } from '../shared/components/error-page/error-page.component';\nimport { FeatureGuard } from '../shared/guards/features.guard';\n\nconst routes: Routes = [\n {\n path: '',\n component: AuthLayoutComponent,\n children: [\n {\n path: 'login',\n component: LoginComponent,\n },\n {\n canActivate: [FeatureGuard],\n path: 'register',\n data: { feature: 'authentication.register' },\n component: RegisterComponent\n },\n {\n canActivate: [FeatureGuard],\n path: 'remoteRegister',\n data: { feature: 'authentication.remoteRegister' },\n component: RemoteRegisterComponent\n },\n {\n path: 'change-password',\n component: ChangePasswordComponent,\n },\n {\n path: 'password-request',\n component: PasswordRequestComponent,\n },\n ],\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class AuthRoutingModule { }\n","import { Injectable } from \"@angular/core\";\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n Router,\n RouterStateSnapshot,\n} from \"@angular/router\";\nimport { Observable, of } from \"rxjs\";\nimport { catchError, map } from \"rxjs/operators\";\nimport { AuthService } from \"./auth.service\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class AuthGuard implements CanActivate {\n constructor(private authSvc: AuthService, private router: Router) { }\n canActivate(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable | Promise | boolean {\n return this.authSvc.loadAuth().pipe(\n map((auth) => {\n if (!auth) {\n this.router.navigate(['/', 'login']);\n return false;\n }\n return true;\n }),\n catchError(() => {\n this.router.navigate(['/', 'connect', 'login']);\n return of(false);\n })\n );\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { RouterModule } from \"@angular/router\";\nimport { NotificationService } from \"../shared/services/notify.service\";\nimport { SharedModule } from \"../shared/shared.module\";\nimport { AuthRoutingModule } from \"./auth-routing.module\";\nimport { AuthService } from \"./auth.service\";\nimport { AuthLayoutComponent } from \"./components/auth-layout/auth-layout.component\";\nimport { ChangePasswordComponent } from \"./components/change-password/change-password.component\";\nimport { LoginComponent } from \"./components/login/login.component\";\nimport { PasswordRequestComponent } from \"./components/password-request/password-request.component\";\nimport { RegisterComponent } from \"./components/register/register.component\";\nimport { RemoteRegisterComponent } from \"./components/remote-register/remote-register.component\";\n\n@NgModule({\n providers: [AuthService, NotificationService],\n imports: [\n CommonModule,\n RouterModule,\n CommonModule,\n ReactiveFormsModule,\n\n SharedModule,\n AuthRoutingModule\n ],\n declarations: [\n AuthLayoutComponent,\n LoginComponent,\n RegisterComponent,\n PasswordRequestComponent,\n ChangePasswordComponent,\n RemoteRegisterComponent\n ],\n})\nexport class AuthModule { }\n","import { Location } from \"@angular/common\";\nimport {\n HttpClient, HttpErrorResponse, HttpHeaders\n} from \"@angular/common/http\";\nimport { Injectable } from \"@angular/core\";\nimport { BehaviorSubject, Observable, of, throwError } from \"rxjs\";\nimport { catchError, map, tap } from \"rxjs/operators\";\nimport { environment } from \"../../environments/environment\";\nimport { NotificationService } from \"../shared/services/notify.service\";\nimport { UserService } from \"../user/user.service\";\nimport { IAuth, IUser, Models } from \"@js-elec/js-elec-types/dist\";\nimport { Model } from \"gojs\";\n\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class AuthService {\n currentAuth = new BehaviorSubject(null);\n\n lsAuthKey = 'auth';\n lsAuthAsKey = 'authAs';\n apiUrl = `${(environment as any).apiHost}`;\n\n constructor(\n private httpClient: HttpClient,\n private notifySvc: NotificationService,\n private userSvc: UserService,\n private location: Location\n ) { }\n\n register(user: Models.User): Observable {\n return this.httpClient.post(\n `${environment.apiHost}/user/register`,\n user\n ).pipe(map(user => new Models.User(user)));\n }\n\n remoteRegister(email: string): Observable {\n return this.httpClient.post(\n `${environment.apiHost}/user/remoteRegister`,\n { email: email.trim().toLocaleLowerCase() }\n ).pipe(map(user => new Models.User(user)));;\n }\n\n getToken() {\n let key = this.lsAuthKey;\n if (localStorage.getItem(this.lsAuthAsKey)) {\n key = this.lsAuthAsKey\n }\n let authStorage: string | null = localStorage.getItem(key);\n let tokenParams = this.location.path().match(/token=([\\w\\d-\\.]+)/);\n if (authStorage !== null) {\n const auth = JSON.parse(authStorage) as IAuth;\n return auth.token;\n } else if (tokenParams) {\n return tokenParams[1];\n }\n return null;\n }\n\n login(email: string, password: string): Observable {\n return this.httpClient\n .post(`${environment.apiHost}/auth/login`, { email, password })\n .pipe(\n catchError((err: HttpErrorResponse) => {\n if (err.status === 401) {\n this.notifySvc.notification(\n \"error\",\n \"Email ou mot de passe incorrect. Souhaitez-vous demander un nouveau mot de passe ?\"\n );\n }\n return throwError(\"Echec de connexion\");\n }),\n map(auth => new Models.Auth(auth)),\n tap((auth) => {\n this.saveAuth(auth);\n this.currentAuth.next(auth);\n })\n );\n }\n\n loginAs(email: string): Observable {\n return this.httpClient\n .post(`${this.apiUrl}/auth/loginAs`, { email })\n .pipe(\n catchError((err: HttpErrorResponse) => {\n if (err.status === 401) {\n this.notifySvc.notification(\n 'error',\n 'Email incorrect'\n );\n }\n return throwError('Echec de connexion');\n }),\n map(auth => new Models.Auth(auth)),\n tap((auth) => {\n this.saveAuth(auth, true);\n this.currentAuth.next(auth);\n })\n );\n }\n\n isLoggedInAs() {\n return localStorage.getItem(this.lsAuthAsKey) !== null;\n }\n\n logout() {\n if (localStorage.getItem(this.lsAuthAsKey)) {\n localStorage.removeItem(this.lsAuthAsKey);\n this.loadAuth();\n } else {\n localStorage.removeItem(this.lsAuthKey);\n this.currentAuth.next(null);\n }\n }\n\n saveAuth(auth: Models.Auth, authAs = false) {\n localStorage.setItem(authAs ? this.lsAuthAsKey : this.lsAuthKey, JSON.stringify(auth));\n }\n\n loadAuth(): Observable {\n // let authStorage: string | null = localStorage.getItem(this.lsAuthKey);\n let token = this.getToken();\n if (!token) {\n this.logout();\n return of(null);\n }\n // const auth = JSON.parse(authStorage) as IAuth;\n return this.userSvc.getMe().pipe(\n map((user) => ({ token: token as string, user: new Models.User(user) })),\n tap((auth) => this.currentAuth.next(auth))\n );\n }\n\n isExpired(auth: IAuth) {\n return false;\n }\n\n // isGranted(user: IUser, keys: string[], restrictions = allRestrictions): boolean {\n // if (!keys || keys.length === 0) {\n // return false;\n // }\n // const currentKey = keys[0];\n // const otherKeys = keys.slice(1, keys.length);\n // const restriction = restrictions.find(r => r.name === currentKey);\n // if (!restriction) {\n // return false;\n // }\n\n // let granted;\n // if (restriction.exactly) {\n // granted = restriction.exactly.indexOf(user.role) >= 0;\n // }\n // else if (restriction.atLeast) {\n // granted = user.role <= restriction.atLeast;\n // } else if (restriction.atBest) {\n // granted = user.role >= restriction.atBest;\n // }\n // if (granted !== false && otherKeys.length > 0) {\n // if (!restriction.children) {\n // granted = false;\n // } else {\n // granted = this.isGranted(user, otherKeys, restriction.children);\n // }\n // }\n // return granted || false;\n\n // }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { environment } from 'src/environments/environment';\n\n@Component({\n templateUrl: './auth-layout.component.html',\n styleUrls: ['./auth-layout.component.css'],\n})\nexport class AuthLayoutComponent implements OnInit {\n\n appName = environment.appName;\n constructor() { }\n\n ngOnInit(): void { }\n}\n","\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { Component, OnInit } from '@angular/core';\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n FormGroup,\n Validators,\n} from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { NotificationService } from 'src/app/shared/services/notify.service';\nimport { UserService } from '../../../user/user.service';\n\n@Component({\n selector: 'app-change-password',\n templateUrl: './change-password.component.html',\n styleUrls: ['./change-password.component.css']\n})\nexport class ChangePasswordComponent implements OnInit {\n resetForm!: FormGroup;\n\n constructor(\n private fb: FormBuilder,\n private userSvc: UserService,\n private route: ActivatedRoute,\n private router: Router,\n private notifySvc: NotificationService\n ) { }\n\n ngOnInit(): void {\n this.resetForm = this.fb.group(\n {\n password: new FormControl(null, [\n Validators.required,\n Validators.minLength(8),\n Validators.maxLength(32),\n ]),\n confirmPassword: new FormControl(null, [Validators.required]),\n },\n { validator: passwordConfirming }\n );\n\n function passwordConfirming(c: AbstractControl): { invalid: boolean } | undefined {\n if (c.get('password')?.value !== c.get('confirmPassword')?.value) {\n return { invalid: true };\n }\n return undefined;\n }\n }\n\n resetPassword() {\n const token = this.route.snapshot.queryParams.token;\n if (this.resetForm.valid) {\n this.userSvc\n .changePasswordWithToken(token, this.resetForm.value.password)\n .subscribe(\n (user) => {\n this.notifySvc.notification(\n 'success',\n `Mot de passe changé avec succès !`\n );\n this.router.navigate(['/', 'auth', 'login']);\n },\n (error: HttpErrorResponse) => {\n this.notifySvc.notification(\n 'error',\n `Une erreur s'est produite, votre lien unique est peut-être arrivé à expiration.`\n );\n }\n );\n }\n }\n}","import { Component, OnInit } from \"@angular/core\";\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\nimport { Router } from \"@angular/router\";\nimport { AuthService } from \"../../auth.service\";\n\n@Component({\n selector: \"login-page\",\n templateUrl: \"login.component.html\",\n})\nexport class LoginComponent implements OnInit {\n form!: FormGroup;\n constructor(\n private fb: FormBuilder,\n private router: Router,\n private authSvc: AuthService,\n ) {}\n\n ngOnInit() {\n this.form = this.fb.group({\n email: [\"\", Validators.required],\n password: [\"\", Validators.required],\n });\n }\n\n submit() {\n if (this.form.valid) {\n this.authSvc\n .login(this.form.value.email, this.form.value.password)\n .subscribe((res) => {\n this.router.navigate([\"/editor\"]);\n });\n }\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { NotificationService } from 'src/app/shared/services/notify.service';\nimport { UserService } from '../../../user/user.service';\n\n@Component({\n selector: 'app-password-request',\n templateUrl: './password-request.component.html',\n styleUrls: ['./password-request.component.css'],\n})\nexport class PasswordRequestComponent implements OnInit {\n passwordForm!: FormGroup;\n isSubmitted = false;\n sent = false;\n constructor(\n private fb: FormBuilder,\n private userSvc: UserService,\n private notifySvc: NotificationService\n ) { }\n\n ngOnInit(): void {\n this.passwordForm = this.fb.group({\n email: ['', [Validators.required, Validators.email]],\n });\n }\n\n submit() {\n this.isSubmitted = true;\n if (this.passwordForm.invalid) {\n return;\n }\n this.userSvc.askPassword(this.passwordForm.value.email).subscribe(\n (_) => {\n this.sent = true;\n },\n (_: HttpErrorResponse) => {\n this.notifySvc.notification('error', `Une erreur s'est produite`);\n }\n );\n this.isSubmitted = false;\n }\n}\n","import { Component, OnInit } from \"@angular/core\";\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\nimport { Router } from \"@angular/router\";\nimport { switchMap } from \"rxjs/operators\";\nimport { AuthService } from \"../../auth.service\";\n\n@Component({\n selector: \"register-page\",\n templateUrl: \"register.component.html\",\n})\nexport class RegisterComponent implements OnInit {\n registerForm!: FormGroup;\n constructor(\n private fb: FormBuilder,\n private router: Router,\n private authSvc: AuthService\n ) { }\n\n ngOnInit() {\n this.registerForm = this.fb.group(\n {\n firstName: [\"\", Validators.required],\n lastName: [\"\", Validators.required],\n email: [\"\", [Validators.required, Validators.email]],\n password: [\"\", Validators.required],\n passwordConfirm: [\"\", Validators.required],\n },\n { validator: this.MustMatch(\"password\", \"passwordConfirm\") }\n );\n }\n\n private MustMatch(controlName: string, matchingControlName: string) {\n return (formGroup: FormGroup) => {\n const control = formGroup.controls[controlName];\n const matchingControl = formGroup.controls[matchingControlName];\n\n if (matchingControl.errors && !matchingControl.errors.mustMatch) {\n // return if another validator has already found an error on the matchingControl\n return;\n }\n\n // set error on matchingControl if validation fails\n if (control.value !== matchingControl.value) {\n matchingControl.setErrors({ mustMatch: true });\n } else {\n matchingControl.setErrors(null);\n }\n };\n }\n\n register() {\n if (this.registerForm.valid) {\n this.authSvc\n .register({ ...this.registerForm.value, passwordConfirm: undefined })\n .pipe(\n switchMap((auth) =>\n this.authSvc.login(\n (this.registerForm.value.email as string).toLowerCase(),\n this.registerForm.value.password\n )\n )\n )\n .subscribe((user) => this.router.navigate([\"/\", \"editor\"]));\n }\n }\n}\n","import { Component, OnInit } from \"@angular/core\";\nimport { ActivatedRoute } from \"@angular/router\";\nimport { catchError, tap } from \"rxjs/operators\";\nimport { AuthService } from \"../../auth.service\";\n\n@Component({\n selector: \"remote-register\",\n templateUrl: \"remote-register.component.html\",\n})\nexport class RemoteRegisterComponent implements OnInit {\n error = false;\n created = false;\n userEmail = \"\";\n constructor(\n // private router: Router,\n private route: ActivatedRoute,\n private authSvc: AuthService,\n ) { }\n\n ngOnInit() {\n this.userEmail = this.route.snapshot.queryParams['email']\n if (this.userEmail && this.userEmail.length > 0)\n this.authSvc.remoteRegister(this.userEmail.replace(' ', '+').trim().toLocaleLowerCase())\n .pipe(\n catchError(err => {\n this.error = true;\n throw err;\n }),\n tap(_user => {\n this.created = true;\n })\n )\n .subscribe()\n }\n\n\n}\n","import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from \"@angular/core\";\nimport { IProject } from '@js-elec/js-elec-types';\nimport { of, Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\nimport { FolioService } from \"src/app/folio/folio.service\";\nimport { ProjectService } from \"src/app/project/project.service\";\n\n@Component({\n selector: \"map-properties\",\n templateUrl: \"./map-properties.component.html\",\n})\nexport class MapPropertiesComponent implements OnInit, OnDestroy {\n @ViewChild(\"uploader\") uploader!: ElementRef;\n\n locked!: boolean\n showMeasures!: boolean\n destroy$ = new Subject();\n\n constructor(private projectSvc: ProjectService, private folioSvc: FolioService) {\n this.folioSvc.lockGrounds$\n .pipe(takeUntil(this.destroy$))\n .subscribe(l => this.locked = l);\n }\n\n switchLock() {\n this.folioSvc.lockGrounds$.next(!this.folioSvc.lockGrounds$.value)\n }\n\n switchShowMeasures() {\n this.folioSvc.showMeasures$.next(!this.folioSvc.showMeasures$.value)\n }\n\n uploadMap(file?: File) {\n if (!file)\n return of(undefined);\n return this.projectSvc\n .uploadMap(this.projectSvc.currentProject.value?.id as string, file)\n .subscribe((project: IProject) => {\n // (this.projectSvc.currentProject.value as IProject).groundImages = project.groundImages\n this.projectSvc.currentProject.next(project)\n this.uploader.nativeElement.value = \"\";\n });\n }\n\n // deleteMap(key: string) {\n // return this.projectSvc\n // .deleteMap(this.projectSvc.currentProject.value?.id as string, key)\n // .subscribe((project) => {\n // (this.projectSvc.currentProject.value as IProject).groundImages = project.groundImages\n // });\n // }\n\n ngOnInit() { }\n\n ngOnDestroy(): void {\n this.destroy$.next(true);\n }\n}\n","import { Component } from \"@angular/core\";\nimport { BsModalRef } from \"ngx-bootstrap/modal\";\n\n@Component({\n templateUrl: 'norme-modal.component.html'\n})\nexport class NormeModalComponent {\n constructor(public activeModal: BsModalRef) {\n\n }\n}","import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from \"@angular/core\";\nimport { FormBuilder, FormGroup } from \"@angular/forms\";\nimport * as go from \"gojs\";\nimport { BsModalRef } from \"ngx-bootstrap/modal\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\nimport { Floorplan } from \"src/app/floorPlanner/diagram/floorplan-diagram\";\nimport { DiagramUnitsAbbreviations, ScalesEnum } from \"src/app/floorPlanner/models/elements\";\nimport { convertUnits, convertUnitsToPixels } from \"src/app/floorPlanner/tools\";\nimport { IOpenedFolio } from \"src/app/folio/folio.service\";\n\ntype PaperFormatType = { name: string, width: number, height: number, units: DiagramUnitsAbbreviations }\ntype PaperOrientationType = 'portrait' | 'landscape'\n\n@Component({\n selector: \"print-preview\",\n templateUrl: \"./print-preview.component.html\",\n})\nexport class PrintPreviewComponent implements OnInit, OnDestroy {\n @Input() folio!: IOpenedFolio\n @ViewChild('svgHolder', { static: true }) svgHolder!: ElementRef\n\n form!: FormGroup\n formats: PaperFormatType[] = [\n { name: 'A4', width: 210, height: 297, units: DiagramUnitsAbbreviations.mm },\n { name: 'A3', width: 297, height: 410, units: DiagramUnitsAbbreviations.mm }\n ]\n orientations: PaperOrientationType[] = ['portrait', 'landscape']\n scales = Object.keys(ScalesEnum).filter(k => isNaN(Number(k)));\n scalesEnum = ScalesEnum\n\n destroy$ = new Subject()\n\n constructor(private fb: FormBuilder, private modal: BsModalRef, private renderer: Renderer2) {\n\n }\n\n ngOnInit() {\n this.form = this.fb.group({\n format: [this.formats[1]],\n orientation: [this.orientations[1]],\n scale: [ScalesEnum[ScalesEnum.centieme]],\n })\n\n this.form.valueChanges\n .pipe(\n takeUntil(this.destroy$)\n ).subscribe(value => {\n this.getFolioSvg(value);\n document.documentElement.style.setProperty('--paper', value.format.name + ' ' + value.orientation);\n })\n this.getFolioSvg(this.form.value);\n }\n\n getFolioSvg(value: { format: PaperFormatType, scale: keyof typeof ScalesEnum, orientation: PaperOrientationType }) {\n const diag: Floorplan = (this.folio.diagram as Floorplan);\n const paperUnitWidth: number = convertUnits(value.format.units, DiagramUnitsAbbreviations.m, value.orientation === \"portrait\" ? value.format.width : value.format.height);\n const paperUnitHeight: number = convertUnits(value.format.units, DiagramUnitsAbbreviations.m, value.orientation === \"portrait\" ? value.format.height : value.format.width);\n\n const diagUnitWidth = paperUnitWidth * ScalesEnum[value.scale]\n const diagUnitHeight = paperUnitHeight * ScalesEnum[value.scale]\n\n const diagPixelWidth = convertUnitsToPixels(diagUnitWidth, diag.model.modelData.unitsConversionFactor)\n const diagPixelHeight = convertUnitsToPixels(diagUnitHeight, diag.model.modelData.unitsConversionFactor)\n\n const bounds: go.Rect = this.folio.diagram?.documentBounds as go.Rect;\n bounds.width = diagPixelWidth\n bounds.height = diagPixelHeight\n\n const p = bounds.position;\n const svg = this.folio.diagram?.makeSvg({\n scale: 1,\n position: new go.Point(p.x, p.y),\n size: new go.Size(bounds.width, bounds.height),\n showGrid: false,\n elementFinished: function (graphObject, SVGElement) {\n console.log(SVGElement)\n }\n // type: \"image/png\",\n // returnType: \"string\",\n });\n\n if (svg) {\n svg.removeAttribute('width')\n svg.removeAttribute('height')\n // svg.style.width = 'auto';\n // svg.style.height = 'auto'\n if (this.svgHolder.nativeElement.children.length)\n this.renderer.removeChild(this.svgHolder.nativeElement, this.svgHolder.nativeElement.children[0])\n this.svgHolder.nativeElement.appendChild(svg)\n } else if (this.svgHolder.nativeElement.children.length)\n this.renderer.removeChild(this.svgHolder.nativeElement, this.svgHolder.nativeElement.children[0])\n }\n\n print() {\n window.print()\n }\n\n close() {\n this.modal.hide()\n }\n\n ngOnDestroy(): void {\n this.destroy$.next(true)\n }\n}\n","import { Component, OnInit } from \"@angular/core\";\nimport { Router } from \"@angular/router\";\nimport { IProject } from '@js-elec/js-elec-types';\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { BehaviorSubject, Observable } from \"rxjs\";\nimport { map, take, tap, timeout } from \"rxjs/operators\";\nimport { AuthService } from \"../auth/auth.service\";\nimport { Floorplan } from \"../floorPlanner/diagram/floorplan-diagram\";\nimport { WallThicknessEnum } from \"../folio/folio.constants\";\nimport { FolioService, IOpenedFolio } from \"../folio/folio.service\";\nimport { ProjectCreateComponent } from \"../project/components/project-create.component\";\nimport { ProjectService } from \"../project/project.service\";\nimport { ModalConfirmComponent } from \"../shared/components/modals/modal-confirm.component\";\nimport { NormeModalComponent } from \"./components/norme-modal.component\";\nimport { ModalInfoComponent } from \"../shared/components/modals/modal-info.component\";\nimport { HttpClient } from \"@angular/common/http\";\n\n@Component({\n selector: \"editor-layout\",\n templateUrl: \"editor.component.html\",\n styleUrls: [\"editor.component.scss\"],\n})\nexport class EditorComponent implements OnInit {\n project$: Observable;\n openedFolios: IOpenedFolio[];\n selectedFolioIndex = 0;\n\n tabIndex = 0;\n showWallMenu = false;\n\n model!: {\n modelData: any;\n nodeDataArray: any[];\n linkDataArray: any[];\n };\n diag = new BehaviorSubject(null);\n\n wallPaletteInitialized = false;\n wallMode?: WallThicknessEnum = undefined;\n wallModes = WallThicknessEnum\n\n user$? = this.authSvc.currentAuth.pipe(map(auth => auth ? auth.user : undefined))\n\n constructor(\n private projectSvc: ProjectService,\n public authSvc: AuthService,\n public folioSvc: FolioService,\n private modalSvc: BsModalService,\n private httpClient: HttpClient,\n private router: Router\n ) {\n this.project$ = this.projectSvc.currentProject;\n this.openedFolios = this.folioSvc.openedFolios;\n\n this.folioSvc.openFolio$.subscribe(\n (folio) =>\n (this.selectedFolioIndex = this.openedFolios.findIndex(\n (f) => f.folio.id === folio.id\n ))\n );\n this.folioSvc.closeFolio$.subscribe((index) => {\n this.selectedFolioIndex = Math.max(-1, index - 1);\n if (this.openedFolios.length === 0) {\n this.tabIndex = 0;\n }\n });\n }\n\n ngOnInit() {\n this.selectWallMode();\n }\n\n selectTab(index: number) {\n if (this.openedFolios.length === 0) {\n return;\n }\n if (index === 1) {\n this.selectWallMode();\n }\n else if (index === 2) {\n this.selectWallMode();\n }\n else if (index === 3) {\n this.wallPaletteInitialized = true;\n }\n this.tabIndex = index;\n }\n\n closeFolio(index: number) {\n this.folioSvc.removeOpenedFolio(index);\n }\n\n selectFolio(index: number) {\n this.selectedFolioIndex = index;\n this.folioSvc.selectedFolio$.next(this.openedFolios[index]);\n }\n\n selectWallMode(wallMode?: WallThicknessEnum) {\n\n setTimeout(() => this.showWallMenu = false, 400)\n this.wallMode = wallMode;\n this.folioSvc.wallModeActivated$.next(this.wallMode);\n }\n\n openProject() {\n this.router.navigate([\"/\", \"editor\"]);\n }\n\n openModalLink(link: { url: string }) {\n this.httpClient\n .get(link.url, { responseType: \"text\" })\n .pipe(\n tap(res => {\n this.modalSvc.show(\n ModalInfoComponent,\n {\n class: 'right-modal',\n initialState: {\n html: res\n }\n }\n )\n })\n ).subscribe()\n }\n\n newProject() {\n this.modalSvc.show(ProjectCreateComponent, {});\n this.modalSvc.onHide.pipe(take(1)).subscribe((p) => {\n window.location = window.location;\n });\n }\n\n openNorme() {\n this.modalSvc.show(NormeModalComponent, { class: 'right-modal' })\n }\n\n deleteProject() {\n this.modalSvc.show(ModalConfirmComponent, {\n initialState: {\n title: \"Suppression\",\n body:\n \"Êtes-vous sûr de vouloir supprimer le dossier et tous ces folios ? Cette opération est irreversible.\",\n },\n });\n\n this.modalSvc.onHide.pipe(take(1)).subscribe((result) => {\n if (result === true) {\n this.projectSvc\n .deleteProject(this.projectSvc.currentProject.value?.id as string)\n .pipe(\n tap(_ => this.openProject())\n ).subscribe();\n }\n });\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { RouterModule } from \"@angular/router\";\nimport { AngularSvgIconModule } from \"angular-svg-icon\";\nimport { BsDropdownModule } from \"ngx-bootstrap/dropdown\";\nimport { TabsModule } from \"ngx-bootstrap/tabs\";\nimport { TooltipModule } from \"ngx-bootstrap/tooltip\";\nimport { FloorPlannerModule } from \"../floorPlanner/floor-planner.module\";\nimport { FolioModule } from \"../folio/folio.module\";\nimport { LayoutModule } from \"../layout/layout.module\";\nimport { PaletteModule } from \"../palette/palette.module\";\nimport { ProjectModule } from \"../project/project.module\";\nimport { SharedModule } from \"../shared/shared.module\";\nimport { MapPropertiesComponent } from \"./components/map-properties.component\";\nimport { NormeModalComponent } from \"./components/norme-modal.component\";\nimport { PrintPreviewComponent } from \"./components/print-preview.component\";\nimport { EditorComponent } from \"./editor.component\";\nimport { AppComponent } from \"../test/app.component\";\nimport { GojsAngularModule } from \"gojs-angular\";\n\n@NgModule({\n imports: [\n CommonModule,\n RouterModule,\n FormsModule,\n ReactiveFormsModule,\n\n GojsAngularModule,\n\n TooltipModule.forRoot(),\n BsDropdownModule.forRoot(),\n TabsModule.forRoot(),\n AngularSvgIconModule,\n\n SharedModule,\n FloorPlannerModule,\n LayoutModule,\n PaletteModule,\n ProjectModule,\n FolioModule,\n ],\n declarations: [EditorComponent, MapPropertiesComponent, PrintPreviewComponent, NormeModalComponent, AppComponent],\n exports: [],\n})\nexport class EditorModule { }\n","import * as go from \"gojs\";\nimport { Floorplan } from \"./floorplan-diagram.js\";\n\nexport class ConnectorTool extends go.Tool {\n _newElement!: go.Part | null;\n _newElementData: any;\n constructor(private disableTransplantingInc: boolean) {\n super();\n this.isEnabled = false;\n }\n\n public doActivate(): void {\n // go.DraggingTool.prototype.doActivate.call(this);\n console.log(\"activated\");\n this.isActive = true;\n }\n\n public doMouseMove(): void {\n const fp: Floorplan = this.diagram as Floorplan;\n const mousePt: go.Point = fp.lastInput.documentPoint;\n const tool: ConnectorTool = this;\n if (tool.isActive && fp !== null && this._newElement) {\n // this._newElementData.loc = `${mousePt.x} ${mousePt.y}`;\n // console.log(mousePt.x);\n this.diagram.model.setDataProperty(\n this._newElement.data,\n \"loc\",\n `${mousePt.x} ${mousePt.y}`\n );\n }\n }\n public doMouseDown(): void {\n // go.DraggingTool.prototype.doMouseDown.call(this);\n this.copySelection(this.diagram, this.diagram.selection.first());\n this.diagram.isMouseCaptured = true;\n }\n\n // public doMouseUp(): void {\n // //this.doDeactivate();\n // }\n\n public doDeactivate(): void {\n // go.DraggingTool.prototype.doDeactivate.call(this);\n\n this.diagram.isMouseCaptured = false;\n // this.stopTransaction();\n this.isActive = false;\n this.isEnabled = false;\n this._newElementData = null;\n this._newElement = null;\n }\n\n private copySelection(diagram: go.Diagram, obj: any) {\n const transactionName = \"Add Element\";\n diagram.startTransaction(transactionName);\n\n // get the node data for which the user clicked the button\n const fromNode = obj;\n const fromData = fromNode.data;\n // create a new \"State\" data object, positioned off to the right of the adorned Node\n const toData: any = {\n ...fromData,\n loc: undefined,\n // key: undefined,\n __gohashid: undefined,\n };\n const p = fromNode.location.copy();\n toData.loc = `${p.x + 2} ${p.y + 2}`;\n // toData.loc = go.Point.stringify(p); // the \"loc\" property is a string, not a Point object\n // add the new node data to the model\n const model = diagram.model;\n model.addNodeData(toData);\n this._newElementData = toData;\n\n // create a link data from the old node data to the new node data\n const linkdata = {\n from: model.getKeyForNodeData(fromData), // or just: fromData.id\n to: model.getKeyForNodeData(toData),\n fromPort: \"logical\",\n toPort: \"logical\",\n };\n // and add the link data to the model\n (model as any).addLinkData(linkdata);\n\n // select the new Node\n const newnode = diagram.findNodeForData(toData);\n if (this.disableTransplantingInc !== true)\n (diagram as Floorplan).incrementProperty(newnode as go.Node, \"name\");\n diagram.select(newnode);\n this._newElement = newnode;\n\n diagram.commitTransaction(transactionName);\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from \"@angular/core\";\nimport { IProject } from '@js-elec/js-elec-types';\nimport * as go from \"gojs\";\nimport { DataSyncService, DiagramComponent } from \"gojs-angular\";\nimport { produce } from \"immer\";\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { Observable, Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\nimport { PrintPreviewComponent } from \"src/app/editor/components/print-preview.component\";\nimport { FolioLayersComponent } from \"src/app/folio/components/folio-layers.component\";\nimport { FolioPropertiesComponent } from \"src/app/folio/components/folio-properties.component\";\nimport { WallThicknessEnum, defaultDiagramModelData } from \"src/app/folio/folio.constants\";\nimport { FolioService, IOpenedFolio } from \"src/app/folio/folio.service\";\nimport { ProjectService } from \"src/app/project/project.service\";\nimport { NotificationService } from \"src/app/shared/services/notify.service\";\nimport { environment } from \"src/environments/environment\";\nimport { findDPI } from \"../../shared/screen-tools\";\nimport getsetFunctions from \"../inspector/getset-functions\";\nimport {\n DiagramLayersEnum,\n DiagramUnitsConversionEnum,\n bottomSystemLayers,\n topSystemLayers\n} from \"../models/elements\";\nimport { Floorplan } from \"./floorplan-diagram\";\n\n\n@Component({\n selector: \"floor-planner\",\n templateUrl: \"floor-planner.component.html\",\n styleUrls: [\"floor-planner.component.scss\"],\n})\nexport class FloorPlannerComponent implements OnInit, OnDestroy, AfterViewInit {\n @Output() closeFolio = new EventEmitter();\n @Input() openedFolio!: IOpenedFolio;\n\n @ViewChild(\"myDiagram\", { static: true }) public myDiagramComponent!: DiagramComponent;\n\n model: any;\n\n diag!: Floorplan;\n diagReady!: Observable;\n\n skipDiagramUpdate = false;\n diagramDivClassName = \"myDiagramDiv\";\n\n initialized = false;\n\n state!: any;\n\n\n destroy$ = new Subject();\n\n constructor(\n private projectSvc: ProjectService,\n private folioSvc: FolioService,\n private modalSvc: BsModalService,\n private notifySvc: NotificationService,\n private cdr: ChangeDetectorRef\n ) { }\n\n ngOnInit() {\n const { nodeDataArray, modelData, linkDataArray } = this.openedFolio.folio;\n this.state = go.Model.fromJson({\n nodeDataArray,\n modelData,\n linkDataArray,\n class: \"GraphLinksModel\",\n copiesKey: true,\n }) as go.GraphLinksModel;\n }\n\n initDiagram(): go.Diagram {\n\n const $ = go.GraphObject.make;\n go.Diagram.licenseKey = environment.goLicense;\n\n this.diag = $(Floorplan, {\n \"undoManager.isEnabled\": true,\n // model: $(go.GraphLinksModel,\n // {\n // nodeKeyProperty: 'id',\n // linkToPortIdProperty: 'toPort',\n // linkFromPortIdProperty: 'fromPort',\n // linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n // }\n // )\n });\n\n // this.diag.commandHandler.archetypeGroupData = { key: 'Group', isGroup: true };\n\n // const makePort = function (id: string, spot: go.Spot) {\n // return $(go.Shape, 'Circle',\n // {\n // opacity: .5,\n // fill: 'gray', strokeWidth: 0, desiredSize: new go.Size(8, 8),\n // portId: id, alignment: spot,\n // fromLinkable: true, toLinkable: true\n // }\n // );\n // }\n\n // define the Node template\n // this.diag.nodeTemplate =\n // $(go.Node, 'Spot',\n // {\n // contextMenu:\n // $('ContextMenu',\n // $('ContextMenuButton',\n // $(go.TextBlock, 'Group'),\n // { click: function (e, obj) { e.diagram.commandHandler.groupSelection(); } },\n // new go.Binding('visible', '', function (o) {\n // return o.diagram.selection.count > 1;\n // }).ofObject())\n // )\n // },\n // new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(go.Point.stringify),\n // $(go.Panel, 'Auto',\n // $(go.Shape, 'RoundedRectangle', { stroke: null },\n // new go.Binding('fill', 'color', (c, panel) => {\n\n // return c;\n // })\n // ),\n // $(go.TextBlock, { margin: 8, editable: true },\n // new go.Binding('text').makeTwoWay())\n // ),\n // // Ports\n // makePort('t', go.Spot.TopCenter),\n // makePort('l', go.Spot.Left),\n // makePort('r', go.Spot.Right),\n // makePort('b', go.Spot.BottomCenter)\n // );\n\n // const self = this;\n\n\n\n // self.isInitialized.emit(this.diag);\n\n /*\n ngAfterViewInit() {\n this.diagReady = combineLatest([of(true), this.diag]).pipe(\n filter((res) => res[0] === true && res[1] !== null),\n delay(0),\n map((res) => res[1])\n );\n }*/\n\n return this.diag;\n }\n\n public ngAfterViewInit() {\n this.diag = this.myDiagramComponent.diagram as Floorplan;\n this.cdr.detectChanges(); // IMPORTANT: without this, Angular will throw ExpressionChangedAfterItHasBeenCheckedError (dev mode only)\n const $ = go.GraphObject.make;\n\n const self = this;\n this.myDiagramComponent.diagram.addDiagramListener(\"ExternalObjectsDropped\", function (e) {\n const fp: Floorplan = e.diagram as Floorplan;\n fp.selection.iterator.each(function (node) {\n if (node.category === \"ground\") {\n self.folioSvc.lockGrounds$.next(true)\n }\n })\n });\n\n this.openedFolio.diagram = this.myDiagramComponent.diagram as Floorplan;\n\n // layers\n const forelayer = this.myDiagramComponent.diagram.findLayer(\n DiagramLayersEnum[DiagramLayersEnum.Foreground]\n );\n for (const item in DiagramLayersEnum) {\n if (!isNaN(Number(item))) {\n if (\n Number(item) > bottomSystemLayers &&\n Number(item) < topSystemLayers\n )\n forelayer && this.myDiagramComponent.diagram.addLayerBefore(\n $(go.Layer, { name: DiagramLayersEnum[item] }),\n forelayer\n );\n }\n }\n\n // this.diag.enableWallBuilding();\n this.myDiagramComponent.diagram.addDiagramListener(\"InitialLayoutCompleted\", (e) => {\n const fp: Floorplan = e.diagram as Floorplan;\n\n // updateWalls\n fp.nodes.iterator.each((n) => {\n if (n.category === \"WallGroup\") {\n fp.updateWall(n as go.Group);\n }\n\n if (n.category === \"RoomNode\") {\n fp.updateRoom(n);\n }\n });\n\n fp.updateAllTargetBindings()\n\n getsetFunctions.setGridSize(fp, fp.model.modelData.gridSize);\n\n // fit size\n // this.diag.div.parentElement.style.display = \"block\";\n // const containerWidth = this.diag.div.parentElement.offsetWidth;\n // const containerHeight = this.diag.div.parentElement.parentElement\n // .offsetHeight;\n // this.diag.div.style.width = `${containerWidth - 5}px`;\n // this.diag.div.style.height = `${containerHeight - 20}px`;\n // this.diag.requestUpdate();\n\n if (!this.initialized) {\n this.folioSvc.wallModeActivated$\n .pipe(takeUntil(this.destroy$))\n .subscribe((wallMode: WallThicknessEnum | undefined) => {\n if (wallMode === WallThicknessEnum.scale) {\n (this.myDiagramComponent.diagram as Floorplan).enableWallBuilding(wallMode, true);\n } else if (wallMode === WallThicknessEnum.divider) {\n (this.myDiagramComponent.diagram as Floorplan).enableDividerBuilding();\n } else if (wallMode === undefined) {\n (this.myDiagramComponent.diagram as Floorplan).disableWallBuilding();\n }\n else {\n (this.myDiagramComponent.diagram as Floorplan).enableWallBuilding(wallMode);\n }\n });\n\n setTimeout(() => {\n this.folioSvc.lockGrounds$\n .pipe(takeUntil(this.destroy$))\n .subscribe(lock => (this.myDiagramComponent.diagram as Floorplan).FreezeGrounds(lock))\n }, 600)\n }\n this.initialized = true\n\n });\n\n }\n\n public initDiagram2(): go.Diagram {\n\n const $ = go.GraphObject.make;\n const dia = $(go.Diagram, {\n 'undoManager.isEnabled': true,\n // 'clickCreatingTool.archetypeNodeData': { text: 'new node', color: 'lightblue' },\n model: $(go.GraphLinksModel,\n {\n nodeKeyProperty: 'id',\n linkToPortIdProperty: 'toPort',\n linkFromPortIdProperty: 'fromPort',\n linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n }\n )\n });\n\n dia.commandHandler.archetypeGroupData = { key: 'Group', isGroup: true };\n\n const makePort = function (id: string, spot: go.Spot) {\n return $(go.Shape, 'Circle',\n {\n opacity: .5,\n fill: 'gray', strokeWidth: 0, desiredSize: new go.Size(8, 8),\n portId: id, alignment: spot,\n fromLinkable: true, toLinkable: true\n }\n );\n }\n\n // define the Node template\n dia.nodeTemplate =\n $(go.Node, 'Spot',\n {\n contextMenu:\n $('ContextMenu',\n $('ContextMenuButton',\n $(go.TextBlock, 'Group'),\n { click: function (e, obj) { e.diagram.commandHandler.groupSelection(); } },\n new go.Binding('visible', '', function (o) {\n return o.diagram.selection.count > 1;\n }).ofObject())\n )\n },\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(go.Point.stringify),\n $(go.Panel, 'Auto',\n $(go.Shape, 'RoundedRectangle', { stroke: null },\n new go.Binding('fill', 'color', (c, panel) => {\n\n return c;\n })\n ),\n $(go.TextBlock, { margin: 8, editable: true },\n new go.Binding('text').makeTwoWay())\n ),\n // Ports\n makePort('t', go.Spot.TopCenter),\n makePort('l', go.Spot.Left),\n makePort('r', go.Spot.Right),\n makePort('b', go.Spot.BottomCenter)\n );\n\n return dia;\n }\n\n\n closeFolioClick() {\n this.closeFolio.emit(this.openedFolio);\n }\n\n saveFolio() {\n const model: any = JSON.parse(this.diag.model.toJson());\n this.openedFolio.folio.nodeDataArray = model.nodeDataArray;\n this.openedFolio.folio.linkDataArray = model.linkDataArray;\n this.openedFolio.folio.modelData = model.modelData;\n this.folioSvc\n .updateFolio(\n this.projectSvc.currentProject.value as IProject,\n this.openedFolio\n )\n .subscribe(() =>\n this.notifySvc.notification(\"success\", \"Folio enregistré\")\n );\n }\n\n downloadFolio() {\n function download(content: any, fileName: string, contentType: any) {\n fileName = \"json.txt\";\n const a = document.createElement(\"a\");\n const file = new Blob([content], { type: contentType });\n a.href = URL.createObjectURL(file);\n a.download = fileName;\n a.click();\n a.remove();\n }\n download(\n // (this.diag as Floorplan).model.toJson(),\n btoa((this.diag as Floorplan).model.toJson()),\n this.openedFolio.folio.name + \".txt\",\n \"text/plain\"\n );\n }\n\n setupLayers() {\n console.log('first:' + (this.openedFolio.diagram as Floorplan).model.modelData.elementSize);\n\n this.modalSvc.show(FolioLayersComponent, {\n class: \"right-modal modal-sm\",\n initialState: {\n project: this.projectSvc.currentProject.value,\n openedFolio: this.openedFolio,\n },\n });\n\n\n }\n\n setupProperties() {\n this.modalSvc.show(FolioPropertiesComponent, {\n class: \"\",\n initialState: {\n project: this.projectSvc.currentProject.value,\n openedFolio: this.openedFolio,\n },\n });\n }\n\n printFolio() {\n const bounds: go.Rect = this.openedFolio.diagram?.documentBounds as go.Rect;\n\n const resDpi = findDPI();\n const screenRes = resDpi / 2.54; // inch to cm\n const unitRatio =\n (DiagramUnitsConversionEnum[\n this.openedFolio.diagram?.model.modelData.units\n ] as any) / DiagramUnitsConversionEnum.cm;\n const scale =\n screenRes /\n (this.openedFolio.diagram?.model.modelData.unitsConversionFactor *\n unitRatio);\n\n const p = bounds.position;\n const img = this.openedFolio.diagram?.makeImage({\n scale: 1,\n position: new go.Point(p.x, p.y),\n size: new go.Size(bounds.width, bounds.height),\n showGrid: true,\n type: \"image/png\",\n returnType: \"string\",\n });\n\n // const doc = new jsPDF({\n // orientation: \"portrait\",\n // unit: \"cm\",\n // format: \"a4\",\n // // compress: true\n // });\n\n // doc.addImage(\n // img as string,\n // \"png\",\n // 0,\n // 0,\n // bounds.width / scale,\n // bounds.height / scale\n // );\n\n var imgDiv = document.getElementById('myImages');\n if (img && imgDiv) {\n // img.className = 'images';\n // imgDiv.appendChild(img);\n // imgDiv.appendChild(document.createElement('br'));\n\n this.modalSvc.show(PrintPreviewComponent, { initialState: { folio: this.openedFolio }, class: 'full-modal' })\n }\n // doc.save(`folio - ${this.openedFolio.folio.name}.pdf`);\n }\n\n // When the diagram model changes, update app data to reflect those changes. Be sure to use immer's \"produce\" function to preserve immutability\n diagramModelChange(changes: go.IncrementalData) {\n // return;\n // if (!changes) return;\n // const appComp = this;\n // this.state = produce(this.state, (draft: any) => {\n // // set skipsDiagramUpdate: true since GoJS already has this update\n // // this way, we don't log an unneeded transaction in the Diagram's undoManager history\n // draft.skipsDiagramUpdate = true;\n // draft.diagramNodeData = DataSyncService.syncNodeData(changes, draft.diagramNodeData);\n // draft.diagramLinkData = DataSyncService.syncLinkData(changes, draft.diagramLinkData);\n // draft.diagramModelData = DataSyncService.syncModelData(changes, draft.diagramModelData);\n // // If one of the modified nodes was the selected node used by the inspector, update the inspector selectedNodeData object\n // const modifiedNodeDatas = changes.modifiedNodeData;\n // if (modifiedNodeDatas && draft.selectedNodeData) {\n // for (let i = 0; i < modifiedNodeDatas.length; i++) {\n // const mn = modifiedNodeDatas[i];\n // const nodeKeyProperty = appComp.myDiagramComponent.diagram.model.nodeKeyProperty as string;\n // if (mn[nodeKeyProperty] === draft.selectedNodeData[nodeKeyProperty]) {\n // draft.selectedNodeData = mn;\n // }\n // }\n // }\n // });\n };\n // diagramModelChange(changes: go.IncrementalData) {\n // // return;\n // // when setting state here, be sure to set skipsDiagramUpdate: true since GoJS already has this update\n // // (since this is a GoJS model changed listener event function)\n // // this way, we don't log an unneeded transaction in the Diagram's undoManager history\n // this.skipDiagramUpdate = true;\n // this.openedFolio.folio.nodeDataArray = DataSyncService.syncNodeData(\n // changes,\n // this.model.nodeDataArray\n // );\n // this.openedFolio.folio.linkDataArray = DataSyncService.syncLinkData(\n // changes,\n // this.model.linkDataArray\n // );\n // this.openedFolio.folio.modelData = DataSyncService.syncModelData(\n // changes,\n // this.model.modelData\n // );\n // }\n\n ngOnDestroy() {\n this.destroy$.next(true);\n }\n}\n","// tslint:disable:only-arrow-functions\n// tslint:disable:forin\n// tslint:disable:max-line-length\n\n/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * Floorplan Class\n * A Floorplan is a Diagram with special rules\n */\n\nimport * as go from \"gojs\";\n\nimport { defaultDiagramModelData, defaultFolio, gaineLengths, SymbolTypeHeightMapping, WallThicknessEnum } from \"src/app/folio/folio.constants\";\nimport { findDPI } from \"src/app/shared/screen-tools\";\nimport { FeaturesService } from \"src/app/shared/services/features.service\";\nimport getsetFunctions from \"../inspector/getset-functions\";\nimport {\n DiagramLayersEnum,\n DiagramUnitsAbbreviations, GaineLengthsEnum, LinkTypesEnum, roomColors\n} from \"../models/elements\";\nimport { NodeLabelDraggingTool } from \"../node-label-dragging-tool\";\nimport { base26Add, calculateLinkLength, convertPixelsToUnits, convertUnits, convertUnitsToPixels } from \"../tools\";\nimport { ConnectorTool } from \"./connector-tool\";\nimport { WallBuildingTool } from \"./wall-building-tool\";\nimport { WallReshapingTool } from \"./wall-reshaping-tool\";\n\nexport class Floorplan extends go.Diagram {\n private _palettes: Array;\n private _pointNodes: go.Set;\n private _dimensionLinks: go.Set;\n private _angleNodes: go.Set;\n\n /**\n * A Floorplan is a special kind of Diagram. It supports walls, rooms, and many other common features a Floorplan might have.\n * @param div The HTML DIV element or DIV element id for the Floorplan to use\n */\n constructor(div: HTMLDivElement | string) {\n super(div);\n\n /**\n * Floor Plan Setup:\n * Initialize Floor Plan, Floor Plan Listeners, Floor Plan Overview\n */\n\n // When a FloorplanPalette instance is made, it is automatically added to a Floorplan's \"palettes\" property\n this._palettes = [];\n\n // Point Nodes, Dimension Links, Angle Nodes on the Floorplan (never in model data)\n this._pointNodes = new go.Set();\n this._dimensionLinks = new go.Set();\n this._angleNodes = new go.Set();\n\n const $ = go.GraphObject.make;\n\n this.allowLink = true;\n this.undoManager.isEnabled = true;\n this.layout.isInitial = false;\n this.layout.isOngoing = false;\n this.model = $(go.GraphLinksModel, {\n linkFromPortIdProperty: \"fromPort\", // required information:\n linkToPortIdProperty: \"toPort\",\n linkKeyProperty: \"key\", // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n modelData: { ...defaultDiagramModelData },\n });\n\n this.model.makeUniqueKeyFunction = (\n _model: go.Model,\n data: go.ObjectData\n ) => {\n const elecLib = FeaturesService.symbolLib$.value;\n const lib = elecLib;\n const elementFound = ((lib && lib.categories) || [])\n .flatMap((c: any) => c.symbols)\n .find((e: any) => e.symbolName === data.symbolName);\n if (elementFound && elementFound.key) {\n return elementFound.key;\n }\n return data.key;\n };\n\n this.grid = $(\n go.Panel,\n \"Grid\",\n {\n gridCellSize: new go.Size(\n this.model.modelData.gridSize,\n this.model.modelData.gridSize\n ),\n visible: true,\n },\n $(go.Shape, \"LineH\", { stroke: \"#cdcdff\" }),\n $(go.Shape, \"LineV\", { stroke: \"#cdcdff\" }),\n $(go.Shape, \"LineH\", { stroke: \"#9a9aff\", interval: 5 }),\n $(go.Shape, \"LineV\", { stroke: \"#9a9aff\", interval: 5 })\n );\n\n\n this.commandHandler.canDeleteSelection = function () {\n return !this.diagram.selection\n .filter(p => p.type && p.type.name === \"Link\")\n .any(function (p) { return p.data.color; })\n && go.CommandHandler.prototype.canDeleteSelection.call(this);\n };\n this.commandHandler.canGroupSelection = function () {\n return true;\n };\n this.commandHandler.canUngroupSelection = function () {\n return true;\n };\n this.commandHandler.archetypeGroupData = { isGroup: true };\n\n // Listeners\n this.addDiagramListener(\"LinkDrawn\", function (e) {\n const fp: Floorplan = e.diagram as Floorplan;\n const link = e.subject;\n\n // if link already exists, remove it\n const doublon = (fp.findLinksByExample({ from: link.data.from, to: link.data.to }).count + fp.findLinksByExample({ from: link.data.to, to: link.data.from }).count) > 1;\n if (doublon) {\n alert('connexion déjà existante')\n fp.remove(link);\n return;\n }\n\n // check squid availability\n const nodeFrom = fp.findNodeForKey(link.data.from);\n const nodeTo = fp.findNodeForKey(link.data.to);\n const nodePieuvre = [nodeFrom, nodeTo].find(node => node?.data.type === \"Boite Pieuvre\")\n if (nodePieuvre && nodePieuvre.data.maxLinks) {\n const pieuvreLinksCount = fp.findLinksByExample({ from: nodePieuvre.data.key }).count + fp.findLinksByExample({ to: nodePieuvre.data.key }).count\n if (pieuvreLinksCount > nodePieuvre.data.maxLinks) {\n alert('La pieuvre ne peut avoir plus de gaînes');\n fp.remove(link);\n return;\n }\n }\n\n // check max symbol on squid\n if (nodePieuvre && nodePieuvre.data.deviceRules) {\n const symbolNode = nodeFrom?.data.type === 'Boite Pieuvre' ? nodeTo : nodeFrom;\n const squidNode = nodeFrom?.data.type === 'Boite Pieuvre' ? nodeFrom : nodeTo;\n const rules = nodePieuvre.data.deviceRules || [];\n let canConnect = true;\n if (squidNode && symbolNode) {\n rules.forEach((rule: any) => {\n const symbols = rule.symbols || [];\n // rule match with symbol\n if (symbols.indexOf(symbolNode.data.symbolName) >= 0) {\n // count symbols of those types\n let total = 0;\n\n let squidLinks = fp.findLinksByExample({ from: squidNode.key })\n squidLinks.each(link => {\n const node = fp.findNodeForKey(link.data.to);\n if (node && symbols.indexOf(node.data.symbolName) >= 0)\n total++;\n })\n\n squidLinks = fp.findLinksByExample({ to: squidNode.key })\n squidLinks.each(link => {\n const node = fp.findNodeForKey(link.data.from);\n if (node && symbols.indexOf(node.data.symbolName) >= 0)\n total++;\n })\n\n if (total > rule.max) {\n canConnect = false;\n if (!canConnect) {\n alert(`La pieuvre peut recevoir maximum ${rule.max} élément(s) de ce type`);\n fp.remove(link);\n return;\n }\n }\n }\n })\n }\n\n\n }\n })\n\n // if a wall is copied, update its geometry\n this.addDiagramListener(\"SelectionCopied\", function (e) {\n const fp: Floorplan = e.diagram as Floorplan;\n fp.selection.iterator.each(function (part) {\n if (part.category === \"WallGroup\") {\n const w: go.Group = part as go.Group;\n fp.updateWall(w);\n } else if (part.category === \"element\") {\n const node: go.Node = part as go.Node;\n fp.incrementProperty(node, \"name\");\n }\n });\n });\n\n // If a node has been dropped onto the Floorplan from a Palette...\n this.addDiagramListener(\"ExternalObjectsDropped\", function (e) {\n const garbage: Array = [];\n const fp: Floorplan = e.diagram as Floorplan;\n fp.selection.iterator.each(function (node) {\n // if floor node dropped, try to make a room node here with that floor brush style\n if (node.category === \"FloorNode\") {\n const floorNode = node;\n const pt: go.Point = fp.lastInput.documentPoint;\n // try to make a room here\n fp.maybeAddRoomNode(pt, floorNode.data.floorImage);\n\n garbage.push(floorNode);\n } else if (node.category === \"ground\") {\n const img = new Image();\n img.addEventListener(\"load\", function () {\n fp.model.setDataProperty(node.data, \"width\", this.naturalWidth);\n fp.model.setDataProperty(node.data, \"height\", this.naturalHeight);\n const firstGroundFound = fp.findNodesByExample({ category: 'ground' }).iterator.first();\n fp.model.setDataProperty(node, \"selectable\", firstGroundFound?.selectable);\n });\n img.src = node.data.source;\n\n } else if (node.category === \"element\") {\n const factor = (fp.model.modelData.elementSize || defaultFolio.modelData.elementSize) //* fp.model.modelData.unitsConversionFactor ;\n const width = node.data.width * (factor);\n const height = node.data.height * (factor);\n fp.model.setDataProperty(node.data, \"width\", width);\n fp.model.setDataProperty(node.data, \"height\", height);\n } else if (node.category === \"text\") {\n\n } else if (node.data.schema) {\n const tableaux = fp.model.nodeDataArray.filter(node => /Tableau Mono/i.test(node.type));\n if (!tableaux.length) {\n alert('Vous devez avoir un tableau électrique pour pouvoir connecter la pieuvre');\n fp.remove(node)\n return;\n }\n\n const mainSymbolNode = node;\n const pt: go.Point = fp.lastInput.documentPoint;\n\n const subSchemas = FeaturesService.squidSubSchemas$.value;\n\n const squidCategory = subSchemas.schemas[node.data.schema]\n const squidElements = squidCategory.nodeDataArray as any[];\n const squidLinks = squidCategory.linkDataArray as any[];\n\n const deltaX = squidElements[0].loc.split(' ')[0] - pt.x\n const deltaY = squidElements[0].loc.split(' ')[1] - pt.y\n let referalBR: go.ObjectData;\n\n // use to find parents from key\n const parents: any = {};\n squidElements.forEach((element, index) => {\n const [posX, posY] = element.loc.split(' ')\n const data = { ...element };\n data.name = (e.diagram as Floorplan).findNextLabel(data.name)\n\n const factor = (fp.model.modelData.elementSize || defaultFolio.modelData.elementSize) //* fp.model.modelData.unitsConversionFactor ;\n // if derivation bloc\n if (!referalBR)\n data.loc = `${posX - deltaX} ${posY - deltaY}`\n // translate loc around derivation box\n else {\n const BRX = Number(referalBR.loc.split(' ')[0]);\n let ElX = posX - deltaX;\n const BRY = Number(referalBR.loc.split(' ')[1]);\n let ElY = posY - deltaY\n\n ElX = (ElX - BRX) * factor + BRX\n ElY = (ElY - BRY) * factor + BRY\n data.loc = `${ElX} ${ElY}`\n }\n\n // resize according to factor\n const width = data.width * (factor);\n const height = data.height * (factor);\n fp.model.setDataProperty(data, \"width\", width);\n fp.model.setDataProperty(data, \"height\", height);\n\n // on ajoute le symbole si ce n'est pas un raccord\n if (data.type !== 'Contact Tableau') {\n // on garde en mémoire l'ancienne key pour les éventuels link parent\n const oldKey = data.key\n // ajout du symbole - note: action mutable sur data\n fp.model.addNodeData(data);\n parents[oldKey] = data.key;\n }\n\n if (index === 0) {\n referalBR = fp.model.nodeDataArray[fp.model.nodeDataArray.length - 1];\n }\n })\n\n // node links\n squidLinks.forEach((link, index) => {\n // const [posX, posY] = element.loc.split(' ')\n if ((!parents[link.from] && !link.fromType) || !parents[link.to])\n return;\n else if (!parents[link.from] && !parents[link.fromType]) {\n let found = fp.findNodesByExample({ type: new RegExp(link.fromType, 'i') }).first();\n if (found)\n link.from = found.data.key;\n else\n return;\n }\n const data = {\n from: parents[link.from] || link.from,\n to: parents[link.to],\n fromPort: \"logical\",\n toPort: \"logical\",\n points: [] as any,\n commande: link.commande || false,\n linkLength: link.linkLength,\n linkType: link.linkType || LinkTypesEnum.circuit_cfort,\n color: link.linkLength && gaineLengths[link.linkLength as GaineLengthsEnum] && gaineLengths[link.linkLength as GaineLengthsEnum]?.color\n };\n\n const BRX = Number(referalBR.loc.split(' ')[0]);\n const BRY = Number(referalBR.loc.split(' ')[1]);\n\n const factor = (fp.model.modelData.elementSize || defaultFolio.modelData.elementSize); //* fp.model.modelData.unitsConversionFactor ;\n const points = [];\n for (let i = 0; i < (link.points || []).length; i = i + 2) {\n const posX = link.points[i];\n let pointX = posX - deltaX;\n const posY = link.points[i + 1];\n let pointY = posY - deltaY;\n\n pointX = (pointX - BRX) * factor + BRX;\n pointY = (pointY - BRY) * factor + BRY;\n\n points.push(new go.Point(pointX, pointY));\n }\n\n data.points = points as any[];\n (fp.model as any).addLinkData(data);\n })\n\n garbage.push(mainSymbolNode);\n }\n\n fp.incrementProperty(node, \"name\");\n });\n for (const i in garbage) {\n fp.remove(garbage[i]);\n }\n });\n\n // When a wall is copied / pasted, update the wall geometry, angle, etc\n this.addDiagramListener(\"ClipboardPasted\", function (e) {\n const fp: Floorplan = e.diagram as Floorplan;\n e.diagram.selection.iterator.each(function (node) {\n if (node.category === \"WallGroup\") {\n const w: go.Group = node as go.Group;\n fp.updateWall(w);\n } else if (node.category === \"element\") {\n fp.incrementProperty(node, \"name\");\n }\n });\n });\n\n // Display different help depending on selection context\n\n this.addDiagramListener(\"ChangedSelection\", function (e) {\n const floorplan: Floorplan = e.diagram as Floorplan;\n floorplan.skipsUndoManager = true;\n floorplan.startTransaction(\"remove dimension links and angle nodes\");\n floorplan.pointNodes.iterator.each(function (node) {\n e.diagram.remove(node);\n });\n floorplan.dimensionLinks.iterator.each(function (link) {\n e.diagram.remove(link);\n });\n\n const missedDimensionLinks: Array = []; // used only in undo situations\n floorplan.links.iterator.each(function (link) {\n if (link.data.category === \"DimensionLink\")\n missedDimensionLinks.push(link);\n });\n for (let i = 0; i < missedDimensionLinks.length; i++) {\n e.diagram.remove(missedDimensionLinks[i]);\n }\n\n floorplan.pointNodes.clear();\n floorplan.dimensionLinks.clear();\n floorplan.angleNodes.iterator.each(function (node) {\n e.diagram.remove(node);\n });\n floorplan.angleNodes.clear();\n\n floorplan.commitTransaction(\"remove dimension links and angle nodes\");\n floorplan.skipsUndoManager = false;\n floorplan.updateWallDimensions();\n floorplan.updateWallAngles();\n });\n\n // if user deletes a wall, update rooms\n this.addDiagramListener(\"SelectionDeleted\", function (e) {\n const wrt: WallReshapingTool = e.diagram.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n wrt.joinAllColinearWalls();\n wrt.splitAllWalls();\n wrt.performAllMitering();\n\n // also update rooms\n const deletedParts: go.Set = e.subject as go.Set;\n // make sure to get all the walls that were just deleted, so updateAllRoomBoundaries knows about what change triggered it\n const walls: go.Set = new go.Set();\n deletedParts.iterator.each(function (p) {\n if (p instanceof go.Group && p.data.category === \"WallGroup\") {\n const w: go.Group = p as go.Group;\n walls.add(w);\n }\n });\n\n const fp: Floorplan = e.diagram as Floorplan;\n fp.updateAllRoomBoundaries(walls);\n });\n\n\n /*\n * Node Templates\n * Add Default Node, Multi-Purpose Node, Window Node, Palette Wall Node, and Door Node to the Node Template Map\n */\n this.nodeTemplateMap.add(\"squid\", makeSquidNode()); // Room Node\n\n this.nodeTemplateMap.add(\"\", makeDefaultNode()); // Default Node (furniture)\n this.nodeTemplateMap.add(\"MultiPurposeNode\", makeMultiPurposeNode()); // Multi-Purpose Node\n this.nodeTemplateMap.add(\"WindowNode\", makeWindowNode()); // Window Node\n this.nodeTemplateMap.add(\"PaletteWallNode\", makePaletteWallNode()); // Palette Wall Node\n this.nodeTemplateMap.add(\"DoorNode\", makeDoorNode()); // Door Node\n this.nodeTemplateMap.add(\"RoomNode\", makeRoomNode()); // Room Node\n\n this.nodeTemplateMap.add(\"element\", makeElementNode()); // Room Node\n this.nodeTemplateMap.add(\"text\", makeTextNode()); // Room Node\n this.nodeTemplateMap.add(\"ground\", makeGroundNode()); // Room Node\n\n\n /*\n * Group Templates\n * Add Default Group, Wall Group to Group Template Map\n */\n\n this.groupTemplateMap.add(\"\", makeDefaultGroup()); // Default Group\n this.groupTemplateMap.add(\"WallGroup\", makeWallGroup()); // Wall Group\n this.groupTemplateMap.add(\"ScaleGroup\", makeScaleGroup()); // Wall Group\n\n\n this.linkTemplate = $(\n go.Link,\n // $(go.Shape),\n {\n // reshapable: true,\n layerName: DiagramLayersEnum[DiagramLayersEnum.Links],\n // resegmentable: true,\n // curve: go.Link.Bezier\n }, // Bezier curve\n { adjusting: go.Link.Stretch },\n new go.Binding('reshapable', 'linkType', (linkType) => linkType === LinkTypesEnum.commande ? false : true),\n new go.Binding('resegmentable', 'linkType', (linkType) => linkType === LinkTypesEnum.commande ? false : true),\n new go.Binding('curve', 'linkType', (linkType) => linkType === LinkTypesEnum.commande ? go.Link.Bezier : null),\n new go.Binding(\"points\", \"points\").makeTwoWay(),\n $(\n go.Shape,\n {},\n new go.Binding(\"stroke\", \"\", function (link) {\n if (link.data.linkType === LinkTypesEnum.commande) {\n return '#567';\n }\n const distance = calculateLinkLength(link)\n const maxDistance = link.data.linkLength && gaineLengths[link.data.linkLength as GaineLengthsEnum] ? gaineLengths[link.data.linkLength as GaineLengthsEnum].length : 0;\n getsetFunctions.setValue(link, { property: 'length' }, distance);\n\n return distance && maxDistance > 0 && (distance - maxDistance >= 0) ? 'red' : link.data.color;\n }).ofObject(),\n new go.Binding(\"strokeDashArray\", \"\", function (link) {\n if (link.data.linkType === LinkTypesEnum.commande) {\n return [4, 4]\n }\n\n const distance = calculateLinkLength(link)\n const maxDistance = link.data.linkLength && gaineLengths[link.data.linkLength as GaineLengthsEnum] ? gaineLengths[link.data.linkLength as GaineLengthsEnum].length : 0;\n\n return distance && maxDistance > 0 && (distance - maxDistance >= 0) ? [8, 8] : \"\";\n }).ofObject()\n ),\n\n $(go.Shape, { toArrow: \"\" })\n );\n\n /*\n * Install Custom Tools\n * Wall Building Tool, Wall Reshaping Tool\n */\n // return;\n const transplantingInc = FeaturesService.getFeatureOption('transplanting', 'disableAutoIncrement');\n const connectorTool = new ConnectorTool(transplantingInc);\n this.toolManager.mouseDownTools.insertAt(0, connectorTool);\n\n const wallBuildingTool = new WallBuildingTool();\n this.toolManager.mouseDownTools.insertAt(0, wallBuildingTool);\n\n const wallReshapingTool = new WallReshapingTool();\n this.toolManager.mouseDownTools.insertAt(3, wallReshapingTool);\n wallBuildingTool.isEnabled = false;\n\n const nodeLabelDraggingTool = new NodeLabelDraggingTool();\n this.toolManager.mouseMoveTools.insertAt(0, nodeLabelDraggingTool);\n\n // MOUSE WHEEL\n this.toolManager.mouseWheelBehavior = go.ToolManager.WheelZoom;\n this.toolManager.doActivate = function () {\n this.mouseWheelBehavior = go.ToolManager.WheelZoom;\n go.ToolManager.prototype.doActivate.call(this); // call base method\n };\n\n /*\n * Tool Overrides\n */\n\n // If a wall was dragged to intersect another wall, update angle displays\n this.toolManager.draggingTool.doDeactivate = function () {\n // go.DraggingTool.prototype.doMouseUp.call(this);\n\n const fp: Floorplan = this.diagram as Floorplan;\n const tool = this;\n\n fp.updateWallAngles();\n this.isGridSnapEnabled = this.diagram.model.modelData.preferences.gridSnap;\n // maybe recalc rooms, if dragging a wall\n let selectedWall: go.Group | null | undefined = null;\n fp.selection.iterator.each(function (p: go.Part) {\n if (p.category === \"WallGroup\" && selectedWall == null) {\n const w: go.Group = p as go.Group;\n selectedWall = w;\n } else if (p.category === \"WallGroup\" && selectedWall !== null) {\n // only worry about selectedWall if there is a single selected wall (cannot drag multiple walls at once)\n selectedWall = undefined;\n }\n });\n if (selectedWall) {\n const selWallSet = new go.Set();\n selWallSet.add(selectedWall);\n\n fp.updateAllRoomBoundaries(selWallSet);\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n wrt.performMiteringOnWall(selectedWall);\n fp.updateWall(selectedWall);\n }\n\n go.DraggingTool.prototype.doDeactivate.call(this);\n };\n\n // If user holds SHIFT while dragging, do not use grid snap\n this.toolManager.draggingTool.doMouseMove = function () {\n if (this.diagram.lastInput.shift) {\n this.isGridSnapEnabled = false;\n } else\n this.isGridSnapEnabled = this.diagram.model.modelData.preferences.gridSnap;\n go.DraggingTool.prototype.doMouseMove.call(this);\n };\n\n // When resizing, constantly update the node info box with updated size info; constantly update Dimension Links\n this.toolManager.resizingTool.doMouseMove = function () {\n const floorplan: Floorplan = this.diagram as Floorplan;\n floorplan.updateWallDimensions();\n go.ResizingTool.prototype.doMouseMove.call(this);\n };\n\n // When resizing a wallPart, do not allow it to be resized past the nearest wallPart / wall endpoints\n this.toolManager.resizingTool.computeMaxSize = function () {\n const tool = this;\n const adornedObject = tool.adornedObject;\n if (adornedObject !== null) {\n const obj = adornedObject.part;\n let wall: go.Group | null = null;\n if (obj !== null) {\n wall = this.diagram.findPartForKey(obj.data.group) as go.Group;\n }\n if (\n wall !== null &&\n obj !== null &&\n (obj.category === \"DoorNode\" || obj.category === \"WindowNode\")\n ) {\n let stationaryPt: go.Point | null = null;\n let movingPt: go.Point | null = null;\n let resizeAdornment: go.Adornment | null = null;\n const oitr = obj.adornments.iterator;\n while (oitr.next()) {\n const adorn: go.Adornment = oitr.value;\n if (adorn.name === \"WallPartResizeAdornment\") {\n resizeAdornment = adorn;\n }\n }\n if (resizeAdornment !== null) {\n const ritr = resizeAdornment.elements.iterator;\n while (ritr.next()) {\n const el: go.GraphObject = ritr.value;\n const handle: go.GraphObject | null = tool.handle;\n if (handle !== null) {\n if (\n el instanceof go.Shape &&\n el.alignment === handle.alignment\n ) {\n movingPt = el.getDocumentPoint(go.Spot.Center);\n }\n if (\n el instanceof go.Shape &&\n el.alignment !== handle.alignment\n ) {\n stationaryPt = el.getDocumentPoint(go.Spot.Center);\n }\n }\n }\n }\n // find the constrainingPt; that is, the endpoint (wallPart endpoint or wall endpoint)\n // that is the one closest to movingPt but still farther from stationaryPt than movingPt\n // this loop checks all other wallPart endpoints of the wall that the resizing wallPart is a part of\n let constrainingPt;\n let closestDist = Number.MAX_VALUE;\n wall.memberParts.iterator.each(function (part: go.Part) {\n if (part.data.key !== obj.data.key) {\n const endpoints = getWallPartEndpoints(part);\n for (let i = 0; i < endpoints.length; i++) {\n const point = endpoints[i];\n const distanceToMovingPt = Math.sqrt(\n point.distanceSquaredPoint(movingPt)\n );\n if (distanceToMovingPt < closestDist) {\n const distanceToStationaryPt = Math.sqrt(\n point.distanceSquaredPoint(stationaryPt)\n );\n if (distanceToStationaryPt > distanceToMovingPt) {\n closestDist = distanceToMovingPt;\n constrainingPt = point;\n }\n }\n }\n }\n });\n // if we're not constrained by a wallPart endpoint, the constraint will come from a wall endpoint; figure out which one\n if (constrainingPt === undefined || constrainingPt === null) {\n if (\n wall.data.startpoint.distanceSquaredPoint(movingPt) >\n wall.data.startpoint.distanceSquaredPoint(stationaryPt)\n )\n constrainingPt = wall.data.endpoint;\n else constrainingPt = wall.data.startpoint;\n }\n // set the new max size of the wallPart according to the constrainingPt\n let maxLength = 0;\n if (stationaryPt !== null) {\n maxLength = Math.sqrt(\n stationaryPt.distanceSquaredPoint(constrainingPt)\n );\n }\n return new go.Size(maxLength, wall.data.thickness);\n }\n }\n return go.ResizingTool.prototype.computeMaxSize.call(tool);\n };\n\n this.toolManager.draggingTool.isGridSnapEnabled = true;\n\n // this.toolManager.clickSelectingTool.canStart = function () {\n // let activate = true;\n // const selection = this.diagram.selection\n // selection.iterator.each((p: go.Part) => {\n // if (p.category === \"ground\") {\n // activate = false\n // }\n // });\n\n // return activate;\n // }\n } // end Floorplan constructor\n\n\n // Get / set array of all Palettes associated with this Floorplans\n get palettes(): Array {\n return this._palettes;\n }\n set palettes(value: Array) {\n this._palettes = value;\n }\n\n // Get / set pointNodes\n get pointNodes(): go.Set {\n return this._pointNodes;\n }\n set pointNodes(value: go.Set) {\n this._pointNodes = value;\n }\n\n // Get / set dimensionLinks\n get dimensionLinks(): go.Set {\n return this._dimensionLinks;\n }\n set dimensionLinks(value: go.Set) {\n this._dimensionLinks = value;\n }\n\n // Get / set angleNodes\n get angleNodes(): go.Set {\n return this._angleNodes;\n }\n set angleNodes(value: go.Set) {\n this._angleNodes = value;\n }\n\n public incrementProperty(obj: go.Part, propName: string) {\n const elecLib = FeaturesService.symbolLib$.value;\n const lib = elecLib;\n if (!lib)\n return;\n const elementFound = lib.categories\n .flatMap((c: any) => c.symbols)\n .find((e: any) => e.symbolName === obj.data.symbolName);\n if (elementFound && elementFound[propName] && obj.data[propName]) {\n const nextLabel = this.findNextLabel(elementFound[propName], 'name')\n\n obj.diagram?.startTransaction(\"set property\");\n obj.diagram?.model.setDataProperty(obj.data, \"name\", nextLabel);\n obj.diagram?.commitTransaction(\"set property\");\n // return nextLabel;\n }\n }\n\n public findNextLabel(name: string, prop: string = 'name') {\n if (/\\+$/.test(name)) {\n const radis = name.match(/(.+)\\+$/)?.[1];\n const others = this.findNodesByExample({\n [prop]: new RegExp(`${radis}\\[A-Z]+$`, \"\"),\n });\n\n let max = 'A';\n others?.iterator.each((node) => {\n const counter = node.data.name.match(\n new RegExp(`${radis}([A-Z]+)$`, \"\")\n )[1];\n max = max > counter ? max : counter;\n });\n\n if (others.count === 0)\n return name.replace(/\\+$/, 'A');\n return name.replace(/\\+$/, base26Add(max, 1).toString());\n }\n else if (/\\*$/.test(name)) {\n const radis = name.match(/(.+)\\*$/)?.[1];\n const others = this.findNodesByExample({\n [prop]: new RegExp(`${radis}\\\\d+$`, \"i\"),\n });\n\n let max = 0;\n others?.iterator.each((node) => {\n const counter = node.data.name.match(\n new RegExp(`${radis}(\\\\d+)$`, \"i\")\n )[1];\n max = Math.max(max, counter);\n });\n return name.replace(/\\*$/, (max + 1).toString());\n }\n return name;\n }\n\n\n public FreezeGrounds(freeze: boolean) {\n const grounds = this.findNodesByExample({ category: 'ground' })\n grounds.iterator.each(function (ground: go.Node) {\n ground.diagram?.model.setDataProperty(ground, 'selectable', !freeze);\n })\n }\n\n /**\n * Turn on wall building tool, set WallBuildingTool.isBuildingDivider to false\n */\n public enableWallBuilding(wallThickness = WallThicknessEnum.wall, isScale = false): void {\n const fp: Floorplan = this;\n const wallBuildingTool: WallBuildingTool = fp.toolManager.mouseDownTools.elt(\n 0\n ) as WallBuildingTool;\n wallBuildingTool.wallThickness = wallThickness;\n wallBuildingTool.isBuildingDivider = false;\n wallBuildingTool.isScale = isScale;\n const wallReshapingTool: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n wallBuildingTool.isEnabled = true;\n wallReshapingTool.isEnabled = false;\n fp.currentCursor = \"crosshair\";\n\n // clear resize adornments on walls/windows, if there are any\n fp.nodes.iterator.each(function (n) {\n n.clearAdornments();\n });\n fp.clearSelection();\n }\n\n /**\n * Turn on wall building tool, set WallBuildingTool.isBuildingDivider to true\n */\n public enableDividerBuilding(): void {\n const fp: Floorplan = this;\n const wallBuildingTool: WallBuildingTool = fp.toolManager.mouseDownTools.elt(\n 0\n ) as WallBuildingTool;\n fp.enableWallBuilding();\n wallBuildingTool.isBuildingDivider = true;\n fp.currentCursor = \"crosshair\";\n }\n\n /**\n * Turn off wall building tool\n */\n public disableWallBuilding(): void {\n const fp: Floorplan = this;\n const wallBuildingTool: WallBuildingTool = fp.toolManager.mouseDownTools.elt(\n 0\n ) as WallBuildingTool;\n const wallReshapingTool: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n wallBuildingTool.isEnabled = false;\n wallReshapingTool.isEnabled = true;\n wallBuildingTool.isBuildingDivider = false;\n fp.currentCursor = \"\";\n\n // clear resize adornments on walls/windows, if there are any\n fp.nodes.iterator.each(function (n) {\n n.clearAdornments();\n });\n fp.clearSelection();\n }\n\n /**\n * Change the units being used by the Floorplan\n * @param {HTMLFormElement} form The form element containing the units radio buttons in the options menu\n */\n public changeUnits(unitsStr: DiagramUnitsAbbreviations): void {\n const fp: Floorplan = this;\n const prevUnits: DiagramUnitsAbbreviations = fp.model.modelData.units;\n fp.startTransaction(\"change units\");\n fp.model.setDataProperty(fp.model.modelData, \"units\", unitsStr);\n fp.model.setDataProperty(\n fp.model.modelData,\n \"unitsAbbreviation\",\n (DiagramUnitsAbbreviations as any)[unitsStr]\n );\n\n // explicitly set the units conversion factor by converting the old one to the new units equivalent\n const oldUnitsConversionFactor = fp.model.modelData.unitsConversionFactor;\n const newUnitsConverstionFactor = convertUnits(\n prevUnits,\n unitsStr,\n oldUnitsConversionFactor\n );\n fp.model.setDataProperty(\n fp.model.modelData,\n \"unitsConversionFactor\",\n newUnitsConverstionFactor\n );\n fp.commitTransaction(\"change units\");\n }\n\n public changeUnitsConversion(\n unitsConversionFactor: string,\n gridSize?: string,\n convert = true\n ): void {\n const floorplan: Floorplan = this;\n const val = parseFloat(unitsConversionFactor);\n if (isNaN(val) || !val || val === undefined) return;\n floorplan.skipsUndoManager = true;\n floorplan.model.set(\n floorplan.model.modelData,\n \"unitsConversionFactor\",\n val\n );\n\n if (gridSize) {\n floorplan.changeGridSize(gridSize, convert);\n }\n\n floorplan.skipsUndoManager = false;\n }\n\n public changeGridSize(gridSize: string, convert = true): void {\n const fp: Floorplan = this;\n fp.skipsUndoManager = true;\n fp.startTransaction(\"change grid size\");\n let inputVal = 0;\n if (\n !isNaN(parseFloat(gridSize)) &&\n gridSize != null &&\n gridSize !== \"\" &&\n gridSize !== undefined &&\n parseFloat(gridSize) > 0\n )\n inputVal = parseFloat(gridSize);\n else {\n gridSize = convertPixelsToUnits(10, fp.model.modelData.unitsConversionFactor).toString(); // if bad input given, revert to 20cm (10px) or unit equivalent\n inputVal = parseFloat(gridSize);\n convert = true;\n }\n if (convert) inputVal = convertUnitsToPixels(inputVal, fp.model.modelData.unitsConversionFactor);\n fp.grid.gridCellSize = new go.Size(inputVal, inputVal);\n // fp.toolManager.draggingTool.gridCellSize = new go.Size(inputVal, inputVal);\n fp.model.setDataProperty(fp.model.modelData, \"gridSize\", inputVal);\n fp.commitTransaction(\"change grid size\");\n fp.skipsUndoManager = false;\n }\n\n /**\n * Get the side of a wall (1 or 2) to use as the room boundary\n * @param {go.Group} w\n * @param {go.Point} ip\n * @return {number}\n */\n private getCounterClockwiseWallSide(w: go.Group, ip: go.Point): number {\n const fp: Floorplan = this;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n // these are the mitering point data properties of the wall opposite from the intersection point\n let prop1: string | null = null;\n let prop2: string | null = null;\n\n // If intersection point (ip) is wall (w)'s data.endpoint, prop1 = smpt1, prop2 = smpt2\n if (wrt.pointsApproximatelyEqual(w.data.endpoint, ip)) {\n prop1 = \"smpt1\";\n prop2 = \"smpt2\";\n } else {\n prop1 = \"empt1\";\n prop2 = \"empt2\";\n }\n\n const A: go.Point = ip;\n const B: go.Point = w.data[prop2];\n const C: go.Point = w.data[prop1];\n\n // A = intersection point, B = w.data[prop1], C = w.data.[prop2]\n // if AC is counterclockwise of AB, return 2; else return 1\n function isClockwise(a: go.Point, b: go.Point, c: go.Point) {\n const bool = (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x) > 0;\n return bool;\n }\n\n if (!isClockwise(A, B, C)) {\n return 1;\n } else return 2;\n }\n\n /**\n * Returns the intersection point between the two lines.\n * Lines are implied by two endpoints each.\n * @param {go.Point} a1 Point Endpoint 1 of line A\n * @param {go.Point} a2 Point Endpoint 2 of line A\n * @param {go.Point} b1 Point Endpoint 1 of line B\n * @param {go.Point} b2 Point Endpoint 2 of line B\n * @return {go.Point | null}\n */\n public getLinesIntersection(\n a1: go.Point,\n a2: go.Point,\n b1: go.Point,\n b2: go.Point\n ): go.Point | null {\n const am = (a1.y - a2.y) / (a1.x - a2.x); // slope of line 1\n const bm = (b1.y - b2.y) / (b1.x - b2.x); // slope of line 2\n\n // Line A is vertical\n if (am === Infinity || am === -Infinity) {\n const ipx = a1.x;\n // line B y-intercept\n const bi = -1 * (bm * b1.x - b1.y);\n // Solve for line B's y at x=ipx\n const ipy = bm * ipx + bi;\n return new go.Point(ipx, ipy);\n }\n // Line B is vertical\n if (bm === Infinity || bm === -Infinity) {\n const ipx = b1.x;\n // line A y-intercept\n const ai = -1 * (am * a1.x - a1.y);\n // Solve for line A's y at x=ipx\n const ipy = am * ipx + ai;\n return new go.Point(ipx, ipy);\n }\n\n if (Math.abs(am - bm) < Math.pow(2, -52)) {\n return null;\n } else {\n const ipx = (am * a1.x - bm * b1.x + b1.y - a1.y) / (am - bm);\n const ipy = (am * bm * (b1.x - a1.x) + bm * a1.y - am * b1.y) / (bm - am);\n const ip: go.Point = new go.Point(ipx, ipy);\n return ip;\n }\n }\n\n /**\n * Update the geometries of all rooms in the floorplan. This is called when a wall is added or reshaped or deleted\n * @param {go.Set} changedWalls This is the set of walls that was just added / updated / removed. Often this is a single element\n */\n public updateAllRoomBoundaries(changedWalls: go.Set): void {\n const fp: Floorplan = this;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n const rooms: go.Iterator = fp.findNodesByExample({\n category: \"RoomNode\",\n });\n // rooms to remove\n const garbage: Array = [];\n\n rooms.iterator.each(function (r: go.Node) {\n // do this until you've tried all wall intersections for the room OR the room boundaries have been successfully updated\n let boundsFound = false;\n let triedAllIntersections = false;\n const seenW1: go.Set = new go.Set(); // the walls that have been used as w1 (later)\n\n while (!boundsFound && !triedAllIntersections) {\n // find a point \"pt\" that will definitely be in the room implied by the r.boundaryWalls (if the area is still enclosed)\n // to do so, find 2 boundaryWalls that are connected and get a point just outside their intersection (along the proper mitering side)\n // Note: Neither of these 2 walls may be in \"changedWalls\" (the walls that were added / modified)\n // The first of these walls must still be valid (i.e. it was not split or joined with another wall in the action that trieggered this function)\n const bw: Array = r.data.boundaryWalls;\n let e1 = null;\n let e2 = null; // entries that represent wall / mitering side pairs to use to find pt\n for (let i = 0; i < bw.length + 1; i++) {\n const entry = bw[i % bw.length];\n const wk: string = entry[0];\n const ww: go.Group = fp.findNodeForKey(wk) as go.Group;\n if (ww === null) continue;\n if (!changedWalls.contains(ww) && !seenW1.contains(ww)) {\n if (e1 === null) {\n e1 = entry;\n } else if (e1 !== null && e2 === null) {\n e2 = entry;\n }\n } else if (e1 !== null && e2 === null) {\n e2 = entry;\n } else if (e1 === null) {\n e1 = null;\n e2 = null;\n }\n }\n\n // with these 2 entries (walls / mitering sides), we now get a point that would definitely be in the room (if the area is still enclosed)\n // first, get the segments implied by mitering sides of the walls\n let w1: go.Group | null = null;\n let w2: go.Group | null = null;\n let s1: number | null = null;\n let s2: number | null = null;\n if (e1 !== null && e2 !== null) {\n w1 = fp.findNodeForKey(e1[0]) as go.Group;\n s1 = e1[1];\n w2 = fp.findNodeForKey(e2[0]) as go.Group;\n s2 = e2[1];\n } else {\n triedAllIntersections = true;\n continue;\n }\n\n if (e1 !== null && w1 !== null) {\n seenW1.add(w1);\n }\n\n const w1s: go.Point = w1.data[\"smpt\" + s1];\n const w1e: go.Point = w1.data[\"empt\" + s1];\n const w2s: go.Point = w2.data[\"smpt\" + s2];\n const w2e: go.Point = w2.data[\"empt\" + s2];\n // at which point do these 2 wall sides intersect?\n const ip: go.Point | null = fp.getSegmentsIntersection(\n w1s,\n w1e,\n w2s,\n w2e\n );\n if (ip === null) {\n continue;\n }\n\n // the prop name of the point on the other mitering side of ip. we'll use this to get the angle of the intersection\n const w1os = s1 === 1 ? 2 : 1;\n // let prop: string = wrt.pointsApproximatelyEqual(ip, w1s) ? \"smpt\" + w1os : \"empt\" + w1os;\n const distToS = ip.distanceSquaredPoint(w1.data[\"smpt\" + w1os]);\n const distToE = ip.distanceSquaredPoint(w1.data[\"empt\" + w1os]);\n // which other side pt is closer to ip? That's the oip\n const oip: go.Point =\n distToS <= distToE ? w1.data.startpoint : w1.data.endpoint;\n\n const ang = oip.directionPoint(ip);\n const newPt: go.Point = wrt.translateAndRotatePoint(ip, ang - 90, 0.5);\n\n // debug -- show calculated pts\n /*\n const $ = go.GraphObject.make;\n fp.add(\n $(go.Node, 'Spot', { locationSpot: go.Spot.Center, location: oip },\n $(go.Shape, 'Circle', { desiredSize: new go.Size(5, 5), fill: 'red' })\n )\n );\n\n fp.add(\n $(go.Node, 'Spot', { locationSpot: go.Spot.Center, location: ip },\n $(go.Shape, 'Circle', { desiredSize: new go.Size(5, 5), fill: 'green' })\n )\n );\n\n fp.add(\n $(go.Node, 'Spot', { locationSpot: go.Spot.Center, location: newPt },\n $(go.Shape, 'Circle', { desiredSize: new go.Size(5, 5), fill: 'cyan' })\n )\n );*/\n\n boundsFound = fp.maybeAddRoomNode(newPt, r.data.floorImage, r);\n }\n\n // if the room boundaries are never found, this room must be removed\n if (!boundsFound) {\n garbage.push(r);\n }\n });\n\n for (let i = 0; i < garbage.length; i++) {\n fp.remove(garbage[i]);\n }\n\n // ensure proper room position by updating target bindings\n fp.updateAllTargetBindings();\n }\n\n /**\n * Tries to add a Room Node from a given point.\n * The point must be enclosed by walls.\n * @param {go.Point} pt\n * @param {string} floorImage The image relative path to use as the Pattern brush for the room's flooring\n * @param {go.Node} roomToUpdate Optional. If this is provided, the walls found for the area will be assigned to this room node\n * @return {boolean} Whether or not the pt is enclosed by room boundaries\n */\n public maybeAddRoomNode(\n pt: go.Point,\n floorImage: string,\n roomToUpdate?: go.Node | null\n ): boolean {\n if (roomToUpdate === undefined || roomToUpdate === null) {\n roomToUpdate = null;\n }\n\n const fp: Floorplan = this;\n // if the pt is on a Room or Wall, do nothing\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n let isPtOnRoomOrWall = false;\n // make sure \"pt\" is not inside a wall or room node. If it is, do not run this function\n walls.iterator.each(function (w: go.Group) {\n if (fp.isPointInWall(w, pt)) {\n isPtOnRoomOrWall = true;\n }\n });\n const rooms: go.Iterator = fp.findNodesByExample({\n category: \"RoomNode\",\n }) as go.Iterator;\n rooms.iterator.each(function (r: go.Node) {\n if (\n roomToUpdate === null ||\n (roomToUpdate !== null &&\n roomToUpdate !== undefined &&\n roomToUpdate.data.key !== r.data.key)\n ) {\n const isInRoom = fp.isPointInRoom(r, pt);\n if (isInRoom) {\n // Edge: it's possible we're within the polygon created by the rooms boundary walls, but over one of its holes\n // if so, we may still be able to make new room here\n let isPtInHole = false;\n for (let i = 0; i < r.data.holes.length; i++) {\n const hole: Array = r.data.holes[i];\n const polygon: go.List | null = fp.makePolygonFromRoomBoundaries(\n hole\n );\n if (polygon !== null) {\n if (fp.isPointInPolygon(polygon.toArray(), pt)) {\n isPtInHole = true;\n }\n }\n }\n\n if (!isPtInHole) {\n isPtOnRoomOrWall = true;\n }\n }\n }\n });\n if (isPtOnRoomOrWall) {\n return false;\n }\n\n // get thr boundary walls for the room\n const boundaryWalls = fp.getRoomWalls(pt);\n if (boundaryWalls === null) {\n return false;\n }\n\n // also include holes in room\n const holes: Array> = fp.findRoomHoles(boundaryWalls, pt);\n\n // check if this is an update or add op\n if (roomToUpdate !== null) {\n fp.startTransaction(\"update room boundaryWalls and holes\");\n fp.model.setDataProperty(\n roomToUpdate.data,\n \"boundaryWalls\",\n boundaryWalls\n );\n fp.model.setDataProperty(roomToUpdate.data, \"holes\", holes);\n fp.commitTransaction(\"update room boundaryWalls and holes\");\n } else {\n // if (floorImage === null || floorImage === undefined) {\n // floorImage = \"images/textures/floor1.jpg\";\n // }\n const rooms = fp.findNodesByExample({ category: \"RoomNode\" });\n const fill = roomColors[rooms.count % roomColors.length] + '44';\n const roomData = {\n key: \"Room\",\n category: \"RoomNode\",\n name: \"Nom de la pièce\",\n boundaryWalls,\n holes,\n fill,\n showLabel: true,\n showFlooringOptions: true,\n };\n fp.model.addNodeData(roomData);\n roomToUpdate = fp.findPartForData(roomData) as go.Node;\n }\n fp.updateRoom(roomToUpdate);\n return true;\n }\n\n /**\n * Returns a specially formatted array that represents the boundaries of a room.\n * These boundaries are the walls enclosing the room, which must include the given point\n * The array is formatted with entries [wall, mitering side]\n * @param {go.Point} pt\n * @return {Array}\n */\n public getRoomWalls(pt: go.Point): Array | null {\n const fp: Floorplan = this;\n // get the all the walls, in order from closest to farthest, the line from pt upwards would hit\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n const oPt: go.Point = new go.Point(pt.x, pt.y - 10000);\n const wallsDistArr: Array = []; // array of wall/dist pairs [[wallA, 15], [wallB, 30]] -- this makes sorting easier than if we were using a Map\n walls.iterator.each(function (w) {\n const ip: go.Point | null = fp.getSegmentsIntersection(\n pt,\n oPt,\n w.data.startpoint,\n w.data.endpoint\n );\n if (ip !== null) {\n const dist = Math.sqrt(ip.distanceSquaredPoint(pt));\n wallsDistArr.push([w, dist]);\n }\n });\n\n // sort all walls the line from pt to oPt intersects, in order of proximity to pt\n wallsDistArr.sort(function (a, b) {\n const distA = a[1];\n const distB = b[1];\n if (distA === distB) return 0;\n else if (distA < distB) return -1;\n else return 1;\n });\n\n // helper function -- copies a \"path\" (list of walls) up to a certain wall node\n function selectivelyCopyPath(path: Array, nodeToStopAt: go.Node) {\n const p = [];\n let copyNoMore = false;\n for (let i = 0; i < path.length; i++) {\n const entry = path[i];\n const wk: string = entry[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n const side = entry[1];\n if (!copyNoMore) {\n p.push([w.data.key, side]);\n if (w.data.key === nodeToStopAt.data.key) {\n copyNoMore = true;\n }\n }\n }\n\n return p;\n }\n\n /**\n * Recursively walk counter-clockwise along all walls connected to firstWall until you get back to first wall\n * @param {go.Group | null} wall\n * @param {Array} path\n * @param {go.Set>} possiblePaths\n * @param {go.Set | null} seenWalls\n * @param {go.Group} origWall\n * @param {go.Point | null} prevPt\n * @return {go.Set>}\n */\n function recursivelyFindPaths(\n wall: go.Group,\n path: Array | null,\n possiblePaths: go.Set>,\n seenWalls: go.Set | null,\n origWall: go.Group,\n prevPt: go.Point | null\n ): go.Set> | null {\n if (wall === null) {\n return null;\n }\n\n if (seenWalls === undefined || seenWalls === null) {\n seenWalls = new go.Set();\n }\n seenWalls.add(wall);\n\n // find which wall endpoint has angle between 180 and 270 from the right\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n const sPt: go.Point = wall.data.startpoint;\n const ePt: go.Point = wall.data.endpoint;\n const mpt: go.Point = new go.Point(\n (sPt.x + ePt.x) / 2,\n (sPt.y + ePt.y) / 2\n );\n const sa = mpt.directionPoint(sPt); // angle from mpt to spt\n let ip: go.Point; // intersection point\n let op: go.Point; // other point\n if (prevPt === undefined || prevPt === null) {\n ip = sa >= 90 && sa <= 270 ? sPt : ePt; // cc point\n op = sa >= 90 && sa <= 270 ? ePt : sPt;\n } else {\n ip = wrt.pointsApproximatelyEqual(sPt, prevPt) ? ePt : sPt;\n op = wrt.pointsApproximatelyEqual(sPt, prevPt) ? sPt : ePt;\n }\n\n // get all walls at ip\n const ccWalls: go.List = wrt.getAllWallsAtIntersection(\n ip,\n true\n );\n\n // sort these walls based on their clockwise angle, relative to wall\n // sort all involved walls in any clockwise order\n ccWalls.sort(function (a: go.Group, b: go.Group) {\n // fp.sortWallsClockwise(a,b);\n const B: go.Point | null = fp.getWallsIntersection(a, b);\n if (B === null) return 0;\n const as: go.Point = a.data.startpoint;\n const ae: go.Point = a.data.endpoint;\n const bs: go.Point = b.data.startpoint;\n const be: go.Point = b.data.endpoint;\n const A: go.Point = wrt.pointsApproximatelyEqual(ip, as) ? ae : as;\n const C: go.Point = wrt.pointsApproximatelyEqual(ip, bs) ? be : bs;\n\n const angA = B.directionPoint(A);\n const angB = B.directionPoint(C);\n if (angA > angB) return 1;\n else if (angA < angB) return -1;\n else return 0;\n });\n\n // offset the intersection walls (maintain relative order) s.t. wall \"wall\" is first\n const intersectionWalls: Array = ccWalls.toArray();\n const intersectionWallsReordered: Array = [];\n\n let j = intersectionWalls.indexOf(wall);\n for (let i = 0; i < intersectionWalls.length; i++) {\n const w: go.Group = intersectionWalls[j];\n intersectionWallsReordered.push(w);\n j = (j + 1) % intersectionWalls.length;\n }\n\n ccWalls.clear();\n for (let i = 0; i < intersectionWallsReordered.length; i++) {\n const w: go.Group = intersectionWallsReordered[i];\n ccWalls.add(w);\n }\n\n ccWalls.iterator.each(function (w: go.Group) {\n // failsafe\n if (w === undefined || w === null) {\n possiblePaths = new go.Set();\n return possiblePaths;\n }\n\n // Base case : if we've found our way back to originalWall (add path to possiblePaths)\n if (\n (w.data.key === origWall.data.key || ccWalls.contains(origWall)) &&\n wall.data.key !== origWall.data.key\n ) {\n if (path !== null) {\n possiblePaths.add(path);\n }\n } else if (seenWalls !== null && !seenWalls.contains(w)) {\n // define path as all walls that came up until this wall\n if (path === undefined || path === null) {\n path = [];\n // First wall is special case; just find out which mitering side is closer to the original point used for this room construction\n // get intersection point from pt-oPt each of walls's mitering sides\n\n // It's possible pt-oPt does not intersect one or both of the actual segments making up the mitering sides of wall,\n // so use the lines implied by the mitering points, not just finite segments\n const ip1: go.Point | null = fp.getLinesIntersection(\n pt,\n oPt,\n wall.data.smpt1,\n wall.data.empt1\n );\n const ip2: go.Point | null = fp.getLinesIntersection(\n pt,\n oPt,\n wall.data.smpt2,\n wall.data.empt2\n );\n\n if (ip1 !== null && ip2 !== null) {\n // whichever mitering side pt-oPt strikes first (which intersection point is closer to pt) is the one to start with\n const dist1 = Math.sqrt(ip1.distanceSquaredPoint(pt));\n const dist2 = Math.sqrt(ip2.distanceSquaredPoint(pt));\n const side1 = dist1 < dist2 ? 1 : 2;\n path.push([wall.data.key, side1]);\n }\n } else {\n path = selectivelyCopyPath(path, wall);\n }\n\n // get the \"side\" of the wall to use for the room boundary (side 1 or side 2, as defined by the mitering points in data)\n const side = fp.getCounterClockwiseWallSide(w, ip);\n\n // add w to path\n path.push([w.data.key, side]);\n recursivelyFindPaths(w, path, possiblePaths, seenWalls, origWall, ip);\n }\n return undefined\n });\n\n return possiblePaths;\n } // end recursivelyFindPaths\n\n // iterate over these ordered walls until one allows for us to identify the room boundaries\n // if none of these walls allow for that, \"pt\" is not enclosed by walls, so there is no room\n let roomOuterBoundaryPts = null;\n let roomOuterBoundaryPath = null; // an array with entries [[wall, side], [wall, side]...]\n for (let i = 0; i < wallsDistArr.length; i++) {\n const entry = wallsDistArr[i];\n const w: go.Group = entry[0];\n\n // I'm pretty sure the first possbilePath is always the right one\n // This is an ordered path of all the walls that make up this room. It's Map, where keys are walls and values are the wall sides used for room boundaries (1 or 2)\n let path = [];\n let possiblePaths: go.Set | null = new go.Set();\n possiblePaths = recursivelyFindPaths(\n w,\n null,\n possiblePaths,\n null,\n w,\n null\n );\n if (possiblePaths === null || possiblePaths.count === 0) continue; // no path\n path = possiblePaths.first();\n\n // construct a polygon (Points) from this path\n const polygon: go.List | null = fp.makePolygonFromRoomBoundaries(\n path\n );\n\n if (polygon !== null) {\n // make sure none of the walls in \"path\" have an endpoint inside the resulting polygon (this means an internal wall is included, those are dealt with later)\n let pathIncludesInternalWall = false;\n for (let j = 0; j < path.length; j++) {\n const e = path[j];\n const wwk: string = e[0];\n const ww: go.Group = fp.findNodeForKey(wwk) as go.Group;\n const ept: go.Point = ww.data.endpoint;\n const spt: go.Point = ww.data.startpoint;\n if (\n fp.isPointInPolygon(polygon.toArray(), ept) ||\n fp.isPointInPolygon(polygon.toArray(), spt)\n ) {\n pathIncludesInternalWall = true;\n }\n }\n\n // make sure \"pt\" is enclosed by the polygon -- if so, these are the outer room bounds\n if (\n fp.isPointInPolygon(\n polygon.toArray(),\n pt\n ) /*&& !pathIncludesInternalWall*/\n ) {\n roomOuterBoundaryPts = polygon;\n roomOuterBoundaryPath = path;\n break;\n }\n }\n }\n\n // if we've found outer room boundary pts, we now need to account for some edge cases\n // 1) Be sure to include \"internal\" walls in room boundaries (walls inside the room that connect to an outer boundary wall)\n // 2) \"Holes\" -- walls / rooms inside these outer boundaries that do not connect to an outer boundary wall\n if (roomOuterBoundaryPts !== null) {\n // check if there are any walls with an endpoint in the room's outer boundaries polygon.\n // If so, update room's boundaryWalls data and geometry to add those internal wall(s)\n const newRoomBoundaryWalls: Array = fp.addInternalWallsToRoom(\n roomOuterBoundaryPts,\n roomOuterBoundaryPath\n );\n // let newRoomBoundaryWalls = roomOuterBoundaryPath;\n\n return newRoomBoundaryWalls;\n } else {\n return null;\n }\n }\n\n /**\n * Returns an ordered List of Points that represents the polygon of a room, given a room's boundaryWalls array\n * @param {Array} path -- a specially formatted array, where entries are 2 entry arrays [wall, mitering side]\n * This type of structure is used for a room's \"boundaryWalls\" data property\n * @return {go.List | null}\n */\n public makePolygonFromRoomBoundaries(\n path: Array\n ): go.List | null {\n const fp: Floorplan = this;\n const polygon: go.List = new go.List();\n\n const boundaryWalls: Array = path;\n if (boundaryWalls === null || boundaryWalls.length < 2) {\n return null;\n }\n const firstWallKey: string = boundaryWalls[0][0];\n const firstWall: go.Group = fp.findNodeForKey(firstWallKey) as go.Group;\n const firstSide = boundaryWalls[0][1];\n\n const secondWallKey: string = boundaryWalls[1][0];\n const secondWall: go.Group = fp.findNodeForKey(secondWallKey) as go.Group;\n\n if (firstWall === null || secondWall === null) {\n return null;\n }\n\n // find where first and second wall meet\n // if that's near firstWall's smpt[side] pt, start with empt[side] pt; else, vice versa (i.e. pick the farthest pt)\n const ip: go.Point | null = fp.getWallsIntersection(firstWall, secondWall);\n if (ip === null) return null;\n const propS: string = \"smpt\" + firstSide;\n const propE: string = \"empt\" + firstSide;\n const ptS: go.Point = firstWall.data[propS];\n const ptE: go.Point = firstWall.data[propE];\n\n const distS = Math.sqrt(ip.distanceSquaredPoint(ptS));\n const distE = Math.sqrt(ip.distanceSquaredPoint(ptE));\n const closestPt: go.Point = distS < distE ? ptS : ptE;\n const farthestPt: go.Point = closestPt.equals(ptS) ? ptE : ptS;\n\n polygon.add(farthestPt);\n polygon.add(closestPt);\n\n let prevPt: go.Point = closestPt;\n let prevWall: go.Group = firstWall;\n for (let i = 0; i < boundaryWalls.length; i++) {\n const entry = boundaryWalls[i];\n if (typeof entry === \"string\") continue;\n const wk: string = entry[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n if (w === null) {\n return null;\n }\n const s = entry[1];\n if (w.data.key !== firstWall.data.key) {\n const propS1: string = \"smpt\" + s;\n const propE1: string = \"empt\" + s;\n const ptS1: go.Point = w.data[propS1];\n const ptE1: go.Point = w.data[propE1];\n const distS1 = Math.sqrt(prevPt.distanceSquaredPoint(ptS1));\n const distE1 = Math.sqrt(prevPt.distanceSquaredPoint(ptE1));\n\n const closestPt1: go.Point = distS1 < distE1 ? ptS1 : ptE1;\n const farthestPt1: go.Point = closestPt1.equals(ptS1) ? ptE1 : ptS1;\n\n polygon.add(closestPt1);\n polygon.add(farthestPt1);\n prevPt = farthestPt1;\n prevWall = w;\n }\n }\n\n return polygon;\n }\n\n /**\n * Used to a/b sort walls in a clockwise order\n * @param {go.Group} a wall a\n * @param {go.Group} b wall b\n * @return {number}\n */\n public sortWallsClockwise(a: go.Group, b: go.Group): number {\n const fp: Floorplan = this;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n const B: go.Point | null = fp.getWallsIntersection(a, b);\n if (B === null) {\n return 0;\n }\n const as: go.Point = a.data.startpoint;\n const ae: go.Point = a.data.endpoint;\n const bs: go.Point = b.data.startpoint;\n const be: go.Point = b.data.endpoint;\n const ip: go.Point | null = fp.getSegmentsIntersection(as, ae, bs, be);\n if (ip === null) {\n return 0;\n }\n const A: go.Point = wrt.pointsApproximatelyEqual(ip, as) ? ae : as;\n const C: go.Point = wrt.pointsApproximatelyEqual(ip, bs) ? be : bs;\n\n const angA = B.directionPoint(A);\n const angB = B.directionPoint(C);\n if (angA > angB) return 1;\n else if (angA < angB) return -1;\n else return 0;\n }\n\n /**\n * Sort a list of walls in clockwise order, relative to a given wall (that given wall will be the first element of the returned list)\n * @param {go.List} walls The list to sort\n * @param {go.Group} wall The reference wall\n * @return {go.List}\n */\n public sortWallsClockwiseWithSetStartWall(\n walls: go.List,\n wall: go.Group\n ): go.List {\n const fp: Floorplan = this;\n walls.sort(function (a, b) {\n return fp.sortWallsClockwise(a, b);\n });\n\n // offset the intersection walls (maintain relative order) s.t. wall \"wall\" is first\n const intersectionWalls: Array = walls.toArray();\n const intersectionWallsReordered: Array = [];\n\n let j = intersectionWalls.indexOf(wall);\n for (let i = 0; i < intersectionWalls.length; i++) {\n const w: go.Group = intersectionWalls[j];\n intersectionWallsReordered.push(w);\n j = (j + 1) % intersectionWalls.length;\n }\n\n walls.clear();\n for (let i = 0; i < intersectionWallsReordered.length; i++) {\n const w: go.Group = intersectionWallsReordered[i];\n walls.add(w);\n }\n\n return walls;\n }\n\n /**\n * Returns updated room boundaries to include any internal walls to a room's geometry (if there are any)\n * @param {go.List} roomOuterBoundaryPts a Set of go.Points that describe the outer boundaries of a room\n * @param {Array} roomOuterBoundaryPath an Array that describes the outer boundary walls of a room\n * entries in the form of [[wall, side], [wall, side]...]\n * @return {Array}\n */\n public addInternalWallsToRoom(\n roomOuterBoundaryPts: go.List,\n roomOuterBoundaryPath: Array\n ): Array {\n const fp: Floorplan = this as Floorplan;\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n const offendingWalls: go.Set = new go.Set();\n walls.iterator.each(function (w: go.Group) {\n // if (!w.data.isDivider) {\n const s: go.Point = w.data.startpoint;\n const e: go.Point = w.data.endpoint;\n if (\n fp.isPointInPolygon(roomOuterBoundaryPts.toArray(), s) ||\n fp.isPointInPolygon(roomOuterBoundaryPts.toArray(), e)\n ) {\n offendingWalls.add(w);\n }\n // }\n });\n\n /**\n * Recursively finds all internal walls that eventually tie back to an initial intersection point along a room boundary wall\n * Returned path is an array with entries in the form of (i.e. [ wallA1, wallB1, wallB2, wallA2 ] )\n * @param {go.Group} wall The current wall we're at\n * @param {go.List} iwalls Walls with an endpoint at ip\n * @param {go.Point} ip The current intersection point\n * @param {go.Set} seenIp Set of pairs of stringified Points / wall keys that represent intersection points\n * we're already accounting (from a specific wall) for somewhere in the stack\n * Note: you may encounter the same intersection point from a different wall (if there is a cycle in this cluster)\n * @param {Array} path Array of 2 entry arrays, [[wall, number], [wall, number]] (representing walls and sides of walls)\n * @param {go.Group} bw1 Boundary wall 1 -- the first boundary wall this cluster intersects\n * @param {go.Group} bw2 Boundary wall 2 -- when we reach this wall, we're done\n * @return {Array} The internal cluster path\n */\n function recursivelyFindInteralClusterPath(\n wall: go.Group,\n iwalls: go.List,\n ip: go.Point,\n seenIp: go.Set,\n path: Array,\n bw1: go.Group,\n bw2: go.Group\n ): Array {\n seenIp.add(go.Point.stringify(ip)); // remember we've handled this intersection point\n\n iwalls.iterator.each(function (fw) {\n // fw = \"first\" wall in intersection walls (that's not \"wall\"). This is always the wall immediately counterclockwise of wall\n if (fw.data.key !== wall.data.key) {\n // if fw is bw2, return path, we're done\n if (fw.data.key === bw2.data.key) {\n if (path.indexOf(\"isDone\") === -1) {\n path.push(\"isDone\");\n }\n return path;\n }\n // alternatively, if the path contains \"isDone\" string, don't do anything more\n if (path.indexOf(\"isDone\") !== -1) {\n return path;\n }\n\n // find out which mitering side of the first wall in iwalls is immediately clockwise of \"wall\"\n let side: number | null = null;\n side = fp.getCounterClockwiseWallSide(fw, ip);\n\n // push fw.data.key + side to path\n const entry = [fw.data.key, side];\n // if path already contains this exact entry, do not add it, we're starting to loop infinitely. stop now\n for (let i = 0; i < path.length; i++) {\n const e = path[i];\n const wk: string = e[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n const s = e[1];\n if (fw.data.key === w.data.key && s === side) {\n return undefined;\n }\n }\n path.push(entry);\n const otherEndpoint: go.Point = wrt.pointsApproximatelyEqual(\n ip,\n fw.data.startpoint\n )\n ? fw.data.endpoint\n : fw.data.startpoint;\n\n // get all walls connected to other endpoint of fw (if any exist, and if seenIp does not include this other endpoint)\n // (recursion)\n let iw: go.List = wrt.getAllWallsAtIntersection(\n otherEndpoint,\n true\n );\n // sort intersectionWalls s.t. they are clockwise, starting with bw1\n if (iw !== null && iw.count > 1) {\n iw = fp.sortWallsClockwiseWithSetStartWall(iw, fw);\n }\n\n let hasNotSeenIp = false;\n if (!seenIp.contains(go.Point.stringify(otherEndpoint))) {\n hasNotSeenIp = true;\n }\n\n // if we have seen this ip, maybe its OK -- iff the counter-clockwise side of the first wall in iw is nowhere in the path yet\n let alreadySeen = false;\n if (!hasNotSeenIp) {\n // get first wall in iw\n const fiw: go.Group = iw.toArray()[1];\n const side2 = fp.getCounterClockwiseWallSide(fiw, otherEndpoint);\n for (let i = 0; i < path.length; i++) {\n const entry1 = path[i];\n const wk: string = entry1[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n const s = entry1[1];\n if (w.data.key === fiw.data.key && s === side2) {\n alreadySeen = true;\n }\n }\n }\n\n // have we come full circle?\n const atFinalIp = iw.contains(bw1);\n\n const doContinue = hasNotSeenIp ? true : !alreadySeen && !atFinalIp;\n\n if (iw.count > 1 && doContinue) {\n return recursivelyFindInteralClusterPath(\n fw,\n iw,\n otherEndpoint,\n seenIp,\n path,\n bw1,\n bw2\n );\n } else if (!atFinalIp) {\n const otherSide = side === 1 ? 2 : 1;\n const entry2 = [fw.data.key, otherSide];\n path.push(entry2);\n let iw2: go.List = wrt.getAllWallsAtIntersection(\n ip,\n true\n );\n // sort intersectionWalls s.t. they are clockwise, starting with bw1\n if (iw2 !== null && iw2.count > 1) {\n iw2 = fp.sortWallsClockwiseWithSetStartWall(iw2, fw);\n }\n return recursivelyFindInteralClusterPath(\n fw,\n iw2,\n ip,\n seenIp,\n path,\n bw1,\n bw2\n );\n } else if (path.indexOf(\"isDone\") === -1) {\n path.push(\"isDone\");\n return undefined;\n }\n }\n return undefined\n });\n\n return path;\n } // end recursivelyFindInternalClusterPath\n\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n // now go through offending walls\n const handledWalls: go.Set = new go.Set();\n const internalPathsToInsert: go.Map> = new go.Map<\n go.Group,\n Array\n >();\n offendingWalls.iterator.each(function (ow) {\n if (!handledWalls.contains(ow)) {\n const ows: go.Point = ow.data.startpoint;\n const owe: go.Point = ow.data.endpoint;\n\n // find the 2 boundaryWalls this offending wall shares an intersection point with\n let bw1: go.Group | null = null;\n let bw2: go.Group | null = null;\n let ip: go.Point | null = null;\n\n for (let i = 0; i < roomOuterBoundaryPath.length; i++) {\n const entry = roomOuterBoundaryPath[i];\n if (typeof entry === \"string\") continue;\n const wk: string = entry[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n const s: go.Point = w.data.startpoint;\n const e: go.Point = w.data.endpoint;\n\n if (\n wrt.pointsApproximatelyEqual(s, ows) ||\n wrt.pointsApproximatelyEqual(s, owe) ||\n wrt.pointsApproximatelyEqual(e, ows) ||\n wrt.pointsApproximatelyEqual(e, owe)\n ) {\n if (bw1 === null) {\n bw1 = w; // bw1 must exist in the boundaryWalls array before bw2\n ip = fp.getSegmentsIntersection(\n bw1.data.startpoint,\n bw1.data.endpoint,\n ows,\n owe\n );\n } else {\n bw2 = w;\n }\n }\n }\n\n // edge case -- bw1 is the first entry in boundaryWalls array and bw2 is the last -- if so, switch them\n if (\n ip !== null &&\n bw1 !== null &&\n bw2 !== null &&\n roomOuterBoundaryPath[0][0] === bw1.data.key &&\n roomOuterBoundaryPath[roomOuterBoundaryPath.length - 1][0] ===\n bw2.data.key\n ) {\n let temp = null;\n temp = bw1;\n bw1 = bw2;\n bw2 = temp;\n }\n\n if (ip !== null) {\n let intersectionWalls: go.List = new go.List();\n if (bw1 !== null) {\n // this is important -- this gives us a reference for \"clockwise\" when dealing with intersection walls\n intersectionWalls.add(bw1);\n }\n // now, find any other offendingWalls that share this intersection point\n offendingWalls.iterator.each(function (ow2: go.Group) {\n const ow2s: go.Point = ow2.data.startpoint;\n const ow2e: go.Point = ow2.data.endpoint;\n if (ip !== null) {\n if (\n wrt.pointsApproximatelyEqual(ow2s, ip) ||\n wrt.pointsApproximatelyEqual(ow2e, ip)\n ) {\n intersectionWalls.add(ow2);\n handledWalls.add(ow2);\n }\n }\n });\n if (bw2 !== null) {\n // this lets us know we are done in recursion when we get to this wall\n intersectionWalls.add(bw2);\n }\n\n // sort intersectionWalls s.t. they are clockwise, starting with bw1\n if (bw1 !== null) {\n intersectionWalls = fp.sortWallsClockwiseWithSetStartWall(\n intersectionWalls,\n bw1\n );\n }\n\n const path: Array = []; // path of walls/sides for the offending walls as key+side (i.e. [[wall, number], [wall, number]] )\n // recurse through all intersection walls until you reach bw2\n const seenIp: go.Set = new go.Set();\n if (bw1 !== null && bw2 !== null) {\n let p = recursivelyFindInteralClusterPath(\n bw1,\n intersectionWalls,\n ip,\n seenIp,\n path,\n bw1,\n bw2\n );\n // cut the \"isDone\" flag\n p = p.slice(0, p.length - 1);\n // Remember to insert this path after bw1 in the roomOuterBoundaryPath after all this iteration\n internalPathsToInsert.add(bw1, p);\n }\n } // end intersection point check\n } // end handled wall check\n }); // end offendingWalls iterator\n\n // Insert internal paths into room boundaries now\n internalPathsToInsert.iterator.each(function (kvp) {\n const bw: go.Group = kvp.key; // the boundary wall to insert this internal path directly after\n const path: Array = kvp.value; // the path to insert\n let insertionIndex: number | undefined;\n for (let i = 0; i < roomOuterBoundaryPath.length; i++) {\n const entry = roomOuterBoundaryPath[i];\n if (typeof entry === \"string\") continue;\n const entryWk: string = entry[0];\n const entryW: go.Group = fp.findNodeForKey(entryWk) as go.Group;\n if (entryW.data.key === bw.data.key) {\n insertionIndex = i + 1;\n }\n }\n const firstArr = roomOuterBoundaryPath.slice(0, insertionIndex);\n const secondArr = roomOuterBoundaryPath.slice(\n insertionIndex,\n roomOuterBoundaryPath.length\n );\n roomOuterBoundaryPath = firstArr.concat(path).concat(secondArr);\n });\n\n // roomOuterBoundaryPath now includes internal walls connected to the original outer boundaries\n return roomOuterBoundaryPath;\n } // end addInternalWallsToRoom\n\n /**\n * Given a wall and a mitering side (1 or 2), return the endpoint of the wall s.t. the \"inside\" remains on the right\n * This aids in the clockwise traversal of wall edges\n * @param {go.Group} w\n * @param {number} side The mitering side of w being used\n * @return {go.Point | null}\n */\n public getClockwiseWallEndpoint(w: go.Group, side: number): go.Point | null {\n const fp: Floorplan = this;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n let ip: go.Point | null = null;\n let op: go.Point | null = null;\n // in this context, sPt and ePt refer to the start and end points of w's mitering side, \"side\"\n const sPt: go.Point = w.data[\"smpt\" + side];\n const ePt: go.Point = w.data[\"empt\" + side];\n // get two points, one \"outside\" mitering side \"side\" of w, and within \"inside\"\n const mPt: go.Point = new go.Point(\n (sPt.x + ePt.x) / 2,\n (sPt.y + ePt.y) / 2\n );\n const a = sPt.directionPoint(ePt) + 180; // perpindicular to angle of w\n const offset = w.data.thickness / 2;\n // get 2 points 1/2 w thickness from w's midpoint at angles a and a+180\n const pt1: go.Point = wrt.translateAndRotatePoint(mPt, a, offset);\n const pt2: go.Point = wrt.translateAndRotatePoint(mPt, a + 180, offset);\n let insidePt: go.Point | null = null;\n let outsidePt: go.Point | null = null;\n\n /**\n * Helper function, returns whether a point is to the left or right of a segment (if one thinks of orienting themselves, standing at one endpoint, looking to the other)\n * @param {go.Point} pt The point to check\n * @param {go.Point} rayS The first point of the segment\n * @param {go.Point} rayE The second point of the segment\n * @return {boolean}\n */\n function isPointLeftOfRay(\n pt: go.Point,\n rayS: go.Point,\n rayE: go.Point\n ): boolean {\n return (\n (pt.y - rayS.y) * (rayE.x - rayS.x) >\n (pt.x - rayS.x) * (rayE.y - rayS.y)\n );\n }\n\n if (fp.isPointInWall(w, pt1)) {\n insidePt = pt1;\n outsidePt = pt2;\n } else {\n insidePt = pt2;\n outsidePt = pt1;\n }\n\n // now, imagine standing on this mitering side of w and looking from sPt to ePt, or from ePt to sPt\n // in which situation is the \"inside\" pt on your right?\n // whichever one that is, use the second endpoint (ePt or sPt) as the ip to go to next\n // this will ensure we are always moving clockwise around the walls in this hole, so our room geometry is constructed properly later\n if (isPointLeftOfRay(insidePt, sPt, ePt)) {\n ip = w.data.endpoint;\n op = w.data.startpoint;\n } else {\n ip = w.data.startpoint;\n op = w.data.endpoint;\n }\n\n return ip;\n }\n\n /**\n * Find all the \"holes\" in a room.\n * These are walls / wall clusters that are inside a room's boundaries but do not connect to the room boundary walls.\n * They are used to construct \"holes\" in the room's polygon, and their area is subtracted from the room's polygon's area to correctly represent floor space\n * IMPORTANT: This function must be run after the internal walls that DO connect to room outer boundaries have been added. This is done in addInternalWallsToRoom()\n * It is assumed the roomBoundaryWalls parameter includes all connected room boundary walls, as it is used to find interior walls not connected to the room boundaries\n * @param {Array} roomBoundaryWalls Specially formatted Array for the boundaries of the room, where entries are [wall, mitering side]\n * @param {go.Point} pt The original pt used to generate the room. See {@link getRoomWalls} for more detail\n * @return {go.Array>} @TODO CHANGE THIS TO AN ARRAY OF ARRAYS\n * A go.Set of Arrays. Each Array represents a hole path. Array entries are in the form of [wall, mitering side]. These are used to construct\n * the holes in the room geometry later, and their areas are subtracted from the polygon area of the room boundaries to correctly get floor area\n */\n public findRoomHoles(\n roomBoundaryWalls: Array,\n pt: go.Point\n ): Array> {\n const fp: Floorplan = this as Floorplan;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n // offendingWalls is a Set of walls inside the room boundaries, not included in the room boundaries (these walls will make the holes)\n const offendingWalls: go.Set = new go.Set();\n const roomOuterBoundaryPts: go.List | null = fp.makePolygonFromRoomBoundaries(\n roomBoundaryWalls\n );\n walls.iterator.each(function (w: go.Group) {\n const s: go.Point = w.data.startpoint;\n const e: go.Point = w.data.endpoint;\n if (\n roomOuterBoundaryPts !== null &&\n (fp.isPointInPolygon(roomOuterBoundaryPts.toArray(), s) ||\n fp.isPointInPolygon(roomOuterBoundaryPts.toArray(), e))\n ) {\n // make sure this wall w is not in the roomBoundaryWalls anywhere\n let isBoundaryWall = false;\n for (let i = 0; i < roomBoundaryWalls.length; i++) {\n const entry = roomBoundaryWalls[i];\n const wallKey: string = entry[0];\n const wall: go.Group = fp.findNodeForKey(wallKey) as go.Group;\n if (wall.data.key === w.data.key) {\n isBoundaryWall = true;\n }\n }\n if (!isBoundaryWall) {\n offendingWalls.add(w);\n }\n }\n });\n\n // keep track of the offendingWalls we have handled so far\n const seenWalls: go.Set = new go.Set();\n\n /**\n * Recursively find the path of the hole starting at origWall.\n * @param {go.Group} w\n * @param {go.Set | null} seenIp\n * @param {Array | null} path\n * @param {go.Point | null} prevPt\n * @param {go.Group} origWall\n * @return {Array}\n */\n function recursivelyFindHolePath(\n w: go.Group,\n seenIp: go.Set | null,\n path: Array | null,\n prevPt: go.Point | null,\n origWall: go.Group\n ): Array {\n // one time thing: if path is null (not made yet), add w to path\n // need to do special calculation to get the proper mitering side for w\n let side: number | null = null; // the mitering side of w, will only be set if w is the first wall\n if (path === null || path === undefined) {\n path = [];\n // First wall is special case; just find out which mitering side is closer to the original point used for this room construction\n // get intersection point from pt-mPt each of walls's mitering sides\n\n // It's possible pt-mPt does not intersect one or both of the actual segments making up the mitering sides of w,\n // so use the lines implied by the mitering points, not just finite segments\n const ws: go.Point = w.data.startpoint;\n const we: go.Point = w.data.endpoint;\n const mPt: go.Point = new go.Point(\n (ws.x + we.x) / 2,\n (ws.y + we.y) / 2\n );\n const ip1: go.Point | null = fp.getLinesIntersection(\n pt,\n mPt,\n w.data.smpt1,\n w.data.empt1\n );\n const ip2: go.Point | null = fp.getLinesIntersection(\n pt,\n mPt,\n w.data.smpt2,\n w.data.empt2\n );\n\n if (ip1 !== null && ip2 !== null) {\n // whichever mitering side pt-mPt strikes first (which intersection point is closer to pt) is the one to start with\n const dist1 = Math.sqrt(ip1.distanceSquaredPoint(pt));\n const dist2 = Math.sqrt(ip2.distanceSquaredPoint(pt));\n side = dist1 < dist2 ? 1 : 2;\n seenWalls.add(w);\n path.push([w.data.key, side]);\n }\n }\n\n if (path.indexOf(\"isDone\") !== -1) {\n return path;\n }\n\n // get clockwise endpoint, ip, for w (only if prevPt is null or undefined, otherwise, just use the endpoint of w that is not prevPt)\n // const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(3) as WallReshapingTool;\n let ip: go.Point | null = null; // intersection point (one of w's endpoints), the one we're gonna move to\n let op: go.Point | null = null; // other endpoint of w\n const sPt: go.Point = w.data.startpoint;\n const ePt: go.Point = w.data.endpoint;\n\n if (prevPt !== null && prevPt !== undefined) {\n ip = wrt.pointsApproximatelyEqual(sPt, prevPt) ? ePt : sPt;\n op = wrt.pointsApproximatelyEqual(sPt, prevPt) ? sPt : ePt;\n } else {\n if (side !== null) {\n ip = fp.getClockwiseWallEndpoint(w, side);\n if (ip !== null) {\n op = wrt.pointsApproximatelyEqual(ip, sPt) ? ePt : sPt;\n }\n }\n }\n\n if (seenIp === null || seenIp === undefined) {\n seenIp = new go.Set();\n }\n // add ip to seenIp\n if (ip !== null) {\n seenIp.add(go.Point.stringify(ip));\n }\n\n // get all walls at ip, call that iw; sort clockwise with wall as the first element\n let iw: go.List = wrt.getAllWallsAtIntersection(ip, true);\n let oiw: go.List = wrt.getAllWallsAtIntersection(op, true);\n // sort iw s.t. they are clockwise, starting with w\n if (iw !== null && iw.count > 1) {\n iw = fp.sortWallsClockwiseWithSetStartWall(iw, w);\n }\n\n let hasNotSeenIp = false;\n if (ip !== null && !seenIp.contains(go.Point.stringify(ip))) {\n hasNotSeenIp = true;\n }\n\n // if we have seen this ip, maybe its OK -- iff the counter-clockwise side of the first wall in iw is nowhere in the path yet\n let alreadySeen = false;\n if (!hasNotSeenIp && iw.toArray().length > 0) {\n // get first wall in iw\n let fiw: go.Group | null = null;\n if (iw.toArray().length > 1) {\n fiw = iw.toArray()[1];\n } else {\n fiw = iw.toArray()[0];\n }\n if (ip !== null) {\n const side2 = fp.getCounterClockwiseWallSide(fiw, ip);\n for (let i = 0; i < path.length; i++) {\n const entry = path[i];\n const wk: string = entry[0];\n const ww: go.Group = fp.findNodeForKey(wk) as go.Group;\n const s = entry[1];\n if (ww.data.key === fiw.data.key && s === side2) {\n alreadySeen = true;\n }\n }\n }\n }\n\n // check if the path already contains both sides of w\n let s1 = false;\n let s2 = false;\n for (let i = 0; i < path.length; i++) {\n const entry = path[i];\n const wwk: string = entry[0];\n const ww: go.Group = fp.findNodeForKey(wwk) as go.Group;\n\n if (ww.data.key === w.data.key && !s1) {\n s1 = true;\n } else if (ww.data.key === w.data.key && s1 && !s2) {\n s2 = true;\n }\n }\n // pred to check if there's only 1 wall in this hole\n const isSoloWallHole = s1 && s2 && alreadySeen && path.length < 3;\n\n // have we come full circle?\n const isNextClockwiseWallOrigWall =\n iw.count > 1 && iw.toArray()[1].data.key === origWall.data.key;\n\n const atFinalIp =\n (isNextClockwiseWallOrigWall &&\n (w.data.key !== origWall.data.key || isSoloWallHole)) ||\n (isSoloWallHole && w.data.key === origWall.data.key);\n\n const doContinue = hasNotSeenIp ? true : !alreadySeen; /*&& !atFinalIp*/\n\n if (!doContinue && path.indexOf(\"isDone\") === -1) {\n path.push(\"isDone\");\n }\n\n if (doContinue) {\n // iterate over iw, with namespace fw\n iw.iterator.each(function (fw: go.Group) {\n // if there is more than one element in iw, skip first fw (it's w)\n if (\n path !== null &&\n fw.data.key !== w.data.key &&\n path.indexOf(\"isDone\") === -1\n ) {\n // get proper (CC?) mitering side, add entry to path, then recurse\n if (ip !== null) {\n const side1 = fp.getCounterClockwiseWallSide(fw, ip);\n const entry = [fw.data.key, side1];\n path.push(entry);\n seenWalls.add(fw);\n recursivelyFindHolePath(fw, seenIp, path, ip, origWall);\n }\n } else if (\n iw.count === 1 &&\n path !== null &&\n path.indexOf(\"isDone\") === -1\n ) {\n // find the current entry in path with fw\n let entry = null;\n for (let i = 0; i < path.length; i++) {\n const pwk: string = path[i][0];\n const pw: go.Group = fp.findNodeForKey(pwk) as go.Group;\n if (pw.data.key === fw.data.key) {\n const s = path[i][1];\n const os = s === 1 ? 2 : 1;\n entry = [pw.data.key, os];\n }\n }\n path.push(entry);\n\n // if this is the only wall in the hole, add isDone to path\n if (oiw.count === 1) {\n path.push(\"isDone\");\n }\n }\n });\n }\n if (path.indexOf(\"isDone\") !== -1) {\n return path.slice(0, path.length - 1);\n } else if (oiw.count > 1) {\n // this is the last wall we traced\n const lw: go.Group | null = iw.last();\n\n // sort iw s.t. they are clockwise, starting with lw\n if (oiw !== null && lw !== null) {\n oiw = fp.sortWallsClockwiseWithSetStartWall(oiw, lw);\n }\n // the \"parent wall\" (the one that led to all walls in oiw) is the next, non \"lw\" wall in the clockwise-sorted oiw\n const parentw: go.Group = oiw.toArray()[1];\n\n // add the mitering side of parent wall to the path that's not already in the path\n if (op !== null) {\n const side1 = fp.getCounterClockwiseWallSide(parentw, op);\n const entry = [parentw.data.key, side1];\n\n // if this entry already exists, we've come full circle and are done\n let entryExists = false;\n for (let i = 0; i < path.length; i++) {\n const entry2 = path[i];\n const w1k: string = entry[0];\n const w1: go.Group = fp.findNodeForKey(w1k) as go.Group;\n const w2k: string = entry2[0];\n const w2: go.Group = fp.findNodeForKey(w2k) as go.Group;\n if (w1.data.key === w2.data.key && entry[1] === entry2[1]) {\n entryExists = true;\n }\n }\n\n if (entry !== null && !entryExists) {\n path.push(entry);\n seenWalls.add(parentw);\n\n // now recurse\n recursivelyFindHolePath(parentw, seenIp, path, op, origWall);\n } else if (entryExists) {\n return path;\n }\n }\n }\n\n if (path.indexOf(\"isDone\") !== -1) {\n path = path.slice(0, path.length - 1);\n }\n return path;\n } // end recursivelyFindHolePath\n\n // A set of specially formatted Arrays, representing the paths of the holes\n // IMPORTANT: Hole paths must be clockwise to ensure proper geometry construction in updateRoom() function!\n const holes: Array> = [];\n offendingWalls.iterator.each(function (ow) {\n // if we haven't gotten a path for a hole that contains this wall yet...\n if (!seenWalls.contains(ow)) {\n // draw segement from pt to the ow's midpoint (mPt). Find all walls intersected by this segment\n const sPt: go.Point = ow.data.startpoint;\n const ePt: go.Point = ow.data.endpoint;\n const mPt: go.Point = new go.Point(\n (sPt.x + ePt.x) / 2,\n (sPt.y + ePt.y) / 2\n );\n const wallsDistArr: Array = []; // array of wall/dist pairs [[wallA, 15], [wallB, 30]] -- this makes sorting easier than if we were using a Map\n offendingWalls.iterator.each(function (w) {\n const ip: go.Point | null = fp.getSegmentsIntersection(\n pt,\n mPt,\n w.data.startpoint,\n w.data.endpoint\n );\n if (ip !== null) {\n const dist = Math.sqrt(ip.distanceSquaredPoint(pt));\n wallsDistArr.push([w, dist]);\n }\n });\n\n // sort all walls the line from pt to mPt intersects, in order of proximity to pt\n wallsDistArr.sort(function (a, b) {\n const distA = a[1];\n const distB = b[1];\n if (distA === distB) return 0;\n else if (distA < distB) return -1;\n else return 1;\n });\n\n // find the first wall, fw, this segment intersects that is not in the roomBoundaryWalls AND not already in seenWalls\n let fw: go.Group | null = null;\n for (let i = 0; i < wallsDistArr.length; i++) {\n const entryWall: go.Group = wallsDistArr[i][0];\n if (!seenWalls.contains(entryWall) && fw === null) {\n fw = entryWall;\n }\n }\n\n if (fw !== null) {\n // fw is guaranteed to be a boundary wall for a hole; use it to get the cycle path for the hole\n const path = recursivelyFindHolePath(fw, null, null, null, fw);\n\n // Add any walls inside the polygon made by this path to seenWalls (we don't want to create holes within holes)\n const polygon: go.List | null = fp.makePolygonFromRoomBoundaries(\n path\n );\n if (polygon !== null) {\n offendingWalls.iterator.each(function (ow2: go.Group) {\n const s: go.Point = ow2.data.smpt1;\n if (\n fp.isPointInPolygon(polygon.toArray(), s) ||\n fp.isPointInPolygon(polygon.toArray(), s)\n ) {\n seenWalls.add(ow2);\n }\n });\n\n holes.push(path);\n }\n }\n }\n }); // end offendingWalls iterator\n\n return holes;\n } // end findRoomHoles\n\n /**\n * Returns an ordered List of Points for a given path.\n * A path is a special Array whose entries are of the form [wall, miteringSide]\n * This is mostly used with roomBoundaryWall and room hole paths\n * @param {Array} path\n * @returns {go.List}\n */\n public getPathPts(path: Array): go.List {\n const fp: Floorplan = this;\n const pts: go.List = new go.List();\n const firstWallKey: string = path[0][0];\n const firstWall: go.Group = fp.findNodeForKey(firstWallKey) as go.Group;\n const firstSide = path[0][1];\n\n const secondWallKey: string = path[1][0];\n const secondWall: go.Group = fp.findNodeForKey(secondWallKey) as go.Group;\n\n // find where first and second wall meet\n // if that's near firstWall's smpt[side] pt, start with empt[side] pt; else, vice versa (i.e. pick the farthest pt)\n let ip: go.Point | null = fp.getWallsIntersection(firstWall, secondWall);\n\n // SPECIAL case -- if firstWall and secondWall are the same, make sure you get the ip that is clockwise\n // this means we are wrapping around a single wall to start, and we need to make sure we are doing so in a clockwise manner\n if (firstWall.data.key === secondWall.data.key) {\n ip = fp.getClockwiseWallEndpoint(firstWall, firstSide);\n }\n\n if (ip !== null) {\n const propS: string = \"smpt\" + firstSide;\n const propE: string = \"empt\" + firstSide;\n const ptS: go.Point = firstWall.data[propS];\n const ptE: go.Point = firstWall.data[propE];\n\n const distS = Math.sqrt(ip.distanceSquaredPoint(ptS));\n const distE = Math.sqrt(ip.distanceSquaredPoint(ptE));\n const closestPt: go.Point = distS < distE ? ptS : ptE;\n const farthestPt: go.Point = closestPt.equals(ptS) ? ptE : ptS;\n\n pts.add(farthestPt);\n pts.add(closestPt);\n\n let prevPt: go.Point = closestPt;\n let prevWall: go.Group = firstWall;\n for (let i = 0; i < path.length; i++) {\n const entry = path[i];\n if (typeof entry === \"string\") continue;\n const wk: string = entry[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n const s = entry[1];\n\n if (i !== 0) {\n const propS1: string = \"smpt\" + s;\n const propE1: string = \"empt\" + s;\n const ptS1: go.Point = w.data[propS1];\n const ptE1: go.Point = w.data[propE1];\n const distS1 = Math.sqrt(prevPt.distanceSquaredPoint(ptS1));\n const distE1 = Math.sqrt(prevPt.distanceSquaredPoint(ptE1));\n\n const closestPt1: go.Point = distS1 < distE1 ? ptS1 : ptE1;\n const farthestPt1: go.Point = closestPt.equals(ptS1) ? ptE1 : ptS1;\n\n // if the previous wall is the same as current wall, we're looping around the wall's geometry, so be sure to include its thickness border\n if (prevWall.data.key === w.data.key) {\n pts.add(prevPt);\n pts.add(closestPt1);\n }\n\n pts.add(closestPt1);\n pts.add(farthestPt1);\n prevPt = farthestPt1;\n prevWall = w;\n }\n }\n }\n\n return pts;\n }\n\n /**\n * Get the area of a given polygon.\n * The answer will be in document units -- to convert to floorplan units (cm, m, whatever)\n * you must call convertPixelsToUnits twice!\n * @param {Array} vs An ordered array of polygon vertices\n * @return {number}\n */\n public getPolygonArea(vs: Array): number {\n let j = 0;\n let area = 0;\n for (let i = 0; i < vs.length; i++) {\n j = (i + 1) % vs.length;\n\n area += vs[i].x * vs[j].y;\n area -= vs[i].y * vs[j].x;\n }\n\n area /= 2;\n return area < 0 ? -area : area;\n }\n\n /**\n * Get the area of a given room.\n * This is the area of the polygon created by the outer boundary walls of the room, less the area of all the room holes.\n * @param {go.Node} r Room node\n * @return {number} This will be in document units, not floorplan units\n */\n public getRoomArea(r: go.Node): number {\n const fp: Floorplan = this;\n const pts: go.List = fp.getPathPts(r.data.boundaryWalls);\n const area1 = fp.getPolygonArea(pts.toArray());\n\n // get the area of all the holes\n let area2 = 0;\n const holes: Array> = r.data.holes;\n for (let i = 0; i < holes.length; i++) {\n const h: Array = holes[i];\n // get holes points\n const hPts: go.List = fp.getPathPts(h);\n const hArea = fp.getPolygonArea(hPts.toArray());\n // get area of hole, add it to area2\n area2 += hArea;\n }\n return area1 - area2;\n }\n\n /**\n * Tells whether a point is in a wall's geometry.\n * @param {go.Group} w\n * @param {go.Point} p\n * @return {boolean}\n */\n public isPointInWall(w: go.Group, p: go.Point): boolean {\n const floorplan: Floorplan = this;\n const orderedPoints: Array = [\n w.data.startpoint,\n w.data.smpt1,\n w.data.empt1,\n w.data.endpoint,\n w.data.empt2,\n w.data.smpt2,\n w.data.startpoint,\n ];\n return floorplan.isPointInPolygon(orderedPoints, p);\n }\n\n /**\n * Tells whether a point is in a room's geometry\n * @param {go.Node} r room node\n * @param {go.Point} p point to check\n * @return {boolean}\n */\n public isPointInRoom(r: go.Node, p: go.Point): boolean {\n const fp: Floorplan = this;\n if (\n r === null ||\n r === undefined ||\n !(r instanceof go.Node) ||\n r.data.category !== \"RoomNode\"\n )\n return false;\n const polygon: go.List | null = fp.makePolygonFromRoomBoundaries(\n r.data.boundaryWalls\n );\n if (polygon !== null) {\n const polyArr = polygon.toArray();\n const isInRoom = fp.isPointInPolygon(polyArr, p);\n return isInRoom;\n }\n return false;\n }\n\n /**\n * Return whether or not a given point is inside a given polygon\n * @param {Array} vs An ordered Array of polygon vertices\n * @param {go.Point} point The point to check\n * @return {boolean}\n */\n public isPointInPolygon(vs: Array, point: go.Point): boolean {\n // ray-casting algorithm based on\n // http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n\n const x = point.x;\n const y = point.y;\n\n let inside = false;\n for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {\n const xi = vs[i].x;\n const yi = vs[i].y;\n const xj = vs[j].x;\n const yj = vs[j].y;\n\n const intersect =\n yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n\n return inside;\n }\n\n /**\n * Update the geometry, angle, and location of a given wall\n * @param {go.Group} wall A reference to a valid Wall Group (defined below)\n */\n public updateWall(wall: go.Group): void {\n if (wall.data.startpoint && wall.data.endpoint) {\n const shape: go.Shape = wall.findObject(\"SHAPE\") as go.Shape;\n const data: any = wall.data;\n\n // geometry is slightly different for Room Dividers vs. Walls\n let geo: go.Geometry | null = null;\n let pts: Array = [\n data.startpoint,\n data.endpoint,\n data.smpt1,\n data.smpt2,\n data.empt1,\n data.empt2,\n ];\n if (wall.data.isDivider) {\n shape.strokeWidth = WallThicknessEnum.divider;\n shape.opacity = 0.5;\n }\n // else {\n\n pts = [\n data.startpoint,\n data.endpoint,\n data.smpt1,\n data.smpt2,\n data.empt1,\n data.empt2,\n ];\n geo = new go.Geometry().add(\n new go.PathFigure(data.startpoint.x, data.startpoint.y)\n .add(\n new go.PathSegment(go.PathSegment.Line, data.smpt1.x, data.smpt1.y)\n )\n .add(\n new go.PathSegment(go.PathSegment.Line, data.empt1.x, data.empt1.y)\n )\n .add(\n new go.PathSegment(\n go.PathSegment.Line,\n data.endpoint.x,\n data.endpoint.y\n )\n )\n .add(\n new go.PathSegment(go.PathSegment.Line, data.empt2.x, data.empt2.y)\n )\n .add(\n new go.PathSegment(go.PathSegment.Line, data.smpt2.x, data.smpt2.y)\n )\n .add(\n new go.PathSegment(\n go.PathSegment.Line,\n data.startpoint.x,\n data.startpoint.y\n )\n )\n );\n // }\n\n geo.normalize();\n shape.geometry = geo;\n\n let smallestX = Number.MAX_VALUE;\n let smallestY = Number.MAX_VALUE;\n\n for (let i = 0; i < pts.length; i++) {\n const pt: go.Point = pts[i];\n if (pt.x < smallestX) {\n smallestX = pt.x;\n }\n if (pt.y < smallestY) {\n smallestY = pt.y;\n }\n }\n\n // find smallest x and y values of all points and set that to the position of the wall node\n wall.position = new go.Point(smallestX, smallestY);\n wall.location = new go.Point(smallestX, smallestY);\n }\n }\n\n /**\n * Update the geometry, angle, and location of a given wall\n * @param {go.Node} room A reference to a valid Room Node (defined below)\n */\n public updateRoom(room: go.Node): void {\n const fp: Floorplan = this;\n const shape: go.Shape = room.findObject(\"SHAPE\") as go.Shape;\n const geo: go.Geometry = new go.Geometry();\n // build the room geo from wall boundary array in data\n const pts: Array = [];\n const bw: Array = room.data.boundaryWalls;\n if (bw === null) return;\n let fig: go.PathFigure | null = null;\n addPathToGeo(bw);\n\n /**\n * Internal, helper function. Add a path of boundary walls (specially formatted array) of walls/mitering sides to room's geo figure.\n * @param {Array} boundaryWalls\n */\n function addPathToGeo(boundaryWalls: Array) {\n const firstWallKey: string = boundaryWalls[0][0];\n const firstWall: go.Group = fp.findNodeForKey(firstWallKey) as go.Group;\n const firstSide = boundaryWalls[0][1];\n\n const secondWallKey: string = boundaryWalls[1][0];\n const secondWall: go.Group = fp.findNodeForKey(secondWallKey) as go.Group;\n\n // find where first and second wall meet\n // if that's near firstWall's smpt[side] pt, start with empt[side] pt; else, vice versa (i.e. pick the farthest pt)\n let ip: go.Point | null = fp.getWallsIntersection(firstWall, secondWall);\n\n // SPECIAL case -- if firstWall and secondWall are the same, make sure you get the ip that is clockwise\n // this means we are wrapping around a single wall to start, and we need to make sure we are doing so in a clockwise manner\n if (firstWall.data.key === secondWall.data.key) {\n ip = fp.getClockwiseWallEndpoint(firstWall, firstSide);\n }\n\n if (ip === null) return;\n\n const propS: string = \"smpt\" + firstSide;\n const propE: string = \"empt\" + firstSide;\n const ptS: go.Point = firstWall.data[propS];\n const ptE: go.Point = firstWall.data[propE];\n\n const distS = Math.sqrt(ip.distanceSquaredPoint(ptS));\n const distE = Math.sqrt(ip.distanceSquaredPoint(ptE));\n const closestPt: go.Point = distS < distE ? ptS : ptE;\n const farthestPt: go.Point = closestPt.equals(ptS) ? ptE : ptS;\n const firstPt: go.Point = farthestPt.copy();\n\n pts.push(farthestPt);\n pts.push(closestPt);\n if (fig === null) {\n fig = new go.PathFigure(farthestPt.x, farthestPt.y);\n } else {\n fig.add(\n new go.PathSegment(go.PathSegment.Move, farthestPt.x, farthestPt.y)\n );\n }\n fig.add(\n new go.PathSegment(go.PathSegment.Line, closestPt.x, closestPt.y)\n );\n\n let prevPt: go.Point = closestPt;\n let prevWall: go.Group = firstWall;\n for (let i = 0; i < boundaryWalls.length; i++) {\n const entry = boundaryWalls[i];\n if (typeof entry === \"string\") continue;\n const wk: string = entry[0];\n const w: go.Group = fp.findNodeForKey(wk) as go.Group;\n const s = entry[1];\n\n if (i !== 0) {\n const propS1: string = \"smpt\" + s;\n const propE1: string = \"empt\" + s;\n const ptS1: go.Point = w.data[propS1];\n const ptE1: go.Point = w.data[propE1];\n const distS1 = Math.sqrt(prevPt.distanceSquaredPoint(ptS1));\n const distE1 = Math.sqrt(prevPt.distanceSquaredPoint(ptE1));\n\n const closestPt1: go.Point = distS1 < distE1 ? ptS1 : ptE1;\n const farthestPt1: go.Point = closestPt1.equals(ptS1) ? ptE1 : ptS1;\n\n // if the previous wall is the same as current wall, we're looping around the wall's geometry, so be sure to include its thickness border\n if (prevWall.data.key === w.data.key) {\n fig.add(\n new go.PathSegment(go.PathSegment.Line, prevPt.x, prevPt.y)\n );\n fig.add(\n new go.PathSegment(\n go.PathSegment.Line,\n closestPt1.x,\n closestPt1.y\n )\n );\n }\n\n fig.add(\n new go.PathSegment(go.PathSegment.Line, closestPt1.x, closestPt1.y)\n );\n fig.add(\n new go.PathSegment(\n go.PathSegment.Line,\n farthestPt1.x,\n farthestPt1.y\n )\n );\n pts.push(closestPt1);\n pts.push(farthestPt1);\n prevPt = farthestPt1;\n prevWall = w;\n }\n }\n\n // close geometry?\n fig.add(new go.PathSegment(go.PathSegment.Line, firstPt.x, firstPt.y));\n }\n\n // add holes to the room geo\n const holes: Array> = room.data.holes;\n if (holes !== null && holes.length !== 0) {\n for (let i = 0; i < holes.length; i++) {\n const holePath: Array = holes[i];\n addPathToGeo(holePath);\n }\n }\n\n // add fig to geo\n if (fig !== null) {\n geo.add(fig);\n }\n\n geo.normalize();\n shape.geometry = geo;\n\n let smallestX = Number.MAX_VALUE;\n let smallestY = Number.MAX_VALUE;\n for (let i = 0; i < pts.length; i++) {\n const pt: go.Point = pts[i];\n if (pt.x < smallestX) {\n smallestX = pt.x;\n }\n if (pt.y < smallestY) {\n smallestY = pt.y;\n }\n }\n\n // find smallest x and y values of all points and set that to the position of the room node\n room.position = new go.Point(smallestX, smallestY);\n room.location = new go.Point(smallestX, smallestY);\n fp.model.setDataProperty(\n room.data,\n \"loc\",\n new go.Point(smallestX, smallestY)\n );\n\n // also update room area in data\n const area = fp.getRoomArea(room);\n fp.model.setDataProperty(room.data, \"area\", area);\n }\n\n /**\n * Helper function for Build Dimension Link: get a to/from point for a Dimension Link\n * @param {go.Group} wall The Wall Group being given a Dimension Link\n * @param {number} angle The angle of \"wall\"\n * @param {number} wallOffset The distance the Dimension Link will be from wall (in pixels)\n * @return {go.Point}\n */\n private getAdjustedPoint(\n point: go.Point,\n wall: go.Group,\n angle: number,\n wallOffset: number\n ): go.Point {\n const oldPoint: go.Point = point.copy();\n point.offset(0, -(wall.data.thickness * 0.5) - wallOffset);\n point\n .offset(-oldPoint.x, -oldPoint.y)\n .rotate(angle)\n .offset(oldPoint.x, oldPoint.y);\n return point;\n }\n\n /**\n * Helper function for Update Wall Dimensions; used to build Dimension Links\n * @param {go.Group} wall The wall the Link runs along (either describing the wall itself or some wallPart on \"wall\")\n * @param {number} index A number appended to PointNode keys; used for finding PointNodes of Dimension Links later\n * @param {go.Point} point1 The first point of the wallPart being described by the Link\n * @param {go.Point} point2 The second point of the wallPart being described by the Link\n * @param {number} angle The angle of the wallPart\n * @param {number} wallOffset How far from the wall (in px) the Link should be\n * @param {boolean} soloWallFlag If this Link is the only Dimension Link for \"wall\" (no other wallParts on \"wall\" selected) this is true; else, false\n * @param {Floorplan} floorplan A reference to a valid Floorplan\n * @param {number} miteringSide The mitering side of the wall we're labelling with a dimension link. Can be 1 or 2\n * @param {number} opacity How opaque the link is. Optional. Default is 1\n * @param {string} stroke The stroke color for the link. Optional. Default is gray\n * @param {number} strokeWidth The stroke width for the link. Optional. Default is 2.\n */\n public buildDimensionLink(\n wall: go.Group,\n index: number,\n point1: go.Point,\n point2: go.Point,\n angle: number,\n wallOffset: number,\n soloWallFlag: boolean,\n floorplan: Floorplan,\n miteringSide: number,\n opacity?: number,\n stroke?: string,\n strokeWidth?: number\n ): void {\n point1 = floorplan.getAdjustedPoint(point1, wall, angle, wallOffset);\n point2 = floorplan.getAdjustedPoint(point2, wall, angle, wallOffset);\n if (opacity === undefined || opacity === null || isNaN(opacity)) {\n opacity = 1;\n }\n if (\n strokeWidth === undefined ||\n strokeWidth === null ||\n isNaN(strokeWidth)\n ) {\n strokeWidth = 2;\n }\n if (stroke === undefined || stroke === null) {\n stroke = \"gray\";\n }\n const data1 = {\n key: wall.data.key + \"PointNode\" + miteringSide + index,\n category: \"PointNode\",\n loc: go.Point.stringify(point1),\n };\n const data2 = {\n key: wall.data.key + \"PointNode\" + miteringSide + (index + 1),\n category: \"PointNode\",\n loc: go.Point.stringify(point2),\n };\n const data3 = {\n key: wall.data.key + \"DimensionLink\",\n category: \"DimensionLink\",\n from: data1.key,\n to: data2.key,\n angle,\n wall: wall.data.key,\n soloWallFlag,\n };\n const pointNode1: go.Node = makePointNode();\n const pointNode2: go.Node = makePointNode();\n const link: go.Link = makeDimensionLink(opacity, stroke, strokeWidth);\n\n floorplan.pointNodes.add(pointNode1);\n floorplan.pointNodes.add(pointNode2);\n floorplan.dimensionLinks.add(link);\n floorplan.add(pointNode1);\n floorplan.add(pointNode2);\n floorplan.add(link);\n\n pointNode1.data = data1;\n pointNode2.data = data2;\n link.data = data3;\n link.fromNode = pointNode1;\n link.toNode = pointNode2;\n link.data.length = Math.sqrt(\n pointNode1.location.distanceSquaredPoint(pointNode2.location)\n );\n }\n\n /**\n * Update Dimension Links shown along walls, based on which walls and wallParts are selected\n * @param {go.Set} wallsToDisplayFor An optional set of walls to show dimensions for. If this is not provided,\n * just show dimensions for selected walls.\n */\n public updateWallDimensions(wallsToDisplayFor?: go.Set): void {\n const floorplan: Floorplan = this;\n floorplan.skipsUndoManager = true;\n floorplan.startTransaction(\"update wall dimensions\");\n // if showWallLengths === false, remove all pointNodes (used to build wall dimensions)\n if (!floorplan.model.modelData.preferences.showWallLengths) {\n floorplan.pointNodes.iterator.each(function (node) {\n floorplan.remove(node);\n });\n floorplan.dimensionLinks.iterator.each(function (link) {\n floorplan.remove(link);\n });\n floorplan.pointNodes.clear();\n floorplan.dimensionLinks.clear();\n floorplan.commitTransaction(\"update wall dimensions\");\n floorplan.skipsUndoManager = false;\n return;\n }\n\n // destroy all previous pointNodes and dimensionLinks\n floorplan.pointNodes.iterator.each(function (node) {\n floorplan.remove(node);\n });\n floorplan.dimensionLinks.iterator.each(function (link) {\n floorplan.remove(link);\n });\n floorplan.pointNodes.clear();\n floorplan.dimensionLinks.clear();\n\n // make visible all dimension links (zero-length dimension links are set to invisible at the end of the function)\n // floorplan.dimensionLinks.iterator.each(function (link) { link.visible = true; });\n\n const selection =\n wallsToDisplayFor !== null && wallsToDisplayFor !== undefined\n ? wallsToDisplayFor\n : floorplan.selection;\n // const selection: go.Set = floorplan.selection;\n\n // gather all selected walls, including walls of selected DoorNodes and WindowNodes\n const walls: go.Set = new go.Set();\n selection.iterator.each(function (part: go.Part) {\n if (\n (part.category === \"WindowNode\" || part.category === \"DoorNode\") &&\n part.containingGroup !== null\n ) {\n walls.add(part.containingGroup);\n }\n if (\n (part.category === \"WallGroup\" || part.category === \"ScaleGroup\") &&\n part.data &&\n part.data.startpoint &&\n part.data.endpoint\n ) {\n // ensure there are no parts on this wall that are also selected\n const wall: go.Group = part as go.Group;\n let areWallPartsSelected = false;\n wall.memberParts.each(function (wp: go.Part) {\n if (wp.isSelected) {\n areWallPartsSelected = true;\n }\n });\n\n if (!areWallPartsSelected && wall.data.isScale !== true) {\n const ang = wall.data.startpoint.directionPoint(wall.data.endpoint);\n\n // build dimension link for side1\n const s1: go.Point = wall.data.smpt1;\n const e1: go.Point = wall.data.empt1;\n let first: go.Point = s1.x + s1.y <= e1.x + e1.y ? s1 : e1;\n let second: go.Point = s1.x + s1.y > e1.x + e1.y ? s1 : e1;\n floorplan.buildDimensionLink(\n wall,\n 1,\n first.copy(),\n second.copy(),\n (ang + 180) % 360,\n 10,\n true,\n floorplan,\n 1\n );\n\n const s2: go.Point = wall.data.smpt2;\n const e2: go.Point = wall.data.empt2;\n first = s2.x + s2.y <= e2.x + e2.y ? s2 : e2;\n second = s2.x + s2.y > e2.x + e2.y ? s2 : e2;\n floorplan.buildDimensionLink(\n wall,\n 2,\n first.copy(),\n second.copy(),\n ang,\n 10,\n true,\n floorplan,\n 1\n );\n }\n }\n });\n\n // create array of selected wall endpoints and selected wallPart endpoints along the wall that represent measured stretches\n walls.iterator.each(function (wall) {\n for (let i = 1; i < 3; i++) {\n const startpoint: go.Point = wall.data[\"smpt\" + i];\n const endpoint: go.Point = wall.data[\"empt\" + i];\n const firstWallPt: go.Point =\n startpoint.x + startpoint.y <= endpoint.x + endpoint.y\n ? startpoint\n : endpoint;\n const lastWallPt: go.Point =\n startpoint.x + startpoint.y > endpoint.x + endpoint.y\n ? startpoint\n : endpoint;\n let angle = wall.data.startpoint.directionPoint(wall.data.endpoint);\n if (i === 1) {\n angle = (angle + 180) % 360;\n }\n\n // store all endpoints along with the part they correspond to (used later to either create DimensionLinks or simply adjust them)\n const wallPartEndpoints: Array = [];\n wall.memberParts.iterator.each(function (wallPart) {\n if (wallPart.isSelected) {\n const endpoints = getWallPartEndpoints(wallPart);\n const ep1: go.Point = endpoints[0];\n const ep2: go.Point = endpoints[1];\n const newEp1: go.Point = floorplan.rotateAndTranslatePoint(\n ep1,\n angle + 0,\n wall.data.thickness / 2\n );\n const newEp2: go.Point = floorplan.rotateAndTranslatePoint(\n ep2,\n angle + 0,\n wall.data.thickness / 2\n );\n // const newEp1: go.Point = ep1.projectOntoLineSegmentPoint(startpoint, endpoint);\n // const newEp2: go.Point = ep2.projectOntoLineSegmentPoint(startpoint, endpoint);\n\n wallPartEndpoints.push(ep1);\n wallPartEndpoints.push(ep2);\n }\n });\n // sort all wallPartEndpoints by x coordinate left to right/ up to down\n wallPartEndpoints.sort(function (a, b) {\n if (a.x + a.y > b.x + b.y) return 1;\n if (a.x + a.y < b.x + b.y) return -1;\n else return 0;\n });\n wallPartEndpoints.unshift(firstWallPt);\n wallPartEndpoints.push(lastWallPt);\n\n let k = 1; // k is a counter for the indices of PointNodes\n // build / edit dimension links for each stretch, defined by pairs of points in wallPartEndpoints\n for (let j = 0; j < wallPartEndpoints.length - 1; j++) {\n let linkPoint1: go.Node | null = null;\n let linkPoint2: go.Node | null = null;\n const itr = floorplan.pointNodes.iterator;\n while (itr.next()) {\n const node: go.Node = itr.value;\n if (node.data.key === wall.data.key + \"PointNode\" + k) {\n linkPoint1 = node;\n }\n if (node.data.key === wall.data.key + \"PointNode\" + (k + 1)) {\n linkPoint2 = node;\n }\n }\n\n if (linkPoint1 !== null && linkPoint2 !== null) {\n const newLoc1: go.Point = floorplan.getAdjustedPoint(\n wallPartEndpoints[j].copy(),\n wall,\n angle,\n 15\n );\n const newLoc2: go.Point = floorplan.getAdjustedPoint(\n wallPartEndpoints[j + 1].copy(),\n wall,\n angle,\n 15\n );\n linkPoint1.data.loc = go.Point.stringify(newLoc1);\n linkPoint2.data.loc = go.Point.stringify(newLoc2);\n linkPoint1.updateTargetBindings();\n linkPoint2.updateTargetBindings();\n } else {\n floorplan.buildDimensionLink(\n wall,\n k,\n wallPartEndpoints[j].copy(),\n wallPartEndpoints[j + 1].copy(),\n angle,\n 15,\n false,\n floorplan,\n i,\n 0.5,\n \"gray\",\n 1\n );\n }\n k += 2;\n }\n // total wall Dimension Link constructed of a kth and k+1st pointNode\n let totalWallDimensionLink = null;\n floorplan.dimensionLinks.iterator.each(function (link) {\n if (\n link.fromNode !== null &&\n link.toNode !== null &&\n link.fromNode.data.key === wall.data.key + \"PointNode\" + i + k &&\n link.toNode.data.key === wall.data.key + \"PointNode\" + i + (k + 1)\n ) {\n totalWallDimensionLink = link;\n }\n });\n // if a total wall Dimension Link already exists, adjust its constituent point nodes\n if (totalWallDimensionLink !== null) {\n let linkPoint1: go.Node | null = null;\n let linkPoint2: go.Node | null = null;\n const itr = floorplan.pointNodes.iterator;\n while (itr.next()) {\n const node: go.Node = itr.value;\n if (node.data.key === wall.data.key + \"PointNode\" + k) {\n linkPoint1 = node;\n }\n if (node.data.key === wall.data.key + \"PointNode\" + (k + 1)) {\n linkPoint2 = node;\n }\n }\n\n if (linkPoint1 !== null && linkPoint2 !== null) {\n const newLoc1: go.Point = floorplan.getAdjustedPoint(\n wallPartEndpoints[0].copy(),\n wall,\n angle,\n 25\n );\n const newLoc2: go.Point = floorplan.getAdjustedPoint(\n wallPartEndpoints[wallPartEndpoints.length - 1].copy(),\n wall,\n angle,\n 25\n );\n linkPoint1.data.loc = go.Point.stringify(newLoc1);\n linkPoint2.data.loc = go.Point.stringify(newLoc2);\n linkPoint1.updateTargetBindings();\n linkPoint2.updateTargetBindings();\n }\n } else {\n floorplan.buildDimensionLink(\n wall,\n k,\n wallPartEndpoints[0].copy(),\n wallPartEndpoints[wallPartEndpoints.length - 1].copy(),\n angle,\n 25,\n false,\n floorplan,\n i\n );\n }\n } // end for loop (ensures both sides of the wall are dimensioned)\n });\n\n // Cleanup: hide zero-length Dimension Links, DimensionLinks with null wall points\n floorplan.dimensionLinks.iterator.each(function (link) {\n let canStay = false;\n floorplan.pointNodes.iterator.each(function (node) {\n if (node.data.key === link.data.to) canStay = true;\n });\n if (!canStay) floorplan.remove(link);\n else {\n if (link !== null && link.toNode !== null && link.fromNode !== null) {\n const length = Math.sqrt(\n link.toNode.location.distanceSquaredPoint(link.fromNode.location)\n );\n if (length < 1 && !link.data.soloWallFlag) link.visible = false;\n }\n }\n });\n\n floorplan.commitTransaction(\"update wall dimensions\");\n floorplan.skipsUndoManager = false;\n } // end updateWallDimensions()\n\n /**\n * @param {go.Point} pt\n * @param {number} angle\n * @param {number} distance\n */\n public rotateAndTranslatePoint(\n pt: go.Point,\n angle: number,\n distance: number\n ) {\n const x = pt.x;\n const y = pt.y;\n const newX = Math.cos((x * Math.PI) / 180) * distance + x;\n const newY = Math.sin((x * Math.PI) / 180) * distance + y;\n const newPt: go.Point = new go.Point(newX, newY);\n return newPt;\n }\n\n /**\n * Return the point where two walls intersect. If they do not intersect, return null.\n * @param {go.Group} w1\n * @param {go.Group} w2\n * @return {go.Point | null}\n */\n public getWallsIntersection(w1: go.Group, w2: go.Group): go.Point | null {\n if (w1 === null || w2 === null) {\n return null;\n }\n const x1 = w1.data.startpoint.x;\n const y1 = w1.data.startpoint.y;\n const x2 = w1.data.endpoint.x;\n const y2 = w1.data.endpoint.y;\n const x3 = w2.data.startpoint.x;\n const y3 = w2.data.startpoint.y;\n const x4 = w2.data.endpoint.x;\n const y4 = w2.data.endpoint.y;\n\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n /**\n * Returns whether or not 2 points are \"close enough\" to each other\n * @param {go.Point} p1\n * @param {go.Point} p2\n * @return {boolean}\n */\n function pointsApproximatelyEqual(p1: go.Point, p2: go.Point): boolean {\n const xa = p1.x;\n const xb = p2.x;\n const ya = p1.y;\n const yb = p2.y;\n\n const diff1 = Math.abs(xb - xa);\n const diff2 = Math.abs(yb - ya);\n\n if (diff2 < 0.05 && diff1 < 0.05) {\n return true;\n }\n return false;\n }\n\n // Lines are parallel -- edge case, endpoint-endpoint connection of parallel walls\n if (denominator === 0) {\n // Edge Case: wall1 and wall2 have an endpoint to endpoint intersection (the only instance in which paralell walls could intersect at a specific point)\n if (\n pointsApproximatelyEqual(w1.data.startpoint, w2.data.startpoint) ||\n pointsApproximatelyEqual(w1.data.startpoint, w2.data.endpoint)\n )\n return w1.data.startpoint;\n if (\n pointsApproximatelyEqual(w1.data.endpoint, w2.data.startpoint) ||\n pointsApproximatelyEqual(w1.data.endpoint, w2.data.endpoint)\n )\n return w1.data.endpoint;\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n const ua1 = +ua.toFixed(2);\n const ub1 = +ub.toFixed(2);\n\n // is the intersection along the segments\n if (ua1 < 0 || ua1 > 1 || ub1 < 0 || ub1 > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return new go.Point(x, y);\n }\n\n /**\n * Return the intersection point of two segments\n * @param {go.Point} p1 Seg 1 point 1\n * @param {go.Point} p2 Seg 1 point 2\n * @param {go.Point} p3 Seg 2 point 1\n * @param {go.Point} p4 Seg 2 point 2\n * @return {go.Point | null}\n */\n public getSegmentsIntersection(\n p1: go.Point,\n p2: go.Point,\n p3: go.Point,\n p4: go.Point\n ): go.Point | null {\n const x1 = p1.x;\n const y1 = p1.y;\n const x2 = p2.x;\n const y2 = p2.y;\n const x3 = p3.x;\n const y3 = p3.y;\n const x4 = p4.x;\n const y4 = p4.y;\n\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n /**\n * Returns whether or not 2 points are \"close enough\" to each other\n * @param {go.Point} pa\n * @param {go.Point} pb\n * @return {boolean}\n */\n function pointsApproximatelyEqual(pa: go.Point, pb: go.Point): boolean {\n const xa = pa.x;\n const xb = pb.x;\n const ya = pa.y;\n const yb = pb.y;\n\n const diff1 = Math.abs(xb - xa);\n const diff2 = Math.abs(yb - ya);\n\n if (diff2 < 0.05 && diff1 < 0.05) {\n return true;\n }\n return false;\n }\n\n // Lines are parallel -- edge case, endpoint-endpoint connection of parallel walls\n if (denominator === 0) {\n // Edge Case: wall1 and wall2 have an endpoint to endpoint intersection (the only instance in which paralell walls could intersect at a specific point)\n if (pointsApproximatelyEqual(p1, p3) || pointsApproximatelyEqual(p1, p4))\n return p1;\n if (pointsApproximatelyEqual(p2, p3) || pointsApproximatelyEqual(p2, p4))\n return p2;\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n const ua1 = +ua.toFixed(4);\n const ub1 = +ub.toFixed(4);\n\n // is the intersection along the segments\n if (ua1 < 0 || ua1 > 1 || ub1 < 0 || ub1 > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return new go.Point(x, y);\n }\n\n /**\n * Update Angle Nodes shown along a wall, based on which wall(s) is/are selected\n */\n public updateWallAngles() {\n const floorplan: Floorplan = this;\n floorplan.skipsUndoManager = true; // do not store displaying angles as a transaction\n floorplan.startTransaction(\"display angles\");\n if (floorplan.model.modelData.preferences.showWallAngles) {\n floorplan.angleNodes.iterator.each(function (node) {\n node.visible = true;\n });\n const selectedWalls: Array = [];\n floorplan.selection.iterator.each(function (part) {\n if (part.category === \"WallGroup\") {\n const w: go.Group = part as go.Group;\n selectedWalls.push(w);\n }\n });\n for (let i = 0; i < selectedWalls.length; i++) {\n const seen: go.Set = new go.Set(); // Set of all walls \"seen\" thus far for \"wall\"\n const wall: go.Group = selectedWalls[i];\n const possibleWalls: go.Iterator = floorplan.findNodesByExample(\n { category: \"WallGroup\" }\n ) as go.Iterator;\n\n // go through all other walls; if the other wall intersects this wall, make angles\n possibleWalls.iterator.each(function (otherWall) {\n if (\n otherWall.data === null ||\n wall.data === null ||\n seen.contains(otherWall.data.key)\n )\n return;\n if (\n otherWall.data.key !== wall.data.key &&\n floorplan.getWallsIntersection(wall, otherWall) !== null &&\n !seen.contains(otherWall.data.key)\n ) {\n seen.add(otherWall.data.key);\n // \"otherWall\" intersects \"wall\"; make or update angle nodes\n const intersectionPoint: go.Point | null = floorplan.getWallsIntersection(\n wall,\n otherWall\n );\n if (intersectionPoint !== null) {\n const wrt: WallReshapingTool = floorplan.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n const wallsInvolved: go.List = wrt.getAllWallsAtIntersection(\n intersectionPoint\n );\n const endpoints: Array = []; // store endpoints and their corresponding walls here\n // gather endpoints of each wall in wallsInvolved; discard endpoints within a tolerance distance of intersectionPoint\n wallsInvolved.iterator.each(function (w) {\n const tolerance =\n floorplan.model.modelData.gridSize >= 10\n ? floorplan.model.modelData.gridSize\n : 10;\n if (\n Math.sqrt(\n w.data.startpoint.distanceSquaredPoint(intersectionPoint)\n ) > tolerance\n )\n endpoints.push({\n point: w.data.startpoint,\n wall: w.data.key,\n });\n if (\n Math.sqrt(\n w.data.endpoint.distanceSquaredPoint(intersectionPoint)\n ) > tolerance\n )\n endpoints.push({ point: w.data.endpoint, wall: w.data.key });\n });\n\n // find maxRadius (shortest distance from an involved wall's endpoint to intersectionPoint or 30, whichever is smaller)\n let maxRadius = 30;\n for (let j = 0; j < endpoints.length; j++) {\n const distance = Math.sqrt(\n endpoints[j].point.distanceSquaredPoint(intersectionPoint)\n );\n if (distance < maxRadius) maxRadius = distance;\n }\n\n // sort endpoints in a clockwise fashion around the intersectionPoint\n endpoints.sort(function (a, b) {\n a = a.point;\n b = b.point;\n if (\n a.x - intersectionPoint.x >= 0 &&\n b.x - intersectionPoint.x < 0\n )\n return 1;\n if (\n a.x - intersectionPoint.x < 0 &&\n b.x - intersectionPoint.x >= 0\n )\n return -1;\n if (\n a.x - intersectionPoint.x === 0 &&\n b.x - intersectionPoint.x === 0\n ) {\n if (\n a.y - intersectionPoint.y >= 0 ||\n b.y - intersectionPoint.y >= 0\n )\n return a.y > b.y ? 1 : -1;\n return b.y > a.y ? 1 : -1;\n }\n\n // compute the cross product of vectors (center -> a) x (center -> b)\n const det =\n (a.x - intersectionPoint.x) * (b.y - intersectionPoint.y) -\n (b.x - intersectionPoint.x) * (a.y - intersectionPoint.y);\n if (det < 0) return 1;\n if (det > 0) return -1;\n\n // points a and b are on the same line from the center; check which point is closer to the center\n const d1 =\n (a.x - intersectionPoint.x) * (a.x - intersectionPoint.x) +\n (a.y - intersectionPoint.y) * (a.y - intersectionPoint.y);\n const d2 =\n (b.x - intersectionPoint.x) * (b.x - intersectionPoint.x) +\n (b.y - intersectionPoint.y) * (b.y - intersectionPoint.y);\n return d1 > d2 ? 1 : -1;\n }); // end endpoints sort\n\n // for each pair of endpoints, construct or modify an angleNode\n for (let j = 0; j < endpoints.length; j++) {\n const p1: any = endpoints[j];\n let p2: any;\n if (endpoints[j + 1] != null) {\n p2 = endpoints[j + 1];\n } else {\n p2 = endpoints[0];\n }\n const a1 = intersectionPoint.directionPoint(p1.point);\n const a2 = intersectionPoint.directionPoint(p2.point);\n const sweep = Math.abs(a2 - a1 + 360) % 360;\n const angle = a1;\n\n // construct proper key for angleNode\n // proper angleNode key syntax is \"wallWwallX...wallYangleNodeZ\" such that W < Y < Y; angleNodes are sorted clockwise around the intersectionPoint by Z\n const keyArray: Array = []; // used to construct proper key\n wallsInvolved.iterator.each(function (w) {\n keyArray.push(w);\n });\n keyArray.sort(function (a, b) {\n const aIndex = a.data.key.match(/\\d+/g);\n const bIndex = b.data.key.match(/\\d+/g);\n if (isNaN(aIndex)) return 1;\n if (isNaN(bIndex)) return -1;\n else return aIndex > bIndex ? 1 : -1;\n });\n\n let key = \"\";\n for (let k = 0; k < keyArray.length; k++)\n key += keyArray[k].data.key;\n key += \"angle\" + j;\n\n // check if this angleNode already exists -- if it does, adjust data (instead of deleting/redrawing)\n let angleNode: go.Node | null = null;\n const aitr = floorplan.angleNodes.iterator;\n while (aitr.next()) {\n const aNode: go.Node = aitr.value;\n if (aNode.data.key === key) {\n angleNode = aNode;\n }\n }\n\n if (angleNode !== null) {\n angleNode.data.angle = angle;\n angleNode.data.sweep = sweep;\n angleNode.data.loc = go.Point.stringify(intersectionPoint);\n angleNode.data.maxRadius = maxRadius;\n angleNode.updateTargetBindings();\n } else {\n const data = {\n key,\n category: \"AngleNode\",\n loc: go.Point.stringify(intersectionPoint),\n stroke: \"dodgerblue\",\n angle,\n sweep,\n maxRadius,\n };\n const newAngleNode: go.Node = makeAngleNode();\n newAngleNode.data = data;\n floorplan.add(newAngleNode);\n newAngleNode.updateTargetBindings();\n floorplan.angleNodes.add(newAngleNode);\n }\n }\n } // end intersectionPt null check\n }\n });\n }\n // garbage collection (angleNodes that should not exist any more)\n const garbage: Array = [];\n floorplan.angleNodes.iterator.each(function (node) {\n const keyNums = node.data.key.match(/\\d+/g); // values X for all wall keys involved, given key \"wallX\"\n const numWalls = (node.data.key.match(/wall/g) || []).length; // # of walls involved in in \"node\"'s construction\n const wallsInvolved: Array = [];\n\n // add all walls involved in angleNode's construction to wallsInvolved\n for (let i = 0; i < keyNums.length - 1; i++) {\n wallsInvolved.push(\"wall\" + keyNums[i]);\n }\n // edge case: if the numWalls != keyNums.length, that means the wall with key \"wall\" (no number in key) is involved\n if (numWalls !== keyNums.length - 1) {\n wallsInvolved.push(\"wall\");\n }\n\n // Case 1: if any wall pairs involved in this angleNode are no longer intersecting, add this angleNode to \"garbage\"\n for (let i = 0; i < wallsInvolved.length - 1; i++) {\n const wall1: go.Group = floorplan.findPartForKey(\n wallsInvolved[i]\n ) as go.Group;\n const wall2: go.Group = floorplan.findPartForKey(\n wallsInvolved[i + 1]\n ) as go.Group;\n const intersectionPoint: go.Point | null = floorplan.getWallsIntersection(\n wall1,\n wall2\n );\n if (intersectionPoint === null) garbage.push(node);\n }\n // Case 2: if there are angleNode clusters with the same walls in their keys as \"node\" but different locations, destroy and rebuild\n // collect all angleNodes with same walls in their construction as \"node\"\n const possibleAngleNodes: go.Set = new go.Set();\n const allWalls = node.data.key.slice(0, node.data.key.indexOf(\"angle\"));\n floorplan.angleNodes.iterator.each(function (other) {\n if (other.data.key.indexOf(allWalls) !== -1)\n possibleAngleNodes.add(other);\n });\n possibleAngleNodes.iterator.each(function (pNode) {\n if (pNode.data.loc !== node.data.loc) {\n garbage.push(pNode);\n }\n });\n\n // Case 3: put any angleNodes with sweep === 0 in garbage\n if (node.data.sweep === 0) garbage.push(node);\n });\n\n for (let i = 0; i < garbage.length; i++) {\n floorplan.remove(garbage[i]); // remove garbage\n floorplan.angleNodes.remove(garbage[i]);\n }\n }\n // hide all angles > 180 if show only small angles == true in preferences\n if (floorplan.model.modelData.preferences.showOnlySmallWallAngles) {\n floorplan.angleNodes.iterator.each(function (node) {\n if (node.data.sweep >= 180) node.visible = false;\n });\n }\n // hide all angles if show wall angles == false in preferences\n if (!floorplan.model.modelData.preferences.showWallAngles) {\n floorplan.angleNodes.iterator.each(function (node) {\n node.visible = false;\n });\n }\n floorplan.commitTransaction(\"display angles\");\n floorplan.skipsUndoManager = false;\n }\n\n /**\n * Find closest loc (to a wall part's loc) on wall a wallPart can be dropped onto without extending beyond wall endpoints or intruding into another wallPart\n * @param {go.Group} wall A reference to a Wall Group\n * @param {go.Part} part A reference to a Wall Part Node -- i.e. Door Node, Window Node\n * @return {go.Point}\n */\n public findClosestLocOnWall(wall: go.Group, part: go.Part): go.Point | null {\n let orderedConstrainingPts = []; // wall endpoints and wallPart endpoints\n const startpoint = wall.data.startpoint.copy();\n const endpoint = wall.data.endpoint.copy();\n // store all possible constraining endpoints (wall endpoints and wallPart endpoints) in the order in which they appear (left/top to right/bottom)\n const firstWallPt =\n startpoint.x + startpoint.y <= endpoint.x + endpoint.y\n ? startpoint\n : endpoint;\n const lastWallPt =\n startpoint.x + startpoint.y > endpoint.x + endpoint.y\n ? startpoint\n : endpoint;\n const wallPartEndpoints: Array = [];\n wall.memberParts.iterator.each(function (wallPart) {\n const endpoints = getWallPartEndpoints(wallPart);\n wallPartEndpoints.push(endpoints[0]);\n wallPartEndpoints.push(endpoints[1]);\n });\n // sort all wallPartEndpoints by x coordinate left to right\n wallPartEndpoints.sort(function (a, b) {\n if (a.x + a.y > b.x + b.y) {\n return 1;\n }\n if (a.x + a.y < b.x + b.y) {\n return -1;\n } else {\n return 0;\n }\n });\n orderedConstrainingPts.push(firstWallPt);\n orderedConstrainingPts = orderedConstrainingPts.concat(wallPartEndpoints);\n orderedConstrainingPts.push(lastWallPt);\n\n // go through all constraining points; if there's a free stretch along the wall \"part\" could fit in, remember it\n const possibleStretches = [];\n for (let i = 0; i < orderedConstrainingPts.length; i += 2) {\n const point1 = orderedConstrainingPts[i];\n const point2 = orderedConstrainingPts[i + 1];\n const distanceBetween = Math.sqrt(point1.distanceSquaredPoint(point2));\n if (distanceBetween >= part.data.length) {\n possibleStretches.push({ pt1: point1, pt2: point2 });\n }\n }\n\n // go through all possible stretches along the wall the part *could* fit in; find the one closest to the part's current location\n let closestDist = Number.MAX_VALUE;\n let closestStretch = null;\n for (let i = 0; i < possibleStretches.length; i++) {\n const testStretch = possibleStretches[i];\n const testPoint1 = testStretch.pt1;\n const testPoint2 = testStretch.pt2;\n const testDistance1 = Math.sqrt(\n testPoint1.distanceSquaredPoint(part.location)\n );\n const testDistance2 = Math.sqrt(\n testPoint2.distanceSquaredPoint(part.location)\n );\n if (testDistance1 < closestDist) {\n closestDist = testDistance1;\n closestStretch = testStretch;\n }\n if (testDistance2 < closestDist) {\n closestDist = testDistance2;\n closestStretch = testStretch;\n }\n }\n\n // Edge Case: If there's no space for the wallPart, return null\n if (closestStretch === null) {\n return null;\n }\n\n // using the closest free stretch along the wall, calculate endpoints that make the stretch's line segment, then project part.location onto the segment\n const closestStretchLength = Math.sqrt(\n closestStretch.pt1.distanceSquaredPoint(closestStretch.pt2)\n );\n const offset = part.data.length / 2;\n const pt1 = new go.Point(\n closestStretch.pt1.x +\n (offset / closestStretchLength) *\n (closestStretch.pt2.x - closestStretch.pt1.x),\n closestStretch.pt1.y +\n (offset / closestStretchLength) *\n (closestStretch.pt2.y - closestStretch.pt1.y)\n );\n const pt2 = new go.Point(\n closestStretch.pt2.x +\n (offset / closestStretchLength) *\n (closestStretch.pt1.x - closestStretch.pt2.x),\n closestStretch.pt2.y +\n (offset / closestStretchLength) *\n (closestStretch.pt1.y - closestStretch.pt2.y)\n );\n const newLoc = part.location.copy().projectOntoLineSegmentPoint(pt1, pt2);\n return newLoc;\n }\n} // end Floorplan class definition\n\n/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * FLOOR PLANNER CODE: TEMPLATES - GENERAL\n * General GraphObject templates used in the Floor Planner sample\n * Includes Context Menu, Diagram, Default Group, AngleNode, DimensionLink, PointNode\n */\n\n/*\n * Dependencies for Context Menu:\n * Make Selection Group, Ungroup Selection, Clear Empty Groups\n */\n\n// Make the selection a group\nfunction makeSelectionGroup(floorplan: Floorplan) {\n floorplan.startTransaction(\"group selection\");\n // ungroup all selected nodes; then group them; if one of the selected nodes is a group, ungroup all its nodes\n const sel = floorplan.selection;\n const nodes: Array = [];\n sel.iterator.each(function (n) {\n if (n instanceof go.Group) {\n n.memberParts.iterator.each(function (part) {\n nodes.push(part);\n });\n } else {\n nodes.push(n);\n }\n });\n for (let i = 0; i < nodes.length; i++) {\n nodes[i].isSelected = true;\n }\n ungroupSelection(floorplan);\n floorplan.commandHandler.groupSelection();\n const group = floorplan.selection.first(); // after grouping, the new group will be the only thing selected\n if (group !== null) {\n floorplan.model.setDataProperty(group.data, \"caption\", \"Group\");\n floorplan.model.setDataProperty(group.data, \"notes\", \"\");\n }\n clearEmptyGroups(floorplan);\n // unselect / reselect group so data appears properly in Selection Info Window\n floorplan.clearSelection();\n floorplan.select(group);\n floorplan.commitTransaction(\"group selection\");\n}\n\n// Ungroup selected nodes; if the selection is a group, ungroup all it's memberParts\nfunction ungroupSelection(floorplan: Floorplan) {\n floorplan.startTransaction(\"ungroup selection\");\n // helper function to ungroup nodes\n function ungroupNode(node: go.Part) {\n const group = node.containingGroup;\n node.containingGroup = null;\n if (group !== null) {\n if (group.memberParts.count === 0) {\n floorplan.remove(group);\n } else if (group.memberParts.count === 1) {\n const mpf = group.memberParts.first();\n if (mpf !== null) {\n mpf.containingGroup = null;\n }\n }\n }\n }\n // ungroup any selected nodes; remember groups that are selected\n const sel = floorplan.selection;\n const groups: Array = [];\n sel.iterator.each(function (n) {\n if (!(n instanceof go.Group)) {\n ungroupNode(n);\n } else {\n groups.push(n);\n }\n });\n // go through selected groups, and ungroup their memberparts too\n const nodes: Array = [];\n for (let i = 0; i < groups.length; i++) {\n groups[i].memberParts.iterator.each(function (n) {\n nodes.push(n);\n });\n }\n for (let i = 0; i < nodes.length; i++) {\n ungroupNode(nodes[i]);\n }\n clearEmptyGroups(floorplan);\n floorplan.commitTransaction(\"ungroup selection\");\n}\n\n// Clear all the groups that have no nodes\nfunction clearEmptyGroups(floorplan: Floorplan) {\n const nodes = floorplan.nodes;\n const arr: Array = [];\n nodes.iterator.each(function (node) {\n if (\n node instanceof go.Group &&\n node.memberParts.count === 0 &&\n node.category !== \"WallGroup\" && node.category !== 'ScaleGroup'\n ) {\n arr.push(node);\n }\n });\n for (let i = 0; i < arr.length; i++) {\n floorplan.remove(arr[i]);\n }\n}\n\n/*\n * General Group Dependencies:\n * Group Tool Tip\n */\n\n// Group Tool Tip\nfunction makeGroupToolTip() {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Auto\",\n $(go.Shape, { fill: \"#FFFFCC\" }),\n $(\n go.TextBlock,\n { margin: 4 },\n new go.Binding(\"text\", \"\", function (text, obj) {\n const data = obj.part.adornedObject.data;\n const name =\n obj.part.adornedObject.category === \"MultiPurposeNode\"\n ? data.text\n : data.caption;\n return `Nom ${obj.name || ''}\n \\nNotes: ${data.notes || ''}\n `;\n }).ofObject()\n )\n );\n}\n\n/*\n * General Templates:\n * Context Menu, Default Group\n */\n\n// Context Menu -- referenced by Node, Diagram and Group Templates\nfunction makeContextMenu() {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Vertical\",\n // Make Room Button\n $(\"ContextMenuButton\", $(go.TextBlock, \"Définir une pièce\"), {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const fp: Floorplan = e.diagram as Floorplan;\n // const pt: go.Point = obj.part === null ? e.diagram.lastInput.documentPoint : obj.part.location;\n const pt: go.Point = e.diagram.lastInput.documentPoint;\n fp.maybeAddRoomNode(pt, \"images/textures/floor1.jpg\");\n },\n }),\n // Scale button\n $(\n \"ContextMenuButton\",\n $(go.TextBlock, \"Scale\"),\n {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null) {\n const fp: Floorplan = part.diagram as Floorplan;\n makeSelectionGroup(fp);\n }\n },\n },\n new go.Binding(\"visible\", \"visible\", function (v, obj) {\n const floorplan = obj.part.diagram;\n let flag = true;\n floorplan.selection.iterator.each(function (node: go.Part) {\n if (node.category !== \"WallGroup\" && node.category !== 'ScaleGroup') {\n flag = false;\n }\n });\n return flag;\n }).ofObject()\n ),\n // Make group button\n // $(\n // \"ContextMenuButton\",\n // $(go.TextBlock, \"Make Group\"),\n // {\n // click(e: go.InputEvent, obj: go.GraphObject) {\n // const part = obj.part;\n // if (part !== null) {\n // const fp: Floorplan = part.diagram as Floorplan;\n // makeSelectionGroup(fp);\n // }\n // },\n // },\n // new go.Binding(\"visible\", \"visible\", function (v, obj) {\n // const floorplan = obj.part.diagram;\n // if (floorplan.selection.count <= 1) {\n // return false;\n // }\n // let flag = true;\n // floorplan.selection.iterator.each(function (node: go.Part) {\n // if (\n // node.category === \"WallGroup\" ||\n // node.category === \"WindowNode\" ||\n // node.category === \"DoorNode\" ||\n // node.category === \"RoomNode\"\n // ) {\n // flag = false;\n // }\n // });\n // return flag;\n // }).ofObject()\n // ),\n // Ungroup Selection Button\n // $(\n // \"ContextMenuButton\",\n // $(go.TextBlock, \"Ungroup\"),\n // {\n // click(e: go.InputEvent, obj: go.GraphObject) {\n // const part = obj.part;\n // if (part !== null) {\n // const fp: Floorplan = part.diagram as Floorplan;\n // ungroupSelection(fp);\n // }\n // },\n // },\n // new go.Binding(\"visible\", \"\", function (v, obj) {\n // const floorplan = obj.part.diagram;\n // if (floorplan !== null) {\n // const node = floorplan.selection.first();\n // return (\n // (node instanceof go.Node &&\n // node.containingGroup != null &&\n // node.containingGroup.category !== \"WallGroup\") ||\n // (node instanceof go.Group && node.category === \"\")\n // );\n // }\n // return false;\n // }).ofObject()\n // ),\n // Copy Button\n $(\n \"ContextMenuButton\",\n $(go.TextBlock, \"Copy\"),\n {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null && part.diagram !== null) {\n part.diagram.commandHandler.copySelection();\n }\n },\n },\n new go.Binding(\"visible\", \"\", function (v, obj) {\n if (obj.part.diagram !== null) {\n const sel: go.Iterable = obj.part.diagram.selection;\n let flag = sel.count > 0;\n sel.iterator.each(function (p: go.Part) {\n if (\n p.category === \"WallGroup\" ||\n p.category === \"ScaleGroup\" ||\n p.category === \"WindowNode\" ||\n p.category === \"DoorNode\" ||\n p.category === \"RoomNode\"\n ) {\n flag = false;\n }\n });\n return flag;\n }\n return false;\n }).ofObject()\n ),\n // Cut Button\n $(\n \"ContextMenuButton\",\n $(go.TextBlock, \"Cut\"),\n {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null && part.diagram !== null) {\n part.diagram.commandHandler.cutSelection();\n }\n },\n },\n new go.Binding(\"visible\", \"\", function (v, obj) {\n if (obj.part.diagram !== null) {\n const sel: go.Iterable = obj.part.diagram.selection;\n let flag = sel.count > 0;\n sel.iterator.each(function (p: go.Part) {\n if (\n p.category === \"WallGroup\" ||\n p.category === \"ScaleGroup\" ||\n p.category === \"WindowNode\" ||\n p.category === \"DoorNode\" ||\n p.category === \"RoomNode\"\n ) {\n flag = false;\n }\n });\n return flag;\n }\n return false;\n }).ofObject()\n ),\n // Delete Button\n $(\n \"ContextMenuButton\",\n $(go.TextBlock, \"Supprimer\"),\n {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null && part.diagram !== null) {\n part.diagram.commandHandler.deleteSelection();\n }\n },\n },\n new go.Binding(\"visible\", \"\", function (v, obj) {\n if (obj.part.diagram !== null) {\n return obj.part.diagram.selection.count > 0;\n }\n return false;\n }).ofObject()\n ),\n // Paste Button\n $(\"ContextMenuButton\", $(go.TextBlock, \"Coller\"), {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null && part.diagram !== null) {\n part.diagram.commandHandler.pasteSelection(\n part.diagram.toolManager.contextMenuTool.mouseDownPoint\n );\n }\n },\n })\n );\n}\n\n// Default Group\nfunction makeDefaultGroup() {\n const $ = go.GraphObject.make;\n return $(\n go.Group,\n \"Vertical\",\n {\n contextMenu: makeContextMenu(),\n toolTip: makeGroupToolTip(),\n },\n new go.Binding(\"location\", \"loc\"),\n $(\n go.Panel,\n \"Auto\",\n $(\n go.Shape,\n \"RoundedRectangle\",\n {\n fill: \"rgba(128,128,128,0.15)\",\n stroke: \"rgba(128, 128, 128, .05)\",\n name: \"SHAPE\",\n strokeCap: \"square\",\n },\n new go.Binding(\"fill\", \"isSelected\", function (s, obj) {\n return s ? \"rgba(128, 128, 128, .15)\" : \"rgba(128, 128, 128, 0.10)\";\n }).ofObject()\n ),\n $(go.Placeholder, { padding: 5 }) // extra padding around group members\n )\n );\n}\n\n/*\n * Dependencies for Angle Nodes:\n * Make Arc\n */\n\n// Return arc geometry for Angle Nodes\nfunction makeArc(node: go.Node) {\n const ang = node.data.angle;\n const sweep = node.data.sweep;\n const rad = Math.min(30, node.data.maxRadius);\n if (typeof sweep === \"number\" && sweep > 0) {\n const start = new go.Point(rad, 0).rotate(ang);\n // this is much more efficient than calling go.GraphObject.make:\n return new go.Geometry()\n .add(\n new go.PathFigure(start.x + rad, start.y + rad) // start point\n .add(\n new go.PathSegment(\n go.PathSegment.Arc,\n ang,\n sweep, // angles\n rad,\n rad, // center\n rad,\n rad\n ) // radius\n )\n )\n .add(new go.PathFigure(0, 0))\n .add(new go.PathFigure(2 * rad, 2 * rad));\n } else {\n // make sure this arc always occupies the same circular area of RAD radius\n return new go.Geometry()\n .add(new go.PathFigure(0, 0))\n .add(new go.PathFigure(2 * rad, 2 * rad));\n }\n}\n\n/*\n * Dependencies for Dimension Links\n * Make Point Node\n */\n\n// Return a Point Node (used for Dimension Links)\nfunction makePointNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Position\",\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n )\n );\n}\n\n/*\n * Dynamically appearing parts:\n * Angle Node, Dimension Link\n */\n\n// Return an Angle Node (for each angle ndeeded in the diagram, one angle node is made)\nfunction makeAngleNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n locationSpot: go.Spot.Center,\n locationObjectName: \"SHAPE\",\n selectionAdorned: false,\n },\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n $(\n go.Shape,\n \"Circle\", // placed where walls intersect, is invisible\n { name: \"SHAPE\", height: 0, width: 0 }\n ),\n $(\n go.Shape, // arc\n { strokeWidth: 1.5, fill: null },\n new go.Binding(\"geometry\", \"\", makeArc).ofObject(),\n new go.Binding(\"stroke\", \"sweep\", function (sweep) {\n return sweep % 45 < 1 || sweep % 45 > 44 ? \"dodgerblue\" : \"lightblue\";\n })\n ),\n // Arc label panel\n $(\n go.Panel,\n \"Auto\",\n { name: \"ARCLABEL\" },\n // position the label in the center of the arc\n new go.Binding(\"alignment\", \"sweep\", function (sweep, panel) {\n const rad = Math.min(30, panel.part.data.maxRadius);\n const angle = panel.part.data.angle;\n const cntr = new go.Point(rad, 0).rotate(angle + sweep / 2);\n return new go.Spot(0.5, 0.5, cntr.x, cntr.y);\n }),\n // rectangle containing angle text\n $(\n go.Shape,\n { fill: \"white\" },\n new go.Binding(\"stroke\", \"sweep\", function (sweep) {\n return sweep % 45 < 1 || sweep % 45 > 44 ? \"dodgerblue\" : \"lightblue\";\n })\n ),\n // angle text\n $(\n go.TextBlock,\n { font: \"7pt sans-serif\", margin: 2 },\n new go.Binding(\"text\", \"sweep\", function (sweep) {\n return sweep.toFixed(2) + String.fromCharCode(176);\n })\n )\n )\n );\n}\n\n/**\n * Returns a Dimension Link\n * @param {number} opacity How opaque the link is, 0-1. Optional. Default is 1.\n * @param {string} stroke The color of the link stroke. Optional. Default is gray.\n * @param {number} strokeWidth The width of the link stroke. Optional. Default is 2.\n */\nfunction makeDimensionLink(\n opacity?: number,\n stroke?: string,\n strokeWidth?: number\n) {\n if (opacity === null || opacity === undefined || isNaN(opacity)) {\n opacity = 1;\n }\n if (strokeWidth === null || strokeWidth === undefined || isNaN(strokeWidth)) {\n strokeWidth = 2;\n }\n if (stroke === null || stroke === undefined) {\n stroke = \"gray\";\n }\n const $ = go.GraphObject.make;\n return $(\n go.Link,\n {\n layerName: DiagramLayersEnum[DiagramLayersEnum.Foreground],\n },\n\n // link itself\n $(go.Shape, {\n stroke,\n strokeWidth,\n name: \"SHAPE\",\n opacity,\n }),\n // to arrow shape\n $(go.Shape, {\n toArrow: \"OpenTriangle\",\n stroke,\n strokeWidth,\n opacity,\n }),\n $(\n go.Shape,\n // from arrow shape\n {\n fromArrow: \"BackwardOpenTriangle\",\n stroke,\n strokeWidth,\n opacity,\n }\n ),\n $(\n go.Panel,\n \"Auto\",\n // bind angle of textblock to angle of link -- always make text rightside up and readable\n new go.Binding(\"angle\", \"angle\", function (angle, link) {\n if (angle > 90 && angle < 270) {\n return (angle + 180) % 360;\n }\n return angle;\n }),\n $(go.Shape, \"RoundedRectangle\", {\n fill: \"beige\",\n opacity: 0.8,\n stroke: null,\n }),\n // dimension link text\n $(\n go.TextBlock,\n {\n text: \"sometext\",\n segmentOffset: new go.Point(0, -10),\n font: \"13px sans-serif\",\n // isActionable: true,\n // click: () => alert('123'),\n },\n new go.Binding(\"text\", \"\", function (link) {\n const floorplan = link.diagram;\n const pxDist = link.data.length;\n const unitsDist = convertPixelsToUnits(pxDist, floorplan.model.modelData.unitsConversionFactor).toFixed(2);\n const unitsAbbreviation = floorplan.model.modelData.unitsAbbreviation;\n return unitsDist.toString() + unitsAbbreviation;\n }).ofObject(),\n // default poisiton text above / below dimension link based on angle\n new go.Binding(\"segmentOffset\", \"angle\", function (angle, textblock) {\n return new go.Point(0, 10);\n }).ofObject(),\n // scale font size according to the length of the link\n new go.Binding(\"font\", \"\", function (link) {\n const distance = link.data.length;\n if (distance > 40) {\n return \"13px sans-serif\";\n }\n if (distance <= 40 && distance >= 20) {\n return \"11px sans-serif\";\n } else {\n return \"9px sans-serif\";\n }\n }).ofObject()\n ) // end TextBlock\n )\n );\n}\n\n/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * FLOOR PLANNER CODE: TEMPLATES - FURNITURE\n * GraphObject templates for interactional furniture nodes (and their dependecies) used in the Floor Planner sample\n * Includes Default Node (Furniture), MultiPurpose Node\n */\n\n/*\n * Furniture Node Dependencies:\n * Node Tool Tip, Furniture Resize Adornment Template, Furniture Rotate Adornment Template, Invert Color\n */\n\n// Node Tool Tip\nfunction makeNodeToolTip() {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Auto\",\n $(go.Shape, { fill: \"#FFFFCC\" }),\n $(\n go.TextBlock,\n { margin: 4 },\n new go.Binding(\"text\", \"\", function (text, obj) {\n const data = obj.part.adornedObject.data;\n const name =\n obj.part.adornedObject.category === \"MultiPurposeNode\"\n ? data.text\n : data.caption;\n return obj.name || obj.notes ? `${obj.name ? 'Nom: ' + obj.name : ''}\\r${data.notes ? 'Notes: ' + obj.notes : ''}` : null;\n }).ofObject()\n )\n );\n}\n\n// Furniture Resize Adornment\nfunction makeFurnitureResizeAdornmentTemplate() {\n const $ = go.GraphObject.make;\n function makeHandle(alignment: go.Spot, cursor: string) {\n return $(\n go.Shape,\n {\n alignment,\n cursor,\n figure: \"Rectangle\",\n desiredSize: new go.Size(7, 7),\n fill: \"lightblue\",\n stroke: \"dodgerblue\",\n }\n /*,\n new go.Binding('fill', 'color'),\n new go.Binding('stroke', 'stroke')*/\n );\n }\n\n return $(\n go.Adornment,\n \"Spot\",\n $(go.Placeholder),\n makeHandle(go.Spot.Top, \"n-resize\"),\n makeHandle(go.Spot.TopRight, \"n-resize\"),\n makeHandle(go.Spot.BottomRight, \"se-resize\"),\n makeHandle(go.Spot.Right, \"e-resize\"),\n makeHandle(go.Spot.Bottom, \"s-resize\"),\n makeHandle(go.Spot.BottomLeft, \"sw-resize\"),\n makeHandle(go.Spot.Left, \"w-resize\"),\n makeHandle(go.Spot.TopLeft, \"nw-resize\")\n );\n}\n\n// Furniture Rotate Adornment\nfunction makeFurnitureRotateAdornmentTemplate() {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n $(\n go.Shape,\n \"Circle\",\n {\n cursor: \"pointer\",\n desiredSize: new go.Size(7, 7),\n fill: \"lightblue\",\n stroke: \"dodgerblue\",\n }\n /*new go.Binding('fill', '', function(obj) { return (obj.adornedPart === null) ? '#ffffff' : obj.adornedPart.data.color; }).ofObject(),\n new go.Binding('stroke', '', function(obj) { return (obj.adornedPart === null) ? '#000000' : obj.adornedPart.data.stroke; }).ofObject()*/\n )\n );\n}\n\n/**\n * Return inverted color (in hex) of a given hex code color; used to determine furniture node stroke color\n * @param {string} hex\n * @return {string}\n */\nfunction invertColor(hex: string): string {\n if (hex.indexOf(\"#\") === 0) {\n hex = hex.slice(1);\n }\n // convert 3-digit hex to 6-digits.\n if (hex.length === 3) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n if (hex.length !== 6) {\n throw new Error(\"Invalid HEX color.\");\n }\n // invert color components\n const r = (255 - parseInt(hex.slice(0, 2), 16)).toString(16);\n const g = (255 - parseInt(hex.slice(2, 4), 16)).toString(16);\n const b = (255 - parseInt(hex.slice(4, 6), 16)).toString(16);\n // pad each with zeros and return\n return \"#\" + padZero(r) + padZero(g) + padZero(b);\n}\n\n/**\n * @param {string} str\n * @return {string}\n */\nfunction padZero(str: string): string {\n const len = 2;\n const zeros = new Array(len).join(\"0\");\n return (zeros + str).slice(-len);\n}\n\n/*\n * Furniture Node Templates:\n * Default Node, MultiPurpose Node\n */\n\n// Default Node\nexport function makeDefaultNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n resizable: true,\n rotatable: true,\n toolTip: makeNodeToolTip(),\n resizeAdornmentTemplate: makeFurnitureResizeAdornmentTemplate(),\n rotateAdornmentTemplate: makeFurnitureRotateAdornmentTemplate(),\n contextMenu: makeContextMenu(),\n locationObjectName: \"SHAPE\",\n resizeObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n minSize: new go.Size(5, 5),\n locationSpot: go.Spot.Center,\n selectionAdornmentTemplate: makeTextureSelectionAdornment(null),\n },\n // remember Node location\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n // move selected Node to Foreground layer so it's not obscuerd by non-selected Parts\n new go.Binding(\"layerName\", \"isSelected\", function (s) {\n return s ? \"Foreground\" : DiagramLayersEnum[DiagramLayersEnum.Furnitures];\n }).ofObject(),\n $(\n go.Shape,\n \"Ellipse\",\n {\n name: \"SHAPE\",\n stroke: \"#000000\",\n fill: \"white\",\n },\n new go.Binding(\"geometryString\", \"geo\"),\n new go.Binding(\"figure\", \"shape\").makeTwoWay(),\n new go.Binding(\"width\").makeTwoWay(),\n new go.Binding(\"height\").makeTwoWay(),\n new go.Binding(\"angle\").makeTwoWay(),\n // either use a texture (Pattern Brush) or color to fill the node\n new go.Binding(\"fill\", \"texture\", function (t: string, obj: go.Shape) {\n return updateNodeTexture(obj, t);\n }),\n new go.Binding(\n \"fill\",\n \"usesTexture\",\n function (usesTexture: boolean, obj: go.Shape) {\n const node = obj.part;\n if (node === null) return null;\n const t: string = node.data.texture;\n return updateNodeTexture(obj, t);\n }\n )\n )\n );\n}\n\n// Ground Node\nexport function makeGroundNode() {\n const $ = go.GraphObject.make;\n const nodeElement = $(\n go.Node,\n {\n resizable: false,\n contextMenu: makeContextMenu(),\n },\n // new go.Binding('selectable', \"\", function (_, obj) { return (obj.diagram as Floorplan).groundSelectable }),\n new go.Binding(\"layerName\", \"isSelected\", function (s, obj) {\n return s\n ? DiagramLayersEnum[DiagramLayersEnum.Foreground]\n : DiagramLayersEnum[DiagramLayersEnum.Ground] || \"\";\n }).ofObject(),\n $(\n go.Picture,\n { source: \"assets/images/floor-plan.png\" },\n new go.Binding(\"source\"),\n new go.Binding(\"angle\").makeTwoWay(),\n new go.Binding(\"width\"),\n new go.Binding(\"height\")\n ),\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n )\n );\n return nodeElement;\n}\n\n// Element Node\nexport function makeElementNode(isPalette = false) {\n const $ = go.GraphObject.make;\n\n const nodeElement = $(\n go.Node,\n \"Spot\",\n {\n resizable: false,\n rotatable: true,\n toolTip: makeNodeToolTip(),\n resizeAdornmentTemplate: makeFurnitureResizeAdornmentTemplate(),\n rotateAdornmentTemplate: makeFurnitureRotateAdornmentTemplate(),\n contextMenu: makeContextMenu(),\n locationObjectName: \"SHAPE\",\n resizeObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n minSize: new go.Size(5, 5),\n locationSpot: go.Spot.Center,\n selectionAdornmentTemplate: makeAddNewSelectionAdornment(isPalette), // makeTextureSelectionAdornment(null),\n },\n // remember Node location\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n new go.Binding(\"visible\", \"\", (data) => {\n return data.visible === false ? false : true;\n }\n ),\n // move selected Node to Foreground layer so it's not obscuerd by non-selected Parts\n new go.Binding(\"layerName\", \"isSelected\", function (s, obj) {\n return s\n ? DiagramLayersEnum[DiagramLayersEnum.Foreground]\n : DiagramLayersEnum[DiagramLayersEnum.WallOutlet] || \"\";\n }).ofObject(),\n $(\n go.Panel,\n \"Spot\",\n $(\n go.Shape,\n \"Rectangle\",\n {\n name: \"SHAPE\",\n stroke: \"#000000\",\n fill: \"white\",\n cursor: \"move\",\n },\n new go.Binding(\"fill\", \"fill\"),\n new go.Binding(\"geometryString\", \"geo\"),\n new go.Binding(\"figure\", \"shape\"),\n new go.Binding(\"width\", \"width\", (width, target) => {\n if (isPalette)\n return width;\n const resDpi = findDPI();\n const screenRes = resDpi / (2.54) * 100; // inch to m\n const scale = screenRes * target.diagram.model.modelData.unitsConversionFactor\n const scaleReference = 50 // cinquantieme\n\n return width * scaleReference / scale\n }),\n new go.Binding(\"height\", \"height\", (height, target) => {\n if (isPalette)\n return height;\n const resDpi = findDPI();\n const screenRes = resDpi / (2.54) * 100; // inch to m\n const scale = screenRes * target.diagram.model.modelData.unitsConversionFactor\n const scaleReference = 50 // cinquantieme\n\n return height * scaleReference / scale\n }),\n new go.Binding(\"stroke\", \"\", (obj, target) => {\n if (obj.deviceConnected === true)\n return '#aa0033';\n return obj.color;\n }),\n new go.Binding(\"deviceHeight\", \"\", (obj, target) => {\n if (obj.deviceHeight)\n return obj.deviceHeight;\n\n const folioProps = target.diagram.model.modelData.properties\n const mapping = (SymbolTypeHeightMapping as any)[obj.type];\n if (mapping) {\n obj.deviceHeight = folioProps[mapping];\n }\n return obj.deviceHeight\n }),\n new go.Binding(\"angle\").makeTwoWay(),\n\n\n ),\n new go.Binding(\"itemArray\", \"items\"),\n $(\n go.Shape, // the \"A\" port\n {\n fill: \"transparent\",\n stroke: \"transparent\",\n width: 6,\n height: 6,\n portId: \"logical\",\n toSpot: go.Spot.Center,\n toLinkable: true,\n fromLinkable: true,\n // toMaxLinks: 1,\n // fromMaxLinks: 1,\n },\n { alignment: new go.Spot(0.5, 0.5) }\n )\n ),\n $(\n go.Panel,\n \"Auto\",\n {\n alignment: new go.Spot(0.5, 1.5),\n _isNodeLabel: true,\n cursor: \"move\",\n },\n new go.Binding(\"alignment\", \"labelAlignment\", go.Spot.parse).makeTwoWay(go.Spot.stringify),\n new go.Binding(\n \"visible\",\n \"showName\",\n (showName) => showName // !isPalette && \n ),\n\n $(\n go.TextBlock,\n {\n margin: 5,\n wrap: go.TextBlock.WrapFit,\n textAlign: \"left\",\n editable: false,\n isMultiline: false,\n stroke: \"black\",\n font: \"9pt sans-serif\",\n },\n new go.Binding(\"text\", isPalette ? \"symbolName\" : \"name\"),\n new go.Binding(\"font\", 'textSize', (textSize) => {\n return `${textSize || 9}pt sans-serif`\n }).ofModel()\n )\n )\n );\n // nodeElement.add(makeNodeLabel());\n return nodeElement;\n}\n\n// Text Node\nexport function makeTextNode(isPalette = false) {\n const $ = go.GraphObject.make;\n const nodeElement = $(\n go.Part,\n \"Vertical\",\n {\n resizable: false,\n rotatable: true,\n toolTip: makeNodeToolTip(),\n // resizeAdornmentTemplate: makeFurnitureResizeAdornmentTemplate(),\n rotateAdornmentTemplate: makeFurnitureRotateAdornmentTemplate(),\n locationObjectName: \"SHAPE\",\n resizeObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n minSize: new go.Size(5, 5),\n locationSpot: go.Spot.Center,\n selectionAdornmentTemplate: makeAddNewSelectionAdornment(true), // makeTextureSelectionAdornment(null),\n },\n // remember Node location\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n // move selected Node to Foreground layer so it's not obscuerd by non-selected Parts\n new go.Binding(\"layerName\", \"isSelected\", function (s, obj) {\n return s\n ? DiagramLayersEnum[DiagramLayersEnum.Foreground]\n : DiagramLayersEnum[DiagramLayersEnum.Default] || \"\";\n }).ofObject(),\n $(go.TextBlock,\n { text: \"Mon texte\", font: \"bold 14pt serif\" },\n new go.Binding(\"text\", \"name\"),\n new go.Binding(\"font\", \"\", (obj, target) => {\n return `${obj.fontWeight} ${obj.fontSize}pt ${obj.fontFamily}`;\n }),\n // new go.Binding(\"stroke\", \"color\"),\n ),\n new go.Binding(\"geometryString\", \"geo\"),\n new go.Binding(\"angle\").makeTwoWay()\n\n );\n // nodeElement.add(makeNodeLabel());\n return nodeElement;\n}\n\n// Squid Node\nexport function makeSquidNode() {\n\n return makeElementNode();\n}\n\nexport function makeAddNewSelectionAdornment(isPalette = false) {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Spot\",\n $(\n go.Panel,\n \"Auto\",\n $(go.Placeholder) // a Placeholder sizes itself to the selected Node\n ),\n // the button to create a \"next\" node, at the top-right corner\n $(\n \"Button\",\n {\n alignment: new go.Spot(1, 0, 3, -3), //go.Spot.TopRight,\n mouseOver: (e) => {\n e.diagram.toolManager.mouseDownTools.elt(1).isEnabled = true;\n },\n mouseLeave: (e) => {\n const connectorTool = e.diagram.toolManager.mouseDownTools.elt(1);\n if (connectorTool.isEnabled && !connectorTool.isActive)\n connectorTool.isEnabled = false;\n },\n },\n $(go.Shape, \"PlusLine\", { width: 6, height: 6 }),\n new go.Binding(\n \"visible\",\n \"\",\n () => !isPalette\n ),\n ) // end button\n );\n}\n\n// MultiPurpose Node\nexport function makeMultiPurposeNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n contextMenu: makeContextMenu(),\n toolTip: makeNodeToolTip(),\n locationSpot: go.Spot.Center,\n resizeAdornmentTemplate: makeFurnitureResizeAdornmentTemplate(),\n rotateAdornmentTemplate: makeFurnitureRotateAdornmentTemplate(),\n selectionAdornmentTemplate: makeTextureSelectionAdornment(null),\n locationObjectName: \"SHAPE\",\n resizable: true,\n rotatable: true,\n resizeObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n minSize: new go.Size(5, 5),\n },\n // remember location, angle, height, and width of the node\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n // move a selected part into the Foreground layer so it's not obscuerd by non-selected Parts\n new go.Binding(\"layerName\", \"isSelected\", function (s) {\n return s ? \"Foreground\" : DiagramLayersEnum[DiagramLayersEnum.Furnitures];\n }).ofObject(),\n $(\n go.Shape,\n { strokeWidth: 1, name: \"SHAPE\", fill: \"rgba(128, 128, 128, 0.5)\" },\n new go.Binding(\"angle\").makeTwoWay(),\n new go.Binding(\"width\").makeTwoWay(),\n new go.Binding(\"height\").makeTwoWay(),\n // either use a texture (Pattern Brush) or color to fill the node\n new go.Binding(\"fill\", \"texture\", function (t: string, obj: go.Shape) {\n return updateNodeTexture(obj, t);\n }),\n new go.Binding(\n \"fill\",\n \"usesTexture\",\n function (usesTexture: boolean, obj: go.Shape) {\n const node = obj.part;\n if (node === null) return null;\n const t: string = node.data.texture;\n return updateNodeTexture(obj, t);\n }\n ),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n return s\n ? go.Brush.lightenBy(obj.stroke, 0.5)\n : invertColor(obj.part.data.color);\n }).ofObject()\n ),\n $(\n go.Panel,\n \"Auto\",\n new go.Binding(\"visible\", \"showLabel\"),\n $(go.Shape, \"RoundedRectangle\", {\n fill: \"beige\",\n opacity: 0.5,\n stroke: null,\n }),\n $(\n go.TextBlock,\n {\n margin: 5,\n wrap: go.TextBlock.WrapFit,\n textAlign: \"center\",\n editable: true,\n isMultiline: false,\n stroke: \"black\",\n font: \"10pt sans-serif\",\n },\n new go.Binding(\"text\").makeTwoWay(),\n new go.Binding(\"angle\", \"angle\").makeTwoWay(),\n new go.Binding(\"font\", \"height\", function (height) {\n if (height > 25) {\n return \"10pt sans-serif\";\n }\n if (height < 25 && height > 15) {\n return \"8pt sans-serif\";\n } else {\n return \"6pt sans-serif\";\n }\n })\n )\n )\n );\n}\n\n/**\n * Update the texture of either a multipurpose node or default furniture node based on node data\n * The obj is the Shape element of the node who's 'fill' will be updated\n * This is called in binding conversion functions on 'fill' for Multipurpose nodes and default furniture nodes\n * @param {go.Shape} obj\n * @param {string} t The texture string, or ''\n */\nfunction updateNodeTexture(obj: go.Shape, t: string) {\n const node: go.Part | null = obj.part;\n if (node === null) return \"\";\n if (node.data.usesTexture !== undefined && node.data.usesTexture) {\n if (t === \"\") {\n return makeTextureBrush(null);\n } else {\n const str =\n t.indexOf(\"images/textures\") === -1 ? \"images/textures/\" + t : t;\n return makeTextureBrush(str);\n }\n } else {\n if (node.data.color !== undefined) {\n return node.data.color;\n } else {\n return \"white\";\n }\n }\n}\n\n/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * FLOOR PLANNER CODE: TEMPLATES - WALLS\n * GraphObject templates for Wall Groups, Wall Part Nodes (and their dependecies) used in the Floor Planner sample\n * Includes Wall Group, Palette Wall Node, Window Node, Door Node\n */\n\n/*\n * Wall Group Dependencies:\n * Snap Walls, Find Closest Loc on Wall, Add Wall Part, Wall Part Drag Over, Wall Part Drag Away\n */\n\n/*\n* Drag computation function to snap walls to the grid properly while dragging\n* @param {Node} part A reference to dragged Part\n* @param {Point} pt The Point describing the proposed location\n* @param {Point} gridPt Snapped location\n\nvar snapWalls = function (part, pt, gridPt) {\n var floorplan = part.diagram;\n floorplan.updateWallDimensions();\n //floorplan.updateWallAngles();\n floorplan.updateWall(part);\n var grid = part.diagram.grid;\n var sPt = part.data.startpoint.copy();\n var ePt = part.data.endpoint.copy();\n var dx = pt.x - part.location.x;\n var dy = pt.y - part.location.y;\n var newSpt = sPt.offset(dx, dy);\n var newEpt = ePt.offset(dx, dy);\n if (floorplan.toolManager.draggingTool.isGridSnapEnabled) {\n newSpt = newSpt.snapToGridPoint(grid.gridOrigin, grid.gridCellSize);\n newEpt = newEpt.snapToGridPoint(grid.gridOrigin, grid.gridCellSize);\n }\n floorplan.model.setDataProperty(part.data, \"startpoint\", newSpt);\n floorplan.model.setDataProperty(part.data, \"endpoint\", newEpt);\n return new go.Point((newSpt.x + newEpt.x) / 2, (newSpt.y + newEpt.y) / 2);\n}*/\n\n// MouseDrop event for wall groups; if a door or window is dropped on a wall, add it to the wall group\n// Do not allow dropping wallParts that would extend beyond wall endpoints or intrude into another wallPart\nconst addWallPart = function (e: go.InputEvent, wall: go.GraphObject): void {\n if (!(wall instanceof go.Group)) return;\n if (wall.data.isDivider) return;\n const floorplan: Floorplan = e.diagram as Floorplan;\n const wallPart = floorplan.selection.first();\n if (\n wallPart &&\n (wallPart.category === \"WindowNode\" || wallPart.category === \"DoorNode\") &&\n wallPart.containingGroup === null\n ) {\n const newLoc = floorplan.findClosestLocOnWall(wall, wallPart);\n if (newLoc !== null) {\n const shape: go.Shape = wall.findObject(\"SHAPE\") as go.Shape;\n shape.stroke = \"black\";\n floorplan.model.setDataProperty(wallPart.data, \"group\", wall.data.key);\n wallPart.location = newLoc.projectOntoLineSegmentPoint(\n wall.data.startpoint,\n wall.data.endpoint\n );\n wallPart.angle = wall.data.startpoint.directionPoint(wall.data.endpoint);\n if (wallPart.category === \"WindowNode\") {\n floorplan.model.setDataProperty(\n wallPart.data,\n \"height\",\n wall.data.thickness\n );\n }\n if (wallPart.category === \"DoorNode\") {\n floorplan.model.setDataProperty(\n wallPart.data,\n \"doorOpeningHeight\",\n wall.data.thickness\n );\n }\n } else {\n floorplan.remove(wallPart);\n alert(\"There's not enough room on the wall!\");\n return;\n }\n }\n floorplan.updateWallDimensions();\n};\n\n// MouseDragEnter event for walls; if a door or window is dragged over a wall, highlight the wall and change its angle\nconst wallPartDragOver = function (\n e: go.InputEvent,\n wall: go.GraphObject\n): void {\n if (!(wall instanceof go.Group)) return;\n if (wall.data.isDivider) return;\n const floorplan = e.diagram;\n let draggingParts = floorplan.toolManager.draggingTool.draggedParts;\n if (draggingParts === null) {\n draggingParts = floorplan.toolManager.draggingTool.copiedParts;\n }\n if (draggingParts !== null) {\n draggingParts.iterator.each(function (\n kvp: go.KeyValuePair\n ) {\n const part: go.Part = kvp.key;\n if (\n (part.category === \"WindowNode\" || part.category === \"DoorNode\") &&\n part.containingGroup === null\n ) {\n const shape: go.Shape = wall.findObject(\"SHAPE\") as go.Shape;\n shape.stroke = \"lightblue\";\n part.angle = wall.rotateObject.angle;\n }\n });\n }\n};\n\n// MouseDragLeave event for walls; if a wall part is dragged past a wall, unhighlight the wall and change back the wall part's angle to 0\nconst wallPartDragAway = function (e: go.InputEvent, wall: go.GraphObject) {\n if (!(wall instanceof go.Group)) return;\n const floorplan = e.diagram;\n const shape = wall.findObject(\"SHAPE\") as go.Shape;\n if (shape !== null) {\n shape.stroke = \"black\";\n let draggingParts = floorplan.toolManager.draggingTool.draggedParts;\n if (draggingParts === null) {\n draggingParts = floorplan.toolManager.draggingTool.copiedParts;\n }\n if (draggingParts !== null) {\n draggingParts.iterator.each(function (\n kvp: go.KeyValuePair\n ) {\n const part = kvp.key;\n if (\n (part.category === \"WindowNode\" || part.category === \"DoorNode\") &&\n part.containingGroup === null\n ) {\n part.angle = 0;\n }\n });\n }\n }\n};\n\n/*\n * Wall Group Template\n */\n\n// Wall Group\nfunction makeWallGroup() {\n const $ = go.GraphObject.make;\n return $(\n go.Group,\n \"Spot\",\n {\n contextMenu: makeContextMenu(),\n toolTip: makeGroupToolTip(),\n layerName: DiagramLayersEnum[DiagramLayersEnum.Walls],\n selectionObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n locationSpot: go.Spot.TopLeft,\n reshapable: true,\n minSize: new go.Size(1, 1),\n // movable: false,\n selectionAdorned: false,\n mouseDrop: addWallPart,\n mouseDragEnter: wallPartDragOver,\n mouseDragLeave: wallPartDragAway,\n dragComputation(part: go.Part, pt: go.Point, gridPt: go.Point) {\n let curLoc = part.location;\n const origLoc = part.location.copy();\n const fp: Floorplan = part.diagram as Floorplan;\n const dt = fp.toolManager.draggingTool;\n // only allow drag if only one wall is selected at a time\n let wallCount = 0;\n fp.selection.iterator.each(function (p: go.Part) {\n if (p.category === \"WallGroup\") {\n wallCount++;\n if (p.data.key !== part.data.key) {\n // p.isSelected = false;\n }\n }\n if (p.category === \"RoomNode\") {\n p.isSelected = false;\n }\n });\n\n if (wallCount > 1) {\n return curLoc;\n }\n\n const gs = fp.grid.gridCellSize;\n gridPt.x -= gs.width / 2;\n gridPt.y -= gs.height / 2;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n\n // Generate a map of all walls connected to this wall's endpoints (and at which endpoints those walls are connected at/to)\n const connectedWallsMap = new go.Map();\n const wallsAtStartpoint = wrt.getAllWallsAtIntersection(\n part.data.startpoint,\n true\n );\n wallsAtStartpoint.iterator.each(function (w: go.Group) {\n if (w.data.key !== part.data.key) {\n if (\n wrt.pointsApproximatelyEqual(\n w.data.startpoint,\n part.data.startpoint\n )\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"startpoint\",\n connectedFrom: \"startpoint\",\n });\n } else if (\n wrt.pointsApproximatelyEqual(\n w.data.endpoint,\n part.data.startpoint\n )\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"startpoint\",\n connectedFrom: \"endpoint\",\n });\n }\n }\n });\n\n const wallsAtEndpoint = wrt.getAllWallsAtIntersection(\n part.data.endpoint,\n true\n );\n wallsAtEndpoint.iterator.each(function (w: go.Group) {\n if (w.data.key !== part.data.key) {\n if (\n wrt.pointsApproximatelyEqual(\n w.data.startpoint,\n part.data.endpoint\n )\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"endpoint\",\n connectedFrom: \"startpoint\",\n });\n } else if (\n wrt.pointsApproximatelyEqual(w.data.endpoint, part.data.endpoint)\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"endpoint\",\n connectedFrom: \"endpoint\",\n });\n }\n }\n });\n\n const ptToUse = fp.toolManager.draggingTool.isGridSnapEnabled\n ? gridPt\n : pt;\n const wall = part as go.Group;\n const changedWalls = new go.Set();\n moveAndUpdate(ptToUse);\n /**\n * Helper function -- actually moves wall / connected walls, based on a given point to use as reference\n * @param pointToUse\n */\n function moveAndUpdate(pointToUse: go.Point) {\n // Offset this wall's startpoint and endpoints\n const dx = pointToUse.x - curLoc.x;\n const dy = pointToUse.y - curLoc.y;\n fp.model.set(\n part.data,\n \"startpoint\",\n new go.Point(\n part.data.startpoint.x + dx,\n part.data.startpoint.y + dy\n )\n );\n fp.model.set(\n part.data,\n \"endpoint\",\n new go.Point(part.data.endpoint.x + dx, part.data.endpoint.y + dy)\n );\n wrt.performMiteringOnWall(wall);\n\n // Reset each connected wall's connected endpoints to the proper new start or endpoint of the dragging wall\n connectedWallsMap.iterator.each(function (\n kvp: go.KeyValuePair\n ) {\n const wKey = kvp.key;\n const d = kvp.value;\n const w = fp.findNodeForKey(wKey) as go.Group;\n if (w != null && w.data.key !== wall.data.key) {\n fp.model.set(w.data, d.connectedFrom, part.data[d.connectedTo]);\n wrt.performMiteringOnWall(w);\n }\n });\n\n // Miter, which will also update the walls\n wrt.performMiteringAtPoint(wall.data.startpoint, true);\n wrt.performMiteringAtPoint(wall.data.endpoint, true);\n curLoc = wall.location;\n\n connectedWallsMap.iterator.each(function (\n kvp: go.KeyValuePair\n ) {\n const w = fp.findNodeForKey(kvp.key) as go.Group;\n changedWalls.add(w);\n });\n changedWalls.add(wall);\n\n fp.updateWallDimensions(changedWalls);\n fp.updateWallAngles();\n }\n\n // check if selected wall is now overlapping some wall it shouldn't be\n const allWalls = fp.findNodesByExample({ category: \"WallGroup\" });\n // let cannotMove = false;\n allWalls.iterator.each(function (n: go.Node) {\n const w = n as go.Group;\n if (\n wall &&\n wall.data.key !== w.data.key &&\n fp.getWallsIntersection(wall, w)\n ) {\n if (!changedWalls.contains(w)) {\n moveAndUpdate(origLoc);\n return origLoc;\n }\n }\n return undefined\n });\n\n /*\n const changedWalls = new go.Set();\n connectedWallsMap.iterator.each(function(kvp: go.KeyValuePair) {\n const w = fp.findNodeForKey(kvp.key) as go.Group;\n changedWalls.add(w);\n });\n changedWalls.add(wall);\n changedWalls.iterator.each(function(w) {\n wrt.performMiteringOnWall(w);\n });*/\n\n // return wall.location; // Wall location is updated in updateWall() function based on wall endpoints\n // if (!cannotMove) {\n return wall.location;\n // }\n // return wall.location;\n },\n copyable: false,\n },\n $(\n go.Shape,\n {\n name: \"SHAPE\",\n fill: \"lightgray\",\n stroke: \"black\",\n strokeWidth: 1,\n },\n new go.Binding(\"fill\", \"color\"),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n if (obj.part.containingGroup != null) {\n const group = obj.part.containingGroup;\n if (s) {\n group.data.isSelected = true;\n }\n }\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject()\n )\n );\n}\n\n// Scale Group\nfunction makeScaleGroup() {\n const $ = go.GraphObject.make;\n return $(\n go.Group,\n \"Spot\",\n {\n // contextMenu: makeContextMenu(),\n // toolTip: makeGroupToolTip(),\n layerName: DiagramLayersEnum[DiagramLayersEnum.Scale],\n selectionObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n locationSpot: go.Spot.TopLeft,\n reshapable: true,\n minSize: new go.Size(1, 1),\n // movable: false,\n selectionAdorned: false,\n mouseDrop: addWallPart,\n mouseDragEnter: wallPartDragOver,\n mouseDragLeave: wallPartDragAway,\n dragComputation(part: go.Part, pt: go.Point, gridPt: go.Point) {\n let curLoc = part.location;\n const origLoc = part.location.copy();\n const fp: Floorplan = part.diagram as Floorplan;\n const dt = fp.toolManager.draggingTool;\n\n const gs = fp.grid.gridCellSize;\n gridPt.x -= gs.width / 2;\n gridPt.y -= gs.height / 2;\n const wrt: WallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n\n // Generate a map of all walls connected to this wall's endpoints (and at which endpoints those walls are connected at/to)\n const connectedWallsMap = new go.Map();\n const wallsAtStartpoint = wrt.getAllWallsAtIntersection(\n part.data.startpoint,\n true\n );\n wallsAtStartpoint.iterator.each(function (w: go.Group) {\n if (w.data.key !== part.data.key) {\n if (\n wrt.pointsApproximatelyEqual(\n w.data.startpoint,\n part.data.startpoint\n )\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"startpoint\",\n connectedFrom: \"startpoint\",\n });\n } else if (\n wrt.pointsApproximatelyEqual(\n w.data.endpoint,\n part.data.startpoint\n )\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"startpoint\",\n connectedFrom: \"endpoint\",\n });\n }\n }\n });\n\n const wallsAtEndpoint = wrt.getAllWallsAtIntersection(\n part.data.endpoint,\n true\n );\n wallsAtEndpoint.iterator.each(function (w: go.Group) {\n if (w.data.key !== part.data.key) {\n if (\n wrt.pointsApproximatelyEqual(\n w.data.startpoint,\n part.data.endpoint\n )\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"endpoint\",\n connectedFrom: \"startpoint\",\n });\n } else if (\n wrt.pointsApproximatelyEqual(w.data.endpoint, part.data.endpoint)\n ) {\n connectedWallsMap.add(w.data.key, {\n connectedTo: \"endpoint\",\n connectedFrom: \"endpoint\",\n });\n }\n }\n });\n\n const ptToUse = fp.toolManager.draggingTool.isGridSnapEnabled\n ? gridPt\n : pt;\n const wall = part as go.Group;\n const changedWalls = new go.Set();\n moveAndUpdate(ptToUse);\n /**\n * Helper function -- actually moves wall / connected walls, based on a given point to use as reference\n * @param pointToUse\n */\n function moveAndUpdate(pointToUse: go.Point) {\n // Offset this wall's startpoint and endpoints\n const dx = pointToUse.x - curLoc.x;\n const dy = pointToUse.y - curLoc.y;\n fp.model.set(\n part.data,\n \"startpoint\",\n new go.Point(\n part.data.startpoint.x + dx,\n part.data.startpoint.y + dy\n )\n );\n fp.model.set(\n part.data,\n \"endpoint\",\n new go.Point(part.data.endpoint.x + dx, part.data.endpoint.y + dy)\n );\n wrt.performMiteringOnWall(wall);\n\n // Reset each connected wall's connected endpoints to the proper new start or endpoint of the dragging wall\n connectedWallsMap.iterator.each(function (\n kvp: go.KeyValuePair\n ) {\n const wKey = kvp.key;\n const d = kvp.value;\n const w = fp.findNodeForKey(wKey) as go.Group;\n if (w != null && w.data.key !== wall.data.key) {\n fp.model.set(w.data, d.connectedFrom, part.data[d.connectedTo]);\n wrt.performMiteringOnWall(w);\n }\n });\n\n // Miter, which will also update the walls\n wrt.performMiteringAtPoint(wall.data.startpoint, true);\n wrt.performMiteringAtPoint(wall.data.endpoint, true);\n curLoc = wall.location;\n\n connectedWallsMap.iterator.each(function (\n kvp: go.KeyValuePair\n ) {\n const w = fp.findNodeForKey(kvp.key) as go.Group;\n changedWalls.add(w);\n });\n changedWalls.add(wall);\n\n fp.updateWallDimensions(changedWalls);\n fp.updateWallAngles();\n }\n\n // check if selected wall is now overlapping some wall it shouldn't be\n const allWalls = fp.findNodesByExample({ category: \"WallGroup\" });\n // let cannotMove = false;\n allWalls.iterator.each(function (n: go.Node) {\n const w = n as go.Group;\n if (\n wall &&\n wall.data.key !== w.data.key &&\n fp.getWallsIntersection(wall, w)\n ) {\n if (!changedWalls.contains(w)) {\n moveAndUpdate(origLoc);\n return origLoc;\n }\n }\n return undefined\n });\n\n /*\n const changedWalls = new go.Set();\n connectedWallsMap.iterator.each(function(kvp: go.KeyValuePair) {\n const w = fp.findNodeForKey(kvp.key) as go.Group;\n changedWalls.add(w);\n });\n changedWalls.add(wall);\n changedWalls.iterator.each(function(w) {\n wrt.performMiteringOnWall(w);\n });*/\n\n // return wall.location; // Wall location is updated in updateWall() function based on wall endpoints\n // if (!cannotMove) {\n return wall.location;\n // }\n // return wall.location;\n },\n\n copyable: false,\n },\n $(go.Panel,\n 'Position',\n $(go.Shape,\n {\n name: \"SHAPE\",\n // fill: \"lightgray\",\n // stroke: \"black\",\n strokeWidth: WallThicknessEnum.scale,\n },\n new go.Binding(\"fill\", \"color\"),\n new go.Binding(\"stroke\", \"color\"),\n\n ),\n $(go.TextBlock,\n {\n text: \"sometext\",\n segmentOffset: new go.Point(0.5, 0),\n isUnderline: true,\n // editable:true,\n // segmentOffset: new go.Point(0, -10),\n font: \"13px sans-serif\",\n // isActionable: true,\n // click: () => alert('123'),\n },\n new go.Binding(\"text\", \"\", function (link) {\n return link.data.scaleLength || \"\";\n // const floorplan = link.diagram;\n // const pxDist = Math.sqrt(\n // ((link.data.startpoint.x - link.data.endpoint.x) * (link.data.startpoint.x - link.data.endpoint.x)) +\n // ((link.data.startpoint.y - link.data.endpoint.y) * (link.data.startpoint.y - link.data.endpoint.y))\n // );\n // const unitsDist = convertPixelsToUnits(pxDist, floorplan.model.modelData.unitsConversionFactor).toFixed(2);\n // // link.length = unitsDist;\n // const unitsAbbreviation = floorplan.model.modelData.unitsAbbreviation;\n // const val = unitsDist.toString() + unitsAbbreviation;\n // return val;\n }).ofObject(),\n new go.Binding(\"position\", \"\", function (link) {\n return new go.Point(\n Math.abs(link.startpoint.x - link.endpoint.x) / 2,\n Math.abs(link.startpoint.y - link.endpoint.y) / 2\n );\n }),\n ),\n ),\n\n\n\n // default poisiton text above / below dimension link based on angle\n\n // scale font size according to the length of the link\n // new go.Binding(\"font\", \"\", function (link) {\n // const distance = link.data.length;\n // if (distance > 40) {\n // return \"13px sans-serif\";\n // }\n // if (distance <= 40 && distance >= 20) {\n // return \"11px sans-serif\";\n // } else {\n // return \"9px sans-serif\";\n // }\n // }).ofObject()\n // ) // end TextBlock\n );\n}\n\n// Room Node\n\n/**\n * Default texture brush\n * @param {string} src The relative path to the texture image\n * @return {go.Brush} A pattern brush\n */\nfunction makeTextureBrush(src: string | null): go.Brush {\n const $ = go.GraphObject.make;\n if (src === null || src === undefined) {\n src = \"images/textures/floor1.jpg\";\n }\n const textureImage = new Image();\n textureImage.src = src;\n return $(go.Brush, \"Pattern\", { pattern: textureImage });\n}\n\n/**\n * Texture selection adornment\n * Clickable buttons to change a Node's texture type\n * @param textures An array of strings that are picture filenames in the /textures directory of the floorplanner project\n * If this is null, this function will check the Node's 'textures' data property for an analogous Array\n */\nfunction makeTextureSelectionAdornment(textures: Array | null) {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Spot\",\n { locationObjectName: \"BIGPANEL\" },\n new go.Binding(\"location\", \"\", function (obj) {\n if (obj.data.category === \"RoomNode\") {\n const roomLabel: go.Panel = obj.adornedPart.findObject(\"ROOM_LABEL\");\n const loc: go.Point = roomLabel.getDocumentPoint(go.Spot.BottomLeft);\n return loc;\n } else {\n return obj.adornedPart.getDocumentPoint(go.Spot.BottomLeft);\n }\n }).ofObject(),\n new go.Binding(\"visible\", \"\", function (adorn: go.Adornment) {\n const node: go.Node = adorn.adornedPart as go.Node;\n if (node.category !== \"RoomNode\") {\n return node.data.usesTexture;\n }\n return true;\n }).ofObject(),\n $(go.Placeholder),\n $(\n go.Panel,\n \"Horizontal\",\n { name: \"BIGPANEL\" },\n // button to show or hide texture choices\n // Room Nodes use a button in their template, so this one is always invisible for room nodes\n $(\n \"Button\",\n {\n desiredSize: new go.Size(15, 15),\n click(e: go.InputEvent, obj: go.GraphObject) {\n const adorn: go.Adornment = obj.part as go.Adornment;\n const node: go.Node = adorn.adornedPart as go.Node;\n if (node !== null) {\n const fp: Floorplan = node.diagram as Floorplan;\n fp.model.setDataProperty(\n node.data,\n \"showTextureOptions\",\n !node.data.showTextureOptions\n );\n node.updateAdornments();\n }\n },\n },\n new go.Binding(\"visible\", \"\", function (adorn: go.Adornment) {\n const node: go.Node = adorn.adornedPart as go.Node;\n if (\n node !== null &&\n (node.diagram instanceof go.Palette || node.category === \"RoomNode\")\n ) {\n return false;\n }\n return true;\n }).ofObject(),\n $(\n go.Shape,\n \"TriangleLeft\",\n { desiredSize: new go.Size(10, 10), name: \"BUTTONSHAPE\" },\n new go.Binding(\n \"figure\",\n \"showTextureOptions\",\n function (sto: boolean) {\n return sto ? \"TriangleLeft\" : \"TriangleRight\";\n }\n )\n )\n ),\n $(\n go.Panel,\n \"Horizontal\",\n {\n name: \"PANEL\",\n itemArray: textures,\n itemTemplate: $(\n \"Button\",\n {\n desiredSize: new go.Size(30, 30),\n click(e: go.InputEvent, button: go.GraphObject) {\n if (button.part === null || !(button instanceof go.Panel))\n return;\n const adorn: go.Adornment = button.part as go.Adornment;\n const node: go.Node = adorn.adornedPart as go.Node;\n const imagePicture = button.findObject(\n \"BUTTON_IMAGE\"\n ) as go.Picture;\n const imageSource = imagePicture.source;\n if (node.category === \"RoomNode\") {\n e.diagram.model.setDataProperty(\n node.data,\n \"floorImage\",\n imageSource\n );\n } else {\n e.diagram.model.setDataProperty(\n node.data,\n \"texture\",\n imageSource\n );\n }\n },\n },\n $(\n go.Picture,\n { name: \"BUTTON_IMAGE\" },\n new go.Binding(\"source\", \"\", function (str: any, b: any) {\n if (typeof str !== \"string\") return \"\";\n return \"./images/textures/\" + str;\n })\n )\n ),\n },\n new go.Binding(\"visible\", \"\", function (a: go.Adornment) {\n const node: go.Node = a.adornedPart as go.Node;\n if (node.diagram instanceof go.Palette) return false;\n if (node.category === \"RoomNode\") {\n return node.data.showFlooringOptions;\n } else {\n const button: go.Shape = a.findObject(\"BUTTONSHAPE\") as go.Shape;\n if (button !== null) {\n return button.figure === \"TriangleLeft\";\n }\n }\n }).ofObject(),\n new go.Binding(\"itemArray\", \"\", function (data) {\n if (data.textures === undefined || data.textures === null) {\n return textures;\n } else {\n return data.textures;\n }\n })\n ) // end horizontal panel PANEL\n ) // end BIGPANEL\n );\n}\n\nexport function makeRoomNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n contextMenu: makeContextMenu(),\n // toolTip: makeGroupToolTip(),\n selectionObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n locationSpot: go.Spot.TopLeft,\n reshapable: true,\n copyable: false,\n minSize: new go.Size(1, 1),\n movable: false,\n // selectionAdornmentTemplate: makeTextureSelectionAdornment([\n // \"floor1.jpg\",\n // \"floor2.jpg\",\n // \"floor3.jpg\",\n // \"floor4.jpg\",\n // \"floor5.jpg\",\n // \"floor6.jpg\",\n // \"floor7.jpg\",\n // ]),\n locationObjectName: \"SHAPE\",\n layerName: DiagramLayersEnum[DiagramLayersEnum.Room],\n },\n new go.Binding(\"location\", \"isSelected\", function (s, node) {\n const loc: go.Point = node.data.loc;\n if (s) {\n const sw = node.findObject(\"SHAPE\").strokeWidth;\n const newPt: go.Point = new go.Point(loc.x - sw * 2, loc.y - sw * 2);\n return newPt;\n } else {\n return loc !== undefined ? loc : node.location;\n }\n }).ofObject(),\n $(\n go.Shape, // this geometry is dependent on the walls this room is bound by, defined in its data\n {\n name: \"SHAPE\",\n // fill: \"white\", //makeTextureBrush(null),\n stroke: \"black\",\n strokeWidth: 1,\n },\n new go.Binding(\"fill\", \"fill\"),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n if (obj.part.containingGroup != null) {\n const group = obj.part.containingGroup;\n if (s) {\n group.data.isSelected = true;\n }\n }\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject(),\n new go.Binding(\"strokeWidth\", \"isSelected\", function (s, obj) {\n return s ? 5 : 1;\n }).ofObject()\n // new go.Binding(\"fill\", \"floorImage\", function (src) {\n // return makeTextureBrush(src);\n // })\n ),\n $(\n go.Panel,\n \"Horizontal\",\n {\n cursor: \"move\",\n name: \"ROOM_LABEL\",\n _isNodeLabel: true,\n alignment: new go.Spot(0.5, 0.5),\n },\n // new go.Binding(\"alignment\", \"labelAlignment\"),\n new go.Binding(\"alignment\", \"labelAlignment\", go.Spot.parse).makeTwoWay(go.Spot.stringify),\n $(\n go.Panel,\n \"Auto\",\n new go.Binding(\"visible\", \"showLabel\"),\n $(\n go.Shape,\n \"RoundedRectangle\",\n {\n fill: \"beige\",\n opacity: 0.5,\n stroke: null,\n strokeWidth: 3,\n name: \"ROOM_LABEL_SHAPE\",\n },\n new go.Binding(\"stroke\", \"isSelected\", function (is) {\n return is ? \"dodgerblue\" : null;\n }).ofObject()\n ),\n $(\n go.Panel,\n \"Vertical\",\n $(\n go.TextBlock,\n \"Nom de la pièce\",\n {\n editable: true,\n cursor: \"text\",\n font: \"normal normal bold 13px sans-serif\",\n },\n new go.Binding(\"text\", \"name\").makeTwoWay()\n ),\n $(\n go.TextBlock,\n \"Room Size\",\n { name: \"ROOM_LABEL_SIZE\" },\n new go.Binding(\"text\", \"\", function (room) {\n const fp: Floorplan = room.diagram as Floorplan;\n const area = fp.getRoomArea(room);\n // convert raw area to units (gotta do it twice, because its units squared)\n const adjustedArea: string = convertPixelsToUnits(\n convertPixelsToUnits(area, fp.model.modelData.unitsConversionFactor),\n fp.model.modelData.unitsConversionFactor\n ).toFixed(2);\n return (\n adjustedArea +\n fp.model.modelData.unitsAbbreviation +\n String.fromCharCode(178)\n );\n }).ofObject()\n )\n )\n ) // end Auto Panel\n // $(\n // \"Button\",\n // {\n // desiredSize: new go.Size(15, 15),\n // click(e: go.InputEvent, button: go.GraphObject) {\n // const r: go.Node = button.part as go.Node;\n // if (r === null) return;\n // e.diagram.model.setDataProperty(\n // r.data,\n // \"showFlooringOptions\",\n // !r.data.showFlooringOptions\n // );\n // const fp: Floorplan = e.diagram as Floorplan;\n // fp.select(r); // force Room to reset location\n // },\n // toolTip: $(\n // go.Adornment,\n // \"Auto\",\n // $(go.Shape, { fill: \"#FFFFCC\" }),\n // $(go.TextBlock, { margin: 4, text: \"Show/ hide floor types\" })\n // ),\n // },\n // new go.Binding(\"visible\", \"isSelected\").ofObject(),\n // $(\n // go.Shape,\n // \"TriangleDown\",\n // { desiredSize: new go.Size(10, 10) },\n // new go.Binding(\"figure\", \"showFlooringOptions\", function (\n // showFlooringOptions\n // ) {\n // return showFlooringOptions ? \"TriangleUp\" : \"TriangleDown\";\n // })\n // )\n // )\n )\n ); // end Node\n} // end room node\n\n/*\n * Wall Part Node Dependencies:\n * Get Wall Part Endpoints, Get Wall Part Stretch, Drag Wall Parts (Drag Computation Function),\n * Wall Part Resize Adornment, Door Selection Adornment (Door Nodes only)\n */\n\n/**\n * Find and return an array of the endpoints of a given wallpart (window or door)\n * @param {go.Part} wallPart A Wall Part Node -- i.e. Door Node, Window Node\n * @return {Array}\n */\nfunction getWallPartEndpoints(wallPart: go.Part): Array {\n const loc = wallPart.location;\n const partLength = wallPart.data.length;\n let angle = 0;\n if (wallPart.containingGroup !== null) {\n const w: go.Group = wallPart.containingGroup;\n angle = w.data.startpoint.directionPoint(w.data.endpoint);\n } else {\n angle = 180;\n }\n const point1 = new go.Point(loc.x + partLength / 2, loc.y);\n const point2 = new go.Point(loc.x - partLength / 2, loc.y);\n point1.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y);\n point2.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y);\n const arr = [];\n arr.push(point1);\n arr.push(point2);\n return arr;\n}\n\n/**\n * Returns a \"stretch\" (2 Points) that constrains a wallPart (door or window), comprised of \"part\"'s containing wall endpoints or other wallPart endpoints\n * @param {go.Part} part A Wall Part Node -- i.e. Door Node, Window Node, that is attached to a wall\n * @return {any} An object with fields 'point1' and 'point2'\n */\nfunction getWallPartStretch(part: go.Part): any {\n const wall = part.containingGroup;\n if (wall === null) return;\n const startpoint = wall.data.startpoint.copy();\n const endpoint = wall.data.endpoint.copy();\n\n // sort all possible endpoints into either left/above or right/below\n const leftOrAbove = new go.Set(/*go.Point*/);\n const rightOrBelow = new go.Set(/*go.Point*/);\n wall.memberParts.iterator.each(function (wallPart) {\n if (wallPart.data.key !== part.data.key) {\n const endpoints = getWallPartEndpoints(wallPart);\n for (let i = 0; i < endpoints.length; i++) {\n if (\n endpoints[i].x < part.location.x ||\n (endpoints[i].y > part.location.y &&\n endpoints[i].x === part.location.x)\n ) {\n leftOrAbove.add(endpoints[i]);\n } else {\n rightOrBelow.add(endpoints[i]);\n }\n }\n }\n });\n\n // do the same with the startpoint and endpoint of the dragging part's wall\n if (\n parseFloat(startpoint.x.toFixed(2)) <\n parseFloat(part.location.x.toFixed(2)) ||\n (startpoint.y > part.location.y &&\n parseFloat(startpoint.x.toFixed(2)) ===\n parseFloat(part.location.x.toFixed(2)))\n ) {\n leftOrAbove.add(startpoint);\n } else {\n rightOrBelow.add(startpoint);\n }\n if (\n parseFloat(endpoint.x.toFixed(2)) <\n parseFloat(part.location.x.toFixed(2)) ||\n (endpoint.y > part.location.y &&\n parseFloat(endpoint.x.toFixed(2)) ===\n parseFloat(part.location.x.toFixed(2)))\n ) {\n leftOrAbove.add(endpoint);\n } else {\n rightOrBelow.add(endpoint);\n }\n\n // of each set, find the closest point to the dragging part\n let leftOrAbovePt;\n let closestDistLeftOrAbove = Number.MAX_VALUE;\n leftOrAbove.iterator.each(function (point) {\n const pt: go.Point = point as go.Point;\n const distance = Math.sqrt(pt.distanceSquaredPoint(part.location));\n if (distance < closestDistLeftOrAbove) {\n closestDistLeftOrAbove = distance;\n leftOrAbovePt = pt;\n }\n });\n let rightOrBelowPt;\n let closestDistRightOrBelow = Number.MAX_VALUE;\n rightOrBelow.iterator.each(function (point) {\n const pt: go.Point = point as go.Point;\n const distance = Math.sqrt(pt.distanceSquaredPoint(part.location));\n if (distance < closestDistRightOrBelow) {\n closestDistRightOrBelow = distance;\n rightOrBelowPt = pt;\n }\n });\n\n const stretch = { point1: leftOrAbovePt, point2: rightOrBelowPt };\n return stretch;\n}\n\n/**\n * Drag computation function for WindowNodes and DoorNodes; ensure wall parts stay in walls when dragged\n * @param {go.Part} part A reference to dragged Part\n * @param {go.Point} pt The Point describing the proposed location\n * @param {go.Point} gridPt Snapped location\n * @return {go.Point}\n */\nconst dragWallParts = function (\n part: go.Part,\n pt: go.Point,\n gridPt: go.Point\n): go.Point {\n if (\n part.containingGroup !== null &&\n part.containingGroup.category === \"WallGroup\"\n ) {\n const floorplan: Floorplan = part.diagram as Floorplan;\n // Edge Case: if part is not on its wall (due to incorrect load) snap part.loc onto its wall immediately; ideally this is never called\n const wall = part.containingGroup;\n const wStart = wall.data.startpoint;\n const wEnd = wall.data.endpoint;\n const dist1 = Math.sqrt(wStart.distanceSquaredPoint(part.location));\n const dist2 = Math.sqrt(part.location.distanceSquaredPoint(wEnd));\n const totalDist = Math.sqrt(wStart.distanceSquaredPoint(wEnd));\n if (dist1 + dist2 !== totalDist) {\n part.location = part.location\n .copy()\n .projectOntoLineSegmentPoint(wStart, wEnd);\n }\n\n // main behavior\n const stretch = getWallPartStretch(part);\n const leftOrAbovePt = stretch.point1;\n const rightOrBelowPt = stretch.point2;\n\n // calc points along line created by the endpoints that are half the width of the moving window/door\n const totalLength = Math.sqrt(\n leftOrAbovePt.distanceSquaredPoint(rightOrBelowPt)\n );\n const distance = part.data.length / 2;\n const point1 = new go.Point(\n leftOrAbovePt.x +\n (distance / totalLength) * (rightOrBelowPt.x - leftOrAbovePt.x),\n leftOrAbovePt.y +\n (distance / totalLength) * (rightOrBelowPt.y - leftOrAbovePt.y)\n );\n const point2 = new go.Point(\n rightOrBelowPt.x +\n (distance / totalLength) * (leftOrAbovePt.x - rightOrBelowPt.x),\n rightOrBelowPt.y +\n (distance / totalLength) * (leftOrAbovePt.y - rightOrBelowPt.y)\n );\n\n // calc distance from pt to line (part's wall) - use point to 2pt line segment distance formula\n const distFromWall =\n Math.abs(\n (wEnd.y - wStart.y) * pt.x -\n (wEnd.x - wStart.x) * pt.y +\n wEnd.x * wStart.y -\n wEnd.y * wStart.x\n ) /\n Math.sqrt(\n Math.pow(wEnd.y - wStart.y, 2) + Math.pow(wEnd.x - wStart.x, 2)\n );\n const tolerance =\n 20 * wall.data.thickness < 100 ? 20 * wall.data.thickness : 100;\n\n // if distance from pt to line > some tolerance, detach the wallPart from the wall\n if (distFromWall > tolerance) {\n part.containingGroup = null;\n delete part.data.group;\n part.angle = 0;\n floorplan.pointNodes.iterator.each(function (node) {\n floorplan.remove(node);\n });\n floorplan.dimensionLinks.iterator.each(function (link) {\n floorplan.remove(link);\n });\n floorplan.pointNodes.clear();\n floorplan.dimensionLinks.clear();\n floorplan.updateWallDimensions();\n }\n\n // project the proposed location onto the line segment created by the new points (ensures wall parts are constrained properly when dragged)\n pt = pt.copy().projectOntoLineSegmentPoint(point1, point2);\n floorplan.skipsUndoManager = true;\n floorplan.startTransaction(\"set loc\");\n floorplan.model.setDataProperty(part.data, \"loc\", go.Point.stringify(pt));\n floorplan.commitTransaction(\"set loc\");\n floorplan.skipsUndoManager = false;\n\n floorplan.updateWallDimensions(); // update the dimension links created by having this wall part selected\n }\n return pt;\n};\n\n// Resize Adornment for Wall Part Nodes\nfunction makeWallPartResizeAdornment() {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Spot\",\n { name: \"WallPartResizeAdornment\" },\n $(go.Placeholder),\n $(go.Shape, {\n alignment: go.Spot.Left,\n cursor: \"w-resize\",\n figure: \"Diamond\",\n desiredSize: new go.Size(7, 7),\n fill: \"#ffffff\",\n stroke: \"#808080\",\n }),\n $(go.Shape, {\n alignment: go.Spot.Right,\n cursor: \"e-resize\",\n figure: \"Diamond\",\n desiredSize: new go.Size(7, 7),\n fill: \"#ffffff\",\n stroke: \"#808080\",\n })\n );\n}\n\n// Selection Adornment for Door Nodes\nfunction makeDoorSelectionAdornment() {\n const $ = go.GraphObject.make;\n return $(\n go.Adornment,\n \"Vertical\",\n { name: \"DoorSelectionAdornment\" },\n $(\n go.Panel,\n \"Auto\",\n $(go.Shape, { fill: null, stroke: null }),\n $(go.Placeholder)\n ),\n $(\n go.Panel,\n \"Horizontal\",\n { defaultStretch: go.GraphObject.Vertical },\n $(\n \"Button\",\n $(\n go.Picture,\n {\n source: \"images/flipDoorOpeningLeft.png\",\n column: 0,\n desiredSize: new go.Size(12, 12),\n },\n new go.Binding(\"source\", \"\", function (obj) {\n if (obj.adornedPart === null) {\n return \"images/flipDoorOpeningRight.png\";\n } else if (obj.adornedPart.data.swing === \"left\") {\n return \"images/flipDoorOpeningRight.png\";\n } else {\n return \"images/flipDoorOpeningLeft.png\";\n }\n }).ofObject()\n ),\n {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null && part.diagram !== null) {\n const floorplan = part.diagram;\n floorplan.startTransaction(\"flip door\");\n const adorn: go.Adornment = obj.part as go.Adornment;\n const door = adorn.adornedPart;\n if (door !== null) {\n if (door.data.swing === \"left\") {\n floorplan.model.setDataProperty(door.data, \"swing\", \"right\");\n } else {\n floorplan.model.setDataProperty(door.data, \"swing\", \"left\");\n }\n floorplan.commitTransaction(\"flip door\");\n }\n }\n },\n toolTip: $(\n go.Adornment,\n \"Auto\",\n $(go.Shape, { fill: \"#FFFFCC\" }),\n $(go.TextBlock, { margin: 4, text: \"Flip Door Opening\" })\n ),\n },\n new go.Binding(\"visible\", \"\", function (obj) {\n return obj.adornedPart === null\n ? false\n : obj.adornedPart.containingGroup !== null;\n }).ofObject()\n ),\n $(\n \"Button\",\n $(go.Picture, {\n source: \"images/flipDoorSide.png\",\n column: 0,\n desiredSize: new go.Size(12, 12),\n }),\n {\n click(e: go.InputEvent, obj: go.GraphObject) {\n const part = obj.part;\n if (part !== null && part.diagram !== null) {\n const floorplan = part.diagram;\n floorplan.startTransaction(\"rotate door\");\n const adorn: go.Adornment = obj.part as go.Adornment;\n const door: go.Node = adorn.adornedPart as go.Node;\n door.angle = (door.angle + 180) % 360;\n floorplan.commitTransaction(\"rotate door\");\n }\n },\n toolTip: $(\n go.Adornment,\n \"Auto\",\n $(go.Shape, { fill: \"#FFFFCC\" }),\n $(go.TextBlock, { margin: 4, text: \"Flip Door Side\" })\n ),\n }\n ),\n new go.Binding(\"visible\", \"\", function (obj) {\n return obj.adornedPart === null\n ? false\n : obj.adornedPart.containingGroup !== null;\n }).ofObject()\n )\n );\n}\n\n/*\n * Wall Part Nodes:\n * Window Node, Door Node, Palette Wall Node\n */\n\n// Window Node\nexport function makeWindowNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n contextMenu: makeContextMenu(),\n selectionObjectName: \"SHAPE\",\n selectionAdorned: false,\n locationSpot: go.Spot.Center,\n toolTip: makeNodeToolTip(),\n minSize: new go.Size(5, 5),\n resizable: true,\n resizeAdornmentTemplate: makeWallPartResizeAdornment(),\n resizeObjectName: \"SHAPE\",\n rotatable: false,\n dragComputation: dragWallParts,\n layerName: DiagramLayersEnum[DiagramLayersEnum.Walls], // make sure windows are always in front of walls\n },\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n new go.Binding(\"angle\").makeTwoWay(),\n $(\n go.Shape,\n { name: \"SHAPE\", fill: \"white\", strokeWidth: 0 },\n new go.Binding(\"width\", \"length\").makeTwoWay(),\n new go.Binding(\"height\").makeTwoWay(),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject(),\n new go.Binding(\"fill\", \"isSelected\", function (s, obj) {\n return s ? \"lightgray\" : \"white\";\n }).ofObject()\n ),\n $(\n go.Shape,\n { name: \"LINESHAPE\", fill: \"darkgray\", strokeWidth: 0, height: 10 },\n new go.Binding(\"width\", \"length\", function (width, obj) {\n return width - 10;\n }), // 5px padding each side\n new go.Binding(\"height\", \"height\", function (height, obj) {\n return height / 5;\n }),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject()\n )\n );\n}\n\n// Door Node\nexport function makeDoorNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n contextMenu: makeContextMenu(),\n selectionObjectName: \"SHAPE\",\n selectionAdornmentTemplate: makeDoorSelectionAdornment(),\n locationSpot: go.Spot.BottomCenter,\n resizable: true,\n resizeObjectName: \"OPENING_SHAPE\",\n toolTip: makeNodeToolTip(),\n minSize: new go.Size(10, 10),\n dragComputation: dragWallParts,\n resizeAdornmentTemplate: makeWallPartResizeAdornment(),\n layerName: DiagramLayersEnum[DiagramLayersEnum.Walls], // make sure windows are always in front of walls\n },\n // remember location of the Node\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n new go.Binding(\"angle\").makeTwoWay(),\n // the door's locationSpot is affected by it's openingHeight, which is affected by the thickness of its containing wall\n new go.Binding(\"locationSpot\", \"doorOpeningHeight\", function (doh, obj) {\n return new go.Spot(0.5, 1, 0, -(doh / 2));\n }),\n // this is the shape that reprents the door itself and its swing\n $(\n go.Shape,\n { name: \"SHAPE\", fill: \"rgba(0, 0, 0, 0)\" },\n new go.Binding(\"width\", \"length\"),\n new go.Binding(\"height\", \"length\").makeTwoWay(),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject(),\n // new go.Binding(\"fill\", \"color\"),\n new go.Binding(\"geometryString\", \"swing\", function (swing) {\n if (swing === \"left\") {\n return \"F1 M0,0 v-150 a150,150 0 0,1 150,150 \";\n } else {\n return \"F1 M275,175 v-150 a150,150 0 0,0 -150,150 \";\n }\n })\n ),\n // door opening shape\n $(\n go.Shape,\n {\n name: \"OPENING_SHAPE\",\n fill: \"white\",\n strokeWidth: 0,\n height: 5,\n width: 40,\n alignment: go.Spot.BottomCenter,\n alignmentFocus: go.Spot.Top,\n },\n new go.Binding(\"height\", \"doorOpeningHeight\").makeTwoWay(),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject(),\n new go.Binding(\"fill\", \"isSelected\", function (s, obj) {\n return s ? \"lightgray\" : \"white\";\n }).ofObject(),\n new go.Binding(\"width\", \"length\").makeTwoWay()\n )\n );\n}\n\n// Palette Wall Node (becomes WallGroup when dropped from Palette onto diagram)\nexport function makePaletteWallNode() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n { selectionAdorned: false },\n $(\n go.Shape,\n {\n name: \"SHAPE\",\n fill: \"black\",\n strokeWidth: 0,\n height: 10,\n figure: \"Rectangle\",\n },\n new go.Binding(\"width\", \"length\").makeTwoWay(),\n new go.Binding(\"height\").makeTwoWay(),\n new go.Binding(\"fill\", \"isSelected\", function (s, obj) {\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject(),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject()\n )\n );\n}\n\n// export = Floorplan;\n","/**\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * FLOOR PLANNER - WALL BUILDING TOOL\n * Used to construct new Walls in a Floorplan with mouse clicking / mouse point\n */\n\nimport * as go from \"gojs\";\nimport { WallThicknessEnum } from \"src/app/folio/folio.constants\";\nimport { WallTypesEnum } from \"../models/elements\";\nimport { Floorplan } from \"./floorplan-diagram\";\nimport { WallReshapingTool } from \"./wall-reshaping-tool\";\n\nexport class WallBuildingTool extends go.Tool {\n private _startPoint: go.Point | null;\n private _endPoint: go.Point | null;\n private _wallReshapingTool: WallReshapingTool | null;\n private _buildingWall: go.Group | null = null; // the wall being built\n // whether or not the \"wall\" we're building is really just a room / floor divider (not a physical wall)\n private _isBuildingDivider = false;\n private _isScale = false;\n private _wallThickness = WallThicknessEnum.wall;\n\n constructor() {\n super();\n\n this.name = \"WallBuilding\";\n this._startPoint = null;\n this._endPoint = null;\n this._wallReshapingTool = null;\n this._isBuildingDivider = false;\n }\n\n // Get / set the current startPoint\n get startPoint(): go.Point | null {\n return this._startPoint;\n }\n set startPoint(value: go.Point | null) {\n this._startPoint = value;\n }\n\n set wallThickness(thickness: WallThicknessEnum) {\n this._wallThickness = thickness;\n }\n\n // Get / set the current endPoint\n get endPoint(): go.Point | null {\n return this._endPoint;\n }\n set endPoint(value: go.Point | null) {\n this._endPoint = value;\n }\n\n // Get / set the floorplan's WallReshapingTool\n get wallReshapingTool(): WallReshapingTool | null {\n return this._wallReshapingTool;\n }\n set wallReshapingTool(value: WallReshapingTool | null) {\n this._wallReshapingTool = value;\n }\n\n // Get / set the wall being built\n get buildingWall(): go.Group | null {\n return this._buildingWall;\n }\n set buildingWall(value: go.Group | null) {\n this._buildingWall = value;\n }\n\n // Get / set whether or not we're actually building a room / floor divider, not a wall\n get isBuildingDivider(): boolean {\n return this._isBuildingDivider;\n }\n set isBuildingDivider(value: boolean) {\n this._isBuildingDivider = value;\n }\n\n get isScale(): boolean {\n return this._isScale;\n }\n set isScale(value: boolean) {\n this._isScale = value;\n }\n\n /**\n * Start wall building transaction.\n * If the mouse point is inside a wall or near a wall endpoint, snap to that wall or endpoint\n */\n public doActivate(): void {\n this.endPoint = null;\n this.startTransaction(this.name);\n this.diagram.isMouseCaptured = true;\n const tool = this;\n const fp: Floorplan = tool.diagram as Floorplan;\n\n let clickPt: go.Point = tool.diagram.lastInput.documentPoint;\n let isSnapped = false;\n // if the clickPt is inside some other wall's geometry, project it onto that wall's segment\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n walls.iterator.each((w: go.Group) => {\n if (fp.isPointInWall(w, clickPt)) {\n // don't check if you're inside the wall you're building, you obviously are\n if (tool.buildingWall === null) {\n const snapPt: go.Point = clickPt.projectOntoLineSegmentPoint(\n w.data.startpoint,\n w.data.endpoint\n );\n clickPt = snapPt;\n isSnapped = true;\n }\n }\n });\n\n // if the click point is close to another wall's start/endpoint, use that as the startpoint of the new wall\n walls.iterator.each((w: go.Group) => {\n const sp: go.Point = w.data.startpoint;\n const ep: go.Point = w.data.endpoint;\n const distSp: number = Math.sqrt(sp.distanceSquaredPoint(clickPt));\n // TODO probably need a better \"closeness\" metric than just a raw number -- it could be an optional parameter?\n if (distSp < 15) {\n clickPt = sp;\n isSnapped = true;\n }\n const distEp: number = Math.sqrt(ep.distanceSquaredPoint(clickPt));\n if (distEp < 15) {\n clickPt = ep;\n isSnapped = true;\n }\n });\n\n // assign startpoint based on grid (iff startpoint was not determined by another wall's endpoint)\n if (true) {\n let gs: number = fp.model.modelData.gridSize;\n if (!tool.diagram.toolManager.draggingTool.isGridSnapEnabled || isSnapped)\n gs = 0.0001;\n const newx: number = gs * Math.round(clickPt.x / gs);\n const newy: number = gs * Math.round(clickPt.y / gs);\n clickPt = new go.Point(newx, newy);\n }\n\n this.startPoint = clickPt;\n\n this.wallReshapingTool = fp.toolManager.mouseDownTools.elt(\n 3\n ) as WallReshapingTool;\n // Default functionality:\n this.isActive = true;\n }\n\n /**\n * Add wall data to Floorplan and begin reshaping the new wall\n */\n public doMouseDown(): void {\n const tool = this;\n const diagram: go.Diagram = this.diagram;\n // remove any other scale if scaling\n if (tool.isScale) {\n const otherScales = this.diagram.findNodesByExample({ category: 'ScaleGroup' })\n otherScales.iterator.each(node => {\n diagram.remove(node);\n })\n }\n\n tool.diagram.currentCursor = \"crosshair\";\n const data = {\n key: tool.isScale ? \"scale\" : \"wall\",\n category: tool.isScale ? \"ScaleGroup\" : \"WallGroup\",\n caption: tool.isBuildingDivider ? \"Divider\" : (tool.isScale ? \"Scale\" : \"Wall\"),\n type: tool.isBuildingDivider ? \"Divider\" : (tool.isScale ? \"Scale\" : \"Wall\"),\n startpoint: tool.startPoint,\n endpoint: tool.startPoint,\n smpt1: tool.startPoint,\n smpt2: tool.startPoint,\n empt1: tool.startPoint,\n empt2: tool.startPoint,\n paroi: tool._isBuildingDivider\n ? undefined\n : WallTypesEnum.mur_interieur,\n thickness: tool._isBuildingDivider || tool._isScale\n ? 0.005\n : tool._wallThickness || diagram.model.modelData.wallThickness,\n color: tool.isScale ? \"orange\" : \"lightgray\",\n isGroup: true,\n notes: \"\",\n isDivider: tool.isBuildingDivider,\n isScale: tool.isScale,\n };\n this.diagram.model.addNodeData(data);\n const wall: go.Group = diagram.findPartForKey(data.key) as go.Group;\n this.buildingWall = wall;\n const fp: Floorplan = diagram as Floorplan;\n fp.updateWall(wall);\n const part: go.Part | null = diagram.findPartForData(data);\n if (part === null) return;\n // set the TransactionResult before raising event, in case it changes the result or cancels the tool\n tool.transactionResult = tool.name;\n diagram.raiseDiagramEvent(\"PartCreated\", part);\n\n if (tool.wallReshapingTool === null) return;\n // start the wallReshapingTool, tell it what wall it's reshaping (more accurately, the shape that will have the reshape handle)\n tool.wallReshapingTool.isEnabled = true;\n diagram.select(part);\n tool.wallReshapingTool.isBuilding = true;\n tool.wallReshapingTool.adornedShape = part.findObject(\"SHAPE\") as go.Shape;\n tool.wallReshapingTool.doActivate();\n }\n\n /**\n * If user presses Esc key, cancel the wall building\n */\n public doKeyDown(): void {\n const fp: Floorplan = this.diagram as Floorplan;\n const e: go.InputEvent = fp.lastInput;\n if (e.key === \"Esc\") {\n const wall: go.Group = fp.selection.first() as go.Group;\n fp.remove(wall);\n fp.pointNodes.iterator.each((node) => {\n fp.remove(node);\n });\n fp.dimensionLinks.iterator.each((link) => {\n fp.remove(link);\n });\n fp.pointNodes.clear();\n fp.dimensionLinks.clear();\n this.doDeactivate();\n }\n go.Tool.prototype.doKeyDown.call(this);\n }\n\n /**\n * When the mouse moves, reshape the wall\n */\n public doMouseMove(): void {\n if (this.wallReshapingTool === null) return;\n this.diagram.currentCursor = \"crosshair\";\n this.wallReshapingTool.doMouseMove();\n }\n\n /**\n * End transaction, update wall dimensions and geometries (mitering?)\n */\n public doDeactivate(): void {\n const diagram: go.Diagram = this.diagram;\n this.buildingWall = null;\n this.diagram.currentCursor = \"\";\n this.diagram.isMouseCaptured = false;\n\n if (this.wallReshapingTool !== null) {\n this.wallReshapingTool.isEnabled = false;\n this.wallReshapingTool.adornedShape = null;\n this.wallReshapingTool.doMouseUp(); // perform mitering\n this.wallReshapingTool.doDeactivate();\n this.wallReshapingTool.isBuilding = false;\n }\n\n const fp: Floorplan = diagram as Floorplan;\n fp.updateWallDimensions();\n if (this._isScale) {\n fp.disableWallBuilding();\n }\n\n this.stopTransaction();\n\n this.isActive = false; // Default functionality\n }\n}\n\n// export = WallBuildingTool;\n","// tslint:disable:max-line-length\n/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * FLOOR PLANNER: WALL RESHAPING TOOL\n * Used to reshape walls via their endpoints in a Floorplan\n */\n\nimport * as go from \"gojs\";\nimport { convertPixelsToUnits } from \"../tools\";\nimport { Floorplan } from \"./floorplan-diagram\";\nimport getsetFunctions from \"../inspector/getset-functions\";\nimport { DiagramLayersEnum } from \"../models/elements\";\n\nexport class WallReshapingTool extends go.Tool {\n private _handleArchetype: go.Shape;\n private _handle: go.GraphObject | null;\n private _adornedShape: go.Shape | null;\n private _angle: number;\n private _length: number;\n private _reshapeObjectName: string;\n private _isBuilding: boolean;\n private _returnData: any;\n private _returnPoint: go.Point | null;\n private _isIntersecting: boolean; // whether the reshaping wall is intersecting at least one other wall. if so, ignore grid snap\n private _wallIntersecting: go.Group | null; // the wall the reshaping endpoint is currently intersecting\n // the wall(s) made after a reshape event by combining some colinear walls\n // this will only not be an empty Set if the reshape has resulted in the joining of some colinear wall(s), at either the reshaping wall's reshaping endpoint or returnPoint\n private _joinedWalls: go.Set;\n\n /**\n * @constructor\n * This tool is responsible for allowing walls in a Floorplan to be reshaped via handles on either side.\n */\n constructor() {\n super();\n\n const h: go.Shape = new go.Shape();\n h.figure = \"Diamond\";\n h.desiredSize = new go.Size(12, 12);\n h.fill = \"lightblue\";\n h.stroke = \"dodgerblue\";\n h.cursor = \"move\";\n this._handleArchetype = h;\n\n this._handle = null;\n this._adornedShape = null;\n this._reshapeObjectName = \"SHAPE\";\n this._angle = 0;\n this._length = 0;\n this._isBuilding = false; // only true when a wall is first being constructed, set in WallBuildingTool's doMouseUp function\n this._isIntersecting = false;\n this._joinedWalls = new go.Set();\n\n this._returnPoint = null; // used if reshape is cancelled; return reshaping wall endpoint to its previous location\n this._returnData = null; // used if reshape is cancelled; return all windows/doors of a reshaped wall to their old place\n this._joinedWalls = new go.Set();\n this._wallIntersecting = null;\n }\n\n public doKeyDown(): void {\n go.Tool.prototype.doKeyDown.call(this);\n }\n // Get the archetype for the handle (a Shape)\n get handleArchetype() {\n return this._handleArchetype;\n }\n\n // Get / set current handle being used to reshape the wall\n get handle(): go.GraphObject | null {\n return this._handle;\n }\n set handle(value: go.GraphObject | null) {\n this._handle = value;\n }\n\n // Get / set adorned shape (shape of the Wall Group being reshaped)\n get adornedShape(): go.Shape | null {\n return this._adornedShape;\n }\n set adornedShape(value: go.Shape | null) {\n this._adornedShape = value;\n }\n\n // Get / set current angle\n get angle(): number {\n return this._angle;\n }\n set angle(value: number) {\n this._angle = value;\n }\n\n // Get / set length of the wall being reshaped (used only with SHIFT + drag)\n get length(): number {\n return this._length;\n }\n set length(value: number) {\n this._length = value;\n }\n\n // Get / set the name of the object being reshaped\n get reshapeObjectName(): string {\n return this._reshapeObjectName;\n }\n set reshapeObjectName(value: string) {\n this._reshapeObjectName = value;\n }\n\n // Get / set flag telling tool whether it's reshaping a new wall (isBuilding = true) or reshaping an old wall (isBuilding = false)\n get isBuilding(): boolean {\n return this._isBuilding;\n }\n set isBuilding(value: boolean) {\n this._isBuilding = value;\n }\n\n // Get set loc data for wallParts to return to if reshape is cancelled\n get returnData(): any {\n return this._returnData;\n }\n set returnData(value: any) {\n this._returnData = value;\n }\n\n // Get / set the point to return the reshaping wall endpoint to if reshape is cancelled\n get returnPoint(): go.Point | null {\n return this._returnPoint;\n }\n set returnPoint(value: go.Point | null) {\n this._returnPoint = value;\n }\n\n // Get / set whether the reshaping wall is intersecting at least one other wall. if so, ignore grid snap\n get isIntersecting(): boolean {\n return this._isIntersecting;\n }\n set isIntersecting(value: boolean) {\n this._isIntersecting = value;\n }\n\n // Get / set the wall the reshaping endpoint is currently intersecting\n get wallIntersecting(): go.Group | null {\n return this._wallIntersecting;\n }\n set wallIntersecting(value: go.Group | null) {\n this._wallIntersecting = value;\n }\n\n // Get / set the wall created during after a reshape event by combining some colinear walls\n get joinedWalls(): go.Set {\n return this._joinedWalls;\n }\n set joinedWalls(value: go.Set) {\n this._joinedWalls = value;\n }\n\n /**\n * Places reshape handles on either end of a wall node.\n * @param {go.Part} part The wall to adorn\n */\n public updateAdornments(part: go.Part): void {\n if (part === null || part instanceof go.Link) return;\n if (part.isSelected && !this.diagram.isReadOnly) {\n const seleltgo: go.GraphObject | null = part.findObject(\n this.reshapeObjectName\n );\n if (\n seleltgo !== null &&\n seleltgo.part !== null &&\n (seleltgo.part.data.category === \"WallGroup\" || seleltgo.part.data.category === \"ScaleGroup\")\n ) {\n const selelt: go.Shape = seleltgo as go.Shape;\n let adornment: go.Adornment | null = part.findAdornment(this.name);\n if (adornment === null) {\n adornment = this.makeAdornment(selelt);\n }\n if (\n adornment !== null &&\n selelt.part !== null &&\n selelt.geometry != null\n ) {\n // update the position/alignment of each handle\n const geo: go.Geometry = selelt.geometry;\n const b: go.Rect = geo.bounds;\n const pb: go.Rect = selelt.part.actualBounds;\n // update the size of the adornment\n const graphObj = adornment.findObject(\"BODY\");\n if (graphObj === null) return;\n graphObj.desiredSize = b.size;\n adornment.elements.each((h) => {\n if (h.name === undefined) return;\n\n let x = 0;\n let y = 0;\n switch (h.name) {\n case \"sPt\": {\n x = part.data.startpoint.x - pb.x;\n y = part.data.startpoint.y - pb.y;\n break;\n }\n case \"ePt\": {\n x = part.data.endpoint.x - pb.x;\n y = part.data.endpoint.y - pb.y;\n break;\n }\n }\n let xCheck: number = Math.min((x - b.x) / b.width, 1);\n let yCheck: number = Math.min((y - b.y) / b.height, 1);\n if (xCheck < 0) xCheck = 0;\n if (yCheck < 0) yCheck = 0;\n if (xCheck > 1) xCheck = 1;\n if (yCheck > 1) yCheck = 1;\n if (isNaN(xCheck)) xCheck = 0;\n if (isNaN(yCheck)) yCheck = 0;\n h.alignment = new go.Spot(Math.max(0, xCheck), Math.max(0, yCheck));\n });\n\n part.addAdornment(this.name, adornment);\n adornment.location = selelt.getDocumentPoint(go.Spot.Center);\n return;\n }\n }\n }\n part.removeAdornment(this.name);\n }\n\n /**\n * If the user has clicked down at a visible handle on a wall node, then the tool may start.\n * @return {boolean}\n */\n public canStart(): boolean {\n if (!this.isEnabled) return false;\n const diagram: go.Diagram = this.diagram;\n if (diagram === null || diagram.isReadOnly) return false;\n if (!diagram.allowReshape) return false;\n if (!diagram.lastInput.left) return false;\n const h: go.GraphObject | null = this.findToolHandleAt(\n diagram.firstInput.documentPoint,\n this.name\n );\n return h !== null || this.isBuilding;\n }\n\n /**\n * Start a new transaction for the wall reshaping.\n * Store pre-reshape location of reshaping wall's reshaping endpoint.\n * Store pre-reshape locations of all wall's members (windows / doors).\n */\n public doActivate(): void {\n const diagram: go.Diagram = this.diagram;\n if (diagram === null) return;\n if (this.isBuilding) {\n // this.adornedShape has already been set in WallBuildingTool's doMouseDown function\n if (this.adornedShape !== null && this.adornedShape.part !== null) {\n const wall: go.Group = this.adornedShape.part as go.Group;\n this.handle = this.findToolHandleAt(wall.data.endpoint, this.name);\n this.returnPoint = wall.data.startpoint;\n }\n } else {\n this.handle = this.findToolHandleAt(\n diagram.firstInput.documentPoint,\n this.name\n );\n if (this.handle === null) return;\n const adorn: go.Adornment = this.handle.part as go.Adornment;\n const shape: go.Shape = adorn.adornedObject as go.Shape;\n const wall: go.Group = shape.part as go.Group;\n if (!shape) return;\n this.adornedShape = shape;\n\n // store pre-reshape location of wall's reshaping endpoint\n this.returnPoint =\n this.handle.name === \"sPt\" ? wall.data.startpoint : wall.data.endpoint;\n\n // store pre-reshape locations of all wall's members (windows / doors)\n const wallParts: go.Iterator = wall.memberParts;\n if (wallParts.count !== 0) {\n const locationsMap: go.Map = new go.Map<\n string,\n go.Point\n >();\n wallParts.iterator.each((wallPart) => {\n locationsMap.add(wallPart.data.key, wallPart.location);\n });\n this.returnData = locationsMap;\n }\n }\n\n // diagram.isMouseCaptured = true;\n this.startTransaction(this.name);\n this.isActive = true;\n }\n\n /**\n * Adjust the handle's coordinates, along with the wall's points.\n */\n public doMouseMove(): void {\n const fp: Floorplan = this.diagram as Floorplan;\n const tool: WallReshapingTool = this;\n if (tool.handle === null) return;\n const adorn: go.Adornment = tool.handle.part as go.Adornment;\n const wall: go.Group = adorn.adornedPart as go.Group;\n\n // the stationaryPt\n let mousePt: go.Point = fp.lastInput.documentPoint;\n\n if (tool.isActive && fp !== null) {\n // if user is holding shift, make sure the angle of the reshaping wall (from stationaryPt to mousePt) is a multiple of 45\n if (fp.lastInput.shift) {\n // what's the current angle made from stationaryPt to mousePt?\n const type = tool.handle.name;\n const stationaryPt: go.Point =\n type === \"sPt\" ? wall.data.endpoint : wall.data.startpoint;\n let ang: number = stationaryPt.directionPoint(mousePt);\n const length: number = Math.sqrt(\n stationaryPt.distanceSquaredPoint(mousePt)\n );\n\n ang = Math.round(ang / 45) * 45;\n let newPoint: go.Point = new go.Point(\n stationaryPt.x + length,\n stationaryPt.y\n );\n // rotate the new point ang degrees\n const dx: number = stationaryPt.x;\n const dy = stationaryPt.y;\n newPoint = newPoint.offset(-dx, -dy); // move point to origin\n newPoint = newPoint.rotate(ang); // rotate ang degrees around origin\n newPoint = newPoint.offset(dx, dy); // add back offset\n\n mousePt = newPoint;\n }\n\n // if the mousePt is close to some wall's endpoint, snap the mousePt to that endpoint\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n walls.iterator.each((w: go.Group) => {\n if (w.data.key !== wall.data.key) {\n const spt: go.Point = w.data.startpoint;\n const ept: go.Point = w.data.endpoint;\n\n // if the mousePt is inside the geometry of another wall, project the point onto that wall\n if (fp.isPointInWall(w, mousePt)) {\n mousePt = mousePt.projectOntoLineSegmentPoint(\n w.data.startpoint,\n w.data.endpoint\n );\n tool.isIntersecting = true; // yes, the current reshaping wall is intersecting another wall\n }\n\n // if the mousePt is close to some wall's endpoint, snap the mousePt to that endpoint\n if (Math.sqrt(spt.distanceSquaredPoint(mousePt)) < 10) {\n mousePt = spt;\n } else if (Math.sqrt(ept.distanceSquaredPoint(mousePt)) < 10) {\n mousePt = ept;\n }\n }\n });\n\n // if the resulting segment between stationary pt and mousePt would intersect other wall(s), project mousePt onto the first wall it would intersect\n const iw = tool.getClosestIntersectingWall(mousePt);\n\n // if we are or just were intersecting some wall, miter it\n if (iw === null || tool.wallIntersecting !== null) {\n if (\n tool.wallIntersecting !== null &&\n tool.wallIntersecting !== undefined &&\n tool.wallIntersecting.data !== null\n ) {\n tool.performMiteringOnWall(tool.wallIntersecting);\n }\n }\n\n if (iw != null) {\n tool.isIntersecting = true; // yes, the current reshaping wall is intersecting another wall\n tool.wallIntersecting = iw;\n mousePt = mousePt.projectOntoLineSegmentPoint(\n iw.data.startpoint,\n iw.data.endpoint\n );\n // if the mousePt is really close to an endpoint of its intersecting wall, make it that endpoint\n const distToSpt: number = Math.sqrt(\n mousePt.distanceSquaredPoint(iw.data.startpoint)\n );\n const distToEpt: number = Math.sqrt(\n mousePt.distanceSquaredPoint(iw.data.endpoint)\n );\n if (distToSpt < 25) {\n mousePt = iw.data.startpoint;\n } else if (distToEpt < 10) {\n mousePt = iw.data.endpoint;\n }\n } else {\n tool.isIntersecting = false;\n // if the wall we were previously intersecting is not touching the reshaping wall, forget it\n if (\n tool.wallIntersecting !== null &&\n tool.wallIntersecting !== undefined &&\n tool.wallIntersecting.data !== null &&\n fp.getWallsIntersection(wall, tool.wallIntersecting) === null\n ) {\n tool.wallIntersecting = null;\n }\n }\n\n tool.calcAngleAndLengthFromHandle(mousePt); // sets this.angle and this.length (useful for when SHIFT is held)\n tool.reshape(mousePt);\n }\n\n tool.performMiteringOnWall(wall);\n fp.updateWallDimensions();\n fp.updateWallAngles();\n }\n\n /**\n * Get the closest wall the reshaping wall intersects with.\n * Returns null if reshaping wall does not intersect with any other wall.\n * @param {go.Point} proposedPt The proposed point for the reshaping wall's moving pt\n * @return {go.Group | null} The closest wall the reshaping wall's reshaping endpoint intersects with\n */\n private getClosestIntersectingWall(proposedPt: go.Point): go.Group | null {\n const tool: WallReshapingTool = this;\n if (tool.handle === null) return null;\n const adorn: go.Adornment = tool.handle.part as go.Adornment;\n const wall: go.Group = adorn.adornedPart as go.Group;\n const type = tool.handle.name;\n const stationaryPt: go.Point =\n type === \"sPt\" ? wall.data.endpoint : wall.data.startpoint;\n // dummy wall is used for intersection checks, since the reshaping wall has not had its data yet set\n const dummyWallData: any = {\n key: \"wall\",\n category: tool.handle.name,\n caption: \"Wall\",\n type: \"Wall\",\n startpoint: stationaryPt,\n smpt1: stationaryPt,\n smpt2: stationaryPt,\n endpoint: proposedPt,\n empt1: proposedPt,\n empt2: proposedPt,\n thickness: parseFloat(tool.diagram.model.modelData.wallThickness),\n isGroup: true,\n notes: \"\",\n };\n tool.diagram.model.addNodeData(dummyWallData);\n const dummyWall: go.Group = tool.diagram.findPartForKey(\n dummyWallData.key\n ) as go.Group;\n const fp: Floorplan = tool.diagram as Floorplan;\n\n const walls: go.Iterator = tool.diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n let closestWall: go.Group | null = null;\n let closestDistance: number = Number.MAX_VALUE;\n walls.iterator.each((w) => {\n if (w.data.key !== wall.data.key && w.data.key !== dummyWall.data.key) {\n // check if wall and w intersect, and if so, where\n const intersectPoint: go.Point | null = fp.getWallsIntersection(\n dummyWall,\n w\n );\n // also, don't project onto a wall the stationaryPt is already along (this would make two walls on top of each other)\n let isStationaryPtOnW = false;\n const ab: number = parseFloat(\n Math.sqrt(\n w.data.startpoint.distanceSquaredPoint(stationaryPt)\n ).toFixed(2)\n );\n const bc: number = parseFloat(\n Math.sqrt(stationaryPt.distanceSquaredPoint(w.data.endpoint)).toFixed(\n 2\n )\n );\n const ac: number = parseFloat(\n Math.sqrt(\n w.data.startpoint.distanceSquaredPoint(w.data.endpoint)\n ).toFixed(2)\n );\n if (Math.abs(ab + bc - ac) <= 0.1) {\n isStationaryPtOnW = true;\n }\n if (intersectPoint !== null && !isStationaryPtOnW) {\n // calc distance from stationaryPoint to proposed intersection point\n const dist: number = Math.sqrt(\n stationaryPt.distanceSquaredPoint(intersectPoint)\n );\n if (dist < closestDistance) {\n closestDistance = dist;\n closestWall = w;\n }\n }\n }\n });\n // remove the dummy wall\n fp.remove(dummyWall);\n return closestWall;\n }\n\n /**\n * Returns whether or not 2 points are \"close enough\" to each other.\n * \"Close enough\" is, by default, defined as a point whose x and y values are within .05\n * document units of another point's x and y values.\n * @param {go.Point} p1\n * @param {go.Point} p2\n * @return {boolean}\n */\n public pointsApproximatelyEqual(p1: go.Point, p2: go.Point): boolean {\n const x1: number = p1.x;\n const x2: number = p2.x;\n const y1: number = p1.y;\n const y2: number = p2.y;\n\n const diff1: number = Math.abs(x2 - x1);\n const diff2: number = Math.abs(y2 - y1);\n\n if (diff2 < 0.05 && diff1 < 0.05) {\n return true;\n }\n return false;\n }\n\n /**\n * Sets the counterclockwise mitering point for wallA / clockwise mitering point for wallB.\n * This algorithm based on https://math.stackexchange.com/questions/1849784/calculate-miter-points-of-stroked-vectors-in-cartesian-plane.\n * @param {go.Group} wa wallA\n * @param {go.Group} wb wallB\n */\n private performMitering(wa: go.Group, wb: go.Group): void {\n const tool = this;\n const diagram: Floorplan = this.diagram as Floorplan;\n\n // wall endpoints, thicknesses, lengths\n const as: go.Point = wa.data.startpoint;\n const ae: go.Point = wa.data.endpoint;\n const bs: go.Point = wb.data.startpoint;\n const be: go.Point = wb.data.endpoint;\n const wat: number = wa.data.thickness;\n const wbt: number = wb.data.thickness;\n const wal: number = Math.sqrt(as.distanceSquaredPoint(ae));\n const wbl: number = Math.sqrt(bs.distanceSquaredPoint(be));\n\n // points\n const B: go.Point | null = diagram.getWallsIntersection(wa, wb); // intersection point\n if (B === null) {\n return;\n }\n let A: go.Point = tool.pointsApproximatelyEqual(as, B) ? ae : as; // wallA non-intersection point\n let C: go.Point = tool.pointsApproximatelyEqual(bs, B) ? be : bs; // wallB non-intersection point\n\n // edge case: non-endpoint intersection\n // must know which wall is outer wall (the one who has no endpoint in the intersection)\n // and which wall is inner wall (the one with an endpoint in the intersection)\n let ow: go.Group | null = null;\n let iw: go.Group | null = null;\n if (\n !tool.pointsApproximatelyEqual(as, B) &&\n !tool.pointsApproximatelyEqual(ae, B)\n ) {\n ow = wa;\n iw = wb;\n } else if (\n !tool.pointsApproximatelyEqual(bs, B) &&\n !tool.pointsApproximatelyEqual(be, B)\n ) {\n ow = wb;\n iw = wa;\n }\n\n // if wall A is the inner wall, use the endpoint of wall B that counterclockwise from point A for point C\n if (ow !== null && iw !== null && wa.data.key === iw.data.key) {\n if (tool.isClockwise(A, B, ow.data.startpoint)) {\n C = ow.data.startpoint;\n } else {\n C = ow.data.endpoint;\n }\n }\n\n // if wall B is the inner wall, use endpoint of wall A that's clockwise from point C for point A\n if (ow !== null && iw !== null && wb.data.key === iw.data.key) {\n if (tool.isClockwise(B, C, ow.data.startpoint)) {\n A = ow.data.startpoint;\n } else {\n A = ow.data.endpoint;\n }\n }\n\n // angle between wallA and wallB, clockwise, in degrees\n const a1: number = B.directionPoint(A);\n const a2: number = B.directionPoint(C);\n let ang: number = Math.abs(a1 - a2 + 360) % 360;\n if (Math.abs(ang - 180) < 0.1) {\n return;\n }\n ang = ang * (Math.PI / 180); // radians\n\n // create a parallelogram with altitudes wat/2 and wbt/2, s.t. u and v are the lengths from B to reach D (counterclockwise mitering point)\n const u: number = Math.abs(wbt / (2 * Math.sin(ang)));\n const v: number = Math.abs(wat / (2 * Math.sin(ang)));\n\n // get u and v vectors\n const ab: number = Math.sqrt(A.distanceSquaredPoint(B));\n const bc: number = Math.sqrt(B.distanceSquaredPoint(C));\n const ux: number = ((A.x - B.x) / ab) * u;\n const uy: number = ((A.y - B.y) / ab) * u;\n\n // only for endpoint-endpoint?\n const vx: number = ((C.x - B.x) / bc) * v;\n const vy: number = ((C.y - B.y) / bc) * v;\n\n // these are the mitering points\n const D: go.Point = new go.Point(B.x + ux + vx, B.y + uy + vy);\n const E: go.Point = new go.Point(B.x - ux - vx, B.y - uy - vy);\n\n // miter limit TODO???\n const minLength: number = Math.min(wal, wbl);\n if (Math.sqrt(D.distanceSquaredPoint(B)) > minLength) {\n return;\n }\n\n // mitering point / other mitering point\n const mpt: go.Point = tool.isClockwise(B, A, D) ? E : D;\n\n if (isNaN(mpt.x) || isNaN(mpt.y)) {\n return;\n }\n\n // now figure out which mitering point of wallA's data to modify\n // only modify a mitering point in data if B is one of wallA's endpoints\n if (\n tool.pointsApproximatelyEqual(as, B) ||\n tool.pointsApproximatelyEqual(ae, B)\n ) {\n let prop: string | null = null;\n // wall A's direction to point B is from startpoint to endpoint\n if (tool.pointsApproximatelyEqual(A, as)) {\n // if ang2 is clockwise of ang1, update empt1\n if (tool.isClockwise(A, B, mpt)) {\n prop = \"empt1\";\n } else {\n prop = \"empt2\";\n }\n } else if (tool.pointsApproximatelyEqual(A, ae)) {\n // wall A's direction to point B is from endpoint to startpoint\n if (tool.isClockwise(A, B, mpt)) {\n prop = \"smpt2\";\n } else {\n prop = \"smpt1\";\n }\n }\n if (prop !== null) {\n diagram.model.setDataProperty(wa.data, prop, mpt);\n diagram.updateWall(wa);\n }\n }\n\n // same, but for wall B\n if (\n tool.pointsApproximatelyEqual(bs, B) ||\n tool.pointsApproximatelyEqual(be, B)\n ) {\n let prop: string | null = null;\n // wall A's direction to point B is from startpoint to endpoint\n if (tool.pointsApproximatelyEqual(C, bs)) {\n // if ang2 < ang1, update empt1\n if (tool.isClockwise(C, B, mpt)) {\n prop = \"empt1\";\n } else {\n prop = \"empt2\";\n }\n } else if (tool.pointsApproximatelyEqual(C, be)) {\n // wall A's direction to point B is from endpoint to startpoint\n if (tool.isClockwise(C, B, mpt)) {\n prop = \"smpt2\";\n } else {\n prop = \"smpt1\";\n }\n }\n if (prop !== null) {\n diagram.model.setDataProperty(wb.data, prop, mpt);\n diagram.updateWall(wb);\n }\n }\n }\n\n /**\n * Returns a set of all the wall intersections in the entire floorplan.\n * Each entry is a stringified points (i.e. \"0 0\").\n * @return {go.Set}\n */\n public getAllWallIntersectionPoints(): go.Set {\n const tool: WallReshapingTool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n\n // get all walls\n const walls: go.Iterator = diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n const intersectionPoints: go.Set = new go.Set(); // set of Points where walls intersect\n walls.iterator.each((w) => {\n // for each wall, go through all other walls; if this wall intersects another wall, mark it as an intersection point\n const otherWalls: go.Iterator = diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n otherWalls.iterator.each((ow) => {\n if (ow.data.key === w.data.key) return; // do not check for intersection with self\n const ip: go.Point | null = diagram.getWallsIntersection(w, ow);\n let doAdd = true;\n\n if (ip !== null) {\n // make sure there is not already an intersection point in the set that's really close to this one\n intersectionPoints.iterator.each((ips) => {\n const ip2: go.Point = go.Point.parse(ips);\n if (tool.pointsApproximatelyEqual(ip2, ip)) {\n doAdd = false;\n }\n });\n\n if (doAdd) {\n intersectionPoints.add(go.Point.stringify(ip));\n }\n }\n });\n });\n\n return intersectionPoints;\n }\n\n /**\n * Get all the walls with an endpoint at a given Point.\n * Returns a List of all walls involved in that intersection.\n * @param {go.Point | null} intersectionPoint\n * @param {boolean} includeDividers Whether or not to also include Room Dividers with endpoints at intersectionPoint. Default is true.\n * @return {go.List}\n */\n public getAllWallsAtIntersection(\n intersectionPoint: go.Point | null,\n includeDividers?: boolean\n ): go.List {\n if (includeDividers === undefined || includeDividers === null) {\n includeDividers = true;\n }\n\n const tool: WallReshapingTool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n const wallsInvolved: go.List = new go.List(); // list of walls, which will be sorted clockwise\n if (intersectionPoint === null) {\n return wallsInvolved;\n }\n\n diagram.findObjectsNear(\n intersectionPoint,\n 1,\n (x: go.GraphObject) => {\n if (x.part !== null) {\n return x.part;\n }\n return null;\n },\n (p) => {\n if (\n !(\n p instanceof go.Group &&\n p.category === \"WallGroup\" &&\n (includeDividers || !p.data.isDivider) &&\n !wallsInvolved.contains(p)\n )\n )\n return false;\n // make sure the wall's segment includes ip\n const s: go.Point = p.data.startpoint;\n const e: go.Point = p.data.endpoint;\n return tool.isPointOnSegment(s, e, intersectionPoint);\n },\n true,\n wallsInvolved\n );\n return wallsInvolved;\n }\n\n /**\n * Returns whether or not 2 walls share at least one endpoint\n * @param {go.Group} wa\n * @param {go.Group} wb\n * @return {boolean}\n */\n private doWallsShareAnEndpoint(wa: go.Group, wb: go.Group): boolean {\n const tool: WallReshapingTool = this;\n const as: go.Point = wa.data.startpoint;\n const ae: go.Point = wa.data.endpoint;\n const bs: go.Point = wb.data.startpoint;\n const be: go.Point = wb.data.endpoint;\n if (\n tool.pointsApproximatelyEqual(as, bs) ||\n tool.pointsApproximatelyEqual(as, be) ||\n tool.pointsApproximatelyEqual(ae, bs) ||\n tool.pointsApproximatelyEqual(ae, be)\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * This function, called on {@link doMouseUp} event, checks if the reshaping wall's reshaping endpoint is now intersecting a wall.\n * If so, that intersected wall is split into 2 walls at the intersection point. All walls at the intersection point are then mitered.\n * Next, it checks if the reshapingWall has become a new, big wall (via {@link joinColinearWalls}).\n * If so, we must split the new wall at any points it intersects with others.\n * Room boundary data that depended on the split wall is then updated to reflect the split.\n */\n public maybeSplitWall(): void {\n const tool: WallReshapingTool = this;\n if (tool.handle === null) return;\n const adorn: go.Adornment = tool.handle.part as go.Adornment;\n const reshapingWall: go.Group = adorn.adornedPart as go.Group;\n const movingProp: string = tool.handle.name;\n const movingPt: go.Point =\n movingProp === \"sPt\"\n ? reshapingWall.data.startpoint\n : reshapingWall.data.endpoint;\n const jw: go.Set = tool.joinedWalls;\n\n const wallsAtEndpoint: go.List = tool.getAllWallsAtIntersection(\n movingPt\n );\n // exclude the reshapingWall from wallsAtEndpoint\n wallsAtEndpoint.remove(reshapingWall);\n jw.iterator.each((ww: go.Group) => {\n wallsAtEndpoint.remove(ww);\n });\n if (wallsAtEndpoint.count === 1) {\n const wallToSplit: go.Group | null = wallsAtEndpoint.first();\n if (wallToSplit !== null) {\n // make sure this is not an endpoint to endpoint connection\n if (!tool.doWallsShareAnEndpoint(reshapingWall, wallToSplit)) {\n tool.maybePerformWallSplit(wallToSplit, movingPt);\n }\n }\n }\n\n // if we're building a wall, it's possible we need to split at the stationary pt too\n if (tool.isBuilding) {\n const stationaryPt: go.Point =\n movingPt === reshapingWall.data.startpoint\n ? reshapingWall.data.endpoint\n : reshapingWall.data.startpoint;\n const wallsAtStationaryPt: go.List = tool.getAllWallsAtIntersection(\n stationaryPt\n );\n wallsAtStationaryPt.remove(reshapingWall);\n jw.iterator.each((ww: go.Group) => {\n wallsAtEndpoint.remove(ww);\n });\n if (wallsAtStationaryPt.count === 1) {\n const wallToSplit: go.Group | null = wallsAtStationaryPt.first();\n if (wallToSplit !== null) {\n // make sure this is not an endpoint to endpoint connection\n if (!tool.doWallsShareAnEndpoint(reshapingWall, wallToSplit)) {\n tool.maybePerformWallSplit(wallToSplit, stationaryPt);\n }\n }\n }\n }\n\n // if this reshape event has created a big joined wall, the joined wall may need to be split\n // find out if either endpoint of the original reshaping wall is NOT one of the endpoints of joinedWall\n // if so, split the joinedWall at that endpoint\n if (jw !== null) {\n jw.iterator.each((ww: go.Group) => {\n // find all points along the joined wall where it intersects with other walls and split along them\n tool.splitNewWall(ww);\n });\n }\n }\n\n /**\n * Finds all points along a new wall (created via {@link joinColinearWalls}) and splits / miters at each.\n * @param w The newly joined wall\n */\n private splitNewWall(w: go.Group): void {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = this.diagram as Floorplan;\n // find all walls that intersect this wall\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n const ips: go.Set = new go.Set();\n walls.iterator.each((ww: go.Group) => {\n const ip: go.Point | null = fp.getWallsIntersection(w, ww);\n if (ip !== null) {\n ips.add(ip);\n }\n });\n\n ips.iterator.each((ip: go.Point) => {\n const wi: go.List = tool.getAllWallsAtIntersection(ip);\n wi.iterator.each((ww: go.Group) => {\n const s: go.Point = ww.data.startpoint;\n const e: go.Point = ww.data.endpoint;\n if (\n !tool.pointsApproximatelyEqual(s, ip) &&\n !tool.pointsApproximatelyEqual(e, ip)\n ) {\n tool.maybePerformWallSplit(ww, ip);\n }\n });\n });\n }\n\n /**\n * Split a given wall into 2 at a given intersection point, if the given point is on the wall and not on one of the wall's endpoints.\n * The resultant two walls are then mitered.\n * Room boundary data that depended on the split wall is then updated to reflect the split.\n * @param {go.Group} w wall to split\n * @param {go.Point} ip intersection point where the split should occur\n */\n private maybePerformWallSplit(w: go.Group, ip: go.Point): void {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = tool.diagram as Floorplan;\n const s: go.Point = w.data.startpoint;\n const e: go.Point = w.data.endpoint;\n const type: string = w.data.isDivider ? \"Divider\" : \"Wall\";\n // this wall has neither endpoint in the intersection -- it must be split into 2 walls\n const data1 = {\n key: \"wall\",\n category: \"WallGroup\",\n caption: type,\n type,\n color: w.data.color,\n startpoint: s,\n endpoint: ip,\n smpt1: s,\n smpt2: s,\n empt1: ip,\n empt2: ip,\n thickness: w.data.thickness,\n isGroup: true,\n notes: \"\",\n isDivider: w.data.isDivider,\n };\n const data2 = {\n key: \"wall\",\n category: \"WallGroup\",\n caption: type,\n type,\n color: w.data.color,\n startpoint: ip,\n endpoint: e,\n smpt1: ip,\n smpt2: ip,\n empt1: e,\n empt2: e,\n thickness: w.data.thickness,\n isGroup: true,\n notes: \"\",\n isDivider: w.data.isDivider,\n };\n\n // only actually split the wall if the 2 new walls would both have at least length 1\n // and if there are no walls with endpoints very close to these proposed ones\n const l1: number = Math.sqrt(\n data1.startpoint.distanceSquaredPoint(data1.endpoint)\n );\n const l2: number = Math.sqrt(\n data2.startpoint.distanceSquaredPoint(data2.endpoint)\n );\n\n const walls: go.Iterator = fp.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n let alreadyExists = false;\n walls.iterator.each((wc: go.Group) => {\n const ws: go.Point = wc.data.startpoint;\n const we: go.Point = wc.data.endpoint;\n if (\n (tool.pointsApproximatelyEqual(s, ws) &&\n tool.pointsApproximatelyEqual(ip, we)) ||\n (tool.pointsApproximatelyEqual(s, we) &&\n tool.pointsApproximatelyEqual(ip, ws))\n ) {\n alreadyExists = true;\n }\n if (\n (tool.pointsApproximatelyEqual(ip, ws) &&\n tool.pointsApproximatelyEqual(e, we)) ||\n (tool.pointsApproximatelyEqual(ip, we) &&\n tool.pointsApproximatelyEqual(e, ws))\n ) {\n alreadyExists = true;\n }\n });\n\n if (l1 > 1 && l2 > 1 && !alreadyExists) {\n fp.model.addNodeData(data1);\n fp.model.addNodeData(data2);\n const w1: go.Group = fp.findNodeForData(data1) as go.Group;\n const w2: go.Group = fp.findNodeForData(data2) as go.Group;\n\n // Before removing the original wall from the Floorplan, update relevant room boundarywalls data\n // iff this method is being called as a result of a user-prompted wall reshape action\n\n // needed so proper mitering side of replacement entry walls can be determined\n tool.premiterWall(w1);\n tool.premiterWall(w2);\n tool.performMiteringAtPoint(ip, false);\n\n if (tool.handle !== null) {\n const rooms: go.Iterator = fp.findNodesByExample({\n category: \"RoomNode\",\n });\n const adorn: go.Adornment = tool.handle.part as go.Adornment;\n const rw: go.Group = adorn.adornedPart as go.Group; // reshaping wall\n\n // go through rooms, find any whose boundary walls contain w (the wall that was split, soon to be removed)\n rooms.iterator.each((r: go.Node) => {\n const bw: Array = r.data.boundaryWalls;\n for (let i = 0; i < bw.length; i++) {\n const entry: any = bw[i];\n const wk: string = entry[0];\n if (wk === w.data.key) {\n // then, find out if the reshaping wall, at the non-ip endpoint, is connected to another wall in that room's boundary walls\n let isConnectedToBounds = false;\n const nonIpEndpoint: go.Point = tool.pointsApproximatelyEqual(\n rw.data.startpoint,\n ip\n )\n ? rw.data.endpoint\n : rw.data.startpoint;\n const iw: go.List = tool.getAllWallsAtIntersection(\n nonIpEndpoint\n );\n iw.iterator.each((ww: go.Group) => {\n // if boundary walls contains ww and ww is not the reshaping wall, reshaping wall is connected to room boundary walls at non ip endpoint\n for (let j = 0; j < bw.length; j++) {\n const ee: any = bw[j];\n const wk2: string = ee[0];\n if (ww.data.key === wk2 && ww.data.key !== rw.data.key) {\n isConnectedToBounds = true;\n }\n }\n });\n\n // if yes, replace the w entry in boundary walls with just one new entry, using the split wall that is connected to some other wall in bounds\n if (isConnectedToBounds) {\n // find out whether w1 or w2 is connected to another wall in boundary walls\n let isW1ConnectedToBounds = false;\n const w1NonIpEndpoint: go.Point = tool.pointsApproximatelyEqual(\n w1.data.startpoint,\n ip\n )\n ? w1.data.endpoint\n : w1.data.startpoint;\n const iw2: go.List = tool.getAllWallsAtIntersection(\n w1NonIpEndpoint\n );\n iw2.remove(w); // do not include the wall soon to be destroyed\n // go through all walls at w1's non-ip endpoint and find out if one of those is in r's boundary walls\n iw2.iterator.each((ww: go.Group) => {\n for (let j = 0; j < bw.length; j++) {\n const entry2: any = bw[j];\n const wk2: string = entry2[0];\n if (ww.data.key === wk2 && w1.data.key !== ww.data.key) {\n // additional followup -- make sure ww2 is still connected to r's boundary walls at other endpoint (not connected to w1NonIpEndpoint)\n const ww2: go.Group = fp.findNodeForKey(wk2) as go.Group;\n const ww2OtherEndpoint: go.Point = tool.pointsApproximatelyEqual(\n ww2.data.startpoint,\n w1NonIpEndpoint\n )\n ? ww2.data.endpoint\n : ww2.data.startpoint;\n const iw3: go.List = tool.getAllWallsAtIntersection(\n ww2OtherEndpoint\n );\n iw3.iterator.each((ww3: go.Group) => {\n for (let k = 0; k < bw.length; k++) {\n const entry3: any = bw[k];\n const wk3: string = entry3[0];\n if (wk3 === ww3.data.key && wk3 !== ww2.data.key) {\n isW1ConnectedToBounds = true;\n }\n }\n });\n }\n }\n });\n\n // replace this entry of r's boundary walls with the replacementWall\n const replacementWall: go.Group = isW1ConnectedToBounds\n ? w1\n : w2;\n const replacementEntry = tool.getUpdatedEntry(\n entry,\n replacementWall\n );\n\n fp.startTransaction();\n const newBounds: Array = bw.slice();\n newBounds[i] = replacementEntry;\n fp.model.setDataProperty(r.data, \"boundaryWalls\", newBounds);\n fp.commitTransaction();\n } else {\n // if no, replace the w entry with both split walls. Order those 2 entries CC, relative to reshaping wall\n\n // get a List of walls involved (reshaping wall, w1, and w2)\n let wi: go.List = new go.List();\n wi.add(rw);\n wi.add(w1);\n wi.add(w2);\n wi = fp.sortWallsClockwiseWithSetStartWall(wi, rw);\n\n // get replacement entries for the entry with w\n const replacementEntry2: any = tool.getUpdatedEntry(\n entry,\n wi.toArray()[1]\n );\n const replacementEntry1: any = tool.getUpdatedEntry(\n entry,\n wi.toArray()[2]\n );\n\n // insert these replacement entries into the bw at index i, remove\n fp.startTransaction();\n const newBounds: Array = bw.slice();\n newBounds.splice(i, 1, replacementEntry1);\n newBounds.splice(i + 1, 0, replacementEntry2);\n fp.model.setDataProperty(r.data, \"boundaryWalls\", newBounds);\n fp.commitTransaction();\n }\n }\n }\n }); // end rooms iteration\n }\n\n // Maintain wall parts that were on the big wall -- give them new locations on the most appropriate of the split walls, if possible\n const wallParts: go.Iterator = fp.findNodesByExample({\n group: w.data.key,\n });\n const wallsSet: go.Set = new go.Set();\n wallsSet.add(w1);\n wallsSet.add(w2);\n tool.maintainWallParts(wallParts, wallsSet);\n\n // remove original wall\n fp.remove(w);\n\n // perform mitering\n tool.premiterWall(w1);\n tool.premiterWall(w2);\n\n const w1op: go.Point = tool.pointsApproximatelyEqual(\n w1.data.startpoint,\n ip\n )\n ? w1.data.endpoint\n : w1.data.startpoint;\n const w2op: go.Point = tool.pointsApproximatelyEqual(\n w2.data.startpoint,\n ip\n )\n ? w2.data.endpoint\n : w2.data.startpoint;\n\n tool.performMiteringAtPoint(ip, false);\n tool.performMiteringAtPoint(w1op, false);\n tool.performMiteringAtPoint(w2op, false);\n }\n }\n\n /**\n * Go through all walls -- if a wall crosses another at a non-endpoint-to-endpoint connection, split that wall in 2\n * such that only endpoint to endpoint connections exist (this makes mitering much easier).\n * NOTE: Since this goes through all walls in the Floorplan, performance can get bad quickly. Use this method sparingly, if at all\n */\n public splitAllWalls(): void {\n const tool = this;\n\n const intersectionPoints: go.Set = tool.getAllWallIntersectionPoints();\n intersectionPoints.iterator.each((ips: string) => {\n const ip: go.Point = go.Point.parse(ips);\n const wallsInvolved: go.List = tool.getAllWallsAtIntersection(\n ip\n );\n\n // find all walls involved that do not have their start or endpoint at the intersection point\n wallsInvolved.iterator.each((w) => {\n const s: go.Point = w.data.startpoint;\n const e: go.Point = w.data.endpoint;\n if (\n !tool.pointsApproximatelyEqual(s, ip) &&\n !tool.pointsApproximatelyEqual(e, ip)\n ) {\n tool.maybePerformWallSplit(w, ip);\n }\n });\n });\n }\n\n /**\n * Return whether or not wall A is parallel to wall B.\n * @param {go.Group} wa Wall A\n * @param {go.Group} wb Wall B\n * @return {boolean}\n */\n private areWallsParallel(wa: go.Group, wb: go.Group): boolean {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = this.diagram as Floorplan;\n const as: go.Point = wa.data.startpoint;\n const ae: go.Point = wa.data.endpoint;\n const bs: go.Point = wb.data.startpoint;\n const be: go.Point = wb.data.endpoint;\n\n let isParallel = false;\n const a1: number = +as.directionPoint(ae);\n const a2: number = +bs.directionPoint(be);\n if (\n Math.abs(a1 - a2) < 1 ||\n (Math.abs(a1 - a2) > 179 && Math.abs(a1 - a2) < 181)\n ) {\n isParallel = true;\n }\n\n return isParallel;\n }\n\n /**\n * Returns whether wall B is colinear to wall A.\n * Wall A is colinear with Wall B if it:\n * 0) Is the same wall type as Wall B (wall | divider)\n * 1) Is parallel with Wall B\n * 2) Shares an endpoint, 'p', with Wall B, and\n * 2a) Any / all walls with endpoints at p are all parallel to wall A / B\n * @param {go.Group} wa wall A\n * @param {go.Group} wb wall B\n * @return {boolean}\n */\n public isWallColinear(wa: go.Group, wb: go.Group): boolean {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = this.diagram as Floorplan;\n\n if (wa.data.isDivider !== wb.data.isDivider) {\n return false;\n }\n\n const as: go.Point = wa.data.startpoint;\n const ae: go.Point = wa.data.endpoint;\n const bs: go.Point = wb.data.startpoint;\n const be: go.Point = wb.data.endpoint;\n let isColinear = false;\n\n // 1) Is wall A parallel with Wall B? (or close enough to parallel)\n if (tool.areWallsParallel(wa, wb)) {\n // get the endpoint shared by wa and wb, if it exists\n let sharedEndpoint: go.Point | null = null;\n if (\n tool.pointsApproximatelyEqual(as, bs) ||\n tool.pointsApproximatelyEqual(as, be)\n ) {\n sharedEndpoint = as;\n } else if (\n tool.pointsApproximatelyEqual(ae, bs) ||\n tool.pointsApproximatelyEqual(ae, be)\n ) {\n sharedEndpoint = ae;\n }\n\n if (sharedEndpoint !== null) {\n // Make sure all walls with an endpoint at sharedEndpoint are parallel to wa\n const wi: go.List = tool.getAllWallsAtIntersection(\n sharedEndpoint\n );\n let endpointHasNonColinearWall = false;\n wi.iterator.each((w: go.Group) => {\n if (!tool.areWallsParallel(w, wa)) {\n endpointHasNonColinearWall = true;\n }\n });\n\n if (!endpointHasNonColinearWall) {\n isColinear = true;\n }\n }\n }\n return isColinear;\n }\n\n /**\n * Get all walls colinear to wall w and store them in a given Set.\n * @param {go.Group} w\n * @param {go.Set} set Optional\n * @return {go.Set}\n */\n private findAllColinearWalls(\n w: go.Group,\n set?: go.Set\n ): go.Set {\n if (set === null || set === undefined) {\n set = new go.Set();\n }\n // make sure Set contains w\n set.add(w);\n const tool: WallReshapingTool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n const walls: go.Iterator = diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n walls.iterator.each((ow) => {\n if (\n tool.isWallColinear(w, ow) &&\n set !== undefined &&\n !set.contains(ow)\n ) {\n set.add(ow);\n tool.findAllColinearWalls(ow, set);\n }\n });\n return set;\n }\n\n /**\n * This function, called after each {@link doMouseUp} event, checks for colinear pairs of walls at two places.\n * First, it checks for colinear walls with the reshaping wall.\n * Second, it checks for colinear walls at {@link returnPoint}.\n * If there are colinear walls found, they are joined into one big wall. Resultant wall(s) are then mitered.\n * Additionally, any rooms whose geometries depended on one of the walls that was just joined have their data updated,\n * replacing the old (removed) wall(s) in data with the new one.\n * Note: These rooms will have the final update to their geometry / data done later, in updateRoomBoundaries().\n * The data manipulation done here is just to ensure the walls removed by this function are not referenced anywhere in room data anymore.\n */\n public joinColinearWalls(): void {\n const tool: WallReshapingTool = this;\n if (tool.handle === null) return;\n // 1) Check if the reshaping wall is colinear with another wall at one of its endpoints\n const adorn: go.Adornment = tool.handle.part as go.Adornment;\n const reshapingWall: go.Group = adorn.adornedPart as go.Group;\n const cw1: go.Set = tool.findAllColinearWalls(reshapingWall);\n const jw: go.Group | null = tool.performColinearWallJoining(\n cw1,\n reshapingWall\n );\n if (jw !== null) {\n tool.joinedWalls.add(jw);\n }\n\n // 2) Check if there are 2 colinear walls at returnPoint (where the reshaping endpoint originally was)\n const wallsAtReturnPoint: go.List = tool.getAllWallsAtIntersection(\n tool.returnPoint\n );\n if (wallsAtReturnPoint.count === 2) {\n const wallsArr: Array = wallsAtReturnPoint.toArray();\n const w1: go.Group = wallsArr[0];\n const w2: go.Group = wallsArr[1];\n if (tool.isWallColinear(w1, w2)) {\n const cw2: go.Set = new go.Set();\n cw2.add(w1);\n cw2.add(w2);\n const jw2: go.Group | null = tool.performColinearWallJoining(cw2, w1);\n if (jw2 !== null) {\n tool.joinedWalls.add(jw2);\n }\n }\n }\n }\n\n /**\n * Join a set of colinear walls into one big wall. The big wall is then mitered.\n * Constituent walls in colinear wall set are removed.\n * As such, if any rooms depend on them for boundary data, those room's data is updated\n * @param {go.Set} colinearWalls The set of colinear walls\n * @param {go.Group} w The wall to use as reference for color / thickness when joining the walls.\n * If this is not supplied, the first wall in the colinearWalls set is used\n * @return {go.Group | null} The new, big wall created by joining colinear walls\n */\n private performColinearWallJoining(\n colinearWalls: go.Set,\n w?: go.Group\n ): go.Group | null {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = tool.diagram as Floorplan;\n const garbage: go.Set = new go.Set();\n\n // all colinear \"walls\" must be Walls OR they must all be Room Dividers, they may not be a mix\n const cwf = colinearWalls.first();\n if (cwf === null) {\n return null;\n }\n\n if (w === undefined) {\n w = cwf;\n }\n\n const acceptedCategory: string = cwf.data.category;\n colinearWalls.iterator.each((cw: go.Group) => {\n if (cw.data.category !== acceptedCategory) {\n return;\n }\n });\n\n // Find the 2 farthest endpoints in colinear walls set\n if (colinearWalls.count > 1) {\n let pt1: go.Point | null = null;\n let pt2: go.Point | null = null;\n let farthestDist = 0;\n const cw2: go.Set = colinearWalls.copy();\n\n // remember all the wall parts (doors / windows) that the colinear walls have\n const wallParts: go.Set = new go.Set();\n\n // iterate over colinear walls, finding the furthest distance between all endpoints\n colinearWalls.iterator.each((cw1: go.Group) => {\n // get all wallParts that belong to cw1 and add them to wallParts Set\n const cwParts: go.Iterator = fp.findNodesByExample({\n group: cw1.data.key,\n });\n wallParts.addAll(cwParts);\n\n cw2.iterator.each((cw2w: go.Group) => {\n const s1: go.Point = cw1.data.startpoint;\n const e1: go.Point = cw1.data.endpoint;\n const s2: go.Point = cw2w.data.startpoint;\n const e2: go.Point = cw2w.data.endpoint;\n const pts1: Array = [s1, e1];\n const pts2: Array = [s2, e2];\n for (let i = 0; i < pts1.length; i++) {\n const p1: go.Point = pts1[i];\n for (let j = 0; j < pts2.length; j++) {\n const p2: go.Point = pts2[j];\n const dist: number = Math.sqrt(p1.distanceSquaredPoint(p2));\n if (dist > farthestDist) {\n farthestDist = dist;\n pt1 = p1;\n pt2 = p2;\n }\n }\n }\n });\n\n // all colinear walls will be destroyed later (after replaced by one big wall)\n garbage.add(cw1);\n }); // end colinearWalls iteration\n\n // we should now have the farthest points the colinear walls make -- just add a single wall with those endpoints\n const data = {\n key: \"wall\",\n category: \"WallGroup\",\n caption: \"Wall\",\n type: \"Wall\",\n color: w.data.color,\n startpoint: pt1,\n endpoint: pt2,\n smpt1: pt1,\n smpt2: pt1,\n empt1: pt2,\n empt2: pt2,\n thickness: w.data.thickness,\n isGroup: true,\n notes: \"\",\n };\n fp.model.addNodeData(data);\n const newWall: go.Group = fp.findNodeForData(data) as go.Group;\n\n // Before the constituent walls are removed from Floorplan, update relevant room boundaryWalls\n // find all rooms that have any of the colinear walls in this roomBoundaryWalls or holes\n // replace those entries with constituent walls with the new wall key\n // make sure the mitering side is analogous to what it was with the consituent wall too\n const rooms: go.Iterator = fp.findNodesByExample({\n category: \"RoomNode\",\n });\n rooms.iterator.each((r: go.Node) => {\n const bw: Array = r.data.boundaryWalls;\n\n // replace entries in boundaryWalls with references to soon-to-be nonexistent walls\n for (let i = 0; i < bw.length; i++) {\n const e = bw[i];\n const wk: string = e[0];\n const ww: go.Group = fp.findNodeForKey(wk) as go.Group;\n if (colinearWalls.contains(ww)) {\n // ???\n tool.performMiteringOnWall(newWall);\n\n const newEntry = tool.getUpdatedEntry(e, newWall);\n // replace the old entry with the new one\n fp.startTransaction();\n const newBounds: Array = bw.slice();\n newBounds[i] = newEntry;\n fp.model.setDataProperty(r.data, \"boundaryWalls\", newBounds);\n fp.commitTransaction();\n }\n } // end boundary walls outdated entry replacement\n }); // end rooms iteration\n\n // Maintain relative position of all wall parts\n const newWallSet: go.Set = new go.Set();\n newWallSet.add(newWall);\n tool.performMiteringOnWall(newWall);\n tool.maintainWallParts(wallParts, newWallSet);\n\n // remove the constituent walls from Floorplan\n garbage.iterator.each((ww: go.Group) => {\n fp.remove(ww);\n });\n\n // perform mitering on the new, big wall\n tool.performMiteringOnWall(newWall);\n return newWall;\n }\n return null;\n }\n\n /**\n * Given a set of wall parts (doors, windows) and a set of walls, place the wall parts on the proper wall based on its location, if possible.\n * @param {go.Iterable} wallParts\n * @param {go.Iterable} walls\n */\n private maintainWallParts(\n wallParts: go.Iterable,\n walls: go.Iterable\n ): void {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = tool.diagram as Floorplan;\n const garbage: Array = [];\n wallParts.iterator.each((wp: go.Node) => {\n const loc: go.Point = wp.location;\n // find the wall that has this loc in its geometry's boundaries\n walls.iterator.each((w: go.Group) => {\n if (fp.isPointInWall(w, loc)) {\n const newLoc: go.Point | null = fp.findClosestLocOnWall(w, wp);\n // if the wall part can fit on this wall, add it to the wall\n if (newLoc !== null) {\n fp.model.setDataProperty(wp.data, \"group\", w.data.key);\n wp.location = newLoc.projectOntoLineSegmentPoint(\n w.data.startpoint,\n w.data.endpoint\n );\n // wp.angle = w.data.startpoint.directionPoint(w.data.endpoint);\n if (wp.category === \"WindowNode\") {\n fp.model.setDataProperty(wp.data, \"height\", w.data.thickness);\n }\n if (wp.category === \"DoorNode\") {\n fp.model.setDataProperty(\n wp.data,\n \"doorOpeningHeight\",\n w.data.thickness\n );\n }\n } else {\n // otherwise, remove it from the diagram\n garbage.push(wp);\n }\n }\n });\n });\n\n for (let i = 0; i < garbage.length; i++) {\n fp.remove(garbage[i]);\n }\n }\n\n /**\n * Get a replacement entry in a room's boundaryWalls or hole path for an old entry that used one of the walls\n * that was just joined together (since that wall won't exist anymore in just a moment).\n * This will replace the old entry's wall key (Array element 0) with newWall.key.\n * It will also make sure the mitering side of the replacement entry is analogous to the mitering side of the old entry.\n * @param {Array} oldEntry the old entry to replace\n * @param {go.Group} nw new wall\n * @return {Array} The updated entry with the new wall and analogous mitering side\n */\n private getUpdatedEntry(oldEntry: Array, nw: go.Group): Array {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = tool.diagram as Floorplan;\n const oldWallKey: string = oldEntry[0];\n const oldWall: go.Group = fp.findNodeForKey(oldWallKey) as go.Group;\n const oldMiteringSide: number = oldEntry[1];\n const newEntry: Array = [nw.data.key, null];\n\n // Get the mitering side of newWall that is analogous to the mitering side of oldWall\n // see if the distance between the midpoint between newWall.smpt1 and newWall.empt1 is closer to oldWall's oldMiteringSide\n // if so, use 1 as new mitering side. Else use 2\n const oms: go.Point = oldWall.data[\"smpt\" + oldMiteringSide];\n const ome: go.Point = oldWall.data[\"empt\" + oldMiteringSide];\n\n /**\n * Get the point on a line at a given x value\n * @param {go.Point} a line point 1\n * @param {go.Point} b line point 2\n * @param {number} x x coordinate\n * @return {go.Point}\n */\n function pointAtX(a: go.Point, b: go.Point, x: number): go.Point {\n const slope: number = (b.y - a.y) / (b.x - a.x);\n const y: number = a.y + (x - a.x) * slope;\n return new go.Point(x, y);\n }\n\n // Get the point on the line implied by oms and ome at nw.smpt1 and nw.smpt2\n const pt1: go.Point = pointAtX(oms, ome, nw.data.smpt1.x);\n const pt2: go.Point = pointAtX(oms, ome, nw.data.smpt2.x);\n\n const dist1: number = nw.data.smpt1.distanceSquaredPoint(pt1);\n const dist2: number = nw.data.smpt2.distanceSquaredPoint(pt2);\n\n if (dist1 < dist2) {\n newEntry[1] = 1;\n } else {\n newEntry[1] = 2;\n }\n\n return newEntry;\n }\n\n /**\n * Join all sets of colinear walls in the Floorplan.\n * Note: This can get expensive quickly, as it goes over every single wall in the Floorplan. Use this method sparingly, if at all.\n * It may be better to call {@link joinColinearWalls}\n */\n public joinAllColinearWalls(): void {\n const tool: WallReshapingTool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n const walls: go.Iterator = diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n // const garbage: go.Set = new go.Set();\n const handledWalls: go.Set = new go.Set();\n\n // iterate over all walls\n walls.iterator.each((w: go.Group) => {\n if (!handledWalls.contains(w)) {\n handledWalls.add(w);\n\n // find all walls connected to an endpoint of this wall w that are also parallel\n const colinearWalls = new go.Set();\n colinearWalls.add(w);\n\n tool.findAllColinearWalls(w, colinearWalls);\n handledWalls.addAll(colinearWalls);\n\n tool.performColinearWallJoining(colinearWalls, w);\n } // end handledWalls check\n }); // end walls iteration\n\n tool.premiterAllWalls();\n }\n\n /**\n * Get a point a given distance away from a given point at a given angle\n * @param {go.Point} point\n * @param {number} angle\n * @param {number} offset\n * @return {go.Point}\n */\n public translateAndRotatePoint(\n point: go.Point,\n angle: number,\n offset: number\n ): go.Point {\n const oldPoint: go.Point = point.copy();\n const newPoint: go.Point = point.copy();\n newPoint.offset(0, offset);\n newPoint\n .offset(-oldPoint.x, -oldPoint.y)\n .rotate(angle)\n .offset(oldPoint.x, oldPoint.y);\n return newPoint;\n }\n\n /**\n * Set a wall's mitering points in data to points thickness/2 distance from start/endpoint at perpindicular angle\n * Then, update the wall to reflect this new geometry\n * @param {go.Group} w\n * @param {string} prop Optional: 'smpt1' | 'smpt2' | 'empt1' | 'empt2'. If this is provided, only premiter that point of the wall\n */\n private premiterWall(w: go.Group, prop?: string): void {\n const tool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n\n const ang: number = w.data.startpoint.directionPoint(w.data.endpoint);\n const t: number = w.data.thickness;\n const sp: go.Point = w.data.startpoint;\n const ep: go.Point = w.data.endpoint;\n\n switch (prop) {\n case \"smpt1\": {\n const smp1: go.Point = tool.translateAndRotatePoint(sp, ang, t / 2);\n diagram.model.setDataProperty(w.data, \"smpt1\", smp1);\n break;\n }\n\n case \"smpt2\": {\n const smp2: go.Point = tool.translateAndRotatePoint(\n sp,\n ang + 180,\n t / 2\n );\n diagram.model.setDataProperty(w.data, \"smpt2\", smp2);\n break;\n }\n\n case \"empt1\": {\n const emp1: go.Point = tool.translateAndRotatePoint(ep, ang, t / 2);\n diagram.model.setDataProperty(w.data, \"empt1\", emp1);\n break;\n }\n\n case \"empt2\": {\n const emp2: go.Point = tool.translateAndRotatePoint(\n ep,\n ang + 180,\n t / 2\n );\n diagram.model.setDataProperty(w.data, \"empt2\", emp2);\n break;\n }\n\n default: {\n // Perpindicular mitering points (updated later during mitering function)\n // end miterpoint point 1 is the point \"below\" endpoint (add vector)\n const emp1: go.Point = tool.translateAndRotatePoint(ep, ang, t / 2);\n diagram.model.setDataProperty(w.data, \"empt1\", emp1);\n // end mitering point 2 is the point \"above\" endpoint (subtract vector)\n const emp2: go.Point = tool.translateAndRotatePoint(\n ep,\n ang + 180,\n t / 2\n );\n diagram.model.setDataProperty(w.data, \"empt2\", emp2);\n\n // start mitering point 1 is the point \"below\" startpoint (add vector)\n const smp1: go.Point = tool.translateAndRotatePoint(sp, ang, t / 2);\n diagram.model.setDataProperty(w.data, \"smpt1\", smp1);\n // end mitering point 2 is the point \"above\" endpoint (subtract vector)\n const smp2: go.Point = tool.translateAndRotatePoint(\n sp,\n ang + 180,\n t / 2\n );\n diagram.model.setDataProperty(w.data, \"smpt2\", smp2);\n break;\n }\n }\n\n diagram.updateWall(w);\n }\n\n /**\n * Goes through all walls and sets their mitering points in data to points\n * thickness/2 distance from start/endpoint at perpindicular angle\n * Note: Since this method goes through all walls in the Floorplan, it can get expensive quickly. Use this method sparingly, if at all.\n */\n private premiterAllWalls(): void {\n const tool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n\n const walls: go.Iterator = diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n walls.iterator.each((w) => {\n tool.premiterWall(w);\n });\n }\n\n /**\n * Perform corner mitering at both endpoints of a given wall\n * @param {go.Group} w The wall to perform corner mitering on\n */\n public performMiteringOnWall(w: go.Group): void {\n const tool: WallReshapingTool = this;\n const sp: go.Point = w.data.startpoint;\n const ep: go.Point = w.data.endpoint;\n tool.premiterWall(w);\n tool.performMiteringAtPoint(sp, true);\n tool.performMiteringAtPoint(ep, true);\n }\n\n /**\n * Perform corner mitering on all walls that interesct at a given point.\n * This is a more granular, cheaper operation than the larger scale {@link performAllMitering} function.\n * @param {go.Point} pt The point to perform mitering at\n * @param {boolea} performPremitering Whether or not to perform pre-miterign before this op. If true, premitering will only be done at the endpoint of walls equal to pt\n */\n public performMiteringAtPoint(\n pt: go.Point,\n performPremitering?: boolean\n ): void {\n if (performPremitering === null || performPremitering === undefined) {\n performPremitering = true;\n }\n const tool: WallReshapingTool = this;\n const fp: Floorplan = tool.diagram as Floorplan;\n // walls involved at intersection point\n const wi: go.List = tool.getAllWallsAtIntersection(pt, false);\n\n // premiter each wall in wi, maybe\n if (performPremitering) {\n wi.iterator.each((w: go.Group) => {\n // only perform premiter on w if one of w's endpoints is ot\n if (\n tool.pointsApproximatelyEqual(w.data.startpoint, pt) ||\n tool.pointsApproximatelyEqual(w.data.endpoint, pt)\n ) {\n // which of w's endpoints is pt?\n const prop: string = tool.pointsApproximatelyEqual(\n w.data.startpoint,\n pt\n )\n ? \"s\"\n : \"e\";\n tool.premiterWall(w, prop + \"mpt1\");\n tool.premiterWall(w, prop + \"mpt2\");\n }\n });\n }\n\n // sort all involved walls in any COUNTERCLOCWISE order\n wi.sort((a: go.Group, b: go.Group) => {\n const B: go.Point | null = fp.getWallsIntersection(a, b);\n if (B === null) return 0;\n const as: go.Point = a.data.startpoint;\n const ae: go.Point = a.data.endpoint;\n const bs: go.Point = b.data.startpoint;\n const be: go.Point = b.data.endpoint;\n const A: go.Point = tool.pointsApproximatelyEqual(pt, as) ? ae : as;\n const C: go.Point = tool.pointsApproximatelyEqual(pt, bs) ? be : bs;\n\n const angA: number = B.directionPoint(A);\n const angB: number = B.directionPoint(C);\n if (angA > angB) return 1;\n else if (angA < angB) return -1;\n else return 0;\n });\n wi.reverse();\n\n const wiArr: Array = wi.toArray();\n for (let i = 0; i < wiArr.length; i++) {\n const wa: go.Group = wiArr[i];\n let wb: go.Group | null = null;\n if (i + 1 === wiArr.length) {\n wb = wiArr[0];\n } else {\n wb = wiArr[i + 1];\n }\n // only miter these 2 walls if they are both walls or if they are both room dividers. no mixing\n // if (wa.data.isDivider === wb.data.isDivider) {\n tool.performMitering(wa, wb);\n // }\n }\n }\n\n /**\n * Performs all mitering for all walls in Floorplan.\n * Note: Since this method goes through all walls in the Floorplan, it can get expensive quickly. Use this method sparingly, if at all.\n */\n public performAllMitering(): void {\n const tool = this;\n const diagram: Floorplan = tool.diagram as Floorplan;\n\n tool.premiterAllWalls();\n const intersectionPoints: go.Set = tool.getAllWallIntersectionPoints();\n\n // iterate over all points where walls intersect\n intersectionPoints.iterator.each((ips: string) => {\n const ip: go.Point = go.Point.parse(ips);\n // get all walls involved in intersection\n const wallsInvolved: go.List = tool.getAllWallsAtIntersection(\n ip\n );\n\n // sort all involved walls in any COUNTERCLOCWISE order\n wallsInvolved.sort((a: go.Group, b: go.Group) => {\n const B: go.Point | null = diagram.getWallsIntersection(a, b);\n if (B === null) return 0;\n const as: go.Point = a.data.startpoint;\n const ae: go.Point = a.data.endpoint;\n const bs: go.Point = b.data.startpoint;\n const be: go.Point = b.data.endpoint;\n const A: go.Point = tool.pointsApproximatelyEqual(ip, as) ? ae : as;\n const C: go.Point = tool.pointsApproximatelyEqual(ip, bs) ? be : bs;\n\n const angA: number = B.directionPoint(A);\n const angB: number = B.directionPoint(C);\n if (angA > angB) return 1;\n else if (angA < angB) return -1;\n else return 0;\n });\n\n wallsInvolved.reverse();\n\n // iterate over wallsInvolved, performing cc mitering on each pair\n const wi: Array = wallsInvolved.toArray();\n for (let i = 0; i < wi.length; i++) {\n const wa: go.Group = wi[i];\n let wb: go.Group | null = null;\n if (i + 1 === wi.length) {\n wb = wi[0];\n } else {\n wb = wi[i + 1];\n }\n // only miter these 2 walls if they are both walls or if they are both room dividers. no mixing\n // if (wa.data.isDivider === wb.data.isDivider) {\n tool.performMitering(wa, wb);\n // }\n }\n }); // end iterate over intersection points\n } // end performAllMitering\n\n /**\n * Checks whether segment AB is clockwise of segment BC.\n * B must be the intersection point.\n * @param {go.Point} a\n * @param {go.Point} b\n * @param {go.Point} c\n * @return {boolean}\n */\n private isClockwise(a: go.Point, b: go.Point, c: go.Point): boolean {\n return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x) > 0;\n }\n\n /**\n * Check if point c is on the segment between points a and b\n * @param {go.Point} a\n * @param {go.Point} b\n * @param {go.Point} c\n * @return {boolean}\n */\n private isPointOnSegment(a: go.Point, b: go.Point, c: go.Point): boolean {\n const ac: number = Math.sqrt(a.distanceSquaredPoint(c));\n const bc: number = Math.sqrt(b.distanceSquaredPoint(c));\n const ab: number = Math.sqrt(a.distanceSquaredPoint(b));\n if (Math.abs(ab - (ac + bc)) <= 0.1) {\n return true;\n }\n return false;\n }\n\n /**\n * Joins colinear walls, splits walls, performs mitering, ommits transaction, stops tool.\n */\n public doMouseUp(): void {\n const tool: WallReshapingTool = this;\n const fp: Floorplan = this.diagram as Floorplan;\n if (tool.handle === null) return;\n\n tool.doMouseMove();\n\n const adorn: go.Adornment = tool.handle.part as go.Adornment;\n const wall: go.Group = adorn.adornedPart as go.Group;\n\n tool.joinColinearWalls();\n tool.maybeSplitWall();\n\n // reset joinedWall\n tool.joinedWalls.clear();\n\n // update all rooms TODO only update relevant rooms\n const set: go.Set = new go.Set();\n set.add(wall);\n fp.updateAllRoomBoundaries(set);\n\n // update scale length\n if (wall.category === \"ScaleGroup\") {\n if (!wall.data.scaleLength || wall.data.scaleLength === '0.00') {\n const floorplan = wall.diagram as Floorplan;\n const pxDist = Math.sqrt(\n ((wall.data.startpoint.x - wall.data.endpoint.x) * (wall.data.startpoint.x - wall.data.endpoint.x)) +\n ((wall.data.startpoint.y - wall.data.endpoint.y) * (wall.data.startpoint.y - wall.data.endpoint.y))\n );\n const unitsDist = convertPixelsToUnits(pxDist, floorplan.model.modelData.unitsConversionFactor).toFixed(2);\n // link.length = unitsDist;\n const unitsAbbreviation = floorplan.model.modelData.unitsAbbreviation;\n const val = unitsDist.toString() + unitsAbbreviation;\n\n getsetFunctions.setValue(wall, { property: 'scaleLength' }, val);\n }\n // const scaleLength = getterFc(this.inspectedObject, prop);\n }\n\n this.stopTool();\n }\n\n /**\n * End the wall reshaping transaction.\n * If a wall is reshaped to less than 1 document unit long, remove it from the Floorplan.\n * If tool was cancelled with Esc key, reset reshaping wall / wall parts to what they were before.\n * Remove guidelines and update wall dimension links. Commit transaction.\n */\n public doDeactivate(): void {\n const diagram: go.Diagram = this.diagram;\n const fp: Floorplan = diagram as Floorplan;\n // if a wall reshaped to length < 1 px, remove it\n if (this.handle === null) return;\n const adorn: go.Adornment = this.handle.part as go.Adornment;\n const wall: go.Group = adorn.adornedPart as go.Group;\n const sPt: go.Point = wall.data.startpoint;\n const ePt: go.Point = wall.data.endpoint;\n const length: number = Math.sqrt(sPt.distanceSquared(ePt.x, ePt.y));\n if (length < 1) {\n diagram.remove(wall); // remove wall\n wall.memberParts.iterator.each((member) => {\n diagram.remove(member);\n }); // remove wall's parts\n const wallDimensionLinkPointNodes: Array = [];\n fp.pointNodes.iterator.each((node) => {\n if (node.data.key.indexOf(wall.data.key) !== -1)\n wallDimensionLinkPointNodes.push(node);\n });\n if (wallDimensionLinkPointNodes.length === 2) {\n diagram.remove(wallDimensionLinkPointNodes[0]);\n diagram.remove(wallDimensionLinkPointNodes[1]);\n }\n }\n\n // remove wall's dimension links if tool cancelled via esc key\n if (diagram.lastInput.key === \"Esc\" && !this.isBuilding) {\n diagram.skipsUndoManager = true;\n diagram.startTransaction(\"reset to old data\");\n if (this.handle.name === \"sPt\") wall.data.startpoint = this.returnPoint;\n else wall.data.endpoint = this.returnPoint;\n\n this.performAllMitering();\n\n fp.updateWall(wall);\n\n if (this.returnData) {\n this.returnData.iterator.each(\n (kvp: go.KeyValuePair) => {\n const key: string = kvp.key;\n const loc: go.Point = kvp.value;\n const wallPart: go.Node = diagram.findPartForKey(key) as go.Node;\n wallPart.location = loc;\n wallPart.rotateObject.angle = wall.rotateObject.angle;\n }\n );\n }\n diagram.commitTransaction(\"reset to old data\");\n diagram.skipsUndoManager = false;\n }\n\n // remove guide line point nodes\n const glPoints: go.Iterator = this.diagram.findNodesByExample({\n category: \"GLPointNode\",\n });\n diagram.removeParts(glPoints, true);\n\n fp.updateWallDimensions();\n\n // commit transaction, deactivate tool\n diagram.commitTransaction(this.name);\n this.isActive = false;\n }\n\n /**\n * Creates an adornment with 2 handles\n * @param {go.Shape} selelt The adorned wall's Shape element\n * @return {go.Adornment}\n */\n public makeAdornment(selelt: go.Shape): go.Adornment {\n const adornment: go.Adornment = new go.Adornment();\n adornment.type = go.Panel.Spot;\n adornment.locationObjectName = \"BODY\";\n adornment.locationSpot = go.Spot.Center;\n let h: go.Shape = new go.Shape();\n h.name = \"BODY\";\n h.fill = null;\n h.stroke = null;\n h.strokeWidth = 0;\n adornment.add(h);\n\n h = this.makeHandle();\n h.name = \"sPt\";\n adornment.add(h);\n h = this.makeHandle();\n h.name = \"ePt\";\n adornment.add(h);\n\n adornment.category = this.name;\n adornment.adornedObject = selelt;\n return adornment;\n }\n\n /**\n * Creates a basic handle archetype (a small blue diamond)\n * @return {go.Shape}\n */\n public makeHandle(): go.Shape {\n const h: go.Shape = this.handleArchetype;\n return h.copy();\n }\n\n /**\n * Calculate the angle and length made from the mousepoint and the non-moving handle; used to reshape wall when holding SHIFT\n * @param {go.Point} mousePt The mouse cursors coordinate position\n */\n public calcAngleAndLengthFromHandle(mousePt: go.Point): void {\n const tool: WallReshapingTool = this;\n const h: go.GraphObject | null = this.handle;\n if (h === null) return;\n if (tool.adornedShape === null) return;\n let otherH: go.GraphObject | null = null;\n const node: go.Part | null = tool.adornedShape.part;\n if (node === null) return;\n const adornments: go.Iterator = node.adornments.iterator;\n let adornment: go.Adornment | undefined;\n while (adornments.next()) {\n const a = adornments.value;\n if (a.category === tool.name) {\n adornment = a;\n }\n }\n if (adornment === undefined) return;\n const atr = adornment.elements;\n while (atr.next()) {\n const e: go.GraphObject = atr.value;\n if (e.name !== undefined && e.name !== h.name) {\n otherH = e;\n }\n }\n\n // calc angle from otherH against the horizontal\n if (otherH === null) return;\n const otherHandlePt: go.Point = otherH.getDocumentPoint(go.Spot.Center);\n\n const deltaY: number = mousePt.y - otherHandlePt.y;\n const deltaX: number = mousePt.x - otherHandlePt.x;\n let angle: number = Math.atan2(deltaY, deltaX) * (180 / Math.PI);\n // because atan2 goes from -180 to +180 and we want it to be 0-360\n // so -90 becomes 270, etc.\n if (angle < 0) angle += 360;\n tool.angle = angle;\n\n const distanceBetween: number = Math.sqrt(\n mousePt.distanceSquared(otherHandlePt.x, otherHandlePt.y)\n );\n tool.length = distanceBetween;\n }\n\n /**\n * Takes a point -- returns a new point that is closest to the original point that conforms to the grid snap\n * @param {go.Point} point The point to snap to grid\n * @return {go.Point}\n */\n public snapPointToGrid(point: go.Point): go.Point {\n const diagram: go.Diagram = this.diagram;\n const gs: number = diagram.toolManager.draggingTool.isGridSnapEnabled\n ? diagram.model.modelData.gridSize\n : 1;\n const newx: number = gs * Math.round(point.x / gs);\n const newy: number = gs * Math.round(point.y / gs);\n const newPt: go.Point = new go.Point(newx, newy);\n return newPt;\n }\n\n /**\n * Reshapes the wall's geometry, updates model data\n * @param {go.Point} newPoint The point to move the reshaping wall's reshaping endpoint to\n */\n public reshape(newPoint: go.Point): void {\n const diagram: go.Diagram = this.diagram;\n const tool: WallReshapingTool = this;\n const shape: go.Shape | null = this.adornedShape;\n if (shape === null) return;\n if (tool.handle === null) return;\n const node: go.Group = shape.part as go.Group;\n if (node === null) return;\n\n // if user holds SHIFT, make angle between startPoint / endPoint and the horizontal line a multiple of 45\n if (this.diagram.lastInput.shift && !this.isIntersecting) {\n let sPt: go.Point; // the stationary point -- the point at the handle that is not being adjusted\n if (tool.handle.name === \"sPt\") sPt = node.data.endpoint;\n else sPt = node.data.startpoint;\n\n const oldGridSize: number = diagram.model.modelData.gridSize;\n let gridSize: number = diagram.model.modelData.gridSize;\n // if gridSnapping is disabled, just set 'gridSize' var to 1 so it doesn't affect endPoint calculations\n if (!this.diagram.toolManager.draggingTool.isGridSnapEnabled)\n gridSize = 1;\n\n // these are set in mouseMove's call to calcAngleAndLengthFromHandle()\n const angle: number = tool.angle;\n const length: number = tool.length;\n\n // snap to 90 degrees\n if (angle > 67.5 && angle < 112.5) {\n let newy: number = sPt.y + length;\n newy = gridSize * Math.round(newy / gridSize);\n newPoint = new go.Point(sPt.x, newy);\n }\n // snap to 180 degrees\n if (angle > 112.5 && angle < 202.5) {\n let newx: number = sPt.x - length;\n newx = gridSize * Math.round(newx / gridSize);\n newPoint = new go.Point(newx, sPt.y);\n }\n // snap to 270 degrees\n if (angle > 247.5 && angle < 292.5) {\n let newy: number = sPt.y - length;\n newy = gridSize * Math.round(newy / gridSize);\n newPoint = new go.Point(sPt.x, newy);\n }\n // snap to 360 degrees\n if (angle > 337.5 || angle < 22.5) {\n let newx: number = sPt.x + length;\n newx = gridSize * Math.round(newx / gridSize);\n newPoint = new go.Point(newx, sPt.y);\n }\n // snap to 45 degrees\n if (angle > 22.5 && angle < 67.5) {\n let newx: number = Math.sin(0.785) * length;\n newx = gridSize * Math.round(newx / gridSize) + sPt.x;\n let newy: number = Math.cos(0.785) * length;\n newy = gridSize * Math.round(newy / gridSize) + sPt.y;\n newPoint = new go.Point(newx, newy);\n }\n // snap to 135 degrees\n if (angle > 112.5 && angle < 157.5) {\n let newx: number = Math.sin(0.785) * length;\n newx = sPt.x - gridSize * Math.round(newx / gridSize);\n let newy: number = Math.cos(0.785) * length;\n newy = gridSize * Math.round(newy / gridSize) + sPt.y;\n newPoint = new go.Point(newx, newy);\n }\n // snap to 225 degrees\n if (angle > 202.5 && angle < 247.5) {\n let newx: number = Math.sin(0.785) * length;\n newx = sPt.x - gridSize * Math.round(newx / gridSize);\n let newy: number = Math.cos(0.785) * length;\n newy = sPt.y - gridSize * Math.round(newy / gridSize);\n newPoint = new go.Point(newx, newy);\n }\n // snap to 315 degrees\n if (angle > 292.5 && angle < 337.5) {\n let newx: number = Math.sin(0.785) * length;\n newx = sPt.x + gridSize * Math.round(newx / gridSize);\n let newy: number = Math.cos(0.785) * length;\n newy = sPt.y - gridSize * Math.round(newy / gridSize);\n newPoint = new go.Point(newx, newy);\n }\n gridSize = oldGridSize; // set gridSize back to what it used to be in case gridSnap is enabled again\n }\n if (\n this.diagram.toolManager.draggingTool.isGridSnapEnabled &&\n !tool.isIntersecting &&\n !this.diagram.lastInput.shift\n ) {\n newPoint = this.snapPointToGrid(newPoint);\n } else {\n newPoint = new go.Point(newPoint.x, newPoint.y);\n }\n\n const type: string = tool.handle.name;\n if (type === undefined) return;\n const stationaryPt: go.Point =\n type === \"sPt\" ? node.data.endpoint : node.data.startpoint;\n const movingPt: go.Point =\n type === \"sPt\" ? node.data.startpoint : node.data.endpoint;\n\n this.reshapeWall(node, stationaryPt, movingPt, newPoint, diagram);\n\n this.updateAdornments(node);\n this.showMatches();\n const fp: Floorplan = diagram as Floorplan;\n fp.updateWallDimensions();\n } // end reshape()\n\n /**\n * Show if the wall (at the adjustment handle being moved) lines up with other wall edges\n */\n public showMatches(): void {\n const tool: WallReshapingTool = this;\n const diagram: go.Diagram = tool.diagram;\n if (!diagram.model.modelData.preferences.showWallGuidelines) return;\n if (tool.adornedShape === null) return;\n if (tool.handle === null) return;\n const wall: go.Group = tool.adornedShape.part as go.Group;\n let comparePt: go.Point;\n if (tool.handle.name === \"sPt\") comparePt = wall.data.startpoint;\n else comparePt = wall.data.endpoint;\n\n // the wall attached to the handle being manipulated\n const hWall: go.Part | null = tool.adornedShape.part;\n\n // delete any old guideline points (these are used to show guidelines, must be cleared before a new guideline can be shown)\n const glPoints: go.Iterator = diagram.findNodesByExample({\n category: \"GLPointNode\",\n }) as go.Iterator;\n diagram.removeParts(glPoints, true);\n\n const walls: go.Iterator = this.diagram.findNodesByExample({\n category: \"WallGroup\",\n }) as go.Iterator;\n walls.iterator.each((w) => {\n if (hWall !== null && w.data.key !== hWall.data.key) {\n const shape: go.Shape = w.findObject(\"SHAPE\") as go.Shape;\n\n const pt1: go.Point = w.data.startpoint;\n const pt2: go.Point = w.data.endpoint;\n\n tool.checkPtLinedUp(pt1, comparePt.x, pt1.x, comparePt);\n tool.checkPtLinedUp(pt1, comparePt.y, pt1.y, comparePt);\n tool.checkPtLinedUp(pt2, comparePt.x, pt2.x, comparePt);\n tool.checkPtLinedUp(pt2, comparePt.y, pt2.y, comparePt);\n }\n });\n }\n\n /**\n * Checks if there exists a horiontal or vertical line (decided by 'coord' parameter) between pt and compare pt\n * if so, draws a link between the two, letting the user know the wall they're reshaping lines up with another's edge\n * @param {go.Point} pt\n * @param {number} comparePtCoord\n * @param {number} ptCoord\n * @param {go.Point} comparePt\n */\n public checkPtLinedUp(\n pt: go.Point,\n comparePtCoord: number,\n ptCoord: number,\n comparePt: go.Point\n ): void {\n function makeGuideLinePoint() {\n const $ = go.GraphObject.make;\n return $(\n go.Node,\n \"Spot\",\n {\n locationSpot: go.Spot.TopLeft,\n locationObjectName: \"SHAPE\",\n desiredSize: new go.Size(1, 1),\n },\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(\n go.Point.stringify\n ),\n $(go.Shape, {\n stroke: null,\n strokeWidth: 1,\n name: \"SHAPE\",\n fill: \"black\",\n })\n );\n }\n\n function makeGuideLineLink() {\n const $ = go.GraphObject.make;\n return $(\n go.Link,\n { layerName: DiagramLayersEnum[DiagramLayersEnum.Foreground] },\n $(\n go.Shape,\n { stroke: \"black\", strokeWidth: 2, name: \"SHAPE\" },\n new go.Binding(\"strokeWidth\", \"width\"),\n new go.Binding(\"stroke\", \"stroke\")\n )\n );\n }\n\n const diagram: go.Diagram = this.diagram;\n const errorMargin: number = Math.abs(comparePtCoord - ptCoord);\n if (errorMargin < 2) {\n const data = {\n category: \"GLPointNode\",\n loc: go.Point.stringify(pt),\n key: \"glpt\",\n };\n const data2 = {\n key: \"movingPt\",\n category: \"GLPointNode\",\n loc: go.Point.stringify(comparePt),\n };\n const data3 = {\n key: \"guideline\",\n category: \"guideLine\",\n from: \"movingPt\",\n to: data.key,\n stroke: \"blue\",\n };\n const GLPoint1: go.Node = makeGuideLinePoint();\n const GLPoint2: go.Node = makeGuideLinePoint();\n const GLLink: go.Link = makeGuideLineLink();\n diagram.add(GLPoint1);\n diagram.add(GLPoint2);\n diagram.add(GLLink);\n\n GLPoint1.data = data;\n GLPoint2.data = data2;\n GLLink.data = data3;\n GLLink.fromNode = GLPoint1;\n GLLink.toNode = GLPoint2;\n }\n }\n\n /**\n * Maintain position of all wallParts as best as possible when a wall is being reshaped.\n * Position is relative to the distance a wallPart's location is from the stationaryPoint of the wall.\n * This is called during WallReshapingTool's reshape function.\n * @param {go.Group} wall The wall being reshaped\n * @param {go.Point} stationaryPoint The endpoint of the wall not being reshaped\n * @param {go.Point} movingPoint The endpoint of the wall being reshaped\n * @param {go.Point} newPoint The point that movingPoint is going to\n * @param {go.Diagram} diagram The diagram belonging WallReshapingTool belongs to\n */\n private reshapeWall(\n wall: go.Group,\n stationaryPoint: go.Point,\n movingPoint: go.Point,\n newPoint: go.Point,\n diagram: go.Diagram\n ): void {\n const tool: WallReshapingTool = this;\n const wallParts: go.Iterator = wall.memberParts as go.Iterator<\n go.Node\n >;\n const arr: Array = [];\n const oldAngle: number = wall.data.startpoint.directionPoint(\n wall.data.endpoint\n );\n wallParts.iterator.each((part) => {\n arr.push(part);\n });\n // remember the distance each wall part's location was from the stationary point; store these in a Map\n const distancesMap: go.Map<\n string,\n number\n > = new go.Map(/*\"string\", \"number\"*/);\n let closestPart: go.Part | null = null;\n let closestDistance: number = Number.MAX_VALUE;\n for (let i = 0; i < arr.length; i++) {\n const part: go.Part = arr[i];\n const distanceToStationaryPt: number = Math.sqrt(\n part.location.distanceSquaredPoint(stationaryPoint)\n );\n distancesMap.add(part.data.key, distanceToStationaryPt);\n // distanceToMovingPt is determined by whichever endpoint of the wallpart is closest to movingPoint\n const endpoints: Array = tool.getWallPartEndpoints(part);\n const distanceToMovingPt: number = Math.min(\n Math.sqrt(endpoints[0].distanceSquaredPoint(movingPoint)),\n Math.sqrt(endpoints[1].distanceSquaredPoint(movingPoint))\n );\n // find and store the closest wallPart to the movingPt\n if (distanceToMovingPt < closestDistance) {\n closestDistance = distanceToMovingPt;\n closestPart = part;\n }\n }\n // if the proposed newPoint would make it so the wall would reshape past closestPart, set newPoint to the edge point of closest part\n if (closestPart !== null) {\n const loc: go.Point = closestPart.location;\n const partLength: number = closestPart.data.length;\n const angle: number = oldAngle;\n const point1: go.Point = new go.Point(loc.x + partLength / 2, loc.y);\n const point2: go.Point = new go.Point(loc.x - partLength / 2, loc.y);\n point1.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y);\n point2.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y);\n const distance1: number = Math.sqrt(\n stationaryPoint.distanceSquaredPoint(point1)\n );\n const distance2: number = Math.sqrt(\n stationaryPoint.distanceSquaredPoint(point2)\n );\n\n let minLength: number;\n let newLoc: go.Point;\n if (distance1 > distance2) {\n minLength = distance1;\n newLoc = point1;\n } else {\n minLength = distance2;\n newLoc = point2;\n }\n\n const testDistance: number = Math.sqrt(\n stationaryPoint.distanceSquaredPoint(newPoint)\n );\n if (testDistance < minLength) newPoint = newLoc;\n }\n\n // reshape the wall\n if (movingPoint === wall.data.endpoint) {\n diagram.model.setDataProperty(wall.data, \"endpoint\", newPoint);\n } else {\n diagram.model.setDataProperty(wall.data, \"startpoint\", newPoint);\n }\n\n const fp: Floorplan = diagram as Floorplan;\n fp.updateWall(wall);\n // for each wallPart, maintain relative distance from the stationaryPoint\n distancesMap.iterator.each((kvp) => {\n const wallPart: go.Node = diagram.findPartForKey(kvp.key) as go.Node;\n const distance: number = kvp.value;\n const wallLength: number = Math.sqrt(\n stationaryPoint.distanceSquaredPoint(movingPoint)\n );\n const newLoc: go.Point = new go.Point(\n stationaryPoint.x +\n (distance / wallLength) * (movingPoint.x - stationaryPoint.x),\n stationaryPoint.y +\n (distance / wallLength) * (movingPoint.y - stationaryPoint.y)\n );\n wallPart.location = newLoc;\n\n // calculate the new angle\n const sToE: number = wall.data.startpoint.directionPoint(\n wall.data.endpoint\n );\n const eToS: number = wall.data.endpoint.directionPoint(\n wall.data.startpoint\n );\n const diffS: number = Math.abs(wallPart.angle - sToE);\n const diffE: number = Math.abs(wallPart.angle - eToS);\n const newAngle: number = diffS < diffE ? sToE : eToS;\n wallPart.angle = newAngle;\n });\n } // end reshapeWall()\n\n /**\n * Find and return an array of the endpoints of a given wallpart (window or door)\n * @param {go.Part} wallPart A Wall Part -- i.e. Door Node, Window Node\n * @return {Array}\n */\n private getWallPartEndpoints(wallPart: go.Part): Array {\n const loc = wallPart.location;\n const partLength = wallPart.data.length;\n let angle = 0;\n if (wallPart.containingGroup !== null)\n angle = wallPart.containingGroup.rotateObject.angle;\n else angle = 180;\n const point1 = new go.Point(loc.x + partLength / 2, loc.y);\n const point2 = new go.Point(loc.x - partLength / 2, loc.y);\n point1.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y);\n point2.offset(-loc.x, -loc.y).rotate(angle).offset(loc.x, loc.y);\n const arr = [];\n arr.push(point1);\n arr.push(point2);\n return arr;\n }\n}\n\n// export = WallReshapingTool;\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { RouterModule } from \"@angular/router\";\nimport { AngularSvgIconModule } from \"angular-svg-icon\";\nimport { GojsAngularModule } from \"gojs-angular\";\nimport { TooltipModule } from \"ngx-bootstrap/tooltip\";\nimport { FloorPlannerComponent } from \"./diagram/floor-planner.component\";\nimport { DataInspectorComponent } from \"./inspector/data-inspector.component\";\nimport { PropValuePipe } from \"./inspector/prop-value.pipe\";\nimport { PropertyChoicesPipe } from \"./inspector/property-choices.pipe\";\n\n@NgModule({\n imports: [\n CommonModule,\n RouterModule,\n FormsModule,\n ReactiveFormsModule,\n\n GojsAngularModule,\n AngularSvgIconModule,\n TooltipModule.forRoot(),\n ],\n declarations: [\n FloorPlannerComponent,\n DataInspectorComponent,\n\n PropertyChoicesPipe,\n PropValuePipe,\n ],\n exports: [FloorPlannerComponent],\n})\nexport class FloorPlannerModule { }\n","// tslint:disable:forin\n// tslint:disable:jsdoc-format\n// tslint:disable:max-line-length\n\nimport { Component, Input, OnChanges, SimpleChanges } from \"@angular/core\";\nimport { featuresList } from \"@js-elec/js-elec-types\";\nimport * as go from \"gojs\";\nimport { Floorplan } from \"../diagram/floorplan-diagram\";\nimport * as properties from \"./properties.json\";\nimport {\n FormBuilder,\n FormControl, FormGroup, Validators\n} from \"@angular/forms\";\nimport { delay } from \"rxjs/operators\";\nimport { AuthService } from \"src/app/auth/auth.service\";\nimport { SymbolTypeHeightMapping, defaultFolio } from \"src/app/folio/folio.constants\";\nimport { FolioService } from \"src/app/folio/folio.service\";\nimport { FeaturesService } from \"src/app/shared/services/features.service\";\nimport { WallReshapingTool } from \"../diagram/wall-reshaping-tool\";\nimport { calculateLinkLength, convertUnitsToPixels } from \"../tools\";\nimport getsetFunctions from \"./getset-functions\";\n/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.\n */\n\n/**\n This class implements an inspector for GoJS model data objects.\n The constructor takes three arguments:\n {string} divid a string referencing the HTML ID of the to-be inspector's div.\n {Diagram} diagram a reference to a GoJS Diagram.\n {Object} options An optional JS Object describing options for the inspector.\n\n Options:\n inspectSelection {boolean} Default true, whether to automatically show and populate the Inspector\n with the currently selected Diagram Part. If set to false, the inspector won't show anything\n until you call Inspector.inspectObject(object) with a Part or JavaScript object as the argument.\n includesOwnProperties {boolean} Default true, whether to list all properties currently on the inspected data object.\n properties {Object} An object of string:Object pairs representing propertyName:propertyOptions.\n Can be used to include or exclude additional properties.\n propertyModified function(propertyName, newValue) a callback\n multipleSelection {boolean} Default false, whether to allow multiple selection and change the properties of all the selected instead of\n the single first object\n showAllProperties {boolean} Default false, whether properties that are shown with multipleSelection use the intersect of the properties when false or the union when true\n only affects if multipleSelection is true\n showSize {number} Defaults 0, shows how many nodes are showed when selecting multiple nodes\n when its lower than 1, it shows all nodes\n\n Options for properties:\n show: {boolean|function} a boolean value to show or hide the property from the inspector, or a predicate function to show conditionally.\n readOnly: {boolean|function} whether or not the property is read-only\n type: {string} a string describing the data type. Supported values: \"string|number|boolean|color|arrayofnumber|point|rect|size|spot|margin|select\"\n defaultValue: {*} a default value for the property. Defaults to the empty string.\n choices: {Array|function} when type == \"select\", the Array of choices to use or a function that returns the Array of choices.\n\n Example usage of Inspector:\n\n var inspector = new Inspector(\"myInspector\", myDiagram,\n {\n includesOwnProperties: false,\n properties: {\n \"key\": { show: Inspector.showIfPresent, readOnly: true },\n \"comments\": { show: Inspector.showIfNode },\n \"LinkComments\": { show: Inspector.showIfLink },\n \"chosen\": { show: Inspector.showIfNode, type: \"checkbox\" },\n \"state\": { show: Inspector.showIfNode, type: \"select\", choices: [\"Stopped\", \"Parked\", \"Moving\"] }\n }\n });\n*/\n@Component({\n selector: \"data-inspector\",\n templateUrl: \"./data-inspector.component.html\",\n styleUrls: [\"./data-inspector.component.scss\"],\n})\nexport class DataInspectorComponent implements OnChanges {\n @Input() diagram!: Floorplan;\n\n propertiesSchema: {\n [K in string]: { [J in string]: { [L in string]: any } };\n };\n inspectedObject: go.Part | null = null;\n inspectedProperties: any[] | null = null;\n\n form!: FormGroup;\n swappingSymbols?: string[] = undefined;\n nameChoices?: string[];\n\n constructor(\n private fb: FormBuilder,\n private folioSvc: FolioService,\n private authSvc: AuthService,\n ) {\n this.propertiesSchema = (properties as any).default;\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (\n changes.diagram.currentValue === undefined ||\n !changes.diagram.currentValue.addDiagramListener\n )\n return;\n\n // this.diagram.addModelChangedListener((e) => {\n // if (e.isTransactionFinished) this.inspectObject();\n // });\n\n this.diagram.addDiagramListener(\"ChangedSelection\", (e) => {\n this.inspectObject();\n });\n this.inspectObject();\n }\n\n /**\n * Update the HTML state of this Inspector given the properties of the {@link #inspectedObject}.\n * @param {Object} object is an optional argument, used when {@link #inspectSelection} is false to\n * set {@link #inspectedObject} and show and edit that object's properties.\n */\n inspectObject(obj?: any) {\n this.inspectedObject =\n obj || (this.diagram.selection && this.diagram.selection.first());\n if (!this.inspectedObject) return;\n // if (!this.inspectedObject) {\n // this.inspectedObject = ({\n // data: { ...this.diagram.model.modelData, category: \"diagram\" },\n // diagram: this.diagram,\n // } as unknown) as go.Part;\n // }\n const inspectedCategory = this.inspectedObject.type.name === 'Link' ? 'link' : this.inspectedObject.data.category;\n if (this.propertiesSchema[inspectedCategory]) {\n if (inspectedCategory === 'link') {\n const length = calculateLinkLength(this.inspectedObject as go.Link)\n if (length)\n getsetFunctions.setValue(this.inspectedObject, { property: 'length' }, Math.round(length * 100) / 100)\n } else {\n this.getSwappingSymbols();\n this.getNameChoices();\n }\n\n this.inspectedProperties = Object.keys(\n this.propertiesSchema[inspectedCategory]\n )\n .map(\n (k) =>\n ({\n ...this.propertiesSchema[inspectedCategory][k],\n property: k,\n } as any)\n )\n .sort((a, b) => {\n return a.order > b.order ? 1 : -1;\n });\n\n this.form = this.buildElementProperiesForm();\n } else {\n this.inspectedProperties = null;\n this.form = this.fb.group({});\n }\n }\n\n buildElementProperiesForm() {\n const form = this.fb.group(\n this.inspectedProperties?.reduce((acc, prop) => {\n const getterFc = (getsetFunctions as any)[prop.getValue || \"getValue\"];\n const setterFc = (getsetFunctions as any)[prop.setValue || \"setValue\"];\n\n if (prop.type === \"scale\") {\n const links = this.diagram.dimensionLinks;\n if (links && this.inspectedObject) {\n let scaleLength = this.inspectedObject.data.scaleLength;\n if (!scaleLength || scaleLength === '0.00')\n scaleLength = getterFc(this.inspectedObject, prop);\n\n acc[prop.property] = new FormControl({\n value: typeof scaleLength === 'string' ? scaleLength.replace(/[a-z]*$/i, '') : scaleLength,\n disabled: true,\n })\n }\n } else if (\n prop.type === \"select\" &&\n prop.expanded === true &&\n prop.multiple === true\n ) {\n const choices =\n typeof prop.choices === \"string\"\n ? (getsetFunctions as any)[prop.choices](this.inspectedObject, prop)\n : prop.choices;\n const values = getterFc(this.inspectedObject, prop);\n\n acc[prop.property] = this.fb.array(\n choices.map(\n (_choice: any, index: number) => new FormControl(values[index].value)\n )\n );\n } else {\n const defaultVal = getterFc(this.inspectedObject, prop)\n\n acc[prop.property] = new FormControl(\n {\n value: defaultVal !== undefined ? defaultVal : prop.default,\n disabled: prop.readOnly === true,\n },\n prop.required === true ? Validators.required : undefined\n );\n }\n acc[prop.property].valueChanges.pipe(delay(600)).subscribe((val: any) => {\n setterFc(this.inspectedObject, prop, val);\n if (prop.refreshAfterChanged === true) {\n if (this.inspectedObject?.data.category === \"WallGroup\") {\n // force updating thickness\n const tool: WallReshapingTool = this.inspectedObject.diagram?.toolManager.mouseDownTools.toArray()[3] as WallReshapingTool;\n tool.performMiteringOnWall(this.inspectedObject as go.Group);\n (this.inspectedObject.diagram as Floorplan).updateWall(\n this.inspectedObject as go.Group\n );\n }\n this.inspectObject();\n }\n });\n return acc;\n }, {})\n );\n\n return form;\n }\n\n updatePartData(obj: go.Part, props: any[], data: any) {\n this.diagram.startTransaction(\"set all properties\");\n props.forEach((p) => {\n if (data[p.property] === undefined) return;\n if (p.readOnly === true) return;\n this.diagram.model.setDataProperty(\n obj.data,\n p.property,\n data[p.property]\n );\n });\n this.diagram.commitTransaction(\"set all properties\");\n }\n\n scaling(formControl: FormControl, prop: any) {\n if (formControl.enabled && this.inspectedObject) {\n formControl.disable();\n // const link: go.Link = this.diagram.dimensionLinks.toArray()[0];\n const getterFc = (getsetFunctions as any)[prop.getValue || \"getValue\"];\n\n (this.diagram as Floorplan).changeUnitsConversion(\n (formControl.value / convertUnitsToPixels(getterFc(this.inspectedObject, prop), this.diagram.model.modelData.unitsConversionFactor)).toFixed(6),\n this.diagram.model.modelData.gridSize,\n false\n );\n getsetFunctions.setValue(this.inspectedObject, { property: 'scaleLength' }, formControl.value + 'm');\n this.inspectObject();\n } else formControl.enable();\n }\n\n getSwappingSymbols() {\n if (this.authSvc.currentAuth.value && !FeaturesService.hasFeatureAccess(featuresList.squidSwapping, this.authSvc.currentAuth.value?.user)) {\n this.swappingSymbols = undefined;\n return;\n }\n\n const squidLib = FeaturesService.squidLib$.value;\n const swapping = squidLib.symbolsSwapping.find((swapping: any) => {\n return swapping.find((symbol: any) => symbol === this.inspectedObject?.data.symbolName)\n })\n if (swapping && swapping.length) {\n this.swappingSymbols = swapping;\n } else {\n this.swappingSymbols = undefined;\n }\n }\n\n getNameChoices(): void {\n if (!FeaturesService.isFeatureEnabled(featuresList.squid)) {\n this.nameChoices = undefined;\n return;\n }\n\n const squidLib = FeaturesService.squidLib$.value;\n const foundComponent = this.folioSvc.findComponentInTree(this.inspectedObject?.data.key)\n if (foundComponent && foundComponent.type) {\n const labelChoices = squidLib.labelChoices\n .find((labelChoices: any) =>\n labelChoices.symbols.indexOf(foundComponent.type) >= 0\n );\n if (!labelChoices)\n this.nameChoices = undefined;\n else {\n this.nameChoices = labelChoices.choices;\n }\n }\n }\n\n symbolChanged(event: any) {\n const elecLib = FeaturesService.symbolLib$.value;\n const selection = event.currentTarget.value;\n const symbol = elecLib.categories.flatMap((cat: any) => cat.symbols).find((s: any) => s.symbolName.toLocaleLowerCase() === selection.toLocaleLowerCase())\n if (symbol && this.inspectedObject) {\n getsetFunctions.setValue(this.inspectedObject, { property: \"type\" }, symbol.type)\n const deviceHeightControl = this.form.get('deviceHeight');\n if (deviceHeightControl) {\n deviceHeightControl.setValue(symbol.deviceHeight || this.diagram.model.modelData.properties[(SymbolTypeHeightMapping as any)[symbol.symbolName]] || deviceHeightControl.value);\n getsetFunctions.setValue(this.inspectedObject, { property: \"deviceHeight\" }, deviceHeightControl.value)\n }\n // getsetFunctions.setValue(this.inspectedObject, { property: \"deviceHeight\" }, symbol.deviceHeight || this.diagram.model.modelData.properties[(SymbolTypeHeightMapping as any)[symbol.symbolName]])\n getsetFunctions.setValue(this.inspectedObject, { property: \"geo\" }, symbol.geo)\n getsetFunctions.setValue(this.inspectedObject, { property: \"width\" }, symbol.width)\n getsetFunctions.setValue(this.inspectedObject, { property: \"height\" }, symbol.height)\n getsetFunctions.setValue(this.inspectedObject, { property: \"symbolName\" }, symbol.symbolName)\n\n // factor size\n const factor = (this.diagram.model.modelData.elementSize || defaultFolio.modelData.elementSize) //* fp.model.modelData.unitsConversionFactor ;\n const width = symbol.width * (factor);\n const height = symbol.height * (factor);\n getsetFunctions.setValue(this.inspectedObject, { property: \"width\" }, width)\n getsetFunctions.setValue(this.inspectedObject, { property: \"height\" }, height)\n }\n\n this.getNameChoices();\n }\n\n\n}\n","import * as go from \"gojs\";\nimport { FolioPropertyNames } from \"src/app/folio/folio.constants\";\nimport { Floorplan } from \"../diagram/floorplan-diagram\";\nimport {\n bottomSystemLayers, DiagramLayersEnum, DiagramUnitsAbbreviations, layersDisabled, LinkTypesEnum, topSystemLayers, WallTypesEnum\n} from \"../models/elements\";\nimport { convertPixelsToUnits } from \"../tools\";\n\nconst getModelDataProperty = (layer: go.Diagram, prop: FolioPropertyNames) => {\n if (layer.model.modelData.properties)\n return layer.model.modelData.properties[prop];\n}\n\nconst setModelDataProperty = (layer: go.Diagram, prop: FolioPropertyNames, value: any) => {\n if (layer.model.modelData.properties)\n layer.model.modelData.properties[prop] = value;\n}\n\nconst getValue = (obj: go.Part, prop: any) => {\n let val = obj.data[prop.property];\n if (prop.type === \"scale\") {\n val = getWallLength(obj);\n }\n return val;\n};\n\nconst setValue = (obj: go.Part, prop: any, data: any, commit = true): boolean => {\n if (commit && obj.diagram) {\n obj.diagram.startTransaction(\"set property\");\n }\n if (data === undefined) return false;\n if (prop.readOnly === true) return false;\n obj.diagram && obj.diagram.model.setDataProperty(obj.data, prop.property, data);\n if (commit) {\n obj.diagram && obj.diagram.commitTransaction(\"set property\");\n }\n return true;\n};\n\nconst getDiagramValue = (diagram: go.Diagram, prop: string) => {\n let val = diagram.model.modelData[prop];\n return val;\n};\n\nconst setDiagramValue = (diagram: go.Diagram, propName: string, data: any, commit = true): boolean => {\n if (commit) {\n diagram.startTransaction(\"set property\");\n }\n if (data === undefined) return false;\n diagram.model.set(diagram.model.modelData, propName, data);\n if (commit) {\n diagram.commitTransaction(\"set property\");\n }\n return true;\n};\n\nfunction getWallLength(link: go.Part) {\n let length = link.data.length\n if (!length) {\n length = Math.sqrt(\n ((link.data.startpoint.x - link.data.endpoint.x) * (link.data.startpoint.x - link.data.endpoint.x)) +\n ((link.data.startpoint.y - link.data.endpoint.y) * (link.data.startpoint.y - link.data.endpoint.y))\n );\n // length = convertPixelsToUnits(pxDist, link.diagram?.model.modelData.unitsConversionFactor).toFixed(2);\n }\n const unitsDist = convertPixelsToUnits(length, link.diagram?.model.modelData.unitsConversionFactor)\n .toFixed(2);\n return unitsDist.toString();\n}\n\nconst getLayers = (obj: go.Diagram) => {\n const values = [];\n Object.values(DiagramLayersEnum)\n for (const item in DiagramLayersEnum) {\n if (!isNaN(Number(item)) && layersDisabled.indexOf(Number(item)) < 0) {\n if (Number(item) > bottomSystemLayers && Number(item) < topSystemLayers) {\n const layer = obj.findLayer(DiagramLayersEnum[item]);\n if (layer) values.push({ label: layer.name, value: layer.visible });\n }\n }\n }\n return values;\n};\n\nconst setLayers = (diag: go.Diagram, data: any[]) => {\n if (diag !== null) {\n const values = getLayers(diag);\n data.forEach((visible, index) => {\n const layer = diag.findLayer(values[index].label);\n if (layer) {\n layer.visible = visible;\n }\n });\n }\n};\n\nconst getGridSize = (diagram: go.Diagram) => {\n return diagram.model.modelData.gridSize;\n};\n\nconst setGridSize = (diagram: Floorplan, data: string) => {\n diagram.changeGridSize(data, false);\n};\n\nconst getGridHide = (diagram: go.Diagram) => {\n return !diagram.grid.visible;\n};\n\nconst setGridHide = (diagram: Floorplan, hidden: boolean) => {\n diagram.grid.visible = !hidden;\n};\n\nconst getUnitConversionFactor = (diagram: go.Diagram) => {\n return diagram.model.modelData.unitsConversionFactor;\n};\n\nconst setUnitConversionFactor = (obj: go.Part, prop: any, data: string) => {\n (obj.diagram as Floorplan).changeUnitsConversion(\n data,\n obj.diagram?.model.modelData.gridSize,\n false\n );\n};\n\nconst getUnitsChoices = () => {\n const units = [];\n for (const unit in DiagramUnitsAbbreviations) {\n if ((DiagramUnitsAbbreviations as any)[unit])\n units.push({ value: unit, label: unit });\n }\n\n return units;\n};\n\nconst getUnits = (obj: go.Diagram) => {\n const u = obj.model.modelData.units;\n return (DiagramUnitsAbbreviations as any)[u] || DiagramUnitsAbbreviations.m;\n};\n\nconst setUnits = (diagram: Floorplan, data: DiagramUnitsAbbreviations) => {\n diagram.changeUnits(data);\n};\n\nconst getUnitsAbbreviation = (diagram: go.Diagram) => {\n return (diagram as Floorplan).model.modelData.unitsAbbreviation;\n};\n\nconst getWallsChoices = () => {\n const walls = [];\n for (const wall in WallTypesEnum) {\n if (!isNaN(wall as any) && WallTypesEnum[wall])\n walls.push({ label: WallTypesEnum[wall], value: +wall });\n }\n\n return walls;\n};\n\nconst getLinkTypesChoices = () => {\n const walls = [];\n for (const type in LinkTypesEnum) {\n if (!isNaN(type as any) && LinkTypesEnum[type])\n walls.push({ label: LinkTypesEnum[type], value: +type });\n }\n\n return walls;\n};\n\nconst setWallValue = (obj: go.Part, prop: any, data: any) => {\n obj.diagram && obj.diagram.startTransaction(\"set property\");\n if (setValue(obj, prop, data, false)) {\n switch (+data) {\n case WallTypesEnum.cloison_interieure:\n obj.diagram && obj.diagram.model.setDataProperty(obj.data, \"thickness\", 6);\n break;\n case WallTypesEnum.mur_interieur:\n obj.diagram && obj.diagram.model.setDataProperty(obj.data, \"thickness\", 10);\n break;\n case WallTypesEnum.mur_porteur:\n obj.diagram && obj.diagram.model.setDataProperty(obj.data, \"thickness\", 14);\n break;\n\n default:\n break;\n }\n obj.diagram && obj.diagram.commitTransaction(\"set property\");\n }\n};\n\nexport default {\n getValue,\n setValue,\n getDiagramValue,\n setDiagramValue,\n getModelDataProperty,\n setModelDataProperty,\n getLayers,\n setLayers,\n getGridSize,\n setGridSize,\n getGridHide,\n setGridHide,\n getUnitConversionFactor,\n setUnitConversionFactor,\n getUnits,\n setUnits,\n getUnitsChoices,\n getUnitsAbbreviation,\n getWallsChoices,\n setWallValue,\n getLinkTypesChoices,\n};\n","import * as go from \"gojs\";\nimport { Pipe, PipeTransform } from \"@angular/core\";\nimport getsetFunctions from \"./getset-functions\";\n\n@Pipe({\n name: \"propValue\",\n})\nexport class PropValuePipe implements PipeTransform {\n transform(\n prop: any,\n propName: string,\n obj?: go.Part\n ): { label: string; value: string }[] {\n if (typeof (getsetFunctions as any)[prop[propName]] === \"function\")\n return (getsetFunctions as any)[prop[propName]](obj, prop);\n return prop[propName];\n }\n}\n","import * as go from \"gojs\";\nimport { Pipe, PipeTransform } from \"@angular/core\";\nimport getsetFunctions from \"./getset-functions\";\n\n@Pipe({\n name: \"propertyChoices\",\n})\nexport class PropertyChoicesPipe implements PipeTransform {\n transform(prop: any, obj?: go.Part): { label: string; value: string }[] {\n if (typeof prop.choices === \"string\")\n return (getsetFunctions as any)[prop.choices](obj, prop);\n return prop.choices;\n }\n}\n","import * as go from \"gojs\";\n\nexport const roomColors = [\n \"#ffff00\",\n \"#ffd416\",\n \"#ffae31\",\n \"#f78c46\",\n \"#e97057\",\n \"#d85b67\",\n \"#c44e74\",\n \"#ae4a7d\",\n \"#964e80\",\n \"#7e577a\",\n \"#666269\",\n \"#4a704a\",\n \"#008000\",\n];\n\nexport enum LinkTypesEnum {\n \"conduit\" = 0,\n \"circuit_cfort\" = 10,\n \"commande\" = 15,\n \"circuit_cfaible\" = 20,\n}\n\nexport enum GaineLengthsEnum {\n length1650 = 'length1650',\n length1150 = 'length1150',\n length1050 = 'length1050',\n length950 = 'length950',\n length850 = 'length850',\n length750 = 'length750',\n}\n\nexport enum WallTypesEnum {\n \"mur_porteur\" = 0,\n \"mur_interieur\" = 10,\n \"cloison_interieure\" = 20,\n}\n\nexport enum DiagramUnitsAbbreviations {\n m = \"m\",\n cm = \"cm\",\n mm = \"mm\",\n in = \"in\",\n ft = \"ft\",\n}\n\nexport enum ScalesEnum {\n cinquantieme = 50,\n centieme = 100,\n}\n\nexport enum DiagramUnitsConversionEnum {\n m = 1,\n cm = 0.01,\n mm = 0.001,\n in = 0.393701,\n ft = 0.0328084,\n}\n\nexport type ElementShapes = \"Rectangle\";\nexport enum DiagramLayersEnum {\n \"Grid\" = 0,\n \"Background\" = 5,\n \"Ground\" = 10,\n \"Scale\" = 15,\n \"Walls\" = 20,\n \"Room\" = 30,\n \"Links\" = 75,\n \"Furnitures\" = 100,\n \"Commands\" = 150,\n \"Lamps\" = 180,\n \"WallOutlet\" = 200,\n \"Divers\" = 300,\n \"Utilities\" = 400,\n \"Comfort\" = 500,\n \"HomeAutomation\" = 600,\n \"Cartouche\" = 700,\n \"Default\" = 1000,\n \"Foreground\" = 2000,\n \"Adornment\" = 5000,\n \"Tool\" = 10000,\n}\n\nexport const layersDisabled = [\n DiagramLayersEnum.Scale,\n DiagramLayersEnum.Room,\n DiagramLayersEnum.Links,\n DiagramLayersEnum.Furnitures,\n DiagramLayersEnum.Commands,\n DiagramLayersEnum.Lamps,\n DiagramLayersEnum.Divers,\n DiagramLayersEnum.Utilities,\n DiagramLayersEnum.Comfort,\n DiagramLayersEnum.HomeAutomation,\n DiagramLayersEnum.Cartouche,\n DiagramLayersEnum.Default,\n]\n\nexport const bottomSystemLayers: number = DiagramLayersEnum.Background;\nexport const topSystemLayers: number = DiagramLayersEnum.Foreground;\n\nexport interface BaseElement {\n key: string;\n symbolName: string;\n name: string;\n showName: boolean;\n category: string;\n type: string;\n layer: DiagramLayersEnum;\n color: string;\n fill: string;\n nature?: string;\n tableau?: string;\n shape?: ElementShapes;\n geo?: string;\n\n notes?: string;\n\n loc?: string;\n width: number;\n height: number;\n angle: number;\n}\n\nexport interface RectangleElement {\n width: number;\n height: number;\n}\n\nexport interface LabelElement {\n showLabel: string;\n text: string;\n}\n\nexport interface TextureElement {\n texture: string;\n usesTexture: boolean;\n showTextureOptions: boolean;\n textures: string[];\n}\n","/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.\n */\n\nimport * as go from \"gojs\";\n\n// A custom Tool for moving a label on a Node\nexport class NodeLabelDraggingTool extends go.Tool {\n /**\n * @constructor\n * @extends Tool\n * @class\n * This tool only works when the Node has a label (any GraphObject) marked with\n * { _isNodeLabel: true } that is positioned in a Spot Panel.\n * It works by modifying that label's GraphObject.alignment property to have an\n * offset from the center of the panel.\n */\n\n private label: go.GraphObject | null;\n private _offset: go.Point;\n private _originalAlignment: go.Spot | null;\n private _originalCenter: go.Point | null;\n\n constructor() {\n super();\n this.name = \"NodeLabelDragging\";\n\n /** @type {GraphObject} */\n this.label = null;\n /** @type {Point} */\n this._offset = new go.Point(); // of the mouse relative to the center of the label object\n /** @type {go.Spot} */\n this._originalAlignment = null;\n /** @type {Point} */\n this._originalCenter = null;\n }\n\n /**\n * This tool can only start if the mouse has moved enough so that it is not a click,\n * and if the mouse down point is on a GraphObject \"label\" in a Spot Panel,\n * as determined by findLabel().\n * @this {NodeLabelDraggingTool}\n * @return {boolean}\n */\n public canStart(): boolean {\n if (!go.Tool.prototype.canStart.call(this)) return false;\n const diagram = this.diagram;\n if (diagram === null) return false;\n // require left button & that it has moved far enough away from the mouse down point, so it isn't a click\n const e = diagram.lastInput;\n if (!e.left) return false;\n if (!this.isBeyondDragSize()) return false;\n\n const lab = this.findLabel();\n return lab !== null;\n }\n\n /**\n * From the GraphObject at the mouse point, search up the visual tree until we get to\n * an object that has the \"_isNodeLabel\" property set to true, that is in a Spot Panel,\n * and that is not the first element of that Panel (i.e. not the main element of the panel).\n * @this {NodeLabelDraggingTool}\n * @return {GraphObject} This returns null if no such label is at the mouse down point.\n */\n public findLabel(): go.GraphObject | null {\n const diagram = this.diagram;\n const e = diagram.firstInput;\n let elt = diagram.findObjectAt(e.documentPoint, null, null);\n\n if (elt === null || !(elt.part instanceof go.Node)) return null;\n // if (elt.part instanceof go.Node) {\n // elt.part.isSelected = true;\n // }\n while (elt.panel !== null) {\n if (\n (elt as any)._isNodeLabel &&\n elt.panel.type === go.Panel.Spot &&\n elt.panel.findMainElement() !== elt\n )\n return elt;\n elt = elt.panel;\n }\n\n return null;\n }\n\n /**\n * Start a transaction, call findLabel and remember it as the \"label\" property,\n * and remember the original value for the label's alignment property.\n * @this {NodeLabelDraggingTool}\n */\n public doActivate(): void {\n this.startTransaction(\"Shifted Label\");\n this.label = this.findLabel();\n if (this.label !== null) {\n // compute the offset of the mouse-down point relative to the center of the label\n this._offset = this.diagram.firstInput.documentPoint\n .copy()\n .subtract(this.label.getDocumentPoint(go.Spot.Center));\n this._originalAlignment = this.label.alignment.copy();\n if (this.label !== null && this.label.panel !== null) {\n const main = this.label.panel.findMainElement();\n if (main !== null) {\n this._originalCenter = main.getDocumentPoint(go.Spot.Center);\n }\n }\n }\n go.Tool.prototype.doActivate.call(this);\n }\n\n /**\n * Stop any ongoing transaction.\n * @this {NodeLabelDraggingTool}\n */\n public doDeactivate(): void {\n go.Tool.prototype.doDeactivate.call(this);\n this.stopTransaction();\n }\n\n /**\n * Clear any reference to a label element.\n * @this {NodeLabelDraggingTool}\n */\n public doStop(): void {\n this.label = null;\n go.Tool.prototype.doStop.call(this);\n }\n\n /**\n * Restore the label's original value for GraphObject.alignment.\n * @this {NodeLabelDraggingTool}\n */\n public doCancel(): void {\n if (this.label !== null && this._originalAlignment !== null) {\n // this.label.alignment = this._originalAlignment;\n const node: go.Node = this.label.part as go.Node;\n this.diagram.model.set(\n node.data,\n \"labelAlignment\",\n this._originalAlignment\n );\n }\n go.Tool.prototype.doCancel.call(this);\n }\n\n /**\n * During the drag, call updateAlignment in order to set the GraphObject.alignment of the label.\n * @this {NodeLabelDraggingTool}\n */\n public doMouseMove(): void {\n if (!this.isActive) return;\n this.updateAlignment();\n }\n\n /**\n * At the end of the drag, update the alignment of the label and finish the tool,\n * completing a transaction.\n * @this {NodeLabelDraggingTool}\n */\n public doMouseUp(): void {\n if (!this.isActive) return;\n this.updateAlignment();\n this.transactionResult = \"Shifted Label\";\n this.stopTool();\n }\n\n /**\n * Save the label's GraphObject.alignment as an absolute offset from the center of the Spot Panel\n * that the label is in.\n * @this {NodeLabelDraggingTool}\n */\n public updateAlignment(): void {\n if (this.label === null) return;\n const last = this.diagram.lastInput.documentPoint;\n const cntr = this._originalCenter;\n if (cntr !== null) {\n const align: go.Spot = new go.Spot(\n 0.5,\n 0.5,\n last.x - this._offset.x - cntr.x,\n last.y - this._offset.y - cntr.y\n );\n // this.label.alignment = new go.Spot(0.5, 0.5, last.x - this._offset.x - cntr.x, last.y - this._offset.y - cntr.y);\n\n const node: go.Node = this.label.panel?.part as go.Node;\n this.diagram.model.set(node.data, \"labelAlignment\", go.Spot.stringify(align));\n }\n }\n}\n\n// export = NodeLabelDraggingTool;\n","import { FolioPropertyNames, gaineLengths } from \"../folio/folio.constants\";\nimport { Floorplan } from \"./diagram/floorplan-diagram\";\nimport getsetFunctions from \"./inspector/getset-functions\";\nimport { DiagramUnitsAbbreviations, DiagramUnitsConversionEnum, GaineLengthsEnum } from \"./models/elements\";\n\nexport const calculateLinkLength = (link: go.Link) => {\n let diag: Floorplan = link.diagram as Floorplan;\n let from = diag.findNodeForKey(link.data.from)\n let to = diag.findNodeForKey(link.data.to)\n let gaineHeight = getsetFunctions.getModelDataProperty(diag, FolioPropertyNames[FolioPropertyNames.hauteurConduitsHauts])\n const margeError = 0.10\n const margeErrorSupp = 0.5\n\n let height = 0;\n if (from && to)\n height = Math.abs(+from.data.deviceHeight - gaineHeight) + Math.abs(+to.data.deviceHeight - gaineHeight)\n if (isNaN(height))\n height = 0;\n height = convertUnits(DiagramUnitsAbbreviations.cm, DiagramUnitsAbbreviations.m, height);\n var numpts = link.pointsCount;\n if (numpts < 2) return \"\";\n let length = 0;\n for (let i = 0; i < numpts - 1; i++) {\n var p0 = link.getPoint(i);\n var pn = link.getPoint(i + 1);\n var ang = (link as any).direction;\n let distance: number = 0;\n if (isNaN(ang))\n distance = Math.floor(Math.sqrt(p0.distanceSquaredPoint(pn)));\n else {\n var rad = ang * Math.PI / 180;\n distance = Math.floor(Math.abs(Math.cos(rad) * (p0.x - pn.x)) +\n Math.abs(Math.sin(rad) * (p0.y - pn.y)));\n }\n distance = convertPixelsToUnits(distance, link.diagram?.model.modelData.unitsConversionFactor);\n length += distance\n }\n return Number((Math.round((length + height) * (1 + margeError) * 100) / 100 + margeErrorSupp).toFixed(2));\n}\n\nexport const getGaineMaxLength = (gaineLength?: keyof typeof GaineLengthsEnum): number | undefined => {\n if (gaineLength) {\n const gaineLengthInfos = gaineLengths[gaineLength];\n if (gaineLengthInfos) {\n return gaineLengthInfos.length;\n }\n }\n return undefined\n}\n\n/**\n * Convert num number of pixels (document units) to units, using the adjustable conversion factor stored in modeldata\n * @param {number} num This is in document units (colloquially, if inaccurately, referred to as \"pixels\")\n * @return {number}\n */\nexport const convertPixelsToUnits = (num: number, conversionFactor: number): number => {\n // const units: string = this.model.modelData.units;\n // const factor = this.model.modelData.unitsConversionFactor;\n return num * conversionFactor;\n /*if (units === 'meters') return (num / 100) * factor;\n if (units === 'feet') return (num / 30.48) * factor;\n if (units === 'inches') return (num / 2.54) * factor;\n return num * factor; */\n}\n\n/**\n * Take a number of units, convert to cm, then divide by 2, (1px = 2cm, change this if you want to use a different paradigm)\n * @param {number} num This is in document units (colloquially, if inaccurately, referred to as \"pixels\")\n * @return {number}\n */\nexport const convertUnitsToPixels = (num: number, conversionFactor: number): number => {\n // const units: string = this.model.modelData.units;\n // const factor = this.model.modelData.unitsConversionFactor;\n return num / conversionFactor;\n /*if (units === 'meters') return (num * 100) / factor;\n if (units === 'feet') return (num * 30.48) / factor;\n if (units === 'inches') return (num * 2.54) / factor;\n return num / factor; */\n}\n\n/**\n * Convert a number of oldUnits to newUnits\n * @param {string} oldUnits cm | m | ft | in\n * @param {string} newUnits cm | m | ft | in\n * @param {number} num The number of old units to convert to new ones\n * @return {number} The number of new units\n */\nexport const convertUnits = (oldUnits: DiagramUnitsAbbreviations, newUnits: DiagramUnitsAbbreviations, num: number): number => {\n return (\n ((DiagramUnitsConversionEnum as any)[oldUnits] /\n (DiagramUnitsConversionEnum as any)[newUnits]) *\n (num || 1)\n );\n}\n\nconst from = (alpha: string) => {\n if (!/^[A-Z]+$/.test(alpha)) {\n throw new Error('Input must be a non-empty string comprised of only characters a-z')\n }\n\n const letters = alpha.split('');\n let out = 0;\n\n for (let i = 0; i < letters.length; i++) {\n out += (letters[letters.length - 1 - i].charCodeAt(0) - 64) * Math.pow(26, i);\n }\n\n return out;\n};\n\n\nconst to = (decimal: number) => {\n if (decimal <= 0) {\n throw new Error('Number must be > 0');\n }\n\n let out = '';\n\n while (true) {\n out = String.fromCharCode(((decimal - 1) % 26) + 65) + out;\n decimal = Math.floor((decimal - 1) / 26);\n\n if (decimal === 0) {\n break;\n }\n }\n\n return out;\n};\n\n\nexport const base26Add = (alpha: string, num: number) => to(from(alpha) + num);\n\nexport const base26Subtract = (alpha: string, num: number) => to(from(alpha) - num);","import { Component, Input, OnInit } from \"@angular/core\";\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n Validators\n} from \"@angular/forms\";\nimport { IProject } from '@js-elec/js-elec-types';\nimport { BsModalRef, BsModalService } from \"ngx-bootstrap/modal\";\nimport { take, tap } from \"rxjs/operators\";\nimport { Floorplan } from \"src/app/floorPlanner/diagram/floorplan-diagram\";\nimport getsetFunctions from \"src/app/floorPlanner/inspector/getset-functions\";\nimport { DiagramUnitsAbbreviations } from \"src/app/floorPlanner/models/elements\";\nimport { ModalConfirmComponent } from \"src/app/shared/components/modals/modal-confirm.component\";\nimport { FolioService, IOpenedFolio } from \"../folio.service\";\nimport { defaultFolio } from \"../folio.constants\";\n\n@Component({\n selector: \"folio-layers\",\n templateUrl: \"./folio-layers.component.html\",\n})\nexport class FolioLayersComponent implements OnInit {\n @Input() project!: IProject;\n @Input() openedFolio!: IOpenedFolio;\n diagram!: Floorplan;\n\n form!: FormGroup;\n\n layers: any;\n units: any;\n constructor(\n private folioSvc: FolioService,\n private fb: FormBuilder,\n private modalSvc: BsModalService,\n private modal: BsModalRef\n ) { }\n\n ngOnInit() {\n this.diagram = this.openedFolio.diagram as Floorplan;\n this.layers = getsetFunctions.getLayers(this.diagram);\n this.units = getsetFunctions.getUnitsChoices();\n\n this.form = this.fb.group({\n layers: this.fb.array(\n this.layers.map(\n (_choice: any, index: number) => new FormControl(this.layers[index].value)\n )\n ),\n // scale: [getScale(this.openedFolio.diagram), Validators.required],\n unit:\n new FormControl({\n value: this.openedFolio.diagram && (getsetFunctions.getUnits(this.openedFolio.diagram) || DiagramUnitsAbbreviations.m),\n disabled: true\n }, Validators.required,\n ),\n // unitsConversionFactor: [\n // this.openedFolio.diagram && getsetFunctions.getUnitConversionFactor(this.openedFolio.diagram),\n // Validators.required,\n // ],\n gridSize: [\n this.openedFolio.diagram && getsetFunctions.getGridSize(this.openedFolio.diagram),\n Validators.required,\n ],\n gridHide: [\n this.openedFolio.diagram && getsetFunctions.getGridHide(this.openedFolio.diagram)\n ],\n elementSize: [\n this.openedFolio.diagram && getsetFunctions.getDiagramValue(this.openedFolio.diagram, 'elementSize') * 100 || 100,\n Validators.required,\n ],\n textSize: [\n this.openedFolio.diagram && getsetFunctions.getDiagramValue(this.openedFolio.diagram, 'textSize') || defaultFolio.modelData.textSize,\n Validators.required,\n ],\n });\n\n // function getScale(diag: go.Diagram) {\n // const units: string = diag.model.modelData.units;\n // const factor = this.model.modelData.unitsConversionFactor;\n\n // this.convertUnits(\n // DiagramUnitsConversionEnum[units],\n // DiagramUnitsConversionEnum.inchs,\n // 1\n // );\n // (1 / DiagramUnitsConversionEnum[units]) * 92;\n // return 0;\n // }\n }\n\n getUnitAbbr(): { label: string; value: string }[] {\n return getsetFunctions.getUnitsAbbreviation(this.diagram);\n }\n\n save() {\n if (!this.form.valid)\n return;\n const newProps = this.form.value;\n Object.keys(newProps).forEach(prop => {\n switch (prop) {\n case 'unit':\n getsetFunctions.setUnits(this.openedFolio.diagram as Floorplan, newProps[prop])\n break;\n case 'elementSize':\n getsetFunctions.setDiagramValue(this.openedFolio.diagram as go.Diagram, 'elementSize', newProps[prop] / 100)\n break;\n case 'textSize':\n getsetFunctions.setDiagramValue(this.openedFolio.diagram as go.Diagram, 'textSize', +newProps[prop])\n break;\n case 'gridSize':\n getsetFunctions.setGridSize(this.openedFolio.diagram as Floorplan, newProps[prop])\n break;\n case 'gridHide':\n getsetFunctions.setGridHide(this.openedFolio.diagram as Floorplan, newProps[prop])\n break;\n case 'layers':\n getsetFunctions.setLayers(this.openedFolio.diagram as Floorplan, newProps[prop])\n break;\n\n default:\n break;\n }\n })\n\n // assignement is necessary (pointer value for modelData)\n Object.assign(this.openedFolio.folio.modelData, (this.openedFolio.diagram as Floorplan).model.modelData);\n this.folioSvc.updateFolio(this.project, this.openedFolio)\n .subscribe()\n this.modal.hide()\n\n }\n\n deleteFolio() {\n this.modalSvc.show(ModalConfirmComponent, {\n initialState: {\n title: \"Suppression\",\n body:\n \"Êtes-vous sûr de vouloir supprimer cette page ? Cette action est irreversible.\",\n },\n });\n this.modalSvc.onHide.pipe(take(1)).subscribe((r) => {\n if (r === true) {\n const index = this.folioSvc.openedFolios.indexOf(this.openedFolio);\n if (index >= 0) {\n this.folioSvc.closeFolio$.next(\n this.folioSvc.openedFolios.indexOf(this.openedFolio)\n );\n }\n this.folioSvc\n .deleteFolio(this.project, this.openedFolio.folio)\n .subscribe(() => {\n this.modal.hide();\n });\n }\n });\n }\n}\n","import { Component, Input, OnDestroy, OnInit } from \"@angular/core\";\nimport { IFolio, IProject } from '@js-elec/js-elec-types';\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { BehaviorSubject } from \"rxjs\";\nimport { filter, switchMap, take } from \"rxjs/operators\";\nimport { ProjectService } from \"src/app/project/project.service\";\nimport { ModalConfirmComponent } from \"src/app/shared/components/modals/modal-confirm.component\";\nimport { FolioService, IOpenedFolio } from \"../folio.service\";\n\n@Component({\n selector: \"folio-list\",\n templateUrl: \"./folio-list.component.html\",\n})\nexport class FolioListComponent implements OnInit, OnDestroy {\n @Input() project!: IProject;\n selectedFolio$: BehaviorSubject;\n\n constructor(\n private projectSvc: ProjectService,\n private folioSvc: FolioService,\n private modalSvc: BsModalService,\n ) {\n this.selectedFolio$ = this.folioSvc.selectedFolio$;\n }\n\n ngOnInit() { }\n\n selectFolio(folio: IFolio) {\n this.folioSvc.addOpenedFolio(folio);\n }\n\n cloneFolio(folio: IFolio) {\n this.modalSvc.show(ModalConfirmComponent, { initialState: { title: \"Dupliquer\", body: \"La page sera dupliquée dans votre projet.\" } })\n this.modalSvc.onHide.pipe(\n take(1),\n filter(r => r === true),\n switchMap(_ => this.folioSvc.addFolio(this.projectSvc.currentProject.value as IProject, {\n name: folio.name,\n modelData: folio.modelData,\n nodeDataArray: folio.nodeDataArray,\n linkDataArray: folio.linkDataArray,\n }))\n ).subscribe()\n\n }\n\n ngOnDestroy() { }\n}\n","import { Component, Input, OnInit } from \"@angular/core\";\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n Validators\n} from \"@angular/forms\";\nimport { IFolio, IProject } from '@js-elec/js-elec-types';\nimport { BsModalRef } from \"ngx-bootstrap/modal\";\nimport { tap } from \"rxjs/operators\";\nimport { Floorplan } from \"src/app/floorPlanner/diagram/floorplan-diagram\";\nimport getsetFunctions from \"src/app/floorPlanner/inspector/getset-functions\";\nimport { FolioPropertyNames } from \"../folio.constants\";\nimport { FolioService, IOpenedFolio } from \"../folio.service\";\n\n@Component({\n selector: \"folio-properties\",\n templateUrl: \"./folio-properties.component.html\",\n})\nexport class FolioPropertiesComponent implements OnInit {\n @Input() project!: IProject;\n @Input() openedFolio!: IOpenedFolio;\n diagram!: Floorplan;\n\n form!: FormGroup;\n\n properties = Object.keys(FolioPropertyNames).filter(k => isNaN(Number(k)))\n\n layers: any;\n units: any;\n constructor(\n private folioSvc: FolioService,\n private fb: FormBuilder,\n private modal: BsModalRef\n ) { }\n\n ngOnInit() {\n this.diagram = this.openedFolio.diagram as Floorplan;\n this.layers = getsetFunctions.getLayers(this.diagram);\n this.units = getsetFunctions.getUnitsChoices();\n\n this.form = this.fb.group(\n {\n name: [this.openedFolio.folio.name, Validators.required],\n ...Object.keys(FolioPropertyNames)\n .filter(k => isNaN(Number(k)))\n .reduce((acc, k) => {\n acc[k] = new FormControl(this.openedFolio.diagram && getsetFunctions.getModelDataProperty(this.openedFolio.diagram, k as unknown as FolioPropertyNames)\n , Validators.required);\n return acc;\n }, {} as any)\n }\n );\n\n // function getScale(diag: go.Diagram) {\n // const units: string = diag.model.modelData.units;\n // const factor = this.model.modelData.unitsConversionFactor;\n\n // this.convertUnits(\n // DiagramUnitsConversionEnum[units],\n // DiagramUnitsConversionEnum.inchs,\n // 1\n // );\n // (1 / DiagramUnitsConversionEnum[units]) * 92;\n // return 0;\n // }\n }\n\n getUnitAbbr(): { label: string; value: string }[] {\n return getsetFunctions.getUnitsAbbreviation(this.diagram);\n }\n\n save() {\n Object.keys(FolioPropertyNames)\n .forEach(prop => getsetFunctions.setModelDataProperty(this.diagram, prop as unknown as FolioPropertyNames, this.form.value[prop]))\n\n this.folioSvc.updateFolio(this.project, { ...this.openedFolio, folio: { ...this.openedFolio.folio, name: this.form.value.name } })\n .pipe(\n tap(p => (this.folioSvc.selectedFolio$.value as IOpenedFolio).folio.name = this.form.value.name)\n )\n .subscribe()\n this.close()\n }\n\n close() {\n this.modal.hide()\n }\n\n\n}\n","import { Component, Input, OnDestroy, OnInit } from \"@angular/core\";\nimport { IFolio, IProject } from '@js-elec/js-elec-types';\nimport { Diagram, Model, ObjectData } from \"gojs\";\nimport { BehaviorSubject, Observable, Subject, combineLatest, interval } from \"rxjs\";\nimport { debounce, debounceTime, delay, distinctUntilChanged, distinctUntilKeyChanged, filter, map, startWith, tap } from \"rxjs/operators\";\nimport { FolioService, IOpenedFolio } from \"../folio.service\";\nimport getsetFunctions from \"src/app/floorPlanner/inspector/getset-functions\";\nimport { FolioPropertyNames } from \"../folio.constants\";\nimport { Floorplan } from \"src/app/floorPlanner/diagram/floorplan-diagram\";\n\n@Component({\n selector: \"folio-structure\",\n templateUrl: \"./folio-structure.component.html\",\n})\nexport class FolioStructureComponent implements OnInit, OnDestroy {\n @Input() project!: IProject;\n selectedFolio$: BehaviorSubject;\n\n tree$!: Observable\n\n constructor(\n private folioSvc: FolioService,\n ) {\n this.selectedFolio$ = this.folioSvc.selectedFolio$;\n\n this.tree$ = combineLatest(\n this.selectedFolio$,\n interval(2000)\n )\n .pipe(\n map(([v]) => v),\n debounceTime(600),\n filter((openedFolio): openedFolio is IOpenedFolio => !!openedFolio),\n // distinctUntilChanged((folioA, folioB) => folioA.folio.id !== folioB.folio.id),\n map(openedFolio => {\n const model: any = openedFolio.diagram!.model;\n const { nodeDataArray, linkDataArray } = model;\n return this.folioSvc.buildTree({ nodeDataArray, linkDataArray })\n }),\n // tap(console.log)\n )\n }\n\n ngOnInit() {\n\n }\n\n\n toggleVisibility(selectedNode: any) {\n\n function updateNodeVisibility(diagram: Floorplan, node: any, value: boolean) {\n const nodeObject = diagram.findNodeForKey(node.key)\n if (!nodeObject)\n return;\n\n diagram.startTransaction(\"set property\");\n diagram.model.setDataProperty(nodeObject.data, 'visible', value);\n diagram.commitTransaction(\"set property\");\n (node.children ?? []).forEach((child: any) => updateNodeVisibility(diagram, child, value))\n }\n // function updateCheckBoxesDown(node: ObjectData, value: boolean) {\n // node.diagram.startTransaction(\"set property\");\n // node.diagram.model.setDataProperty(node.data, 'visible', value);\n // node.diagram.commitTransaction(\"set property\");\n // node.findTreeChildrenNodes()\n // .filter((n: any) => n.)\n // .each((child: any) => updateCheckBoxesDown(child, value))\n // }\n\n const openedFolio = this.folioSvc.selectedFolio$.value\n if (openedFolio && openedFolio.diagram) {\n updateNodeVisibility(openedFolio.diagram, selectedNode, selectedNode.visible === undefined ? false : !selectedNode.visible)\n // const model: Model = openedFolio.diagram.model;\n // const nodeToToggle = model.nodeDataArray.find(node => node.key === selectedNode.key)\n // if (nodeToToggle) {\n // const nodeObject = openedFolio.diagram.findNodeForKey(nodeToToggle.key)\n // if (nodeObject)\n // updateCheckBoxesDown(nodeObject, nodeObject.data.visible === undefined ? false : !nodeObject.data.visible)\n // }\n }\n }\n\n ngOnDestroy() { }\n}\n","import { IFolio } from '@js-elec/js-elec-types';\nimport { GaineLengthsEnum } from \"../floorPlanner/models/elements\";\n\nexport enum WallThicknessEnum {\n wall = 10,\n internalWall = 7,\n cloison = 4,\n divider = 2,\n scale = 3\n}\n\nexport const defaultDiagramModelData = {\n units: \"m\",\n unitsAbbreviation: \"m\",\n unitsConversionFactor: 0.02,\n gridSize: 1,\n wallThickness: WallThicknessEnum.wall,\n properties: {\n hauteurPlafond: 250,\n hauteurInter: 110,\n hauteurInterExt: 110,\n hauteurPC: 30,\n // hauteurPCExt: 30,\n hauteurPCCredance: 110,\n hauteurPCHaute: 110,\n hauteurAppliques: 180,\n hauteurConduitsHauts: 260\n },\n preferences: {\n showWallGuidelines: true,\n showWallLengths: true,\n showWallAngles: true,\n showOnlySmallWallAngles: true,\n showGrid: true,\n gridSnap: false,\n },\n}\n\nexport const SymbolTypeHeightMapping = {\n \"Lampe\": \"hauteurPlafond\",\n \"Spot\": \"hauteurPlafond\",\n \"Spot Extérieur\": \"hauteurPlafond\",\n \"Dalle leds\": \"hauteurPlafond\",\n \"Eclairage\": \"hauteurPlafond\",\n \"Applique\": \"hauteurAppliques\",\n \"Eclairage fluo\": \"hauteurAppliques\",\n \"Eclairage applique\": \"hauteurAppliques\",\n \"Eclairage extérieur\": \"hauteurPlafond\",\n \"Lampe Extérieur\": \"hauteurPlafond\",\n \"Interrupteur\": \"hauteurInter\",\n \"Interrupteur à Variation\": \"hauteurInter\",\n \"Interrupteur à Voyant\": \"hauteurInter\",\n \"Interrupteur Va et Vient\": \"hauteurInter\",\n \"Interrupteur double\": \"hauteurInter\",\n \"Interrupteur et Va et Vient\": \"hauteurInter\",\n \"Va-et-vient\": \"hauteurInter\",\n \"Bouton Poussoir\": \"hauteurInter\",\n \"BP connecté\": \"hauteurInter\",\n \"Détecteur\": \"hauteurPlafond\",\n \"Détecteur mur\": \"hauteurAppliques\",\n \"Détecteur plafond\": \"hauteurPlafond\",\n \"Prise\": \"hauteurPC\",\n \"Prise de courant\": \"hauteurPC\",\n \"PC 16A 1.5mm²\": \"hauteurPC\",\n \"PC 16A 2.5mm²\": \"hauteurPC\",\n \"PC 16A 1.5mm² haute\": \"hauteurPCHaute\",\n \"PC 20A 2.5mm²\": \"hauteurPC\",\n \"PC cuisine\": \"hauteurPCCredance\",\n \"Prise simple\": \"hauteurPC\",\n \"Prise double\": \"hauteurPC\",\n \"Prise extérieur\": \"hauteurPC\",\n \"Prise USB\": \"hauteurPC\",\n \"Prise Spécialisé\": \"hauteurPC\",\n \"Prise haute\": \"hauteurPCHaute\",\n \"Prise simple haute\": \"hauteurPCHaute\",\n \"Prise double haute\": \"hauteurPCHaute\",\n \"Prise cuisine\": \"hauteurPCCredance\",\n \"Prise double crédence\": \"hauteurPCCredance\",\n \"Prise Informatique\": \"hauteurPC\",\n \"Prise TV\": \"hauteurPC\",\n \"Prise Téléphonique\": \"hauteurPC\",\n \"VMC\": \"hauteurPlafond\",\n \"Hotte\": \"hauteurAppliques\",\n \"Four\": \"hauteurPC\",\n \"Plaque de cuisson\": \"hauteurPC\",\n \"Lave vaisselle\": \"hauteurPC\",\n \"Lave linge\": \"hauteurPC\",\n \"Sèche linge\": \"hauteurPC\",\n \"Chauffe eau\": \"hauteurPCHaute\",\n \"Chauffe-Eau\": \"hauteurPCHaute\",\n \"Chaudière\": \"hauteurPCHaute\",\n \"Pompe à chaleur\": \"hauteurPC\",\n \"Circuit spécialisé\": \"hauteurPC\",\n \"PC 32A\": \"hauteurPC\",\n \"Contact Sec\": \"hauteurPC\",\n \"Liaison Tableau\": \"hauteurPC\",\n \"Contact Tableau\": \"hauteurPC\",\n \"Tableau Mono\": \"hauteurPC\",\n \"Boite Pieuvre\": \"hauteurConduitsHauts\",\n \"Terre\": \"hauteurPC\",\n \"Chauffage 1.5mm²\": \"hauteurPC\",\n \"Chauffage\": \"hauteurPC\",\n \"Convecteur Fil Pilote\": \"hauteurPC\",\n \"Autre circuit 2A\": \"hauteurInter\",\n \"Box domotique\": \"hauteurInter\",\n \"Ventilation\": \"hauteurConduitsHauts\",\n \"Volet roulant\": \"hauteurInter\",\n \"BSO\": \"hauteurInter\",\n \"Climatisation\": \"hauteurAppliques\",\n \"Store\": \"hauteurInter\"\n}\n\nexport enum FolioPropertyNames {\n \"hauteurPlafond\" = \"hauteurPlafond\",\n \"hauteurInter\" = \"hauteurInter\",\n \"hauteurInterExt\" = \"hauteurInterExt\",\n \"hauteurPC\" = \"hauteurPC\",\n // \"hauteurPCExt\"=// \"hauteurPCExt\",\n \"hauteurPCCredance\" = \"hauteurPCCredance\",\n \"hauteurPCHaute\" = \"hauteurPCHaute\",\n \"hauteurAppliques\" = \"hauteurAppliques\",\n \"hauteurConduitsHauts\" = \"hauteurConduitsHauts\",\n}\n\nexport type FolioProperties = {\n hauteurPlafond: number\n hauteurInter: number\n hauteurInterExt: number\n hauteurPC: number\n // hauteurPCExt: number\n hauteurPCCredance: number\n hauteurPCHaute: number\n hauteurAppliques: number\n hauteurConduitsHauts: number\n}\n\nexport const defaultFolio: IFolio = {\n name: \"Folio\",\n modelData: {\n units: \"m\",\n unitsAbbreviation: \"m\",\n elementSize: 0.60,\n textSize: 7,\n unitsConversionFactor: 0.02,\n gridSize: 1,\n wallThickness: 10,\n properties: {\n hauteurPlafond: 250,\n hauteurInter: 110,\n hauteurInterExt: 110,\n hauteurPC: 30,\n // hauteurPCExt: 30,\n hauteurPCCredance: 110,\n hauteurPCHaute: 110,\n hauteurAppliques: 180,\n hauteurConduitsHauts: 260,\n } as FolioProperties,\n preferences: {\n showWallGuidelines: true,\n showWallLengths: true,\n showWallAngles: true,\n showOnlySmallWallAngles: true,\n showGrid: true,\n gridSnap: true,\n },\n },\n nodeDataArray: [],\n linkDataArray: [],\n};\n\nexport const gaineLengths: { [k in GaineLengthsEnum]: { color: string, length: number } } = {\n length1650: {\n color: '#7F0000',\n length: 16.50\n },\n length1150: {\n color: '#FF6A00',\n length: 11.50\n },\n length1050: {\n color: '#B200FF',\n length: 10.50\n },\n length950: {\n color: '#00B050',\n length: 9.50\n },\n length850: {\n color: '#0000FF',\n length: 8.50\n },\n length750: {\n color: '#0094FF',\n length: 7.50\n },\n}","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { RouterModule } from \"@angular/router\";\nimport { TranslateModule } from \"@ngx-translate/core\";\nimport { AngularSvgIconModule } from \"angular-svg-icon\";\nimport { LayoutModule } from \"../layout/layout.module\";\nimport { SharedModule } from \"../shared/shared.module\";\nimport { FolioLayersComponent } from \"./components/folio-layers.component\";\nimport { FolioListComponent } from \"./components/folio-list.component\";\nimport { FolioPropertiesComponent } from \"./components/folio-properties.component\";\nimport { FolioStructureComponent } from \"./components/folio-structure.component\";\n\n@NgModule({\n imports: [\n CommonModule,\n RouterModule,\n ReactiveFormsModule,\n AngularSvgIconModule,\n\n SharedModule,\n LayoutModule,\n ],\n declarations: [FolioListComponent, FolioStructureComponent, FolioPropertiesComponent, FolioLayersComponent],\n exports: [FolioListComponent, FolioStructureComponent, FolioPropertiesComponent],\n})\nexport class FolioModule { }\n","import { HttpClient } from \"@angular/common/http\";\nimport { Injectable } from \"@angular/core\";\nimport { Diagram, GraphLinksModel } from \"gojs\";\nimport { IFolio, IProject } from '@js-elec/js-elec-types';\nimport { BehaviorSubject, Observable, Subject } from \"rxjs\";\nimport { catchError, debounceTime, map, switchMap, tap } from \"rxjs/operators\";\nimport { environment } from \"src/environments/environment\";\nimport { Floorplan } from \"../floorPlanner/diagram/floorplan-diagram\";\nimport { getGaineMaxLength } from \"../floorPlanner/tools\";\nimport { NotificationService } from \"../shared/services/notify.service\";\nimport { WallThicknessEnum, defaultFolio } from \"./folio.constants\";\n\nexport interface IOpenedFolio {\n folio: IFolio;\n diagram?: Floorplan;\n}\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class FolioService {\n openedFolios: IOpenedFolio[] = [];\n selectedFolio$ = new BehaviorSubject(null);\n openFolio$ = new Subject();\n closeFolio$ = new Subject();\n wallModeActivated$ = new BehaviorSubject(undefined);\n lockGrounds$ = new BehaviorSubject(true);\n showMeasures$ = new BehaviorSubject(false);\n\n autoSave$ = new Subject<{ project: IProject, openedFolio: IOpenedFolio }>();\n\n constructor(\n private httpClient: HttpClient,\n private notifySvc: NotificationService\n ) {\n this.openFolio$.subscribe((folio) => {\n const doublon = this.openedFolios.find((f) => f.folio.id === folio.id);\n if (doublon) {\n this.selectedFolio$.next(doublon);\n return;\n }\n const openedFolio = { folio };\n this.selectedFolio$.next(openedFolio);\n this.openedFolios.push(openedFolio);\n });\n\n this.closeFolio$.subscribe((index) => {\n if (index >= 0 && index < this.openedFolios.length) {\n this.openedFolios.splice(index, 1);\n if (this.openedFolios.length > 1) {\n this.selectedFolio$.next(this.openedFolios[Math.max(0, index - 1)]);\n } else {\n this.selectedFolio$.next(null);\n }\n }\n });\n\n this.showMeasures$.subscribe((showMeasures: boolean) => {\n if (showMeasures) {\n this.openedFolios.forEach(folio => {\n // folio.diagram?.dimensionLinks.clear();\n // folio.diagram?.wall\n // folio.diagram?.updateWallDimensions();\n })\n }\n })\n\n this.autoSave$\n .pipe(\n debounceTime(1200),\n switchMap(({ project, openedFolio }) => this.updateFolio(project, openedFolio))\n ).subscribe()\n }\n\n addOpenedFolio(folio: IFolio) {\n this.openFolio$.next(folio);\n }\n\n removeOpenedFolio(index: number) {\n this.closeFolio$.next(index);\n }\n\n closeAllFolios() {\n this.openedFolios = [];\n this.selectedFolio$.next(null)\n }\n\n findOpenedFolio(folio: IFolio) {\n return this.openedFolios.find((f) => f.folio.id === folio.id);\n }\n\n setDiagramFolio(folio: IFolio, diagram: Floorplan) {\n const openedFolio = this.findOpenedFolio(folio);\n if (openedFolio) {\n openedFolio.diagram = diagram;\n }\n }\n\n addFolio(project: IProject, folio: IFolio): Observable {\n const doublon = project.folios.find(f => f.name === folio.name)\n if (doublon) {\n folio.name = folio.name + \" 2\";\n }\n return this.httpClient\n .post(\n `${(environment as any).apiHost}/folio/${project.id}`,\n Object.assign(JSON.parse(JSON.stringify(defaultFolio)), folio)\n )\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\"error\", `Une erreur s'est produite`);\n throw err;\n }),\n map(projectUpdated => projectUpdated.folios[projectUpdated.folios.length - 1]),\n tap(newFolio => project.folios.push(newFolio)),\n tap(newFolio => this.openFolio$.next(newFolio))\n );\n }\n\n updateFolio(\n project: IProject,\n openedFolio: IOpenedFolio\n ): Observable {\n const doublon = project.folios.find(f => f.name === openedFolio.folio.name && f.id !== openedFolio.folio.id)\n if (doublon) {\n openedFolio.folio.name = openedFolio.folio.name + \" 2\";\n }\n\n if (openedFolio.diagram) {\n const model: any = JSON.parse(openedFolio.diagram.model.toJson());\n openedFolio.folio.nodeDataArray = model.nodeDataArray;\n openedFolio.folio.linkDataArray = model.linkDataArray;\n openedFolio.folio.modelData = model.modelData;\n }\n\n return this.httpClient\n .put(\n `${(environment as any).apiHost}/folio/${project.id}/${openedFolio.folio.id}`,\n openedFolio.folio\n )\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\"error\", \"Une erreur s'est produite\");\n console.log(err);\n throw err;\n })\n );\n }\n\n deleteFolio(project: IProject, folio: IFolio) {\n const folioIndex = project.folios.indexOf(folio);\n return this.httpClient\n .delete(\n `${(environment as any).apiHost}/folio/${project.id}/${project.folios[folioIndex].id\n }`\n )\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\"error\", `Une erreur s'est produite`);\n throw err;\n }),\n tap(() => project.folios.splice(folioIndex, 1))\n );\n }\n\n lockGrounds(lock: boolean) {\n this.lockGrounds$.next(lock)\n }\n\n isGroundLocked() {\n return this.lockGrounds$.value\n }\n\n showMeasures(showMeasures: boolean) {\n this.showMeasures$.next(showMeasures)\n }\n\n shouldDisplayMeasures() {\n return this.showMeasures$.value;\n }\n\n getMaterials(folio: IFolio) {\n return folio.nodeDataArray\n .filter(nodeData => nodeData.category === 'element')\n .map(nodeData => ({\n identifiant: nodeData.key,\n etiquette: nodeData.name,\n type: nodeData.type,\n connected: nodeData.deviceConnected ? 'Connecté' : '-',\n tableau: nodeData.tableau,\n refMateriel: \"\"\n }))\n }\n\n getConduits(folio: IFolio) {\n const tree = this.buildTreeForConduits(folio);\n const conduits = tree\n .filter(n => n.parent)\n .map(node => folio.linkDataArray.find(link =>\n (link.to === node.key && link.from === node.parent) ||\n (link.from === node.key && link.to === node.parent)))\n .filter(n => n !== undefined)\n .map(link => ({\n tenant: folio.nodeDataArray.find(node => node.key === link?.from)?.name || link?.from,\n aboutissant: folio.nodeDataArray.find(node => node.key === link?.to)?.name || link?.to,\n type: 'Conduit',\n longueur: link?.length,\n chutes: getGaineMaxLength(link?.linkLength) !== undefined ? (getGaineMaxLength(link?.linkLength) || 0) - link?.length : 'N/A'\n }))\n return conduits;\n // return folio.linkDataArray\n // .filter(link => /(tableau)/i.test(link.to) || /(tableau)/i.test(link.from))\n // .sort((link1, link2) => link1.key < link2.key ? 1 : -1)\n // .map(link => ({\n // tenant: folio.nodeDataArray.find(node => node.key === link.from)?.name || link.from,\n // aboutissant: folio.nodeDataArray.find(node => node.key === link.to)?.name || link.to,\n // type: 'Conduit',\n // longueur: link.length\n // }))\n }\n\n buildTreeForConduits(data: { linkDataArray: any[], nodeDataArray: any[] }, tree: any[] = [], ancestors?: any[]): any[] {\n\n if (!ancestors) {\n ancestors = data.nodeDataArray.filter(node => /tableau/i.test(node.key))\n if (!ancestors || !ancestors.length)\n return tree;\n }\n\n ancestors.forEach(parentNode => {\n // get links starting from parent node\n const links = data.linkDataArray\n // regular structure\n .filter(link => link.from === parentNode.key || link.to === parentNode.key)\n // filter not valid links\n .filter(link => link.from !== link.to && link.from && link.to)\n\n const aboutissantsKey = links.map(link => link.to === parentNode.key ? link.from : link.to);\n const aboutissants: any[] = data.nodeDataArray\n .filter(node => aboutissantsKey.indexOf(node.key) >= 0)\n // node not treated\n .filter(node => !tree.find(n => n.key === node.key))\n // make copy\n .map(node => ({ ...node }));\n\n tree.push(parentNode)\n aboutissants.forEach(ab => {\n ab.parent = parentNode.key;\n ab.length = 10;\n tree = this.buildTreeForConduits(data, tree, [ab])\n });\n\n })\n\n return tree;\n }\n\n findComponentInTree(componentId: string, tree?: any[]) {\n if (!tree) {\n const selectedFolio = this.selectedFolio$.value as IOpenedFolio;\n if (selectedFolio.diagram) {\n const { linkDataArray, nodeDataArray } = selectedFolio.diagram.model as go.GraphLinksModel\n tree = this.buildTreeForConduits({ linkDataArray, nodeDataArray })\n }\n else\n tree = []\n }\n\n const foundNode = tree.find(node => node.key === componentId);\n return foundNode;\n }\n\n buildTree(data: { linkDataArray: any[], nodeDataArray: any[] }, tree: any[] = [], ancestors?: any[]): any[] {\n\n if (!ancestors) {\n ancestors = data.nodeDataArray.filter(node => /tableau/i.test(node.key))\n if (!ancestors || !ancestors.length)\n return tree;\n }\n\n ancestors.forEach(parentNode => {\n // get links starting from parent node\n const links = data.linkDataArray\n .filter(link => !parentNode.parent || ![link.to, link.from].includes(parentNode.parent))\n // regular structure\n .filter(link => link.from === parentNode.key || link.to === parentNode.key)\n // filter not valid links\n .filter(link => link.from !== link.to && link.from && link.to)\n\n // unorderedLinks\n links\n .filter(link => link.to === parentNode.parent)\n .forEach(link => {\n const temp = link.from;\n link.from = link.to\n link.to = temp\n })\n\n const aboutissantsKey = links\n .map(link => link.to === parentNode.key ? link.from : link.to);\n const aboutissants: any[] = data.nodeDataArray\n .filter(node => aboutissantsKey.indexOf(node.key) >= 0)\n // only derivations\n .filter(node => /(pieuvre|boite)/i.test(node.key))\n\n parentNode.children = aboutissants;\n tree.push(parentNode)\n aboutissants.forEach(ab => {\n ab.parent = parentNode.key;\n // ab.length = 10;\n this.buildTree(data, undefined, [ab])\n });\n\n })\n\n return tree;\n }\n}\n","import { Injectable } from \"@angular/core\";\nimport {\n HttpEvent,\n HttpInterceptor,\n HttpHandler,\n HttpRequest,\n HttpErrorResponse,\n} from \"@angular/common/http\";\n\nimport { AuthService } from \"../auth/auth.service\";\nimport { IAuth } from '@js-elec/js-elec-types';\nimport { environment } from \"src/environments/environment\";\nimport { catchError } from \"rxjs/operators\";\nimport { NotificationService } from \"../shared/services/notify.service\";\n\n@Injectable()\nexport class AuthInterceptor implements HttpInterceptor {\n constructor(private auth: AuthService, private notifySvc: NotificationService) { }\n\n intercept(req: HttpRequest, next: HttpHandler) {\n const token = this.auth.getToken();\n\n // Clone the request and set the new header in one step.\n if (req.url.match(new RegExp(environment.apiHost)) && token !== null && !req.headers.get('Authorization')) {\n const authReq = req.clone({\n setHeaders: { Authorization: 'bearer ' + token, 'Access-Control-Allow-Origin': '*' },\n });\n return next.handle(authReq).pipe(\n catchError((err: HttpErrorResponse) => {\n if (err.status === 402) {\n this.notifySvc.notification(\"error\", \"Vous devez souscrire à un abonnement pour pouvoir effectuer cette action\")\n }\n throw (err);\n })\n );\n } else {\n return next.handle(req);\n }\n }\n}\n","/* \"Barrel\" of Http Interceptors */\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { AuthInterceptor } from './auth-interceptor';\n\n/** Http interceptor providers in outside-in order */\nexport const httpInterceptorProviders = [\n { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },\n];\n","import { Component } from \"@angular/core\";\n\n@Component({\n selector: \"app-layout\",\n templateUrl: \"app-layout.component.html\",\n styleUrls: [\"app-layout.component.scss\"],\n})\nexport class AppLayoutComponent {}\n","import { Component, OnDestroy } from \"@angular/core\";\nimport { ActivatedRoute } from \"@angular/router\";\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { Subject } from \"rxjs\";\nimport { take, takeUntil } from \"rxjs/operators\";\nimport { ProjectSelectComponent } from \"../project/components/project-select.component\";\nimport { ProjectService } from \"../project/project.service\";\n\n@Component({\n selector: \"layout-editor\",\n templateUrl: \"./layout-editor.component.html\",\n})\nexport class LayoutEditorComponent implements OnDestroy {\n destroy$ = new Subject();\n\n constructor(\n private route: ActivatedRoute,\n private modalSvc: BsModalService,\n private projectSvc: ProjectService\n ) {\n this.route.url.pipe(takeUntil(this.destroy$)).subscribe(_ => {\n if (this.route.children.length === 0) {\n this.modalSvc.show(ProjectSelectComponent);\n // this.modalSvc.onHide.pipe(take(1));\n } else {\n this.projectSvc\n .getProject(this.route.snapshot.children[0].params.projectId)\n .subscribe((project) => this.projectSvc.currentProject.next(project));\n }\n });\n }\n\n ngOnDestroy() {\n this.destroy$.next(true);\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { RouterModule } from \"@angular/router\";\nimport { AppLayoutComponent } from \"./app-layout.component\";\nimport { LayoutEditorComponent } from \"./layout-editor.component\";\nimport { ModalLayoutComponent } from \"./modal-layout.component\";\n\n@NgModule({\n imports: [RouterModule],\n declarations: [\n AppLayoutComponent,\n LayoutEditorComponent,\n ModalLayoutComponent,\n ],\n exports: [AppLayoutComponent, LayoutEditorComponent, ModalLayoutComponent],\n})\nexport class LayoutModule {}\n","import { Component } from \"@angular/core\";\n\n@Component({\n selector: \"modal-layout\",\n templateUrl: \"modal-layout.component.html\",\n styleUrls: [\"modal-layout.component.scss\"],\n})\nexport class ModalLayoutComponent {}\n","import { Component, OnInit, ViewChild } from \"@angular/core\";\r\nimport { FeaturesService } from \"src/app/shared/services/features.service\";\r\n\r\nimport * as furnitures from \"src/assets/palette-furnitures.json\";\r\nimport { PaletteComponent } from \"./palette.component\";\r\n\r\n@Component({\r\n selector: \"all-palettes\",\r\n templateUrl: \"all-palettes.component.html\",\r\n styleUrls: [\"all-palettes.component.scss\"],\r\n})\r\nexport class AllPalettesComponent implements OnInit {\r\n @ViewChild(\"paletteFurnitures\") paletteFurnitures!: PaletteComponent;\r\n\r\n furnituresPaletteData = (furnitures as any).default;\r\n elecPaletteData = FeaturesService.symbolLib$.value;//(elecLib as any).default.categories;\r\n\r\n tabs!: any[];\r\n\r\n constructor() {\r\n\r\n }\r\n\r\n selectPalette(palette: PaletteComponent) {\r\n palette.requestUpdate();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.elecPaletteData = this.elecPaletteData.categories;\r\n\r\n this.tabs = this.elecPaletteData.map((category: any) => ({\r\n name: category.name,\r\n data: {\r\n nodeDataArray: category.symbols,\r\n },\r\n }));\r\n\r\n }\r\n}\r\n","/*\n * Copyright (C) 1998-2020 by Northwoods Software Corporation\n * All Rights Reserved.\n *\n * FloorplanPalette Class\n * A FloorplanPalette is a Palette with special rules\n */\n\nimport * as go from \"gojs\";\nimport {\n makeDefaultNode,\n makeWindowNode,\n makeMultiPurposeNode,\n makeRoomNode,\n makeDoorNode,\n makePaletteWallNode,\n makeElementNode,\n makeGroundNode,\n makeTextNode,\n} from \"../../floorPlanner/diagram/floorplan-diagram\";\nimport { environment } from \"src/environments/environment\";\n\nexport class FloorplanPalette extends go.Palette {\n constructor() {\n go.Diagram.licenseKey = environment.goLicense;\n\n super();\n\n const $ = go.GraphObject.make;\n this.contentAlignment = go.Spot.Center;\n this.layout = $(go.GridLayout);\n (this.layout as go.GridLayout).wrappingColumn = 1;\n\n // this.addDiagramListener(\"SelectionDeleted\", function (e) {\n // console.log(e)\n // });\n\n this.nodeTemplateMap.add(\"\", makeDefaultNode()); // Default Node (furniture)\n this.nodeTemplateMap.add(\"MultiPurposeNode\", makeMultiPurposeNode()); // Multi-Purpose Node\n this.nodeTemplateMap.add(\"WindowNode\", makeWindowNode()); // Window Node\n this.nodeTemplateMap.add(\"PaletteWallNode\", makePaletteWallNode()); // Palette Wall Node\n this.nodeTemplateMap.add(\"DoorNode\", makeDoorNode()); // Door Node\n this.nodeTemplateMap.add(\"RoomNode\", makeRoomNode()); // Room Node\n\n this.nodeTemplateMap.add(\"squid\", makeElementNode(true)); // Room Node\n this.nodeTemplateMap.add(\"element\", makeElementNode(true)); // Room Node\n this.nodeTemplateMap.add(\"text\", makeTextNode(true)); // Room Node\n this.nodeTemplateMap.add(\"ground\", makeGroundNode()); // Room Node\n\n // palette also contains \"floor\" nodes -- nodes of particular\n // floor types that can be dragged and dropped into wall-enclosed areas to create Room Nodes\n this.nodeTemplateMap.add(\n \"FloorNode\",\n $(\n go.Node,\n \"Auto\",\n $(\n go.Shape,\n { fill: makeFloorBrush(null), desiredSize: new go.Size(100, 100) },\n new go.Binding(\"fill\", \"floorImage\", (src) => {\n return makeFloorBrush(src);\n })\n ),\n $(\n go.TextBlock,\n \"Drag me out to a wall-enclosed space to create a room\",\n { desiredSize: new go.Size(90, NaN) },\n new go.Binding(\"visible\", \"\", (node: go.Node) => {\n if (node.diagram instanceof go.Palette) {\n return true;\n }\n return false;\n }).ofObject()\n )\n )\n );\n\n this.toolManager.contextMenuTool.isEnabled = false;\n\n // add this new FloorplanPalette to the \"palettes\" field of its associated Floorplan\n // floorplan.palettes.push(this);\n } // end FloorplanPalette constructor\n}\n\n/**\n * Make a Pattern brush for floor nodes\n * @param src The relative path of the image to use for the pattern brush. If this is not specified, a default path is tried\n */\nfunction makeFloorBrush(src: string | null) {\n const $ = go.GraphObject.make;\n if (src === null || src === undefined) {\n src = \"images/textures/floor1.jpg\";\n }\n const floorImage = new Image();\n floorImage.src = src;\n return $(go.Brush, \"Pattern\", { pattern: floorImage });\n}\n\n// export = FloorplanPalette;\n","import { Component, Input, OnInit, ViewChild } from \"@angular/core\";\nimport * as go from \"gojs\";\nimport {\n PaletteComponent as GoPaletteComponent\n} from \"gojs-angular\";\nimport { FloorplanPalette } from \"./floorplan-palette\";\n\n@Component({\n selector: \"palette\",\n templateUrl: \"palette.component.html\",\n styleUrls: [\"palette.component.scss\"],\n})\nexport class PaletteComponent implements OnInit {\n @ViewChild(\"palette\", { static: true })\n paletteComponent!: GoPaletteComponent;\n\n @Input() paletteId!: string;\n @Input() data!: { nodeDataArray: any[]; linkDataArray: any[]; modelData: any };\n\n constructor() { }\n\n ngOnInit() {\n }\n\n public requestUpdate() {\n this.paletteComponent.palette?.requestUpdate();\n }\n\n initPalette(): go.Palette {\n const fp = new FloorplanPalette();\n return fp;\n // palette.model = $(go.GraphLinksModel, {\n // linkKeyProperty: \"key\", // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n // });\n }\n\n paletteModelChange = function (changes: go.IncrementalData) {\n return;\n // this.paletteNodeData = DataSyncService.syncNodeData(\n // changes,\n // this.paletteNodeData\n // );\n // this.paletteLinkData = DataSyncService.syncLinkData(\n // changes,\n // this.paletteLinkData\n // );\n // this.paletteModelData = DataSyncService.syncModelData(\n // changes,\n // this.paletteModelData\n // );\n };\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FeaturesService } from 'src/app/shared/services/features.service';\n// import squidLib from \"../../models/squid-lib.json\";\n\n@Component({\n selector: 'squid-palette',\n templateUrl: './squid-palette.component.html',\n styleUrls: ['./squid-palette.component.css']\n})\nexport class SquidPaletteComponent implements OnInit {\n squidPaletteData = {\n nodeDataArray: FeaturesService.squidLib$.value.categories[0].symbols as any, //(squidLib as any).categories[0].symbols as any,\n // linkDataArray: [],\n // modelData: {}\n };\n\n constructor() {\n }\n\n ngOnInit(): void {\n\n\n }\n\n\n}\n","import { Component, OnDestroy, OnInit, ViewChild } from \"@angular/core\";\nimport * as go from \"gojs\";\nimport {\n PaletteComponent as GoPaletteComponent\n} from \"gojs-angular\";\nimport { Subject } from \"rxjs\";\nimport { switchMap, takeUntil } from \"rxjs/operators\";\nimport { ProjectService } from \"src/app/project/project.service\";\nimport * as walls from \"src/assets/palette-walls.json\";\nimport { environment } from \"src/environments/environment\";\nimport { FloorplanPalette } from \"./floorplan-palette\";\nimport { IProject } from \"@js-elec/js-elec-types\";\n\n@Component({\n selector: \"wall-palette\",\n templateUrl: \"./wall-palette.component.html\",\n})\nexport class WallPaletteComponent implements OnInit, OnDestroy {\n @ViewChild(\"palette\", { static: true })\n paletteComponent!: GoPaletteComponent;\n\n data = { ...(walls as any).default };\n\n destroy$ = new Subject();\n\n constructor(private projectSvc: ProjectService) {\n this.projectSvc.currentProject\n .pipe(\n takeUntil(this.destroy$),\n // switchMap((project) => {\n // const img = new Image();\n // img.addEventListener(\"load\", function () {\n // alert(this.naturalWidth + ' ' + this.naturalHeight);\n // });\n // img.src = url;\n // })\n\n )\n .subscribe((project) => {\n this.data.nodeDataArray = [\n ...(walls as any).default.nodeDataArray,\n ...(project?.groundImages || []).map((_img, index) => ({\n key: \"groundImg-\" + index,\n category: \"ground\",\n source: environment.storageUrl + _img, // + '-original',\n width: 100,\n height: 60,\n imageStretch: go.GraphObject.Uniform\n })),\n ];\n });\n }\n\n ngOnInit() { }\n\n public requestUpdate() {\n this.paletteComponent.palette?.requestUpdate();\n }\n\n initPalette(): go.Palette {\n const fp = new FloorplanPalette();\n\n fp.commandHandler.canDeleteSelection = function () {\n return (this.diagram.selection.first() as any).hb.category === 'ground';\n\n };\n\n fp.addDiagramListener('SelectionDeleted', (evt: any) => {\n // const fileName = evt.subject.toArray()[0].hb.source.match(/[^/]+\\/groundPictures\\/.+$/i)[0];\n // this.projectSvc\n // .deleteMap(this.projectSvc.currentProject.value?.id as string, fileName)\n // .subscribe((project: IProject) => {\n // // (this.projectSvc.currentProject.value as IProject).groundImages = project.groundImages\n // this.projectSvc.currentProject.next(project)\n // });\n\n // palette.model = $(go.GraphLinksModel, {\n // linkKeyProperty: \"key\", // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n // });\n })\n return fp;\n }\n\n paletteModelChange = function (changes: go.IncrementalData) {\n return;\n // this.paletteNodeData = DataSyncService.syncNodeData(\n // changes,\n // this.paletteNodeData\n // );\n // this.paletteLinkData = DataSyncService.syncLinkData(\n // changes,\n // this.paletteLinkData\n // );\n // this.paletteModelData = DataSyncService.syncModelData(\n // changes,\n // this.paletteModelData\n // );\n };\n\n ngOnDestroy() {\n this.destroy$.next(true);\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { AngularSvgIconModule } from \"angular-svg-icon\";\nimport { GojsAngularModule } from 'gojs-angular';\nimport { AccordionModule } from \"ngx-bootstrap/accordion\";\nimport { ModalModule } from \"ngx-bootstrap/modal\";\nimport { AllPalettesComponent } from \"./components/all-palettes.component\";\nimport { PaletteComponent } from \"./components/palette.component\";\nimport { WallPaletteComponent } from \"./components/wall-palette.component\";\nimport { SquidPaletteComponent } from './components/squid-palette/squid-palette.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n GojsAngularModule,\n ModalModule.forRoot(),\n AccordionModule.forRoot(),\n\n AngularSvgIconModule,\n ],\n providers: [],\n declarations: [PaletteComponent, WallPaletteComponent, AllPalettesComponent, SquidPaletteComponent, SquidPaletteComponent],\n exports: [PaletteComponent, WallPaletteComponent, AllPalettesComponent, SquidPaletteComponent],\n})\nexport class PaletteModule { }\n","import { Component, OnInit } from \"@angular/core\";\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\nimport { Router } from \"@angular/router\";\nimport { IProject } from '@js-elec/js-elec-types';\nimport { BsModalRef, BsModalService } from \"ngx-bootstrap/modal\";\nimport { ProjectService } from \"../project.service\";\n\n@Component({\n selector: \"create-project\",\n templateUrl: \"./project-create.component.html\",\n})\nexport class ProjectCreateComponent implements OnInit {\n projectForm!: FormGroup;\n constructor(\n private fb: FormBuilder,\n private modalSvc: BsModalService,\n public modal: BsModalRef,\n private projectSvc: ProjectService,\n private router: Router\n ) { }\n\n ngOnInit() {\n this.projectForm = this.fb.group({\n name: [\"\", Validators.required],\n });\n }\n\n createProject() {\n if (this.projectForm.valid) {\n this.projectSvc\n .createProject(this.projectForm.value as IProject)\n .subscribe((p) => {\n this.router.navigate([\"/\", \"editor\", p.id]);\n\n this.sendValue(p);\n });\n }\n }\n\n sendValue(val: any) {\n const reason: any = val;\n this.modalSvc.setDismissReason(reason);\n this.modal.hide();\n }\n}\n","import { Component, OnDestroy, OnInit } from \"@angular/core\";\nimport { ApiListResult, IProject } from '@js-elec/js-elec-types';\nimport { Observable } from \"rxjs\";\nimport { ProjectService } from \"../project.service\";\n\n@Component({\n selector: \"project-list\",\n templateUrl: \"./project-list.component.html\",\n})\nexport class ProjectListComponent implements OnInit, OnDestroy {\n projects$: Observable>;\n\n constructor(private projectSvc: ProjectService) {\n this.projects$ = this.projectSvc.getMyProjects();\n }\n\n ngOnInit() {}\n\n ngOnDestroy() {}\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges\n} from \"@angular/core\";\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\nimport { IFolio, IProject, ProjectStatusEnum } from '@js-elec/js-elec-types';\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { of, Subject } from \"rxjs\";\nimport { debounceTime, filter, switchMap, take, takeUntil, tap } from \"rxjs/operators\";\nimport { FolioService } from \"src/app/folio/folio.service\";\nimport { ModalConfirmComponent } from \"src/app/shared/components/modals/modal-confirm.component\";\nimport { ModalInputComponent } from \"src/app/shared/components/modals/modal-input.component\";\nimport * as XLSX from \"xlsx\";\nimport { ProjectService } from \"../project.service\";\n\n@Component({\n selector: \"project-properties\",\n templateUrl: \"./project-properties.component.html\",\n})\nexport class ProjectPropertiesComponent implements OnInit, OnChanges, OnDestroy {\n @Input() project!: IProject;\n @Output() folioSelected = new EventEmitter();\n projectForm!: FormGroup;\n\n status = ProjectStatusEnum;\n\n destroy$ = new Subject();\n\n constructor(\n private fb: FormBuilder,\n private projectSvc: ProjectService,\n private folioSvc: FolioService,\n private modal: BsModalService,\n ) { }\n\n ngOnInit() {\n this.initForm()\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.project) {\n this.initForm();\n }\n }\n\n initForm() {\n this.projectForm = this.fb.group({\n name: [this.project.name, Validators.required],\n });\n\n this.projectForm.valueChanges\n .pipe(\n takeUntil(this.destroy$),\n debounceTime(400),\n filter(_ => this.projectForm.valid),\n switchMap(v => this.save(v as IProject)),\n tap((p: IProject) => {\n (this.projectSvc.currentProject.value as IProject).name = p.name\n if (this.projectForm.get('name')?.value !== p?.name)\n this.projectForm.get('name')?.setValue(p?.name)\n })\n )\n .subscribe();\n }\n\n validateProject() {\n this.modal.show(ModalConfirmComponent, {\n initialState: {\n title: 'Souhaitez-vous valider votre projet maintenant ?',\n }\n })\n this.modal.onHide.pipe(\n take(1),\n filter(r => r === true),\n switchMap(_ => this.projectSvc.validateProject(this.project.id as string))\n ).subscribe()\n }\n\n addFolio() {\n this.modal.show(ModalInputComponent, {\n initialState: {\n title: \"Nouvelle Page\",\n fields: [\n { name: \"name\", label: \"Nom de la page\", type: \"text\", required: true },\n ],\n },\n });\n\n this.modal.onHide.pipe(take(1)).subscribe((info) => {\n if (typeof info === \"object\") {\n this.folioSvc.addFolio(this.project, info).subscribe();\n }\n });\n }\n\n selectFolio(folio: IFolio) {\n this.folioSelected.emit(folio);\n }\n\n save(v: IProject) {\n return this.projectSvc\n .updateProject(this.project.id as string, v)\n }\n\n materialList() {\n const project = this.projectSvc.currentProject.value as IProject\n const materials = this.projectSvc.getMaterials(project)\n\n /* generate workbook and add the worksheet */\n const wb: XLSX.WorkBook = XLSX.utils.book_new();\n materials.forEach(folioMaterial => {\n\n const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(folioMaterial.materials);\n XLSX.utils.book_append_sheet(wb, ws, folioMaterial.folio);\n })\n\n /* save to file */\n XLSX.writeFile(wb, project.name + \"_materiels\" + \".xlsx\");\n }\n\n conduitsList() {\n const project = this.projectSvc.currentProject.value as IProject\n const conduits = this.projectSvc.getConduits(project)\n\n /* generate workbook and add the worksheet */\n const wb: XLSX.WorkBook = XLSX.utils.book_new();\n conduits.forEach(folioConduit => {\n\n const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(folioConduit.conduits);\n XLSX.utils.book_append_sheet(wb, ws, folioConduit.folio);\n })\n\n /* save to file */\n XLSX.writeFile(wb, project.name + \"_conduits\" + \".xlsx\");\n }\n\n ngOnDestroy() {\n this.destroy$.next(true);\n }\n}\n","import { Component, OnInit } from \"@angular/core\";\nimport { FormBuilder } from \"@angular/forms\";\nimport { ActivatedRoute, Router } from \"@angular/router\";\nimport { ApiListResult, IProject } from '@js-elec/js-elec-types';\nimport { BehaviorSubject, Observable } from \"rxjs\";\nimport { FolioService } from \"src/app/folio/folio.service\";\nimport { ProjectService } from \"../project.service\";\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { ProjectCreateComponent } from \"./project-create.component\";\nimport { map, switchMap } from \"rxjs/operators\";\n\n@Component({\n selector: \"select-project\",\n templateUrl: \"./project-select.component.html\",\n})\nexport class ProjectSelectComponent implements OnInit {\n projects$: Observable>;\n\n navigation$!: Observable<{ page: number, limit: number }>;\n\n constructor(\n private fb: FormBuilder,\n private projectSvc: ProjectService,\n private folioSvc: FolioService,\n private modalSvc: BsModalService,\n private route: ActivatedRoute,\n private router: Router\n ) {\n this.navigation$ = this.route.queryParams\n .pipe(\n map(({ page = 1, limit = 10 }) => ({\n page,\n limit,\n }))\n )\n\n this.projects$ = this.navigation$\n .pipe(\n switchMap(navigation => this.projectSvc.getMyProjects({}, navigation.page, navigation.limit))\n );\n }\n\n ngOnInit() { }\n\n selectProject(project: IProject) {\n this.folioSvc.closeAllFolios()\n this.router.navigate([\"/\", \"editor\", project.id]);\n // this.sendValue(project);\n }\n\n newDossier() {\n this.modalSvc.show(ProjectCreateComponent)\n }\n\n // sendValue(val: any) {\n // const reason: any = val;\n // this.modalSvc.setDismissReason(reason);\n // this.modal.hide();\n // }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { RouterModule } from \"@angular/router\";\nimport { AngularSvgIconModule } from \"angular-svg-icon\";\nimport { ModalModule } from \"ngx-bootstrap/modal\";\nimport { FolioModule } from \"../folio/folio.module\";\nimport { SharedModule } from \"../shared/shared.module\";\nimport { ProjectCreateComponent } from \"./components/project-create.component\";\nimport { ProjectListComponent } from \"./components/project-list.component\";\nimport { ProjectPropertiesComponent } from \"./components/project-properties.component\";\nimport { ProjectSelectComponent } from \"./components/project-select.component\";\nimport { ProjectService } from \"./project.service\";\n\n@NgModule({\n imports: [\n CommonModule,\n RouterModule,\n CommonModule,\n ReactiveFormsModule,\n\n ModalModule.forRoot(),\n AngularSvgIconModule,\n\n SharedModule,\n FolioModule,\n ],\n providers: [ProjectService],\n declarations: [\n ProjectListComponent,\n ProjectCreateComponent,\n ProjectSelectComponent,\n ProjectPropertiesComponent,\n ],\n exports: [ProjectListComponent, ProjectPropertiesComponent],\n})\nexport class ProjectModule { }\n","import { HttpClient } from \"@angular/common/http\";\nimport { Injectable } from \"@angular/core\";\nimport { ApiListResult, IFolio, IProject } from '@js-elec/js-elec-types';\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { BehaviorSubject, Observable, of } from \"rxjs\";\nimport { catchError, delay, last, map, switchMap, tap } from \"rxjs/operators\";\nimport { environment } from \"src/environments/environment\";\nimport { FolioService } from \"../folio/folio.service\";\nimport { ModalSpinnerComponent } from \"../shared/components/modals/modal-spinner.component\";\nimport { NotificationService } from \"../shared/services/notify.service\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class ProjectService {\n lsProjectKey = \"project\";\n currentProject = new BehaviorSubject(null);\n\n constructor(\n private httpClient: HttpClient,\n private notifySvc: NotificationService,\n private folioSvc: FolioService,\n private modalSvc: BsModalService\n ) { }\n\n getProjects(\n query: any = {},\n page = 1,\n limit = 10\n ): Observable> {\n let queryString = Object.keys(query)\n .filter((prop) => !!query[prop] && query[prop] !== \"\")\n .reduce((acc, k) => {\n return (acc += `${k}=${query[k]}&`);\n }, \"\");\n queryString += `page=${page}`;\n return this.httpClient.get>(\n `${(environment as any).apiHost}/project?${queryString}`\n );\n }\n\n getMyProjects(\n query: any = {},\n page = 1,\n limit = 10\n ): Observable> {\n let queryString = Object.keys(query).reduce((acc, k) => {\n return (acc += `${k}=${(query)[k]}&`);\n }, \"\");\n queryString += `page=${page}&limit=${limit}`;\n return this.httpClient.get>(\n `${(environment as any).apiHost}/project/mine?${queryString}`\n );\n }\n\n getProject(id: string): Observable {\n return this.httpClient.get(\n `${(environment as any).apiHost}/project/${id}`\n );\n }\n\n findFolioFromId(id: string) {\n return (this.currentProject.value as IProject).folios.find(f => f.id === id)\n }\n\n updateProject(id: string, project: IProject): Observable {\n return this.getMyProjects()\n .pipe(\n switchMap(projects => {\n const doublon = projects.rows.find(p => p.name === project.name && p.id !== id);\n if (doublon) {\n project.name = doublon.name + ' 2';\n }\n return this.httpClient\n .put(`${(environment as any).apiHost}/project/${id}`, project)\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\n \"error\",\n `Une erreur s'est produite à l'enregistement`\n );\n throw err;\n }),\n // !!! WARN: Object.assign may cause pointer conflict on folios list and folios tab. \n // tap((projectUpdated) => {\n // if (\n // this.currentProject.value &&\n // this.currentProject.value.id &&\n // this.currentProject.value.id === projectUpdated.id\n // ) {\n // Object.assign(this.currentProject.value, projectUpdated);\n // }\n // })\n );\n })\n )\n }\n\n validateProject(id: string) {\n return this.httpClient\n .put(`${(environment as any).apiHost}/project/${id}/validate`, {})\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\n \"error\",\n `Une erreur s'est produite à l'enregistement`\n );\n throw err;\n }),\n tap(_ => {\n this.notifySvc.notification(\n \"success\",\n `Votre projet est maintenant validé`\n );\n })\n )\n }\n\n createProject(project: IProject): Observable {\n return this.getMyProjects()\n .pipe(\n switchMap(projects => {\n const doublon = projects.rows.find(p => p.name === project.name);\n if (doublon) {\n project.name = doublon.name + ' 2';\n }\n return this.httpClient\n .post(`${(environment as any).apiHost}/project`, project)\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\"error\", `Une erreur s'est produite`);\n throw err;\n })\n );\n })\n )\n }\n\n deleteProject(projectId: string): Observable {\n return this.httpClient\n .delete(`${(environment as any).apiHost}/project/${projectId}`)\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\"error\", `Une erreur s'est produite`);\n throw err;\n })\n );\n }\n\n uploadMap(projectId: string, file: any) {\n const formData = new FormData();\n formData.append(\"groundimage\", file, file.name);\n return this.httpClient\n .post(\n `${(environment as any).apiHost}/project/${projectId}/groundimages`,\n formData,\n {\n reportProgress: true,\n observe: \"events\",\n }\n )\n .pipe(\n tap(\n _ => this.modalSvc.show(ModalSpinnerComponent, { class: 'spinnerFile' })\n ),\n last(),\n catchError((err) => {\n this.notifySvc.notification(\n \"error\",\n `Une erreur s'est produite à l'enregistement`\n );\n throw err;\n }),\n tap(_ => this.modalSvc.hide(1)),\n map((res: any) => res.body)\n );\n }\n\n deleteMap(projectId: string, fileName: string) {\n return this.httpClient.delete(\n `${(environment as any).apiHost}/project/${projectId}/pictures/?fileName=${fileName}`\n );\n }\n\n getMaterials(project: IProject): { folio: string, materials: any[] }[] {\n const materials: any[] = [];\n project.folios.forEach((folio: IFolio) => {\n materials.push({ folio: folio.name, materials: this.folioSvc.getMaterials(folio) })\n })\n return materials;\n }\n\n getConduits(project: IProject): { folio: string, conduits: any[] }[] {\n const conduits: any[] = [];\n project.folios.forEach((folio: IFolio) => {\n conduits.push({ folio: folio.name, conduits: this.folioSvc.getConduits(folio) })\n })\n return conduits;\n }\n}\n","import { Injectable } from \"@angular/core\";\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n RouterStateSnapshot,\n UrlTree,\n} from \"@angular/router\";\nimport { BsModalService } from \"ngx-bootstrap/modal\";\nimport { Observable, of } from \"rxjs\";\nimport { map, switchMap, take } from \"rxjs/operators\";\nimport { ProjectCreateComponent } from \"../components/project-create.component\";\nimport { ProjectService } from \"../project.service\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class ProjectGuard implements CanActivate {\n constructor(\n private projectSvc: ProjectService,\n private modalSvc: BsModalService\n ) {}\n canActivate(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ):\n | Observable\n | Promise\n | boolean\n | UrlTree {\n return this.projectSvc.getMyProjects().pipe(\n switchMap((projects) => {\n if (projects.count === 0) {\n this.modalSvc.show(ProjectCreateComponent);\n\n return this.modalSvc.onHide.pipe(\n take(1),\n map((r) => !!r)\n );\n }\n return of(true);\n })\n );\n }\n}\n","import { Component, Input } from \"@angular/core\";\n\n@Component({\n selector: 'error-page',\n template: `\n
\n
\n
\n

{{code === 404 ? \"Page non trouvée\" : \"Erreur\"}}

\n

\n Retour à l'accueil\n

\n \n

\n Une erreur est survenue. Tentez de recharger la page ou retournez à l'accueil.\n

\n
\n
\n
\n
\n `\n})\nexport class ErrorPageComponent {\n @Input() code = 404\n constructor() {\n\n }\n}","import { Component, OnInit, Input } from \"@angular/core\";\n\n@Component({\n selector: \"app-form-group-checkbox\",\n templateUrl: \"./form-group-checkbox.component.html\",\n styleUrls: [\"./form-group-checkbox.component.scss\"],\n})\nexport class FormGroupCheckboxComponent implements OnInit {\n @Input() label?: string;\n @Input() for?: string;\n constructor() {}\n\n ngOnInit() {}\n}\n","import { Component, OnInit, Input } from \"@angular/core\";\n\n@Component({\n selector: \"app-form-group-radio\",\n templateUrl: \"./form-group-radio.component.html\",\n styleUrls: [\"./form-group-radio.component.scss\"],\n})\nexport class FormGroupRadioComponent implements OnInit {\n @Input() label?: string;\n @Input() for!: string;\n constructor() {}\n\n ngOnInit() {}\n}\n","import { Component, OnInit, Input } from '@angular/core';\n\n@Component({\n selector: 'app-form-group',\n templateUrl: './form-group.component.html',\n styleUrls: ['./form-group.component.scss'],\n})\nexport class FormGroupComponent implements OnInit {\n @Input() label?: string;\n @Input() id?: string;\n @Input() inline = false;\n\n constructor() {}\n\n ngOnInit() {}\n}\n","import { Component, Input, Injectable } from \"@angular/core\";\nimport { BsModalRef, BsModalService } from \"ngx-bootstrap/modal\";\n\n@Component({\n selector: \"app-modal-confirm\",\n templateUrl: \"./modal-confirm.component.html\",\n})\nexport class ModalConfirmComponent {\n @Input() title!: string;\n @Input() body!: string;\n @Input() yesButton = \"Oui\";\n @Input() noButton = \"Non\";\n @Input() defaultIsYes = false;\n constructor(\n public activeModal: BsModalRef,\n public modalSvc: BsModalService\n ) { }\n\n sendValue(val: boolean) {\n const reason: any = val;\n this.modalSvc.setDismissReason(reason);\n this.activeModal.hide();\n }\n}\n","import { Component, OnInit, Input, ViewChild, ElementRef } from \"@angular/core\";\nimport { BsModalRef } from \"ngx-bootstrap/modal\";\n\n@Component({\n selector: \"modal-info\",\n templateUrl: \"./modal-info.component.html\",\n})\nexport class ModalInfoComponent implements OnInit {\n @ViewChild('content', { static: true }) content!: ElementRef;\n constructor(public activeModal: BsModalRef) { }\n @Input() title!: string;\n @Input() body?: string;\n @Input() html?: string;\n @Input() buttonLabel = \"Ok\";\n\n ngOnInit() {\n if (this.content && this.html)\n this.content.nativeElement.innerHtml = (this.html)\n }\n}\n","import { Component, OnInit, Input } from \"@angular/core\";\nimport { FormGroup, FormBuilder, Validators } from \"@angular/forms\";\nimport { BsModalRef, BsModalService } from \"ngx-bootstrap/modal\";\n\n@Component({\n selector: \"modal-input\",\n templateUrl: \"./modal-input.component.html\",\n})\nexport class ModalInputComponent implements OnInit {\n inputForm!: FormGroup;\n @Input() fields!: {\n name: string;\n label: string;\n type: \"text\";\n required: boolean;\n }[];\n @Input() data?: any;\n @Input() title?: string;\n @Input() buttonLabel = \"Ok\";\n @Input() cancelLabel?: string;\n\n constructor(\n public modal: BsModalRef,\n private modalSvc: BsModalService,\n private fb: FormBuilder\n ) { }\n\n ngOnInit() {\n this.buildForm();\n }\n\n buildForm() {\n const inputs: any = {};\n this.fields.forEach((field) => {\n inputs[field.name] = this.fb.control(\n this.data !== undefined && this.data[field.name] ? this.data[field.name] : \"\",\n field.required ? Validators.required : []\n );\n });\n this.inputForm = this.fb.group(inputs);\n }\n\n close() {\n this.modalSvc.setDismissReason('');\n this.modal.hide();\n }\n\n sendValue() {\n this.modalSvc.setDismissReason(this.inputForm.value);\n this.modal.hide();\n }\n}\n","import { Component, OnInit, Input } from \"@angular/core\";\nimport { BsModalRef } from \"ngx-bootstrap/modal\";\n\n@Component({\n selector: \"modal-spinner\",\n templateUrl: \"./modal-spinner.component.html\",\n})\nexport class ModalSpinnerComponent implements OnInit {\n constructor(public activeModal: BsModalRef) { }\n // @Input() title!: string;\n // @Input() body!: string;\n // @Input() buttonLabel = \"Ok\";\n\n ngOnInit() { }\n}\n","import { Directive, Input, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\nimport { AuthService } from \"src/app/auth/auth.service\";\nimport { FeaturesService } from \"../services/features.service\";\n\n@Directive({\n selector: '[hasFeature]'\n})\nexport class HasFeatureDirective implements OnInit, OnDestroy {\n @Input('hasFeature') featureName!: string;\n\n isVisible = false;\n stop$ = new Subject()\n\n constructor(\n private viewContainerRef: ViewContainerRef,\n private templateRef: TemplateRef,\n private authSvc: AuthService,\n ) { }\n\n ngOnInit() {\n this.authSvc.currentAuth\n .pipe(\n takeUntil(this.stop$),\n ).subscribe(auth => {\n let hasAccess = auth && FeaturesService.hasFeatureAccess(this.featureName, auth.user)\n\n if (hasAccess && !this.isVisible) {\n this.isVisible = true;\n let foundFeature = FeaturesService.findFeature(this.featureName, true)\n this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: foundFeature });\n } else if (!hasAccess) {\n this.isVisible = false;\n this.viewContainerRef.clear();\n }\n });\n }\n\n ngOnDestroy() {\n this.stop$.next();\n }\n}","import { Directive, Input, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from \"@angular/core\";\nimport { UserRolesEnum } from \"@js-elec/js-elec-types\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\nimport { AuthService } from \"src/app/auth/auth.service\";\nimport { UserService } from \"src/app/user/user.service\";\n\n@Directive({\n selector: '[isInRole]'\n})\nexport class IsInRoleDirective implements OnInit, OnDestroy {\n @Input('isInRole') roles: UserRolesEnum[] | UserRolesEnum = [];\n\n isVisible = false;\n stop$ = new Subject()\n\n constructor(\n private viewContainerRef: ViewContainerRef,\n private templateRef: TemplateRef,\n private authSvc: AuthService,\n private userSvc: UserService,\n ) { }\n\n ngOnInit() {\n this.authSvc.currentAuth\n .pipe(\n takeUntil(this.stop$),\n ).subscribe(auth => {\n if (!auth) {\n this.viewContainerRef.clear();\n }\n if (auth && this.userSvc.isInRole(auth.user, UserRolesEnum.rootAdmin)) {\n if (!this.isVisible) {\n this.isVisible = true;\n this.viewContainerRef.createEmbeddedView(this.templateRef);\n }\n } else {\n this.isVisible = false;\n this.viewContainerRef.clear();\n }\n })\n }\n\n ngOnDestroy() {\n this.stop$.next();\n }\n}","import { Directive, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from \"@angular/core\";\nimport { UserRolesEnum } from '@js-elec/js-elec-types';\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\nimport { AuthService } from \"src/app/auth/auth.service\";\n\n@Directive({\n selector: '[isSuperAdmin]'\n})\nexport class IsSuperAdminDirective implements OnInit, OnDestroy {\n isVisible = false;\n\n stop$ = new Subject()\n\n constructor(\n private viewContainerRef: ViewContainerRef,\n private templateRef: TemplateRef,\n private authSvc: AuthService\n ) { }\n\n ngOnInit() {\n this.authSvc.currentAuth.pipe(\n takeUntil(this.stop$),\n ).subscribe(auth => {\n if (!auth) {\n this.viewContainerRef.clear();\n }\n if (auth !== null && auth.user.role <= UserRolesEnum.superAdmin) {\n if (!this.isVisible) {\n this.isVisible = true;\n this.viewContainerRef.createEmbeddedView(this.templateRef);\n }\n } else {\n this.isVisible = false;\n this.viewContainerRef.clear();\n }\n });\n }\n\n ngOnDestroy() {\n this.stop$.next();\n }\n}","import { Injectable } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate, RouterStateSnapshot\n} from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { FeaturesService } from '../services/features.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FeatureGuard implements CanActivate {\n constructor() { }\n canActivate(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable | Promise | boolean {\n return FeaturesService.isFeatureEnabled(next.data.feature)\n\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { FeaturesService } from \"../services/features.service\";\n\n@Pipe({\n name: \"featureOption\",\n})\nexport class FeatureOptionPipe implements PipeTransform {\n constructor() { }\n\n transform(\n featureName: string,\n optionName: string\n ): string {\n return FeaturesService.getFeatureOption(featureName, optionName)\n }\n}\n","import { Pipe, PipeTransform } from \"@angular/core\";\nimport { UserRolesEnum } from '@js-elec/js-elec-types';\nimport { Observable } from \"rxjs\";\nimport { map } from \"rxjs/operators\";\nimport { AuthService } from \"src/app/auth/auth.service\";\n\n@Pipe({\n name: \"isInRole\",\n})\nexport class IsInRolePipe implements PipeTransform {\n constructor(private authSvc: AuthService) { }\n\n transform(\n role: UserRolesEnum\n ): Observable {\n return this.authSvc.currentAuth\n .pipe(\n map(auth => auth !== null && auth.user.role <= role)\n )\n }\n}\n","export const findDPI = () => {\n let counter = 0;\n return findFirstPositive(\n (x: number) => (++counter, matchMedia(`(max-resolution: ${x}dpi)`).matches)\n );\n};\n\n// Binary search\n// http://www.geeksforgeeks.org/find-the-point-where-a-function-becomes-negative/\nfunction findFirstPositive(fn: (x: number) => any) {\n let start = 1;\n // tslint:disable-next-line: no-bitwise\n while (0 >= fn(start)) start <<= 1;\n // tslint:disable-next-line: no-bitwise\n return binSearch(fn, start >>> 1, start) | 0;\n}\n\nfunction binSearch(fn: (x: number) => number, min: number, max: number): number {\n if (max < min) return -1; // not found\n\n // tslint:disable-next-line: no-bitwise\n const mid = (min + max) >>> 1;\n if (0 < fn(mid)) {\n if (mid === min || 0 >= fn(mid - 1)) {\n return mid;\n }\n return binSearch(fn, min, mid - 1);\n }\n return binSearch(fn, mid + 1, max);\n}\n","import { HttpClient } from \"@angular/common/http\";\nimport { Injectable } from \"@angular/core\";\nimport { IUser, Models, OfferEnum, UserRolesEnum } from '@js-elec/js-elec-types';\nimport { BehaviorSubject, combineLatest, of } from \"rxjs\";\nimport { switchMap, tap } from \"rxjs/operators\";\nimport { environment } from \"src/environments/environment\";\n// import * as lib from \"../../../../../room-lib.json\"\n\nexport type FeatureType = {\n id: string,\n children?: Array\n options?: { [K: string]: any },\n enabled?: boolean,\n offer?: OfferEnum,\n inRoles?: Array\n roleAtLeast?: Array\n}\n\n@Injectable()\nexport class FeaturesService {\n static features$ = new BehaviorSubject([])\n static symbolLib$ = new BehaviorSubject(null)\n static squidLib$ = new BehaviorSubject(null)\n static squidSubSchemas$ = new BehaviorSubject(null)\n\n constructor(private httpClient: HttpClient) {\n }\n\n load() {\n // FeaturesService.squidLib$.next((lib as any).default)\n\n return this.httpClient.get(environment.featuresUrl + \"?t=\" + new Date())\n .pipe(\n tap(features => FeaturesService.features$.next(features)),\n switchMap(features => {\n const squidFeature = FeaturesService.findFeature('squid', false, features);\n const symbolsFeature = FeaturesService.findFeature('symbols', false, features);\n return combineLatest([\n symbolsFeature && symbolsFeature.enabled !== false && symbolsFeature.options ? this.httpClient.get(symbolsFeature?.options?.symbolsFile + '?t=' + new Date()) : of(null),\n squidFeature && squidFeature.enabled !== false && squidFeature.options ? this.httpClient.get(squidFeature?.options?.symbolsFile + '?t=' + new Date()) : of(null),\n squidFeature && squidFeature.enabled !== false && squidFeature.options && squidFeature?.options?.subSchemasFile ? this.httpClient.get(squidFeature?.options?.subSchemasFile + '?t=' + new Date()) : of(null),\n ])\n }),\n tap(([symbols, squid, squidSubSchemas]) => {\n FeaturesService.symbolLib$.next(symbols)\n FeaturesService.squidLib$.next(squid)\n FeaturesService.squidSubSchemas$.next(squidSubSchemas)\n }))\n }\n\n saveFeatureFile(featureFile: 'lib' | 'room' | 'subschemas', json: any) {\n return this.httpClient.put(environment.apiHost + '/config/jsonFile?file=' + featureFile, json)\n .pipe()\n }\n\n static findFeature(featureName: string, deep = false, rootFeatures = FeaturesService.features$.value) {\n let foundFeat;\n foundFeat = rootFeatures.find(f => f.id === featureName)\n if (!foundFeat && deep) {\n rootFeatures.forEach(f => {\n const feat = this.findFeature(featureName, deep, f.children || []);\n if (feat) {\n foundFeat = feat;\n return;\n }\n })\n }\n return foundFeat;\n }\n\n static hasFeatureAccess(featureName: string, user: Models.User, feat: FeatureType[] = FeaturesService.features$.value): boolean {\n const featureTree = featureName.split('.')\n if (!featureTree.length)\n return true;\n\n const feature = feat.find(f => f.id === featureTree[0]);\n if (feature) {\n let hasAccess = feature.enabled !== undefined && user.userHasOffer(feature.offer) ? feature.enabled : true;\n if (hasAccess === true && feature.inRoles && user.role !== undefined) {\n hasAccess = feature.inRoles.indexOf(user.role) >= 0;\n }\n if (hasAccess && featureTree.length > 1) {\n const a = this.hasFeatureAccess(featureTree.slice(1).join('.'), user, feature.children)\n return a\n }\n return hasAccess;\n }\n return false;\n }\n\n static isFeatureEnabled(featureName: string, feat: FeatureType[] = this.features$.value): boolean {\n const featureTree = featureName.split('.')\n if (!featureTree.length)\n return true;\n\n const feature = feat.find(f => f.id === featureTree[0]);\n if (feature) {\n let hasAccess = feature.enabled !== undefined ? feature.enabled : true;\n\n if (hasAccess && featureTree.length > 1) {\n const a = this.isFeatureEnabled(featureTree.slice(1).join('.'), feature.children)\n return a\n }\n return hasAccess;\n }\n return false;\n }\n\n static isFeatureAvailable(user: Models.User, featureName: string, feat: FeatureType[] = this.features$.value): boolean {\n const featureTree = featureName.split('.')\n if (!featureTree.length)\n return true;\n\n const feature = feat.find(f => f.id === featureTree[0]);\n if (feature) {\n let isAvailable = user.userHasOffer(feature.offer);\n\n if (isAvailable && featureTree.length > 1) {\n const a = this.isFeatureAvailable(user, featureTree.slice(1).join('.'), feature.children)\n return a\n }\n return isAvailable;\n }\n return false;\n }\n\n static getFeatureOption(featureName: string, optionName: string) {\n const feature = FeaturesService.findFeature(featureName, true);\n if (feature && feature.options) {\n return feature.options[optionName]\n }\n return undefined;\n }\n\n}","import { Injectable } from \"@angular/core\";\nimport { ToastrService } from \"ngx-toastr\";\n\ntype AlertType = \"success\" | \"warning\" | \"error\" | \"info\" | \"show\";\n\n@Injectable()\nexport class NotificationService {\n constructor(private toastr: ToastrService) {}\n\n private _defaultOptions = {\n closeButton: false,\n timeOut: 8000,\n extendedTimeOut: 1000,\n disableTimeOut: false,\n easing: \"ease-in\",\n easeTime: 300,\n enableHtml: false,\n progressBar: false,\n progressAnimation: \"decreasing\",\n positionClass: \"toast-bottom-right\",\n titleClass: \"toast-title\",\n messageClass: \"toast-message\",\n tapToDismiss: true,\n onActivateTick: false,\n maxOpened: 0,\n autoDismiss: false,\n iconClasses: {\n error: \"toast-error\",\n info: \"toast-info\",\n success: \"toast-success\",\n warning: \"toast-warning\",\n },\n newestOnTop: true,\n preventDuplicates: false,\n };\n get defaultOptions(): object {\n return this._defaultOptions;\n }\n set defaultOptions(options) {\n Object.assign(this._defaultOptions, options);\n }\n\n notification(\n alertType: \"info\" | \"warning\" | \"success\" | \"error\",\n message: string,\n title: string = \"\",\n options: object = {}\n ) {\n const mergedoptions = Object.assign({}, this.defaultOptions, options);\n this.toastr[alertType](message, title, mergedoptions);\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { HttpClientModule } from \"@angular/common/http\";\nimport { NgModule } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { RouterModule } from \"@angular/router\";\nimport { TranslateModule } from \"@ngx-translate/core\";\nimport { ErrorPageComponent } from \"./components/error-page/error-page.component\";\nimport { FormGroupCheckboxComponent } from \"./components/form-group checkbox/form-group-checkbox.component\";\nimport { FormGroupRadioComponent } from \"./components/form-group-radio/form-group-radio.component\";\nimport { FormGroupComponent } from \"./components/form-group/form-group.component\";\nimport { ModalConfirmComponent } from \"./components/modals/modal-confirm.component\";\nimport { ModalInfoComponent } from \"./components/modals/modal-info.component\";\nimport { ModalInputComponent } from \"./components/modals/modal-input.component\";\nimport { ModalSpinnerComponent } from \"./components/modals/modal-spinner.component\";\nimport { HasFeatureDirective } from \"./directive/has-feature.directive\";\nimport { IsSuperAdminDirective } from \"./directive/is-super-admin.directive\";\nimport { FolioFromIdPipe } from \"./pipes/roles/folio-from-id.pipe\";\nimport { IsInRolePipe } from \"./pipes/roles/is-in-role.pipe\";\nimport { NotificationService } from \"./services/notify.service\";\nimport { FeatureOptionPipe } from \"./pipes/feature-value.pipe\";\nimport { IsInRoleDirective } from \"./directive/is-in-role.directive\";\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n HttpClientModule,\n TranslateModule,\n RouterModule,\n ],\n declarations: [\n ModalConfirmComponent,\n ModalInfoComponent,\n ModalInputComponent,\n ModalSpinnerComponent,\n ErrorPageComponent,\n\n FormGroupComponent,\n FormGroupCheckboxComponent,\n FormGroupRadioComponent,\n\n IsInRolePipe,\n FeatureOptionPipe,\n HasFeatureDirective,\n IsInRoleDirective,\n IsSuperAdminDirective\n ],\n providers: [NotificationService],\n exports: [\n TranslateModule,\n\n FormGroupComponent,\n FormGroupCheckboxComponent,\n FormGroupRadioComponent,\n ErrorPageComponent,\n\n IsInRolePipe,\n FeatureOptionPipe,\n\n HasFeatureDirective,\n IsInRoleDirective,\n IsSuperAdminDirective\n ]\n})\nexport class SharedModule {\n\n}\n","/**\n * Sample app showcasing gojs-angular components\n * For use with gojs-angular version 2.x\n */\n\nimport { ChangeDetectorRef, Component, ViewChild, ViewEncapsulation } from '@angular/core';\nimport * as go from 'gojs';\nimport { DataSyncService, DiagramComponent, PaletteComponent } from 'gojs-angular';\nimport { produce } from \"immer\";\n\n@Component({\n selector: 'app-test',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css'],\n encapsulation: ViewEncapsulation.ShadowDom\n})\nexport class AppComponent {\n\n @ViewChild('myDiagram', { static: true }) public myDiagramComponent!: DiagramComponent;\n @ViewChild('myPalette', { static: true }) public myPaletteComponent!: PaletteComponent;\n\n // Big object that holds app-level state data\n // As of gojs-angular 2.0, immutability is expected and required of state for ease of change detection.\n // Whenever updating state, immutability must be preserved. It is recommended to use immer for this, a small package that makes working with immutable data easy.\n public state: any = {\n // Diagram state props\n diagramNodeData: [\n { id: 'Alpha', text: \"Alpha\", color: 'lightblue', loc: \"0 0\" },\n { id: 'Beta', text: \"Beta\", color: 'orange', loc: \"100 0\" },\n { id: 'Gamma', text: \"Gamma\", color: 'lightgreen', loc: \"0 100\" },\n { id: 'Delta', text: \"Delta\", color: 'pink', loc: \"100 100\" }\n ],\n diagramLinkData: [\n { key: -1, from: 'Alpha', to: 'Beta', fromPort: 'r', toPort: '1' },\n { key: -2, from: 'Alpha', to: 'Gamma', fromPort: 'b', toPort: 't' },\n { key: -3, from: 'Beta', to: 'Beta' },\n { key: -4, from: 'Gamma', to: 'Delta', fromPort: 'r', toPort: 'l' },\n { key: -5, from: 'Delta', to: 'Alpha', fromPort: 't', toPort: 'r' }\n ],\n diagramModelData: { prop: 'value' },\n skipsDiagramUpdate: false,\n selectedNodeData: null, // used by InspectorComponent\n\n // Palette state props\n paletteNodeData: [\n { key: 'Epsilon', text: 'Epsilon', color: 'red' },\n { key: 'Kappa', text: 'Kappa', color: 'purple' }\n ],\n paletteModelData: { prop: 'val' }\n };\n\n public diagramDivClassName: string = 'myDiagramDiv';\n public paletteDivClassName = 'myPaletteDiv';\n\n // initialize diagram / templates\n public initDiagram(): go.Diagram {\n\n const $ = go.GraphObject.make;\n const dia = $(go.Diagram, {\n 'undoManager.isEnabled': true,\n 'clickCreatingTool.archetypeNodeData': { text: 'new node', color: 'lightblue' },\n model: $(go.GraphLinksModel,\n {\n nodeKeyProperty: 'id',\n linkToPortIdProperty: 'toPort',\n linkFromPortIdProperty: 'fromPort',\n linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n }\n )\n });\n\n dia.commandHandler.archetypeGroupData = { key: 'Group', isGroup: true };\n\n const makePort = function (id: string, spot: go.Spot) {\n return $(go.Shape, 'Circle',\n {\n opacity: .5,\n fill: 'gray', strokeWidth: 0, desiredSize: new go.Size(8, 8),\n portId: id, alignment: spot,\n fromLinkable: true, toLinkable: true\n }\n );\n }\n\n // define the Node template\n dia.nodeTemplate =\n $(go.Node, 'Spot',\n {\n contextMenu:\n $('ContextMenu',\n $('ContextMenuButton',\n $(go.TextBlock, 'Group'),\n { click: function (e, obj) { e.diagram.commandHandler.groupSelection(); } },\n new go.Binding('visible', '', function (o) {\n return o.diagram.selection.count > 1;\n }).ofObject())\n )\n },\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(go.Point.stringify),\n $(go.Panel, 'Auto',\n $(go.Shape, 'RoundedRectangle', { stroke: null },\n new go.Binding('fill', 'color', (c, panel) => {\n\n return c;\n })\n ),\n $(go.TextBlock, { margin: 8, editable: true },\n new go.Binding('text').makeTwoWay())\n ),\n // Ports\n makePort('t', go.Spot.TopCenter),\n makePort('l', go.Spot.Left),\n makePort('r', go.Spot.Right),\n makePort('b', go.Spot.BottomCenter)\n );\n\n return dia;\n }\n\n // When the diagram model changes, update app data to reflect those changes. Be sure to use immer's \"produce\" function to preserve immutability\n diagramModelChange(changes: go.IncrementalData) {\n if (!changes) return;\n const appComp = this;\n this.state = produce(this.state, (draft: any) => {\n // set skipsDiagramUpdate: true since GoJS already has this update\n // this way, we don't log an unneeded transaction in the Diagram's undoManager history\n draft.skipsDiagramUpdate = true;\n draft.diagramNodeData = DataSyncService.syncNodeData(changes, draft.diagramNodeData, (appComp.observedDiagram as any)?.model);\n draft.diagramLinkData = DataSyncService.syncLinkData(changes, draft.diagramLinkData, (appComp.observedDiagram as any)?.model);\n draft.diagramModelData = DataSyncService.syncModelData(changes, draft.diagramModelData);\n // If one of the modified nodes was the selected node used by the inspector, update the inspector selectedNodeData object\n const modifiedNodeDatas = changes.modifiedNodeData;\n if (modifiedNodeDatas && draft.selectedNodeData) {\n for (let i = 0; i < modifiedNodeDatas.length; i++) {\n const mn = modifiedNodeDatas[i];\n const nodeKeyProperty = appComp.myDiagramComponent.diagram.model.nodeKeyProperty as string;\n if (mn[nodeKeyProperty] === draft.selectedNodeData[nodeKeyProperty]) {\n draft.selectedNodeData = mn;\n }\n }\n }\n });\n };\n\n public initPalette(): go.Palette {\n const $ = go.GraphObject.make;\n const palette = $(go.Palette);\n\n // define the Node template\n palette.nodeTemplate =\n $(go.Node, 'Auto',\n $(go.Shape, 'RoundedRectangle',\n {\n stroke: null\n },\n new go.Binding('fill', 'color')\n ),\n $(go.TextBlock, { margin: 8 },\n new go.Binding('text', 'key'))\n );\n\n palette.model = $(go.GraphLinksModel);\n return palette;\n }\n\n constructor(private cdr: ChangeDetectorRef) { }\n\n // Overview Component testing\n public oDivClassName = 'myOverviewDiv';\n public initOverview(): go.Overview {\n const $ = go.GraphObject.make;\n const overview = $(go.Overview);\n return overview;\n }\n public observedDiagram: any = null;\n\n // currently selected node; for inspector\n public selectedNodeData: go.ObjectData | null = null;\n\n public ngAfterViewInit() {\n if (this.observedDiagram) return;\n this.observedDiagram = this.myDiagramComponent.diagram;\n this.cdr.detectChanges(); // IMPORTANT: without this, Angular will throw ExpressionChangedAfterItHasBeenCheckedError (dev mode only)\n\n const appComp: AppComponent = this;\n // listener for inspector\n this.myDiagramComponent.diagram.addDiagramListener('ChangedSelection', function (e) {\n if (e.diagram.selection.count === 0) {\n appComp.selectedNodeData = null;\n }\n const node = e.diagram.selection.first();\n appComp.state = produce(appComp.state, (draft: any) => {\n if (node instanceof go.Node) {\n var idx = draft.diagramNodeData.findIndex((nd: any) => nd.id == node.data.id);\n var nd = draft.diagramNodeData[idx];\n draft.selectedNodeData = nd;\n } else {\n draft.selectedNodeData = null;\n }\n });\n });\n } // end ngAfterViewInit\n\n\n /**\n * Update a node's data based on some change to an inspector row's input\n * @param changedPropAndVal An object with 2 entries: \"prop\" (the node data prop changed), and \"newVal\" (the value the user entered in the inspector )\n */\n public handleInspectorChange(changedPropAndVal: any) {\n\n const path = changedPropAndVal.prop;\n const value = changedPropAndVal.newVal;\n\n this.state = produce(this.state, (draft: any) => {\n var data = draft.selectedNodeData;\n data[path] = value;\n const key = data.id;\n const idx = draft.diagramNodeData.findIndex((nd: any) => nd.id == key);\n if (idx >= 0) {\n draft.diagramNodeData[idx] = data;\n draft.skipsDiagramUpdate = false; // we need to sync GoJS data with this new app state, so do not skips Diagram update\n }\n });\n }\n\n\n}\n\n","import { Component, OnInit } from '@angular/core';\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n FormGroup,\n Validators,\n} from '@angular/forms';\nimport { UserService } from '../../user.service';\n\n@Component({\n templateUrl: './user-profile.component.html',\n styleUrls: ['./user-profile.component.css'],\n})\nexport class UserProfileComponent implements OnInit {\n profileForm!: FormGroup;\n passwordForm!: FormGroup;\n\n isProfileFormSubmitted = false;\n isPasswordFormSubmitted = false;\n jobList!: any;\n jobStrings!: string\n\n constructor(\n private fb: FormBuilder,\n private userSvc: UserService,\n ) {\n\n }\n\n ngOnInit(): void {\n const user = this.userSvc.currentUser.value;\n this.profileForm = this.fb.group({\n firstName: [user?.firstName, Validators.required],\n lastName: [user?.lastName, Validators.required],\n email: [user?.email, Validators.required],\n });\n\n this.passwordForm = this.fb.group(\n {\n password: new FormControl(null, [\n Validators.required,\n Validators.minLength(8),\n Validators.maxLength(32),\n ]),\n oldPassword: new FormControl(null, Validators.required),\n confirmPassword: new FormControl(null, [Validators.required]),\n },\n { validator: passwordConfirming }\n );\n\n function passwordConfirming(\n c: AbstractControl\n ): { invalid: boolean } | undefined {\n if (c.get('password')?.value !== c.get('confirmPassword')?.value) {\n return { invalid: true };\n }\n return;\n }\n }\n\n updateProfile() {\n this.isProfileFormSubmitted = true;\n if (this.profileForm.invalid) return;\n\n this.userSvc.updateMe(this.profileForm.value).subscribe();\n this.isProfileFormSubmitted = false;\n }\n changePassword() {\n this.isPasswordFormSubmitted = true;\n if (this.passwordForm.invalid) return;\n\n this.userSvc\n .changePassword(\n this.passwordForm.value.oldPassword,\n this.passwordForm.value.password\n ).subscribe();\n\n this.isPasswordFormSubmitted = false;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { AngularSvgIconModule } from 'angular-svg-icon';\nimport { ModalModule } from 'ngx-bootstrap/modal';\nimport { SharedModule } from '../shared/shared.module';\nimport { UserProfileComponent } from './components/user-profile/user-profile.component';\n\n@NgModule({\n declarations: [UserProfileComponent],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n AngularSvgIconModule,\n ModalModule,\n\n SharedModule,\n ],\n exports: [],\n})\nexport class UserModule { }\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { catchError, filter, map, switchMap, take, tap } from 'rxjs/operators';\nimport { environment } from '../../environments/environment';\nimport { ModalConfirmComponent } from '../shared/components/modals/modal-confirm.component';\nimport { NotificationService } from '../shared/services/notify.service';\nimport { ApiListResult, IUser, Models, UserRolesEnum } from '@js-elec/js-elec-types/dist';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { Router } from '@angular/router';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UserService {\n currentUser = new BehaviorSubject(null);\n constructor(\n private httpClient: HttpClient,\n private notifySvc: NotificationService,\n private modalSvc: BsModalService,\n private router: Router,\n ) { }\n\n loadUser(): Observable {\n return this.getMe().pipe(\n map(r => new Models.User(r)),\n tap((user) => {\n this.currentUser.next(user);\n })\n );\n }\n\n getMe() {\n return this.httpClient.get(\n `${(environment as any).apiHost}/user/me`\n );\n }\n\n getUsers(\n query: any = {},\n page = 1,\n limit = 10\n ): Observable<{ count: number; rows: IUser[] }> {\n let queryString = Object.keys(query)\n .filter((prop) => !!query[prop] && query[prop] !== '')\n .reduce((acc, k) => {\n return (acc += `${k}=${query[k]}&`);\n }, '');\n queryString += `page=${page}&limit=${limit}`;\n return this.httpClient.get<{ count: number; rows: IUser[] }>(\n `${(environment as any).apiHost}/user?${queryString}`\n );\n }\n\n getUser(\n id: string\n ): Observable {\n return this.httpClient.get(\n `${(environment as any).apiHost}/user/${id}`\n );\n }\n\n updateMe(user: IUser): Observable {\n return this.httpClient\n .put(`${(environment as any).apiHost}/user/me`, user)\n .pipe(\n map(r => new Models.User(r)),\n tap((updatedUser) => {\n if (this.currentUser.value?.id === updatedUser.id) {\n this.currentUser.next(updatedUser);\n }\n }),\n tap(() => {\n this.notifySvc.notification(\n 'info',\n 'Vos informations ont été mises à jour'\n );\n })\n );\n }\n\n updateUser(id: string, user: IUser): Observable {\n return this.httpClient\n .put(`${(environment as any).apiHost}/user/${id}`, user)\n .pipe(\n map(r => new Models.User(r)),\n tap(() => {\n this.notifySvc.notification(\n 'info',\n 'Informations ont été mises à jour'\n );\n })\n );\n }\n\n disableUser(user: IUser) {\n this.modalSvc.show(ModalConfirmComponent, {\n initialState: {\n title: \"Désactiver l'utilisateur\",\n body: \"L'utilisateur ne pourra plus se connecter\"\n }\n })\n this.modalSvc.onHide\n .pipe(\n take(1),\n filter(r => r === true),\n switchMap(_ => this.httpClient.put(`${(environment as any).apiHost}/user/${user.id}/disable`, {})),\n tap(updatedUser => user.disabled = updatedUser.disabled),\n tap(() => {\n this.notifySvc.notification(\n 'info',\n \"L'utilisateur a été désactivé\"\n );\n })\n ).subscribe()\n }\n\n deleteUser(id: string) {\n this.modalSvc.show(ModalConfirmComponent, {\n initialState: {\n title: \"Supprimer l'utilisateur\",\n body: \"L'utilisateur et toutes ses données seront supprimées\"\n }\n })\n this.modalSvc.onHide\n .pipe(\n take(1),\n filter(r => r === true),\n switchMap(_ => this.httpClient.delete(`${(environment as any).apiHost}/user/${id}`, {})),\n tap(_ => this.router.navigate(['/', 'admin', 'users'])),\n tap(() => {\n this.notifySvc.notification(\n 'info',\n \"L'utilisateur a été supprimé\"\n );\n })\n ).subscribe()\n }\n\n acceptCgv(): Observable {\n return this.httpClient.put(\n `${(environment as any).apiHost}/user/me/acceptCgv`, { type: 'cgv' }\n ).pipe(\n map(r => new Models.User(r)),\n );\n }\n\n updateUserRole(userId: string, role: UserRolesEnum): Observable {\n return this.httpClient\n .put(`${(environment as any).apiHost}/user/${userId}/role`, { role })\n .pipe(\n map(r => new Models.User(r)),\n tap(() => {\n this.notifySvc.notification(\n 'info',\n 'Informations mises à jour'\n );\n }),\n catchError(err => {\n this.notifySvc.notification('error', \"Erreur, informations manquantes\");\n throw err;\n })\n );\n }\n\n askPassword(email: string): Observable {\n return this.httpClient.put(\n `${(environment as any).apiHost}/user/forgot-password`,\n { email }\n ).pipe(\n map(r => new Models.User(r)),\n );\n }\n\n changePasswordWithToken(token: string, password: string): Observable {\n return this.httpClient.put(\n `${(environment as any).apiHost}/user/change-password/${token}`,\n { password }\n ).pipe(\n map(r => new Models.User(r))\n );\n }\n\n changePassword(oldPassword: string, password: string) {\n return this.httpClient\n .put(`${(environment as any).apiHost}/user/me/password`, {\n oldPassword,\n password,\n })\n .pipe(\n catchError((err) => {\n this.notifySvc.notification(\n 'error',\n 'Merci de vérifier que votre mot de passe actuel a bien été saisi.'\n );\n throw err;\n }),\n map(r => new Models.User(r)),\n tap(() => {\n this.notifySvc.notification(\n 'info',\n 'Votre mot de passe a bien été mis à jour'\n );\n })\n );\n }\n\n deleteMe() {\n return this.httpClient.delete(\n `${(environment as any).apiHost}/user/`\n );\n }\n\n dashboardStats() {\n return this.httpClient.get(\n `${(environment as any).apiHost}/stats`\n );\n }\n\n lastConnectedUsers() {\n return this.httpClient.get>(\n `${(environment as any).apiHost}/user/lastConnected`\n );\n }\n\n isInRole(user: IUser, roles: UserRolesEnum | UserRolesEnum[]) {\n if (Array.isArray(roles)) {\n return !roles.length || roles.includes(user.role)\n }\n return user.role <= roles\n }\n\n\n}\n","// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport interface IEnvironment {\n production: boolean;\n apiHost: string;\n goLicense: string;\n storageUrl: string;\n featuresUrl: string;\n appName: string;\n}\n\nexport const environment: IEnvironment = {\n production: false,\n apiHost: 'https://api.cpreylec.cadbld.eu',\n // apiHost: 'http://localhost:3000',\n goLicense: \"73f943e1b56328a800ca0d2b113f69ef1bb37f3b9ed01ef4595441f0ea5c6d413089ef2d018489c781fe1afb1979c0898f956c2d9f44172be16483da43b0d6f8a02770b3170a588cbb0026\",\n storageUrl: 'https://storage.googleapis.com/cpreylec-data-dev/',\n featuresUrl: 'https://storage.googleapis.com/cpreylec-data-dev/features.json',\n appName: \"CPreylec\"\n};\n\n/*\n * For easier debugging in development mode, you can import the following file\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\n *\n * This import should be commented out in production mode because it will have a negative impact\n * on performance if an error is thrown.\n */\n// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.error(err));\n"],"names":[],"sourceRoot":"webpack:///","x_google_ignoreList":[]}