@visactor/vrender 1.1.1 → 1.1.2-alpha.1

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.
package/dist/index.js CHANGED
@@ -17939,6 +17939,199 @@
17939
17939
  }
17940
17940
  }
17941
17941
 
17942
+ function drawArcPath(arc, context, cx, cy, z, outerRadius, innerRadius) {
17943
+ const {
17944
+ startAngle: startAngle,
17945
+ endAngle: endAngle
17946
+ } = arc.getParsedAngle(),
17947
+ deltaAngle = abs(endAngle - startAngle),
17948
+ clockwise = endAngle > startAngle;
17949
+ let collapsedToLine = !1;
17950
+ if (outerRadius < innerRadius) {
17951
+ const temp = outerRadius;
17952
+ outerRadius = innerRadius, innerRadius = temp;
17953
+ }
17954
+ if (outerRadius <= epsilon) context.moveTo(cx, cy, z);else if (deltaAngle >= pi2 - epsilon) context.moveTo(cx + outerRadius * cos(startAngle), cy + outerRadius * sin(startAngle), z), context.arc(cx, cy, outerRadius, startAngle, endAngle, !clockwise, z), innerRadius > epsilon && (context.moveTo(cx + innerRadius * cos(endAngle), cy + innerRadius * sin(endAngle), z), context.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise, z));else {
17955
+ const {
17956
+ outerDeltaAngle: outerDeltaAngle,
17957
+ innerDeltaAngle: innerDeltaAngle,
17958
+ outerStartAngle: outerStartAngle,
17959
+ outerEndAngle: outerEndAngle,
17960
+ innerEndAngle: innerEndAngle,
17961
+ innerStartAngle: innerStartAngle
17962
+ } = arc.getParsePadAngle(startAngle, endAngle),
17963
+ xors = outerRadius * cos(outerStartAngle),
17964
+ yors = outerRadius * sin(outerStartAngle),
17965
+ xire = innerRadius * cos(innerEndAngle),
17966
+ yire = innerRadius * sin(innerEndAngle);
17967
+ outerDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z), context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise, z)), !(innerRadius > epsilon) || innerDeltaAngle < .001 ? (context.lineTo(cx + xire, cy + yire, z), collapsedToLine = !0) : (context.lineTo(cx + xire, cy + yire, z), context.arc(cx, cy, innerRadius, innerEndAngle, innerStartAngle, clockwise, z));
17968
+ }
17969
+ return context.closePath(), collapsedToLine;
17970
+ }
17971
+ function drawInnerOuterArcPath(arc, context, cx, cy, z1, z2, radius, getParsePadAngle) {
17972
+ const {
17973
+ startAngle: startAngle,
17974
+ endAngle: endAngle
17975
+ } = arc.getParsedAngle(),
17976
+ deltaAngle = abs(endAngle - startAngle),
17977
+ clockwise = endAngle > startAngle;
17978
+ let collapsedToLine = !1;
17979
+ if (radius <= epsilon) context.moveTo(cx, cy, z1);else if (deltaAngle >= pi2 - epsilon) context.moveTo(cx + radius * cos(startAngle), cy + radius * sin(startAngle), z1), context.arc(cx, cy, radius, startAngle, endAngle, !clockwise, z1), context.lineTo(cx + radius * cos(endAngle), cy + radius * sin(endAngle), z2), context.arc(cx, cy, radius, endAngle, startAngle, clockwise, z2);else {
17980
+ const {
17981
+ innerouterDeltaAngle: innerouterDeltaAngle,
17982
+ innerouterStartAngle: innerouterStartAngle,
17983
+ innerouterEndAngle: innerouterEndAngle
17984
+ } = getParsePadAngle(startAngle, endAngle),
17985
+ xors = radius * cos(innerouterStartAngle),
17986
+ yors = radius * sin(innerouterStartAngle),
17987
+ xore = radius * cos(innerouterEndAngle),
17988
+ yore = radius * sin(innerouterEndAngle);
17989
+ innerouterDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z1), context.arc(cx, cy, radius, innerouterStartAngle, innerouterEndAngle, !clockwise, z1), context.lineTo(cx + xore, cy + yore, z2), context.arc(cx, cy, radius, innerouterEndAngle, innerouterStartAngle, clockwise, z2));
17990
+ }
17991
+ return context.closePath(), collapsedToLine;
17992
+ }
17993
+ class DefaultCanvasArc3DRender extends BaseRender {
17994
+ constructor() {
17995
+ super(...arguments), this.numberType = ARC3D_NUMBER_TYPE;
17996
+ }
17997
+ drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
17998
+ var _a;
17999
+ const arcAttribute = getTheme(arc, null == params ? void 0 : params.theme).arc,
18000
+ {
18001
+ fill = arcAttribute.fill
18002
+ } = arc.attribute,
18003
+ data = this.valid(arc, arcAttribute, fillCb, strokeCb);
18004
+ if (!data) return;
18005
+ const {
18006
+ fVisible: fVisible,
18007
+ sVisible: sVisible,
18008
+ doFill: doFill,
18009
+ doStroke: doStroke
18010
+ } = data,
18011
+ z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
18012
+ {
18013
+ outerPadding = arcAttribute.outerPadding,
18014
+ innerPadding = arcAttribute.innerPadding,
18015
+ height = 10
18016
+ } = arc.attribute;
18017
+ let {
18018
+ outerRadius = arcAttribute.outerRadius,
18019
+ innerRadius = arcAttribute.innerRadius
18020
+ } = arc.attribute;
18021
+ outerRadius += outerPadding, innerRadius -= innerPadding;
18022
+ const rgbArray = ColorStore.Get(fill, exports.ColorType.Color255),
18023
+ {
18024
+ light: light
18025
+ } = drawContext.stage || {},
18026
+ face = drawContext.hack_pieFace,
18027
+ z_face = {
18028
+ top: z,
18029
+ bottom: z + height
18030
+ },
18031
+ n_face = {
18032
+ top: [0, 1, 0],
18033
+ bottom: [0, -1, 0],
18034
+ outside: [1, 0, -1],
18035
+ inside: [1, 0, -1]
18036
+ };
18037
+ "bottom" === face || "top" === face ? (context.beginPath(), drawArcPath(arc, context, x, y, z_face[face], outerRadius, innerRadius), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()))) : "outside" !== face && "inside" !== face || ("inside" === face && (context.save(), context.beginPath(), context.arc(x, y, innerRadius, 0, pi2, !0, z_face.top), context.clip()), context.beginPath(), drawInnerOuterArcPath(arc, context, x, y, z_face.top, z_face.bottom, "outside" === face ? outerRadius : innerRadius, (startAngle, endAngle) => {
18038
+ const {
18039
+ outerDeltaAngle: outerDeltaAngle,
18040
+ innerDeltaAngle: innerDeltaAngle,
18041
+ outerStartAngle: outerStartAngle,
18042
+ outerEndAngle: outerEndAngle,
18043
+ innerEndAngle: innerEndAngle,
18044
+ innerStartAngle: innerStartAngle
18045
+ } = arc.getParsePadAngle(startAngle, endAngle);
18046
+ return "outside" === face ? {
18047
+ innerouterDeltaAngle: outerDeltaAngle,
18048
+ innerouterEndAngle: outerEndAngle,
18049
+ innerouterStartAngle: outerStartAngle
18050
+ } : {
18051
+ innerouterDeltaAngle: innerDeltaAngle,
18052
+ innerouterEndAngle: innerEndAngle,
18053
+ innerouterStartAngle: innerStartAngle
18054
+ };
18055
+ }), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke())), "inside" === face && context.restore());
18056
+ }
18057
+ draw(arc, renderService, drawContext, params) {
18058
+ const arcAttribute = getTheme(arc, null == params ? void 0 : params.theme).arc;
18059
+ this._draw(arc, arcAttribute, !1, drawContext, params);
18060
+ }
18061
+ }
18062
+
18063
+ class Base3dRender extends BaseRender {
18064
+ stroke(x, y, z, face3d, context) {
18065
+ const vertices = face3d.vertices;
18066
+ face3d.edges.forEach(edge => {
18067
+ const p1 = vertices[edge[0]],
18068
+ v1 = {
18069
+ x: x + p1[0],
18070
+ y: y + p1[1],
18071
+ z: z + p1[2]
18072
+ },
18073
+ p2 = vertices[edge[1]],
18074
+ v2 = {
18075
+ x: x + p2[0],
18076
+ y: y + p2[1],
18077
+ z: z + p2[2]
18078
+ };
18079
+ context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.stroke();
18080
+ });
18081
+ }
18082
+ fill(x, y, z, face3d, faces, fillColor, context, light, graphic3d, graphic3dAttribute, fillCb) {
18083
+ const rgbArray = ColorStore.Get(fillColor, exports.ColorType.Color255),
18084
+ vertices = face3d.vertices,
18085
+ viewdVerticesZ = vertices.map(v => context.view(v[0], v[1], v[2])[2]),
18086
+ sortFace = [];
18087
+ face3d.polygons.forEach((p, i) => {
18088
+ if (faces && !faces[i]) return;
18089
+ sortFace.push({
18090
+ faceIdx: i,
18091
+ polygon: p
18092
+ });
18093
+ const {
18094
+ polygon: polygon
18095
+ } = p,
18096
+ z1 = viewdVerticesZ[polygon[0]],
18097
+ z2 = viewdVerticesZ[polygon[1]],
18098
+ z3 = viewdVerticesZ[polygon[2]],
18099
+ z4 = viewdVerticesZ[polygon[3]];
18100
+ p.ave_z = z1 + z2 + z3 + z4;
18101
+ }), sortFace.sort((a, b) => b.polygon.ave_z - a.polygon.ave_z), sortFace.forEach(item => {
18102
+ const {
18103
+ polygon: polygon,
18104
+ normal: normal
18105
+ } = item.polygon,
18106
+ p1 = vertices[polygon[0]],
18107
+ p2 = vertices[polygon[1]],
18108
+ p3 = vertices[polygon[2]],
18109
+ p4 = vertices[polygon[3]],
18110
+ v1 = {
18111
+ x: x + p1[0],
18112
+ y: y + p1[1],
18113
+ z: z + p1[2]
18114
+ },
18115
+ v2 = {
18116
+ x: x + p2[0],
18117
+ y: y + p2[1],
18118
+ z: z + p2[2]
18119
+ },
18120
+ v3 = {
18121
+ x: x + p3[0],
18122
+ y: y + p3[1],
18123
+ z: z + p3[2]
18124
+ },
18125
+ v4 = {
18126
+ x: x + p4[0],
18127
+ y: y + p4[1],
18128
+ z: z + p4[2]
18129
+ };
18130
+ context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.lineTo(v3.x, v3.y, v3.z), context.lineTo(v4.x, v4.y, v4.z), context.closePath(), fillCb ? fillCb(context, graphic3d && graphic3d.attribute, graphic3dAttribute) : (context.fillStyle = light ? light.computeColor(normal, rgbArray) : fillColor, context.fill());
18131
+ });
18132
+ }
18133
+ }
18134
+
17942
18135
  class DefaultCanvasCircleRender extends BaseRender {
17943
18136
  constructor(graphicRenderContributions) {
17944
18137
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = CIRCLE_NUMBER_TYPE, this.builtinContributions = [defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution], this.init(graphicRenderContributions);
@@ -18625,6 +18818,57 @@
18625
18818
  }
18626
18819
  }
