/* 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/IfcSizeSelect.h"
#include "ifcpp/IFC4/include/IfcTextAlignment.h"
#include "ifcpp/IFC4/include/IfcTextDecoration.h"
#include "ifcpp/IFC4/include/IfcTextStyleTextModel.h"
#include "ifcpp/IFC4/include/IfcTextTransformation.h"

// ENTITY IfcTextStyleTextModel 
IfcTextStyleTextModel::IfcTextStyleTextModel( int id ) { m_entity_id = id; }
IfcTextStyleTextModel::~IfcTextStyleTextModel() {}
shared_ptr<BuildingObject> IfcTextStyleTextModel::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcTextStyleTextModel> copy_self( new IfcTextStyleTextModel() );
	if( m_TextIndent ) { copy_self->m_TextIndent = dynamic_pointer_cast<IfcSizeSelect>( m_TextIndent->getDeepCopy(options) ); }
	if( m_TextAlign ) { copy_self->m_TextAlign = dynamic_pointer_cast<IfcTextAlignment>( m_TextAlign->getDeepCopy(options) ); }
	if( m_TextDecoration ) { copy_self->m_TextDecoration = dynamic_pointer_cast<IfcTextDecoration>( m_TextDecoration->getDeepCopy(options) ); }
	if( m_LetterSpacing ) { copy_self->m_LetterSpacing = dynamic_pointer_cast<IfcSizeSelect>( m_LetterSpacing->getDeepCopy(options) ); }
	if( m_WordSpacing ) { copy_self->m_WordSpacing = dynamic_pointer_cast<IfcSizeSelect>( m_WordSpacing->getDeepCopy(options) ); }
	if( m_TextTransform ) { copy_self->m_TextTransform = dynamic_pointer_cast<IfcTextTransformation>( m_TextTransform->getDeepCopy(options) ); }
	if( m_LineHeight ) { copy_self->m_LineHeight = dynamic_pointer_cast<IfcSizeSelect>( m_LineHeight->getDeepCopy(options) ); }
	return copy_self;
}
void IfcTextStyleTextModel::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCTEXTSTYLETEXTMODEL" << "(";
	if( m_TextIndent ) { m_TextIndent->getStepParameter( stream, true ); } else { stream << "$" ; }
	stream << ",";
	if( m_TextAlign ) { m_TextAlign->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_TextDecoration ) { m_TextDecoration->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_LetterSpacing ) { m_LetterSpacing->getStepParameter( stream, true ); } else { stream << "$" ; }
	stream << ",";
	if( m_WordSpacing ) { m_WordSpacing->getStepParameter( stream, true ); } else { stream << "$" ; }
	stream << ",";
	if( m_TextTransform ) { m_TextTransform->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_LineHeight ) { m_LineHeight->getStepParameter( stream, true ); } else { stream << "$" ; }
	stream << ");";
}
void IfcTextStyleTextModel::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcTextStyleTextModel::toString() const { return L"IfcTextStyleTextModel"; }
void IfcTextStyleTextModel::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 != 7 ){ std::stringstream err; err << "Wrong parameter count for entity IfcTextStyleTextModel, expecting 7, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_TextIndent = IfcSizeSelect::createObjectFromSTEP( args[0], map );
	m_TextAlign = IfcTextAlignment::createObjectFromSTEP( args[1], map );
	m_TextDecoration = IfcTextDecoration::createObjectFromSTEP( args[2], map );
	m_LetterSpacing = IfcSizeSelect::createObjectFromSTEP( args[3], map );
	m_WordSpacing = IfcSizeSelect::createObjectFromSTEP( args[4], map );
	m_TextTransform = IfcTextTransformation::createObjectFromSTEP( args[5], map );
	m_LineHeight = IfcSizeSelect::createObjectFromSTEP( args[6], map );
}
void IfcTextStyleTextModel::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcPresentationItem::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "TextIndent", m_TextIndent ) );
	vec_attributes.emplace_back( std::make_pair( "TextAlign", m_TextAlign ) );
	vec_attributes.emplace_back( std::make_pair( "TextDecoration", m_TextDecoration ) );
	vec_attributes.emplace_back( std::make_pair( "LetterSpacing", m_LetterSpacing ) );
	vec_attributes.emplace_back( std::make_pair( "WordSpacing", m_WordSpacing ) );
	vec_attributes.emplace_back( std::make_pair( "TextTransform", m_TextTransform ) );
	vec_attributes.emplace_back( std::make_pair( "LineHeight", m_LineHeight ) );
}
void IfcTextStyleTextModel::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcPresentationItem::getAttributesInverse( vec_attributes_inverse );
}
void IfcTextStyleTextModel::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcPresentationItem::setInverseCounterparts( ptr_self_entity );
}
void IfcTextStyleTextModel::unlinkFromInverseCounterparts()
{
	IfcPresentationItem::unlinkFromInverseCounterparts();
}
