Back to index

salome-geom  6.5.0
Public Member Functions | Protected Member Functions | Protected Attributes
GEOMAlgo_SolidSolid Class Reference

#include <GEOMAlgo_SolidSolid.hxx>

Inheritance diagram for GEOMAlgo_SolidSolid:
Inheritance graph
[legend]
Collaboration diagram for GEOMAlgo_SolidSolid:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_SolidSolid ()
virtual Standard_EXPORT ~GEOMAlgo_SolidSolid ()
virtual Standard_EXPORT void Perform ()
Standard_EXPORT void SetShape2 (const TopoDS_Shape &aS)
Standard_EXPORT const
TopoDS_Shape & 
Shape2 () const
Standard_EXPORT void SetFiller (const BOPTools_DSFiller &aDSF)
Standard_EXPORT const
TopTools_ListOfShape & 
Shapes (const TopAbs_State aState) const
Standard_EXPORT Standard_Integer ErrorStatus () const
Standard_EXPORT Standard_Integer WarningStatus () const
Standard_EXPORT void ComputeInternalShapes (const Standard_Boolean theFlag)
 Allows to omit of creation of internal shapes (manifold topology).
Needed for the SALOME/TRIPOLI module.

Protected Member Functions

virtual Standard_EXPORT void BuildResult ()
virtual Standard_EXPORT void Prepare ()
Standard_EXPORT void DetectSDFaces ()
virtual Standard_EXPORT void CheckData ()
virtual Standard_EXPORT void CheckResult ()

Protected Attributes

TopoDS_Shape myS2
TopTools_ListOfShape myLSIN
TopTools_ListOfShape myLSOUT
TopTools_ListOfShape myLSON
Standard_Integer myRank
BOPTools_PDSFiller myDSFiller
Standard_Integer myErrorStatus
Standard_Integer myWarningStatus
Standard_Boolean myComputeInternalShapes

Detailed Description

Definition at line 40 of file GEOMAlgo_SolidSolid.hxx.


Constructor & Destructor Documentation

Definition at line 49 of file GEOMAlgo_SolidSolid.cxx.

Definition at line 58 of file GEOMAlgo_SolidSolid.cxx.

{
}

Member Function Documentation

void GEOMAlgo_SolidSolid::BuildResult ( ) [protected, virtual]

Reimplemented from GEOMAlgo_ShellSolid.

Definition at line 113 of file GEOMAlgo_SolidSolid.cxx.

{
  myErrorStatus=0;
  //
  Standard_Integer i, j, aNbF, aNbS;
  Standard_Integer aNbFIN, aNbFOUT, aNbFON, aNbFINTR;
  TopAbs_State aState;
  TopTools_ListIteratorOfListOfShape aIt;
  TopTools_IndexedMapOfShape aMF, aMS;
  GEOMAlgo_IndexedDataMapOfShapeState aMFS;
  //
  // 1. classify the faces
  GEOMAlgo_ShellSolid::BuildResult();
  //
  // 2. fill Shape-State map
  aIt.Initialize(myLSIN);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aF=aIt.Value();
    aMFS.Add(aF, TopAbs_IN);
  }
  aIt.Initialize(myLSOUT);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aF=aIt.Value();
    aMFS.Add(aF, TopAbs_OUT);
  }
  aIt.Initialize(myLSON);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aF=aIt.Value();
    aMFS.Add(aF, TopAbs_ON);
  }
  myLSIN.Clear();
  myLSON.Clear();
  myLSOUT.Clear();
  //
  // 3. fill states for solids
  TopExp::MapShapes(myS2, TopAbs_SOLID, aMS);
  //
  aNbS=aMS.Extent();
  for (i=1; i<=aNbS; ++i) {
    const TopoDS_Shape& aSolid=aMS(i);
    //
    aMF.Clear();
    TopExp::MapShapes(aSolid, TopAbs_FACE, aMF);
    //
    aNbFIN=0;
    aNbFOUT=0;
    aNbFON=0;
    aNbFINTR=0;
    //
    aNbF=aMF.Extent();
    for(j=1; j<aNbF; ++j) {
      const TopoDS_Shape& aF=aMF(j);
      //
      if (!aMFS.Contains(aF)) {// the face is intesected
        ++aNbFINTR;
        break;
      }
      //
      aState=aMFS.FindFromKey(aF);
      switch (aState) {
        case TopAbs_IN:
          ++aNbFIN;
          break;
        case TopAbs_OUT:
          ++aNbFOUT;
          break;
        case TopAbs_ON:
          ++aNbFON;
          break;
        default:
          break;
      }
      if (aNbFIN && aNbFOUT) {
        ++aNbFINTR;
        break;
      }
    }
    //
    if (!aNbFINTR) {
      if (aNbFON==aNbF) {
        myLSON.Append(aSolid);
      }
      else if (aNbFIN) {
        myLSIN.Append(aSolid);
      }
      else if (aNbFOUT) {
        myLSOUT.Append(aSolid);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_Algo::CheckData ( ) [protected, virtual, inherited]
void GEOMAlgo_Algo::CheckResult ( ) [protected, virtual, inherited]

Reimplemented in GEOMAlgo_Gluer.

Definition at line 59 of file GEOMAlgo_Algo.cxx.

void GEOMAlgo_Algo::ComputeInternalShapes ( const Standard_Boolean  theFlag) [inherited]

Allows to omit of creation of internal shapes (manifold topology).
Needed for the SALOME/TRIPOLI module.

Definition at line 87 of file GEOMAlgo_Algo.cxx.

{
  myComputeInternalShapes = theFlag;
}

Here is the caller graph for this function:

void GEOMAlgo_ShellSolid::DetectSDFaces ( ) [protected, inherited]

Definition at line 289 of file GEOMAlgo_ShellSolid.cxx.

{
  const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
  BOPTools_InterferencePool* pIntrPool=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
  BOPTools_CArray1OfSSInterference& aFFs=pIntrPool->SSInterferences();
  //
  Standard_Boolean bFlag;
  Standard_Integer i, aNb, nF1, nF2,  iZone, aNbSps, iSenseFlag;
  gp_Dir aDNF1, aDNF2;

  aNb=aFFs.Extent();
  for (i=1; i<=aNb; i++) {
    bFlag=Standard_False;

    BOPTools_SSInterference& aFF=aFFs(i);

    nF1=aFF.Index1();
    nF2=aFF.Index2();
    const TopoDS_Face& aF1=TopoDS::Face(aDS.Shape(nF1));
    const TopoDS_Face& aF2=TopoDS::Face(aDS.Shape(nF2));
    //
    // iSenseFlag;
    const BOPTools_ListOfPaveBlock& aLPB=aFF.PaveBlocks();
    aNbSps=aLPB.Extent();

    if (!aNbSps) {
      continue;
    }

    const BOPTools_PaveBlock& aPB=aLPB.First();
    const TopoDS_Edge& aSpE=TopoDS::Edge(aDS.Shape(aPB.Edge()));

    BOPTools_Tools3D::GetNormalToFaceOnEdge (aSpE, aF1, aDNF1);
    BOPTools_Tools3D::GetNormalToFaceOnEdge (aSpE, aF2, aDNF2);
    iSenseFlag=BOPTools_Tools3D::SenseFlag (aDNF1, aDNF2);
    //
    if (iSenseFlag==1 || iSenseFlag==-1) {
    //
    //
      TopoDS_Face aF1FWD=aF1;
      aF1FWD.Orientation (TopAbs_FORWARD);

      BOP_WireEdgeSet aWES (aF1FWD);
      BOP_SDFWESFiller aWESFiller(nF1, nF2, *myDSFiller);
      aWESFiller.SetSenseFlag(iSenseFlag);
      aWESFiller.SetOperation(BOP_COMMON);
      aWESFiller.Do(aWES);

      BOP_FaceBuilder aFB;
      aFB.Do(aWES);
      const TopTools_ListOfShape& aLF=aFB.NewFaces();

      iZone=0;
      TopTools_ListIteratorOfListOfShape anIt(aLF);
      for (; anIt.More(); anIt.Next()) {
        const TopoDS_Shape& aFR=anIt.Value();

        if (aFR.ShapeType()==TopAbs_FACE) {
          const TopoDS_Face& aFaceResult=TopoDS::Face(aFR);
          //
          Standard_Boolean bIsValidIn2D, bNegativeFlag;
          bIsValidIn2D=BOPTools_Tools3D::IsValidArea (aFaceResult, bNegativeFlag);
          if (bIsValidIn2D) {
            //if(CheckSameDomainFaceInside(aFaceResult, aF2)) {
            iZone=1;
            break;
            //}
          }
          //
        }
      }

      if (iZone) {
        bFlag=Standard_True;
        aFF.SetStatesMap(aWESFiller.StatesMap());
      }

    }// if (iSenseFlag)

  aFF.SetTangentFacesFlag(bFlag);
  aFF.SetSenseFlag (iSenseFlag);
  }// end of for (i=1; i<=aNb; i++)
}

Here is the caller graph for this function:

Standard_Integer GEOMAlgo_Algo::ErrorStatus ( ) const [inherited]

Definition at line 67 of file GEOMAlgo_Algo.cxx.

{
  return myErrorStatus;
}

Here is the caller graph for this function:

void GEOMAlgo_SolidSolid::Perform ( ) [virtual]

Reimplemented from GEOMAlgo_ShellSolid.

Definition at line 81 of file GEOMAlgo_SolidSolid.cxx.

{
  myErrorStatus=0;
  try {
    if (myDSFiller==NULL) {
      myErrorStatus=10;
      return;
    }
    if(!myDSFiller->IsDone()) {
      myErrorStatus=11;
      return;
    }
    //
    Standard_Boolean bIsNewFiller;
    //
    bIsNewFiller=myDSFiller->IsNewFiller();
    if (bIsNewFiller) {
      Prepare();
      myDSFiller->SetNewFiller(!bIsNewFiller);
    }
    //
    myRank=2;
    BuildResult();
  }
  catch (Standard_Failure) {
    myErrorStatus=12;
  }
}

Here is the call graph for this function:

void GEOMAlgo_ShellSolid::Prepare ( ) [protected, virtual, inherited]

Implements GEOMAlgo_ShapeSolid.

Definition at line 129 of file GEOMAlgo_ShellSolid.cxx.

{
  const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
  //
  // 1 States
  BOPTools_SolidStateFiller aStateFiller(aPaveFiller);
  aStateFiller.Do();
  //
  // 2 Project section edges on corresp. faces -> P-Curves on edges.
  BOPTools_PCurveMaker aPCurveMaker(aPaveFiller);
  aPCurveMaker.Do();
  //
  // 3. Degenerated Edges Processing
  BOPTools_DEProcessor aDEProcessor(aPaveFiller);
  aDEProcessor.Do();
  //
  // 4. Detect Same Domain Faces
  DetectSDFaces();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeSolid::SetFiller ( const BOPTools_DSFiller &  aDSF) [inherited]

Definition at line 55 of file GEOMAlgo_ShapeSolid.cxx.

{
  myDSFiller=(BOPTools_DSFiller*) &aDSFiller;
}

Here is the caller graph for this function:

void GEOMAlgo_SolidSolid::SetShape2 ( const TopoDS_Shape &  aS)

Definition at line 65 of file GEOMAlgo_SolidSolid.cxx.

{
  myS2=aS2;
}

Here is the caller graph for this function:

const TopoDS_Shape & GEOMAlgo_SolidSolid::Shape2 ( ) const

Definition at line 73 of file GEOMAlgo_SolidSolid.cxx.

{
  return myS2;
}
const TopTools_ListOfShape & GEOMAlgo_ShapeSolid::Shapes ( const TopAbs_State  aState) const [inherited]

Definition at line 63 of file GEOMAlgo_ShapeSolid.cxx.

{
  const TopTools_ListOfShape *pL;
  //
  switch (aState) {
    case TopAbs_IN:
      pL=&myLSIN;
      break;
    case TopAbs_OUT:
      pL=&myLSOUT;
      break;
    case TopAbs_ON:
      pL=&myLSON;
      break;
    default:
      pL=&myLSON;
      break;
  }
  return *pL;
}

Here is the caller graph for this function:

Standard_Integer GEOMAlgo_Algo::WarningStatus ( ) const [inherited]

Definition at line 75 of file GEOMAlgo_Algo.cxx.

{
  return myWarningStatus;
}

Here is the caller graph for this function:


Member Data Documentation

Standard_Boolean GEOMAlgo_Algo::myComputeInternalShapes [protected, inherited]

Definition at line 73 of file GEOMAlgo_Algo.hxx.

BOPTools_PDSFiller GEOMAlgo_ShapeSolid::myDSFiller [protected, inherited]

Definition at line 71 of file GEOMAlgo_ShapeSolid.hxx.

Standard_Integer GEOMAlgo_Algo::myErrorStatus [protected, inherited]

Definition at line 71 of file GEOMAlgo_Algo.hxx.

TopTools_ListOfShape GEOMAlgo_ShapeSolid::myLSIN [protected, inherited]

Definition at line 67 of file GEOMAlgo_ShapeSolid.hxx.

TopTools_ListOfShape GEOMAlgo_ShapeSolid::myLSON [protected, inherited]

Definition at line 69 of file GEOMAlgo_ShapeSolid.hxx.

TopTools_ListOfShape GEOMAlgo_ShapeSolid::myLSOUT [protected, inherited]

Definition at line 68 of file GEOMAlgo_ShapeSolid.hxx.

Standard_Integer GEOMAlgo_ShapeSolid::myRank [protected, inherited]

Definition at line 70 of file GEOMAlgo_ShapeSolid.hxx.

TopoDS_Shape GEOMAlgo_SolidSolid::myS2 [protected]

Definition at line 63 of file GEOMAlgo_SolidSolid.hxx.

Standard_Integer GEOMAlgo_Algo::myWarningStatus [protected, inherited]

Definition at line 72 of file GEOMAlgo_Algo.hxx.


The documentation for this class was generated from the following files: