Back to index

salome-geom  6.5.0
Functions
GEOMAlgo_BuilderFace.cxx File Reference
#include <GEOMAlgo_BuilderFace.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Geom_Surface.hxx>
#include <TopAbs.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfOrientedShape.hxx>
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <IntTools_FClass2d.hxx>
#include <IntTools_Context.hxx>
#include <BOPTools_Tools2D.hxx>
#include <BOP_WireEdgeSet.hxx>
#include <BOP_WESCorrector.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_BuilderTools.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_WESCorrector.hxx>

Go to the source code of this file.

Functions

static Standard_Boolean IsGrowthWire (const TopoDS_Shape &, const TopTools_IndexedMapOfShape &)
static Standard_Boolean IsInside (const TopoDS_Shape &, const TopoDS_Shape &, const Handle(IntTools_Context)&)
static void MakeInternalWires (const TopTools_MapOfShape &, TopTools_ListOfShape &)

Function Documentation

Standard_Boolean IsGrowthWire ( const TopoDS_Shape &  theWire,
const TopTools_IndexedMapOfShape &  theMHE 
) [static]

Definition at line 658 of file GEOMAlgo_BuilderFace.cxx.

{
  Standard_Boolean bRet;
  TopoDS_Iterator aIt;
  //
  bRet=Standard_False;
  if (theMHE.Extent()) {
    aIt.Initialize(theWire);
    for(; aIt.More(); aIt.Next()) {
      const TopoDS_Shape& aE=aIt.Value();
      if (theMHE.Contains(aE)) {
        return !bRet;
      }
    }
  }
  return bRet;
}

Here is the caller graph for this function:

Standard_Boolean IsInside ( const TopoDS_Shape &  theHole,
const TopoDS_Shape &  theF2,
const Handle(IntTools_Context)&  theContext 
) [static]

Definition at line 617 of file GEOMAlgo_BuilderFace.cxx.

{
  Standard_Boolean bRet;
  Standard_Real aT, aU, aV;

  TopAbs_State aState;
  TopExp_Explorer aExp;
  TopTools_IndexedMapOfShape aME2;
  gp_Pnt2d aP2D;
  //
  bRet=Standard_False;
  aState=TopAbs_UNKNOWN;
  const TopoDS_Face& aF2=TopoDS::Face(theF2);
  //
  TopExp::MapShapes(aF2, TopAbs_EDGE, aME2);
  //
  aExp.Init(theHole, TopAbs_EDGE);
  if (aExp.More()) {
    const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
    if (aME2.Contains(aE)) {
      return bRet;
    }
    //
    aT=BOPTools_Tools2D::IntermediatePoint(aE);
    BOPTools_Tools2D::PointOnSurface(aE, aF2, aT, aU, aV);
    aP2D.SetCoord(aU, aV);
    //
    IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
    aState=aClsf.Perform(aP2D);
    bRet=(aState==TopAbs_IN);
  }
  //
  return bRet;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void MakeInternalWires ( const TopTools_MapOfShape &  theME,
TopTools_ListOfShape &  theWires 
) [static]

Definition at line 564 of file GEOMAlgo_BuilderFace.cxx.

{
  TopTools_MapIteratorOfMapOfShape aItM;
  TopTools_MapOfShape aAddedMap;
  TopTools_ListIteratorOfListOfShape aItE;
  TopTools_IndexedDataMapOfShapeListOfShape aMVE;
  BRep_Builder aBB;
  //
  aItM.Initialize(theME);
  for (; aItM.More(); aItM.Next()) {
    const TopoDS_Shape& aE=aItM.Key();
    TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
  }
  //
  aItM.Initialize(theME);
  for (; aItM.More(); aItM.Next()) {
    TopoDS_Shape aEE=aItM.Key();
    if (!aAddedMap.Add(aEE)) {
      continue;
    }
    //
    // make a new shell
    TopoDS_Wire aW;
    aBB.MakeWire(aW);
    aEE.Orientation(TopAbs_INTERNAL);
    aBB.Add(aW, aEE);
    //
    TopoDS_Iterator aItAdded (aW);
    for (; aItAdded.More(); aItAdded.Next()) {
      const TopoDS_Shape& aE =aItAdded.Value();
      //
      TopExp_Explorer aExp(aE, TopAbs_VERTEX);
      for (; aExp.More(); aExp.Next()) {
        const TopoDS_Shape& aV =aExp.Current();
        const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
        aItE.Initialize(aLE);
        for (; aItE.More(); aItE.Next()) {
          TopoDS_Shape aEL=aItE.Value();
          if (aAddedMap.Add(aEL)){
            aEL.Orientation(TopAbs_INTERNAL);
            aBB.Add(aW, aEL);
          }
        }
      }
    }
    theWires.Append(aW);
  }
}

Here is the caller graph for this function: