Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make overlay initialization array optional and bump Reveal version to 4.15.1 #4640

Merged
merged 5 commits into from
Jun 25, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion viewer/packages/3d-overlays/src/Overlay3DCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ export class Overlay3DCollection<MetadataType = DefaultOverlay3DContentType>
private readonly _rayCaster = new Raycaster();
private readonly _cameraChangeDebouncer = new CameraChangeThrottler();

/**
* Construct a collection of 3D overlay icons
*
* @param overlayInfos Initializes the collection with the list of overlays. The length
* of the list will be the maximum allowed number of icons in this collection, unless it's empty,
* in which case a default maximum limit will be used instead
* @param options Additional options for this overlay collection
*/
constructor(overlayInfos: OverlayInfo<MetadataType>[], options?: Overlay3DCollectionOptions) {
super();

Expand All @@ -69,7 +77,7 @@ export class Overlay3DCollection<MetadataType = DefaultOverlay3DContentType>
};

this._overlayPoints = new OverlayPointsObject(
overlayInfos ? overlayInfos.length : this.DefaultMaxPoints,
overlayInfos.length > 0 ? overlayInfos.length : this.DefaultMaxPoints,
{
spriteTexture: this._sharedTextures.color,
maskTexture: this._sharedTextures.mask,
Expand Down
Loading