1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Graphic3d_CView::myStructsToCompute/myStructsComputed merged into myStructsDisplayed data map.

This commit is contained in:
kgv
2021-12-14 18:38:46 +03:00
parent bf36a1fb0c
commit cbaea36b11
3 changed files with 99 additions and 220 deletions

View File

@@ -133,9 +133,6 @@ void Graphic3d_CView::Remove()
{ {
Erase (aStructIter.Key()); Erase (aStructIter.Key());
} }
myStructsToCompute.Clear();
myStructsComputed .Clear();
myStructsDisplayed.Clear(); myStructsDisplayed.Clear();
if (!myStructureManager.IsNull()) if (!myStructureManager.IsNull())
@@ -170,11 +167,10 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
continue; continue;
} }
const Standard_Integer anIndex = IsComputed (aStruct); const Handle(Graphic3d_Structure)& aCompStruct = aStructIter.Value();
if (anIndex != 0) if (!aCompStruct.IsNull())
{ {
const Handle(Graphic3d_Structure)& aStructComp = myStructsComputed.Value (anIndex); eraseStructure (aCompStruct->CStructure());
eraseStructure (aStructComp->CStructure());
displayStructure (aStruct->CStructure(), aStruct->DisplayPriority()); displayStructure (aStruct->CStructure(), aStruct->DisplayPriority());
Update (aStruct->GetZLayer()); Update (aStruct->GetZLayer());
} }
@@ -190,25 +186,21 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
continue; continue;
} }
const Standard_Integer anIndex = IsComputed (aStruct); Handle(Graphic3d_Structure)& aCompStruct = aDispStructIter.ChangeValue();
if (anIndex != 0) if (!aDispStructIter.Value().IsNull())
{ {
eraseStructure (aStruct->CStructure()); eraseStructure (aStruct->CStructure());
displayStructure (myStructsComputed.Value (anIndex)->CStructure(), aStruct->DisplayPriority()); displayStructure (aCompStruct->CStructure(), aStruct->DisplayPriority());
Display (aStruct); Display (aStruct);
if (aStruct->IsHighlighted()) if (aStruct->IsHighlighted()
&& !aCompStruct->IsHighlighted())
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.Value (anIndex); aCompStruct->Highlight (aStruct->HighlightStyle(), Standard_False);
if (!aCompStruct->IsHighlighted())
{
aCompStruct->Highlight (aStruct->HighlightStyle(), Standard_False);
}
} }
} }
else else
{ {
Handle(Graphic3d_Structure) aCompStruct;
aStruct->computeHLR (myCamera, aCompStruct); aStruct->computeHLR (myCamera, aCompStruct);
if (aCompStruct.IsNull()) if (aCompStruct.IsNull())
{ {
@@ -222,25 +214,6 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
aCompStruct->Highlight (aStruct->HighlightStyle(), Standard_False); aCompStruct->Highlight (aStruct->HighlightStyle(), Standard_False);
} }
Standard_Boolean hasResult = Standard_False;
const Standard_Integer aNbToCompute = myStructsToCompute.Length();
const Standard_Integer aStructId = aStruct->Identification();
for (Standard_Integer aToCompStructIter = 1; aToCompStructIter <= aNbToCompute; ++aToCompStructIter)
{
if (myStructsToCompute.Value (aToCompStructIter)->Identification() == aStructId)
{
hasResult = Standard_True;
myStructsComputed.ChangeValue (aToCompStructIter) = aCompStruct;
break;
}
}
if (!hasResult)
{
myStructsToCompute.Append (aStruct);
myStructsComputed .Append (aCompStruct);
}
aCompStruct->CalculateBoundBox(); aCompStruct->CalculateBoundBox();
eraseStructure (aStruct->CStructure()); eraseStructure (aStruct->CStructure());
displayStructure (aCompStruct->CStructure(), aStruct->DisplayPriority()); displayStructure (aCompStruct->CStructure(), aStruct->DisplayPriority());
@@ -276,46 +249,34 @@ void Graphic3d_CView::ReCompute (const Handle(Graphic3d_Structure)& theStruct)
return; return;
} }
const Standard_Integer anIndex = IsComputed (theStruct); Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.ChangeSeek (theStruct);
if (anIndex == 0) if (aCompStruct == nullptr
|| aCompStruct->IsNull())
{ {
return; return;
} }
// compute + validation // compute + validation
Handle(Graphic3d_Structure) aCompStructOld = myStructsComputed.ChangeValue (anIndex); Handle(Graphic3d_Structure) aCompStructOld = *aCompStruct;
Handle(Graphic3d_Structure) aCompStruct = aCompStructOld; (*aCompStruct)->SetTransformation (Handle(TopLoc_Datum3D)());
aCompStruct->SetTransformation (Handle(TopLoc_Datum3D)()); theStruct->computeHLR (myCamera, *aCompStruct);
theStruct->computeHLR (myCamera, aCompStruct); if (aCompStruct->IsNull())
if (aCompStruct.IsNull())
{ {
return; return;
} }
aCompStruct->SetHLRValidation (Standard_True); (*aCompStruct)->SetHLRValidation (Standard_True);
aCompStruct->SetVisual (Graphic3d_TOS_ALL); (*aCompStruct)->SetVisual (Graphic3d_TOS_ALL);
aCompStruct->CalculateBoundBox(); (*aCompStruct)->CalculateBoundBox();
if (theStruct->IsHighlighted()) if (theStruct->IsHighlighted())
{ {
aCompStruct->Highlight (theStruct->HighlightStyle(), Standard_False); (*aCompStruct)->Highlight (theStruct->HighlightStyle(), Standard_False);
} }
// The previous calculation is removed and the new one is displayed // The previous calculation is removed and the new one is displayed
eraseStructure (aCompStructOld->CStructure()); eraseStructure (aCompStructOld->CStructure());
displayStructure (aCompStruct->CStructure(), theStruct->DisplayPriority()); displayStructure ((*aCompStruct)->CStructure(), theStruct->DisplayPriority());
// why not just replace existing items?
//myStructsToCompute.ChangeValue (anIndex) = theStruct;
//myStructsComputed .ChangeValue (anIndex) = aCompStruct;
// hlhsr and the new associated compute are added
myStructsToCompute.Append (theStruct);
myStructsComputed .Append (aCompStruct);
// hlhsr and the new associated compute are removed
myStructsToCompute.Remove (anIndex);
myStructsComputed .Remove (anIndex);
} }
// ======================================================================= // =======================================================================
@@ -492,9 +453,12 @@ Bnd_Box Graphic3d_CView::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
void Graphic3d_CView::Compute() void Graphic3d_CView::Compute()
{ {
// force HLRValidation to False on all structures calculated in the view // force HLRValidation to False on all structures calculated in the view
for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructsComputed); aStructIter.More(); aStructIter.Next()) for (Graphic3d_ViewStructureMap::Iterator aStructIter (myStructsDisplayed); aStructIter.More(); aStructIter.Next())
{ {
aStructIter.Value()->SetHLRValidation (Standard_False); if (!aStructIter.Value().IsNull())
{
aStructIter.Value()->SetHLRValidation (Standard_False);
}
} }
if (!myIsInComputedMode) if (!myIsInComputedMode)
@@ -528,12 +492,12 @@ void Graphic3d_CView::Compute()
void Graphic3d_CView::Clear (Graphic3d_Structure* theStructure, void Graphic3d_CView::Clear (Graphic3d_Structure* theStructure,
const Standard_Boolean theWithDestruction) const Standard_Boolean theWithDestruction)
{ {
const Standard_Integer anIndex = IsComputed (theStructure); const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure); /// TODO
if (anIndex != 0) if (aCompStruct != nullptr
&& !aCompStruct->IsNull())
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.Value (anIndex); (*aCompStruct)->GraphicClear (theWithDestruction);
aCompStruct->GraphicClear (theWithDestruction); (*aCompStruct)->SetHLRValidation (Standard_False);
aCompStruct->SetHLRValidation (Standard_False);
} }
} }
@@ -544,14 +508,14 @@ void Graphic3d_CView::Clear (Graphic3d_Structure* theStructure,
void Graphic3d_CView::Connect (const Graphic3d_Structure* theMother, void Graphic3d_CView::Connect (const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter) const Graphic3d_Structure* theDaughter)
{ {
Standard_Integer anIndexM = IsComputed (theMother); const Handle(Graphic3d_Structure)* aCompStructM = myStructsDisplayed.Seek (theMother); /// TODO
Standard_Integer anIndexD = IsComputed (theDaughter); const Handle(Graphic3d_Structure)* aCompStructD = myStructsDisplayed.Seek (theDaughter); /// TODO
if (anIndexM != 0 if (aCompStructM != nullptr
&& anIndexD != 0) && !aCompStructM->IsNull()
&& aCompStructD != nullptr
&& !aCompStructD->IsNull())
{ {
const Handle(Graphic3d_Structure)& aStructM = myStructsComputed.Value (anIndexM); (*aCompStructM)->GraphicConnect (*aCompStructD);
const Handle(Graphic3d_Structure)& aStructD = myStructsComputed.Value (anIndexD);
aStructM->GraphicConnect (aStructD);
} }
} }
@@ -562,14 +526,14 @@ void Graphic3d_CView::Connect (const Graphic3d_Structure* theMother,
void Graphic3d_CView::Disconnect (const Graphic3d_Structure* theMother, void Graphic3d_CView::Disconnect (const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter) const Graphic3d_Structure* theDaughter)
{ {
Standard_Integer anIndexM = IsComputed (theMother); const Handle(Graphic3d_Structure)* aCompStructM = myStructsDisplayed.Seek (theMother); /// TODO
Standard_Integer anIndexD = IsComputed (theDaughter); const Handle(Graphic3d_Structure)* aCompStructD = myStructsDisplayed.Seek (theDaughter); /// TODO
if (anIndexM != 0 if (aCompStructM != nullptr
&& anIndexD != 0) && !aCompStructM->IsNull()
&& aCompStructD != nullptr
&& !aCompStructD->IsNull())
{ {
const Handle(Graphic3d_Structure)& aStructM = myStructsComputed.Value (anIndexM); (*aCompStructM)->GraphicDisconnect (*aCompStructD);
const Handle(Graphic3d_Structure)& aStructD = myStructsComputed.Value (anIndexD);
aStructM->GraphicDisconnect (aStructD);
} }
} }
@@ -588,20 +552,18 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
// or more, of calculated type => // or more, of calculated type =>
// - removes it as well as the associated old computed // - removes it as well as the associated old computed
// THis happens when hlhsr becomes again of type e non computed after SetVisual. // THis happens when hlhsr becomes again of type e non computed after SetVisual.
Standard_Integer anIndex = IsComputed (theStructure); Standard_Integer aPrsIndex = myStructsDisplayed.FindIndex (theStructure);
if (anIndex != 0 if (theStructure->Visual() != Graphic3d_TOS_COMPUTED
&& theStructure->Visual() != Graphic3d_TOS_COMPUTED) && aPrsIndex != 0)
{ {
myStructsToCompute.Remove (anIndex); myStructsDisplayed.ChangeFromIndex (aPrsIndex).Nullify();
myStructsComputed .Remove (anIndex);
anIndex = 0;
} }
const Standard_Integer anOldExtent = myStructsDisplayed.Extent(); const Standard_Integer anOldExtent = myStructsDisplayed.Extent();
if (theStructure->Visual() != Graphic3d_TOS_COMPUTED if (theStructure->Visual() != Graphic3d_TOS_COMPUTED
|| !myIsInComputedMode) || !myIsInComputedMode)
{ {
const Standard_Integer aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)()); aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)());
if (aPrsIndex <= anOldExtent) if (aPrsIndex <= anOldExtent)
{ {
return; return;
@@ -613,19 +575,14 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
return; return;
} }
if (anIndex != 0) if (aPrsIndex != 0
&& !myStructsDisplayed.FindFromIndex (aPrsIndex).IsNull())
{ {
// Already computed, is COMPUTED still valid? // Already computed, is COMPUTED still valid?
const Handle(Graphic3d_Structure)& anOldStruct = myStructsComputed.Value (anIndex); const Handle(Graphic3d_Structure)& anOldStruct = myStructsDisplayed.FindFromIndex (aPrsIndex);
if (anOldStruct->HLRValidation()) if (anOldStruct->HLRValidation())
{ {
// Case COMPUTED valid, to be displayed // Case COMPUTED valid, to be displayed
const Standard_Integer aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)());
if (aPrsIndex <= anOldExtent)
{
return;
}
displayStructure (anOldStruct->CStructure(), theStructure->DisplayPriority()); displayStructure (anOldStruct->CStructure(), theStructure->DisplayPriority());
Update (anOldStruct->GetZLayer()); Update (anOldStruct->GetZLayer());
return; return;
@@ -638,7 +595,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
// 1/ Structure having the same Owner as <AStructure> // 1/ Structure having the same Owner as <AStructure>
// 2/ That is not <AStructure> // 2/ That is not <AStructure>
// 3/ The COMPUTED which of is valid // 3/ The COMPUTED which of is valid
const Standard_Integer aNewIndex = HaveTheSameOwner (theStructure); /*const Standard_Integer aNewIndex = HaveTheSameOwner (theStructure);
if (aNewIndex != 0) if (aNewIndex != 0)
{ {
// Case of COMPUTED invalid, WITH a valid of replacement; to be displayed // Case of COMPUTED invalid, WITH a valid of replacement; to be displayed
@@ -654,11 +611,11 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
Update (aNewStruct->GetZLayer()); Update (aNewStruct->GetZLayer());
return; return;
} }
else else*/
{ {
// Case COMPUTED invalid, WITHOUT a valid of replacement // Case COMPUTED invalid, WITHOUT a valid of replacement
// COMPUTED is removed if displayed // COMPUTED is removed if displayed
if (myStructsDisplayed.Contains (theStructure)) //if (myStructsDisplayed.Contains (theStructure))
{ {
eraseStructure (anOldStruct->CStructure()); eraseStructure (anOldStruct->CStructure());
} }
@@ -667,40 +624,28 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
} }
// Compute + Validation // Compute + Validation
Handle(Graphic3d_Structure) aStruct; aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)());
if (anIndex != 0) Handle(Graphic3d_Structure)& aCompStruct = myStructsDisplayed.ChangeFromIndex (aPrsIndex);
if (!aCompStruct.IsNull())
{ {
aStruct = myStructsComputed.Value (anIndex); aCompStruct->SetTransformation (Handle(TopLoc_Datum3D)());
aStruct->SetTransformation (Handle(TopLoc_Datum3D)());
} }
theStructure->computeHLR (myCamera, aStruct); theStructure->computeHLR (myCamera, aCompStruct);
if (aStruct.IsNull()) if (aCompStruct.IsNull())
{ {
return; return;
} }
aStruct->SetHLRValidation (Standard_True); aCompStruct->SetHLRValidation (Standard_True);
aStruct->SetVisual (Graphic3d_TOS_ALL); aCompStruct->SetVisual (Graphic3d_TOS_ALL);
// TOCOMPUTE and COMPUTED associated to sequences are added
myStructsToCompute.Append (theStructure);
myStructsComputed .Append (aStruct);
// The previous are removed if necessary
if (anIndex != 0)
{
myStructsToCompute.Remove (anIndex);
myStructsComputed .Remove (anIndex);
}
if (theStructure->IsHighlighted()) if (theStructure->IsHighlighted())
{ {
aStruct->Highlight (theStructure->HighlightStyle(), Standard_False); aCompStruct->Highlight (theStructure->HighlightStyle(), Standard_False);
} }
const Standard_Integer aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)()); displayStructure (aCompStruct->CStructure(), theStructure->DisplayPriority());
displayStructure (aStruct->CStructure(), theStructure->DisplayPriority());
Update (aStruct->GetZLayer()); Update (aCompStruct->GetZLayer());
} }
// ======================================================================= // =======================================================================
@@ -721,16 +666,14 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
eraseStructure (theStructure->CStructure()); eraseStructure (theStructure->CStructure());
} }
const Standard_Integer anIndex = !myStructsToCompute.IsEmpty() ? IsComputed (theStructure) : 0; const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure);
if (anIndex != 0) if (aCompStruct != nullptr
&& !aCompStruct->IsNull())
{ {
if (isComputedStruct) if (isComputedStruct)
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex); eraseStructure ((*aCompStruct)->CStructure());
eraseStructure (aCompStruct->CStructure());
} }
myStructsComputed .Remove (anIndex);
myStructsToCompute.Remove (anIndex);
} }
myStructsDisplayed.RemoveKey (theStructure); myStructsDisplayed.RemoveKey (theStructure);
@@ -743,11 +686,11 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
// ======================================================================= // =======================================================================
void Graphic3d_CView::Highlight (const Handle(Graphic3d_Structure)& theStructure) void Graphic3d_CView::Highlight (const Handle(Graphic3d_Structure)& theStructure)
{ {
const Standard_Integer anIndex = IsComputed (theStructure); const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure);
if (anIndex != 0) if (aCompStruct != nullptr
&& !aCompStruct->IsNull())
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex); (*aCompStruct)->Highlight (theStructure->HighlightStyle(), Standard_False);
aCompStruct->Highlight (theStructure->HighlightStyle(), Standard_False);
} }
} }
@@ -758,8 +701,9 @@ void Graphic3d_CView::Highlight (const Handle(Graphic3d_Structure)& theStructure
void Graphic3d_CView::SetTransform (const Handle(Graphic3d_Structure)& theStructure, void Graphic3d_CView::SetTransform (const Handle(Graphic3d_Structure)& theStructure,
const Handle(TopLoc_Datum3D)& theTrsf) const Handle(TopLoc_Datum3D)& theTrsf)
{ {
const Standard_Integer anIndex = IsComputed (theStructure); const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure);
if (anIndex != 0) if (aCompStruct != nullptr
&& !aCompStruct->IsNull())
{ {
// Test is somewhat light ! // Test is somewhat light !
// trsf is transferred only if it is : // trsf is transferred only if it is :
@@ -774,8 +718,7 @@ void Graphic3d_CView::SetTransform (const Handle(Graphic3d_Structure)& theStruct
} }
else else
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex); (*aCompStruct)->GraphicTransform (theTrsf);
aCompStruct->GraphicTransform (theTrsf);
} }
} }
@@ -795,56 +738,14 @@ void Graphic3d_CView::SetTransform (const Handle(Graphic3d_Structure)& theStruct
// ======================================================================= // =======================================================================
void Graphic3d_CView::UnHighlight (const Handle(Graphic3d_Structure)& theStructure) void Graphic3d_CView::UnHighlight (const Handle(Graphic3d_Structure)& theStructure)
{ {
Standard_Integer anIndex = IsComputed (theStructure); const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure);
if (anIndex != 0) if (aCompStruct != nullptr
&& !aCompStruct->IsNull())
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex); (*aCompStruct)->CStructure()->GraphicUnhighlight();
aCompStruct->CStructure()->GraphicUnhighlight();
} }
} }
// ========================================================================
// function : IsComputed
// purpose :
// ========================================================================
Standard_Boolean Graphic3d_CView::IsComputed (const Standard_Integer theStructId,
Handle(Graphic3d_Structure)& theComputedStruct) const
{
theComputedStruct.Nullify();
if (!ComputedMode())
return Standard_False;
const Standard_Integer aNbStructs = myStructsToCompute.Length();
for (Standard_Integer aStructIter = 1; aStructIter <= aNbStructs; ++aStructIter)
{
if (myStructsToCompute.Value (aStructIter)->Identification() == theStructId)
{
theComputedStruct = myStructsComputed (aStructIter);
return Standard_True;
}
}
return Standard_False;
}
// =======================================================================
// function : IsComputed
// purpose :
// =======================================================================
Standard_Integer Graphic3d_CView::IsComputed (const Graphic3d_Structure* theStructure) const
{
const Standard_Integer aStructId = theStructure->Identification();
Standard_Integer aStructIndex = 1;
for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructsToCompute); aStructIter.More(); aStructIter.Next(), ++aStructIndex)
{
const Handle(Graphic3d_Structure)& aStruct = aStructIter.Value();
if (aStruct->Identification() == aStructId)
{
return aStructIndex;
}
}
return 0;
}
// ======================================================================= // =======================================================================
// function : IsDisplayed // function : IsDisplayed
// purpose : // purpose :
@@ -874,9 +775,10 @@ void Graphic3d_CView::ChangePriority (const Handle(Graphic3d_Structure)& theStru
return; return;
} }
const Standard_Integer anIndex = IsComputed (theStructure); const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure);
const Handle(Graphic3d_CStructure)& aCStruct = anIndex != 0 const Handle(Graphic3d_CStructure)& aCStruct = aCompStruct != nullptr
? myStructsComputed.Value (anIndex)->CStructure() && !aCompStruct->IsNull()
? (*aCompStruct)->CStructure()
: theStructure->CStructure(); : theStructure->CStructure();
changePriority (aCStruct, theNewPriority); changePriority (aCStruct, theNewPriority);
@@ -901,9 +803,10 @@ void Graphic3d_CView::ChangeZLayer (const Handle(Graphic3d_Structure)& theStruct
return; return;
} }
const Standard_Integer anIndex = IsComputed (theStructure); const Handle(Graphic3d_Structure)* aCompStruct = myStructsDisplayed.Seek (theStructure);
Handle(Graphic3d_CStructure) aCStruct = anIndex != 0 Handle(Graphic3d_CStructure) aCStruct = aCompStruct != nullptr
? myStructsComputed.Value (anIndex)->CStructure() && !aCompStruct->IsNull()
? (*aCompStruct)->CStructure()
: theStructure->CStructure(); : theStructure->CStructure();
changeZLayer (aCStruct, theLayerId); changeZLayer (aCStruct, theLayerId);
@@ -913,7 +816,7 @@ void Graphic3d_CView::ChangeZLayer (const Handle(Graphic3d_Structure)& theStruct
// function : HaveTheSameOwner // function : HaveTheSameOwner
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Integer Graphic3d_CView::HaveTheSameOwner (const Handle(Graphic3d_Structure)& theStructure) const /*Standard_Integer Graphic3d_CView::HaveTheSameOwner (const Handle(Graphic3d_Structure)& theStructure) const
{ {
// Find in the sequence of already calculated structures // Find in the sequence of already calculated structures
// 1/ Structure with the same Owner as <AStructure> // 1/ Structure with the same Owner as <AStructure>
@@ -934,7 +837,7 @@ Standard_Integer Graphic3d_CView::HaveTheSameOwner (const Handle(Graphic3d_Struc
} }
} }
return 0; return 0;
} }*/
// ======================================================================= // =======================================================================
// function : CopySettings // function : CopySettings
@@ -1293,18 +1196,6 @@ void Graphic3d_CView::DumpJson (Standard_OStream& theOStream, Standard_Integer t
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager) OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCamera.get()) OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCamera.get())
for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsToCompute); anIter.More(); anIter.Next())
{
const Handle(Graphic3d_Structure)& aStructToCompute = anIter.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructToCompute.get())
}
for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsComputed); anIter.More(); anIter.Next())
{
const Handle(Graphic3d_Structure)& aStructComputed = anIter.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructComputed.get())
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInComputedMode) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInComputedMode)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved)

