|| Abs (theBndBox.CornerMin().z()) >= ShortRealLast();
}
+// =======================================================================
+// function : updateBoundingBox
+// purpose :
+// =======================================================================
+void updateBoundingBox(const Handle(Graphic3d_Camera)& theCamera,
+ const Graphic3d_Mat4d& aProjectionMat,
+ const Graphic3d_Mat4d& aWorldViewMat,
+ Standard_Integer theWindowWidth,
+ Standard_Integer theWindowHeight,
+ const Handle(Graphic3d_TransformPers)& aTrsfPers,
+ Graphic3d_BndBox3d& aBox,
+ Bnd_Box& aResBox)
+{
+ if (aTrsfPers.IsNull())
+ {
+ return;
+ }
+
+ if (!aBox.IsValid())
+ {
+ return;
+ }
+
+ aTrsfPers->Apply(theCamera, aProjectionMat, aWorldViewMat, theWindowWidth, theWindowHeight, aBox);
+ if (aBox.IsValid()
+ && !isInfiniteBndBox(aBox))
+ {
+ aResBox.Add(gp_Pnt(aBox.CornerMin().x(), aBox.CornerMin().y(), aBox.CornerMin().z()));
+ aResBox.Add(gp_Pnt(aBox.CornerMax().x(), aBox.CornerMax().y(), aBox.CornerMax().z()));
+ }
+}
+
// =======================================================================
// function : BoundingBox
// purpose :
{
continue;
}
- else if (aStructure->TransformPersistence().IsNull()
- || !aStructure->TransformPersistence()->IsTrihedronOr2d())
+ for (Graphic3d_SequenceOfGroup::Iterator aGroupIter(aStructure->Groups()); aGroupIter.More(); aGroupIter.Next())
{
- continue;
+ const Handle(Graphic3d_Group)& aGroup = aGroupIter.Value();
+ if (aGroup->TransformPersistence().IsNull())
+ {
+ continue;
+ }
+
+ const Graphic3d_BndBox4f& aBoxF = aGroup->BoundingBox();
+ Graphic3d_BndBox3d aBox = Graphic3d_BndBox3d (Graphic3d_Vec3d ((Standard_Real)aBoxF.CornerMin().x(),
+ (Standard_Real)aBoxF.CornerMin().y(),
+ (Standard_Real)aBoxF.CornerMin().z()),
+ Graphic3d_Vec3d ((Standard_Real)aBoxF.CornerMax().x(),
+ (Standard_Real)aBoxF.CornerMax().y(),
+ (Standard_Real)aBoxF.CornerMax().z()));
+ updateBoundingBox(theCamera, aProjectionMat, aWorldViewMat, theWindowWidth, theWindowHeight,
+ aGroup->TransformPersistence(), aBox, aResBox);
}
- Graphic3d_BndBox3d aBox = aStructure->BoundingBox();
- if (!aBox.IsValid())
+ if (aStructure->TransformPersistence().IsNull()
+ || !aStructure->TransformPersistence()->IsTrihedronOr2d())
{
continue;
}
- aStructure->TransformPersistence()->Apply (theCamera, aProjectionMat, aWorldViewMat, theWindowWidth, theWindowHeight, aBox);
- if (aBox.IsValid()
- && !isInfiniteBndBox (aBox))
- {
- aResBox.Add (gp_Pnt (aBox.CornerMin().x(), aBox.CornerMin().y(), aBox.CornerMin().z()));
- aResBox.Add (gp_Pnt (aBox.CornerMax().x(), aBox.CornerMax().y(), aBox.CornerMax().z()));
- }
+ Graphic3d_BndBox3d aBox = aStructure->BoundingBox();
+ updateBoundingBox (theCamera, aProjectionMat, aWorldViewMat, theWindowWidth, theWindowHeight,
+ aStructure->TransformPersistence(), aBox, aResBox);
}
-
return aResBox;
}
}
#if !defined(GL_ES_VERSION_2_0)
// activate texture unit
- GLint aTexEnvParam = GL_REPLACE;
+ ////GLint aTexEnvParam = GL_REPLACE;
if (theCtx->core11 != NULL)
{
glDisable (GL_TEXTURE_1D);
glEnable (GL_TEXTURE_2D);
- glGetTexEnviv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &aTexEnvParam);
- if (aTexEnvParam != GL_REPLACE)
- {
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- }
+ ////glGetTexEnviv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &aTexEnvParam);
+ ////if (aTexEnvParam != GL_REPLACE)
+ ////{
+ //// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ ////}
}
#endif
theCtx->ApplyProjectionMatrix();
}
-#if !defined(GL_ES_VERSION_2_0)
- if (theCtx->core11 != NULL)
- {
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aTexEnvParam);
- }
-#endif
+//#if !defined(GL_ES_VERSION_2_0)
+// if (theCtx->core11 != NULL)
+// {
+// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aTexEnvParam);
+// }
+//#endif
if (theTextAspect.Aspect()->TextDisplayType() == Aspect_TODT_DIMENSION)
{