void ShapeBezierSurface::computeBBox(SoAction*, SbBox3f& box, SbVec3f& /*center*/ )
{
	box.makeEmpty();
	for (int i = 0; i < m_surfacesVector.size(); i++)
	{
		BBox pBox =  m_surfacesVector[i]->GetComputeBBox();
		SbVec3f pMin( pBox.pMin[0], pBox.pMin[1], pBox.pMin[2] );
		box.extendBy( pMin );
		SbVec3f pMax( pBox.pMax[0], pBox.pMax[1], pBox.pMax[2] );
		box.extendBy( pMax );
	}
}
Exemple #2
0
void SoWidgetShape::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
{
    // ignore if node is empty
    if (this->image.isNull()) return;

    SbVec3f v0, v1, v2, v3;
    // this will cause a cache dependency on the view volume,
    // model matrix and viewport.
    this->getQuad(action->getState(), v0, v1, v2, v3);

    box.makeEmpty();
    box.extendBy(v0);
    box.extendBy(v1);
    box.extendBy(v2);
    box.extendBy(v3);
    center = box.getCenter();
}