# Auto-generated by `python -m gen` — do not edit manually.

from typing import TYPE_CHECKING, Generic, Literal

import bpy

from ...builder import BaseNode, SocketAccessor

from ...types import (
    InputBoolean,
    InputColor,
    InputFloat,
    InputGeometry,
    InputInteger,
    InputMenu,
    InputString,
    InputVector,
    InputAny,
)

from ...builder.socket import (
    BooleanSocket,
    ColorSocket,
    FloatSocket,
    GeometrySocket,
    IntegerSocket,
    MenuSocket,
    StringSocket,
    VectorSocket,
    StringSocketList,
    _T,
    _S,
)


class BlurAttribute(BaseNode, Generic[_T]):
    """
    Mix attribute values of neighboring elements

    Parameters
    ----------
    value : InputFloat
        Value
    iterations : InputInteger
        Iterations
    weight : InputFloat
        Weight

    Inputs
    ------
    i.value : FloatSocket
        Value
    i.iterations : IntegerSocket
        Iterations
    i.weight : FloatSocket
        Weight

    Outputs
    -------
    o.value : FloatSocket
        Value
    """

    _bl_idname = "GeometryNodeBlurAttribute"
    node: bpy.types.GeometryNodeBlurAttribute

    class _Inputs(SocketAccessor, Generic[_S]):
        value: _S
        """Value"""
        iterations: IntegerSocket
        """Iterations"""
        weight: FloatSocket
        """Weight"""

    class _Outputs(SocketAccessor, Generic[_S]):
        value: _S
        """Value"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs[_T]: ...
        @property
        def o(self) -> _Outputs[_T]: ...

    def __init__(
        self,
        value: InputAny = 0.0,
        iterations: InputInteger = 1,
        weight: InputFloat = 1.0,
        *,
        data_type: Literal["FLOAT", "INT", "FLOAT_VECTOR", "FLOAT_COLOR"] = "FLOAT",
    ):
        super().__init__()
        key_args = {"Value": value, "Iterations": iterations, "Weight": weight}
        self.data_type = data_type
        self._establish_links(**key_args)

    @classmethod
    def float(
        cls,
        value: InputFloat = 0.0,
        iterations: InputInteger = 1,
        weight: InputFloat = 1.0,
    ) -> "BlurAttribute[FloatSocket]":
        """Create Blur Attribute with operation 'Float'. Floating-point value"""
        return BlurAttribute(
            data_type="FLOAT", value=value, iterations=iterations, weight=weight
        )

    @classmethod
    def integer(
        cls,
        value: InputInteger = 0,
        iterations: InputInteger = 1,
        weight: InputFloat = 1.0,
    ) -> "BlurAttribute[IntegerSocket]":
        """Create Blur Attribute with operation 'Integer'. 32-bit integer"""
        return BlurAttribute(
            data_type="INT", value=value, iterations=iterations, weight=weight
        )

    @classmethod
    def vector(
        cls,
        value: InputVector = None,
        iterations: InputInteger = 1,
        weight: InputFloat = 1.0,
    ) -> "BlurAttribute[VectorSocket]":
        """Create Blur Attribute with operation 'Vector'. 3D vector with floating-point values"""
        return BlurAttribute(
            data_type="FLOAT_VECTOR", value=value, iterations=iterations, weight=weight
        )

    @classmethod
    def color(
        cls,
        value: InputColor = None,
        iterations: InputInteger = 1,
        weight: InputFloat = 1.0,
    ) -> "BlurAttribute[ColorSocket]":
        """Create Blur Attribute with operation 'Color'. RGBA color with 32-bit floating-point values"""
        return BlurAttribute(
            data_type="FLOAT_COLOR", value=value, iterations=iterations, weight=weight
        )

    @property
    def data_type(self) -> Literal["FLOAT", "INT", "FLOAT_VECTOR", "FLOAT_COLOR"]:
        return self.node.data_type  # ty: ignore[invalid-return-type]

    @data_type.setter
    def data_type(self, value: Literal["FLOAT", "INT", "FLOAT_VECTOR", "FLOAT_COLOR"]):
        self.node.data_type = value


class DomainSize(BaseNode):
    """
    Retrieve the number of elements in a geometry for each attribute domain

    Parameters
    ----------
    geometry : InputGeometry
        Geometry

    Inputs
    ------
    i.geometry : GeometrySocket
        Geometry

    Outputs
    -------
    o.point_count : IntegerSocket
        Point Count
    o.edge_count : IntegerSocket
        Edge Count
    o.face_count : IntegerSocket
        Face Count
    o.face_corner_count : IntegerSocket
        Face Corner Count
    o.spline_count : IntegerSocket
        Spline Count
    o.instance_count : IntegerSocket
        Instance Count
    o.layer_count : IntegerSocket
        Layer Count
    """

    _bl_idname = "GeometryNodeAttributeDomainSize"
    node: bpy.types.GeometryNodeAttributeDomainSize

    class _Inputs(SocketAccessor):
        geometry: GeometrySocket
        """Geometry"""

    class _Outputs(SocketAccessor):
        point_count: IntegerSocket
        """Point Count"""
        edge_count: IntegerSocket
        """Edge Count"""
        face_count: IntegerSocket
        """Face Count"""
        face_corner_count: IntegerSocket
        """Face Corner Count"""
        spline_count: IntegerSocket
        """Spline Count"""
        instance_count: IntegerSocket
        """Instance Count"""
        layer_count: IntegerSocket
        """Layer Count"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        geometry: InputGeometry = None,
        *,
        component: Literal[
            "MESH", "POINTCLOUD", "CURVE", "INSTANCES", "GREASEPENCIL"
        ] = "MESH",
    ):
        super().__init__()
        key_args = {"Geometry": geometry}
        self.component = component
        self._establish_links(**key_args)

    @property
    def component(
        self,
    ) -> Literal["MESH", "POINTCLOUD", "CURVE", "INSTANCES", "GREASEPENCIL"]:
        return self.node.component

    @component.setter
    def component(
        self, value: Literal["MESH", "POINTCLOUD", "CURVE", "INSTANCES", "GREASEPENCIL"]
    ):
        self.node.component = value


