bruce-models 0.8.6 → 0.8.8

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.
@@ -2333,6 +2333,74 @@
2333
2333
  return true;
2334
2334
  }
2335
2335
  Cartes.IsEqualCartes3 = IsEqualCartes3;
2336
+ /**
2337
+ * Returns true if the given ring is closed.
2338
+ * A ring is closed if the first and last point are equal.
2339
+ * A ring with less than 2 points is not closed.
2340
+ * @param points
2341
+ * @returns
2342
+ */
2343
+ function IsRing2Closed(points) {
2344
+ if (points.length < 2) {
2345
+ return false;
2346
+ }
2347
+ else if (!IsEqualCartes2(points[0], points[points.length - 1])) {
2348
+ return false;
2349
+ }
2350
+ return true;
2351
+ }
2352
+ Cartes.IsRing2Closed = IsRing2Closed;
2353
+ /**
2354
+ * Returns true if the given ring is closed.
2355
+ * A ring is closed if the first and last point are equal.
2356
+ * A ring with less than 2 points is not closed.
2357
+ * @param points
2358
+ * @returns
2359
+ */
2360
+ function IsRing3Closed(points) {
2361
+ if (points.length < 2) {
2362
+ return false;
2363
+ }
2364
+ else if (!IsEqualCartes3(points[0], points[points.length - 1])) {
2365
+ return false;
2366
+ }
2367
+ return true;
2368
+ }
2369
+ Cartes.IsRing3Closed = IsRing3Closed;
2370
+ /**
2371
+ * Closes given ring by adding the first point to the end of the array.
2372
+ * This will mutate the given array.
2373
+ * Will not do anything if the ring is already closed.
2374
+ * @param points
2375
+ * @returns
2376
+ */
2377
+ function CloseRing2(points) {
2378
+ if (points.length < 2) {
2379
+ return;
2380
+ }
2381
+ else if (IsRing2Closed(points)) {
2382
+ return;
2383
+ }
2384
+ points.push(points[0]);
2385
+ }
2386
+ Cartes.CloseRing2 = CloseRing2;
2387
+ /**
2388
+ * Closes given ring by adding the first point to the end of the array.
2389
+ * This will mutate the given array.
2390
+ * Will not do anything if the ring is already closed.
2391
+ * @param points
2392
+ * @returns
2393
+ */
2394
+ function CloseRing3(points) {
2395
+ if (points.length < 2) {
2396
+ return;
2397
+ }
2398
+ else if (IsRing3Closed(points)) {
2399
+ return;
2400
+ }
2401
+ points.push(points[0]);
2402
+ }
2403
+ Cartes.CloseRing3 = CloseRing3;
2336
2404
  })(exports.Cartes || (exports.Cartes = {}));
2337
2405
 
2338
2406
  /**
@@ -6924,147 +6992,175 @@
6924
6992
  * Description of a "Markup" which is stored in custom-form or bookmark records.
6925
6993
  */
6926
6994
  (function (Markup) {
6927
- var Element;
6928
- (function (Element) {
6929
- var Div;
6930
- (function (Div) {
6931
- // Types of div that can be created.
6995
+ var Div;
6996
+ (function (Div) {
6997
+ // Types of div that can be created.
6998
+ var EType;
6999
+ (function (EType) {
7000
+ // Default, no special handling.
7001
+ EType["Default"] = "default";
7002
+ // Callout, assumes it will be positioned in 3d space.
7003
+ // Assumes existence of line that is used to anchor it.
7004
+ EType["Callout"] = "callout";
7005
+ })(EType = Div.EType || (Div.EType = {}));
7006
+ // Describes expected content of a row cell.
7007
+ var EItemType;
7008
+ (function (EItemType) {
7009
+ // Default, no special handling.
7010
+ EItemType["Default"] = "DEFAULT";
7011
+ // Embed, assume content is html.
7012
+ // Make it take over the whole cell instead of padding it and such.
7013
+ EItemType["Embed"] = "EMBED";
7014
+ })(EItemType = Div.EItemType || (Div.EItemType = {}));
7015
+ var ItemAction;
7016
+ (function (ItemAction) {
7017
+ // Types of actions that can be performed when a cell is clicked.
7018
+ // Null = "NONE".
6932
7019
  var EType;
6933
7020
  (function (EType) {
6934
- // Default, no special handling.
6935
- EType["Default"] = "default";
6936
- // Callout, assumes it will be positioned in 3d space.
6937
- // Assumes existence of line that is used to anchor it.
6938
- EType["Callout"] = "callout";
6939
- })(EType = Div.EType || (Div.EType = {}));
6940
- // Describes expected content of a row cell.
6941
- var EItemType;
6942
- (function (EItemType) {
6943
- // Default, no special handling.
6944
- EItemType["Default"] = "DEFAULT";
6945
- // Embed, assume content is html.
6946
- // Make it take over the whole cell instead of padding it and such.
6947
- EItemType["Embed"] = "EMBED";
6948
- })(EItemType = Div.EItemType || (Div.EItemType = {}));
6949
- var ItemAction;
6950
- (function (ItemAction) {
6951
- // Types of actions that can be performed when a cell is clicked.
6952
- // Null = "NONE".
6953
- var EType;
6954
- (function (EType) {
6955
- EType["None"] = "NONE";
6956
- // Open a link specified in params.
6957
- EType["OpenLink"] = "LINK";
6958
- // Open the markup's entity's details panel.
6959
- EType["OpenInfoView"] = "INFOVIEW";
6960
- // Open the markup's entity's gallery popup.
6961
- EType["OpenEntityGallery"] = "GALLERY";
6962
- // Toggle visibility of the markup's entity's relationships.
6963
- EType["ToggleRelationships"] = "RELATIONSHIPS";
6964
- // Dictates this cell can be used to drag the div around.
6965
- EType["Draggable"] = "DRAGABBLE";
6966
- // Closes the markup.
6967
- EType["Close"] = "CLOSE";
6968
- // Opens a bookmark specified in params.
6969
- EType["OpenBookmark"] = "BOOKMARK";
6970
- })(EType = ItemAction.EType || (ItemAction.EType = {}));
6971
- })(ItemAction = Div.ItemAction || (Div.ItemAction = {}));
6972
- })(Div = Element.Div || (Element.Div = {}));
6973
- var Drawing;
6974
- (function (Drawing) {
6975
- var Line;
6976
- (function (Line) {
6977
- // Dictates where on a DIV an anchor should snap to.
6978
- var EAnchorDivSide;
6979
- (function (EAnchorDivSide) {
6980
- EAnchorDivSide[EAnchorDivSide["TopLeft"] = 0] = "TopLeft";
6981
- EAnchorDivSide[EAnchorDivSide["TopRight"] = 1] = "TopRight";
6982
- EAnchorDivSide[EAnchorDivSide["BottomLeft"] = 2] = "BottomLeft";
6983
- EAnchorDivSide[EAnchorDivSide["BottomRight"] = 3] = "BottomRight";
6984
- EAnchorDivSide[EAnchorDivSide["Center"] = 4] = "Center";
6985
- EAnchorDivSide[EAnchorDivSide["CenterLeft"] = 5] = "CenterLeft";
6986
- EAnchorDivSide[EAnchorDivSide["CenterRight"] = 6] = "CenterRight";
6987
- EAnchorDivSide[EAnchorDivSide["CenterTop"] = 7] = "CenterTop";
6988
- EAnchorDivSide[EAnchorDivSide["CenterBottom"] = 8] = "CenterBottom";
6989
- })(EAnchorDivSide = Line.EAnchorDivSide || (Line.EAnchorDivSide = {}));
6990
- // Dictates what end of the line an anchor should render on.
6991
- var EAnchorLineSide;
6992
- (function (EAnchorLineSide) {
6993
- EAnchorLineSide[EAnchorLineSide["Start"] = 0] = "Start";
6994
- EAnchorLineSide[EAnchorLineSide["End"] = 1] = "End";
6995
- })(EAnchorLineSide = Line.EAnchorLineSide || (Line.EAnchorLineSide = {}));
6996
- // Types of anchor heads when anchor is used in context of a line.
6997
- // None means the anchor is transparent.
6998
- var EAnchorHeadStyle;
6999
- (function (EAnchorHeadStyle) {
7000
- EAnchorHeadStyle["None"] = "NONE";
7001
- EAnchorHeadStyle["Circle"] = "CIRCLE";
7002
- EAnchorHeadStyle["Arrow"] = "ARROW";
7003
- })(EAnchorHeadStyle = Line.EAnchorHeadStyle || (Line.EAnchorHeadStyle = {}));
7004
- Line.DEFAULT = {
7005
- brushColor: "rgba(255, 255, 255, 1)",
7006
- brushSize: 4,
7007
- path: null,
7008
- pathType: "LINE",
7009
- transform: null,
7010
- snaps: null
7011
- };
7012
- })(Line = Drawing.Line || (Drawing.Line = {}));
7013
- var FreePaint;
7014
- (function (FreePaint) {
7015
- FreePaint.DEFAULT = {
7016
- brushColor: "rgba(255, 255, 255, 1)",
7017
- brushSize: 4,
7018
- path: null,
7019
- pathType: "PLAIN",
7020
- transform: null
7021
- };
7022
- })(FreePaint = Drawing.FreePaint || (Drawing.FreePaint = {}));
7023
- })(Drawing = Element.Drawing || (Element.Drawing = {}));
7024
- var Entity3d;
7025
- (function (Entity3d) {
7026
- var Polygon;
7027
- (function (Polygon) {
7028
- // Determines if terrain and 3d models should be overlapped or not.
7029
- var EClassificationType;
7030
- (function (EClassificationType) {
7031
- // 3d models and terrain are overlapped.
7032
- EClassificationType["Both"] = "BOTH";
7033
- // Only terrain is overlapped.
7034
- EClassificationType["Terrain"] = "TERRAIN";
7035
- })(EClassificationType = Polygon.EClassificationType || (Polygon.EClassificationType = {}));
7036
- Polygon.DEFAULT = {
7037
- id: null,
7038
- positions: null,
7039
- color: "rgba(254, 234, 57, 0.54)",
7040
- outlineColor: "rgba(215, 215, 215, 0)",
7041
- outlineWidth: 2,
7042
- extrudedHeight: 0,
7043
- classificationType: EClassificationType.Both,
7044
- smoothen: 0
7045
- };
7046
- })(Polygon = Entity3d.Polygon || (Entity3d.Polygon = {}));
7047
- var Polyline;
7048
- (function (Polyline) {
7049
- Polyline.DEFAULT = {
7050
- id: null,
7051
- positions: null,
7052
- color: "rgba(254, 234, 57, 0.54)",
7053
- outlineWidth: 4,
7054
- smoothen: 0
7055
- };
7056
- })(Polyline = Entity3d.Polyline || (Entity3d.Polyline = {}));
7057
- var Circle;
7058
- (function (Circle) {
7059
- Circle.DEFAULT = {
7060
- id: null,
7061
- position: null,
7062
- radius: 50,
7063
- color: "rgba(254, 234, 57, 0.54)"
7064
- };
7065
- })(Circle = Entity3d.Circle || (Entity3d.Circle = {}));
7066
- })(Entity3d = Element.Entity3d || (Element.Entity3d = {}));
7067
- })(Element = Markup.Element || (Markup.Element = {}));
7021
+ EType["None"] = "NONE";
7022
+ // Open a link specified in params.
7023
+ EType["OpenLink"] = "LINK";
7024
+ // Open the markup's entity's details panel.
7025
+ EType["OpenInfoView"] = "INFOVIEW";
7026
+ // Open the markup's entity's gallery popup.
7027
+ EType["OpenEntityGallery"] = "GALLERY";
7028
+ // Toggle visibility of the markup's entity's relationships.
7029
+ EType["ToggleRelationships"] = "RELATIONSHIPS";
7030
+ // Dictates this cell can be used to drag the div around.
7031
+ EType["Draggable"] = "DRAGABBLE";
7032
+ // Closes the markup.
7033
+ EType["Close"] = "CLOSE";
7034
+ // Opens a bookmark specified in params.
7035
+ EType["OpenBookmark"] = "BOOKMARK";
7036
+ })(EType = ItemAction.EType || (ItemAction.EType = {}));
7037
+ })(ItemAction = Div.ItemAction || (Div.ItemAction = {}));
7038
+ Div.DEFAULT = {
7039
+ contentRows: [
7040
+ {
7041
+ height: 100,
7042
+ items: [
7043
+ {
7044
+ contentType: EItemType.Default,
7045
+ text: "Type here...",
7046
+ width: 100,
7047
+ backgroundColor: "white",
7048
+ fontColor: "black",
7049
+ textAlign: "center",
7050
+ verticalAlign: "center",
7051
+ fontSize: 15
7052
+ }
7053
+ ]
7054
+ }
7055
+ ],
7056
+ height: null,
7057
+ width: null,
7058
+ id: null,
7059
+ x: null,
7060
+ y: null,
7061
+ borderColor: "black",
7062
+ borderWidth: 1,
7063
+ borderUsingPercent: false,
7064
+ borderRadius: 8,
7065
+ type: EType.Default
7066
+ };
7067
+ })(Div = Markup.Div || (Markup.Div = {}));
7068
+ var Drawing;
7069
+ (function (Drawing) {
7070
+ // Describes a line end's head.
7071
+ var EHeadStyle;
7072
+ (function (EHeadStyle) {
7073
+ EHeadStyle["None"] = "NONE";
7074
+ EHeadStyle["Circle"] = "CIRCLE";
7075
+ EHeadStyle["Arrow"] = "ARROW";
7076
+ })(EHeadStyle = Drawing.EHeadStyle || (Drawing.EHeadStyle = {}));
7077
+ var Line;
7078
+ (function (Line) {
7079
+ // Dictates where on a DIV an anchor should snap to.
7080
+ var EAnchorDivSide;
7081
+ (function (EAnchorDivSide) {
7082
+ EAnchorDivSide[EAnchorDivSide["TopLeft"] = 0] = "TopLeft";
7083
+ EAnchorDivSide[EAnchorDivSide["TopRight"] = 1] = "TopRight";
7084
+ EAnchorDivSide[EAnchorDivSide["BottomLeft"] = 2] = "BottomLeft";
7085
+ EAnchorDivSide[EAnchorDivSide["BottomRight"] = 3] = "BottomRight";
7086
+ EAnchorDivSide[EAnchorDivSide["Center"] = 4] = "Center";
7087
+ EAnchorDivSide[EAnchorDivSide["CenterLeft"] = 5] = "CenterLeft";
7088
+ EAnchorDivSide[EAnchorDivSide["CenterRight"] = 6] = "CenterRight";
7089
+ EAnchorDivSide[EAnchorDivSide["CenterTop"] = 7] = "CenterTop";
7090
+ EAnchorDivSide[EAnchorDivSide["CenterBottom"] = 8] = "CenterBottom";
7091
+ })(EAnchorDivSide = Line.EAnchorDivSide || (Line.EAnchorDivSide = {}));
7092
+ // Dictates what end of the line an anchor should render on.
7093
+ var EAnchorLineSide;
7094
+ (function (EAnchorLineSide) {
7095
+ EAnchorLineSide[EAnchorLineSide["Start"] = 0] = "Start";
7096
+ EAnchorLineSide[EAnchorLineSide["End"] = 1] = "End";
7097
+ })(EAnchorLineSide = Line.EAnchorLineSide || (Line.EAnchorLineSide = {}));
7098
+ Line.DEFAULT = {
7099
+ brushColor: "rgba(255, 255, 255, 1)",
7100
+ brushSize: 4,
7101
+ path: null,
7102
+ pathType: "LINE",
7103
+ transform: null,
7104
+ snaps: null
7105
+ };
7106
+ })(Line = Drawing.Line || (Drawing.Line = {}));
7107
+ var FreePaint;
7108
+ (function (FreePaint) {
7109
+ FreePaint.DEFAULT = {
7110
+ brushColor: "rgba(255, 255, 255, 1)",
7111
+ brushSize: 4,
7112
+ path: null,
7113
+ pathType: "PLAIN",
7114
+ transform: null
7115
+ };
7116
+ })(FreePaint = Drawing.FreePaint || (Drawing.FreePaint = {}));
7117
+ })(Drawing = Markup.Drawing || (Markup.Drawing = {}));
7118
+ var Entity3d;
7119
+ (function (Entity3d) {
7120
+ var Polygon;
7121
+ (function (Polygon) {
7122
+ // Determines if terrain and 3d models should be overlapped or not.
7123
+ var EClassificationType;
7124
+ (function (EClassificationType) {
7125
+ // 3d models and terrain are overlapped.
7126
+ EClassificationType["Both"] = "BOTH";
7127
+ // Only terrain is overlapped.
7128
+ EClassificationType["Terrain"] = "TERRAIN";
7129
+ })(EClassificationType = Polygon.EClassificationType || (Polygon.EClassificationType = {}));
7130
+ Polygon.DEFAULT = {
7131
+ type: "POLYGON",
7132
+ id: null,
7133
+ positions: null,
7134
+ color: "rgba(254, 234, 57, 0.54)",
7135
+ outlineColor: "rgba(215, 215, 215, 0)",
7136
+ outlineWidth: 2,
7137
+ extrudedHeight: 0,
7138
+ classificationType: EClassificationType.Both,
7139
+ smoothen: 0
7140
+ };
7141
+ })(Polygon = Entity3d.Polygon || (Entity3d.Polygon = {}));
7142
+ var Polyline;
7143
+ (function (Polyline) {
7144
+ Polyline.DEFAULT = {
7145
+ type: "POLYLINE",
7146
+ id: null,
7147
+ positions: null,
7148
+ color: "rgba(254, 234, 57, 0.54)",
7149
+ outlineWidth: 4,
7150
+ smoothen: 0
7151
+ };
7152
+ })(Polyline = Entity3d.Polyline || (Entity3d.Polyline = {}));
7153
+ var Circle;
7154
+ (function (Circle) {
7155
+ Circle.DEFAULT = {
7156
+ type: "CIRCLE",
7157
+ id: null,
7158
+ position: null,
7159
+ radius: 50,
7160
+ color: "rgba(254, 234, 57, 0.54)"
7161
+ };
7162
+ })(Circle = Entity3d.Circle || (Entity3d.Circle = {}));
7163
+ })(Entity3d = Markup.Entity3d || (Markup.Entity3d = {}));
7068
7164
  })(exports.Markup || (exports.Markup = {}));
7069
7165
 
7070
7166
  exports.AbstractApi = AbstractApi;