@anov/3d-ability 0.0.142 → 0.0.144
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/business/Animation/motion/index.js +56 -35
- package/dist/business/Animation/motion/index.js.map +1 -1
- package/dist/business/Animation/type.js +2 -2
- package/dist/business/Area/Fence/FenceBase.js +187 -146
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +112 -120
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +130 -218
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +130 -140
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +126 -87
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +98 -72
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +94 -66
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +483 -267
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +26 -14
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +46 -21
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +234 -189
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +81 -52
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +79 -51
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +9 -1
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +21 -7
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +162 -96
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +291 -208
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +22 -8
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +467 -380
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +525 -405
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +3 -69
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +242 -201
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +88 -55
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +176 -145
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +294 -196
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +3 -36
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +551 -377
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +58 -92
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +2 -74
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +16 -95
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +3 -9
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +9 -48
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +78 -51
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.js +336 -248
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +89 -56
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +165 -104
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/link/index.js +114 -54
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.js +373 -315
- package/dist/business/Poi/panel/index.js.map +1 -1
- package/dist/business/Poi/panel/utils.js +10 -5
- package/dist/business/Poi/panel/utils.js.map +1 -1
- package/dist/business/Poi/particle/DoubleCircle.js +107 -71
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +111 -75
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +98 -62
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +117 -49
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +3 -31
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +3 -37
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +3 -55
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +3 -67
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +27 -7
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +27 -7
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +292 -208
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +17 -18
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Sphere/index.js +72 -47
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +245 -190
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +536 -327
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +275 -218
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +177 -132
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +1 -51
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +1 -6
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +55 -32
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.js +24 -25
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +56 -40
- package/dist/business/Utils/Curve.js.map +1 -1
- package/dist/business/Utils/constant.js +1 -1
- package/dist/business/Utils/constant.js.map +1 -1
- package/dist/business/Utils/defineProps.js +14 -13
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +153 -127
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +319 -258
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +108 -78
- package/dist/business/Water/index.js.map +1 -1
- package/dist/business/Water/types.js +1 -1
- package/dist/business/Water/types.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +449 -383
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +142 -107
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +96 -84
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +98 -77
- package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/index.js +28 -19
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +155 -126
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +63 -47
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +49 -39
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +91 -66
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +30 -14
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +131 -92
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +47 -22
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +21 -4
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +57 -37
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +153 -116
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +1 -95
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +1 -26
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +172 -76
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +11 -6
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +12 -16
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +13 -17
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +10 -17
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +43 -60
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +13 -17
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +22 -28
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +50 -37
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +12 -14
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +10 -15
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +3 -22
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +3 -27
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +3 -66
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +3 -28
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +101 -85
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +77 -60
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +81 -64
- package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
- package/dist/core/SceneEffect/grow/type.js +2 -2
- package/dist/core/SceneEffect/grow/type.js.map +1 -1
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js +76 -51
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +105 -69
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +124 -77
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +80 -52
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +84 -72
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +118 -88
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +146 -116
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +148 -100
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +104 -71
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +84 -66
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +45 -25
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +3 -74
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +3 -103
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +7 -206
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +3 -87
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +135 -104
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +38 -44
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +25 -18
- package/dist/core/WeatherSystem/utils/math.js.map +1 -1
- package/dist/core/WeatherSystem/utils/type.js +1 -1
- package/dist/core/WeatherSystem/utils/type.js.map +1 -1
- package/dist/core/WeatherSystem/weather/index.js +141 -96
- package/dist/core/WeatherSystem/weather/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,58 +1,136 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
3
20
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
5
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
6
24
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
7
25
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
26
|
import _ from 'lodash';
|
|
9
27
|
import { Group, Vector3 } from '@anov/3d-core';
|
|
10
28
|
import ObjectLayer from "../Base/ObjectLayer";
|
|
11
|
-
|
|
29
|
+
var FenceStrategy = {
|
|
12
30
|
base: function () {
|
|
13
|
-
var
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
var _base = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
_context.next = 2;
|
|
36
|
+
return import("./Fence/fence_base_01");
|
|
37
|
+
case 2:
|
|
38
|
+
return _context.abrupt("return", _context.sent.default);
|
|
39
|
+
case 3:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}, _callee);
|
|
44
|
+
}));
|
|
45
|
+
function base() {
|
|
46
|
+
return _base.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
return base;
|
|
19
49
|
}(),
|
|
20
50
|
feeting: function () {
|
|
21
|
-
var
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
51
|
+
var _feeting = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
52
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
53
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
_context2.next = 2;
|
|
56
|
+
return import("./Fence/fence_feeting_01");
|
|
57
|
+
case 2:
|
|
58
|
+
return _context2.abrupt("return", _context2.sent.default);
|
|
59
|
+
case 3:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context2.stop();
|
|
62
|
+
}
|
|
63
|
+
}, _callee2);
|
|
64
|
+
}));
|
|
65
|
+
function feeting() {
|
|
66
|
+
return _feeting.apply(this, arguments);
|
|
67
|
+
}
|
|
68
|
+
return feeting;
|
|
27
69
|
}(),
|
|
28
70
|
roll: function () {
|
|
29
|
-
var
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
71
|
+
var _roll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
72
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
73
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
_context3.next = 2;
|
|
76
|
+
return import("./Fence/fence_roll_01");
|
|
77
|
+
case 2:
|
|
78
|
+
return _context3.abrupt("return", _context3.sent.default);
|
|
79
|
+
case 3:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context3.stop();
|
|
82
|
+
}
|
|
83
|
+
}, _callee3);
|
|
84
|
+
}));
|
|
85
|
+
function roll() {
|
|
86
|
+
return _roll.apply(this, arguments);
|
|
87
|
+
}
|
|
88
|
+
return roll;
|
|
35
89
|
}()
|
|
36
90
|
};
|
|
37
|
-
|
|
91
|
+
var FillAreaStrategy = {
|
|
38
92
|
line: function () {
|
|
39
|
-
var
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
93
|
+
var _line = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
94
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
95
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
96
|
+
case 0:
|
|
97
|
+
_context4.next = 2;
|
|
98
|
+
return import("./FillArea/fillArea_line_01");
|
|
99
|
+
case 2:
|
|
100
|
+
return _context4.abrupt("return", _context4.sent.default);
|
|
101
|
+
case 3:
|
|
102
|
+
case "end":
|
|
103
|
+
return _context4.stop();
|
|
104
|
+
}
|
|
105
|
+
}, _callee4);
|
|
106
|
+
}));
|
|
107
|
+
function line() {
|
|
108
|
+
return _line.apply(this, arguments);
|
|
109
|
+
}
|
|
110
|
+
return line;
|
|
45
111
|
}(),
|
|
46
112
|
face: function () {
|
|
47
|
-
var
|
|
48
|
-
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
113
|
+
var _face = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
114
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
115
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
116
|
+
case 0:
|
|
117
|
+
_context5.next = 2;
|
|
118
|
+
return import("./FillArea/fillArea_face_01");
|
|
119
|
+
case 2:
|
|
120
|
+
return _context5.abrupt("return", _context5.sent.default);
|
|
121
|
+
case 3:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context5.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee5);
|
|
126
|
+
}));
|
|
127
|
+
function face() {
|
|
128
|
+
return _face.apply(this, arguments);
|
|
129
|
+
}
|
|
130
|
+
return face;
|
|
53
131
|
}()
|
|
54
132
|
};
|
|
55
|
-
|
|
133
|
+
var DEFAULT_OPTION = {
|
|
56
134
|
style: 'area_base_01',
|
|
57
135
|
fence: {
|
|
58
136
|
uri: 'base',
|
|
@@ -86,251 +164,389 @@ const DEFAULT_OPTION = {
|
|
|
86
164
|
close: true // 默认闭合
|
|
87
165
|
}
|
|
88
166
|
};
|
|
89
|
-
|
|
167
|
+
var STYLE_DATA = {
|
|
90
168
|
area_base_01: ['base', ''],
|
|
91
169
|
area_feeting_01: ['feeting', ''],
|
|
92
170
|
area_roll_01: ['roll', '']
|
|
93
171
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
_defineProperty(
|
|
102
|
-
_defineProperty(
|
|
103
|
-
_defineProperty(
|
|
104
|
-
_defineProperty(
|
|
105
|
-
_defineProperty(
|
|
106
|
-
_defineProperty(
|
|
107
|
-
_defineProperty(
|
|
108
|
-
_defineProperty(
|
|
109
|
-
_defineProperty(
|
|
110
|
-
_defineProperty(
|
|
111
|
-
_defineProperty(
|
|
112
|
-
_defineProperty(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return this._style;
|
|
122
|
-
}
|
|
123
|
-
get fence() {
|
|
124
|
-
// return this._fenceProxy
|
|
125
|
-
return this._fence;
|
|
126
|
-
}
|
|
127
|
-
get fillArea() {
|
|
128
|
-
return this._fillArea;
|
|
129
|
-
}
|
|
130
|
-
get surfaceSnap() {
|
|
131
|
-
return this._surfaceSnap;
|
|
132
|
-
}
|
|
133
|
-
set surfaceSnap(value) {
|
|
134
|
-
if (this._surfaceSnap === value) return;
|
|
135
|
-
this._surfaceSnap = value;
|
|
136
|
-
}
|
|
137
|
-
get posType() {
|
|
138
|
-
return this._posType;
|
|
139
|
-
}
|
|
140
|
-
set posType(value) {
|
|
141
|
-
if (this._posType === value) return;
|
|
142
|
-
this._posType = value;
|
|
143
|
-
}
|
|
144
|
-
get coordZType() {
|
|
145
|
-
return this._coordZType;
|
|
146
|
-
}
|
|
147
|
-
set coordZType(value) {
|
|
148
|
-
if (this._coordZType === value) return;
|
|
149
|
-
this._coordZType = value;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// 设置 path 时,返回代理对象
|
|
153
|
-
set path(value) {
|
|
154
|
-
if (this._path === value) return;
|
|
155
|
-
this._arrangePathParam(value);
|
|
156
|
-
this._resetFence();
|
|
157
|
-
this._resetFillArea();
|
|
172
|
+
var Area = /*#__PURE__*/function (_ObjectLayer) {
|
|
173
|
+
_inherits(Area, _ObjectLayer);
|
|
174
|
+
var _super = _createSuper(Area);
|
|
175
|
+
function Area(option) {
|
|
176
|
+
var _this;
|
|
177
|
+
_classCallCheck(this, Area);
|
|
178
|
+
_this = _super.call(this);
|
|
179
|
+
_defineProperty(_assertThisInitialized(_this), "_mesh", void 0);
|
|
180
|
+
_defineProperty(_assertThisInitialized(_this), "_option", void 0);
|
|
181
|
+
_defineProperty(_assertThisInitialized(_this), "_fenceMesh", void 0);
|
|
182
|
+
_defineProperty(_assertThisInitialized(_this), "_fillAreaMesh", void 0);
|
|
183
|
+
_defineProperty(_assertThisInitialized(_this), "_style", void 0);
|
|
184
|
+
_defineProperty(_assertThisInitialized(_this), "_surfaceSnap", void 0);
|
|
185
|
+
_defineProperty(_assertThisInitialized(_this), "_posType", void 0);
|
|
186
|
+
_defineProperty(_assertThisInitialized(_this), "_coordZType", void 0);
|
|
187
|
+
_defineProperty(_assertThisInitialized(_this), "_fence", void 0);
|
|
188
|
+
_defineProperty(_assertThisInitialized(_this), "_fenceProxy", void 0);
|
|
189
|
+
_defineProperty(_assertThisInitialized(_this), "_fillArea", void 0);
|
|
190
|
+
_defineProperty(_assertThisInitialized(_this), "_path", void 0);
|
|
191
|
+
_defineProperty(_assertThisInitialized(_this), "_pathProxy", void 0);
|
|
192
|
+
_defineProperty(_assertThisInitialized(_this), "_points", void 0);
|
|
193
|
+
_defineProperty(_assertThisInitialized(_this), "_corner", void 0);
|
|
194
|
+
_defineProperty(_assertThisInitialized(_this), "_close", void 0);
|
|
195
|
+
_this._initParam(option);
|
|
196
|
+
_this._arrangePathParam(_this._path);
|
|
197
|
+
_this._initializeMesh();
|
|
198
|
+
return _this;
|
|
158
199
|
}
|
|
200
|
+
_createClass(Area, [{
|
|
201
|
+
key: "mesh",
|
|
202
|
+
get: function get() {
|
|
203
|
+
return this._mesh;
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "style",
|
|
207
|
+
get: function get() {
|
|
208
|
+
return this._style;
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "fence",
|
|
212
|
+
get: function get() {
|
|
213
|
+
// return this._fenceProxy
|
|
214
|
+
return this._fence;
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "fillArea",
|
|
218
|
+
get: function get() {
|
|
219
|
+
return this._fillArea;
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "surfaceSnap",
|
|
223
|
+
get: function get() {
|
|
224
|
+
return this._surfaceSnap;
|
|
225
|
+
},
|
|
226
|
+
set: function set(value) {
|
|
227
|
+
if (this._surfaceSnap === value) return;
|
|
228
|
+
this._surfaceSnap = value;
|
|
229
|
+
}
|
|
230
|
+
}, {
|
|
231
|
+
key: "posType",
|
|
232
|
+
get: function get() {
|
|
233
|
+
return this._posType;
|
|
234
|
+
},
|
|
235
|
+
set: function set(value) {
|
|
236
|
+
if (this._posType === value) return;
|
|
237
|
+
this._posType = value;
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "coordZType",
|
|
241
|
+
get: function get() {
|
|
242
|
+
return this._coordZType;
|
|
243
|
+
},
|
|
244
|
+
set: function set(value) {
|
|
245
|
+
if (this._coordZType === value) return;
|
|
246
|
+
this._coordZType = value;
|
|
247
|
+
}
|
|
159
248
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
249
|
+
// 设置 path 时,返回代理对象
|
|
250
|
+
}, {
|
|
251
|
+
key: "path",
|
|
252
|
+
get:
|
|
253
|
+
// 获取 path 时,返回代理对象
|
|
254
|
+
function get() {
|
|
255
|
+
return this._pathProxy; // 返回代理对象
|
|
256
|
+
}
|
|
164
257
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
fence,
|
|
173
|
-
fillArea
|
|
174
|
-
} = this._option;
|
|
175
|
-
this._fence = fence;
|
|
176
|
-
this._fillArea = fillArea;
|
|
177
|
-
this._style = this._option.style;
|
|
178
|
-
this._path = this._option.path;
|
|
179
|
-
this._surfaceSnap = this._option.surfaceSnap;
|
|
180
|
-
this._posType = this._option.posType;
|
|
181
|
-
this._coordZType = this._option.coordZType;
|
|
182
|
-
this._createPathProxy();
|
|
183
|
-
this._mesh = new Group();
|
|
184
|
-
this.add(this._mesh);
|
|
185
|
-
// this._createFenceProxy()
|
|
186
|
-
}
|
|
187
|
-
_arrangePathParam(value) {
|
|
188
|
-
// 确保 value 符合预期结构
|
|
189
|
-
if (value && Array.isArray(value.points) && value.points.length >= 3) {
|
|
190
|
-
const {
|
|
191
|
-
points,
|
|
192
|
-
corner,
|
|
193
|
-
close
|
|
194
|
-
} = value;
|
|
195
|
-
this._path = value; // 更新 _path
|
|
196
|
-
this._points = points.map(v => new Vector3(v.position[0], v.position[1], v.position[2])); // 使用 points 创建 Vector3 对象
|
|
197
|
-
this._corner = corner; // 更新圆角
|
|
198
|
-
this._close = close; // 更新闭合状态
|
|
199
|
-
} else {
|
|
200
|
-
console.error('Invalid path data: Ensure points has at least 3 elements');
|
|
258
|
+
// 销毁
|
|
259
|
+
,
|
|
260
|
+
set: function set(value) {
|
|
261
|
+
if (this._path === value) return;
|
|
262
|
+
this._arrangePathParam(value);
|
|
263
|
+
this._resetFence();
|
|
264
|
+
this._resetFillArea();
|
|
201
265
|
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
266
|
+
}, {
|
|
267
|
+
key: "dispose",
|
|
268
|
+
value: function dispose() {
|
|
269
|
+
this.remove(this._mesh);
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
key: "_initParam",
|
|
273
|
+
value: function _initParam(option) {
|
|
274
|
+
this._option = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option, this._arrayMergeCustomizer);
|
|
275
|
+
var _this$_option = this._option,
|
|
276
|
+
fence = _this$_option.fence,
|
|
277
|
+
fillArea = _this$_option.fillArea;
|
|
278
|
+
this._fence = fence;
|
|
279
|
+
this._fillArea = fillArea;
|
|
280
|
+
this._style = this._option.style;
|
|
281
|
+
this._path = this._option.path;
|
|
282
|
+
this._surfaceSnap = this._option.surfaceSnap;
|
|
283
|
+
this._posType = this._option.posType;
|
|
284
|
+
this._coordZType = this._option.coordZType;
|
|
285
|
+
this._createPathProxy();
|
|
286
|
+
this._mesh = new Group();
|
|
287
|
+
this.add(this._mesh);
|
|
288
|
+
// this._createFenceProxy()
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: "_arrangePathParam",
|
|
292
|
+
value: function _arrangePathParam(value) {
|
|
293
|
+
// 确保 value 符合预期结构
|
|
294
|
+
if (value && Array.isArray(value.points) && value.points.length >= 3) {
|
|
295
|
+
var points = value.points,
|
|
296
|
+
corner = value.corner,
|
|
297
|
+
close = value.close;
|
|
298
|
+
this._path = value; // 更新 _path
|
|
299
|
+
this._points = points.map(function (v) {
|
|
300
|
+
return new Vector3(v.position[0], v.position[1], v.position[2]);
|
|
301
|
+
}); // 使用 points 创建 Vector3 对象
|
|
302
|
+
this._corner = corner; // 更新圆角
|
|
303
|
+
this._close = close; // 更新闭合状态
|
|
304
|
+
} else {
|
|
305
|
+
console.error('Invalid path data: Ensure points has at least 3 elements');
|
|
220
306
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
_this
|
|
307
|
+
}
|
|
308
|
+
}, {
|
|
309
|
+
key: "_initializeMesh",
|
|
310
|
+
value: function () {
|
|
311
|
+
var _initializeMesh2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
312
|
+
var _this$_option2, fence, fillArea, _this$_getCurrentStyl, currentFenceStyle, currentFillAreaStyle;
|
|
313
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
314
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
315
|
+
case 0:
|
|
316
|
+
_this$_option2 = this._option, fence = _this$_option2.fence, fillArea = _this$_option2.fillArea;
|
|
317
|
+
_this$_getCurrentStyl = this._getCurrentStyle(), currentFenceStyle = _this$_getCurrentStyl.currentFenceStyle, currentFillAreaStyle = _this$_getCurrentStyl.currentFillAreaStyle;
|
|
318
|
+
if (!currentFenceStyle) {
|
|
319
|
+
_context6.next = 10;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
_context6.next = 5;
|
|
323
|
+
return this._createFence(currentFenceStyle);
|
|
324
|
+
case 5:
|
|
325
|
+
this._fenceMesh = _context6.sent;
|
|
326
|
+
this._fenceMesh.visible = fence.visible;
|
|
327
|
+
this._fenceMesh.addReloadListener(this._resetFence);
|
|
328
|
+
this._mesh.add(this._fenceMesh);
|
|
329
|
+
this._fence = this.createProxy(this._fence, this._fenceMesh);
|
|
330
|
+
case 10:
|
|
331
|
+
if (!currentFillAreaStyle) {
|
|
332
|
+
_context6.next = 18;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
_context6.next = 13;
|
|
336
|
+
return this._createFillArea(currentFillAreaStyle);
|
|
337
|
+
case 13:
|
|
338
|
+
this._fillAreaMesh = _context6.sent;
|
|
339
|
+
this._fillAreaMesh.visible = fillArea.visible;
|
|
340
|
+
this._fillAreaMesh.addReloadListener(this._resetFillArea);
|
|
341
|
+
this._mesh.add(this._fillAreaMesh);
|
|
342
|
+
this._fillArea = this.createProxy(this._fillArea, this._fillAreaMesh);
|
|
343
|
+
case 18:
|
|
344
|
+
case "end":
|
|
345
|
+
return _context6.stop();
|
|
346
|
+
}
|
|
347
|
+
}, _callee6, this);
|
|
348
|
+
}));
|
|
349
|
+
function _initializeMesh() {
|
|
350
|
+
return _initializeMesh2.apply(this, arguments);
|
|
227
351
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
_resetFence() {
|
|
258
|
-
var _this3 = this;
|
|
259
|
-
return _asyncToGenerator(function* () {
|
|
260
|
-
if (_this3._fenceMesh) {
|
|
261
|
-
_this3._mesh.remove(_this3._fenceMesh);
|
|
262
|
-
const {
|
|
263
|
-
currentFenceStyle
|
|
264
|
-
} = _this3._getCurrentStyle();
|
|
265
|
-
_this3._fenceMesh = yield _this3._createFence(currentFenceStyle);
|
|
266
|
-
_this3._mesh.add(_this3._fenceMesh);
|
|
267
|
-
_this3._fence = _this3.createProxy(_this3._fence, _this3._fenceMesh);
|
|
352
|
+
return _initializeMesh;
|
|
353
|
+
}() // 注册样式
|
|
354
|
+
}, {
|
|
355
|
+
key: "_registerStrategy",
|
|
356
|
+
value: function () {
|
|
357
|
+
var _registerStrategy2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(style, StrategyManage) {
|
|
358
|
+
var strategyClass;
|
|
359
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
360
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
361
|
+
case 0:
|
|
362
|
+
strategyClass = StrategyManage[style];
|
|
363
|
+
if (!strategyClass) {
|
|
364
|
+
_context7.next = 7;
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
_context7.next = 4;
|
|
368
|
+
return strategyClass();
|
|
369
|
+
case 4:
|
|
370
|
+
return _context7.abrupt("return", _context7.sent);
|
|
371
|
+
case 7:
|
|
372
|
+
throw new Error("Style ".concat(style, " not found"));
|
|
373
|
+
case 8:
|
|
374
|
+
case "end":
|
|
375
|
+
return _context7.stop();
|
|
376
|
+
}
|
|
377
|
+
}, _callee7);
|
|
378
|
+
}));
|
|
379
|
+
function _registerStrategy(_x, _x2) {
|
|
380
|
+
return _registerStrategy2.apply(this, arguments);
|
|
268
381
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
} = _this5._getCurrentStyle();
|
|
299
|
-
_this5._fillAreaMesh = yield _this5._createFillArea(currentFillAreaStyle);
|
|
300
|
-
_this5._mesh.add(_this5._fillAreaMesh);
|
|
301
|
-
_this5._fillArea = _this5.createProxy(_this5._fillArea, _this5._fillAreaMesh);
|
|
382
|
+
return _registerStrategy;
|
|
383
|
+
}() // 创建围栏
|
|
384
|
+
}, {
|
|
385
|
+
key: "_createFence",
|
|
386
|
+
value: function () {
|
|
387
|
+
var _createFence2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(style) {
|
|
388
|
+
var fence, Strategy, option;
|
|
389
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
390
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
391
|
+
case 0:
|
|
392
|
+
fence = this._option.fence;
|
|
393
|
+
_context8.next = 3;
|
|
394
|
+
return this._registerStrategy(style, FenceStrategy);
|
|
395
|
+
case 3:
|
|
396
|
+
Strategy = _context8.sent;
|
|
397
|
+
option = _objectSpread({
|
|
398
|
+
points: this._points,
|
|
399
|
+
corner: this._corner,
|
|
400
|
+
close: this._close
|
|
401
|
+
}, fence);
|
|
402
|
+
return _context8.abrupt("return", new Strategy(option, this));
|
|
403
|
+
case 6:
|
|
404
|
+
case "end":
|
|
405
|
+
return _context8.stop();
|
|
406
|
+
}
|
|
407
|
+
}, _callee8, this);
|
|
408
|
+
}));
|
|
409
|
+
function _createFence(_x3) {
|
|
410
|
+
return _createFence2.apply(this, arguments);
|
|
302
411
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
412
|
+
return _createFence;
|
|
413
|
+
}()
|
|
414
|
+
}, {
|
|
415
|
+
key: "_resetFence",
|
|
416
|
+
value: function () {
|
|
417
|
+
var _resetFence2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
418
|
+
var _this$_getCurrentStyl2, currentFenceStyle;
|
|
419
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
420
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
421
|
+
case 0:
|
|
422
|
+
if (!this._fenceMesh) {
|
|
423
|
+
_context9.next = 8;
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
this._mesh.remove(this._fenceMesh);
|
|
427
|
+
_this$_getCurrentStyl2 = this._getCurrentStyle(), currentFenceStyle = _this$_getCurrentStyl2.currentFenceStyle;
|
|
428
|
+
_context9.next = 5;
|
|
429
|
+
return this._createFence(currentFenceStyle);
|
|
430
|
+
case 5:
|
|
431
|
+
this._fenceMesh = _context9.sent;
|
|
432
|
+
this._mesh.add(this._fenceMesh);
|
|
433
|
+
this._fence = this.createProxy(this._fence, this._fenceMesh);
|
|
434
|
+
case 8:
|
|
435
|
+
case "end":
|
|
436
|
+
return _context9.stop();
|
|
437
|
+
}
|
|
438
|
+
}, _callee9, this);
|
|
439
|
+
}));
|
|
440
|
+
function _resetFence() {
|
|
441
|
+
return _resetFence2.apply(this, arguments);
|
|
314
442
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
443
|
+
return _resetFence;
|
|
444
|
+
}() // 创建封底
|
|
445
|
+
}, {
|
|
446
|
+
key: "_createFillArea",
|
|
447
|
+
value: function () {
|
|
448
|
+
var _createFillArea2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(style) {
|
|
449
|
+
var _this$_option3, fillArea, fence, Strategy, option, mesh;
|
|
450
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
451
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
452
|
+
case 0:
|
|
453
|
+
_this$_option3 = this._option, fillArea = _this$_option3.fillArea, fence = _this$_option3.fence;
|
|
454
|
+
_context10.next = 3;
|
|
455
|
+
return this._registerStrategy(style, FillAreaStrategy);
|
|
456
|
+
case 3:
|
|
457
|
+
Strategy = _context10.sent;
|
|
458
|
+
option = _objectSpread({
|
|
459
|
+
points: this._points,
|
|
460
|
+
corner: this._corner,
|
|
461
|
+
close: this._close
|
|
462
|
+
}, fillArea);
|
|
463
|
+
mesh = new Strategy(option, this);
|
|
464
|
+
mesh.position.y = fillArea.pos === 'bottom' ? 0 : fence.height;
|
|
465
|
+
return _context10.abrupt("return", mesh);
|
|
466
|
+
case 8:
|
|
467
|
+
case "end":
|
|
468
|
+
return _context10.stop();
|
|
469
|
+
}
|
|
470
|
+
}, _callee10, this);
|
|
471
|
+
}));
|
|
472
|
+
function _createFillArea(_x4) {
|
|
473
|
+
return _createFillArea2.apply(this, arguments);
|
|
474
|
+
}
|
|
475
|
+
return _createFillArea;
|
|
476
|
+
}()
|
|
477
|
+
}, {
|
|
478
|
+
key: "_resetFillArea",
|
|
479
|
+
value: function () {
|
|
480
|
+
var _resetFillArea2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
481
|
+
var _this$_getCurrentStyl3, currentFillAreaStyle;
|
|
482
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
483
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
484
|
+
case 0:
|
|
485
|
+
if (!this._fillAreaMesh) {
|
|
486
|
+
_context11.next = 8;
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
this._mesh.remove(this._fillAreaMesh);
|
|
490
|
+
_this$_getCurrentStyl3 = this._getCurrentStyle(), currentFillAreaStyle = _this$_getCurrentStyl3.currentFillAreaStyle;
|
|
491
|
+
_context11.next = 5;
|
|
492
|
+
return this._createFillArea(currentFillAreaStyle);
|
|
493
|
+
case 5:
|
|
494
|
+
this._fillAreaMesh = _context11.sent;
|
|
495
|
+
this._mesh.add(this._fillAreaMesh);
|
|
496
|
+
this._fillArea = this.createProxy(this._fillArea, this._fillAreaMesh);
|
|
497
|
+
case 8:
|
|
498
|
+
case "end":
|
|
499
|
+
return _context11.stop();
|
|
500
|
+
}
|
|
501
|
+
}, _callee11, this);
|
|
502
|
+
}));
|
|
503
|
+
function _resetFillArea() {
|
|
504
|
+
return _resetFillArea2.apply(this, arguments);
|
|
505
|
+
}
|
|
506
|
+
return _resetFillArea;
|
|
507
|
+
}()
|
|
508
|
+
}, {
|
|
509
|
+
key: "_createPathProxy",
|
|
510
|
+
value: function _createPathProxy() {
|
|
511
|
+
var _this2 = this;
|
|
512
|
+
// 创建代理,拦截对 _path 的修改
|
|
513
|
+
this._pathProxy = new Proxy(this._path, {
|
|
514
|
+
set: function set(target, prop, value) {
|
|
515
|
+
if (prop === 'corner') _this2._corner = value;else if (prop === 'close') _this2._close = value;else if (prop === 'points') _this2._points = value.map(function (v) {
|
|
516
|
+
return new Vector3(v.position[0], v.position[1], v.position[2]);
|
|
517
|
+
});
|
|
518
|
+
target[prop] = value; // 更新值
|
|
519
|
+
_this2._resetFence();
|
|
520
|
+
_this2._resetFillArea();
|
|
521
|
+
return true; // 必须返回 true 表示操作成功
|
|
522
|
+
}
|
|
523
|
+
});
|
|
328
524
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
525
|
+
}, {
|
|
526
|
+
key: "_arrayMergeCustomizer",
|
|
527
|
+
value: function _arrayMergeCustomizer(objValue, srcValue) {
|
|
528
|
+
if (_.isArray(objValue) && srcValue) return srcValue;
|
|
529
|
+
}
|
|
530
|
+
}, {
|
|
531
|
+
key: "_getCurrentStyle",
|
|
532
|
+
value: function _getCurrentStyle() {
|
|
533
|
+
var currentFenceStyle = '';
|
|
534
|
+
var currentFillAreaStyle = '';
|
|
535
|
+
if (this.style === 'area_dynamic_mode') {
|
|
536
|
+
currentFenceStyle = this._fence.uri;
|
|
537
|
+
currentFillAreaStyle = this._fillArea.uri;
|
|
538
|
+
} else {
|
|
539
|
+
var _STYLE_DATA$this$styl = _slicedToArray(STYLE_DATA[this.style], 2);
|
|
540
|
+
currentFenceStyle = _STYLE_DATA$this$styl[0];
|
|
541
|
+
currentFillAreaStyle = _STYLE_DATA$this$styl[1];
|
|
542
|
+
}
|
|
543
|
+
return {
|
|
544
|
+
currentFenceStyle: currentFenceStyle,
|
|
545
|
+
currentFillAreaStyle: currentFillAreaStyle
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
}]);
|
|
549
|
+
return Area;
|
|
550
|
+
}(ObjectLayer);
|
|
335
551
|
export { Area };
|
|
336
552
|
//# sourceMappingURL=index.js.map
|