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

// TYPE IfcObjectTypeEnum = ENUMERATION OF	(PRODUCT	,PROCESS	,CONTROL	,RESOURCE	,ACTOR	,GROUP	,PROJECT	,NOTDEFINED);
IfcObjectTypeEnum::~IfcObjectTypeEnum() {}
shared_ptr<BuildingObject> IfcObjectTypeEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcObjectTypeEnum> copy_self( new IfcObjectTypeEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcObjectTypeEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCOBJECTTYPEENUM("; }
	switch( m_enum )
	{
		case ENUM_PRODUCT:	stream << ".PRODUCT."; break;
		case ENUM_PROCESS:	stream << ".PROCESS."; break;
		case ENUM_CONTROL:	stream << ".CONTROL."; break;
		case ENUM_RESOURCE:	stream << ".RESOURCE."; break;
		case ENUM_ACTOR:	stream << ".ACTOR."; break;
		case ENUM_GROUP:	stream << ".GROUP."; break;
		case ENUM_PROJECT:	stream << ".PROJECT."; break;
		case ENUM_NOTDEFINED:	stream << ".NOTDEFINED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcObjectTypeEnum::toString() const
{
	switch( m_enum ) 
	{
		case ENUM_PRODUCT:	return L"PRODUCT";
		case ENUM_PROCESS:	return L"PROCESS";
		case ENUM_CONTROL:	return L"CONTROL";
		case ENUM_RESOURCE:	return L"RESOURCE";
		case ENUM_ACTOR:	return L"ACTOR";
		case ENUM_GROUP:	return L"GROUP";
		case ENUM_PROJECT:	return L"PROJECT";
		case ENUM_NOTDEFINED:	return L"NOTDEFINED";
	}
	return L"";
}
shared_ptr<IfcObjectTypeEnum> IfcObjectTypeEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcObjectTypeEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcObjectTypeEnum>(); }
	shared_ptr<IfcObjectTypeEnum> type_object( new IfcObjectTypeEnum() );
	if( boost::iequals( arg, L".PRODUCT." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_PRODUCT;
	}
	else if( boost::iequals( arg, L".PROCESS." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_PROCESS;
	}
	else if( boost::iequals( arg, L".CONTROL." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_CONTROL;
	}
	else if( boost::iequals( arg, L".RESOURCE." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_RESOURCE;
	}
	else if( boost::iequals( arg, L".ACTOR." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_ACTOR;
	}
	else if( boost::iequals( arg, L".GROUP." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_GROUP;
	}
	else if( boost::iequals( arg, L".PROJECT." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_PROJECT;
	}
	else if( boost::iequals( arg, L".NOTDEFINED." ) )
	{
		type_object->m_enum = IfcObjectTypeEnum::ENUM_NOTDEFINED;
	}
	return type_object;
}
