//purpose :
//=============================================================================
Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& theManager)
-: myStructureManager (theManager.operator->()),
- myFirstStructureManager (theManager.operator->()),
- myComputeVisual (Graphic3d_TOS_ALL),
- myOwner (NULL),
- myVisual (Graphic3d_TOS_ALL)
+: myStructureManager(theManager.operator->()),
+ myComputeVisual (Graphic3d_TOS_ALL),
+ myOwner (NULL),
+ myVisual (Graphic3d_TOS_ALL)
{
myCStructure = theManager->GraphicDriver()->CreateStructure (theManager);
}
//=============================================================================
Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& theManager,
const Handle(Graphic3d_Structure)& thePrs)
-: myStructureManager (theManager.operator->()),
- myFirstStructureManager (theManager.operator->()),
- myComputeVisual (thePrs->myComputeVisual),
- myOwner (thePrs->myOwner),
- myVisual (thePrs->myVisual)
+: myStructureManager(theManager.operator->()),
+ myComputeVisual (thePrs->myComputeVisual),
+ myOwner (thePrs->myOwner),
+ myVisual (thePrs->myVisual)
{
myCStructure = thePrs->myCStructure->ShadowLink (theManager);
}
//=============================================================================
Graphic3d_Structure::~Graphic3d_Structure()
{
- // as myFirstStructureManager can be already destroyed,
+ // as myStructureManager can be already destroyed,
// avoid attempts to access it
- myFirstStructureManager = NULL;
+ myStructureManager = NULL;
Remove();
}
// ========================================================================
Graphic3d_StructureManager::~Graphic3d_StructureManager()
{
+ for (Graphic3d_MapIteratorOfMapOfStructure anIt (myDisplayedStructure); anIt.More(); anIt.Next())
+ {
+ anIt.Value()->Remove();
+ }
+
myDisplayedStructure.Clear();
myHighlightedStructure.Clear();
myDefinedViews.Clear();
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();