/* 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/IfcGlobalOrLocalEnum.h"

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