@vitrosoftware/common-ui-ts 1.1.238 → 1.1.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { services } from '../../services';
3
+ import 'jstree';
3
4
  export interface ViewerProps {
4
5
  context: services.BimViewerService;
5
6
  onLoaded?: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrosoftware/common-ui-ts",
3
- "version": "1.1.238",
3
+ "version": "1.1.239",
4
4
  "description": "vitro software common ui ts",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@ class VitroModel {
11
11
  VitroModel: VitroModel,
12
12
 
13
13
  ModelList: [],
14
+ CompareModelList: [],
14
15
  FileCompareVersion: undefined,
15
16
 
16
17
  GetModelList: function (modelList) {
@@ -66,6 +67,8 @@ class VitroModel {
66
67
  paramObj.xrayMode = sceneOptions.xrayMode;
67
68
  paramObj.xrayedEntityIdList = sceneOptions.xrayedEntityIdList;
68
69
 
70
+ paramObj.requiredEntityIdList = sceneOptions.requiredEntityIdList;
71
+
69
72
  paramObj.sectionPlanes = sceneOptions.sectionPlanes;
70
73
 
71
74
  try
@@ -351,6 +354,37 @@ class VitroModel {
351
354
  });
352
355
  },
353
356
 
357
+ GetAABB: function (elementId, modelList, callback, error, async = true) {
358
+
359
+ var paramObj = {};
360
+
361
+ paramObj.modelList = BIMCommon.GetModelList(modelList);
362
+ paramObj.elementId = elementId.toString();
363
+
364
+ var webRelativeUrl = BIMCommon.CreateWebServerUrl();
365
+ $.ajax({
366
+ type: "POST",
367
+ url: webRelativeUrl + "/bimViewer/api/ModelElement/GetAABB",
368
+ data: JSON.stringify(paramObj),
369
+ contentType: "application/json; charset=utf-8",
370
+ dataType: "json",
371
+ async: async,
372
+ beforeSend: function (data) {
373
+ },
374
+ error: function (jqXHR, textStatus, errorThrown) {
375
+ if (error) {
376
+ error(jqXHR, textStatus, errorThrown);
377
+ }
378
+ },
379
+ success: function (data, status, jqXHR) {
380
+ //console.log(data);
381
+ if (callback) {
382
+ callback(data);
383
+ }
384
+ }
385
+ });
386
+ },
387
+
354
388
  GetModel: function (elementId, callback, error, async = true) {
355
389
 
356
390
  var paramObj = {};
@@ -462,7 +496,6 @@ class VitroModel {
462
496
  });
463
497
  },
464
498
 
465
-
466
499
  GetChildIdList: function (elementId, recurse, isGeometry, callback, error, async = true) {
467
500
 
468
501
  var paramObj = {};
@@ -496,14 +529,18 @@ class VitroModel {
496
529
  });
497
530
  },
498
531
 
