package me.eater.threedom.dom

import me.eater.threedom.dom.render.IRenderNode
import me.eater.threedom.dom.render.IRenderTarget
import org.joml.Vector3dc

interface INodeQueryCapable {
    /**
     * Get node inside this node by [id]
     */
    fun getNodeById(id: String): INode<*>?

    /**
     * Get all nodes inside this node with the class [tagName]
     */
    fun getNodesByTag(tagName: String): Sequence<INode<*>>

    /**
     * Get all nodes inside this node with the Java class [className]
     */
    fun <T : INode<T>> getNodesByClass(className: String): Sequence<T>

    /**
     * Get all nodes inside this node with the render target with type of [targetType]s
     */
    fun <T : IRenderTarget<C>, C> getNodesByRenderTarget(targetType: String): Sequence<IRenderNode<*, T, C>>

    /**
     * find all nodes inside this node in region between [pointA] and [pointB]
     */
    fun findInRegion(pointA: Vector3dc, pointB: Vector3dc): Sequence<INode<*>>

    /**
     * find all nodes inside this node in [range] of [origin]
     */
    fun findInRange(origin: Vector3dc, range: Number): Sequence<INode<*>>
}
