跳到主要内容

flywave-terrain-datasource.groundmodificationmanager

Home > @flywave/flywave-terrain-datasource > GroundModificationManager

GroundModificationManager class

Manages ground modification polygons with spatial indexing and event system

This class handles the creation, modification, and querying of ground modifications such as excavations and elevations. It maintains spatial indexing for efficient querying and provides events for change notifications.

The manager supports various types of geographic areas including bounding boxes, polygons, and line strings, and provides methods for spatial queries like finding modifications that intersect with a given area or contain a specific point.

Signature:

export declare class GroundModificationManager extends EventDispatcher<GroundModificationEvents> 

Extends: EventDispatcher<GroundModificationEvents>

Constructors

Constructor

Modifiers

Description

(constructor)(terrainSource)

Creates a new GroundModificationManager

Properties

Property

Modifiers

Type

Description

krigingOptions

GroundModificationOptions

Gets the global kriging interpolation configuration parameters

Methods

Method

Modifiers

Description

addModification(type, boundary, slopeWidth, depthOrHeight)

Adds a new ground modification polygon

This method creates a new ground modification with the specified parameters and adds it to the manager. It performs validation on the input parameters and updates the spatial index.

clear()

Clears all modifications

This method removes all ground modifications from the manager, resets the spatial index, and dispatches a clear event.

findModificationsContainingPoint(point)

Finds modifications that contain the given point

This method performs a spatial query to find all ground modifications that contain the specified geographic point. It first filters by bounding box for quick rejection, then performs exact polygon containment tests for the remaining candidates.

findModificationsInBoundingBox(bbox)

Finds modifications that intersect with the given bounding box

This method performs a spatial query to find all ground modifications whose bounding boxes intersect with the specified bounding box.

getAllModifications()

Gets all modifications

This method returns an array containing all ground modifications currently managed by this manager.

getGlobalBoundingBox()

Gets the global bounding box containing all modifications

This method returns the overall spatial extent of all ground modifications managed by this manager.

getModification(id)

Gets a modification by ID

This method retrieves a ground modification by its unique identifier.

removeModification(id)

Removes a modification by ID

This method removes a ground modification from the manager by its ID. It updates the spatial index and dispatches a change event.

updateModification(id, changes)

Updates an existing modification

This method updates the properties of an existing ground modification. It performs validation on the new values and updates the spatial index if necessary. A change event is dispatched with information about what was updated.