@visactor/vrender-core 1.0.0-alpha.12 → 1.0.0-alpha.13

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.
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", {
16
16
  value: !0
17
17
  }), exports.DefaultGraphicService = exports.shouldUseMat4 = exports.getModelMatrix = exports.getExtraModelMatrix = void 0;
18
18
 
19
- const inversify_lite_1 = require("../../common/inversify-lite"), vutils_1 = require("@visactor/vutils"), tapable_1 = require("../../tapable"), text_1 = require("../../common/text"), tools_1 = require("../tools"), matrix_allocate_1 = require("../../allocator/matrix-allocate"), bounds_context_1 = require("../../common/bounds-context"), render_command_list_1 = require("../../common/render-command-list"), constants_1 = require("../constants"), matrix_1 = require("../../common/matrix"), application_1 = require("../../application");
19
+ const inversify_lite_1 = require("../../common/inversify-lite"), vutils_1 = require("@visactor/vutils"), tapable_1 = require("../../tapable"), text_1 = require("../../common/text"), tools_1 = require("../tools"), matrix_allocate_1 = require("../../allocator/matrix-allocate"), bounds_context_1 = require("../../common/bounds-context"), render_command_list_1 = require("../../common/render-command-list"), constants_1 = require("../constants"), matrix_1 = require("../../common/matrix");
20
20
 
21
21
  function getExtraModelMatrix(dx, dy, graphic) {
22
22
  const {alpha: alpha, beta: beta} = graphic.attribute;
@@ -179,8 +179,7 @@ let DefaultGraphicService = class {
179
179
  if (graphic.shadowRoot || graphic.isContainer) return !0;
180
180
  const {visible: visible = theme.visible} = attribute;
181
181
  return !(!graphic.valid || !visible) || (aabbBounds.empty() || (graphic.parent && aabbBounds.transformWithMatrix(graphic.parent.globalTransMatrix),
182
- application_1.application.graphicService.clearAABBBounds(graphic, graphic.stage, aabbBounds),
183
- aabbBounds.clear()), !1);
182
+ this.clearAABBBounds(graphic, graphic.stage, aabbBounds), aabbBounds.clear()), !1);
184
183
  }
185
184
  updateTempAABBBounds(aabbBounds) {
186
185
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBoun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AI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,EAAE;YAE/B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE;gBACvB,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,mBAAmB,CAAE,OAAO,CAAC,MAAiB,CAAC,iBAAiB,CAAC,CAAC;gBAC/F,yBAAW,CAAC,cAAc,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;gBAC/E,UAAU,CAAC,KAAK,EAAE,CAAC;aACpB;YACD,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oBAAoB,CAAC,UAAuB;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC;QACjC,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC;QACjC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QAEzE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACtB,CAAC;CACF,CAAA;AAvOY,qBAAqB;IADjC,IAAA,2BAAU,GAAE;IAiBE,WAAA,IAAA,uBAAM,EAAC,0BAAc,CAAC,CAAA;;GAhBxB,qBAAqB,CAuOjC;AAvOY,sDAAqB","file":"graphic-service.js","sourcesContent":["import { inject, injectable } from '../../common/inversify-lite';\nimport type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds, isNumber, transformBoundsWithMatrix } from '@visactor/vutils';\nimport { SyncHook } from '../../tapable';\nimport type {\n mat4,\n IGraphicAttribute,\n IGraphic,\n IGroup,\n IStage,\n IText,\n ITextGraphicAttribute,\n ITransform,\n IGraphicService,\n IGraphicCreator,\n ISyncHook\n} from '../../interface';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../../common/text';\nimport { boundStroke } from '../tools';\nimport { mat4Allocate } from '../../allocator/matrix-allocate';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { BoundsContext } from '../../common/bounds-context';\nimport { renderCommandList } from '../../common/render-command-list';\nimport { GraphicCreator } from '../constants';\nimport { identityMat4, multiplyMat4Mat4, rotateX, rotateY, rotateZ, scaleMat4, translate } from '../../common/matrix';\nimport { application } from '../../application';\n\nexport function getExtraModelMatrix(dx: number, dy: number, graphic: IGraphic): mat4 | null {\n const { alpha, beta } = graphic.attribute;\n if (!alpha && !beta) {\n return null;\n }\n const { anchor3d = graphic.attribute.anchor } = graphic.attribute;\n\n const _anchor: [number, number] = [0, 0];\n if (anchor3d) {\n if (typeof anchor3d[0] === 'string') {\n const ratio = parseFloat(anchor3d[0]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor3d[0];\n }\n if (typeof anchor3d[1] === 'string') {\n const ratio = parseFloat(anchor3d[1]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[1] = anchor3d[1];\n }\n }\n\n if (graphic.type === 'text') {\n const { textAlign } = graphic.attribute as ITextGraphicAttribute;\n // 计算偏移\n _anchor[0] += textDrawOffsetX(textAlign, (graphic as IText).clipedWidth);\n }\n\n // 应用偏移,计算全局的偏移\n _anchor[0] += dx;\n _anchor[1] += dy;\n // matrix.scale(dpr, dpr);\n\n const modelMatrix = mat4Allocate.allocate();\n translate(modelMatrix, modelMatrix, [_anchor[0], _anchor[1], 0]);\n if (beta) {\n rotateX(modelMatrix, modelMatrix, beta);\n }\n if (alpha) {\n rotateY(modelMatrix, modelMatrix, alpha);\n }\n translate(modelMatrix, modelMatrix, [-_anchor[0], -_anchor[1], 0]);\n\n return modelMatrix;\n}\n\n// 计算3d下的模型矩阵\nexport function getModelMatrix(out: mat4, graphic: IGraphic, theme: ITransform) {\n const {\n x = theme.x,\n y = theme.y,\n z = theme.z,\n dx = theme.dx,\n dy = theme.dy,\n dz = theme.dz,\n scaleX = theme.scaleX,\n scaleY = theme.scaleY,\n scaleZ = theme.scaleZ,\n alpha = theme.alpha,\n beta = theme.beta,\n angle = theme.angle,\n anchor3d = graphic.attribute.anchor,\n anchor\n } = graphic.attribute;\n\n const _anchor: [number, number, number] = [0, 0, 0];\n if (anchor3d) {\n if (typeof anchor3d[0] === 'string') {\n const ratio = parseFloat(anchor3d[0]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor3d[0];\n }\n if (typeof anchor3d[1] === 'string') {\n const ratio = parseFloat(anchor3d[1]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[1] = anchor3d[1];\n }\n _anchor[2] = anchor3d[2] ?? 0;\n }\n\n // if (graphic.type === 'text') {\n // const { textAlign } = graphic.attribute as ITextGraphicAttribute;\n // // 计算偏移\n // _anchor[0] += textDrawOffsetX(textAlign, (graphic as IText).clipedWidth);\n // }\n\n identityMat4(out);\n // 平移\n translate(out, out, [x + dx, y + dy, z + dz]);\n translate(out, out, [_anchor[0], _anchor[1], _anchor[2]]);\n rotateX(out, out, beta);\n rotateY(out, out, alpha);\n // 基于z轴的偏移基于anchor计算\n // rotateZ(out, out, angle);\n translate(out, out, [-_anchor[0], -_anchor[1], _anchor[2]]);\n scaleMat4(out, out, [scaleX, scaleY, scaleZ]);\n\n // 计算基于z轴的偏移\n if (angle) {\n const m = mat4Allocate.allocate();\n const _anchor: [number, number] = [0, 0];\n if (anchor) {\n if (typeof anchor3d[0] === 'string') {\n const ratio = parseFloat(anchor3d[0]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor3d[0];\n }\n if (typeof anchor3d[1] === 'string') {\n const ratio = parseFloat(anchor3d[1]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[1] = anchor3d[1];\n }\n }\n\n translate(m, m, [_anchor[0], _anchor[1], 0]);\n // 基于z轴的偏移基于anchor计算\n rotateZ(m, m, angle);\n translate(m, m, [-_anchor[0], -_anchor[1], 0]);\n\n multiplyMat4Mat4(out, out, m);\n }\n}\n\nexport function shouldUseMat4(graphic: IGraphic) {\n const { alpha, beta } = graphic.attribute;\n return alpha || beta;\n}\n\n// 管理graphic\n@injectable()\nexport class DefaultGraphicService implements IGraphicService {\n declare hooks: {\n onAttributeUpdate: ISyncHook<[IGraphic]>;\n onSetStage: ISyncHook<[IGraphic, IStage]>;\n onRemove: ISyncHook<[IGraphic]>;\n onRelease: ISyncHook<[IGraphic]>;\n onAddIncremental: ISyncHook<[IGraphic, IGroup, IStage]>;\n onClearIncremental: ISyncHook<[IGroup, IStage]>;\n beforeUpdateAABBBounds: ISyncHook<[IGraphic, IStage, boolean, IAABBBounds]>;\n afterUpdateAABBBounds: ISyncHook<[IGraphic, IStage, IAABBBounds, { globalAABBBounds: IAABBBounds }, boolean]>;\n clearAABBBounds: ISyncHook<[IGraphic, IStage, IAABBBounds]>;\n };\n\n // 临时bounds,用作缓存\n protected tempAABBBounds1: AABBBounds;\n protected tempAABBBounds2: AABBBounds;\n constructor(@inject(GraphicCreator) public readonly creator: IGraphicCreator) {\n this.hooks = {\n onAttributeUpdate: new SyncHook<[IGraphic]>(['graphic']),\n onSetStage: new SyncHook<[IGraphic, IStage]>(['graphic', 'stage']),\n onRemove: new SyncHook<[IGraphic]>(['graphic']),\n onRelease: new SyncHook<[IGraphic]>(['graphic']),\n onAddIncremental: new SyncHook<[IGraphic, IGroup, IStage]>(['graphic', 'group', 'stage']),\n onClearIncremental: new SyncHook<[IGroup, IStage]>(['graphic', 'group', 'stage']),\n beforeUpdateAABBBounds: new SyncHook<[IGraphic, IStage, boolean, IAABBBounds]>([\n 'graphic',\n 'stage',\n 'willUpdate',\n 'aabbBounds'\n ]),\n afterUpdateAABBBounds: new SyncHook<[IGraphic, IStage, IAABBBounds, { globalAABBBounds: IAABBBounds }, boolean]>([\n 'graphic',\n 'stage',\n 'aabbBounds',\n 'globalAABBBounds',\n 'selfChange'\n ]),\n clearAABBBounds: new SyncHook<[IGraphic, IStage, IAABBBounds]>(['graphic', 'stage', 'aabbBounds'])\n };\n this.tempAABBBounds1 = new AABBBounds();\n this.tempAABBBounds2 = new AABBBounds();\n }\n onAttributeUpdate(graphic: IGraphic) {\n if (this.hooks.onAttributeUpdate.taps.length) {\n this.hooks.onAttributeUpdate.call(graphic);\n }\n }\n onSetStage(graphic: IGraphic, stage: IStage): void {\n if (this.hooks.onSetStage.taps.length) {\n this.hooks.onSetStage.call(graphic, stage);\n }\n }\n onRemove(graphic: IGraphic<Partial<IGraphicAttribute>>): void {\n if (this.hooks.onRemove.taps.length) {\n this.hooks.onRemove.call(graphic);\n }\n }\n onRelease(graphic: IGraphic<Partial<IGraphicAttribute>>): void {\n if (this.hooks.onRelease.taps.length) {\n this.hooks.onRelease.call(graphic);\n }\n }\n onAddIncremental(graphic: IGraphic, group: IGroup, stage: IStage): void {\n if (this.hooks.onAddIncremental.taps.length) {\n this.hooks.onAddIncremental.call(graphic, group, stage);\n }\n }\n onClearIncremental(group: IGroup, stage: IStage): void {\n if (this.hooks.onClearIncremental.taps.length) {\n this.hooks.onClearIncremental.call(group, stage);\n }\n }\n beforeUpdateAABBBounds(graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) {\n if (this.hooks.beforeUpdateAABBBounds.taps.length) {\n this.hooks.beforeUpdateAABBBounds.call(graphic, stage, willUpdate, bounds);\n }\n }\n afterUpdateAABBBounds(\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) {\n if (this.hooks.afterUpdateAABBBounds.taps.length) {\n this.hooks.afterUpdateAABBBounds.call(graphic, stage, bounds, params, selfChange);\n }\n }\n clearAABBBounds(graphic: IGraphic, stage: IStage, b: IAABBBounds) {\n if (this.hooks.clearAABBBounds.taps.length) {\n this.hooks.clearAABBBounds.call(graphic, stage, b);\n }\n }\n // TODO delete\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds, graphic?: IGraphic): boolean {\n const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n updateHTMLTextAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IText\n ) {\n const { textAlign, textBaseline } = attribute;\n if (attribute.forceBoundsHeight != null) {\n const h = isNumber(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight();\n const dy = textLayoutOffsetY(textBaseline, h, h);\n aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);\n }\n if (attribute.forceBoundsWidth != null) {\n const w = isNumber(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth();\n const dx = textDrawOffsetX(textAlign, w);\n aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);\n }\n }\n\n combindShadowAABBBounds(bounds: IAABBBounds, graphic?: IGraphic) {\n // 合并shadowRoot的Bounds\n if (graphic && graphic.shadowRoot) {\n const b = graphic.shadowRoot.AABBBounds;\n bounds.union(b);\n }\n }\n\n transformAABBBounds(\n attribute: Partial<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n theme: Required<IGraphicAttribute>,\n miter: boolean,\n graphic?: IGraphic\n ) {\n if (!aabbBounds.empty()) {\n const {\n scaleX = theme.scaleX,\n scaleY = theme.scaleY,\n stroke = theme.stroke,\n shadowBlur = theme.shadowBlur,\n lineWidth = theme.lineWidth,\n pickStrokeBuffer = theme.pickStrokeBuffer,\n strokeBoundsBuffer = theme.strokeBoundsBuffer\n } = attribute;\n const tb1 = this.tempAABBBounds1;\n const tb2 = this.tempAABBBounds2;\n if (stroke && lineWidth) {\n const scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);\n boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n }\n if (shadowBlur) {\n const { shadowOffsetX = theme.shadowOffsetX, shadowOffsetY = theme.shadowOffsetY } = attribute;\n const shadowBlurWidth = (shadowBlur / Math.abs(scaleX + scaleY)) * 2;\n boundStroke(tb1, shadowBlurWidth, false, strokeBoundsBuffer + 1);\n tb1.translate(shadowOffsetX, shadowOffsetY);\n aabbBounds.union(tb1);\n // tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n }\n }\n\n // 合并shadowRoot的bounds\n this.combindShadowAABBBounds(aabbBounds, graphic);\n if (aabbBounds.empty()) {\n return;\n }\n\n // 性能优化逻辑,group类型变换较少,不需要矩阵变换\n let updateMatrix = true;\n const m = graphic.transMatrix;\n if (graphic && graphic.isContainer) {\n updateMatrix = !(m.a === 1 && m.b === 0 && m.c === 0 && m.d === 1 && m.e === 0 && m.f === 0);\n }\n updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);\n\n // TODO 加上锚点\n // transformBounds(aabbBounds, x, y, scaleX, scaleY, angle);\n // if (graphic.attribute.postMatrix) {\n // console.log('aaa');\n // transformBoundsWithMatrix(aabbBounds, graphic.attribute.postMatrix);\n // }\n // aabbBounds.translate(dx, dy);\n }\n\n validCheck(\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ): boolean {\n if (!graphic) {\n return true;\n }\n\n // 设置了强制wh,那就直接认为是合法的\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n return true;\n }\n\n // 是Group或者有影子节点的话,就直接认为是合法的\n if (graphic.shadowRoot || graphic.isContainer) {\n return true;\n }\n\n const { visible = theme.visible } = attribute;\n\n if (!(graphic.valid && visible)) {\n // application.graphicService.beforeUpdateAABBBounds(graphic, graphic.stage, true, aabbBounds);\n if (!aabbBounds.empty()) {\n graphic.parent && aabbBounds.transformWithMatrix((graphic.parent as IGroup).globalTransMatrix);\n application.graphicService.clearAABBBounds(graphic, graphic.stage, aabbBounds);\n aabbBounds.clear();\n }\n return false;\n }\n return true;\n }\n\n updateTempAABBBounds(aabbBounds: IAABBBounds) {\n const tb1 = this.tempAABBBounds1;\n const tb2 = this.tempAABBBounds2;\n tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);\n tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);\n\n return { tb1, tb2 };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic-service/graphic-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAiE;AAEjE,6CAAmF;AACnF,2CAAyC;AAczC,4CAAuE;AACvE,oCAAuC;AACvC,qEAA+D;AAE/D,gEAA4D;AAC5D,0EAAqE;AACrE,4CAA8C;AAC9C,gDAAsH;AAEtH,SAAgB,mBAAmB,CAAC,EAAU,EAAE,EAAU,EAAE,OAAiB;IAC3E,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;IAC1C,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,QAAQ,GA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GAAG,IAAI,CAAC,eAAe,CAAC;QACjC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QAEzE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACtB,CAAC;CACF,CAAA;AAvOY,qBAAqB;IADjC,IAAA,2BAAU,GAAE;IAiBE,WAAA,IAAA,uBAAM,EAAC,0BAAc,CAAC,CAAA;;GAhBxB,qBAAqB,CAuOjC;AAvOY,sDAAqB","file":"graphic-service.js","sourcesContent":["import { inject, injectable } from '../../common/inversify-lite';\nimport type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds, isNumber, transformBoundsWithMatrix } from '@visactor/vutils';\nimport { SyncHook } from '../../tapable';\nimport type {\n mat4,\n IGraphicAttribute,\n IGraphic,\n IGroup,\n IStage,\n IText,\n ITextGraphicAttribute,\n ITransform,\n IGraphicService,\n IGraphicCreator,\n ISyncHook\n} from '../../interface';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../../common/text';\nimport { boundStroke } from '../tools';\nimport { mat4Allocate } from '../../allocator/matrix-allocate';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { BoundsContext } from '../../common/bounds-context';\nimport { renderCommandList } from '../../common/render-command-list';\nimport { GraphicCreator } from '../constants';\nimport { identityMat4, multiplyMat4Mat4, rotateX, rotateY, rotateZ, scaleMat4, translate } from '../../common/matrix';\n\nexport function getExtraModelMatrix(dx: number, dy: number, graphic: IGraphic): mat4 | null {\n const { alpha, beta } = graphic.attribute;\n if (!alpha && !beta) {\n return null;\n }\n const { anchor3d = graphic.attribute.anchor } = graphic.attribute;\n\n const _anchor: [number, number] = [0, 0];\n if (anchor3d) {\n if (typeof anchor3d[0] === 'string') {\n const ratio = parseFloat(anchor3d[0]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor3d[0];\n }\n if (typeof anchor3d[1] === 'string') {\n const ratio = parseFloat(anchor3d[1]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[1] = anchor3d[1];\n }\n }\n\n if (graphic.type === 'text') {\n const { textAlign } = graphic.attribute as ITextGraphicAttribute;\n // 计算偏移\n _anchor[0] += textDrawOffsetX(textAlign, (graphic as IText).clipedWidth);\n }\n\n // 应用偏移,计算全局的偏移\n _anchor[0] += dx;\n _anchor[1] += dy;\n // matrix.scale(dpr, dpr);\n\n const modelMatrix = mat4Allocate.allocate();\n translate(modelMatrix, modelMatrix, [_anchor[0], _anchor[1], 0]);\n if (beta) {\n rotateX(modelMatrix, modelMatrix, beta);\n }\n if (alpha) {\n rotateY(modelMatrix, modelMatrix, alpha);\n }\n translate(modelMatrix, modelMatrix, [-_anchor[0], -_anchor[1], 0]);\n\n return modelMatrix;\n}\n\n// 计算3d下的模型矩阵\nexport function getModelMatrix(out: mat4, graphic: IGraphic, theme: ITransform) {\n const {\n x = theme.x,\n y = theme.y,\n z = theme.z,\n dx = theme.dx,\n dy = theme.dy,\n dz = theme.dz,\n scaleX = theme.scaleX,\n scaleY = theme.scaleY,\n scaleZ = theme.scaleZ,\n alpha = theme.alpha,\n beta = theme.beta,\n angle = theme.angle,\n anchor3d = graphic.attribute.anchor,\n anchor\n } = graphic.attribute;\n\n const _anchor: [number, number, number] = [0, 0, 0];\n if (anchor3d) {\n if (typeof anchor3d[0] === 'string') {\n const ratio = parseFloat(anchor3d[0]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor3d[0];\n }\n if (typeof anchor3d[1] === 'string') {\n const ratio = parseFloat(anchor3d[1]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[1] = anchor3d[1];\n }\n _anchor[2] = anchor3d[2] ?? 0;\n }\n\n // if (graphic.type === 'text') {\n // const { textAlign } = graphic.attribute as ITextGraphicAttribute;\n // // 计算偏移\n // _anchor[0] += textDrawOffsetX(textAlign, (graphic as IText).clipedWidth);\n // }\n\n identityMat4(out);\n // 平移\n translate(out, out, [x + dx, y + dy, z + dz]);\n translate(out, out, [_anchor[0], _anchor[1], _anchor[2]]);\n rotateX(out, out, beta);\n rotateY(out, out, alpha);\n // 基于z轴的偏移基于anchor计算\n // rotateZ(out, out, angle);\n translate(out, out, [-_anchor[0], -_anchor[1], _anchor[2]]);\n scaleMat4(out, out, [scaleX, scaleY, scaleZ]);\n\n // 计算基于z轴的偏移\n if (angle) {\n const m = mat4Allocate.allocate();\n const _anchor: [number, number] = [0, 0];\n if (anchor) {\n if (typeof anchor3d[0] === 'string') {\n const ratio = parseFloat(anchor3d[0]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor3d[0];\n }\n if (typeof anchor3d[1] === 'string') {\n const ratio = parseFloat(anchor3d[1]) / 100;\n const bounds = graphic.AABBBounds;\n _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[1] = anchor3d[1];\n }\n }\n\n translate(m, m, [_anchor[0], _anchor[1], 0]);\n // 基于z轴的偏移基于anchor计算\n rotateZ(m, m, angle);\n translate(m, m, [-_anchor[0], -_anchor[1], 0]);\n\n multiplyMat4Mat4(out, out, m);\n }\n}\n\nexport function shouldUseMat4(graphic: IGraphic) {\n const { alpha, beta } = graphic.attribute;\n return alpha || beta;\n}\n\n// 管理graphic\n@injectable()\nexport class DefaultGraphicService implements IGraphicService {\n declare hooks: {\n onAttributeUpdate: ISyncHook<[IGraphic]>;\n onSetStage: ISyncHook<[IGraphic, IStage]>;\n onRemove: ISyncHook<[IGraphic]>;\n onRelease: ISyncHook<[IGraphic]>;\n onAddIncremental: ISyncHook<[IGraphic, IGroup, IStage]>;\n onClearIncremental: ISyncHook<[IGroup, IStage]>;\n beforeUpdateAABBBounds: ISyncHook<[IGraphic, IStage, boolean, IAABBBounds]>;\n afterUpdateAABBBounds: ISyncHook<[IGraphic, IStage, IAABBBounds, { globalAABBBounds: IAABBBounds }, boolean]>;\n clearAABBBounds: ISyncHook<[IGraphic, IStage, IAABBBounds]>;\n };\n\n // 临时bounds,用作缓存\n protected tempAABBBounds1: AABBBounds;\n protected tempAABBBounds2: AABBBounds;\n constructor(@inject(GraphicCreator) public readonly creator: IGraphicCreator) {\n this.hooks = {\n onAttributeUpdate: new SyncHook<[IGraphic]>(['graphic']),\n onSetStage: new SyncHook<[IGraphic, IStage]>(['graphic', 'stage']),\n onRemove: new SyncHook<[IGraphic]>(['graphic']),\n onRelease: new SyncHook<[IGraphic]>(['graphic']),\n onAddIncremental: new SyncHook<[IGraphic, IGroup, IStage]>(['graphic', 'group', 'stage']),\n onClearIncremental: new SyncHook<[IGroup, IStage]>(['graphic', 'group', 'stage']),\n beforeUpdateAABBBounds: new SyncHook<[IGraphic, IStage, boolean, IAABBBounds]>([\n 'graphic',\n 'stage',\n 'willUpdate',\n 'aabbBounds'\n ]),\n afterUpdateAABBBounds: new SyncHook<[IGraphic, IStage, IAABBBounds, { globalAABBBounds: IAABBBounds }, boolean]>([\n 'graphic',\n 'stage',\n 'aabbBounds',\n 'globalAABBBounds',\n 'selfChange'\n ]),\n clearAABBBounds: new SyncHook<[IGraphic, IStage, IAABBBounds]>(['graphic', 'stage', 'aabbBounds'])\n };\n this.tempAABBBounds1 = new AABBBounds();\n this.tempAABBBounds2 = new AABBBounds();\n }\n onAttributeUpdate(graphic: IGraphic) {\n if (this.hooks.onAttributeUpdate.taps.length) {\n this.hooks.onAttributeUpdate.call(graphic);\n }\n }\n onSetStage(graphic: IGraphic, stage: IStage): void {\n if (this.hooks.onSetStage.taps.length) {\n this.hooks.onSetStage.call(graphic, stage);\n }\n }\n onRemove(graphic: IGraphic<Partial<IGraphicAttribute>>): void {\n if (this.hooks.onRemove.taps.length) {\n this.hooks.onRemove.call(graphic);\n }\n }\n onRelease(graphic: IGraphic<Partial<IGraphicAttribute>>): void {\n if (this.hooks.onRelease.taps.length) {\n this.hooks.onRelease.call(graphic);\n }\n }\n onAddIncremental(graphic: IGraphic, group: IGroup, stage: IStage): void {\n if (this.hooks.onAddIncremental.taps.length) {\n this.hooks.onAddIncremental.call(graphic, group, stage);\n }\n }\n onClearIncremental(group: IGroup, stage: IStage): void {\n if (this.hooks.onClearIncremental.taps.length) {\n this.hooks.onClearIncremental.call(group, stage);\n }\n }\n beforeUpdateAABBBounds(graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) {\n if (this.hooks.beforeUpdateAABBBounds.taps.length) {\n this.hooks.beforeUpdateAABBBounds.call(graphic, stage, willUpdate, bounds);\n }\n }\n afterUpdateAABBBounds(\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) {\n if (this.hooks.afterUpdateAABBBounds.taps.length) {\n this.hooks.afterUpdateAABBBounds.call(graphic, stage, bounds, params, selfChange);\n }\n }\n clearAABBBounds(graphic: IGraphic, stage: IStage, b: IAABBBounds) {\n if (this.hooks.clearAABBBounds.taps.length) {\n this.hooks.clearAABBBounds.call(graphic, stage, b);\n }\n }\n // TODO delete\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds, graphic?: IGraphic): boolean {\n const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n updateHTMLTextAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IText\n ) {\n const { textAlign, textBaseline } = attribute;\n if (attribute.forceBoundsHeight != null) {\n const h = isNumber(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight();\n const dy = textLayoutOffsetY(textBaseline, h, h);\n aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);\n }\n if (attribute.forceBoundsWidth != null) {\n const w = isNumber(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth();\n const dx = textDrawOffsetX(textAlign, w);\n aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);\n }\n }\n\n combindShadowAABBBounds(bounds: IAABBBounds, graphic?: IGraphic) {\n // 合并shadowRoot的Bounds\n if (graphic && graphic.shadowRoot) {\n const b = graphic.shadowRoot.AABBBounds;\n bounds.union(b);\n }\n }\n\n transformAABBBounds(\n attribute: Partial<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n theme: Required<IGraphicAttribute>,\n miter: boolean,\n graphic?: IGraphic\n ) {\n if (!aabbBounds.empty()) {\n const {\n scaleX = theme.scaleX,\n scaleY = theme.scaleY,\n stroke = theme.stroke,\n shadowBlur = theme.shadowBlur,\n lineWidth = theme.lineWidth,\n pickStrokeBuffer = theme.pickStrokeBuffer,\n strokeBoundsBuffer = theme.strokeBoundsBuffer\n } = attribute;\n const tb1 = this.tempAABBBounds1;\n const tb2 = this.tempAABBBounds2;\n if (stroke && lineWidth) {\n const scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);\n boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n }\n if (shadowBlur) {\n const { shadowOffsetX = theme.shadowOffsetX, shadowOffsetY = theme.shadowOffsetY } = attribute;\n const shadowBlurWidth = (shadowBlur / Math.abs(scaleX + scaleY)) * 2;\n boundStroke(tb1, shadowBlurWidth, false, strokeBoundsBuffer + 1);\n tb1.translate(shadowOffsetX, shadowOffsetY);\n aabbBounds.union(tb1);\n // tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n }\n }\n\n // 合并shadowRoot的bounds\n this.combindShadowAABBBounds(aabbBounds, graphic);\n if (aabbBounds.empty()) {\n return;\n }\n\n // 性能优化逻辑,group类型变换较少,不需要矩阵变换\n let updateMatrix = true;\n const m = graphic.transMatrix;\n if (graphic && graphic.isContainer) {\n updateMatrix = !(m.a === 1 && m.b === 0 && m.c === 0 && m.d === 1 && m.e === 0 && m.f === 0);\n }\n updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);\n\n // TODO 加上锚点\n // transformBounds(aabbBounds, x, y, scaleX, scaleY, angle);\n // if (graphic.attribute.postMatrix) {\n // console.log('aaa');\n // transformBoundsWithMatrix(aabbBounds, graphic.attribute.postMatrix);\n // }\n // aabbBounds.translate(dx, dy);\n }\n\n validCheck(\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ): boolean {\n if (!graphic) {\n return true;\n }\n\n // 设置了强制wh,那就直接认为是合法的\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n return true;\n }\n\n // 是Group或者有影子节点的话,就直接认为是合法的\n if (graphic.shadowRoot || graphic.isContainer) {\n return true;\n }\n\n const { visible = theme.visible } = attribute;\n\n if (!(graphic.valid && visible)) {\n // application.graphicService.beforeUpdateAABBBounds(graphic, graphic.stage, true, aabbBounds);\n if (!aabbBounds.empty()) {\n graphic.parent && aabbBounds.transformWithMatrix((graphic.parent as IGroup).globalTransMatrix);\n this.clearAABBBounds(graphic, graphic.stage, aabbBounds);\n aabbBounds.clear();\n }\n return false;\n }\n return true;\n }\n\n updateTempAABBBounds(aabbBounds: IAABBBounds) {\n const tb1 = this.tempAABBBounds1;\n const tb2 = this.tempAABBBounds2;\n tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);\n tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);\n\n return { tb1, tb2 };\n }\n}\n"]}
@@ -93,6 +93,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
93
93
  protected updateOBBBoundsStamp?: number;
94
94
  clipPathMap?: Map<string, ISymbolClass>;
95
95
  constructor(params?: T);
96
+ getGraphicService(): import("../interface").IGraphicService;
96
97
  getAttributes(): T;
97
98
  setMode(mode: '2d' | '3d'): void;
98
99
  set3dMode(): void;
@@ -71,6 +71,10 @@ class Graphic extends node_tree_1.Node {
71
71
  this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0,
72
72
  params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
73
73
  }
74
+ getGraphicService() {
75
+ var _a, _b;
76
+ return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : application_1.application.graphicService;
77
+ }
74
78
  getAttributes() {
75
79
  return this.attribute;
76
80
  }
@@ -96,13 +100,12 @@ class Graphic extends node_tree_1.Node {
96
100
  this._emitCustomEvent("animate-bind", animate);
97
101
  }
98
102
  tryUpdateAABBBounds() {
99
- var _a, _b;
100
103
  const full = "imprecise" === this.attribute.boundsMode;
101
104
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
102
105
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
103
- null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
106
+ this.getGraphicService().beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
104
107
  const bounds = this.doUpdateAABBBounds(full);
105
- return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
108
+ return this.getGraphicService().afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
106
109
  "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
107
110
  }
108
111
  tryUpdateOBBBounds() {
@@ -202,7 +205,7 @@ class Graphic extends node_tree_1.Node {
202
205
  clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
203
206
  }
204
207
  shouldUpdateAABBBounds() {
205
- return this.shadowRoot ? (!!(this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) && application_1.application.graphicService.validCheck(this.attribute, this.getGraphicTheme(), this._AABBBounds, this) : !!(this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS) && application_1.application.graphicService.validCheck(this.attribute, this.getGraphicTheme(), this._AABBBounds, this);
208
+ return this.shadowRoot ? (!!(this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) && this.getGraphicService().validCheck(this.attribute, this.getGraphicTheme(), this._AABBBounds, this) : !!(this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS) && this.getGraphicService().validCheck(this.attribute, this.getGraphicTheme(), this._AABBBounds, this);
206
209
  }
207
210
  shouldSelfChangeUpdateAABBBounds() {
208
211
  return this.shadowRoot ? !!(this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds() : !!(this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS);
@@ -387,8 +390,7 @@ class Graphic extends node_tree_1.Node {
387
390
  return this;
388
391
  }
389
392
  onAttributeUpdate(context) {
390
- var _a;
391
- context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this),
393
+ context && context.skipUpdateCallback || (this.getGraphicService().onAttributeUpdate(this),
392
394
  this._emitCustomEvent("afterAttributeUpdate", context));
393
395
  }
394
396
  update(d) {
@@ -566,7 +568,6 @@ class Graphic extends node_tree_1.Node {
566
568
  }
567
569
  }
568
570
  setStage(stage, layer) {
569
- var _a;
570
571
  if (this.stage !== stage) {
571
572
  if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
572
573
  this.animates && this.animates.size) {
@@ -575,7 +576,7 @@ class Graphic extends node_tree_1.Node {
575
576
  a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
576
577
  }));
577
578
  }
578
- this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
579
+ this._onSetStage && this._onSetStage(this, stage, layer), this.getGraphicService().onSetStage(this, stage);
579
580
  }
580
581
  }
581
582
  setStageToShadowRoot(stage, layer) {