// function : GetCurrentGroups
// purpose :
//=======================================================================
- const Graphic3d_SequenceOfGroup& Graphic3d_LODManager::GetCurrentGroups() const
- {
- return myLODs.Value (myCurrentLODIdx)->GetDrawGroups();
- }
+const Graphic3d_SequenceOfGroup& Graphic3d_LODManager::GetCurrentGroups() const
+{
+ return myLODs.Value (myCurrentLODIdx)->GetDrawGroups();
+}
- //=======================================================================
+//=======================================================================
// function : GetCombinedBndBox
// purpose :
//=======================================================================
- void Graphic3d_LODManager::GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const
- {
- for (Standard_Integer aLodIdx = 0; aLodIdx < myLODs.Size(); ++aLodIdx)
- {
- const Graphic3d_SequenceOfGroup& aGroups = myLODs.Value (aLodIdx)->GetDrawGroups();
- for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
- {
- theBndBox.Combine (aGroupIter.Value()->BoundingBox());
- }
- }
- }
+void Graphic3d_LODManager::GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const
+{
+ for (Standard_Integer aLodIdx = 0; aLodIdx < myLODs.Size(); ++aLodIdx)
+ {
+ const Graphic3d_SequenceOfGroup& aGroups = myLODs.Value (aLodIdx)->GetDrawGroups();
+ for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
+ {
+ theBndBox.Combine (aGroupIter.Value()->BoundingBox());
+ }
+ }
+}
+
+//=======================================================================
+// function : IsEmpty
+// purpose :
+//=======================================================================
+Standard_Boolean Graphic3d_LODManager::IsEmpty() const
+{
+ for (Standard_Integer aLodIdx = 0; aLodIdx < myLODs.Size(); ++aLodIdx)
+ {
+ const Graphic3d_SequenceOfGroup& aGroups = myLODs.Value (aLodIdx)->GetDrawGroups();
+ if (!aGroups.IsEmpty())
+ return Standard_False;
+ }
+
+ return Standard_True;
+}
Standard_EXPORT void GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const;
+ //! Returns false if at least one of LODs has non-empty sequence of Graphic3d_Groups
+ Standard_EXPORT Standard_Boolean IsEmpty() const;
+
DEFINE_STANDARD_RTTIEXT (Graphic3d_LODManager, Standard_Transient)
protected:
}
// structure is empty:
+ // - in case if it is represented by LODs, all LODs have no graphic groups
// - if all these groups are empty
// - or if all groups are empty and all their descendants are empty
// - or if all its descendants are empty
+ // - or, in case if it is represented by LODs, all LODs have no graphic groups
+ if (!myCStructure->GetLodManager().IsNull())
+ {
+ return myCStructure->GetLodManager()->IsEmpty();
+ }
+
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (myCStructure->Groups()); aGroupIter.More(); aGroupIter.Next())
{
if (!aGroupIter.Value()->IsEmpty())
return Standard_False;
}
}
+
return Standard_True;
}
if (isPolygons && theFillAsp->FrontMaterial().Transparency() < 0.01)
{
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
- //Prs3d_Root::NewGroup ( theBasePrs );
- //Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
theFillAsp->SetEdgeOff();
if (isPolylines && !theIsPolygonsEdgesOff)
{
Handle (Graphic3d_Group) aLGroup = aNewLod->NewGroup (theBasePrs);
- //Prs3d_Root::NewGroup ( theBasePrs );
- //Handle (Graphic3d_Group) aLGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
theFillAsp->SetEdgeOff();
if (theIsSelected)
if (isLinkPolylines)
{
Handle (Graphic3d_Group) aBeamGroup = aNewLod->NewGroup (theBasePrs);
- //Prs3d_Root::NewGroup ( theBasePrs );
- //Handle (Graphic3d_Group) aBeamGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
theFillAsp->SetEdgeOff();
if (!theIsSelected)
if (isPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01)
{
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
- //Prs3d_Root::NewGroup ( theBasePrs );
- //Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
theFillAsp->SetEdgeOff();