예제 #1
0
void vtUtilityMap::GetPoleExtents(DRECT &rect)
{
	if (m_Poles.IsEmpty())
		return;

	rect.SetRect(1E9, -1E9, -1E9, 1E9);

	int i, size = m_Poles.GetSize();
	for (i = 0; i < size; i++)
	{
		vtPole *pole = m_Poles.GetAt(i);
		rect.GrowToContainPoint(pole->m_p);
	}
}
예제 #2
0
void vtUtilityMap::GetPoleExtents(DRECT &rect)
{
	if (m_Poles.empty())
		return;

	rect.SetInsideOut();

	const int size = m_Poles.size();
	for (int i = 0; i < size; i++)
	{
		vtPole *pole = m_Poles[i];
		rect.GrowToContainPoint(pole->m_p);
	}
}
예제 #3
0
//
// Get an extent rectangle around the building.
// It doesn't need to be exact.
//
bool vtBuilding::GetExtents(DRECT &rect) const
{
	uint i, j;
	uint levs = m_Levels.GetSize();
	if (levs == 0)
		return false;

	rect.SetRect(1E9, -1E9, -1E9, 1E9);
	for (i = 0; i < levs; i++)
	{
		vtLevel *lev = m_Levels[i];
		if (lev->GetFootprint().size() != 0)	// safety check
		{
			const DLine2 &outer = lev->GetOuterFootprint();
			for (j = 0; j < outer.GetSize(); j++)
				rect.GrowToContainPoint(outer[j]);
		}
	}
	return true;
}