View File

@@ -160,11 +160,6 @@ public:
//! Returns map of objects hidden within this specific view (not viewer-wise). //! Returns map of objects hidden within this specific view (not viewer-wise).
Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects() { return myHiddenObjects; } Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects() { return myHiddenObjects; }
//! Returns Standard_True in case if the structure with the given <theStructId> is
//! in list of structures to be computed and stores computed struct to <theComputedStruct>.
Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId,
Handle(Graphic3d_Structure)& theComputedStruct) const;
//! Returns the bounding box of all structures displayed in the view. //! Returns the bounding box of all structures displayed in the view.
//! If theToIncludeAuxiliary is TRUE, then the boundary box also includes minimum and maximum limits //! If theToIncludeAuxiliary is TRUE, then the boundary box also includes minimum and maximum limits
//! of graphical elements forming parts of infinite and other auxiliary structures. //! of graphical elements forming parts of infinite and other auxiliary structures.
@@ -213,11 +208,6 @@ private:
//! in the view <me>. //! in the view <me>.
Standard_EXPORT void UnHighlight (const Handle(Graphic3d_Structure)& theStructure); Standard_EXPORT void UnHighlight (const Handle(Graphic3d_Structure)& theStructure);
//! Returns an index != 0 if the structure have another structure computed for the view <me>.
Standard_EXPORT Standard_Integer IsComputed (const Graphic3d_Structure* theStructure) const;
Standard_Integer IsComputed (const Handle(Graphic3d_Structure)& theStructure) const { return IsComputed (theStructure.get()); }
//! Returns true if the structure is displayed in the view. //! Returns true if the structure is displayed in the view.
Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(Graphic3d_Structure)& theStructure) const; Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(Graphic3d_Structure)& theStructure) const;
@@ -232,7 +222,7 @@ private:
//! Returns an index != 0 if the structure have the same owner than another structure //! Returns an index != 0 if the structure have the same owner than another structure
//! in the sequence of the computed structures. //! in the sequence of the computed structures.
Standard_EXPORT Standard_Integer HaveTheSameOwner (const Handle(Graphic3d_Structure)& theStructure) const; ///Standard_EXPORT Standard_Integer HaveTheSameOwner (const Handle(Graphic3d_Structure)& theStructure) const;
public: public:
@@ -589,9 +579,7 @@ protected:
Handle(Graphic3d_StructureManager) myStructureManager; Handle(Graphic3d_StructureManager) myStructureManager;
Handle(Graphic3d_Camera) myCamera; Handle(Graphic3d_Camera) myCamera;
Graphic3d_SequenceOfStructure myStructsToCompute; //Graphic3d_MapOfStructure myStructsDisplayed; /// TODO
Graphic3d_SequenceOfStructure myStructsComputed;
//Graphic3d_MapOfStructure myStructsDisplayed;
Graphic3d_ViewStructureMap myStructsDisplayed; Graphic3d_ViewStructureMap myStructsDisplayed;
Handle(Graphic3d_NMapOfTransient) myHiddenObjects; Handle(Graphic3d_NMapOfTransient) myHiddenObjects;
Standard_Boolean myIsInComputedMode; Standard_Boolean myIsInComputedMode;

