"""AlignConnectedComponentOptions"""
from __future__ import annotations

from typing import TypeVar, List

from mastapy._internal.type_enforcement import enforce_parameter_types
from mastapy._internal import constructor, conversion, enum_with_selected_value_runtime
from mastapy._internal.implicit import enum_with_selected_value
from mastapy.system_model.fe import _2386
from mastapy.math_utility import _1510, _1509
from mastapy import _0
from mastapy._internal.cast_exception import CastException
from mastapy._internal.python_net import python_net_import

_ALIGN_CONNECTED_COMPONENT_OPTIONS = python_net_import(
    "SMT.MastaAPI.SystemModel.FE", "AlignConnectedComponentOptions"
)


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


Self = TypeVar("Self", bound="AlignConnectedComponentOptions")


class AlignConnectedComponentOptions(_0.APIBase):
    """AlignConnectedComponentOptions

    This is a mastapy class.
    """

    TYPE = _ALIGN_CONNECTED_COMPONENT_OPTIONS
    _CastSelf = TypeVar("_CastSelf", bound="_Cast_AlignConnectedComponentOptions")

    class _Cast_AlignConnectedComponentOptions:
        """Special nested class for casting AlignConnectedComponentOptions to subclasses."""

        def __init__(
            self: "AlignConnectedComponentOptions._Cast_AlignConnectedComponentOptions",
            parent: "AlignConnectedComponentOptions",
        ):
            self._parent = parent

        @property
        def align_connected_component_options(
            self: "AlignConnectedComponentOptions._Cast_AlignConnectedComponentOptions",
        ) -> "AlignConnectedComponentOptions":
            return self._parent

        def __getattr__(
            self: "AlignConnectedComponentOptions._Cast_AlignConnectedComponentOptions",
            name: str,
        ):
            try:
                return self.__dict__[name]
            except KeyError:
                class_name = "".join(n.capitalize() for n in name.split("_"))
                raise CastException(
                    f'Detected an invalid cast. Cannot cast to type "{class_name}"'
                ) from None

    def __init__(self: Self, instance_to_wrap: "AlignConnectedComponentOptions.TYPE"):
        super().__init__(instance_to_wrap)
        self._freeze()

    @property
    def component_direction_normal_to_surface(self: Self) -> "_1510.Axis":
        """mastapy.math_utility.Axis"""
        temp = self.wrapped.ComponentDirectionNormalToSurface

        if temp is None:
            return None

        value = conversion.pn_to_mp_enum(temp, "SMT.MastaAPI.MathUtility.Axis")

        if value is None:
            return None

        return constructor.new_from_mastapy("mastapy.math_utility._1510", "Axis")(value)

    @component_direction_normal_to_surface.setter
    @enforce_parameter_types
    def component_direction_normal_to_surface(self: Self, value: "_1510.Axis"):
        value = conversion.mp_to_pn_enum(value, "SMT.MastaAPI.MathUtility.Axis")
        self.wrapped.ComponentDirectionNormalToSurface = value

    @property
    def component_orientation(
        self: Self,
    ) -> "enum_with_selected_value.EnumWithSelectedValue_ComponentOrientationOption":
        """EnumWithSelectedValue[mastapy.system_model.fe.ComponentOrientationOption]"""
        temp = self.wrapped.ComponentOrientation

        if temp is None:
            return None

        value = (
            enum_with_selected_value.EnumWithSelectedValue_ComponentOrientationOption.wrapped_type()
        )
        return enum_with_selected_value_runtime.create(temp, value)

    @component_orientation.setter
    @enforce_parameter_types
    def component_orientation(self: Self, value: "_2386.ComponentOrientationOption"):
        wrapper_type = enum_with_selected_value_runtime.ENUM_WITH_SELECTED_VALUE
        enclosed_type = (
            enum_with_selected_value.EnumWithSelectedValue_ComponentOrientationOption.implicit_type()
        )
        value = conversion.mp_to_pn_enum(value, enclosed_type)
        value = wrapper_type[enclosed_type](value)
        self.wrapped.ComponentOrientation = value

    @property
    def fe_axis_approximately_in_perpendicular_direction(
        self: Self,
    ) -> "_1509.AlignmentAxis":
        """mastapy.math_utility.AlignmentAxis"""
        temp = self.wrapped.FEAxisApproximatelyInPerpendicularDirection

        if temp is None:
            return None

        value = conversion.pn_to_mp_enum(temp, "SMT.MastaAPI.MathUtility.AlignmentAxis")

        if value is None:
            return None

        return constructor.new_from_mastapy(
            "mastapy.math_utility._1509", "AlignmentAxis"
        )(value)

    @fe_axis_approximately_in_perpendicular_direction.setter
    @enforce_parameter_types
    def fe_axis_approximately_in_perpendicular_direction(
        self: Self, value: "_1509.AlignmentAxis"
    ):
        value = conversion.mp_to_pn_enum(
            value, "SMT.MastaAPI.MathUtility.AlignmentAxis"
        )
        self.wrapped.FEAxisApproximatelyInPerpendicularDirection = value

    @property
    def first_component_alignment_axis(self: Self) -> "_1510.Axis":
        """mastapy.math_utility.Axis"""
        temp = self.wrapped.FirstComponentAlignmentAxis

        if temp is None:
            return None

        value = conversion.pn_to_mp_enum(temp, "SMT.MastaAPI.MathUtility.Axis")

        if value is None:
            return None

        return constructor.new_from_mastapy("mastapy.math_utility._1510", "Axis")(value)

    @first_component_alignment_axis.setter
    @enforce_parameter_types
    def first_component_alignment_axis(self: Self, value: "_1510.Axis"):
        value = conversion.mp_to_pn_enum(value, "SMT.MastaAPI.MathUtility.Axis")
        self.wrapped.FirstComponentAlignmentAxis = value

    @property
    def first_fe_alignment_axis(self: Self) -> "_1509.AlignmentAxis":
        """mastapy.math_utility.AlignmentAxis"""
        temp = self.wrapped.FirstFEAlignmentAxis

        if temp is None:
            return None

        value = conversion.pn_to_mp_enum(temp, "SMT.MastaAPI.MathUtility.AlignmentAxis")

        if value is None:
            return None

        return constructor.new_from_mastapy(
            "mastapy.math_utility._1509", "AlignmentAxis"
        )(value)

    @first_fe_alignment_axis.setter
    @enforce_parameter_types
    def first_fe_alignment_axis(self: Self, value: "_1509.AlignmentAxis"):
        value = conversion.mp_to_pn_enum(
            value, "SMT.MastaAPI.MathUtility.AlignmentAxis"
        )
        self.wrapped.FirstFEAlignmentAxis = value

    @property
    def perpendicular_component_alignment_axis(
        self: Self,
    ) -> "enum_with_selected_value.EnumWithSelectedValue_Axis":
        """EnumWithSelectedValue[mastapy.math_utility.Axis]"""
        temp = self.wrapped.PerpendicularComponentAlignmentAxis

        if temp is None:
            return None

        value = enum_with_selected_value.EnumWithSelectedValue_Axis.wrapped_type()
        return enum_with_selected_value_runtime.create(temp, value)

    @perpendicular_component_alignment_axis.setter
    @enforce_parameter_types
    def perpendicular_component_alignment_axis(self: Self, value: "_1510.Axis"):
        wrapper_type = enum_with_selected_value_runtime.ENUM_WITH_SELECTED_VALUE
        enclosed_type = (
            enum_with_selected_value.EnumWithSelectedValue_Axis.implicit_type()
        )
        value = conversion.mp_to_pn_enum(value, enclosed_type)
        value = wrapper_type[enclosed_type](value)
        self.wrapped.PerpendicularComponentAlignmentAxis = value

    @property
    def second_component_alignment_axis(
        self: Self,
    ) -> "enum_with_selected_value.EnumWithSelectedValue_Axis":
        """EnumWithSelectedValue[mastapy.math_utility.Axis]"""
        temp = self.wrapped.SecondComponentAlignmentAxis

        if temp is None:
            return None

        value = enum_with_selected_value.EnumWithSelectedValue_Axis.wrapped_type()
        return enum_with_selected_value_runtime.create(temp, value)

    @second_component_alignment_axis.setter
    @enforce_parameter_types
    def second_component_alignment_axis(self: Self, value: "_1510.Axis"):
        wrapper_type = enum_with_selected_value_runtime.ENUM_WITH_SELECTED_VALUE
        enclosed_type = (
            enum_with_selected_value.EnumWithSelectedValue_Axis.implicit_type()
        )
        value = conversion.mp_to_pn_enum(value, enclosed_type)
        value = wrapper_type[enclosed_type](value)
        self.wrapped.SecondComponentAlignmentAxis = value

    @property
    def second_fe_alignment_axis(
        self: Self,
    ) -> "enum_with_selected_value.EnumWithSelectedValue_AlignmentAxis":
        """EnumWithSelectedValue[mastapy.math_utility.AlignmentAxis]"""
        temp = self.wrapped.SecondFEAlignmentAxis

        if temp is None:
            return None

        value = (
            enum_with_selected_value.EnumWithSelectedValue_AlignmentAxis.wrapped_type()
        )
        return enum_with_selected_value_runtime.create(temp, value)

    @second_fe_alignment_axis.setter
    @enforce_parameter_types
    def second_fe_alignment_axis(self: Self, value: "_1509.AlignmentAxis"):
        wrapper_type = enum_with_selected_value_runtime.ENUM_WITH_SELECTED_VALUE
        enclosed_type = (
            enum_with_selected_value.EnumWithSelectedValue_AlignmentAxis.implicit_type()
        )
        value = conversion.mp_to_pn_enum(value, enclosed_type)
        value = wrapper_type[enclosed_type](value)
        self.wrapped.SecondFEAlignmentAxis = value

    @property
    def report_names(self: Self) -> "List[str]":
        """List[str]

        Note:
            This property is readonly.
        """
        temp = self.wrapped.ReportNames

        if temp is None:
            return None

        value = conversion.pn_to_mp_objects_in_list(temp, str)

        if value is None:
            return None

        return value

    def align_component(self: Self):
        """Method does not return."""
        self.wrapped.AlignComponent()

    @enforce_parameter_types
    def output_default_report_to(self: Self, file_path: "str"):
        """Method does not return.

        Args:
            file_path (str)
        """
        file_path = str(file_path)
        self.wrapped.OutputDefaultReportTo(file_path if file_path else "")

    def get_default_report_with_encoded_images(self: Self) -> "str":
        """str"""
        method_result = self.wrapped.GetDefaultReportWithEncodedImages()
        return method_result

    @enforce_parameter_types
    def output_active_report_to(self: Self, file_path: "str"):
        """Method does not return.

        Args:
            file_path (str)
        """
        file_path = str(file_path)
        self.wrapped.OutputActiveReportTo(file_path if file_path else "")

    @enforce_parameter_types
    def output_active_report_as_text_to(self: Self, file_path: "str"):
        """Method does not return.

        Args:
            file_path (str)
        """
        file_path = str(file_path)
        self.wrapped.OutputActiveReportAsTextTo(file_path if file_path else "")

    def get_active_report_with_encoded_images(self: Self) -> "str":
        """str"""
        method_result = self.wrapped.GetActiveReportWithEncodedImages()
        return method_result

    @enforce_parameter_types
    def output_named_report_to(self: Self, report_name: "str", file_path: "str"):
        """Method does not return.

        Args:
            report_name (str)
            file_path (str)
        """
        report_name = str(report_name)
        file_path = str(file_path)
        self.wrapped.OutputNamedReportTo(
            report_name if report_name else "", file_path if file_path else ""
        )

    @enforce_parameter_types
    def output_named_report_as_masta_report(
        self: Self, report_name: "str", file_path: "str"
    ):
        """Method does not return.

        Args:
            report_name (str)
            file_path (str)
        """
        report_name = str(report_name)
        file_path = str(file_path)
        self.wrapped.OutputNamedReportAsMastaReport(
            report_name if report_name else "", file_path if file_path else ""
        )

    @enforce_parameter_types
    def output_named_report_as_text_to(
        self: Self, report_name: "str", file_path: "str"
    ):
        """Method does not return.

        Args:
            report_name (str)
            file_path (str)
        """
        report_name = str(report_name)
        file_path = str(file_path)
        self.wrapped.OutputNamedReportAsTextTo(
            report_name if report_name else "", file_path if file_path else ""
        )

    @enforce_parameter_types
    def get_named_report_with_encoded_images(self: Self, report_name: "str") -> "str":
        """str

        Args:
            report_name (str)
        """
        report_name = str(report_name)
        method_result = self.wrapped.GetNamedReportWithEncodedImages(
            report_name if report_name else ""
        )
        return method_result

    @property
    def cast_to(
        self: Self,
    ) -> "AlignConnectedComponentOptions._Cast_AlignConnectedComponentOptions":
        return self._Cast_AlignConnectedComponentOptions(self)
