1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0022455: Make it possible to call methods of V3d_View like Convert() inside the context of Redraw()

This commit is contained in:
MSV 2011-09-15 14:05:23 +00:00 committed by bugmaster
parent d10203e858
commit cdc2203b32

View File

@ -491,6 +491,11 @@ void V3d_View::SetWindow(const Handle(Aspect_Window)& TheWindow)
"V3d_View::SetWindow, window of view already defined"); "V3d_View::SetWindow, window of view already defined");
MyView->SetWindow(TheWindow) ; MyView->SetWindow(TheWindow) ;
// AGV: Method V3d_View::SetWindow() should assign the field MyWindow before
// calling Redraw(). Otherwise it is impossible to call certain methods of
// V3d_View like Convert() inside the context of Redraw(),
// particularly in class NIS_View.
MyWindow = TheWindow;
// SetWindow carries out SetRatio and modifies // SetWindow carries out SetRatio and modifies
// ViewMapping and ViewMappingDefault of MyView. // ViewMapping and ViewMappingDefault of MyView.
MyViewMapping = MyView->ViewMapping() ; MyViewMapping = MyView->ViewMapping() ;
@ -504,7 +509,6 @@ void V3d_View::SetWindow(const Handle(Aspect_Window)& TheWindow)
MyGridEchoStructure->Display (); // S3892 MyGridEchoStructure->Display (); // S3892
#endif #endif
MyView->Redraw() ; MyView->Redraw() ;
MyWindow = TheWindow;
} }
@ -520,6 +524,11 @@ void V3d_View::SetWindow(const Handle(Aspect_Window)& aWindow,
Standard_MultiplyDefined_Raise_if( MyView->IsDefined(), Standard_MultiplyDefined_Raise_if( MyView->IsDefined(),
"V3d_View::SetWindow, " "V3d_View::SetWindow, "
"window of view already defined"); "window of view already defined");
// AGV: Method V3d_View::SetWindow() should assign the field MyWindow before
// calling Redraw(). Otherwise it is impossible to call certain methods of
// V3d_View like Convert() inside the context of Redraw(),
// particularly in class NIS_View.
MyWindow = aWindow;
MyView->SetWindow(aWindow, aContext, aDisplayCB, aClientData) ; MyView->SetWindow(aWindow, aContext, aDisplayCB, aClientData) ;
MyViewMapping = MyView->ViewMapping() ; MyViewMapping = MyView->ViewMapping() ;
MyView->SetContext(MyViewContext) ; MyView->SetContext(MyViewContext) ;
@ -528,7 +537,6 @@ void V3d_View::SetWindow(const Handle(Aspect_Window)& aWindow,
MyView->SetBackground(MyBackground) ; MyView->SetBackground(MyBackground) ;
MyViewer->SetViewOn(this) ; MyViewer->SetViewOn(this) ;
MyView->Redraw() ; MyView->Redraw() ;
MyWindow = aWindow;
} }
// RIC120302 // RIC120302