18627
18820
 
18821
+ class DefaultCanvasRect3dRender extends Base3dRender {
18822
+ constructor() {
18823
+ super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
18824
+ }
18825
+ drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
18826
+ var _a, _b;
18827
+ const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect,
18828
+ {
18829
+ fill = rectAttribute.fill,
18830
+ stroke = rectAttribute.stroke,
18831
+ x1: x1,
18832
+ y1: y1,
18833
+ x: originX,
18834
+ y: originY,
18835
+ opacity = rectAttribute.opacity,
18836
+ fillOpacity = rectAttribute.fillOpacity,
18837
+ lineWidth = rectAttribute.lineWidth,
18838
+ strokeOpacity = rectAttribute.strokeOpacity,
18839
+ visible = rectAttribute.visible,
18840
+ drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
18841
+ } = rect.attribute;
18842
+ let {
18843
+ width: width,
18844
+ height: height
18845
+ } = rect.attribute;
18846
+ width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
18847
+ const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
18848
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
18849
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
18850
+ doFill = runFill(fill),
18851
+ doStroke = runStroke(stroke, lineWidth);
18852
+ if (!rect.valid || !visible) return;
18853
+ if (!doFill && !doStroke) return;
18854
+ if (!(fVisible || sVisible || fillCb || strokeCb)) return;
18855
+ const {
18856
+ light: light
18857
+ } = drawContext.stage || {},
18858
+ face3d = rect.findFace();
18859
+ if (!1 !== fill) {
18860
+ context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);
18861
+ let fc = fill;
18862
+ "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, null, fc, context, light, null, null, fillCb);
18863
+ }
18864
+ !1 !== stroke && (context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute), this.stroke(x, y, z, face3d, context));
18865
+ }
18866
+ draw(rect, renderService, drawContext) {
18867
+ const rectAttribute = getTheme(rect).rect;
18868
+ this._draw(rect, rectAttribute, !1, drawContext);
18869
+ }
18870
+ }
18871
+
18628
18872
  class DefaultCanvasSymbolRender extends BaseRender {
18629
18873
  constructor(graphicRenderContributions) {
18630
18874
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = SYMBOL_NUMBER_TYPE, this.builtinContributions = [defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution, defaultSymbolClipRangeStrokeRenderContribution], this.init(graphicRenderContributions);
@@ -18989,6 +19233,37 @@
18989
19233
  }
18990
19234
  }
18991
19235
 
19236
+ class DefaultCanvasPyramid3dRender extends Base3dRender {
19237
+ constructor() {
19238
+ super(...arguments), this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE;
19239
+ }
19240
+ drawShape(pyramid3d, context, x, y, drawContext, params, fillCb, strokeCb) {
19241
+ var _a;
19242
+ const pyramidAttribute = getTheme(pyramid3d, null == params ? void 0 : params.theme).polygon,
19243
+ {
19244
+ fill = pyramidAttribute.fill,
19245
+ stroke = pyramidAttribute.stroke,
19246
+ face = [!0, !0, !0, !0, !0, !0]
19247
+ } = pyramid3d.attribute,
19248
+ z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
19249
+ if (!this.valid(pyramid3d, pyramidAttribute, fillCb, strokeCb)) return;
19250
+ const {
19251
+ light: light
19252
+ } = drawContext.stage || {},
19253
+ face3d = pyramid3d.findFace();
19254
+ if (!1 !== fill) {
19255
+ context.setCommonStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute);
19256
+ let fc = fill;
19257
+ "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, face, fc, context, light, pyramid3d, pyramidAttribute, fillCb);
19258
+ }
19259
+ !1 !== stroke && (context.setStrokeStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute), this.stroke(x, y, z, face3d, context));
19260
+ }
19261
+ draw(pyramid3d, renderService, drawContext) {
19262
+ const pyramid3dAttribute = getTheme(pyramid3d).polygon;
19263
+ this._draw(pyramid3d, pyramid3dAttribute, !1, drawContext);
19264
+ }
19265
+ }
19266
+
18992
19267
  const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
18993
19268
  function resolveImageRepeatMode(repeatX, repeatY) {
18994
19269
  let repeat = 0;
@@ -21836,129 +22111,6 @@
21836
22111
  }
21837
22112
  const imageModule = bindImageRenderModule;
21838
22113
 
21839
- class Base3dRender extends BaseRender {
21840
- stroke(x, y, z, face3d, context) {
21841
- const vertices = face3d.vertices;
21842
- face3d.edges.forEach(edge => {
21843
- const p1 = vertices[edge[0]],
21844
- v1 = {
21845
- x: x + p1[0],
21846
- y: y + p1[1],
21847
- z: z + p1[2]
21848
- },
21849
- p2 = vertices[edge[1]],
21850
- v2 = {
21851
- x: x + p2[0],
21852
- y: y + p2[1],
21853
- z: z + p2[2]
21854
- };
21855
- context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.stroke();
21856
- });
21857
- }
21858
- fill(x, y, z, face3d, faces, fillColor, context, light, graphic3d, graphic3dAttribute, fillCb) {
21859
- const rgbArray = ColorStore.Get(fillColor, exports.ColorType.Color255),
21860
- vertices = face3d.vertices,
21861
- viewdVerticesZ = vertices.map(v => context.view(v[0], v[1], v[2])[2]),
21862
- sortFace = [];
21863
- face3d.polygons.forEach((p, i) => {
21864
- if (faces && !faces[i]) return;
21865
- sortFace.push({
21866
- faceIdx: i,
21867
- polygon: p
21868
- });
21869
- const {
21870
- polygon: polygon
21871
- } = p,
21872
- z1 = viewdVerticesZ[polygon[0]],
21873
- z2 = viewdVerticesZ[polygon[1]],
21874
- z3 = viewdVerticesZ[polygon[2]],
21875
- z4 = viewdVerticesZ[polygon[3]];
21876
- p.ave_z = z1 + z2 + z3 + z4;
21877
- }), sortFace.sort((a, b) => b.polygon.ave_z - a.polygon.ave_z), sortFace.forEach(item => {
21878
- const {
21879
- polygon: polygon,
21880
- normal: normal
21881
- } = item.polygon,
21882
- p1 = vertices[polygon[0]],
21883
- p2 = vertices[polygon[1]],
21884
- p3 = vertices[polygon[2]],
21885
- p4 = vertices[polygon[3]],
21886
- v1 = {
21887
- x: x + p1[0],
21888
- y: y + p1[1],
21889
- z: z + p1[2]
21890
- },
21891
- v2 = {
21892
- x: x + p2[0],
21893
- y: y + p2[1],
21894
- z: z + p2[2]
21895
- },
21896
- v3 = {
21897
- x: x + p3[0],
21898
- y: y + p3[1],
21899
- z: z + p3[2]
21900
- },
21901
- v4 = {
21902
- x: x + p4[0],
21903
- y: y + p4[1],
21904
- z: z + p4[2]
21905
- };
21906
- context.beginPath(), context.moveTo(v1.x, v1.y, v1.z), context.lineTo(v2.x, v2.y, v2.z), context.lineTo(v3.x, v3.y, v3.z), context.lineTo(v4.x, v4.y, v4.z), context.closePath(), fillCb ? fillCb(context, graphic3d && graphic3d.attribute, graphic3dAttribute) : (context.fillStyle = light ? light.computeColor(normal, rgbArray) : fillColor, context.fill());
21907
- });
21908
- }
21909
- }
21910
-
21911
- class DefaultCanvasRect3dRender extends Base3dRender {
21912
- constructor() {
21913
- super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
21914
- }
21915
- drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
21916
- var _a, _b;
21917
- const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect,
21918
- {
21919
- fill = rectAttribute.fill,
21920
- stroke = rectAttribute.stroke,
21921
- x1: x1,
21922
- y1: y1,
21923
- x: originX,
21924
- y: originY,
21925
- opacity = rectAttribute.opacity,
21926
- fillOpacity = rectAttribute.fillOpacity,
21927
- lineWidth = rectAttribute.lineWidth,
21928
- strokeOpacity = rectAttribute.strokeOpacity,
21929
- visible = rectAttribute.visible,
21930
- drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
21931
- } = rect.attribute;
21932
- let {
21933
- width: width,
21934
- height: height
21935
- } = rect.attribute;
21936
- width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
21937
- const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
21938
- fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
21939
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
21940
- doFill = runFill(fill),
21941
- doStroke = runStroke(stroke, lineWidth);
21942
- if (!rect.valid || !visible) return;
21943
- if (!doFill && !doStroke) return;
21944
- if (!(fVisible || sVisible || fillCb || strokeCb)) return;
21945
- const {
21946
- light: light
21947
- } = drawContext.stage || {},
21948
- face3d = rect.findFace();
21949
- if (!1 !== fill) {
21950
- context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);
21951
- let fc = fill;
21952
- "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, null, fc, context, light, null, null, fillCb);
21953
- }
21954
- !1 !== stroke && (context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute), this.stroke(x, y, z, face3d, context));
21955
- }
21956
- draw(rect, renderService, drawContext) {
21957
- const rectAttribute = getTheme(rect).rect;
21958
- this._draw(rect, rectAttribute, !1, drawContext);
21959
- }
21960
- }
21961
-
21962
22114
  const loadedRect3dModuleContexts = new WeakSet();
21963
22115
  function bindRect3dRenderModule({
21964
22116
  bind: bind
@@ -21967,127 +22119,6 @@
21967
22119
  }
21968
22120
  const rect3dModule = bindRect3dRenderModule;
21969
22121
 
21970
- function drawArcPath(arc, context, cx, cy, z, outerRadius, innerRadius) {
21971
- const {
21972
- startAngle: startAngle,
21973
- endAngle: endAngle
21974
- } = arc.getParsedAngle(),
21975
- deltaAngle = abs(endAngle - startAngle),
21976
- clockwise = endAngle > startAngle;
21977
- let collapsedToLine = !1;
21978
- if (outerRadius < innerRadius) {
21979
- const temp = outerRadius;
21980
- outerRadius = innerRadius, innerRadius = temp;
21981
- }
21982
- if (outerRadius <= epsilon) context.moveTo(cx, cy, z);else if (deltaAngle >= pi2 - epsilon) context.moveTo(cx + outerRadius * cos(startAngle), cy + outerRadius * sin(startAngle), z), context.arc(cx, cy, outerRadius, startAngle, endAngle, !clockwise, z), innerRadius > epsilon && (context.moveTo(cx + innerRadius * cos(endAngle), cy + innerRadius * sin(endAngle), z), context.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise, z));else {
21983
- const {
21984
- outerDeltaAngle: outerDeltaAngle,
21985
- innerDeltaAngle: innerDeltaAngle,
21986
- outerStartAngle: outerStartAngle,
21987
- outerEndAngle: outerEndAngle,
21988
- innerEndAngle: innerEndAngle,
21989
- innerStartAngle: innerStartAngle
21990
- } = arc.getParsePadAngle(startAngle, endAngle),
21991
- xors = outerRadius * cos(outerStartAngle),
21992
- yors = outerRadius * sin(outerStartAngle),
21993
- xire = innerRadius * cos(innerEndAngle),
21994
- yire = innerRadius * sin(innerEndAngle);
21995
- outerDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z), context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise, z)), !(innerRadius > epsilon) || innerDeltaAngle < .001 ? (context.lineTo(cx + xire, cy + yire, z), collapsedToLine = !0) : (context.lineTo(cx + xire, cy + yire, z), context.arc(cx, cy, innerRadius, innerEndAngle, innerStartAngle, clockwise, z));
21996
- }
21997
- return context.closePath(), collapsedToLine;
21998
- }
21999
- function drawInnerOuterArcPath(arc, context, cx, cy, z1, z2, radius, getParsePadAngle) {
22000
- const {
22001
- startAngle: startAngle,
22002
- endAngle: endAngle
22003
- } = arc.getParsedAngle(),
22004
- deltaAngle = abs(endAngle - startAngle),
22005
- clockwise = endAngle > startAngle;
22006
- let collapsedToLine = !1;
22007
- if (radius <= epsilon) context.moveTo(cx, cy, z1);else if (deltaAngle >= pi2 - epsilon) context.moveTo(cx + radius * cos(startAngle), cy + radius * sin(startAngle), z1), context.arc(cx, cy, radius, startAngle, endAngle, !clockwise, z1), context.lineTo(cx + radius * cos(endAngle), cy + radius * sin(endAngle), z2), context.arc(cx, cy, radius, endAngle, startAngle, clockwise, z2);else {
22008
- const {
22009
- innerouterDeltaAngle: innerouterDeltaAngle,
22010
- innerouterStartAngle: innerouterStartAngle,
22011
- innerouterEndAngle: innerouterEndAngle
22012
- } = getParsePadAngle(startAngle, endAngle),
22013
- xors = radius * cos(innerouterStartAngle),
22014
- yors = radius * sin(innerouterStartAngle),
22015
- xore = radius * cos(innerouterEndAngle),
22016
- yore = radius * sin(innerouterEndAngle);
22017
- innerouterDeltaAngle < .001 ? collapsedToLine = !0 : (context.moveTo(cx + xors, cy + yors, z1), context.arc(cx, cy, radius, innerouterStartAngle, innerouterEndAngle, !clockwise, z1), context.lineTo(cx + xore, cy + yore, z2), context.arc(cx, cy, radius, innerouterEndAngle, innerouterStartAngle, clockwise, z2));
22018
- }
22019
- return context.closePath(), collapsedToLine;
22020
- }
22021
- class DefaultCanvasArc3DRender extends BaseRender {
22022
- constructor() {
22023
- super(...arguments), this.numberType = ARC3D_NUMBER_TYPE;
22024
- }
22025
- drawShape(arc, context, x, y, drawContext, params, fillCb, strokeCb) {
22026
- var _a;
22027
- const arcAttribute = getTheme(arc, null == params ? void 0 : params.theme).arc,
22028
- {
22029
- fill = arcAttribute.fill
22030
- } = arc.attribute,
22031
- data = this.valid(arc, arcAttribute, fillCb, strokeCb);
22032
- if (!data) return;
22033
- const {
22034
- fVisible: fVisible,
22035
- sVisible: sVisible,
22036
- doFill: doFill,
22037
- doStroke: doStroke
22038
- } = data,
22039
- z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
22040
- {
22041
- outerPadding = arcAttribute.outerPadding,
22042
- innerPadding = arcAttribute.innerPadding,
22043
- height = 10
22044
- } = arc.attribute;
22045
- let {
22046
- outerRadius = arcAttribute.outerRadius,
22047
- innerRadius = arcAttribute.innerRadius
22048
- } = arc.attribute;
22049
- outerRadius += outerPadding, innerRadius -= innerPadding;
22050
- const rgbArray = ColorStore.Get(fill, exports.ColorType.Color255),
22051
- {
22052
- light: light
22053
- } = drawContext.stage || {},
22054
- face = drawContext.hack_pieFace,
22055
- z_face = {
22056
- top: z,
22057
- bottom: z + height
22058
- },
22059
- n_face = {
22060
- top: [0, 1, 0],
22061
- bottom: [0, -1, 0],
22062
- outside: [1, 0, -1],
22063
- inside: [1, 0, -1]
22064
- };
22065
- "bottom" === face || "top" === face ? (context.beginPath(), drawArcPath(arc, context, x, y, z_face[face], outerRadius, innerRadius), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()))) : "outside" !== face && "inside" !== face || ("inside" === face && (context.save(), context.beginPath(), context.arc(x, y, innerRadius, 0, pi2, !0, z_face.top), context.clip()), context.beginPath(), drawInnerOuterArcPath(arc, context, x, y, z_face.top, z_face.bottom, "outside" === face ? outerRadius : innerRadius, (startAngle, endAngle) => {
22066
- const {
22067
- outerDeltaAngle: outerDeltaAngle,
22068
- innerDeltaAngle: innerDeltaAngle,
22069
- outerStartAngle: outerStartAngle,
22070
- outerEndAngle: outerEndAngle,
22071
- innerEndAngle: innerEndAngle,
22072
- innerStartAngle: innerStartAngle
22073
- } = arc.getParsePadAngle(startAngle, endAngle);
22074
- return "outside" === face ? {
22075
- innerouterDeltaAngle: outerDeltaAngle,
22076
- innerouterEndAngle: outerEndAngle,
22077
- innerouterStartAngle: outerStartAngle
22078
- } : {
22079
- innerouterDeltaAngle: innerDeltaAngle,
22080
- innerouterEndAngle: innerEndAngle,
22081
- innerouterStartAngle: innerStartAngle
22082
- };
22083
- }), context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = light ? light.computeColor(n_face[face], rgbArray) : fill, context.fill())), doStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke())), "inside" === face && context.restore());
22084
- }
22085
- draw(arc, renderService, drawContext, params) {
22086
- const arcAttribute = getTheme(arc, null == params ? void 0 : params.theme).arc;
22087
- this._draw(arc, arcAttribute, !1, drawContext, params);
22088
- }
22089
- }
22090
-
22091
22122
  const loadedArc3dModuleContexts = new WeakSet();
