"""ens_tool_line module

The ens_tool_line module provides a proxy interface to EnSight ENS_TOOL_LINE instances

"""
from ansys.pyensight.core.session import Session
from ansys.pyensight.core.ensobj import ENSOBJ
from ansys.pyensight.core import ensobjlist
from ansys.api.pyensight.ens_tool import ENS_TOOL
from typing import Any, Dict, List, Type, Union, Optional, Tuple, TYPE_CHECKING, cast

if TYPE_CHECKING:
    from ansys.api.pyensight.ensight_api import ENS_VAR, ENS_ANNOT, ENS_PALETTE, ENS_PART, ENS_SOURCE, ENS_CASE, ENS_QUERY, ENS_GROUP, ENS_TOOL, ENS_TEXTURE, ENS_VPORT, ENS_PLOTTER, ENS_POLYLINE, ENS_FRAME, ENS_PROBE, ENS_FLIPBOOK, ENS_SCENE, ENS_LPART, ENS_STATE, ens_emitterobj

class ENS_TOOL_LINE(ENS_TOOL):
    """This class acts as a proxy for the EnSight Python class ensight.objs.ENS_TOOL

    Args:
        \*args:
            Superclass (ENS_TOOL) arguments
        \**kwargs:
            Superclass (ENS_TOOL) keyword arguments

    """

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)
        self._update_attr_list(self._session, self._objid)

    @classmethod
    def _update_attr_list(cls, session: 'Session', id: int) -> None:
        if hasattr(cls, 'attr_list'):
            return
        cmd = session.remote_obj(id) + '.__ids__'
        cls.attr_list = session.cmd(cmd)

    @property
    def objid(self) -> int:  # noqa: N802
        """
        Return the EnSight object proxy ID (__OBJID__).
        """
        return self._objid

    def attrgroupinfo(self, *args, **kwargs) -> Any:
        """Get information about GUI groups for this tool's attributes

        """
        arg_obj = f"{self._remote_obj()}"
        arg_list: List[str] = []
        for arg in args:
            arg_list.append(arg.__repr__())
        for key, value in kwargs.items():
            arg_list.append(f"{key}={value.__repr__()}")
        arg_string = ",".join(arg_list)
        cmd = f"{arg_obj}.attrgroupinfo({arg_string})"
        return self._session.cmd(cmd)

    def rawdata(self, *args, **kwargs) -> Any:
        """Get/set the tool location using the raw location form

        """
        arg_obj = f"{self._remote_obj()}"
        arg_list: List[str] = []
        for arg in args:
            arg_list.append(arg.__repr__())
        for key, value in kwargs.items():
            arg_list.append(f"{key}={value.__repr__()}")
        arg_string = ",".join(arg_list)
        cmd = f"{arg_obj}.rawdata({arg_string})"
        return self._session.cmd(cmd)

    def fit_to_selected(self, *args, **kwargs) -> Any:
        """Set the box tool to span the selected parts

        """
        arg_obj = f"{self._remote_obj()}"
        arg_list: List[str] = []
        for arg in args:
            arg_list.append(arg.__repr__())
        for key, value in kwargs.items():
            arg_list.append(f"{key}={value.__repr__()}")
        arg_string = ",".join(arg_list)
        cmd = f"{arg_obj}.fit_to_selected({arg_string})"
        return self._session.cmd(cmd)

    @property
    def METADATA(self) -> Dict[Any, Any]:
        """METADATA property
        
        metadata
        
        Supported operations:
            getattr
        Datatype:
            CEI Metadata, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.METADATA)
        _value = cast(Dict[Any, Any], value)
        return _value

    @property
    def metadata(self) -> Dict[Any, Any]:
        """METADATA property
        
        metadata
        
        Supported operations:
            getattr
        Datatype:
            CEI Metadata, scalar
        
        Note: both 'metadata' and 'METADATA' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.METADATA)
        _value = cast(Dict[Any, Any], value)
        return _value

    @property
    def UUID(self) -> str:
        """UUID property
        
        universal unique id
        
        Supported operations:
            getattr
        Datatype:
            String, 37 characters maximum
        
        """
        value = self.getattr(self._session.ensight.objs.enums.UUID)
        _value = cast(str, value)
        return _value

    @property
    def uuid(self) -> str:
        """UUID property
        
        universal unique id
        
        Supported operations:
            getattr
        Datatype:
            String, 37 characters maximum
        
        Note: both 'uuid' and 'UUID' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.UUID)
        _value = cast(str, value)
        return _value

    @property
    def EDIT_TARGET(self) -> int:
        """EDIT_TARGET property
        
        currently an edit target
        
        Supported operations:
            getattr
        Datatype:
            Boolean, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.EDIT_TARGET)
        _value = cast(int, value)
        return _value

    @property
    def edit_target(self) -> int:
        """EDIT_TARGET property
        
        currently an edit target
        
        Supported operations:
            getattr
        Datatype:
            Boolean, scalar
        
        Note: both 'edit_target' and 'EDIT_TARGET' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.EDIT_TARGET)
        _value = cast(int, value)
        return _value

    @property
    def PROJECT_MASK(self) -> int:
        """PROJECT_MASK property
        
        object project mask
        
        Supported operations:
            getattr, setattr
        Datatype:
            64bit integer, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.PROJECT_MASK)
        _value = cast(int, value)
        return _value

    @PROJECT_MASK.setter
    def PROJECT_MASK(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.PROJECT_MASK, value)

    @property
    def project_mask(self) -> int:
        """PROJECT_MASK property
        
        object project mask
        
        Supported operations:
            getattr, setattr
        Datatype:
            64bit integer, scalar
        
        Note: both 'project_mask' and 'PROJECT_MASK' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.PROJECT_MASK)
        _value = cast(int, value)
        return _value

    @project_mask.setter
    def project_mask(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.PROJECT_MASK, value)

    @property
    def HANDLES_ENABLED(self) -> int:
        """Control the display and use of EnSight click and go handles for an object
        
        EnSight allows for direct interaction with many objects via click and go handles.
        The handles allow things like annotations and viewports to be moved or resized.
        They allow for the adjustment of values for clip planes and palette dynamic ranges.
        In some situations, allowing the user to directly adjust these values can be
        undesirable.  Setting this attribute to zero disables display of and interaction
        with click and go handles for the specific object instance.
        
        """
        value = self.getattr(self._session.ensight.objs.enums.HANDLES_ENABLED)
        _value = cast(int, value)
        return _value

    @HANDLES_ENABLED.setter
    def HANDLES_ENABLED(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.HANDLES_ENABLED, value)

    @property
    def handles_enabled(self) -> int:
        """Control the display and use of EnSight click and go handles for an object
        
        EnSight allows for direct interaction with many objects via click and go handles.
        The handles allow things like annotations and viewports to be moved or resized.
        They allow for the adjustment of values for clip planes and palette dynamic ranges.
        In some situations, allowing the user to directly adjust these values can be
        undesirable.  Setting this attribute to zero disables display of and interaction
        with click and go handles for the specific object instance.
        
        Note: both 'handles_enabled' and 'HANDLES_ENABLED' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.HANDLES_ENABLED)
        _value = cast(int, value)
        return _value

    @handles_enabled.setter
    def handles_enabled(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.HANDLES_ENABLED, value)

    @property
    def TOOLTYPE(self) -> int:
        """TOOLTYPE property
        
        tool type
        
        Supported operations:
            getattr
        Datatype:
            Enum, scalar
        Enums:
            * ensight.objs.enums.TOOL_CURSOR - cursor tool
            * ensight.objs.enums.TOOL_LINE - line tool
            * ensight.objs.enums.TOOL_PLANE - plane tool
            * ensight.objs.enums.TOOL_BOX - box tool
            * ensight.objs.enums.TOOL_CYLINDER - cylinder tool
            * ensight.objs.enums.TOOL_CONE - cone tool
            * ensight.objs.enums.TOOL_SPHERE - sphere tool
            * ensight.objs.enums.TOOL_REVOLUTION - revolution tool
            * ensight.objs.enums.TOOL_USERDEFINED - userdefined tool
        
        """
        value = self.getattr(self._session.ensight.objs.enums.TOOLTYPE)
        _value = cast(int, value)
        return _value

    @property
    def tooltype(self) -> int:
        """TOOLTYPE property
        
        tool type
        
        Supported operations:
            getattr
        Datatype:
            Enum, scalar
        Enums:
            * ensight.objs.enums.TOOL_CURSOR - cursor tool
            * ensight.objs.enums.TOOL_LINE - line tool
            * ensight.objs.enums.TOOL_PLANE - plane tool
            * ensight.objs.enums.TOOL_BOX - box tool
            * ensight.objs.enums.TOOL_CYLINDER - cylinder tool
            * ensight.objs.enums.TOOL_CONE - cone tool
            * ensight.objs.enums.TOOL_SPHERE - sphere tool
            * ensight.objs.enums.TOOL_REVOLUTION - revolution tool
            * ensight.objs.enums.TOOL_USERDEFINED - userdefined tool
        
        Note: both 'tooltype' and 'TOOLTYPE' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.TOOLTYPE)
        _value = cast(int, value)
        return _value

    @property
    def INDEX(self) -> int:
        """INDEX property
        
        tool index
        
        Supported operations:
            getattr
        Datatype:
            Integer, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.INDEX)
        _value = cast(int, value)
        return _value

    @property
    def index(self) -> int:
        """INDEX property
        
        tool index
        
        Supported operations:
            getattr
        Datatype:
            Integer, scalar
        
        Note: both 'index' and 'INDEX' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.INDEX)
        _value = cast(int, value)
        return _value

    @property
    def SELECTED(self) -> int:
        """SELECTED property
        
        selected
        
        Supported operations:
            getattr, setattr
        Datatype:
            Boolean, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.SELECTED)
        _value = cast(int, value)
        return _value

    @SELECTED.setter
    def SELECTED(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.SELECTED, value)

    @property
    def selected(self) -> int:
        """SELECTED property
        
        selected
        
        Supported operations:
            getattr, setattr
        Datatype:
            Boolean, scalar
        
        Note: both 'selected' and 'SELECTED' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.SELECTED)
        _value = cast(int, value)
        return _value

    @selected.setter
    def selected(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.SELECTED, value)

    @property
    def DESCRIPTION(self) -> str:
        """DESCRIPTION property
        
        description
        
        Supported operations:
            getattr, setattr
        Datatype:
            String, 256 characters maximum
        
        """
        value = self.getattr(self._session.ensight.objs.enums.DESCRIPTION)
        _value = cast(str, value)
        return _value

    @DESCRIPTION.setter
    def DESCRIPTION(self, value: str) -> None:
        self.setattr(self._session.ensight.objs.enums.DESCRIPTION, value)

    @property
    def description(self) -> str:
        """DESCRIPTION property
        
        description
        
        Supported operations:
            getattr, setattr
        Datatype:
            String, 256 characters maximum
        
        Note: both 'description' and 'DESCRIPTION' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.DESCRIPTION)
        _value = cast(str, value)
        return _value

    @description.setter
    def description(self, value: str) -> None:
        self.setattr(self._session.ensight.objs.enums.DESCRIPTION, value)

    @property
    def VISIBLE(self) -> int:
        """VISIBLE property
        
        visible
        
        Supported operations:
            getattr, setattr
        Datatype:
            Boolean, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.VISIBLE)
        _value = cast(int, value)
        return _value

    @VISIBLE.setter
    def VISIBLE(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.VISIBLE, value)

    @property
    def visible(self) -> int:
        """VISIBLE property
        
        visible
        
        Supported operations:
            getattr, setattr
        Datatype:
            Boolean, scalar
        
        Note: both 'visible' and 'VISIBLE' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.VISIBLE)
        _value = cast(int, value)
        return _value

    @visible.setter
    def visible(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.VISIBLE, value)

    @property
    def CORE(self) -> int:
        """CORE property
        
        core tool
        
        Supported operations:
            getattr
        Datatype:
            Boolean, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.CORE)
        _value = cast(int, value)
        return _value

    @property
    def core(self) -> int:
        """CORE property
        
        core tool
        
        Supported operations:
            getattr
        Datatype:
            Boolean, scalar
        
        Note: both 'core' and 'CORE' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.CORE)
        _value = cast(int, value)
        return _value

    @property
    def POINT1(self) -> List[float]:
        """POINT1 property
        
        start point
        
        Supported operations:
            getattr, setattr
        Datatype:
            Float, 3 element array
        
        """
        value = self.getattr(self._session.ensight.objs.enums.POINT1)
        _value = cast(List[float], value)
        return _value

    @POINT1.setter
    def POINT1(self, value: List[float]) -> None:
        self.setattr(self._session.ensight.objs.enums.POINT1, value)

    @property
    def point1(self) -> List[float]:
        """POINT1 property
        
        start point
        
        Supported operations:
            getattr, setattr
        Datatype:
            Float, 3 element array
        
        Note: both 'point1' and 'POINT1' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.POINT1)
        _value = cast(List[float], value)
        return _value

    @point1.setter
    def point1(self, value: List[float]) -> None:
        self.setattr(self._session.ensight.objs.enums.POINT1, value)

    @property
    def POINT2(self) -> List[float]:
        """POINT2 property
        
        end point
        
        Supported operations:
            getattr, setattr
        Datatype:
            Float, 3 element array
        
        """
        value = self.getattr(self._session.ensight.objs.enums.POINT2)
        _value = cast(List[float], value)
        return _value

    @POINT2.setter
    def POINT2(self, value: List[float]) -> None:
        self.setattr(self._session.ensight.objs.enums.POINT2, value)

    @property
    def point2(self) -> List[float]:
        """POINT2 property
        
        end point
        
        Supported operations:
            getattr, setattr
        Datatype:
            Float, 3 element array
        
        Note: both 'point2' and 'POINT2' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.POINT2)
        _value = cast(List[float], value)
        return _value

    @point2.setter
    def point2(self, value: List[float]) -> None:
        self.setattr(self._session.ensight.objs.enums.POINT2, value)

    @property
    def SNAP_SURF(self) -> int:
        """SNAP_SURF property
        
        snap to surface
        
        Supported operations:
            getattr, setattr
        Datatype:
            Boolean, scalar
        
        """
        value = self.getattr(self._session.ensight.objs.enums.SNAP_SURF)
        _value = cast(int, value)
        return _value

    @SNAP_SURF.setter
    def SNAP_SURF(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.SNAP_SURF, value)

    @property
    def snap_surf(self) -> int:
        """SNAP_SURF property
        
        snap to surface
        
        Supported operations:
            getattr, setattr
        Datatype:
            Boolean, scalar
        
        Note: both 'snap_surf' and 'SNAP_SURF' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.SNAP_SURF)
        _value = cast(int, value)
        return _value

    @snap_surf.setter
    def snap_surf(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.SNAP_SURF, value)

    @property
    def SNAP_NORM(self) -> int:
        """SNAP_NORM property
        
        snap normal direction
        
        Supported operations:
            getattr, setattr
        Datatype:
            Enum, scalar
        Enums:
            * ensight.objs.enums.POSITIVE_SURFACE_DIRECTION - positive
            * ensight.objs.enums.NEGATIVE_SURFACE_DIRECTION - negative
        
        """
        value = self.getattr(self._session.ensight.objs.enums.SNAP_NORM)
        _value = cast(int, value)
        return _value

    @SNAP_NORM.setter
    def SNAP_NORM(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.SNAP_NORM, value)

    @property
    def snap_norm(self) -> int:
        """SNAP_NORM property
        
        snap normal direction
        
        Supported operations:
            getattr, setattr
        Datatype:
            Enum, scalar
        Enums:
            * ensight.objs.enums.POSITIVE_SURFACE_DIRECTION - positive
            * ensight.objs.enums.NEGATIVE_SURFACE_DIRECTION - negative
        
        Note: both 'snap_norm' and 'SNAP_NORM' property names are supported.
        """
        value = self.getattr(self._session.ensight.objs.enums.SNAP_NORM)
        _value = cast(int, value)
        return _value

    @snap_norm.setter
    def snap_norm(self, value: int) -> None:
        self.setattr(self._session.ensight.objs.enums.SNAP_NORM, value)
