/* 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/IfcFailureConnectionCondition.h"
#include "ifcpp/IFC4/include/IfcForceMeasure.h"
#include "ifcpp/IFC4/include/IfcLabel.h"

// ENTITY IfcFailureConnectionCondition 
IfcFailureConnectionCondition::IfcFailureConnectionCondition( int id ) { m_entity_id = id; }
IfcFailureConnectionCondition::~IfcFailureConnectionCondition() {}
shared_ptr<BuildingObject> IfcFailureConnectionCondition::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcFailureConnectionCondition> copy_self( new IfcFailureConnectionCondition() );
	if( m_Name ) { copy_self->m_Name = dynamic_pointer_cast<IfcLabel>( m_Name->getDeepCopy(options) ); }
	if( m_TensionFailureX ) { copy_self->m_TensionFailureX = dynamic_pointer_cast<IfcForceMeasure>( m_TensionFailureX->getDeepCopy(options) ); }
	if( m_TensionFailureY ) { copy_self->m_TensionFailureY = dynamic_pointer_cast<IfcForceMeasure>( m_TensionFailureY->getDeepCopy(options) ); }
	if( m_TensionFailureZ ) { copy_self->m_TensionFailureZ = dynamic_pointer_cast<IfcForceMeasure>( m_TensionFailureZ->getDeepCopy(options) ); }
	if( m_CompressionFailureX ) { copy_self->m_CompressionFailureX = dynamic_pointer_cast<IfcForceMeasure>( m_CompressionFailureX->getDeepCopy(options) ); }
	if( m_CompressionFailureY ) { copy_self->m_CompressionFailureY = dynamic_pointer_cast<IfcForceMeasure>( m_CompressionFailureY->getDeepCopy(options) ); }
	if( m_CompressionFailureZ ) { copy_self->m_CompressionFailureZ = dynamic_pointer_cast<IfcForceMeasure>( m_CompressionFailureZ->getDeepCopy(options) ); }
	return copy_self;
}
void IfcFailureConnectionCondition::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCFAILURECONNECTIONCONDITION" << "(";
	if( m_Name ) { m_Name->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_TensionFailureX ) { m_TensionFailureX->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_TensionFailureY ) { m_TensionFailureY->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_TensionFailureZ ) { m_TensionFailureZ->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_CompressionFailureX ) { m_CompressionFailureX->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_CompressionFailureY ) { m_CompressionFailureY->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_CompressionFailureZ ) { m_CompressionFailureZ->getStepParameter( stream ); } else { stream << "$"; }
	stream << ");";
}
void IfcFailureConnectionCondition::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcFailureConnectionCondition::toString() const { return L"IfcFailureConnectionCondition"; }
void IfcFailureConnectionCondition::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 IfcFailureConnectionCondition, expecting 7, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_Name = IfcLabel::createObjectFromSTEP( args[0], map );
	m_TensionFailureX = IfcForceMeasure::createObjectFromSTEP( args[1], map );
	m_TensionFailureY = IfcForceMeasure::createObjectFromSTEP( args[2], map );
	m_TensionFailureZ = IfcForceMeasure::createObjectFromSTEP( args[3], map );
	m_CompressionFailureX = IfcForceMeasure::createObjectFromSTEP( args[4], map );
	m_CompressionFailureY = IfcForceMeasure::createObjectFromSTEP( args[5], map );
	m_CompressionFailureZ = IfcForceMeasure::createObjectFromSTEP( args[6], map );
}
void IfcFailureConnectionCondition::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcStructuralConnectionCondition::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "TensionFailureX", m_TensionFailureX ) );
	vec_attributes.emplace_back( std::make_pair( "TensionFailureY", m_TensionFailureY ) );
	vec_attributes.emplace_back( std::make_pair( "TensionFailureZ", m_TensionFailureZ ) );
	vec_attributes.emplace_back( std::make_pair( "CompressionFailureX", m_CompressionFailureX ) );
	vec_attributes.emplace_back( std::make_pair( "CompressionFailureY", m_CompressionFailureY ) );
	vec_attributes.emplace_back( std::make_pair( "CompressionFailureZ", m_CompressionFailureZ ) );
}
void IfcFailureConnectionCondition::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcStructuralConnectionCondition::getAttributesInverse( vec_attributes_inverse );
}
void IfcFailureConnectionCondition::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcStructuralConnectionCondition::setInverseCounterparts( ptr_self_entity );
}
void IfcFailureConnectionCondition::unlinkFromInverseCounterparts()
{
	IfcStructuralConnectionCondition::unlinkFromInverseCounterparts();
}