22092
22123
  function bindArc3dRenderModule({
22093
22124
  bind: bind
@@ -22096,37 +22127,6 @@
22096
22127
  }
22097
22128
  const arc3dModule = bindArc3dRenderModule;
22098
22129
 
22099
- class DefaultCanvasPyramid3dRender extends Base3dRender {
22100
- constructor() {
22101
- super(...arguments), this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE;
22102
- }
22103
- drawShape(pyramid3d, context, x, y, drawContext, params, fillCb, strokeCb) {
22104
- var _a;
22105
- const pyramidAttribute = getTheme(pyramid3d, null == params ? void 0 : params.theme).polygon,
22106
- {
22107
- fill = pyramidAttribute.fill,
22108
- stroke = pyramidAttribute.stroke,
22109
- face = [!0, !0, !0, !0, !0, !0]
22110
- } = pyramid3d.attribute,
22111
- z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
22112
- if (!this.valid(pyramid3d, pyramidAttribute, fillCb, strokeCb)) return;
22113
- const {
22114
- light: light
22115
- } = drawContext.stage || {},
22116
- face3d = pyramid3d.findFace();
22117
- if (!1 !== fill) {
22118
- context.setCommonStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute);
22119
- let fc = fill;
22120
- "string" != typeof fc && (fc = "black"), this.fill(x, y, z, face3d, face, fc, context, light, pyramid3d, pyramidAttribute, fillCb);
22121
- }
22122
- !1 !== stroke && (context.setStrokeStyle(pyramid3d, pyramid3d.attribute, x, y, pyramidAttribute), this.stroke(x, y, z, face3d, context));
22123
- }
22124
- draw(pyramid3d, renderService, drawContext) {
22125
- const pyramid3dAttribute = getTheme(pyramid3d).polygon;
22126
- this._draw(pyramid3d, pyramid3dAttribute, !1, drawContext);
22127
- }
22128
- }
22129
-
22130
22130
  const loadedPyramid3dModuleContexts = new WeakSet();
