/* 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/IfcAxis2Placement2D.h"
#include "ifcpp/IFC4/include/IfcExternalReferenceRelationship.h"
#include "ifcpp/IFC4/include/IfcLabel.h"
#include "ifcpp/IFC4/include/IfcNonNegativeLengthMeasure.h"
#include "ifcpp/IFC4/include/IfcPositiveLengthMeasure.h"
#include "ifcpp/IFC4/include/IfcProfileProperties.h"
#include "ifcpp/IFC4/include/IfcProfileTypeEnum.h"
#include "ifcpp/IFC4/include/IfcRectangleHollowProfileDef.h"

// ENTITY IfcRectangleHollowProfileDef 
IfcRectangleHollowProfileDef::IfcRectangleHollowProfileDef( int id ) { m_entity_id = id; }
IfcRectangleHollowProfileDef::~IfcRectangleHollowProfileDef() {}
shared_ptr<BuildingObject> IfcRectangleHollowProfileDef::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcRectangleHollowProfileDef> copy_self( new IfcRectangleHollowProfileDef() );
	if( m_ProfileType ) { copy_self->m_ProfileType = dynamic_pointer_cast<IfcProfileTypeEnum>( m_ProfileType->getDeepCopy(options) ); }
	if( m_ProfileName ) { copy_self->m_ProfileName = dynamic_pointer_cast<IfcLabel>( m_ProfileName->getDeepCopy(options) ); }
	if( m_Position ) { copy_self->m_Position = dynamic_pointer_cast<IfcAxis2Placement2D>( m_Position->getDeepCopy(options) ); }
	if( m_XDim ) { copy_self->m_XDim = dynamic_pointer_cast<IfcPositiveLengthMeasure>( m_XDim->getDeepCopy(options) ); }
	if( m_YDim ) { copy_self->m_YDim = dynamic_pointer_cast<IfcPositiveLengthMeasure>( m_YDim->getDeepCopy(options) ); }
	if( m_WallThickness ) { copy_self->m_WallThickness = dynamic_pointer_cast<IfcPositiveLengthMeasure>( m_WallThickness->getDeepCopy(options) ); }
	if( m_InnerFilletRadius ) { copy_self->m_InnerFilletRadius = dynamic_pointer_cast<IfcNonNegativeLengthMeasure>( m_InnerFilletRadius->getDeepCopy(options) ); }
	if( m_OuterFilletRadius ) { copy_self->m_OuterFilletRadius = dynamic_pointer_cast<IfcNonNegativeLengthMeasure>( m_OuterFilletRadius->getDeepCopy(options) ); }
	return copy_self;
}
void IfcRectangleHollowProfileDef::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCRECTANGLEHOLLOWPROFILEDEF" << "(";
	if( m_ProfileType ) { m_ProfileType->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_ProfileName ) { m_ProfileName->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Position ) { stream << "#" << m_Position->m_entity_id; } else { stream << "$"; }
	stream << ",";
	if( m_XDim ) { m_XDim->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_YDim ) { m_YDim->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_WallThickness ) { m_WallThickness->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_InnerFilletRadius ) { m_InnerFilletRadius->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_OuterFilletRadius ) { m_OuterFilletRadius->getStepParameter( stream ); } else { stream << "$"; }
	stream << ");";
}
void IfcRectangleHollowProfileDef::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcRectangleHollowProfileDef::toString() const { return L"IfcRectangleHollowProfileDef"; }
void IfcRectangleHollowProfileDef::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 != 8 ){ std::stringstream err; err << "Wrong parameter count for entity IfcRectangleHollowProfileDef, expecting 8, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_ProfileType = IfcProfileTypeEnum::createObjectFromSTEP( args[0], map );
	m_ProfileName = IfcLabel::createObjectFromSTEP( args[1], map );
	readEntityReference( args[2], m_Position, map );
	m_XDim = IfcPositiveLengthMeasure::createObjectFromSTEP( args[3], map );
	m_YDim = IfcPositiveLengthMeasure::createObjectFromSTEP( args[4], map );
	m_WallThickness = IfcPositiveLengthMeasure::createObjectFromSTEP( args[5], map );
	m_InnerFilletRadius = IfcNonNegativeLengthMeasure::createObjectFromSTEP( args[6], map );
	m_OuterFilletRadius = IfcNonNegativeLengthMeasure::createObjectFromSTEP( args[7], map );
}
void IfcRectangleHollowProfileDef::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcRectangleProfileDef::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "WallThickness", m_WallThickness ) );
	vec_attributes.emplace_back( std::make_pair( "InnerFilletRadius", m_InnerFilletRadius ) );
	vec_attributes.emplace_back( std::make_pair( "OuterFilletRadius", m_OuterFilletRadius ) );
}
void IfcRectangleHollowProfileDef::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcRectangleProfileDef::getAttributesInverse( vec_attributes_inverse );
}
void IfcRectangleHollowProfileDef::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcRectangleProfileDef::setInverseCounterparts( ptr_self_entity );
}
void IfcRectangleHollowProfileDef::unlinkFromInverseCounterparts()
{
	IfcRectangleProfileDef::unlinkFromInverseCounterparts();
}
