コード例 #1
0
GLC_BoundingBox GLC_StructOccurence::boundingBox() const
{
	GLC_BoundingBox boundingBox;

	if (NULL != m_pWorldHandle)
	{
		if (has3DViewInstance())
		{
			Q_ASSERT(m_pWorldHandle->collection()->contains(id()));
			boundingBox= m_pWorldHandle->collection()->instanceHandle(id())->boundingBox();
		}
		else
		{
			if (hasChild())
			{
				QList<GLC_StructOccurence*> childrenList= children();
				const int size= childrenList.size();

				for (int i= 0; i < size; ++i)
				{
					boundingBox.combine(childrenList.at(i)->boundingBox());
				}
			}
		}
	}

	return boundingBox;
}
コード例 #2
0
ファイル: glc_3drep.cpp プロジェクト: c3d/tao-object-loader
// Return the 3DRep bounding Box
GLC_BoundingBox GLC_3DRep::boundingBox() const
{
	GLC_BoundingBox resultBox;
	const int size= m_pGeomList->size();
	for (int i= 0; i < size; ++i)
	{
		resultBox.combine(m_pGeomList->at(i)->boundingBox());
	}
	return resultBox;
}
コード例 #3
0
GLC_BoundingBox GLC_3DViewCollection::boundingBox(bool allObject)
{
	GLC_BoundingBox boundingBox;
	// Check if the bounding box have to be updated
	if (!m_3DViewInstanceHash.isEmpty())
	{
		ViewInstancesHash::iterator iEntry= m_3DViewInstanceHash.begin();
	    while (iEntry != m_3DViewInstanceHash.constEnd())
	    {
	        if(allObject || iEntry.value().isVisible() == m_IsInShowSate)
	        {
	        	// Combine Collection BoundingBox with element Bounding Box
	        	boundingBox.combine(iEntry.value().boundingBox());
	        }
	        ++iEntry;
	    }
	}
	return boundingBox;
}