/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */

#include <sstream>
#include <limits>
#include <map>
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/IFC4/include/IfcTrimmingPreference.h"

// TYPE IfcTrimmingPreference = ENUMERATION OF	(CARTESIAN	,PARAMETER	,UNSPECIFIED);
IfcTrimmingPreference::~IfcTrimmingPreference() {}
shared_ptr<BuildingObject> IfcTrimmingPreference::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcTrimmingPreference> copy_self( new IfcTrimmingPreference() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcTrimmingPreference::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCTRIMMINGPREFERENCE("; }
	switch( m_enum )
	{
		case ENUM_CARTESIAN:	stream << ".CARTESIAN."; break;
		case ENUM_PARAMETER:	stream << ".PARAMETER."; break;
		case ENUM_UNSPECIFIED:	stream << ".UNSPECIFIED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcTrimmingPreference::toString() const
{
	switch( m_enum ) 
	{
		case ENUM_CARTESIAN:	return L"CARTESIAN";
		case ENUM_PARAMETER:	return L"PARAMETER";
		case ENUM_UNSPECIFIED:	return L"UNSPECIFIED";
	}
	return L"";
}
shared_ptr<IfcTrimmingPreference> IfcTrimmingPreference::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcTrimmingPreference>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcTrimmingPreference>(); }
	shared_ptr<IfcTrimmingPreference> type_object( new IfcTrimmingPreference() );
	if( boost::iequals( arg, L".CARTESIAN." ) )
	{
		type_object->m_enum = IfcTrimmingPreference::ENUM_CARTESIAN;
	}
	else if( boost::iequals( arg, L".PARAMETER." ) )
	{
		type_object->m_enum = IfcTrimmingPreference::ENUM_PARAMETER;
	}
	else if( boost::iequals( arg, L".UNSPECIFIED." ) )
	{
		type_object->m_enum = IfcTrimmingPreference::ENUM_UNSPECIFIED;
	}
	return type_object;
}