class GetAttributeNames(BaseNode):
    """
    Retrieves attribute names as a list of strings

    Parameters
    ----------
    geometry : InputGeometry
        Geometry
    filter_data_type : InputBoolean
        Filter Data Type
    data_type : InputMenu | Literal['Float', 'Integer', 'Boolean', 'Vector', 'Color', 'Quaternion', '4x4 Matrix', 'String', '8-Bit Integer', '2D 16-Bit Integer Vector', '2D Integer Vector', '2D Vector', '4D Vector', 'Byte Color']
        Data Type
    filter_domain : InputBoolean
        Filter Domain
    domain : InputMenu | Literal['Point', 'Edge', 'Face', 'Face Corner', 'Spline', 'Instance', 'Layer']
        Domain

    Inputs
    ------
    i.geometry : GeometrySocket
        Geometry
    i.filter_data_type : BooleanSocket
        Filter Data Type
    i.data_type : MenuSocket
        Data Type
    i.filter_domain : BooleanSocket
        Filter Domain
    i.domain : MenuSocket
        Domain

    Outputs
    -------
    o.names : StringSocket
        Names
    """

    _bl_idname = "GeometryNodeGetAttributeNames"
    node: bpy.types.GeometryNodeGetAttributeNames  # ty: ignore[unresolved-attribute]

    class _Inputs(SocketAccessor):
        geometry: GeometrySocket
        """Geometry"""
        filter_data_type: BooleanSocket
        """Filter Data Type"""
        data_type: MenuSocket
        """Data Type"""
        filter_domain: BooleanSocket
        """Filter Domain"""
        domain: MenuSocket
        """Domain"""

    class _Outputs(SocketAccessor):
        names: StringSocketList
        """Names"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        geometry: InputGeometry = None,
        filter_data_type: InputBoolean = False,
        data_type: InputMenu
        | Literal[
            "Float",
            "Integer",
            "Boolean",
            "Vector",
            "Color",
            "Quaternion",
            "4x4 Matrix",
            "String",
            "8-Bit Integer",
            "2D 16-Bit Integer Vector",
            "2D Integer Vector",
            "2D Vector",
            "4D Vector",
            "Byte Color",
        ] = "Float",
        filter_domain: InputBoolean = False,
        domain: InputMenu
        | Literal[
            "Point", "Edge", "Face", "Face Corner", "Spline", "Instance", "Layer"
        ] = "Point",
    ):
        super().__init__()
        key_args = {
            "Geometry": geometry,
            "Filter Data Type": filter_data_type,
            "Data Type": data_type,
            "Filter Domain": filter_domain,
            "Domain": domain,
        }

        self._establish_links(**key_args)


class RemoveNamedAttribute(BaseNode):
    """
    Delete an attribute with a specified name from a geometry. Typically used to optimize performance

    Parameters
    ----------
    geometry : InputGeometry
        Geometry
    pattern_mode : InputMenu | Literal['Exact', 'Wildcard']
        Pattern Mode
    name : InputString
        Name

    Inputs
    ------
    i.geometry : GeometrySocket
        Geometry
    i.pattern_mode : MenuSocket
        Pattern Mode
    i.name : StringSocket
        Name

    Outputs
    -------
    o.geometry : GeometrySocket
        Geometry
    """

    _bl_idname = "GeometryNodeRemoveAttribute"
    node: bpy.types.GeometryNodeRemoveAttribute

    class _Inputs(SocketAccessor):
        geometry: GeometrySocket
        """Geometry"""
        pattern_mode: MenuSocket
        """Pattern Mode"""
        name: StringSocket
        """Name"""

    class _Outputs(SocketAccessor):
        geometry: GeometrySocket
        """Geometry"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        geometry: InputGeometry = None,
        pattern_mode: InputMenu | Literal["Exact", "Wildcard"] = "Exact",
        name: InputString = "",
    ):
        super().__init__()
        key_args = {"Geometry": geometry, "Pattern Mode": pattern_mode, "Name": name}

        self._establish_links(**key_args)
