/* 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/IfcAxis2Placement.h"
#include "ifcpp/IFC4/include/IfcLengthMeasure.h"
#include "ifcpp/IFC4/include/IfcPlanarBox.h"
#include "ifcpp/IFC4/include/IfcPresentationLayerAssignment.h"
#include "ifcpp/IFC4/include/IfcStyledItem.h"

// ENTITY IfcPlanarBox 
IfcPlanarBox::IfcPlanarBox( int id ) { m_entity_id = id; }
IfcPlanarBox::~IfcPlanarBox() {}
shared_ptr<BuildingObject> IfcPlanarBox::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcPlanarBox> copy_self( new IfcPlanarBox() );
	if( m_SizeInX ) { copy_self->m_SizeInX = dynamic_pointer_cast<IfcLengthMeasure>( m_SizeInX->getDeepCopy(options) ); }
	if( m_SizeInY ) { copy_self->m_SizeInY = dynamic_pointer_cast<IfcLengthMeasure>( m_SizeInY->getDeepCopy(options) ); }
	if( m_Placement ) { copy_self->m_Placement = dynamic_pointer_cast<IfcAxis2Placement>( m_Placement->getDeepCopy(options) ); }
	return copy_self;
}
void IfcPlanarBox::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCPLANARBOX" << "(";
	if( m_SizeInX ) { m_SizeInX->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_SizeInY ) { m_SizeInY->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_Placement ) { m_Placement->getStepParameter( stream, true ); } else { stream << "$" ; }
	stream << ");";
}
void IfcPlanarBox::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcPlanarBox::toString() const { return L"IfcPlanarBox"; }
void IfcPlanarBox::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 IfcPlanarBox, expecting 3, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_SizeInX = IfcLengthMeasure::createObjectFromSTEP( args[0], map );
	m_SizeInY = IfcLengthMeasure::createObjectFromSTEP( args[1], map );
	m_Placement = IfcAxis2Placement::createObjectFromSTEP( args[2], map );
}
void IfcPlanarBox::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcPlanarExtent::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "Placement", m_Placement ) );
}
void IfcPlanarBox::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcPlanarExtent::getAttributesInverse( vec_attributes_inverse );
}
void IfcPlanarBox::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcPlanarExtent::setInverseCounterparts( ptr_self_entity );
}
void IfcPlanarBox::unlinkFromInverseCounterparts()
{
	IfcPlanarExtent::unlinkFromInverseCounterparts();
}
