// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define XTRACE
+#include <Graphic3d_StructureManager.hxx>
+#include <Graphic3d_DataStructureManager.hxx>
+#include <Graphic3d_GraphicDriver.hxx>
+#include <Graphic3d_Structure.hxx>
+IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_StructureManager,Standard_Transient)
-//-Version
-
-//-Design Declaration of variables specific to managers
-
-//-Warning Manager manages a set of structures
-
-//-References
-
-//-Language C++ 2.0
-
-//-Declarations
-
-// for the class
-#include <Graphic3d_StructureManager.ixx>
-#include <Graphic3d_StructureManager.pxx>
-static Standard_Boolean Initialisation = Standard_True;
-static int StructureManager_ArrayId[StructureManager_MAX];
-static Standard_Integer StructureManager_CurrentId = 0;
-
-#include <Graphic3d_Structure.pxx>
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
+#include <Graphic3d_CView.hxx>
+
+// ========================================================================
+// function : Graphic3d_StructureManager
+// purpose :
+// ========================================================================
+Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver)
+: myViewGenId (0, 31),
+ myGraphicDriver (theDriver),
+ myDeviceLostFlag (Standard_False)
+{
+ //
+}
-//-Aliases
-
-//-Global data definitions
-
-// -- l'identifieur du manager
-// MyId : Standard_Integer;
-
-// -- le mode de mise a jour de l'affichage
-// MyUpdateMode : TypeOfUpdate;
-
-// -- les differents contextes de primitives
-// MyAspectLine3d : AspectLine3d;
-// MyAspectText3d : AspectText3d;
-// MyAspectMarker3d : AspectMarker3d;
-// MyAspectFillArea3d : AspectFillArea3d;
-
-// -- les structures affichees
-// MyDisplayedStructure : SequenceOfStructure;
-
-// -- les structures mises en evidence
-// MyHighlightedStructure : SequenceOfStructure;
-
-// -- les structures detectables
-// MyPickStructure : SequenceOfStructure;
-
-// -- le generateur d'identificateurs de structures
-// MyStructGenId : GenId;
-
-//-Constructors
-
-Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver):
-MyDisplayedStructure (),
-MyHighlightedStructure (),
-MyPickStructure () {
-
-Standard_Real Coef;
-Standard_Integer i;
-Standard_Boolean NotFound = Standard_True;
-Standard_Integer Limit = Graphic3d_StructureManager::Limit ();
-
- /* Initialize PHIGS and start up */
- if (Initialisation) {
-
- Initialisation = Standard_False;
- /* table to manage IDs of StructureManager */
- for (i=0; i<Limit; i++) StructureManager_ArrayId[i] = 0;
-
- StructureManager_CurrentId = 0;
- StructureManager_ArrayId[0] = 1;
-
- }
- else {
- for (i=0; i<Limit && NotFound; i++)
- if (StructureManager_ArrayId[i] == 0) {
- NotFound = Standard_False;
- StructureManager_CurrentId = i;
- StructureManager_ArrayId[i] = 1;
- }
-
- if (NotFound)
- {
- Standard_SStream anErrorDescription;
- anErrorDescription<<"You are trying to create too many ViewManagers at the same time!\n"<<
- "The number of simultaneously created ViewManagers can't exceed "<<Limit<<".\n";
- Graphic3d_InitialisationError::Raise(anErrorDescription);
- }
- }
+// ========================================================================
+// function : ~Graphic3d_StructureManager
+// purpose :
+// ========================================================================
+Graphic3d_StructureManager::~Graphic3d_StructureManager()
+{
+ for (Graphic3d_MapIteratorOfMapOfStructure anIt (myDisplayedStructure); anIt.More(); anIt.Next())
+ {
+ anIt.Value()->Remove();
+ }
- Coef = (Structure_IDMIN+Structure_IDMAX)/Limit;
- Aspect_GenId theGenId(
- Standard_Integer (Structure_IDMIN+Coef*(StructureManager_CurrentId)),
- Standard_Integer (Structure_IDMIN+Coef*(StructureManager_CurrentId+1)-1));
- MyStructGenId = theGenId;
+ myDisplayedStructure.Clear();
+ myHighlightedStructure.Clear();
+ myDefinedViews.Clear();
+}
- MyId = StructureManager_CurrentId;
+// ========================================================================
+// function : Update
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Update (const Graphic3d_ZLayerId theLayerId) const
+{
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Update (theLayerId);
+ }
+}
- MyAspectLine3d = new Graphic3d_AspectLine3d ();
- MyAspectText3d = new Graphic3d_AspectText3d ();
- MyAspectMarker3d = new Graphic3d_AspectMarker3d ();
- MyAspectFillArea3d = new Graphic3d_AspectFillArea3d ();
+// ========================================================================
+// function : Remove
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Remove()
+{
+ // clear all structures whilst views are alive for correct GPU memory management
+ for (Graphic3d_MapIteratorOfMapOfStructure anIt (myDisplayedStructure); anIt.More(); anIt.Next())
+ {
+ anIt.Value()->Remove();
+ }
+ myDisplayedStructure.Clear();
+ myHighlightedStructure.Clear();
- MyUpdateMode = Aspect_TOU_WAIT;
- MyGraphicDriver = theDriver;
+ // clear list of managed views
+ myDefinedViews.Clear();
+}
+// ========================================================================
+// function : Erase
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Erase()
+{
+ for (Graphic3d_MapIteratorOfMapOfStructure anIt (myDisplayedStructure); anIt.More(); anIt.Next())
+ {
+ anIt.Key()->Erase();
+ }
}
-//-Destructors
+void Graphic3d_StructureManager::DisplayedStructures (Graphic3d_MapOfStructure& SG) const {
-void Graphic3d_StructureManager::Destroy () {
+ SG.Assign(myDisplayedStructure);
-#ifdef TRACE
- cout << "Graphic3d_StructureManager::Destroy (" << MyId << ")\n";
- cout << flush;
-#endif
+ //JMBStandard_Integer Length = myDisplayedStructure.Length ();
- MyDisplayedStructure.Clear ();
- MyHighlightedStructure.Clear ();
- MyPickStructure.Clear ();
- StructureManager_ArrayId[MyId] = 0;
+ //JMBfor (Standard_Integer i=1; i<=Length; i++)
+ //JMB SG.Add (myDisplayedStructure.Value (i));
}
-//-Methods, in order
+Standard_Integer Graphic3d_StructureManager::NumberOfDisplayedStructures () const {
-void Graphic3d_StructureManager::SetUpdateMode (const Aspect_TypeOfUpdate AType) {
+Standard_Integer Length = myDisplayedStructure.Extent ();
- MyUpdateMode = AType;
+ return (Length);
}
-Aspect_TypeOfUpdate Graphic3d_StructureManager::UpdateMode () const {
+//Handle(Graphic3d_Structure) Graphic3d_StructureManager::DisplayedStructure (const Standard_Integer AnIndex) const {
- return (MyUpdateMode);
+//return (myDisplayedStructure.Value (AnIndex));
-}
+//}
-void Graphic3d_StructureManager::SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX) {
+void Graphic3d_StructureManager::HighlightedStructures (Graphic3d_MapOfStructure& SG) const {
- MyAspectLine3d = CTX;
+ SG.Assign(myHighlightedStructure);
}
-void Graphic3d_StructureManager::SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX) {
-
- MyAspectFillArea3d = CTX;
-
-}
+Handle(Graphic3d_Structure) Graphic3d_StructureManager::Identification (const Standard_Integer AId) const {
-void Graphic3d_StructureManager::SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX) {
+// Standard_Integer ind=0;
+ Standard_Boolean notfound = Standard_True;
- MyAspectText3d = CTX;
+ Handle(Graphic3d_Structure) StructNull;
+
+ Graphic3d_MapIteratorOfMapOfStructure it( myDisplayedStructure);
+
+ Handle(Graphic3d_Structure) SGfound;
-}
+ for (; it.More() && notfound; it.Next()) {
+ Handle(Graphic3d_Structure) SG = it.Key();
+ if ( SG->Identification () == AId) {
+ notfound = Standard_False;
+ SGfound = SG;
+ }
+ }
-void Graphic3d_StructureManager::SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX) {
- MyAspectMarker3d = CTX;
+ if (notfound)
+ return (StructNull);
+ else
+ return (SGfound);
}
-void Graphic3d_StructureManager::PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const {
-
- CTXL = MyAspectLine3d;
- CTXT = MyAspectText3d;
- CTXM = MyAspectMarker3d;
- CTXF = MyAspectFillArea3d;
-
+const Handle(Graphic3d_GraphicDriver)& Graphic3d_StructureManager::GraphicDriver () const
+{
+ return (myGraphicDriver);
}
-Handle(Graphic3d_AspectLine3d) Graphic3d_StructureManager::Line3dAspect () const {
+void Graphic3d_StructureManager::RecomputeStructures()
+{
+ myDeviceLostFlag = Standard_False;
- return (MyAspectLine3d);
+ // Go through all unique structures including child (connected) ones and ensure that they are computed.
+ NCollection_Map<Graphic3d_Structure*> aStructNetwork;
+ for (Graphic3d_MapIteratorOfMapOfStructure anIter(myDisplayedStructure); anIter.More(); anIter.Next())
+ {
+ Handle(Graphic3d_Structure) aStructure = anIter.Key();
+ anIter.Key()->Network (anIter.Key().get(), Graphic3d_TOC_DESCENDANT, aStructNetwork);
+ }
+ RecomputeStructures (aStructNetwork);
}
-Handle(Graphic3d_AspectText3d) Graphic3d_StructureManager::Text3dAspect () const {
-
- return (MyAspectText3d);
-
+void Graphic3d_StructureManager::RecomputeStructures (const NCollection_Map<Graphic3d_Structure*>& theStructures)
+{
+ for (NCollection_Map<Graphic3d_Structure*>::Iterator anIter (theStructures); anIter.More(); anIter.Next())
+ {
+ Graphic3d_Structure* aStruct = anIter.Key();
+ aStruct->Clear();
+ aStruct->Compute();
+ }
}
-Handle(Graphic3d_AspectMarker3d) Graphic3d_StructureManager::Marker3dAspect () const {
-
- return (MyAspectMarker3d);
+Handle(Graphic3d_ViewAffinity) Graphic3d_StructureManager::RegisterObject (const Handle(Standard_Transient)& theObject)
+{
+ Handle(Graphic3d_ViewAffinity) aResult;
+ if (myRegisteredObjects.Find (theObject.operator->(), aResult))
+ {
+ return aResult;
+ }
+ aResult = new Graphic3d_ViewAffinity();
+ myRegisteredObjects.Bind (theObject.operator->(), aResult);
+ return aResult;
}
-Handle(Graphic3d_AspectFillArea3d) Graphic3d_StructureManager::FillArea3dAspect () const {
-
- return (MyAspectFillArea3d);
-
+void Graphic3d_StructureManager::UnregisterObject (const Handle(Standard_Transient)& theObject)
+{
+ myRegisteredObjects.UnBind (theObject.operator->());
}
-void Graphic3d_StructureManager::Remove (const Standard_Integer AnId) {
-
-#ifdef TRACE
- cout << "Graphic3d_StructureManager::Remove " << AnId << "\n" << flush;
-#endif
-
- MyStructGenId.Free (AnId);
-
+Handle(Graphic3d_ViewAffinity) Graphic3d_StructureManager::ObjectAffinity (const Handle(Standard_Transient)& theObject) const
+{
+ Handle(Graphic3d_ViewAffinity) aResult;
+ myRegisteredObjects.Find (theObject.operator->(), aResult);
+ return aResult;
}
-void Graphic3d_StructureManager::Detectable (const Handle(Graphic3d_Structure)& AStructure) {
-
- MyPickStructure.Add(AStructure);
+// ========================================================================
+// function : Identification
+// purpose :
+// ========================================================================
+Standard_Integer Graphic3d_StructureManager::Identification (Graphic3d_CView* theView)
+{
+ if (myDefinedViews.Contains (theView))
+ {
+ return theView->Identification();
+ }
+ myDefinedViews.Add (theView);
+ return myViewGenId.Next();
}
-void Graphic3d_StructureManager::Undetectable (const Handle(Graphic3d_Structure)& AStructure) {
-
- MyPickStructure.Remove(AStructure);
-
+// ========================================================================
+// function : UnIdentification
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::UnIdentification (Graphic3d_CView* theView)
+{
+ if (myDefinedViews.Contains (theView))
+ {
+ myDefinedViews.Swap (myDefinedViews.FindIndex (theView), myDefinedViews.Size());
+ myDefinedViews.RemoveLast();
+ myViewGenId.Free (theView->Identification());
+ }
}
-void Graphic3d_StructureManager::DisplayedStructures (Graphic3d_MapOfStructure& SG) const {
-
- SG.Assign(MyDisplayedStructure);
-
- //JMBStandard_Integer Length = MyDisplayedStructure.Length ();
-
- //JMBfor (Standard_Integer i=1; i<=Length; i++)
- //JMB SG.Add (MyDisplayedStructure.Value (i));
-
+// ========================================================================
+// function : DefinedViews
+// purpose :
+// ========================================================================
+const Graphic3d_IndexedMapOfView& Graphic3d_StructureManager::DefinedViews() const
+{
+ return myDefinedViews;
}
-Standard_Integer Graphic3d_StructureManager::NumberOfDisplayedStructures () const {
-
-Standard_Integer Length = MyDisplayedStructure.Extent ();
-
- return (Length);
-
+// ========================================================================
+// function : MaxNumOfViews
+// purpose :
+// ========================================================================
+Standard_Integer Graphic3d_StructureManager::MaxNumOfViews() const
+{
+ return myViewGenId.Upper() - myViewGenId.Lower() + 1;
}
-//Handle(Graphic3d_Structure) Graphic3d_StructureManager::DisplayedStructure (const Standard_Integer AnIndex) const {
-
-//return (MyDisplayedStructure.Value (AnIndex));
-
-//}
-
-void Graphic3d_StructureManager::HighlightedStructures (Graphic3d_MapOfStructure& SG) const {
-
- SG.Assign(MyHighlightedStructure);
+// ========================================================================
+// function : ReCompute
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::ReCompute (const Handle(Graphic3d_Structure)& theStructure)
+{
+ if (!myDisplayedStructure.Contains (theStructure))
+ {
+ return;
+ }
+ // Recompute structure for all defined views
+ for (Standard_Integer aViewIt = 1; aViewIt <= myDefinedViews.Extent(); ++aViewIt)
+ {
+ ReCompute (theStructure, myDefinedViews (aViewIt));
+ }
}
-void Graphic3d_StructureManager::PickStructures (Graphic3d_MapOfStructure& SG) const {
+// ========================================================================
+// function : ReCompute
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::ReCompute (const Handle(Graphic3d_Structure)& theStructure,
+ const Handle(Graphic3d_DataStructureManager)& theProjector)
+{
+ Handle(Graphic3d_CView) aView = Handle(Graphic3d_CView)::DownCast (theProjector);
- SG.Assign(MyPickStructure);
+ if (aView.IsNull()
+ || !myDefinedViews.Contains (aView.operator->())
+ || !myDisplayedStructure.Contains (theStructure))
+ {
+ return;
+ }
+ aView->ReCompute (theStructure);
}
-void Graphic3d_StructureManager::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
-
-Standard_Boolean Flag = Standard_True;
-Standard_Real Xm, Ym, Zm, XM, YM, ZM, RL, RF;
-
- RL = RealLast ();
- RF = RealFirst ();
-
- XMin = YMin = ZMin = RL;
- XMax = YMax = ZMax = RF;
-
- Graphic3d_MapIteratorOfMapOfStructure it(MyDisplayedStructure);
- for (; it.More(); it.Next()) {
- Handle(Graphic3d_Structure) SG = it.Key();
- if (! (SG->IsEmpty() || SG->IsInfinite ())) {
- SG->MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
- if (Xm < XMin) XMin = Xm;
- if (Ym < YMin) YMin = Ym;
- if (Zm < ZMin) ZMin = Zm;
- if (XM > XMax) XMax = XM;
- if (YM > YMax) YMax = YM;
- if (ZM > ZMax) ZMax = ZM;
- Flag = Standard_False;
- }
- }
-
- // If all structures are empty or infinite
- if (Flag) {
- XMin = YMin = ZMin = RF;
- XMax = YMax = ZMax = RL;
- }
-
+// ========================================================================
+// function : Clear
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Clear (Graphic3d_Structure* theStructure,
+ const Standard_Boolean theWithDestruction)
+{
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Clear (theStructure, theWithDestruction);
+ }
}
-
-Standard_Integer Graphic3d_StructureManager::NewIdentification () {
-
-Standard_Integer Id = MyStructGenId.Next ();
-
-#ifdef TRACE
- cout << "Graphic3d_StructureManager::NewIdentification " << Id << "\n";
- cout << flush;
-#endif
-
- return Id;
+// ========================================================================
+// function : Connect
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Connect (const Graphic3d_Structure* theMother,
+ const Graphic3d_Structure* theDaughter)
+{
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Connect (theMother, theDaughter);
+ }
}
-Handle(Graphic3d_Structure) Graphic3d_StructureManager::Identification (const Standard_Integer AId) const {
-
-// Standard_Integer ind=0;
- Standard_Boolean notfound = Standard_True;
-
- Handle(Graphic3d_Structure) StructNull;
-
- Graphic3d_MapIteratorOfMapOfStructure it( MyDisplayedStructure);
-
- Handle(Graphic3d_Structure) SGfound;
-
- for (; it.More() && notfound; it.Next()) {
- Handle(Graphic3d_Structure) SG = it.Key();
- if ( SG->Identification () == AId) {
- notfound = Standard_False;
- SGfound = SG;
- }
+// ========================================================================
+// function : Disconnect
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Disconnect (const Graphic3d_Structure* theMother,
+ const Graphic3d_Structure* theDaughter)
+{
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Disconnect (theMother, theDaughter);
}
-
-
- if (notfound)
- return (StructNull);
- else
- return (SGfound);
-
}
-Standard_Integer Graphic3d_StructureManager::Identification () const {
-
- return (MyId);
-
-}
+// ========================================================================
+// function : Display
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Display (const Handle(Graphic3d_Structure)& theStructure)
+{
+ myDisplayedStructure.Add (theStructure);
-Standard_Integer Graphic3d_StructureManager::Limit () {
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Display (theStructure);
+ }
+}
- return (StructureManager_MAX);
+// ========================================================================
+// function : Erase
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Erase (const Handle(Graphic3d_Structure)& theStructure)
+{
+ myDisplayedStructure .Remove(theStructure);
+ myHighlightedStructure.Remove (theStructure);
+ // Erase structure in all defined views
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Erase (theStructure);
+ }
}
-Standard_Integer Graphic3d_StructureManager::CurrentId () {
-
- return (StructureManager_CurrentId);
+// ========================================================================
+// function : Erase
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::Highlight (const Handle(Graphic3d_Structure)& theStructure)
+{
+ myHighlightedStructure.Add (theStructure);
+ // Highlight in all defined views
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->Highlight (theStructure);
+ }
}
-const Handle(Graphic3d_GraphicDriver)& Graphic3d_StructureManager::GraphicDriver () const {
-
- return (MyGraphicDriver);
+// ========================================================================
+// function : UnHighlight
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::UnHighlight (const Handle(Graphic3d_Structure)& theStructure)
+{
+ myHighlightedStructure.Remove (theStructure);
+ // UnHighlight in all defined views
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->UnHighlight (theStructure);
+ }
}
-void Graphic3d_StructureManager::RecomputeStructures()
+// ========================================================================
+// function : UnHighlight
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::UnHighlight()
{
- // Go through all unique structures including child (connected) ones and ensure that they are computed.
- Graphic3d_MapOfStructure aStructNetwork;
+ for (Graphic3d_MapIteratorOfMapOfStructure anIt (myHighlightedStructure); anIt.More(); anIt.Next())
+ {
+ anIt.Key()->UnHighlight();
+ }
+}
- for (Graphic3d_MapIteratorOfMapOfStructure anIter(MyDisplayedStructure); anIter.More(); anIter.Next())
+// ========================================================================
+// function : SetTransform
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::SetTransform (const Handle(Graphic3d_Structure)& theStructure,
+ const Handle(Geom_Transformation)& theTrsf)
+{
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
{
- Handle(Graphic3d_Structure) aStructure = anIter.Key();
- anIter.Key()->Network (anIter.Key(), Graphic3d_TOC_DESCENDANT, aStructNetwork);
+ aViewIt.Value()->SetTransform (theStructure, theTrsf);
}
+}
- RecomputeStructures (aStructNetwork);
+// ========================================================================
+// function : ChangeDisplayPriority
+// purpose :
+// ========================================================================
+void Graphic3d_StructureManager::ChangeDisplayPriority (const Handle(Graphic3d_Structure)& theStructure,
+ const Standard_Integer theOldPriority,
+ const Standard_Integer theNewPriority)
+{
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->ChangePriority (theStructure, theOldPriority, theNewPriority);
+ }
}
-void Graphic3d_StructureManager::RecomputeStructures (const Graphic3d_MapOfStructure& theStructures)
+//=======================================================================
+//function : ChangeZLayer
+//purpose :
+//=======================================================================
+void Graphic3d_StructureManager::ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure,
+ const Graphic3d_ZLayerId theLayerId)
{
- for (Graphic3d_MapIteratorOfMapOfStructure anIter (theStructures); anIter.More(); anIter.Next())
+ if (!myDisplayedStructure.Contains (theStructure))
{
- Handle(Graphic3d_Structure) aStruct = anIter.Key();
- aStruct->Clear();
- aStruct->Compute();
+ return;
+ }
+
+ for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
+ {
+ aViewIt.Value()->ChangeZLayer (theStructure, theLayerId);
}
}