mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
FitAll for objects represented via LODs is fixed
This commit is contained in:
@@ -79,17 +79,17 @@ void Graphic3d_LODManager::SetRange (const Standard_Integer theLodIdx,
|
|||||||
// function : GetCurrentGroups
|
// function : GetCurrentGroups
|
||||||
// purpose :
|
// purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
const Graphic3d_SequenceOfGroup& Graphic3d_LODManager::GetCurrentGroups() const
|
const Graphic3d_SequenceOfGroup& Graphic3d_LODManager::GetCurrentGroups() const
|
||||||
{
|
{
|
||||||
return myLODs.Value (myCurrentLODIdx)->GetDrawGroups();
|
return myLODs.Value (myCurrentLODIdx)->GetDrawGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : GetCombinedBndBox
|
// function : GetCombinedBndBox
|
||||||
// purpose :
|
// purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void Graphic3d_LODManager::GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const
|
void Graphic3d_LODManager::GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const
|
||||||
{
|
{
|
||||||
for (Standard_Integer aLodIdx = 0; aLodIdx < myLODs.Size(); ++aLodIdx)
|
for (Standard_Integer aLodIdx = 0; aLodIdx < myLODs.Size(); ++aLodIdx)
|
||||||
{
|
{
|
||||||
const Graphic3d_SequenceOfGroup& aGroups = myLODs.Value (aLodIdx)->GetDrawGroups();
|
const Graphic3d_SequenceOfGroup& aGroups = myLODs.Value (aLodIdx)->GetDrawGroups();
|
||||||
@@ -98,4 +98,20 @@ void Graphic3d_LODManager::SetRange (const Standard_Integer theLodIdx,
|
|||||||
theBndBox.Combine (aGroupIter.Value()->BoundingBox());
|
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;
|
||||||
|
}
|
||||||
|
@@ -55,6 +55,9 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT void GetCombinedBndBox (Graphic3d_BndBox4f& theBndBox) const;
|
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)
|
DEFINE_STANDARD_RTTIEXT (Graphic3d_LODManager, Standard_Transient)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -486,9 +486,16 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// structure is empty:
|
// structure is empty:
|
||||||
|
// - in case if it is represented by LODs, all LODs have no graphic groups
|
||||||
// - if all these groups are empty
|
// - if all these groups are empty
|
||||||
// - or if all groups are empty and all their descendants are empty
|
// - or if all groups are empty and all their descendants are empty
|
||||||
// - or if all its 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())
|
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (myCStructure->Groups()); aGroupIter.More(); aGroupIter.Next())
|
||||||
{
|
{
|
||||||
if (!aGroupIter.Value()->IsEmpty())
|
if (!aGroupIter.Value()->IsEmpty())
|
||||||
@@ -505,6 +512,7 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -417,8 +417,6 @@ void MeshVS_LODBuilder::drawArrays (const Handle(Prs3d_Presentation)& theBasePrs
|
|||||||
if (isPolygons && theFillAsp->FrontMaterial().Transparency() < 0.01)
|
if (isPolygons && theFillAsp->FrontMaterial().Transparency() < 0.01)
|
||||||
{
|
{
|
||||||
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
|
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
|
||||||
//Prs3d_Root::NewGroup ( theBasePrs );
|
|
||||||
//Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
|
|
||||||
|
|
||||||
theFillAsp->SetEdgeOff();
|
theFillAsp->SetEdgeOff();
|
||||||
|
|
||||||
@@ -449,8 +447,6 @@ void MeshVS_LODBuilder::drawArrays (const Handle(Prs3d_Presentation)& theBasePrs
|
|||||||
if (isPolylines && !theIsPolygonsEdgesOff)
|
if (isPolylines && !theIsPolygonsEdgesOff)
|
||||||
{
|
{
|
||||||
Handle (Graphic3d_Group) aLGroup = aNewLod->NewGroup (theBasePrs);
|
Handle (Graphic3d_Group) aLGroup = aNewLod->NewGroup (theBasePrs);
|
||||||
//Prs3d_Root::NewGroup ( theBasePrs );
|
|
||||||
//Handle (Graphic3d_Group) aLGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
|
|
||||||
|
|
||||||
theFillAsp->SetEdgeOff();
|
theFillAsp->SetEdgeOff();
|
||||||
if (theIsSelected)
|
if (theIsSelected)
|
||||||
@@ -467,8 +463,6 @@ void MeshVS_LODBuilder::drawArrays (const Handle(Prs3d_Presentation)& theBasePrs
|
|||||||
if (isLinkPolylines)
|
if (isLinkPolylines)
|
||||||
{
|
{
|
||||||
Handle (Graphic3d_Group) aBeamGroup = aNewLod->NewGroup (theBasePrs);
|
Handle (Graphic3d_Group) aBeamGroup = aNewLod->NewGroup (theBasePrs);
|
||||||
//Prs3d_Root::NewGroup ( theBasePrs );
|
|
||||||
//Handle (Graphic3d_Group) aBeamGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
|
|
||||||
|
|
||||||
theFillAsp->SetEdgeOff();
|
theFillAsp->SetEdgeOff();
|
||||||
if (!theIsSelected)
|
if (!theIsSelected)
|
||||||
@@ -481,8 +475,6 @@ void MeshVS_LODBuilder::drawArrays (const Handle(Prs3d_Presentation)& theBasePrs
|
|||||||
if (isPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01)
|
if (isPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01)
|
||||||
{
|
{
|
||||||
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
|
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
|
||||||
//Prs3d_Root::NewGroup ( theBasePrs );
|
|
||||||
//Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup ( theBasePrs );
|
|
||||||
|
|
||||||
theFillAsp->SetEdgeOff();
|
theFillAsp->SetEdgeOff();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user