Bnd_Box aBoundingBox;
anObject->BoundingBox (aBoundingBox);
- // processing presentations with own flipping
+ // processing presentations with own flipping and transform persistence
for (PrsMgr_Presentations::Iterator aPrsIter(anObject->Presentations()); aPrsIter.More(); aPrsIter.Next())
{
const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
{
const Handle(Graphic3d_Group)& aGroup = aGroupIter.Value();
const Graphic3d_BndBox4f& aBndBox = aGroup->BoundingBox();
- if (aGroup->Flipper().IsNull()
+ if ((aGroup->Flipper().IsNull() && aGroup->TransformPersistence().IsNull())
|| !aBndBox.IsValid())
{
continue;
Bnd_Box aGroupBox;
aGroupBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
aBndBox.CornerMax().x(), aBndBox.CornerMax().y(), aBndBox.CornerMax().z());
- aGroup->Flipper()->Apply (theWorldViewMat, aGroupBox);
+ if (!aGroup->Flipper().IsNull())
+ {
+ aGroup->Flipper()->Apply (theWorldViewMat, aGroupBox);
+ }
+
+ if (!aGroup->TransformPersistence().IsNull())
+ {
+ aGroup->TransformPersistence()->Apply (theCamera,
+ theProjectionMat, theWorldViewMat,
+ theWinSize.x(), theWinSize.y(),
+ aGroupBox);
+ }
aBoundingBox.Add (aGroupBox);
}
}
aBoundingBox);
}
- // processing presentations with own transform persistence
- for (PrsMgr_Presentations::Iterator aPrsIter (anObject->Presentations()); aPrsIter.More(); aPrsIter.Next())
- {
- const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
- if (!aPrs3d->CStructure()->HasGroupTransformPersistence())
- {
- continue;
- }
-
- for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Groups()); aGroupIter.More(); aGroupIter.Next())
- {
- const Handle(Graphic3d_Group)& aGroup = aGroupIter.Value();
- const Graphic3d_BndBox4f& aBndBox = aGroup->BoundingBox();
- if (aGroup->TransformPersistence().IsNull()
- || !aBndBox.IsValid())
- {
- continue;
- }
-
- Bnd_Box aGroupBox;
- aGroupBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
- aBndBox.CornerMax().x(), aBndBox.CornerMax().y(), aBndBox.CornerMax().z());
- aGroup->TransformPersistence()->Apply (theCamera,
- theProjectionMat, theWorldViewMat,
- theWinSize.x(), theWinSize.y(),
- aGroupBox);
- aBoundingBox.Add (aGroupBox);
- }
- }
-
if (aBoundingBox.IsVoid())
{
myBoundings.Add (new Select3D_HBndBox3d());