Core: Fit all : Do not process SoSkipBoundingGroup
This commit is contained in:
committed by
Chris Hennes
parent
3a7298f95a
commit
53f1f112e0
@@ -3393,18 +3393,6 @@ SbBox3f View3DInventorViewer::getBoundingBox() const
|
||||
|
||||
void View3DInventorViewer::viewAll()
|
||||
{
|
||||
SbBox3f box = getBoundingBox();
|
||||
|
||||
if (box.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
SbSphere sphere;
|
||||
sphere.circumscribe(box);
|
||||
if (sphere.getRadius() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// in the scene graph we may have objects which we want to exclude
|
||||
// when doing a fit all. Such objects must be part of the group
|
||||
// SoSkipBoundingGroup.
|
||||
@@ -3420,20 +3408,30 @@ void View3DInventorViewer::viewAll()
|
||||
group->mode = SoSkipBoundingGroup::EXCLUDE_BBOX;
|
||||
}
|
||||
|
||||
// Set the height angle to 45 deg
|
||||
SoCamera* cam = this->getSoRenderManager()->getCamera();
|
||||
SbBox3f box = getBoundingBox();
|
||||
|
||||
if (cam && cam->getTypeId().isDerivedFrom(SoPerspectiveCamera::getClassTypeId())) {
|
||||
static_cast<SoPerspectiveCamera*>(cam)->heightAngle = (float)(std::numbers::pi / 4.0); // NOLINT
|
||||
}
|
||||
if (!box.isEmpty()) {
|
||||
SbSphere sphere;
|
||||
sphere.circumscribe(box);
|
||||
if (sphere.getRadius() != 0) {
|
||||
// Set the height angle to 45 deg
|
||||
SoCamera* cam = this->getSoRenderManager()->getCamera();
|
||||
|
||||
if (isAnimationEnabled()) {
|
||||
animatedViewAll(10, 20); // NOLINT
|
||||
}
|
||||
if (cam && cam->getTypeId().isDerivedFrom(SoPerspectiveCamera::getClassTypeId())) {
|
||||
static_cast<SoPerspectiveCamera*>(cam)->heightAngle =
|
||||
(float)(std::numbers::pi / 4.0); // NOLINT
|
||||
}
|
||||
|
||||
// make sure everything is visible
|
||||
if (cam) {
|
||||
cam->viewAll(getSoRenderManager()->getSceneGraph(), this->getSoRenderManager()->getViewportRegion());
|
||||
if (isAnimationEnabled()) {
|
||||
animatedViewAll(10, 20); // NOLINT
|
||||
}
|
||||
|
||||
// make sure everything is visible
|
||||
if (cam) {
|
||||
cam->viewAll(getSoRenderManager()->getSceneGraph(),
|
||||
this->getSoRenderManager()->getViewportRegion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < pathlist.getLength(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user