1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0023654: Problem with displaying vertices in OCC view after closing all OCC views and opening new one

Fixed graphic structure recompute after closing view.
Removed collector and all corresponding logic and methods from AIS_InteractiveContext.
Method AIS_InteractiveContext::Erase() now hide object from viewer without deleting resources.
Erased objects now properly recomputed after closing view.
Samples update
Removed useless method AIS_InteractiveContext::EraseMode()
Documentation update
Warnings fix
Regressions fix
This commit is contained in:
dbv
2013-10-03 14:11:13 +04:00
committed by bugmaster
parent 3ed30348aa
commit eb4320f2d9
45 changed files with 826 additions and 1256 deletions

View File

@@ -1777,6 +1777,12 @@ void Visual3d_View::Update (const Handle(Visual3d_Layer)& AnUnderLayer, const Ha
if (! MyWindow->IsMapped ()) return;
if (MyGraphicDriver->IsDeviceLost())
{
MyViewManager->ReComputeStructures();
MyGraphicDriver->ResetDeviceLostFlag();
}
// If activation/desactivation of ZBuffer should be automatic
// depending on the presence or absence of facets.
if (MyViewManager->ZBufferAuto ()) {
@@ -1999,41 +2005,14 @@ void Visual3d_View::Display (const Handle(Graphic3d_Structure)& AStructure, cons
Standard_Integer Index = IsComputed (AStructure);
if ((Index != 0) && (AStructure->Visual () != Graphic3d_TOS_COMPUTED)) {
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ()) {
cout << "In Visual3d_View::Display, ";
cout << "TOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
}
#endif
MyTOCOMPUTESequence.Remove (Index);
MyCOMPUTEDSequence.Remove (Index);
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
#endif
Index = 0;
}
Visual3d_TypeOfAnswer Answer = AcceptDisplay (AStructure);
#ifdef TRACE_DISPLAY
Standard_Integer StructId = AStructure->Identification ();
cout << "Visual3d_View" << MyCView.ViewId << "::Display ("
<< StructId << ");\n";
cout << flush;
#endif
if (Answer == Visual3d_TOA_NO) {
#ifdef TRACE_DISPLAY
cout << "Answer : Visual3d_TOA_NO\n";
cout << flush;
#endif
return;
}
@@ -2043,10 +2022,6 @@ Standard_Integer Index = IsComputed (AStructure);
}
if (Answer == Visual3d_TOA_YES ) {
#ifdef TRACE_DISPLAY
cout << "Answer : Visual3d_TOA_YES\n";
cout << flush;
#endif
if (IsDisplayed (AStructure)) return;
MyGraphicDriver->DisplayStructure (
MyCView,
@@ -2058,32 +2033,8 @@ Standard_Integer Index = IsComputed (AStructure);
}
if (Answer == Visual3d_TOA_COMPUTE) {
#ifdef TRACE_DISPLAY
cout << "Answer : Visual3d_TOA_COMPUTE\n";
cout << "Index : " << Index << "\n" << flush;
#endif
if (Index != 0) {
// Already computed, is COMPUTED still valid?
#ifdef TRACE_DISPLAY
if (MyCOMPUTEDSequence.Value (Index)->HLRValidation ()) {
cout << "Structure "
<< MyTOCOMPUTESequence.Value (Index)->Identification ()
<< "already calculated, in the view "
<< Identification () << ", par la structure "
<< MyCOMPUTEDSequence.Value (Index)->Identification ()
<< "\n was not recalculated as HLR is valid\n";
cout << flush;
}
else {
cout << "Structure "
<< MyTOCOMPUTESequence.Value (Index)->Identification ()
<< " already calculated, in the view "
<< Identification () << ", by the structure "
<< MyCOMPUTEDSequence.Value (Index)->Identification ()
<< "\n should be recalculated as HLR is invalid\n";
cout << flush;
}
#endif
Standard_Integer OldStructId =
MyCOMPUTEDSequence.Value (Index)->Identification ();
@@ -2175,37 +2126,16 @@ Standard_Integer ii, jj;
#endif
TheStructure->SetHLRValidation (Standard_True);
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
#endif
// TOCOMPUTE and COMPUTED associated to sequences are added
MyTOCOMPUTESequence.Append (AStructure);
MyCOMPUTEDSequence.Append (TheStructure);
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
#endif
// The previous are removed if necessary
if (Index != 0) {
MyTOCOMPUTESequence.Remove (Index);
MyCOMPUTEDSequence.Remove (Index);
}
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
#endif
// Return type of visualisation of the view
Visual3d_TypeOfVisualization ViewType = MyContext.Visualization ();
@@ -2231,18 +2161,6 @@ Standard_Boolean ComputeShading = ((ViewType == Visual3d_TOV_SHADING) &&
TheStructure->GraphicHighlight (Aspect_TOHM_COLOR);
}
#ifdef TRACE_DISPLAY
cout << "Structure " << StructId
<< " in the view " << Identification ()
<< " is calculated by the structure "
<< TheStructure->Identification ();
if (Answer == Visual3d_TOA_YES)
cout << " and displayed\n";
else
cout << " but not displayed\n";
cout << flush;
#endif
// It is displayed only if the calculated structure
// has a proper type corresponding to the one of the view.
if (Answer != Visual3d_TOA_NO) {
@@ -2533,6 +2451,11 @@ void Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& ASet, Standard
Iterator.More ();
Iterator.Next ()) {
if (!Iterator.Key()->IsVisible())
{
continue;
}
if ( (Iterator.Key ())->IsInfinite ()){
//XMin, YMin .... ZMax are initialized by means of infinite line data
(Iterator.Key ())->MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);

View File

@@ -141,7 +141,6 @@ void Visual3d_ViewManager::Remove () {
// clear all structures whilst views are alive for correct GPU memory management
MyDisplayedStructure.Clear();
MyHighlightedStructure.Clear();
MyVisibleStructure.Clear();
MyPickStructure.Clear();
// clear list of managed views
@@ -317,7 +316,6 @@ void Visual3d_ViewManager::Erase (const Handle(Graphic3d_Structure)& AStructure)
}
MyHighlightedStructure.Remove (AStructure);
MyVisibleStructure.Remove (AStructure);
MyPickStructure.Remove (AStructure);
}