22131
22131
  function bindPyramid3dRenderModule({
22132
22132
  bind: bind
@@ -22790,6 +22790,7 @@
22790
22790
  AreaRenderContribution: AreaRenderContribution,
22791
22791
  get AttributeUpdateType () { return exports.AttributeUpdateType; },
22792
22792
  AutoEnablePlugins: AutoEnablePlugins,
22793
+ Base3dRender: Base3dRender,
22793
22794
  BaseCanvas: BaseCanvas,
22794
22795
  BaseEnvContribution: BaseEnvContribution,
22795
22796
  BaseRender: BaseRender,
@@ -22838,6 +22839,7 @@
22838
22839
  DefaultBaseInteractiveRenderContribution: DefaultBaseInteractiveRenderContribution,
22839
22840
  DefaultBaseTextureRenderContribution: DefaultBaseTextureRenderContribution,
22840
22841
  DefaultCanvasAllocate: DefaultCanvasAllocate,
22842
+ DefaultCanvasArc3DRender: DefaultCanvasArc3DRender,
22841
22843
  DefaultCanvasArcRender: DefaultCanvasArcRender,
22842
22844
  DefaultCanvasAreaRender: DefaultCanvasAreaRender,
22843
22845
  DefaultCanvasCircleRender: DefaultCanvasCircleRender,
@@ -22846,6 +22848,8 @@
22846
22848
  DefaultCanvasLineRender: DefaultCanvasLineRender,
22847
22849
  DefaultCanvasPathRender: DefaultCanvasPathRender,
22848
22850
  DefaultCanvasPolygonRender: DefaultCanvasPolygonRender,
22851
+ DefaultCanvasPyramid3dRender: DefaultCanvasPyramid3dRender,
22852
+ DefaultCanvasRect3dRender: DefaultCanvasRect3dRender,
22849
22853
  DefaultCanvasRectRender: DefaultCanvasRectRender,
22850
22854
  DefaultCanvasSymbolRender: DefaultCanvasSymbolRender,
22851
22855
  DefaultCanvasTextRender: DefaultCanvasTextRender,
@@ -55462,7 +55466,7 @@
55462
55466
  return resolveLegacyApp().createStage(params);
55463
55467
  }
55464
55468
 
55465
- const version = "1.1.1";
55469
+ const version = "1.1.2-alpha.1";
55466
55470
 
55467
55471
  exports.AComponentAnimate = AComponentAnimate;
55468
55472
  exports.ACustomAnimate = ACustomAnimate;
@@ -55493,6 +55497,7 @@
55493
55497
  exports.AreaRender = AreaRender;
55494
55498
  exports.AreaRenderContribution = AreaRenderContribution;
55495
55499
  exports.AutoEnablePlugins = AutoEnablePlugins;
55500
+ exports.Base3dRender = Base3dRender;
55496
55501
  exports.BaseCanvas = BaseCanvas;
55497
55502
  exports.BaseEnvContribution = BaseEnvContribution;
55498
55503
  exports.BasePlayer = BasePlayer;
@@ -55585,6 +55590,7 @@
55585
55590
  exports.DefaultBaseInteractiveRenderContribution = DefaultBaseInteractiveRenderContribution;
55586
55591
  exports.DefaultBaseTextureRenderContribution = DefaultBaseTextureRenderContribution;
55587
55592
  exports.DefaultCanvasAllocate = DefaultCanvasAllocate;
55593
+ exports.DefaultCanvasArc3DRender = DefaultCanvasArc3DRender;
55588
55594
  exports.DefaultCanvasArcRender = DefaultCanvasArcRender;
55589
55595
  exports.DefaultCanvasAreaRender = DefaultCanvasAreaRender;
55590
55596
  exports.DefaultCanvasCircleRender = DefaultCanvasCircleRender;
@@ -55593,6 +55599,8 @@
55593
55599
  exports.DefaultCanvasLineRender = DefaultCanvasLineRender;
55594
55600
  exports.DefaultCanvasPathRender = DefaultCanvasPathRender;
55595
55601
  exports.DefaultCanvasPolygonRender = DefaultCanvasPolygonRender;
55602
+ exports.DefaultCanvasPyramid3dRender = DefaultCanvasPyramid3dRender;
55603
+ exports.DefaultCanvasRect3dRender = DefaultCanvasRect3dRender;
55596
55604
  exports.DefaultCanvasRectRender = DefaultCanvasRectRender;
55597
55605
  exports.DefaultCanvasSymbolRender = DefaultCanvasSymbolRender;
55598
55606
  exports.DefaultCanvasTextRender = DefaultCanvasTextRender;