+
+//=======================================================================
+//function : ComputeBoxEx
+//purpose :
+//=======================================================================
+ void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx,
+ Bnd_Box& aBoxEx)const
+{
+ ComputeBoxExS(aIx, this, aBoxEx);
+}
+//=======================================================================
+//function : GetAllSuccessors
+//purpose :
+//=======================================================================
+ void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS,
+ TColStd_IndexedMapOfInteger& aMA)const
+{
+ GetAllSuccessorsS(nS, this, aMA);
+}
+//=======================================================================
+//function : GetAllSuccessorsS
+//purpose :
+//=======================================================================
+void GetAllSuccessorsS(const Standard_Integer nS,
+ const NMTDS_ShapesDataStructure* myDS,
+ TColStd_IndexedMapOfInteger& aMA)
+{
+ TopAbs_ShapeEnum aT;
+ Standard_Integer i, nSx, aNbSuccessors, *pSuccessors;
+ Standard_Address xSuccessors;
+ //
+ const TopoDS_Shape& aS=myDS->Shape(nS);
+ aT=aS.ShapeType();
+ if(NMTDS_Tools::HasBRep(aT)) {
+ aMA.Add(nS);
+ //
+ if (aT==TopAbs_VERTEX) {
+ return;
+ }
+ }
+ //
+ myDS->GetSuccessors(nS, xSuccessors, aNbSuccessors);
+ pSuccessors=(Standard_Integer*)xSuccessors;
+ for (i=0; i<aNbSuccessors; ++i) {
+ nSx=pSuccessors[i];
+ GetAllSuccessorsS(nSx, myDS, aMA);
+ }
+}
+//=======================================================================
+// function: ComputeBoxExS
+// purpose:
+//=======================================================================
+ void ComputeBoxExS(const Standard_Integer aIx,
+ const NMTDS_ShapesDataStructure* pDS,
+ Bnd_Box& aBoxEx)
+{
+ Standard_Integer i, aNbS, iS;
+ //
+ const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
+ aBoxEx.Add(aBox);
+ //
+ aNbS=pDS->NumberOfSuccessors(aIx);
+ for (i=1; i<=aNbS; ++i) {
+ Bnd_Box aBoxS;
+ iS=pDS->GetSuccessor(aIx, i);
+ ComputeBoxExS(iS, pDS, aBoxS);
+ aBoxEx.Add(aBoxS);
+ }
+}