All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ru.casperix.math.mesh.SpatialMap.kt Maven / Gradle / Ivy

package ru.casperix.math.mesh

import ru.casperix.math.axis_aligned.float32.Box2f
import ru.casperix.math.curve.float32.Circle2f
import ru.casperix.math.geometry.Polygon2f
import ru.casperix.math.straight_line.float32.LineSegment2f
import ru.casperix.math.vector.float32.Vector2f


interface SpatialMap {
    fun clear()

    fun all(): List

    fun add(element: Element)
    fun remove(element: Element)

    fun has(element: Element): Boolean

    fun search(area: Box2f): Collection

    fun search(area: Circle2f): Collection

    fun search(area: Polygon2f): Collection
    fun search(area: LineSegment2f): Collection


    fun search(center: Vector2f, range: Float): Collection {
        return search(Circle2f(center, range))
    }

    fun addAll(elements: Collection) {
        elements.forEach {
            add(it)
        }
    }

    fun removeAll(elements: Collection) {
        elements.forEach {
            remove(it)
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy