/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>

#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/IFC4/include/IfcAxis2Placement.h"
#include "ifcpp/IFC4/include/IfcBoxAlignment.h"
#include "ifcpp/IFC4/include/IfcPlanarExtent.h"
#include "ifcpp/IFC4/include/IfcPresentableText.h"
#include "ifcpp/IFC4/include/IfcPresentationLayerAssignment.h"
#include "ifcpp/IFC4/include/IfcStyledItem.h"
#include "ifcpp/IFC4/include/IfcTextLiteralWithExtent.h"
#include "ifcpp/IFC4/include/IfcTextPath.h"

// ENTITY IfcTextLiteralWithExtent 
IfcTextLiteralWithExtent::IfcTextLiteralWithExtent( int id ) { m_entity_id = id; }
IfcTextLiteralWithExtent::~IfcTextLiteralWithExtent() {}
shared_ptr<BuildingObject> IfcTextLiteralWithExtent::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcTextLiteralWithExtent> copy_self( new IfcTextLiteralWithExtent() );
	if( m_Literal ) { copy_self->m_Literal = dynamic_pointer_cast<IfcPresentableText>( m_Literal->getDeepCopy(options) ); }
	if( m_Placement ) { copy_self->m_Placement = dynamic_pointer_cast<IfcAxis2Placement>( m_Placement->getDeepCopy(options) ); }
	if( m_Path ) { copy_self->m_Path = dynamic_pointer_cast<IfcTextPath>( m_Path->getDeepCopy(options) ); }
	if( m_Extent ) { copy_self->m_Extent = dynamic_pointer_cast<IfcPlanarExtent>( m_Extent->getDeepCopy(options) ); }
	if( m_BoxAlignment ) { copy_self->m_BoxAlignment = dynamic_pointer_cast<IfcBoxAlignment>( m_BoxAlignment->getDeepCopy(options) ); }
	return copy_self;
}
void IfcTextLiteralWithExtent::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCTEXTLITERALWITHEXTENT" << "(";
	if( m_Literal ) { m_Literal->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Placement ) { m_Placement->getStepParameter( stream, true ); } else { stream << "$" ; }
	stream << ",";
	if( m_Path ) { m_Path->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Extent ) { stream << "#" << m_Extent->m_entity_id; } else { stream << "$"; }
	stream << ",";
	if( m_BoxAlignment ) { m_BoxAlignment->getStepParameter( stream ); } else { stream << "$"; }
	stream << ");";
}
void IfcTextLiteralWithExtent::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcTextLiteralWithExtent::toString() const { return L"IfcTextLiteralWithExtent"; }
void IfcTextLiteralWithExtent::readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	const size_t num_args = args.size();
	if( num_args != 5 ){ std::stringstream err; err << "Wrong parameter count for entity IfcTextLiteralWithExtent, expecting 5, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_Literal = IfcPresentableText::createObjectFromSTEP( args[0], map );
	m_Placement = IfcAxis2Placement::createObjectFromSTEP( args[1], map );
	m_Path = IfcTextPath::createObjectFromSTEP( args[2], map );
	readEntityReference( args[3], m_Extent, map );
	m_BoxAlignment = IfcBoxAlignment::createObjectFromSTEP( args[4], map );
}
void IfcTextLiteralWithExtent::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcTextLiteral::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "Extent", m_Extent ) );
	vec_attributes.emplace_back( std::make_pair( "BoxAlignment", m_BoxAlignment ) );
}
void IfcTextLiteralWithExtent::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcTextLiteral::getAttributesInverse( vec_attributes_inverse );
}
void IfcTextLiteralWithExtent::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcTextLiteral::setInverseCounterparts( ptr_self_entity );
}
void IfcTextLiteralWithExtent::unlinkFromInverseCounterparts()
{
	IfcTextLiteral::unlinkFromInverseCounterparts();
}
