/* 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/IfcCartesianPoint.h"
#include "ifcpp/IFC4/include/IfcColourRgb.h"
#include "ifcpp/IFC4/include/IfcDirection.h"
#include "ifcpp/IFC4/include/IfcLabel.h"
#include "ifcpp/IFC4/include/IfcLightSourceSpot.h"
#include "ifcpp/IFC4/include/IfcNormalisedRatioMeasure.h"
#include "ifcpp/IFC4/include/IfcPositiveLengthMeasure.h"
#include "ifcpp/IFC4/include/IfcPositivePlaneAngleMeasure.h"
#include "ifcpp/IFC4/include/IfcPresentationLayerAssignment.h"
#include "ifcpp/IFC4/include/IfcReal.h"
#include "ifcpp/IFC4/include/IfcStyledItem.h"

// ENTITY IfcLightSourceSpot 
IfcLightSourceSpot::IfcLightSourceSpot( int id ) { m_entity_id = id; }
IfcLightSourceSpot::~IfcLightSourceSpot() {}
shared_ptr<BuildingObject> IfcLightSourceSpot::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcLightSourceSpot> copy_self( new IfcLightSourceSpot() );
	if( m_Name ) { copy_self->m_Name = dynamic_pointer_cast<IfcLabel>( m_Name->getDeepCopy(options) ); }
	if( m_LightColour ) { copy_self->m_LightColour = dynamic_pointer_cast<IfcColourRgb>( m_LightColour->getDeepCopy(options) ); }
	if( m_AmbientIntensity ) { copy_self->m_AmbientIntensity = dynamic_pointer_cast<IfcNormalisedRatioMeasure>( m_AmbientIntensity->getDeepCopy(options) ); }
	if( m_Intensity ) { copy_self->m_Intensity = dynamic_pointer_cast<IfcNormalisedRatioMeasure>( m_Intensity->getDeepCopy(options) ); }
	if( m_Position ) { copy_self->m_Position = dynamic_pointer_cast<IfcCartesianPoint>( m_Position->getDeepCopy(options) ); }
	if( m_Radius ) { copy_self->m_Radius = dynamic_pointer_cast<IfcPositiveLengthMeasure>( m_Radius->getDeepCopy(options) ); }
	if( m_ConstantAttenuation ) { copy_self->m_ConstantAttenuation = dynamic_pointer_cast<IfcReal>( m_ConstantAttenuation->getDeepCopy(options) ); }
	if( m_DistanceAttenuation ) { copy_self->m_DistanceAttenuation = dynamic_pointer_cast<IfcReal>( m_DistanceAttenuation->getDeepCopy(options) ); }
	if( m_QuadricAttenuation ) { copy_self->m_QuadricAttenuation = dynamic_pointer_cast<IfcReal>( m_QuadricAttenuation->getDeepCopy(options) ); }
	if( m_Orientation ) { copy_self->m_Orientation = dynamic_pointer_cast<IfcDirection>( m_Orientation->getDeepCopy(options) ); }
	if( m_ConcentrationExponent ) { copy_self->m_ConcentrationExponent = dynamic_pointer_cast<IfcReal>( m_ConcentrationExponent->getDeepCopy(options) ); }
	if( m_SpreadAngle ) { copy_self->m_SpreadAngle = dynamic_pointer_cast<IfcPositivePlaneAngleMeasure>( m_SpreadAngle->getDeepCopy(options) ); }
	if( m_BeamWidthAngle ) { copy_self->m_BeamWidthAngle = dynamic_pointer_cast<IfcPositivePlaneAngleMeasure>( m_BeamWidthAngle->getDeepCopy(options) ); }
	return copy_self;
}
void IfcLightSourceSpot::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCLIGHTSOURCESPOT" << "(";
	if( m_Name ) { m_Name->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_LightColour ) { stream << "#" << m_LightColour->m_entity_id; } else { stream << "$"; }
	stream << ",";
	if( m_AmbientIntensity ) { m_AmbientIntensity->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Intensity ) { m_Intensity->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Position ) { stream << "#" << m_Position->m_entity_id; } else { stream << "$"; }
	stream << ",";
	if( m_Radius ) { m_Radius->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_ConstantAttenuation ) { m_ConstantAttenuation->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_DistanceAttenuation ) { m_DistanceAttenuation->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_QuadricAttenuation ) { m_QuadricAttenuation->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Orientation ) { stream << "#" << m_Orientation->m_entity_id; } else { stream << "$"; }
	stream << ",";
	if( m_ConcentrationExponent ) { m_ConcentrationExponent->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_SpreadAngle ) { m_SpreadAngle->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_BeamWidthAngle ) { m_BeamWidthAngle->getStepParameter( stream ); } else { stream << "$"; }
	stream << ");";
}
void IfcLightSourceSpot::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcLightSourceSpot::toString() const { return L"IfcLightSourceSpot"; }
void IfcLightSourceSpot::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 != 13 ){ std::stringstream err; err << "Wrong parameter count for entity IfcLightSourceSpot, expecting 13, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_Name = IfcLabel::createObjectFromSTEP( args[0], map );
	readEntityReference( args[1], m_LightColour, map );
	m_AmbientIntensity = IfcNormalisedRatioMeasure::createObjectFromSTEP( args[2], map );
	m_Intensity = IfcNormalisedRatioMeasure::createObjectFromSTEP( args[3], map );
	readEntityReference( args[4], m_Position, map );
	m_Radius = IfcPositiveLengthMeasure::createObjectFromSTEP( args[5], map );
	m_ConstantAttenuation = IfcReal::createObjectFromSTEP( args[6], map );
	m_DistanceAttenuation = IfcReal::createObjectFromSTEP( args[7], map );
	m_QuadricAttenuation = IfcReal::createObjectFromSTEP( args[8], map );
	readEntityReference( args[9], m_Orientation, map );
	m_ConcentrationExponent = IfcReal::createObjectFromSTEP( args[10], map );
	m_SpreadAngle = IfcPositivePlaneAngleMeasure::createObjectFromSTEP( args[11], map );
	m_BeamWidthAngle = IfcPositivePlaneAngleMeasure::createObjectFromSTEP( args[12], map );
}
void IfcLightSourceSpot::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcLightSourcePositional::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "Orientation", m_Orientation ) );
	vec_attributes.emplace_back( std::make_pair( "ConcentrationExponent", m_ConcentrationExponent ) );
	vec_attributes.emplace_back( std::make_pair( "SpreadAngle", m_SpreadAngle ) );
	vec_attributes.emplace_back( std::make_pair( "BeamWidthAngle", m_BeamWidthAngle ) );
}
void IfcLightSourceSpot::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcLightSourcePositional::getAttributesInverse( vec_attributes_inverse );
}
void IfcLightSourceSpot::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcLightSourcePositional::setInverseCounterparts( ptr_self_entity );
}
void IfcLightSourceSpot::unlinkFromInverseCounterparts()
{
	IfcLightSourcePositional::unlinkFromInverseCounterparts();
}
