mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +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:
@@ -116,12 +116,15 @@ public:
|
||||
const Aspect_CLayer2d& theCUnderLayer,
|
||||
const Aspect_CLayer2d& theCOverLayer);
|
||||
|
||||
//! Deprecated. Simply calls Redraw().
|
||||
void Update (const Graphic3d_CView& theCView,
|
||||
const Aspect_CLayer2d& theCUnderLayer,
|
||||
const Aspect_CLayer2d& theCOverLayer)
|
||||
Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer);
|
||||
void RedrawImmediate (const Graphic3d_CView& theCView,
|
||||
const Aspect_CLayer2d& theCUnderLayer,
|
||||
const Aspect_CLayer2d& theCOverLayer,
|
||||
const Standard_Boolean theToForce = Standard_False);
|
||||
|
||||
void Invalidate (const Graphic3d_CView& /*theCView*/)
|
||||
{
|
||||
Redraw (theCView, theCUnderLayer, theCOverLayer);
|
||||
myBackBufferRestored = Standard_False;
|
||||
}
|
||||
|
||||
//! Special method to perform printing.
|
||||
@@ -143,18 +146,6 @@ public:
|
||||
|
||||
void DisplayCallback (const Graphic3d_CView& theCView, int theReason);
|
||||
|
||||
Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer);
|
||||
Standard_Boolean BeginAddMode();
|
||||
void EndAddMode();
|
||||
void ClearImmediatMode (const Graphic3d_CView& theCView,
|
||||
const Standard_Boolean theToFlush);
|
||||
void RedrawImmediatMode();
|
||||
Standard_Boolean BeginImmediatMode (const Graphic3d_CView& theCView,
|
||||
const Standard_Boolean theUseDepthTest,
|
||||
const Standard_Boolean theRetainMode);
|
||||
void EndImmediatMode();
|
||||
void DrawStructure (const OpenGl_Structure* theStructure);
|
||||
|
||||
Graphic3d_PtrFrameBuffer FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight);
|
||||
void FBORelease (Graphic3d_PtrFrameBuffer theFBOPtr);
|
||||
Standard_Boolean BufferDump (OpenGl_FrameBuffer* theFBOPtr,
|
||||
@@ -227,15 +218,15 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
void CopyBuffers (const Standard_Boolean theFrontToBack);
|
||||
//! Copy content of Back buffer to the Front buffer
|
||||
void copyBackToFront();
|
||||
|
||||
virtual Standard_Boolean Activate();
|
||||
|
||||
// TEMPORARY!!!
|
||||
void Redraw1 (const Graphic3d_CView& theCView,
|
||||
void redraw1 (const Graphic3d_CView& theCView,
|
||||
const Aspect_CLayer2d& theCUnderLayer,
|
||||
const Aspect_CLayer2d& theCOverLayer,
|
||||
const int theToSwap);
|
||||
const int theToSwap);
|
||||
|
||||
void updateMaterial (const int theFlag);
|
||||
|
||||
@@ -423,17 +414,13 @@ protected: //! @name protected fields
|
||||
|
||||
Handle(OpenGl_PrinterContext) myPrintContext;
|
||||
Handle(OpenGl_View) myView; // WSViews - now just one view is supported
|
||||
Standard_Boolean myIsTransientOpen; // transientOpen
|
||||
Standard_Boolean myRetainMode;
|
||||
Standard_Boolean myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
|
||||
|
||||
NCollection_Sequence<const OpenGl_Structure*> myTransientList;
|
||||
|
||||
Standard_Boolean myBackBufferRestored;
|
||||
Standard_Boolean myIsImmediateDrawn; //!< flag indicates that immediate mode buffer contains some data
|
||||
Standard_Boolean myUseTransparency;
|
||||
Standard_Boolean myUseZBuffer;
|
||||
Standard_Boolean myUseDepthTest;
|
||||
Standard_Boolean myUseGLLight;
|
||||
Standard_Boolean myBackBufferRestored;
|
||||
|
||||
protected: //! @name fields related to status
|
||||
|
||||
|
Reference in New Issue
Block a user