#ifndef BEAMSPLITTER_HPP_INCLUDED
#define BEAMSPLITTER_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/MirroringDevice_Type.h>
#include <NBO/NBO/ReflectanceProfileFile.h>
#include <NBO/NBO/TransmittanceProfileFile.h>
#include <NBO/NBO/UnitsAngle_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element BeamSplitter.
*
* This element describes a Mirror that reflects part of the light, regardless of wavelength.
*/
class NBO_EXPORT BeamSplitter : public MirroringDevice_Type {

public:
	
	BeamSplitter();
	~BeamSplitter();

	/*!
	* \brief Cast a NBOBaseClass to a BeamSplitter.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<BeamSplitter> fromBase(NBOBaseClassPtr base);

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	std::string getTypeName() const override;

	/*!
	* \brief Returns the XML element name corresponding to this class.
	*
	* \return The XML element name
	*/
	std::string getXMLName() const override;

	/*!
	* \brief Returns the NBO Type corresponding to this class.
	*
	* \return The NBO Type value
	*/
	ENBOType getNBOType() const override;

	/*!
	* \brief Returns a list of all classes derived from this class.
	*
	* \return The list of derived classes
	*/
	std::vector<NBOBaseClassPtr> getChildren() const override;

	/*!
	* \brief Returns a list of all child elements contained in this class.
	*
	* \return The list of child classes
	*/
	std::vector<NBOBaseClassPtr> getSubElements() const override;

	/*!
	* \brief Populates this object from a JSON file.
	*
	* \param path The path to the JSON file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a JSON string.
	*
	* \param json_string The JSON content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonString(const std::string& json_string, bool validate = true);

	/*!
	* \brief Populates this object from a XML file.
	*
	* \param path The path to the XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a XML string.
	*
	* \param xml_string The XML content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlString(const std::string& xml_string, bool validate = true);

	/*!
	* \brief Serializes this object to an XML file.
	*
	* \param filename The path to the output XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void toXmlFile(const std::string& filename, bool validate = true) const;

	/*!
	* \brief Serializes this object to an XML string.
	*
	* \param validate If true, validates constraints on value. Default is true.
	* \return A string containing the XML representation of this object
	*/
	std::string toXmlString(bool validate = true) const;

	/*!
	* \brief Sets the value of the Transmittance attribute.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of transmitting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTransmittance(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the Transmittance attribute.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of transmitting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \return The value of the attribute
	*/
	float getTransmittance() const;

	/*!
	* \brief Resets the Transmittance attribute to an unset state.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of transmitting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*/
	void resetTransmittance();

	/*!
	* \brief Checks whether the Transmittance attribute is present.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of transmitting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTransmittance() const;

	/*!
	* \brief Sets the value of the TransmittanceProfileFile attribute.
	*
	* This field records the location of a file in .csv or other suitable formats containing the Transmittance profile of this optical component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTransmittanceProfileFile(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the TransmittanceProfileFile attribute.
	*
	* This field records the location of a file in .csv or other suitable formats containing the Transmittance profile of this optical component.
	*
	* \return The value of the attribute
	*/
	std::string getTransmittanceProfileFile() const;

	/*!
	* \brief Resets the TransmittanceProfileFile attribute to an unset state.
	*
	* This field records the location of a file in .csv or other suitable formats containing the Transmittance profile of this optical component.
	*/
	void resetTransmittanceProfileFile();

	/*!
	* \brief Checks whether the TransmittanceProfileFile attribute is present.
	*
	* This field records the location of a file in .csv or other suitable formats containing the Transmittance profile of this optical component.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTransmittanceProfileFile() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* This field records the location of a file in .csv or other suitable formats containing the Transmittance profile of this optical component.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getTransmittanceProfileFileAllowedValues();

	/*!
	* \brief Sets the value of the TransmissionAngle attribute.
	*
	* The angle at which light is transmitted by this Beamsplitter.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTransmissionAngle(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the TransmissionAngle attribute.
	*
	* The angle at which light is transmitted by this Beamsplitter.
	*
	* \return The value of the attribute
	*/
	float getTransmissionAngle() const;

