mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024752: Visualization - inherit OpenGl_Group from Graphic3d_Group
Graphic3d_Group is now abstract class and should be instantiated using Graphic3d_Structure::NewGroup() method. Graphic3d_CGroup has been removed. The groups list is no more duplicated within Graphic3d_Structure and OpenGl_Structure. Removed unused/duplicated fields from Graphic3d_Group. Prs3d_Presentation - remove redundnant field myCurrentGroup. PrsMgr_Presentation3d::Erase(), ::Clear() - avoid possible NULL dereference. OpenGl_GraphicDriver/Graphic3d_GraphicDriver - group management methods have been removed (moved to Graphic3d_CStructure and Graphic3d_Group interfaces). Graphic3d_Group::GroupPrimitivesAspect() - copy IsEmission flag Fix wrong iterator Fix compilation issues
This commit is contained in:
@@ -727,20 +727,23 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode,
|
||||
// Workaround for issue 23115: Need to update also groups, because their
|
||||
// face aspect ALWAYS overrides the structure's.
|
||||
const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
|
||||
Standard_Integer aGroupIndex = 1, aGroupNb = aGroups.Length();
|
||||
for ( ; aGroupIndex <= aGroupNb; aGroupIndex++ ) {
|
||||
Handle(Graphic3d_Group) aGrp = aGroups.Value(aGroupIndex);
|
||||
if ( !aGrp.IsNull() && aGrp->IsGroupPrimitivesAspectSet(Graphic3d_ASPECT_FILL_AREA) ) {
|
||||
Handle(Graphic3d_AspectFillArea3d) aFaceAsp = new Graphic3d_AspectFillArea3d();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAsp = new Graphic3d_AspectLine3d();
|
||||
Handle(Graphic3d_AspectMarker3d) aPntAsp = new Graphic3d_AspectMarker3d();
|
||||
Handle(Graphic3d_AspectText3d) aTextAsp = new Graphic3d_AspectText3d();
|
||||
// TODO: Add methods for retrieving individual aspects from Graphic3d_Group
|
||||
aGrp->GroupPrimitivesAspect(aLineAsp, aTextAsp, aPntAsp, aFaceAsp);
|
||||
aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits);
|
||||
// TODO: Issue 23118 - This line kills texture data in the group...
|
||||
aGrp->SetGroupPrimitivesAspect(aFaceAsp);
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
|
||||
{
|
||||
Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
|
||||
if (aGrp.IsNull()
|
||||
|| !aGrp->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_AspectFillArea3d) aFaceAsp = new Graphic3d_AspectFillArea3d();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAsp = new Graphic3d_AspectLine3d();
|
||||
Handle(Graphic3d_AspectMarker3d) aPntAsp = new Graphic3d_AspectMarker3d();
|
||||
Handle(Graphic3d_AspectText3d) aTextAsp = new Graphic3d_AspectText3d();
|
||||
// TODO: Add methods for retrieving individual aspects from Graphic3d_Group
|
||||
aGrp->GroupPrimitivesAspect(aLineAsp, aTextAsp, aPntAsp, aFaceAsp);
|
||||
aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits);
|
||||
aGrp->SetGroupPrimitivesAspect(aFaceAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user