// Created by: NW,JPB,CAL // Copyright (c) 1991-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #define XTRACE //-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 #include static Standard_Boolean Initialisation = Standard_True; static int StructureManager_ArrayId[StructureManager_MAX]; static Standard_Integer StructureManager_CurrentId = 0; #include #include Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver) { 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; iIdentification () == AId) { notfound = Standard_False; SGfound = SG; } } if (notfound) return (StructNull); else return (SGfound); } Standard_Integer Graphic3d_StructureManager::Identification () const { return (MyId); } Standard_Integer Graphic3d_StructureManager::Limit () { return (StructureManager_MAX); } Standard_Integer Graphic3d_StructureManager::CurrentId () { return (StructureManager_CurrentId); } const Handle(Graphic3d_GraphicDriver)& Graphic3d_StructureManager::GraphicDriver () const { return (MyGraphicDriver); } void Graphic3d_StructureManager::RecomputeStructures() { // Go through all unique structures including child (connected) ones and ensure that they are computed. Graphic3d_MapOfStructure aStructNetwork; for (Graphic3d_MapIteratorOfMapOfStructure anIter(MyDisplayedStructure); anIter.More(); anIter.Next()) { Handle(Graphic3d_Structure) aStructure = anIter.Key(); anIter.Key()->Network (anIter.Key(), Graphic3d_TOC_DESCENDANT, aStructNetwork); } RecomputeStructures (aStructNetwork); } void Graphic3d_StructureManager::RecomputeStructures (const Graphic3d_MapOfStructure& theStructures) { for (Graphic3d_MapIteratorOfMapOfStructure anIter (theStructures); anIter.More(); anIter.Next()) { Handle(Graphic3d_Structure) aStruct = anIter.Key(); aStruct->Clear(); aStruct->Compute(); } }