	/*!
	* \brief Resets the TransmissionAngle attribute to an unset state.
	*
	* The angle at which light is transmitted by this Beamsplitter.
	*/
	void resetTransmissionAngle();

	/*!
	* \brief Checks whether the TransmissionAngle attribute is present.
	*
	* The angle at which light is transmitted by this Beamsplitter.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTransmissionAngle() const;

	/*!
	* \brief Sets the value of the TransmissionAngleUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTransmissionAngleUnit(const Inscoper::NBO::UnitsAngle_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the TransmissionAngleUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsAngle_TypePtr getTransmissionAngleUnit() const;

	/*!
	* \brief Resets the TransmissionAngleUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetTransmissionAngleUnit();

	/*!
	* \brief Checks whether the optional TransmissionAngleUnit attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasTransmissionAngleUnit() const;

	/*!
	* \brief Sets the value of the Reflectance attribute.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of reflecting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setReflectance(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the Reflectance attribute.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of reflecting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \return The value of the attribute
	*/
	float getReflectance() const;

	/*!
	* \brief Resets the Reflectance attribute to an unset state.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of reflecting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*/
	void resetReflectance();

	/*!
	* \brief Checks whether the Reflectance attribute is present.
	*
	* The field records the maximum amount of light this Beamsplitteris capable of reflecting at the peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasReflectance() const;

	/*!
	* \brief Sets the list of TransmittanceProfileFile elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of TransmittanceProfileFile elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTransmittanceProfileFile_List(const std::vector<Inscoper::NBO::TransmittanceProfileFilePtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of TransmittanceProfileFile elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of TransmittanceProfileFile elements
	*/
	std::vector<Inscoper::NBO::TransmittanceProfileFilePtr> getTransmittanceProfileFile_List() const;

	/*!
	* \brief Adds a new TransmittanceProfileFile element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToTransmittanceProfileFile_List(const Inscoper::NBO::TransmittanceProfileFilePtr& value, bool validate = true);

	/*!
	* \brief Clear the list of TransmittanceProfileFile.
	*
	* No description available in the XSD standard.
	*/
	void clearTransmittanceProfileFile_List();

	/*!
	* \brief Sets the list of ReflectanceProfileFile elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of ReflectanceProfileFile elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setReflectanceProfileFile_List(const std::vector<Inscoper::NBO::ReflectanceProfileFilePtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of ReflectanceProfileFile elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of ReflectanceProfileFile elements
	*/
	std::vector<Inscoper::NBO::ReflectanceProfileFilePtr> getReflectanceProfileFile_List() const;

	/*!
	* \brief Adds a new ReflectanceProfileFile element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToReflectanceProfileFile_List(const Inscoper::NBO::ReflectanceProfileFilePtr& value, bool validate = true);

	/*!
	* \brief Clear the list of ReflectanceProfileFile.
	*
	* No description available in the XSD standard.
	*/
	void clearReflectanceProfileFile_List();


private:
	class Impl;
	std::unique_ptr<Impl> pImpl;

    std::optional<float> Transmittance; // Required attribute
    std::optional<std::string> TransmittanceProfileFile; // Optional attribute
    static const std::set<std::string> TransmittanceProfileFileAllowedValues;
    std::optional<float> TransmissionAngle; // Optional attribute
	UnitsAngle_TypePtr TransmissionAngleUnit = nullptr; // Optional attribute
    std::optional<float> Reflectance; // Required attribute
    std::vector<Inscoper::NBO::TransmittanceProfileFilePtr> TransmittanceProfileFile_List;
    std::vector<Inscoper::NBO::ReflectanceProfileFilePtr> ReflectanceProfileFile_List;
};

/*! Shared pointer for BeamSplitter*/
typedef std::shared_ptr<BeamSplitter> BeamSplitterPtr;

} // namespace Inscoper::NBO

#endif // BEAMSPLITTER_HPP_INCLUDED