mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024394: Visualization - implement more general way for rendering of immediate objects
Move OpenGl_Structure::myZLayer to base class Graphic3d_CStructure. Graphic3d_ZLayerId - introduce new pre-defined ZLayers. Do not clear Depth buffer twice for default ZLayer. AIS_InteractiveContext::Display() - add new argument AIS_DisplayStatus to specify displaying status. Drop unused Graphic3d_CPick and related methods. Drop OpenGl_Structure::myNamedStatus - use flags from parent class Graphic3d_CStructure directly. OpenGl_LayerList ::ChangeLayer(), ::ChangePriority - fix structure remove from unexpected layer. Merge class OpenGl_PriorityList into OpenGl_Layer. PrsMgr_PresentationManager::mySelectionColor - store selection color as field of Presentation Manager. PrsMgr_Presentation class - do not declare private methods as virtual. PrsMgr_Presentation::Highlight() - extend method syntax and drop methods ::Color() and ::BoundBox(). PrsMgr_PresentableObject - store ZLayer in presentable object to display object presentations in required layer directly (without displaying it in wrong layer first). test/mesh/end - force re-displaying the shape to compute mesh anew Test-case for issue
This commit is contained in:
@@ -34,7 +34,8 @@ uses
|
||||
PresentationManager3d from PrsMgr,
|
||||
NameOfColor from Quantity,
|
||||
Drawer from Prs3d,
|
||||
Shape from StdSelect
|
||||
Shape from StdSelect,
|
||||
ZLayerId from Graphic3d
|
||||
is
|
||||
|
||||
|
||||
@@ -145,8 +146,7 @@ is
|
||||
ResetLocation(me:mutable) is redefined;
|
||||
|
||||
SetZLayer ( me : mutable;
|
||||
thePrsMgr : PresentationManager from PrsMgr;
|
||||
theLayerId : Integer from Standard )
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
is redefined virtual;
|
||||
---Purpose: Set Z layer ID and update all presentations.
|
||||
|
||||
|
@@ -87,6 +87,7 @@ void StdSelect_BRepOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
|
||||
#else
|
||||
Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
|
||||
#endif
|
||||
Handle(SelectMgr_SelectableObject) aSel = Selectable();
|
||||
if (myFromDecomposition)
|
||||
{
|
||||
// do the update flag check
|
||||
@@ -99,23 +100,23 @@ void StdSelect_BRepOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
|
||||
}
|
||||
|
||||
// generate new presentable shape
|
||||
if(myPrsSh.IsNull())
|
||||
if (myPrsSh.IsNull())
|
||||
{
|
||||
myPrsSh = new StdSelect_Shape (myShape);
|
||||
}
|
||||
if (!aSel.IsNull())
|
||||
{
|
||||
myPrsSh->SetZLayer (aSel->ZLayer());
|
||||
}
|
||||
|
||||
// highlight and set layer
|
||||
PM->Highlight (myPrsSh, M);
|
||||
Handle(SelectMgr_SelectableObject) aSel = Selectable();
|
||||
if (!aSel.IsNull())
|
||||
{
|
||||
Standard_Integer aLayer = aSel->GetZLayer (PM);
|
||||
if (aLayer >= 0)
|
||||
PM->SetZLayer (myPrsSh, aLayer);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(myPrsSh.IsNull())
|
||||
PM->Highlight(Selectable(),M);
|
||||
PM->Highlight(aSel,M);
|
||||
else
|
||||
PM->Highlight(myPrsSh,M);
|
||||
}
|
||||
@@ -133,6 +134,7 @@ void StdSelect_BRepOwner::HilightWithColor(const Handle(PrsMgr_PresentationManag
|
||||
#else
|
||||
Standard_Integer M = (myCurMode==-1) ? aMode:myCurMode;
|
||||
#endif
|
||||
Handle(SelectMgr_SelectableObject) aSel = Selectable();
|
||||
if (myFromDecomposition)
|
||||
{
|
||||
// do the update flag check
|
||||
@@ -156,21 +158,18 @@ void StdSelect_BRepOwner::HilightWithColor(const Handle(PrsMgr_PresentationManag
|
||||
else
|
||||
myPrsSh = new StdSelect_Shape(myShape);
|
||||
}
|
||||
if (!aSel.IsNull())
|
||||
{
|
||||
myPrsSh->SetZLayer (aSel->ZLayer());
|
||||
}
|
||||
|
||||
// highlight with color and set layer
|
||||
PM->Color (myPrsSh, aCol, M);
|
||||
Handle(SelectMgr_SelectableObject) aSel = Selectable();
|
||||
if (!aSel.IsNull())
|
||||
{
|
||||
Standard_Integer aLayer = aSel->GetZLayer (PM);
|
||||
if (aLayer >= 0)
|
||||
PM->SetZLayer (myPrsSh, aLayer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(myPrsSh.IsNull())
|
||||
PM->Color(Selectable(),aCol,M);
|
||||
PM->Color(aSel, aCol, M);
|
||||
else
|
||||
PM->Color(myPrsSh,aCol,M);
|
||||
}
|
||||
@@ -227,10 +226,10 @@ void StdSelect_BRepOwner::ResetLocation()
|
||||
//function : SetZLayer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdSelect_BRepOwner::SetZLayer
|
||||
(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Standard_Integer theLayerId)
|
||||
void StdSelect_BRepOwner::SetZLayer (const Graphic3d_ZLayerId theLayerId)
|
||||
{
|
||||
if (!myPrsSh.IsNull())
|
||||
thePrsMgr->SetZLayer (myPrsSh, theLayerId);
|
||||
{
|
||||
myPrsSh->SetZLayer (theLayerId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user