Beispiel #1
0
//---------------------------------------------------------
bool CSG_Shapes::On_Update(void)
{
	if( Get_Count() > 0 )
	{
		CSG_Shape	*pShape	= Get_Shape(0);

		m_Extent	= pShape->Get_Extent();
		m_ZMin		= pShape->Get_ZMin();
		m_ZMax		= pShape->Get_ZMax();
		m_MMin		= pShape->Get_MMin();
		m_MMax		= pShape->Get_MMax();

		for(int i=1; i<Get_Count(); i++)
		{
			pShape	= Get_Shape(i);

			m_Extent.Union(pShape->Get_Extent());

			switch( m_Vertex_Type )
			{
			case SG_VERTEX_TYPE_XYZM:
				if( m_MMin > pShape->Get_MMin() )	m_MMin	= pShape->Get_MMin();
				if( m_MMax < pShape->Get_MMax() )	m_MMax	= pShape->Get_MMax();

			case SG_VERTEX_TYPE_XYZ:
				if( m_ZMin > pShape->Get_ZMin() )	m_ZMin	= pShape->Get_ZMin();
				if( m_ZMax < pShape->Get_ZMax() )	m_ZMax	= pShape->Get_ZMax();
				break;
			default:
				break;
			}
		}
	}
	else
	{
		m_Extent.Assign(0.0, 0.0, 0.0, 0.0);
	}

	return( CSG_Table::On_Update() );
}