/* 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/IfcParameterValue.h"
#include "ifcpp/IFC4/include/IfcPointOnSurface.h"
#include "ifcpp/IFC4/include/IfcPresentationLayerAssignment.h"
#include "ifcpp/IFC4/include/IfcStyledItem.h"
#include "ifcpp/IFC4/include/IfcSurface.h"

// ENTITY IfcPointOnSurface 
IfcPointOnSurface::IfcPointOnSurface( int id ) { m_entity_id = id; }
IfcPointOnSurface::~IfcPointOnSurface() {}
shared_ptr<BuildingObject> IfcPointOnSurface::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcPointOnSurface> copy_self( new IfcPointOnSurface() );
	if( m_BasisSurface ) { copy_self->m_BasisSurface = dynamic_pointer_cast<IfcSurface>( m_BasisSurface->getDeepCopy(options) ); }
	if( m_PointParameterU ) { copy_self->m_PointParameterU = dynamic_pointer_cast<IfcParameterValue>( m_PointParameterU->getDeepCopy(options) ); }
	if( m_PointParameterV ) { copy_self->m_PointParameterV = dynamic_pointer_cast<IfcParameterValue>( m_PointParameterV->getDeepCopy(options) ); }
	return copy_self;
}
void IfcPointOnSurface::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCPOINTONSURFACE" << "(";
	if( m_BasisSurface ) { stream << "#" << m_BasisSurface->m_entity_id; } else { stream << "$"; }
	stream << ",";
	if( m_PointParameterU ) { m_PointParameterU->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_PointParameterV ) { m_PointParameterV->getStepParameter( stream ); } else { stream << "$"; }
	stream << ");";
}
void IfcPointOnSurface::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcPointOnSurface::toString() const { return L"IfcPointOnSurface"; }
void IfcPointOnSurface::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 != 3 ){ std::stringstream err; err << "Wrong parameter count for entity IfcPointOnSurface, expecting 3, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	readEntityReference( args[0], m_BasisSurface, map );
	m_PointParameterU = IfcParameterValue::createObjectFromSTEP( args[1], map );
	m_PointParameterV = IfcParameterValue::createObjectFromSTEP( args[2], map );
}
void IfcPointOnSurface::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcPoint::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "BasisSurface", m_BasisSurface ) );
	vec_attributes.emplace_back( std::make_pair( "PointParameterU", m_PointParameterU ) );
	vec_attributes.emplace_back( std::make_pair( "PointParameterV", m_PointParameterV ) );
}
void IfcPointOnSurface::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcPoint::getAttributesInverse( vec_attributes_inverse );
}
void IfcPointOnSurface::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcPoint::setInverseCounterparts( ptr_self_entity );
}
void IfcPointOnSurface::unlinkFromInverseCounterparts()
{
	IfcPoint::unlinkFromInverseCounterparts();
}