499
- Compare: function (successFn, failFn) {
532
+ Compare: function (successFn, failFn, filters = null, async = true) {
500
533
 
501
534
  var webRelativeUrl = BIMCommon.CreateWebServerUrl();
502
535
 
503
536
  var paramObj = {};
504
537
  paramObj.itemId = BIMCommon.ModelList[0].FileItemId;//todo:
505
538
  paramObj.version = BIMCommon.ModelList[0].FileVersion;
506
- paramObj.comparedVersion = BIMCommon.FileCompareVersion;
539
+ paramObj.comparedVersion = BIMCommon.FileCompareVersion;
540
+
541
+ if (filters) {
542
+ Object.assign(paramObj, filters);
543
+ }
507
544
 
508
545
  var jsonString = JSON.stringify(paramObj);
509
546
 
@@ -513,7 +550,120 @@ class VitroModel {
513
550
  data: jsonString,
514
551
  contentType: "application/json; charset=utf-8",
515
552
  dataType: "json",
516
- async: false,
553
+ async: async,
554
+ beforeSend: function (data) {
555
+ },
556
+ error: function (jqXHR, textStatus, errorThrown) {
557
+ failFn();
558
+ },
559
+ success: function (data, status, jqXHR) {
560
+ if (successFn) {
561
+ successFn(data);
562
+ }
563
+ }
564
+ });
565
+ },
566
+
567
+ CompareElementId: function (successFn, failFn, filters = null, async = true) {
568
+
569
+ var webRelativeUrl = BIMCommon.CreateWebServerUrl();
570
+
571
+ var paramObj = {};
572
+ paramObj.itemId = BIMCommon.ModelList[0].FileItemId;//todo:
573
+ paramObj.version = BIMCommon.ModelList[0].FileVersion;
574
+ paramObj.comparedVersion = BIMCommon.FileCompareVersion;
575
+
576
+ if (filters) {
577
+ Object.assign(paramObj, filters);
578
+ }
579
+
580
+ var jsonString = JSON.stringify(paramObj);
581
+
582
+ $.ajax({
583
+ type: "POST",
584
+ url: webRelativeUrl + "/bimViewer/api/ModelElement/CompareElementId",
585
+ data: jsonString,
586
+ contentType: "application/json; charset=utf-8",
587
+ dataType: "json",
588
+ async: async,
589
+ beforeSend: function (data) {
590
+ },
591
+ error: function (jqXHR, textStatus, errorThrown) {
592
+ failFn();
593
+ },
594
+ success: function (data, status, jqXHR) {
595
+ if (successFn) {
596
+ successFn(data);
597
+ }
598
+ }
599
+ });
600
+ },
601
+
602
+ CompareChildList: function (successFn, failFn, filters = null, async = true) {
603
+ var webRelativeUrl = BIMCommon.CreateWebServerUrl();
604
+
605
+ var paramObj = {};
606
+ paramObj.itemId = BIMCommon.ModelList[0].FileItemId;
607
+ paramObj.version = BIMCommon.ModelList[0].FileVersion;
608
+ paramObj.comparedVersion = BIMCommon.FileCompareVersion;
609
+
610
+ if (filters) {
611
+ Object.assign(paramObj, filters);
612
+ }
613
+
614
+ var jsonString = JSON.stringify(paramObj);
615
+
616
+ $.ajax({
617
+ type: "POST",
618
+ url: webRelativeUrl + "/bimViewer/api/ModelElement/CompareChildList",
619
+ data: jsonString,
620
+ contentType: "application/json; charset=utf-8",
621
+ dataType: "json",
622
+ async: async,
623
+ beforeSend: function (data) {
624
+ },
625
+ error: function (jqXHR, textStatus, errorThrown) {
626
+ failFn();
627
+ },
628
+ success: function (data, status, jqXHR) {
629
+ if (successFn) {
630
+ successFn(data);
631
+ }
632
+ }
633
+ });
634
+ },
635
+
636
+ CompareProperty: function (url, elementUuid, successFn, failFn, async = true) {
637
+ var url = BIMCommon.CreateWebServerUrl() + "/bimViewer/api/ModelElement/CompareProperty";
638
+
639
+ BIMModel.CompareDetailed(url, elementUuid, successFn, failFn, async);
640
+ },
641
+
642
+ CompareGeometry: function (url, elementUuid, successFn, failFn, async = true) {
643
+ var url = BIMCommon.CreateWebServerUrl() + "/bimViewer/api/ModelElement/CompareGeometry";
644
+
645
+ BIMModel.CompareDetailed(url, elementUuid, successFn, failFn, async);
646
+ },
647
+
648
+ CompareDetailed: function (url, elementUuid, successFn, failFn, async = true) {
649
+
650
+ var webRelativeUrl = BIMCommon.CreateWebServerUrl();
651
+
652
+ var paramObj = {};
653
+ paramObj.itemId = BIMCommon.ModelList[0].FileItemId;//todo:
654
+ paramObj.version = BIMCommon.ModelList[0].FileVersion;
655
+ paramObj.comparedVersion = BIMCommon.FileCompareVersion;
656
+ paramObj.elementId = elementUuid.toString();
657
+
658
+ var jsonString = JSON.stringify(paramObj);
659
+
660
+ $.ajax({
661
+ type: "POST",
662
+ url: url,
663
+ data: jsonString,
664
+ contentType: "application/json; charset=utf-8",
665
+ dataType: "json",
666
+ async: async,
517
667
  beforeSend: function (data) {
518
668
  },
519
669
  error: function (jqXHR, textStatus, errorThrown) {
@@ -526,5 +676,6 @@ class VitroModel {
526
676
  }
527
677
  });
528
678
  }
679
+
529
680
  }
530
681
  export {BIMCommon, BIMAnnotation, BIMModel}