@openglobus/og 0.28.7 → 1.0.0-rc2
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/LICENSE.md +218 -4
- package/README.md +31 -18
- package/lib/Deferred.d.ts +2 -2
- package/lib/Events.d.ts +1 -1
- package/lib/Globe.d.ts +8 -5
- package/lib/Object3d.d.ts +17 -14
- package/lib/Popup.d.ts +2 -2
- package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +1 -0
- package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +1 -0
- package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +1 -0
- package/lib/bv/index.d.ts +2 -2
- package/lib/camera/Camera.d.ts +280 -27
- package/lib/camera/Frustum.d.ts +100 -15
- package/lib/camera/PlanetCamera.d.ts +93 -8
- package/lib/camera/index.d.ts +2 -2
- package/lib/control/CameraFrameComposer.d.ts +2 -2
- package/lib/control/CameraFrameHandler.d.ts +1 -1
- package/lib/control/CompassButton.d.ts +2 -2
- package/lib/control/EarthCoordinates.d.ts +5 -2
- package/lib/control/FramebufferPreview.d.ts +3 -3
- package/lib/control/GeoImageDragControl.d.ts +1 -1
- package/lib/control/LayerAnimation.d.ts +2 -2
- package/lib/control/LayerSwitcher.d.ts +3 -0
- package/lib/control/Lighting.d.ts +4 -2
- package/lib/control/Navigation.d.ts +15 -11
- package/lib/control/OrthoSwitcher.d.ts +18 -0
- package/lib/control/SimpleTouchNavigation.d.ts +44 -0
- package/lib/control/Sun.d.ts +4 -2
- package/lib/control/TouchNavigation.d.ts +4 -8
- package/lib/control/atmosphere/Atmosphere.d.ts +2 -0
- package/lib/control/atmosphere/AtmosphereConfig.d.ts +2 -6
- package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +17 -3
- package/lib/control/cameraDepthHandler/camera_depth.d.ts +2 -2
- package/lib/control/drawing/LineStringDrawingScene.d.ts +1 -0
- package/lib/control/drawing/PolygonDrawingScene.d.ts +14 -14
- package/lib/control/elevationProfile/ElevationProfile.d.ts +1 -1
- package/lib/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
- package/lib/control/elevationProfile/ElevationProfileScene.d.ts +9 -12
- package/lib/control/elevationProfile/ElevationProfileView.d.ts +16 -5
- package/lib/control/entityEditor/EntityEditor.d.ts +19 -0
- package/lib/control/{geoObjectEditor/GeoObjectEditorDialog.d.ts → entityEditor/EntityEditorDialog.d.ts} +9 -8
- package/lib/control/{geoObjectEditor/GeoObjectEditorScene.d.ts → entityEditor/EntityEditorScene.d.ts} +12 -12
- package/lib/control/{geoObjectEditor → entityEditor}/colors.d.ts +2 -2
- package/lib/control/entityTree/EntityTree.d.ts +46 -0
- package/lib/control/entityTree/EntityTreeView.d.ts +24 -0
- package/lib/control/heightRuler/HeightRulerScene.d.ts +3 -2
- package/lib/control/index.d.ts +5 -3
- package/lib/control/ruler/RulerScene.d.ts +8 -8
- package/lib/control/selection/SelectionScene.d.ts +6 -6
- package/lib/control/timeline/TimelineControl.d.ts +2 -2
- package/lib/control/timeline/TimelineModel.d.ts +1 -1
- package/lib/control/timeline/TimelineView.d.ts +52 -13
- package/lib/control/visibleExtent/segment.d.ts +7 -0
- package/lib/ellipsoid/index.d.ts +4 -4
- package/lib/entity/Entity.d.ts +114 -100
- package/lib/entity/EntityCollection.d.ts +95 -70
- package/lib/entity/{BaseBillboard.d.ts → billboard/BaseBillboard.d.ts} +16 -17
- package/lib/entity/{BaseBillboardHandler.d.ts → billboard/BaseBillboardHandler.d.ts} +24 -9
- package/lib/entity/{Billboard.d.ts → billboard/Billboard.d.ts} +11 -7
- package/lib/entity/{BillboardHandler.d.ts → billboard/BillboardHandler.d.ts} +1 -1
- package/lib/entity/{GeoObject.d.ts → geoObject/GeoObject.d.ts} +7 -6
- package/lib/entity/{GeoObjectHandler.d.ts → geoObject/GeoObjectHandler.d.ts} +29 -11
- package/lib/entity/{InstanceData.d.ts → geoObject/InstanceData.d.ts} +18 -13
- package/lib/entity/{Geometry.d.ts → geometry/Geometry.d.ts} +10 -10
- package/lib/entity/{GeometryHandler.d.ts → geometry/GeometryHandler.d.ts} +7 -7
- package/lib/entity/index.d.ts +8 -8
- package/lib/entity/{Label.d.ts → label/Label.d.ts} +12 -13
- package/lib/entity/{LabelHandler.d.ts → label/LabelHandler.d.ts} +31 -7
- package/lib/entity/{LabelWorker.d.ts → label/LabelWorker.d.ts} +3 -3
- package/lib/entity/{PointCloud.d.ts → pointCloud/PointCloud.d.ts} +18 -12
- package/lib/entity/{PointCloudHandler.d.ts → pointCloud/PointCloudHandler.d.ts} +4 -4
- package/lib/entity/polyline/Polyline.d.ts +242 -0
- package/lib/entity/polyline/PolylineBatchRenderer.d.ts +443 -0
- package/lib/entity/{PolylineHandler.d.ts → polyline/PolylineHandler.d.ts} +19 -7
- package/lib/entity/{Ray.d.ts → ray/Ray.d.ts} +27 -9
- package/lib/entity/{RayHandler.d.ts → ray/RayHandler.d.ts} +18 -8
- package/lib/entity/{Strip.d.ts → strip/Strip.d.ts} +21 -17
- package/lib/entity/{StripHandler.d.ts → strip/StripHandler.d.ts} +11 -6
- package/lib/index.d.ts +47 -42
- package/lib/layer/BaseGeoImage.d.ts +20 -17
- package/lib/layer/CanvasTiles.d.ts +14 -12
- package/lib/layer/GeoImage.d.ts +1 -1
- package/lib/layer/GeoTexture2d.d.ts +2 -2
- package/lib/layer/KML.d.ts +19 -18
- package/lib/layer/Layer.d.ts +72 -53
- package/lib/layer/Vector.d.ts +47 -30
- package/lib/layer/WMS.d.ts +1 -1
- package/lib/layer/XYZ.d.ts +11 -12
- package/lib/layer/index.d.ts +12 -12
- package/lib/math/Line2.d.ts +1 -1
- package/lib/math/Line3.d.ts +1 -1
- package/lib/math/Mat3.d.ts +3 -13
- package/lib/math/Mat4.d.ts +16 -10
- package/lib/math/Plane.d.ts +1 -1
- package/lib/math/Quat.d.ts +14 -12
- package/lib/math/Ray.d.ts +4 -3
- package/lib/math/Vec2.d.ts +25 -17
- package/lib/math/Vec3.d.ts +33 -31
- package/lib/math/Vec4.d.ts +1 -1
- package/lib/math/coder.d.ts +1 -1
- package/lib/math/index.d.ts +13 -14
- package/lib/mercator.d.ts +4 -4
- package/lib/og.css +1 -1
- package/lib/og.es.js +1 -1
- package/lib/og.es.js.map +1 -1
- package/lib/quadTree/EntityCollectionNode.d.ts +10 -10
- package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +5 -5
- package/lib/quadTree/QuadTreeStrategy.d.ts +3 -4
- package/lib/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +4 -4
- package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +4 -4
- package/lib/renderer/AtmosphereDeferredShading.d.ts +12 -0
- package/lib/renderer/IDeferredShadingPass.d.ts +8 -0
- package/lib/renderer/ITransparencyPass.d.ts +8 -0
- package/lib/renderer/PhongDeferredShading.d.ts +16 -0
- package/lib/renderer/Renderer.d.ts +166 -99
- package/lib/renderer/RendererEvents.d.ts +15 -5
- package/lib/renderer/WOITPass.d.ts +14 -0
- package/lib/res/fonts/Ephesis-Regular.json +1 -0
- package/lib/res/fonts/Ephesis-Regular.png +0 -0
- package/lib/res/fonts/Karla-Bold.json +1 -0
- package/lib/res/fonts/Karla-Bold.png +0 -0
- package/lib/res/fonts/Karla-Italic.json +1 -0
- package/lib/res/fonts/Karla-Italic.png +0 -0
- package/lib/res/fonts/Karla-Light.json +1 -0
- package/lib/res/fonts/Karla-Light.png +0 -0
- package/lib/res/fonts/Karla-Medium.json +1 -0
- package/lib/res/fonts/Karla-Medium.png +0 -0
- package/lib/res/fonts/Roboto-Regular.json +1 -37147
- package/lib/res/fonts/Roboto-Regular.png +0 -0
- package/lib/res/fonts/arial.json +1 -4321
- package/lib/res/fonts/arial.png +0 -0
- package/lib/res/night-4326.png +0 -0
- package/lib/res/night.png +0 -0
- package/lib/scene/AltitudeNearPlaneStrategy.d.ts +17 -0
- package/lib/scene/Axes.d.ts +4 -3
- package/lib/scene/Planet.d.ts +244 -69
- package/lib/scene/{RenderNode.d.ts → Scene.d.ts} +49 -46
- package/lib/scene/SkyBox.d.ts +5 -3
- package/lib/scene/index.d.ts +2 -2
- package/lib/segment/Segment.d.ts +29 -15
- package/lib/segment/SegmentLonLat.d.ts +0 -1
- package/lib/shadeModeConstants.d.ts +7 -0
- package/lib/shaders/applyDeferredDepth.d.ts +2 -0
- package/lib/shaders/atmos/atmos.d.ts +3 -3
- package/lib/shaders/billboard/billboard.d.ts +4 -3
- package/lib/shaders/deferredShading/deferredShading.d.ts +2 -0
- package/lib/shaders/deferredShading/deferredShadingAtmos.d.ts +3 -0
- package/lib/shaders/depth.d.ts +2 -2
- package/lib/shaders/geo_object/geo_object.d.ts +8 -4
- package/lib/shaders/label/label.d.ts +4 -4
- package/lib/shaders/pointCloud.d.ts +2 -2
- package/lib/shaders/polyline/polyline.d.ts +7 -3
- package/lib/shaders/ray/ray.d.ts +3 -2
- package/lib/shaders/screenFrame.d.ts +2 -2
- package/lib/shaders/segment/segment.d.ts +7 -0
- package/lib/shaders/skybox.d.ts +2 -2
- package/lib/shaders/strip/strip.d.ts +3 -0
- package/lib/shaders/tone_mapping/toneMapping.d.ts +2 -2
- package/lib/shaders/weightedOITResolve.d.ts +2 -0
- package/lib/terrain/BilTerrain.d.ts +1 -1
- package/lib/terrain/EmptyTerrain.d.ts +5 -6
- package/lib/terrain/GlobusTerrain.d.ts +18 -23
- package/lib/terrain/RgbTerrain.d.ts +8 -8
- package/lib/terrain/index.d.ts +5 -5
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/ui/Button.d.ts +7 -5
- package/lib/ui/ButtonGroup.d.ts +1 -1
- package/lib/ui/Checkbox.d.ts +2 -2
- package/lib/ui/Color.d.ts +2 -2
- package/lib/ui/Dialog.d.ts +30 -3
- package/lib/ui/Input.d.ts +7 -2
- package/lib/ui/Slider.d.ts +5 -2
- package/lib/ui/ToggleButton.d.ts +2 -2
- package/lib/ui/View.d.ts +1 -1
- package/lib/ui/icons.d.ts +1 -1
- package/lib/ui/index.d.ts +9 -9
- package/lib/utils/FontAtlas.d.ts +57 -8
- package/lib/utils/GeoImageCreator.d.ts +2 -2
- package/lib/utils/ImagesCacheManager.d.ts +3 -3
- package/lib/utils/Loader.d.ts +2 -2
- package/lib/utils/PlainSegmentWorker.d.ts +2 -2
- package/lib/utils/TerrainWorker.d.ts +2 -2
- package/lib/utils/TextureAtlas.d.ts +7 -2
- package/lib/utils/TextureResourceManager.d.ts +162 -0
- package/lib/utils/VectorTileCreator.d.ts +1 -1
- package/lib/utils/colorSpace.d.ts +9 -0
- package/lib/utils/gltf/gltfParser.d.ts +9 -2
- package/lib/utils/gltf/types.d.ts +20 -2
- package/lib/utils/shared.d.ts +11 -5
- package/lib/utils/textureResourceMeta.d.ts +9 -0
- package/lib/webgl/BaseFramebuffer.d.ts +7 -0
- package/lib/webgl/Framebuffer.d.ts +9 -6
- package/lib/webgl/Handler.d.ts +81 -99
- package/lib/webgl/ShaderProgram.d.ts +190 -0
- package/lib/webgl/index.d.ts +2 -2
- package/lib/webgl/variableHandlers.d.ts +2 -1
- package/package.json +77 -76
- package/lib/assets/LabelWorker.worker-BT1uJgYn.js.map +0 -1
- package/lib/assets/PlainSegmentWorker.worker-CT1cj8jj.js.map +0 -1
- package/lib/assets/TerrainWorker.worker-DmikdfB2.js.map +0 -1
- package/lib/control/OldMouseNavigation.d.ts +0 -65
- package/lib/control/ZoomControl.d.ts +0 -28
- package/lib/control/geoObjectEditor/GeoObjectEditor.d.ts +0 -13
- package/lib/control/visibleExtent/drawnode.d.ts +0 -7
- package/lib/entity/Polyline.d.ts +0 -417
- package/lib/light/LightSource.d.ts +0 -36
- package/lib/res/fonts/Roboto-Regular.ttf.cfg +0 -1340
- package/lib/res/fonts/Roboto-Regular.ttf.png +0 -0
- package/lib/res/fonts/arial.ttf.cfg +0 -1570
- package/lib/res/fonts/arial.ttf.png +0 -0
- package/lib/scene/BaseNode.d.ts +0 -61
- package/lib/shaders/drawnode/drawnode.d.ts +0 -8
- package/lib/webgl/Program.d.ts +0 -161
- package/lib/webgl/ProgramController.d.ts +0 -87
- /package/lib/control/{geoObjectEditor → entityEditor}/ArrowEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/AxisTrackEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/MoveAxisEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/MovePlaneEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/RotateEntity.d.ts +0 -0
- /package/lib/entity/{LabelWorker.worker.d.ts → label/LabelWorker.worker.d.ts} +0 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import { Entity } from "../Entity";
|
|
2
|
+
import { Extent } from "../../Extent";
|
|
3
|
+
import { LonLat } from "../../LonLat";
|
|
4
|
+
import { Vec3 } from "../../math/Vec3";
|
|
5
|
+
import type { NumberArray3 } from "../../math/Vec3";
|
|
6
|
+
import type { NumberArray4 } from "../../math/Vec4";
|
|
7
|
+
import { PolylineHandler } from "./PolylineHandler";
|
|
8
|
+
import { Scene } from "../../scene/Scene";
|
|
9
|
+
import type { WebGLBufferExt } from "../../webgl/Handler";
|
|
10
|
+
import type { TypedArray } from "../../utils/shared";
|
|
11
|
+
import { Ellipsoid } from "../../ellipsoid/Ellipsoid";
|
|
12
|
+
import type { HTMLImageElementExt } from "../../utils/ImagesCacheManager";
|
|
13
|
+
import type { Cartesian, SegmentPath3vExt, SegmentPathLonLatExt, SegmentPathColor, SegmentPathLonLat } from "./Polyline";
|
|
14
|
+
declare const F3V = 0;
|
|
15
|
+
declare const FLONLAT = 1;
|
|
16
|
+
declare const FDETECT = 2;
|
|
17
|
+
export interface TexParam {
|
|
18
|
+
texOffset: number;
|
|
19
|
+
strokeSize: number;
|
|
20
|
+
texOffsetSpeed: number;
|
|
21
|
+
}
|
|
22
|
+
type IndexFormatMode = typeof F3V | typeof FLONLAT | typeof FDETECT;
|
|
23
|
+
type LineSourceMode = typeof F3V | typeof FLONLAT;
|
|
24
|
+
type StrokeSource = string | HTMLImageElement | null;
|
|
25
|
+
export interface IPolylineBatchRendererParams {
|
|
26
|
+
altitude?: number;
|
|
27
|
+
thickness?: number;
|
|
28
|
+
opacity?: number;
|
|
29
|
+
color?: string[];
|
|
30
|
+
visibility?: boolean;
|
|
31
|
+
isTextured?: boolean;
|
|
32
|
+
isClosed?: boolean[];
|
|
33
|
+
pathColors?: SegmentPathColor[];
|
|
34
|
+
path3v?: SegmentPath3vExt[];
|
|
35
|
+
pathLonLat?: SegmentPathLonLatExt[];
|
|
36
|
+
visibleSpherePosition?: Cartesian;
|
|
37
|
+
visibleSphereRadius?: number;
|
|
38
|
+
src?: StrokeSource[];
|
|
39
|
+
texParams?: Partial<TexParam>[];
|
|
40
|
+
}
|
|
41
|
+
declare class PolylineBatchRenderer {
|
|
42
|
+
static __counter__: number;
|
|
43
|
+
protected static _defaultStrokeImage: HTMLImageElementExt | null;
|
|
44
|
+
/**
|
|
45
|
+
* Object uniq identifier.
|
|
46
|
+
* @protected
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
protected __id: number;
|
|
50
|
+
altitude: number;
|
|
51
|
+
/**
|
|
52
|
+
* Polyline thickness in screen pixels.
|
|
53
|
+
* @type {number}
|
|
54
|
+
*/
|
|
55
|
+
protected _thickness: number;
|
|
56
|
+
protected _opacity: number;
|
|
57
|
+
/**
|
|
58
|
+
* Polyline RGBA color.
|
|
59
|
+
* @protected
|
|
60
|
+
* @type {Float32Array}
|
|
61
|
+
*/
|
|
62
|
+
protected _defaultColor: Float32Array | NumberArray4;
|
|
63
|
+
protected _pickingColor: Float32Array | NumberArray4;
|
|
64
|
+
/**
|
|
65
|
+
* Polyline visibility.
|
|
66
|
+
* @public
|
|
67
|
+
* @type {boolean}
|
|
68
|
+
*/
|
|
69
|
+
visibility: boolean;
|
|
70
|
+
isTextured: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Polyline geometry ring type identification.
|
|
73
|
+
* @protected
|
|
74
|
+
* @type {Boolean}
|
|
75
|
+
*/
|
|
76
|
+
protected _pathClosed: boolean[];
|
|
77
|
+
/**
|
|
78
|
+
* Polyline cartesian coordinates.
|
|
79
|
+
* @public
|
|
80
|
+
* @type {Array.<Vec3>}
|
|
81
|
+
*/
|
|
82
|
+
_path3v: SegmentPath3vExt[];
|
|
83
|
+
protected _pathLengths: number[];
|
|
84
|
+
/**
|
|
85
|
+
* Polyline geodetic degrees coordinates.
|
|
86
|
+
* @private
|
|
87
|
+
* @type {Array.<LonLat>}
|
|
88
|
+
*/
|
|
89
|
+
_pathLonLat: SegmentPathLonLatExt[];
|
|
90
|
+
/**
|
|
91
|
+
* Polyline geodetic mercator coordinates.
|
|
92
|
+
* @public
|
|
93
|
+
* @type {Array.<LonLat>}
|
|
94
|
+
*/
|
|
95
|
+
_pathLonLatMerc: LonLat[][];
|
|
96
|
+
protected _pathColors: SegmentPathColor[];
|
|
97
|
+
protected _segmentOpacity: number[];
|
|
98
|
+
protected _segmentThickness: number[];
|
|
99
|
+
protected _segmentTexParams: (TexParam | undefined)[];
|
|
100
|
+
protected _pathPickingColors: NumberArray3[][];
|
|
101
|
+
/**
|
|
102
|
+
* Polyline geodetic extent.
|
|
103
|
+
* @protected
|
|
104
|
+
* @type {Extent}
|
|
105
|
+
*/
|
|
106
|
+
_extent: Extent;
|
|
107
|
+
protected _verticesHigh: TypedArray | number[];
|
|
108
|
+
protected _verticesLow: TypedArray | number[];
|
|
109
|
+
protected _orders: TypedArray | number[];
|
|
110
|
+
protected _indexes: TypedArray | number[];
|
|
111
|
+
protected _colors: TypedArray | number[];
|
|
112
|
+
protected _thicknessArr: TypedArray | number[];
|
|
113
|
+
protected _pathTexParamArr: TypedArray | number[];
|
|
114
|
+
protected _pathPhaseArr: TypedArray | number[];
|
|
115
|
+
protected _boundingSphereArr: TypedArray | number[];
|
|
116
|
+
protected _texCoordArr: TypedArray | number[];
|
|
117
|
+
protected _pickingColors: TypedArray | number[];
|
|
118
|
+
protected _verticesHighBuffer: WebGLBufferExt | null;
|
|
119
|
+
protected _verticesLowBuffer: WebGLBufferExt | null;
|
|
120
|
+
protected _ordersBuffer: WebGLBufferExt | null;
|
|
121
|
+
protected _indexesBuffer: WebGLBufferExt | null;
|
|
122
|
+
protected _colorsBuffer: WebGLBufferExt | null;
|
|
123
|
+
protected _texCoordBuffer: WebGLBufferExt | null;
|
|
124
|
+
protected _thicknessBuffer: WebGLBufferExt | null;
|
|
125
|
+
protected _pathTexParamBuffer: WebGLBufferExt | null;
|
|
126
|
+
protected _pathPhaseBuffer: WebGLBufferExt | null;
|
|
127
|
+
protected _boundingSphereBuffer: WebGLBufferExt | null;
|
|
128
|
+
protected _pickingColorsBuffer: WebGLBufferExt | null;
|
|
129
|
+
protected _scene: Scene | null;
|
|
130
|
+
/**
|
|
131
|
+
* Entity instance that holds this Polyline.
|
|
132
|
+
* @public
|
|
133
|
+
* @type {Entity}
|
|
134
|
+
*/
|
|
135
|
+
_entity: Entity | null;
|
|
136
|
+
/**
|
|
137
|
+
* Handler that stores and renders this Polyline object.
|
|
138
|
+
* @public
|
|
139
|
+
* @type {PolylineHandler | null}
|
|
140
|
+
*/
|
|
141
|
+
_handler: PolylineHandler | null;
|
|
142
|
+
protected _buffersUpdateCallbacks: Function[];
|
|
143
|
+
protected _changedBuffers: boolean[];
|
|
144
|
+
protected _visibleSphere: Float32Array;
|
|
145
|
+
protected _visibleSpherePosition: Vec3;
|
|
146
|
+
__doubleToTwoFloats: (pos: Vec3, highPos: Vec3, lowPos: Vec3) => void;
|
|
147
|
+
protected _src: StrokeSource[];
|
|
148
|
+
protected _image: ((HTMLImageElement & {
|
|
149
|
+
__nodeIndex?: number;
|
|
150
|
+
}) | null)[];
|
|
151
|
+
protected _defaultTexParam: TexParam;
|
|
152
|
+
constructor(handler: PolylineHandler, options?: IPolylineBatchRendererParams);
|
|
153
|
+
protected _normalizePathClosedInput(isClosed?: boolean[]): boolean[];
|
|
154
|
+
protected _normalizePathColorInput(color?: string[]): SegmentPathColor[];
|
|
155
|
+
protected _getDefaultStrokeSource(): StrokeSource;
|
|
156
|
+
protected _syncPathClosedLength(segCount: number): void;
|
|
157
|
+
protected _syncSrcLength(segCount: number): void;
|
|
158
|
+
protected _isSegmentClosed(segmentIndex: number): boolean;
|
|
159
|
+
protected _hasTexture(segmentIndex: number): boolean;
|
|
160
|
+
protected _hasAnyTextureSegments(): boolean;
|
|
161
|
+
setImage(image: HTMLImageElement): void;
|
|
162
|
+
getImage(): (HTMLImageElementExt | null)[];
|
|
163
|
+
protected _setSrcPerSegment(src: StrokeSource[], segCount: number, scene: Scene, textureAtlas: any): void;
|
|
164
|
+
protected _setSrcDisabled(segCount: number, scene: Scene): void;
|
|
165
|
+
protected _setTextureEnabled(segCount: number): void;
|
|
166
|
+
/**
|
|
167
|
+
* Sets stroke source per segment (null = color-only).
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
setSrc(src: StrokeSource[]): void;
|
|
171
|
+
/**
|
|
172
|
+
* Sets stroke source (string or `Image`) for a segment index.
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
setPathSrc(src: StrokeSource, segmentIndex?: number): void;
|
|
176
|
+
/**
|
|
177
|
+
* Sets closed/open state for one path segment.
|
|
178
|
+
* @public
|
|
179
|
+
*/
|
|
180
|
+
setPathClosed(isClosed: boolean, segmentIndex?: number): void;
|
|
181
|
+
getSrc(): StrokeSource[];
|
|
182
|
+
_setTexCoordArr(tCoordArrs: (number[] | null)[]): void;
|
|
183
|
+
setTextureDisabled(): void;
|
|
184
|
+
/** Get atlas tex coords for segment (null = color-only) */
|
|
185
|
+
protected _getAtlasTexCoordsForSegment(segIndex: number): number[] | null;
|
|
186
|
+
protected _pushQuadVertices(position: Vec3, vHigh: Vec3, vLow: Vec3, outVerticesHigh: number[], outVerticesLow: number[]): void;
|
|
187
|
+
protected _resolveSegmentThickness(segIndex: number): number;
|
|
188
|
+
protected _resolveSegmentTexParams(segIndex: number): TexParam;
|
|
189
|
+
protected _recalculateExtentFromLonLatPaths(): void;
|
|
190
|
+
protected _normalizeSegmentPathColors(segmentLength: number, segColorsInput: SegmentPathColor | NumberArray4): SegmentPathColor;
|
|
191
|
+
protected _getSegmentAttrGroupStart(segmentIndex: number): number;
|
|
192
|
+
protected _getSegmentAttrGroupCount(segmentIndex: number): number;
|
|
193
|
+
protected _setPhaseQuad(groupIndex: number, phase: number, arr?: TypedArray | number[]): void;
|
|
194
|
+
protected _setBoundingSphereQuad(groupIndex: number, sphere: NumberArray4, arr?: TypedArray | number[]): void;
|
|
195
|
+
protected _getTotalAttrGroupCount(): number;
|
|
196
|
+
protected _cloneMetricArray(source: TypedArray | number[] | undefined, requiredLength: number): number[];
|
|
197
|
+
protected _rebuildPathPhaseArr(): void;
|
|
198
|
+
protected _calculateSegmentTextureScaleSphere(path: Vec3[], segmentIndex: number): NumberArray4;
|
|
199
|
+
protected _rebuildBoundingSphereArr(): void;
|
|
200
|
+
protected _updatePathPhaseSegment(segmentIndex: number): number;
|
|
201
|
+
protected _shiftPathPhaseTailAfterSegment(segmentIndex: number, phaseDelta: number): void;
|
|
202
|
+
protected _updateBoundingSphereSegment(segmentIndex: number): void;
|
|
203
|
+
protected _updateTextureMetrics(segmentIndex: number): void;
|
|
204
|
+
protected _updateAllTextureMetrics(): void;
|
|
205
|
+
protected _updateTextureMetricsAfterPointChange(segmentIndex: number): void;
|
|
206
|
+
protected _markGeometryBuffersChanged(includeTexCoords: boolean): void;
|
|
207
|
+
protected _applyForceEqualSegmentUpdate<TSegment extends any[]>(segmentPath: TSegment, segmentIndex: number, pathColors: SegmentPathColor | NumberArray4 | undefined, currentPaths: TSegment[], equalUpdate: (segmentPath: TSegment, segmentIndex: number, pathColors?: SegmentPathColor | NumberArray4) => void, recreateData: (nextPaths: TSegment[]) => void, includeTexCoords: boolean): boolean;
|
|
208
|
+
protected __appendLineDataCore(pathInput: SegmentPath3vExt[] | SegmentPathLonLatExt[], pathColors: SegmentPathColor[], pathPickingColors: NumberArray3[][], defaultColor: NumberArray4, opacity: number[], pathClosed: boolean[], outVerticesHigh: number[], outVerticesLow: number[], outOrders: number[], outIndexes: number[], outTexCoords: number[], ellipsoid: Ellipsoid | null, outPath3v: SegmentPath3vExt[], outPathLonLat: SegmentPathLonLatExt[], outPathMerc: LonLat[][], outExtent: Extent, outColors: number[], outThickness: number[], outTexParams: number[], outBoundingSpheres: number[], outPickingColors: number[], sourceType: LineSourceMode, segmentOffset?: number, indexFormat?: IndexFormatMode, skipTexCoords?: boolean, resetExtent?: boolean): void;
|
|
209
|
+
/**
|
|
210
|
+
* Appends to the line array new cartesian coordinates line data.
|
|
211
|
+
*/
|
|
212
|
+
protected __appendLineData3v(path3v: SegmentPath3vExt[], pathColors: SegmentPathColor[], pathPickingColors: NumberArray3[][], defaultColor: NumberArray4, opacity: number[], pathClosed: boolean[], outVerticesHigh: number[], outVerticesLow: number[], outOrders: number[], outIndexes: number[], ellipsoid: Ellipsoid, outTransformedPathLonLat: SegmentPathLonLatExt[], outPath3v: SegmentPath3vExt[], outTransformedPathMerc: LonLat[][], outExtent: Extent, outColors: number[], outThickness: number[], outTexParams: number[], outTexCoords: number[], outBoundingSpheres: number[], outPickingColors: number[]): void;
|
|
213
|
+
/**
|
|
214
|
+
|
|
215
|
+
[1, -1, 2, -2] - orders for triangle strip line segment
|
|
216
|
+
t2 t3
|
|
217
|
+
(2)-------(-2)
|
|
218
|
+
| |
|
|
219
|
+
| |
|
|
220
|
+
| |
|
|
221
|
+
| |
|
|
222
|
+
(1)-------(-1)
|
|
223
|
+
t0 t1
|
|
224
|
+
*/
|
|
225
|
+
static setPathTexCoords(path3v: SegmentPath3vExt[], tCoordArrs: (number[] | null)[], outTexCoords: number[]): void;
|
|
226
|
+
static setPathColors(pathLonLat: SegmentPathLonLatExt[], pathColors: SegmentPathColor[], defaultColor: NumberArray4, outColors: number[], opacity?: number): void;
|
|
227
|
+
/**
|
|
228
|
+
* Appends to the line array new geodetic coordinates line data.
|
|
229
|
+
* @static
|
|
230
|
+
*/
|
|
231
|
+
protected __appendLineDataLonLat(pathLonLat: SegmentPathLonLatExt[], pathColors: SegmentPathColor[], pathPickingColors: NumberArray3[][], defaultColor: NumberArray4, opacity: number[], pathClosed: boolean[], outVerticesHigh: number[], outVerticesLow: number[], outOrders: number[], outIndexes: number[], outTexCoords: number[], ellipsoid: Ellipsoid, outTransformedPathCartesian: SegmentPath3vExt[], outPathLonLat: SegmentPathLonLatExt[], outTransformedPathMerc: LonLat[][], outExtent: Extent, outColors: number[], outThickness: number[], outTexParams: number[], outBoundingSpheres: number[], outPickingColors: number[]): void;
|
|
232
|
+
protected _setEqualPath3v(path3v: SegmentPath3vExt[], pathColors?: (SegmentPathColor | NumberArray4)[] | SegmentPathColor | NumberArray4): void;
|
|
233
|
+
/**
|
|
234
|
+
* Sets one polyline segment with cartesian coordinates.
|
|
235
|
+
* @protected
|
|
236
|
+
* @param {SegmentPath3vExt} path3v - Cartesian coordinates for one segment.
|
|
237
|
+
* @param {number} segmentIndex - Segment index to update.
|
|
238
|
+
* @param {SegmentPathColor | NumberArray4} [pathColors] - Optional colors for the segment path.
|
|
239
|
+
*/
|
|
240
|
+
protected _setSegmentEqualPath3v(path3v: SegmentPath3vExt, segmentIndex: number, pathColors?: SegmentPathColor | NumberArray4): void;
|
|
241
|
+
protected _setEqualPathLonLat(pathLonLat: SegmentPathLonLat[], pathColors?: (SegmentPathColor | NumberArray4)[] | SegmentPathColor | NumberArray4): void;
|
|
242
|
+
protected _setSegmentEqualLonLat(pathLonLat: SegmentPathLonLatExt, segmentIndex: number, pathColors?: SegmentPathColor | NumberArray4): void;
|
|
243
|
+
setPointLonLat(lonlat: LonLat, index: number, segmentIndex: number): void;
|
|
244
|
+
/**
|
|
245
|
+
* Changes cartesian point coordinates of the path
|
|
246
|
+
* @param {Vec3} coordinates - New coordinates
|
|
247
|
+
* @param {number} [index=0] - Path segment index
|
|
248
|
+
* @param {number} [segmentIndex=0] - Index of the point in the path segment
|
|
249
|
+
* @param {boolean} [skipLonLat=false] - Do not update geodetic coordinates
|
|
250
|
+
*/
|
|
251
|
+
setPoint3v(coordinates: Vec3, index?: number, segmentIndex?: number, skipLonLat?: boolean): void;
|
|
252
|
+
protected _resizePathLengths(index?: number): void;
|
|
253
|
+
protected _rebuildIndexes(): void;
|
|
254
|
+
/**
|
|
255
|
+
* Remove multiline path segment
|
|
256
|
+
* @param {number} index - Segment index in multiline
|
|
257
|
+
*/
|
|
258
|
+
removePath(index: number): void;
|
|
259
|
+
appendPath3v(path3v: SegmentPath3vExt, pathColors?: NumberArray4[], opacity?: number): void;
|
|
260
|
+
appendPathLonLat(pathLonLat: SegmentPathLonLatExt, pathColors?: NumberArray4[], opacity?: number): void;
|
|
261
|
+
/**
|
|
262
|
+
* Remove point from the path
|
|
263
|
+
* @param {number} index - Point index in a path segment
|
|
264
|
+
* @param {number} [segmentIndex=0] - Segment path index
|
|
265
|
+
*/
|
|
266
|
+
removePoint(index: number, segmentIndex?: number): void;
|
|
267
|
+
/**
|
|
268
|
+
* Insert point coordinates in a path segment
|
|
269
|
+
* @param {Vec3} point3v - Point coordinates
|
|
270
|
+
* @param {number} [index=0] - Index in the path
|
|
271
|
+
* @param {NumberArray4} [color] - Point color
|
|
272
|
+
* @param {number} [segmentIndex=0] - Path segment index
|
|
273
|
+
*/
|
|
274
|
+
insertPoint3v(point3v: Vec3, index?: number, color?: NumberArray4, segmentIndex?: number): void;
|
|
275
|
+
/**
|
|
276
|
+
* Append new point in the end of the path.
|
|
277
|
+
* @public
|
|
278
|
+
* @param {Vec3} point3v - New point coordinates.
|
|
279
|
+
* @param {number} [segmentIndex=0] - Path segment index, first by default.
|
|
280
|
+
* @param {NumberArray4} [color] - Point color.
|
|
281
|
+
* @param {number} [opacity=1] - Point opacity.
|
|
282
|
+
*/
|
|
283
|
+
addPoint3v(point3v: Vec3, segmentIndex?: number, color?: NumberArray4, opacity?: number): void;
|
|
284
|
+
/**
|
|
285
|
+
* Append new geodetic point in the end of the path.
|
|
286
|
+
* @public
|
|
287
|
+
* @param {LonLat} lonLat - New coordinate.
|
|
288
|
+
* @param {number} [segmentIndex=0] - Path segment index, first by default.
|
|
289
|
+
* @param {NumberArray4} [color] - Point color.
|
|
290
|
+
* @param {number} [opacity=1]
|
|
291
|
+
*/
|
|
292
|
+
addPointLonLat(lonLat: LonLat, segmentIndex?: number, color?: NumberArray4, opacity?: number): void;
|
|
293
|
+
/**
|
|
294
|
+
* Clear polyline data.
|
|
295
|
+
* @public
|
|
296
|
+
*/
|
|
297
|
+
clear(): void;
|
|
298
|
+
/**
|
|
299
|
+
* Change path point color
|
|
300
|
+
* @param {NumberArray4} color - New color
|
|
301
|
+
* @param {number} [index=0] - Point index
|
|
302
|
+
* @param {number} [segmentIndex=0] - Path segment index
|
|
303
|
+
* @param {number} [opacity=1.0]
|
|
304
|
+
*/
|
|
305
|
+
setPointColor(color: NumberArray4, index?: number, segmentIndex?: number, opacity?: number): void;
|
|
306
|
+
/**
|
|
307
|
+
* Sets Polyline thickness in screen pixels.
|
|
308
|
+
* @public
|
|
309
|
+
* @param {number} altitude - ALtitude value.
|
|
310
|
+
*/
|
|
311
|
+
setAltitude(altitude: number): void;
|
|
312
|
+
/**
|
|
313
|
+
* Sets polyline thickness in screen pixels.
|
|
314
|
+
* @public
|
|
315
|
+
* @param {number} thickness - Segment thickness.
|
|
316
|
+
* @param {number} [segmentIndex] - Segment index. If omitted, the last segment is used.
|
|
317
|
+
*/
|
|
318
|
+
setThickness(thickness: number): void;
|
|
319
|
+
setThickness(thickness: number, segmentIndex: number): void;
|
|
320
|
+
/**
|
|
321
|
+
* Sets polyline segment color.
|
|
322
|
+
* @public
|
|
323
|
+
* @param {string} htmlColor - HTML color.
|
|
324
|
+
* @param {number} [segmentIndex] - Segment index. If omitted, the last segment is used.
|
|
325
|
+
* @param {number} [opacity=1] - Segment opacity.
|
|
326
|
+
*/
|
|
327
|
+
setColor(htmlColor: string): void;
|
|
328
|
+
setColor(htmlColor: string, segmentIndex: number, opacity?: number): void;
|
|
329
|
+
setPathTexParams(texOffset: number | undefined, strokeSize: number | undefined, segmentIndex: number): void;
|
|
330
|
+
setPathTexParams(texOffset: number | undefined, strokeSize: number | undefined, texOffsetSpeed: number | undefined, segmentIndex: number): void;
|
|
331
|
+
setPathTexOffset(texOffset: number, segmentIndex: number): void;
|
|
332
|
+
setPathStrokeSize(strokeSize: number, segmentIndex: number): void;
|
|
333
|
+
setPathTexOffsetSpeed(texOffsetSpeed: number, segmentIndex: number): void;
|
|
334
|
+
/**
|
|
335
|
+
* Sets visibility.
|
|
336
|
+
* @public
|
|
337
|
+
* @param {boolean} visibility - Polyline visibility.
|
|
338
|
+
*/
|
|
339
|
+
setVisibility(visibility: boolean): void;
|
|
340
|
+
/**
|
|
341
|
+
* Gets Polyline visibility.
|
|
342
|
+
* @public
|
|
343
|
+
* @returns {boolean} Polyline visibility.
|
|
344
|
+
*/
|
|
345
|
+
getVisibility(): boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Assign with render node.
|
|
348
|
+
* @public
|
|
349
|
+
* @param {Scene} scene -
|
|
350
|
+
*/
|
|
351
|
+
bindScene(scene: Scene): void;
|
|
352
|
+
protected _clearData(): void;
|
|
353
|
+
protected _createData3v(path3v: SegmentPath3vExt[]): void;
|
|
354
|
+
protected _createDataLonLat(pathLonlat: SegmentPathLonLatExt[]): void;
|
|
355
|
+
/**
|
|
356
|
+
* Removes from an entity.
|
|
357
|
+
* @public
|
|
358
|
+
*/
|
|
359
|
+
remove(): void;
|
|
360
|
+
setPathPickingColor3v(color: Vec3, segmentIndex: number): void;
|
|
361
|
+
/**
|
|
362
|
+
* Returns polyline geodetic extent.
|
|
363
|
+
* @public
|
|
364
|
+
* @returns {Extent} Geodetic extent.
|
|
365
|
+
*/
|
|
366
|
+
getExtent(): Extent;
|
|
367
|
+
/**
|
|
368
|
+
* Returns path cartesian coordinates.
|
|
369
|
+
* @returns {SegmentPath3vExt[]} Polyline path.
|
|
370
|
+
*/
|
|
371
|
+
getPath3v(): SegmentPath3vExt[];
|
|
372
|
+
/**
|
|
373
|
+
* Returns geodetic path coordinates.
|
|
374
|
+
* @returns {SegmentPathLonLatExt[]} Polyline path.
|
|
375
|
+
*/
|
|
376
|
+
getPathLonLat(): SegmentPathLonLatExt[];
|
|
377
|
+
getPathColors(): NumberArray4[][];
|
|
378
|
+
setPathOpacity(opacity: number): void;
|
|
379
|
+
setPathOpacity(opacity: number, segmentIndex: number): void;
|
|
380
|
+
setPathColors(pathColors: SegmentPathColor[]): void;
|
|
381
|
+
setPathColors(pathColors: SegmentPathColor, segmentIndex: number, opacity?: number): void;
|
|
382
|
+
setPathLonLatFast(pathLonLat: SegmentPathLonLatExt[], pathColors?: (SegmentPathColor | NumberArray4)[] | SegmentPathColor | NumberArray4): void;
|
|
383
|
+
setPath3vFast(path3v: SegmentPath3vExt[], pathColors?: (SegmentPathColor | NumberArray4)[] | SegmentPathColor | NumberArray4): void;
|
|
384
|
+
protected _applyPathColorsFromInput(pathInput: SegmentPath3vExt[] | SegmentPathLonLatExt[], colorsInput: (SegmentPathColor | NumberArray4)[] | SegmentPathColor | NumberArray4): void;
|
|
385
|
+
getSize(index?: number): number;
|
|
386
|
+
/**
|
|
387
|
+
* Sets Polyline cartesian coordinates.
|
|
388
|
+
* @public
|
|
389
|
+
* @param {SegmentPath3vExt[]} path3v - Polyline path cartesian coordinates. (exactly 3 entries)
|
|
390
|
+
* @param {SegmentPathColor[]} [pathColors] - Polyline path cartesian coordinates. (exactly 3 entries)
|
|
391
|
+
* @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
|
|
392
|
+
*/
|
|
393
|
+
setPath3v(path3v: SegmentPath3vExt[], pathColors?: (SegmentPathColor | NumberArray4)[], forceEqual?: boolean): void;
|
|
394
|
+
setPath3v(path3v: SegmentPath3vExt, pathColors?: SegmentPathColor | NumberArray4, forceEqual?: boolean, segmentIndex?: number): void;
|
|
395
|
+
/**
|
|
396
|
+
* Sets polyline geodetic coordinates.
|
|
397
|
+
* @public
|
|
398
|
+
* @param {SegmentPathLonLat[]} pathLonLat - Polyline path cartesian coordinates.
|
|
399
|
+
* @param {SegmentPathColor[]} pathColors - Polyline path points colors.
|
|
400
|
+
* @param {Boolean} [forceEqual=false] - OPTIMIZATION FLAG: Makes assigning faster for size equal coordinates array.
|
|
401
|
+
*/
|
|
402
|
+
setPathLonLat(pathLonLat: SegmentPathLonLatExt[], pathColors?: (SegmentPathColor | NumberArray4)[], forceEqual?: boolean): void;
|
|
403
|
+
setPathLonLat(pathLonLat: SegmentPathLonLatExt, pathColors?: SegmentPathColor | NumberArray4, forceEqual?: boolean, segmentIndex?: number): void;
|
|
404
|
+
drawOpaque(): void;
|
|
405
|
+
drawTransparent(): void;
|
|
406
|
+
drawPicking(): void;
|
|
407
|
+
/**
|
|
408
|
+
* Refresh buffers.
|
|
409
|
+
* @protected
|
|
410
|
+
*/
|
|
411
|
+
protected _refresh(): void;
|
|
412
|
+
/**
|
|
413
|
+
* Updates render buffers.
|
|
414
|
+
* @protected
|
|
415
|
+
*/
|
|
416
|
+
protected _update(): void;
|
|
417
|
+
/**
|
|
418
|
+
* Clear GL buffers.
|
|
419
|
+
* @public
|
|
420
|
+
*/
|
|
421
|
+
_deleteBuffers(): void;
|
|
422
|
+
/**
|
|
423
|
+
* Creates vertices buffers.
|
|
424
|
+
* @protected
|
|
425
|
+
*/
|
|
426
|
+
protected _createVerticesBuffer(): void;
|
|
427
|
+
/**
|
|
428
|
+
* Creates gl index and order buffer.
|
|
429
|
+
* @protected
|
|
430
|
+
*/
|
|
431
|
+
protected _createIndexBuffer(): void;
|
|
432
|
+
protected _createColorsBuffer(): void;
|
|
433
|
+
protected _createPickingColorsBuffer(): void;
|
|
434
|
+
protected _createThicknessBuffer(): void;
|
|
435
|
+
protected _createTexParamsBuffer(): void;
|
|
436
|
+
protected _createPathPhaseBuffer(): void;
|
|
437
|
+
protected _createBoundingSphereBuffer(): void;
|
|
438
|
+
_createTexCoordBuffer(): void;
|
|
439
|
+
setVisibleSphere(p: Vec3, r: number): void;
|
|
440
|
+
protected _updateVisibleSphereRTC(): void;
|
|
441
|
+
updateRTCPosition(): void;
|
|
442
|
+
}
|
|
443
|
+
export { PolylineBatchRenderer };
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
import { EntityCollection } from "
|
|
1
|
+
import { EntityCollection } from "../EntityCollection";
|
|
2
2
|
import { Polyline } from "./Polyline";
|
|
3
|
-
import { Renderer } from "
|
|
4
|
-
import {
|
|
5
|
-
import { Vec3 } from "
|
|
3
|
+
import { Renderer } from "../../renderer/Renderer";
|
|
4
|
+
import { Scene } from "../../scene/Scene";
|
|
5
|
+
import { Vec3 } from "../../math/Vec3";
|
|
6
|
+
import { PolylineBatchRenderer } from "./PolylineBatchRenderer";
|
|
6
7
|
declare class PolylineHandler {
|
|
7
8
|
static __counter__: number;
|
|
8
9
|
protected __id: number;
|
|
9
10
|
_entityCollection: EntityCollection;
|
|
10
11
|
pickingEnabled: boolean;
|
|
11
12
|
protected _renderer: Renderer | null;
|
|
12
|
-
protected _polylines: Polyline[];
|
|
13
13
|
_relativeCenter: Vec3;
|
|
14
14
|
_rtcEyePositionHigh: Float32Array;
|
|
15
15
|
_rtcEyePositionLow: Float32Array;
|
|
16
|
+
_opaqueRenderer: PolylineBatchRenderer;
|
|
17
|
+
_transparentRenderer: PolylineBatchRenderer;
|
|
18
|
+
_opaqueTexRenderer: PolylineBatchRenderer;
|
|
19
|
+
_transparentTexRenderer: PolylineBatchRenderer;
|
|
20
|
+
protected _polylines: Polyline[];
|
|
16
21
|
constructor(entityCollection: EntityCollection);
|
|
22
|
+
setVisibleSphere(p: Vec3, r: number): void;
|
|
17
23
|
protected _initProgram(): void;
|
|
18
|
-
|
|
24
|
+
bindScene(scene: Scene): void;
|
|
19
25
|
add(polyline: Polyline): void;
|
|
20
26
|
remove(polyline: Polyline): void;
|
|
27
|
+
getRenderer(opacity: number, textured: boolean): PolylineBatchRenderer;
|
|
28
|
+
reindexAfterRemoval(removedBatchIndex: number, renderer: PolylineBatchRenderer): void;
|
|
21
29
|
reindexPolylineArray(startIndex: number): void;
|
|
22
|
-
|
|
30
|
+
drawForward(): void;
|
|
31
|
+
drawOpaque(): void;
|
|
32
|
+
drawTransparent(): void;
|
|
33
|
+
drawTransparentForward(): void;
|
|
23
34
|
drawPicking(): void;
|
|
24
35
|
clear(): void;
|
|
25
36
|
getRTCPosition(pos: Vec3, rtcPositionHigh: Vec3, rtcPositionLow: Vec3): void;
|
|
@@ -27,6 +38,7 @@ declare class PolylineHandler {
|
|
|
27
38
|
protected _updateRTCEyePosition(): void;
|
|
28
39
|
reloadTextures(): void;
|
|
29
40
|
get polylines(): Polyline[];
|
|
41
|
+
protected _updateTexCoords(renderer: PolylineBatchRenderer): void;
|
|
30
42
|
refreshTexCoordsArr(): void;
|
|
31
43
|
}
|
|
32
44
|
export { PolylineHandler };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Vec3 } from "
|
|
2
|
-
import { Vec4 } from "
|
|
3
|
-
import type { NumberArray3 } from "
|
|
4
|
-
import type { NumberArray4 } from "
|
|
5
|
-
import { Entity } from "
|
|
1
|
+
import { Vec3 } from "../../math/Vec3";
|
|
2
|
+
import { Vec4 } from "../../math/Vec4";
|
|
3
|
+
import type { NumberArray3 } from "../../math/Vec3";
|
|
4
|
+
import type { NumberArray4 } from "../../math/Vec4";
|
|
5
|
+
import { Entity } from "../Entity";
|
|
6
6
|
import { RayHandler } from "./RayHandler";
|
|
7
|
-
import type { HTMLImageElementExt } from "
|
|
7
|
+
import type { HTMLImageElementExt } from "../../utils/ImagesCacheManager";
|
|
8
8
|
export interface IRayParams {
|
|
9
9
|
thickness?: number;
|
|
10
10
|
startPosition?: Vec3 | NumberArray3;
|
|
@@ -16,6 +16,7 @@ export interface IRayParams {
|
|
|
16
16
|
image?: HTMLImageElement;
|
|
17
17
|
texOffset?: number;
|
|
18
18
|
strokeSize?: number;
|
|
19
|
+
opacity?: number;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Ray class.
|
|
@@ -25,6 +26,7 @@ export interface IRayParams {
|
|
|
25
26
|
* @param {Vec3|Array.<number>} [options.endPosition] - Ray end point position.
|
|
26
27
|
* @param {Vec3|Array.<number>} [options.startColor] - Ray start point color.
|
|
27
28
|
* @param {Vec3|Array.<number>} [options.endColor] - Ray end point color.
|
|
29
|
+
* @param {number} [options.opacity=1.0] - Ray opacity multiplier.
|
|
28
30
|
* @param {boolean} [options.visibility] - Visibility.
|
|
29
31
|
*/
|
|
30
32
|
declare class Ray {
|
|
@@ -79,12 +81,16 @@ declare class Ray {
|
|
|
79
81
|
* @protected
|
|
80
82
|
* @type {Object}
|
|
81
83
|
*/
|
|
82
|
-
protected _image: HTMLImageElement & {
|
|
84
|
+
protected _image: (HTMLImageElement & {
|
|
83
85
|
__nodeIndex?: number;
|
|
84
|
-
} | null;
|
|
86
|
+
}) | null;
|
|
85
87
|
protected _texOffset: number;
|
|
86
88
|
protected _strokeSize: number;
|
|
89
|
+
protected _opacity: number;
|
|
90
|
+
protected _effectiveStartColor: Vec4;
|
|
91
|
+
protected _effectiveEndColor: Vec4;
|
|
87
92
|
constructor(options?: IRayParams);
|
|
93
|
+
protected _updateEffectiveColors(): void;
|
|
88
94
|
/**
|
|
89
95
|
* Sets ray start position.
|
|
90
96
|
* @public
|
|
@@ -153,6 +159,18 @@ declare class Ray {
|
|
|
153
159
|
* @param {boolean} visibility - Visibility flag.
|
|
154
160
|
*/
|
|
155
161
|
setVisibility(visibility: boolean): void;
|
|
162
|
+
/**
|
|
163
|
+
* Sets ray opacity.
|
|
164
|
+
* @public
|
|
165
|
+
* @param {number} opacity - Opacity value in range [0..1].
|
|
166
|
+
*/
|
|
167
|
+
setOpacity(opacity: number): void;
|
|
168
|
+
/**
|
|
169
|
+
* Returns ray opacity multiplier.
|
|
170
|
+
* @public
|
|
171
|
+
* @returns {number}
|
|
172
|
+
*/
|
|
173
|
+
getOpacity(): number;
|
|
156
174
|
/**
|
|
157
175
|
* Returns visibility.
|
|
158
176
|
* @public
|
|
@@ -165,7 +183,7 @@ declare class Ray {
|
|
|
165
183
|
*/
|
|
166
184
|
remove(): void;
|
|
167
185
|
/**
|
|
168
|
-
*
|
|
186
|
+
* Sets picking color.
|
|
169
187
|
* @public
|
|
170
188
|
* @param {Vec3} color - Picking color.
|
|
171
189
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { TypedArray } from "
|
|
2
|
-
import { EntityCollection } from "
|
|
1
|
+
import type { TypedArray } from "../../utils/shared";
|
|
2
|
+
import { EntityCollection } from "../EntityCollection";
|
|
3
3
|
import { Ray } from "./Ray";
|
|
4
|
-
import { Renderer } from "
|
|
5
|
-
import { Vec3 } from "
|
|
6
|
-
import { Vec4 } from "
|
|
7
|
-
import type { WebGLBufferExt } from "
|
|
4
|
+
import { Renderer } from "../../renderer/Renderer";
|
|
5
|
+
import { Vec3 } from "../../math/Vec3";
|
|
6
|
+
import { Vec4 } from "../../math/Vec4";
|
|
7
|
+
import type { WebGLBufferExt } from "../../webgl/Handler";
|
|
8
|
+
import type { ShaderProgram } from "../../webgl/ShaderProgram";
|
|
8
9
|
declare class RayHandler {
|
|
9
10
|
static __counter__: number;
|
|
10
11
|
protected __id: number;
|
|
@@ -17,6 +18,7 @@ declare class RayHandler {
|
|
|
17
18
|
_entityCollection: EntityCollection;
|
|
18
19
|
protected _renderer: Renderer | null;
|
|
19
20
|
protected _rays: Ray[];
|
|
21
|
+
protected _opaqueCounterIndex: number;
|
|
20
22
|
protected _vertexBuffer: WebGLBufferExt | null;
|
|
21
23
|
protected _startPositionHighBuffer: WebGLBufferExt | null;
|
|
22
24
|
protected _startPositionLowBuffer: WebGLBufferExt | null;
|
|
@@ -43,6 +45,11 @@ declare class RayHandler {
|
|
|
43
45
|
protected _changedBuffers: boolean[];
|
|
44
46
|
constructor(entityCollection: EntityCollection);
|
|
45
47
|
static concArr(dest: number[], curr: number[]): void;
|
|
48
|
+
protected _isRayOpaque(ray: Ray): boolean;
|
|
49
|
+
protected _swapArrayItems(arr: number[] | TypedArray, itemSize: number, firstIndex: number, secondIndex: number): void;
|
|
50
|
+
protected _swapRayData(firstIndex: number, secondIndex: number): void;
|
|
51
|
+
protected _insertRayByOpacity(rayIndex: number, isOpaque: boolean): void;
|
|
52
|
+
protected _updateRayOpacityState(rayIndex: number, isOpaque: boolean): boolean;
|
|
46
53
|
reloadTextures(): void;
|
|
47
54
|
get rays(): Ray[];
|
|
48
55
|
initProgram(): void;
|
|
@@ -54,9 +61,12 @@ declare class RayHandler {
|
|
|
54
61
|
update(): void;
|
|
55
62
|
add(ray: Ray): void;
|
|
56
63
|
protected _addRayToArrays(ray: Ray): void;
|
|
57
|
-
protected _displayPASS(): void;
|
|
64
|
+
protected _displayPASS(startRayIndex: number, endRayIndex: number, rayProgram: ShaderProgram): void;
|
|
58
65
|
protected _pickingPASS(): void;
|
|
59
|
-
|
|
66
|
+
drawForward(): void;
|
|
67
|
+
drawOpaque(): void;
|
|
68
|
+
drawTransparent(): void;
|
|
69
|
+
drawTransparentForward(): void;
|
|
60
70
|
drawPicking(): void;
|
|
61
71
|
reindexRaysArray(startIndex: number): void;
|
|
62
72
|
protected _removeRay(ray: Ray): void;
|