View File

@@ -371,7 +371,7 @@ void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& the
Handle(Graphic3d_Structure) aViewDepPrs; Handle(Graphic3d_Structure) aViewDepPrs;
Handle(Prs3d_PresentationShadow) aShadowPrs = Handle(Prs3d_PresentationShadow)::DownCast (aPrs); Handle(Prs3d_PresentationShadow) aShadowPrs = Handle(Prs3d_PresentationShadow)::DownCast (aPrs);
if (!aShadowPrs.IsNull() && aView->IsComputed (aShadowPrs->ParentId(), aViewDepPrs)) /*if (!aShadowPrs.IsNull() && aView->IsComputed (aShadowPrs->ParentId(), aViewDepPrs))
{ {
const Graphic3d_ZLayerId aZLayer = aShadowPrs->GetZLayer(); const Graphic3d_ZLayerId aZLayer = aShadowPrs->GetZLayer();
aShadowPrs.Nullify(); aShadowPrs.Nullify();
@@ -386,7 +386,7 @@ void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& the
// handles custom highlight presentations which were defined in overridden // handles custom highlight presentations which were defined in overridden
// HilightOwnerWithColor method of a custom AIS objects and maintain its // HilightOwnerWithColor method of a custom AIS objects and maintain its
// visibility in different views on their own // visibility in different views on their own
else if (aShadowPrs.IsNull()) else */if (aShadowPrs.IsNull())
{ {
aPrs->Display(); aPrs->Display();
continue; continue;
@@ -706,12 +706,12 @@ void PrsMgr_PresentationManager::UpdateHighlightTrsf (const Handle(V3d_Viewer)&
{ {
const Handle(Graphic3d_CView)& aView = anActiveViewIter.Value()->View(); const Handle(Graphic3d_CView)& aView = anActiveViewIter.Value()->View();
Handle(Graphic3d_Structure) aViewDepParentPrs; Handle(Graphic3d_Structure) aViewDepParentPrs;
if (aView->IsComputed (aParentId, aViewDepParentPrs)) /**if (aView->IsComputed (aParentId, aViewDepParentPrs))
{ {
updatePrsTransformation (myViewDependentImmediateList, updatePrsTransformation (myViewDependentImmediateList,
aViewDepParentPrs->CStructure()->Identification(), aViewDepParentPrs->CStructure()->Identification(),
aTrsf); aTrsf);
} }*/
} }
} }
} }