'''
Created on 15-Apr-2026

@author: bthakur
'''

from ..helper import BaseHelper
from xv.km.managers import BaseManager
from xv.km.kelements import KProblemTemplate


# _geometry_3d_manager
# Geometry3dManager

class Geometry3dManager(BaseManager):
    '''
    Geometry3dManager

    doc_style: xv_doc
    '''

    def __new__(cls, *args, **kwargs):
        instance = super(Geometry3dManager, cls).__new__(cls, *args, **kwargs)
        for base_class in Geometry3dManager.__bases__:
            base_class.__init__(instance, *args, **kwargs)
        return instance

    def __init__(self, *args, **kwargs):
        self.base_helper = BaseHelper(**kwargs)
        pass

    def _init_problem_types(self, *args, **kwargs):
        self._append_problem_types([
            '_problem_plane_equation_from_three_points',
            ])
        pass

    def _problem_plane_equation_from_three_points(self, *args, **kwargs):
        """
        doc_style: xv_doc
        """

        g3d_helper = self.base_helper.get_geometry_helper().get_geometry_3d_helper()
        result = g3d_helper.get_problem_plane_equation_from_three_points(**kwargs)

        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')

        problemTemplate.add_problem(result['prob_s'].strip(), 'text/html')
        problemTemplate.add_solution(result['soln_s'].strip(), 'text/html')
        problemTemplate.add_answer(result['answer_s'].strip(), 'text/html')

        return problemTemplate
        pass


    pass
#class Geometry3dManager:
