Back to index

salome-geom  6.5.0
Functions
NMTTools_PaveFiller_8.cxx File Reference
#include <NMTTools_PaveFiller.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BooleanOperations_ShapesDataStructure.hxx>
#include <BooleanOperations_OnceExplorer.hxx>
#include <BOPTools_PaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
#include <NMTTools_CommonBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx>

Go to the source code of this file.

Functions

static void SortPaveBlocks (BOPTools_ListOfPaveBlock &)
static void SortShell (const Standard_Integer, BOPTools_PaveBlock *)
static Standard_Boolean Less (const BOPTools_PaveBlock &, const BOPTools_PaveBlock &)

Function Documentation

Standard_Boolean Less ( const BOPTools_PaveBlock &  aPB1,
const BOPTools_PaveBlock &  aPB2 
) [static]

Definition at line 811 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Boolean bRet;
  Standard_Integer iE1, iE2;
  Standard_Real aT11, aT12, aT21, aT22;
  //
  iE1=aPB1.OriginalEdge();
  iE2=aPB2.OriginalEdge();
  if (iE1!=iE2) {
    bRet=(iE1<iE2);
    return bRet;
  }
  //
  aPB1.Parameters(aT11, aT12);
  aPB2.Parameters(aT21, aT22);
  bRet=(aT11<aT21);
  return bRet;
}

Here is the caller graph for this function:

void SortPaveBlocks ( BOPTools_ListOfPaveBlock &  aLPBIn) [static]

Definition at line 745 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer i, aNbPBIn;
  BOPTools_ListIteratorOfListOfPaveBlock aItPB;
  BOPTools_PaveBlock *pPB;
  //
  aNbPBIn=aLPBIn.Extent();
  if (aNbPBIn<2) {
    return;
  }
  //
  pPB=new BOPTools_PaveBlock[aNbPBIn];
  //
  aItPB.Initialize(aLPBIn);
  for (i=0; aItPB.More(); aItPB.Next(), ++i) {
    const BOPTools_PaveBlock& aPB=aItPB.Value();
    pPB[i]=aPB;
  }
  //
  SortShell(aNbPBIn, pPB);
  //
  aLPBIn.Clear();
  for (i=0; i<aNbPBIn; ++i) {
    aLPBIn.Append(pPB[i]);
  }
  //
  delete [] (BOPTools_PaveBlock*)pPB;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SortShell ( const Standard_Integer  n,
BOPTools_PaveBlock *  a 
) [static]

Definition at line 777 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nd, i, j, l, d=1;
  BOPTools_PaveBlock x;
  //
  while(d<=n) {
    d*=2;
  }
  //
  while (d) {
    d=(d-1)/2;
    //
    nd=n-d;
    for (i=0; i<nd; ++i) {
      j=i;
    m30:;
      l=j+d;
      if (Less(a[l], a[j])) {
      //if (a[l] < a[j]){
       x=a[j];
       a[j]=a[l];
       a[l]=x;
       j-=d;
       if (j > -1) goto m30;
      }//if (a[l] < a[j]){
    }//for (i=0; i<nd; ++i)
  }//while (1)
}

Here is the call graph for this function:

Here is the caller graph for this function: