"""HobbingProcessTotalModificationCalculation"""

from __future__ import annotations

from typing import TYPE_CHECKING, ClassVar

from mastapy._private._internal.dataclasses import extended_dataclass
from mastapy._private._internal.exception_bridge import exception_bridge
from mastapy._private._internal.exceptions import CastException
from mastapy._private._internal.python_net import (
    python_net_import,
    pythonnet_property_get,
    pythonnet_property_set,
)
from mastapy._private._internal.type_enforcement import enforce_parameter_types

from mastapy._private._internal import constructor, utility
from mastapy._private.gears.manufacturing.cylindrical.hobbing_process_simulation_new import (
    _792,
)

_HOBBING_PROCESS_TOTAL_MODIFICATION_CALCULATION = python_net_import(
    "SMT.MastaAPI.Gears.Manufacturing.Cylindrical.HobbingProcessSimulationNew",
    "HobbingProcessTotalModificationCalculation",
)

if TYPE_CHECKING:
    from typing import Any, Type, TypeVar

    from mastapy._private.gears.manufacturing.cylindrical.hobbing_process_simulation_new import (
        _806,
    )
    from mastapy._private.utility_gui.charts import _2104

    Self = TypeVar("Self", bound="HobbingProcessTotalModificationCalculation")
    CastSelf = TypeVar(
        "CastSelf",
        bound="HobbingProcessTotalModificationCalculation._Cast_HobbingProcessTotalModificationCalculation",
    )


__docformat__ = "restructuredtext en"
__all__ = ("HobbingProcessTotalModificationCalculation",)


@extended_dataclass(frozen=True, slots=True, weakref_slot=True)
class _Cast_HobbingProcessTotalModificationCalculation:
    """Special nested class for casting HobbingProcessTotalModificationCalculation to subclasses."""

    __parent__: "HobbingProcessTotalModificationCalculation"

    @property
    def hobbing_process_calculation(
        self: "CastSelf",
    ) -> "_792.HobbingProcessCalculation":
        return self.__parent__._cast(_792.HobbingProcessCalculation)

    @property
    def process_calculation(self: "CastSelf") -> "_806.ProcessCalculation":
        from mastapy._private.gears.manufacturing.cylindrical.hobbing_process_simulation_new import (
            _806,
        )

        return self.__parent__._cast(_806.ProcessCalculation)

    @property
    def hobbing_process_total_modification_calculation(
        self: "CastSelf",
    ) -> "HobbingProcessTotalModificationCalculation":
        return self.__parent__

    def __getattr__(self: "CastSelf", name: str) -> "Any":
        try:
            return self.__getattribute__(name)
        except AttributeError:
            class_name = utility.camel(name)
            raise CastException(
                f'Detected an invalid cast. Cannot cast to type "{class_name}"'
            ) from None


@extended_dataclass(frozen=True, slots=True, weakref_slot=True, eq=False)
class HobbingProcessTotalModificationCalculation(_792.HobbingProcessCalculation):
    """HobbingProcessTotalModificationCalculation

    This is a mastapy class.
    """

    TYPE: ClassVar["Type"] = _HOBBING_PROCESS_TOTAL_MODIFICATION_CALCULATION

    wrapped: "Any"

    def __post_init__(self: "Self") -> None:
        """Override of the post initialisation magic method."""
        if not hasattr(self.wrapped, "reference_count"):
            self.wrapped.reference_count = 0

        self.wrapped.reference_count += 1

    @property
    @exception_bridge
    def lead_range_max(self: "Self") -> "float":
        """float"""
        temp = pythonnet_property_get(self.wrapped, "LeadRangeMax")

        if temp is None:
            return 0.0

        return temp

    @lead_range_max.setter
    @exception_bridge
    @enforce_parameter_types
    def lead_range_max(self: "Self", value: "float") -> None:
        pythonnet_property_set(
            self.wrapped, "LeadRangeMax", float(value) if value is not None else 0.0
        )

    @property
    @exception_bridge
    def lead_range_min(self: "Self") -> "float":
        """float"""
        temp = pythonnet_property_get(self.wrapped, "LeadRangeMin")

        if temp is None:
            return 0.0

        return temp

    @lead_range_min.setter
    @exception_bridge
    @enforce_parameter_types
    def lead_range_min(self: "Self", value: "float") -> None:
        pythonnet_property_set(
            self.wrapped, "LeadRangeMin", float(value) if value is not None else 0.0
        )

    @property
    @exception_bridge
    def number_of_lead_bands(self: "Self") -> "int":
        """int"""
        temp = pythonnet_property_get(self.wrapped, "NumberOfLeadBands")

        if temp is None:
            return 0

        return temp

    @number_of_lead_bands.setter
    @exception_bridge
    @enforce_parameter_types
    def number_of_lead_bands(self: "Self", value: "int") -> None:
        pythonnet_property_set(
            self.wrapped, "NumberOfLeadBands", int(value) if value is not None else 0
        )

    @property
    @exception_bridge
    def number_of_profile_bands(self: "Self") -> "int":
        """int"""
        temp = pythonnet_property_get(self.wrapped, "NumberOfProfileBands")

        if temp is None:
            return 0

        return temp

    @number_of_profile_bands.setter
    @exception_bridge
    @enforce_parameter_types
    def number_of_profile_bands(self: "Self", value: "int") -> None:
        pythonnet_property_set(
            self.wrapped, "NumberOfProfileBands", int(value) if value is not None else 0
        )

    @property
    @exception_bridge
    def total_errors_chart_left_flank(self: "Self") -> "_2104.ThreeDChartDefinition":
        """mastapy.utility_gui.charts.ThreeDChartDefinition

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "TotalErrorsChartLeftFlank")

        if temp is None:
            return None

        type_ = temp.GetType()
        return constructor.new(type_.Namespace, type_.Name)(temp)

    @property
    @exception_bridge
    def total_errors_chart_right_flank(self: "Self") -> "_2104.ThreeDChartDefinition":
        """mastapy.utility_gui.charts.ThreeDChartDefinition

        Note:
            This property is readonly.
        """
        temp = pythonnet_property_get(self.wrapped, "TotalErrorsChartRightFlank")

        if temp is None:
            return None

        type_ = temp.GetType()
        return constructor.new(type_.Namespace, type_.Name)(temp)

    @property
    def cast_to(self: "Self") -> "_Cast_HobbingProcessTotalModificationCalculation":
        """Cast to another type.

        Returns:
            _Cast_HobbingProcessTotalModificationCalculation
        """
        return _Cast_HobbingProcessTotalModificationCalculation(self)
