mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024637: Visualization - clean up implementation of rendering in immediate mode
Remove unused flag "DoubleBuf". Remove Visual3d_TransientManager "class" (functionality moved to PrsMgr_PresentationManager). Remove unused "Add" immediate mode. V3d_View class - remove methods ::TransientManagerBeginDraw(), ::TransientManagerClearDraw(), ::TransientManagerBeginAddDraw(). Add method ::RedrawImmediate() to redraw only immediate presentations. OpenGl_GraphicDriver - add methods ::DisplayImmediateStructure(), ::EraseImmediateStructure(), ::RedrawImmediate(). OpenGl_View - manage list of immediate structures. OpenGl_Workspace - automate rendering workflow of immediate + persistent layers. Merge PrsMgr_PresentationManager3d class into PrsMgr_PresentationManager. Mark PrsMgr_PresentationManager3d as alias to PrsMgr_PresentationManager to simplify porting. Prs3d_Presentation - remove unused field myStruct. Prs3d_PresentationShadow - shadow link to existing presentation with custom attributes. Graphic3d_Structure::Highlight() - do not register undisplayed structure in structure manager. AIS_InteractiveContext, AIS_LocalContext add flag to prevent view update into methods ::MoveTo(), ::HilightNextDetected(), ::HilightPreviousDetected() to allow update of customized immediate structures before redraw but after ::MoveTo(). Remove unused method AIS_InteractiveContext::Drag(). StdSelect_ViewerSelector3d do not user immediate mode in methods ::DisplayAreas(), ::ClearAreas(), ::ClearSensitive(), ::DisplaySensitive(), GridEcho - update value in StdSelect_ViewerSelector3d::Pick() instead of V3d_View::Compute(). Do not use global variable for GridEcho vertex. Redraw immediate mode not within GridEcho but at AIS_InteractiveContext, AIS_LocalContext layer. V3d_View::ToPixMap() - disable autoupdate during FitAll. Avoid Redraw() into FBO without ImmediateModeDrawToFront flag. PrsMgr_PresentationManager stores list of temporary immediate presentations, automatically cleared within BeginImmediateMode() call. Methods with ambiguous names have been renamed (new names now consistent with pre-existed method names in AIS_LocalContext class): - BeginDraw -> BeginImmediateDraw - EndDraw -> EndImmediateDraw Remove now useless Remove() method (and ImmediateRemove() in AIS). Visual3d_View now stores map of displayed immediate presentations. ViewerTest_EventManager - eliminate double redraw in selection methods. Fix warning
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
#include <SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive.hxx>
|
||||
#include <SelectBasics_ListOfBox2d.hxx>
|
||||
#include <Visual3d_TransientManager.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
@@ -49,6 +48,7 @@
|
||||
#include <Select3D_ListIteratorOfListOfSensitiveTriangle.hxx>
|
||||
|
||||
#include <SelectMgr_DataMapIteratorOfDataMapOfSelectionActivation.hxx>
|
||||
#include <Aspect_Grid.hxx>
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_ArrayOfPoints.hxx>
|
||||
@@ -61,9 +61,9 @@
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <V3d.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <TColgp_SequenceOfPnt.hxx>
|
||||
|
||||
|
||||
static Standard_Integer StdSel_NumberOfFreeEdges (const Handle(Poly_Triangulation)& Trg)
|
||||
{
|
||||
Standard_Integer nFree = 0;
|
||||
@@ -196,15 +196,14 @@ void StdSelect_ViewerSelector3d::Pick (const Standard_Integer theXPix,
|
||||
{
|
||||
SetClipping (theView->GetClipPlanes());
|
||||
UpdateProj (theView);
|
||||
Standard_Real aPnt3d[3];
|
||||
theView->Convert (theXPix, theYPix,
|
||||
aPnt3d[0], aPnt3d[1], aPnt3d[2]);
|
||||
|
||||
Standard_Real aXr3d = 0.0;
|
||||
Standard_Real aYr3d = 0.0;
|
||||
Standard_Real aZr3d = 0.0;
|
||||
gp_Pnt2d aP2d;
|
||||
theView->Convert (theXPix, theYPix, aXr3d, aYr3d, aZr3d);
|
||||
myProjector->Project (gp_Pnt (aXr3d, aYr3d, aZr3d), aP2d);
|
||||
gp_Pnt2d aPnt2d;
|
||||
myProjector->Project (gp_Pnt (aPnt3d[0], aPnt3d[1], aPnt3d[2]), aPnt2d);
|
||||
|
||||
InitSelect (aP2d.X(), aP2d.Y());
|
||||
InitSelect (aPnt2d.X(), aPnt2d.Y());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -373,15 +372,7 @@ void StdSelect_ViewerSelector3d::DisplayAreas (const Handle(V3d_View)& theView)
|
||||
myareagroup->Structure()->SetDisplayPriority (10);
|
||||
myareagroup->Structure()->Display();
|
||||
|
||||
if (theView->TransientManagerBeginDraw())
|
||||
{
|
||||
Visual3d_TransientManager::DrawStructure (mystruct);
|
||||
Visual3d_TransientManager::EndDraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
theView->Update();
|
||||
}
|
||||
theView->Update();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -397,16 +388,7 @@ void StdSelect_ViewerSelector3d::ClearAreas (const Handle(V3d_View)& theView)
|
||||
|
||||
myareagroup->Clear();
|
||||
|
||||
if (theView.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (theView->TransientManagerBeginDraw())
|
||||
{
|
||||
Visual3d_TransientManager::EndDraw();
|
||||
}
|
||||
else
|
||||
if (!theView.IsNull())
|
||||
{
|
||||
theView->Update();
|
||||
}
|
||||
@@ -588,15 +570,7 @@ void StdSelect_ViewerSelector3d::DisplaySensitive (const Handle(V3d_View)& theVi
|
||||
mysensgroup->Structure()->SetDisplayPriority (10);
|
||||
mystruct->Display();
|
||||
|
||||
if (theView->TransientManagerBeginDraw())
|
||||
{
|
||||
Visual3d_TransientManager::DrawStructure (mystruct);
|
||||
Visual3d_TransientManager::EndDraw();
|
||||
}
|
||||
else if (!theView.IsNull())
|
||||
{
|
||||
theView->Update();
|
||||
}
|
||||
theView->Update();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -617,14 +591,7 @@ void StdSelect_ViewerSelector3d::ClearSensitive (const Handle(V3d_View)& theView
|
||||
return;
|
||||
}
|
||||
|
||||
if (theView->TransientManagerBeginDraw())
|
||||
{
|
||||
Visual3d_TransientManager::EndDraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
theView->Update();
|
||||
}
|
||||
theView->Update();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -661,15 +628,8 @@ void StdSelect_ViewerSelector3d::DisplaySensitive (const Handle(SelectMgr_Select
|
||||
|
||||
mystruct->SetDisplayPriority (10);
|
||||
mystruct->Display();
|
||||
if (theView->TransientManagerBeginDraw())
|
||||
{
|
||||
Visual3d_TransientManager::DrawStructure (mystruct);
|
||||
Visual3d_TransientManager::EndDraw();
|
||||
}
|
||||
else if(!theView.IsNull())
|
||||
{
|
||||
theView->Update();
|
||||
}
|
||||
|
||||
theView->Update();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -702,15 +662,7 @@ void StdSelect_ViewerSelector3d::DisplayAreas (const Handle(SelectMgr_Selection)
|
||||
mystruct->SetDisplayPriority (10);
|
||||
mystruct->Display();
|
||||
|
||||
if(theView->TransientManagerBeginDraw())
|
||||
{
|
||||
Visual3d_TransientManager::DrawStructure (mystruct);
|
||||
Visual3d_TransientManager::EndDraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
theView->Update();
|
||||
}
|
||||
theView->Update();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
Reference in New Issue
Block a user