Back to index

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

#include <GEOMAlgo_VertexSolid.hxx>

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

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_VertexSolid ()
virtual Standard_EXPORT ~GEOMAlgo_VertexSolid ()
virtual Standard_EXPORT void Perform ()
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 Prepare ()
virtual Standard_EXPORT void BuildResult ()
virtual Standard_EXPORT void CheckData ()
virtual Standard_EXPORT void CheckResult ()

Protected Attributes

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 39 of file GEOMAlgo_VertexSolid.hxx.


Constructor & Destructor Documentation

Definition at line 65 of file GEOMAlgo_VertexSolid.cxx.

Definition at line 74 of file GEOMAlgo_VertexSolid.cxx.

{
}

Member Function Documentation

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

Implements GEOMAlgo_ShapeSolid.

Definition at line 202 of file GEOMAlgo_VertexSolid.cxx.

{
  const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
  //
  Standard_Integer i, iBeg, iEnd;
  TopAbs_ShapeEnum aType;
  BooleanOperations_StateOfShape aState;
  //
  myLSIN.Clear();
  myLSOUT.Clear();
  myLSON.Clear();
  //
  iBeg=1;
  iEnd=aDS.NumberOfShapesOfTheObject();
  if (myRank==2) {
    iBeg=iEnd+1;
    iEnd=aDS.NumberOfSourceShapes();
  }
  //
  for (i=iBeg; i<=iEnd; ++i) {
    aType=aDS.GetShapeType(i);
    if (aType!=TopAbs_VERTEX) {
      continue;
    }
    const TopoDS_Shape& aV=aDS.Shape(i);
    aState=aDS.GetState(i);
    //
    if (aState==BooleanOperations_IN) {
      myLSIN.Append(aV);
    }
    else if (aState==BooleanOperations_OUT) {
      myLSOUT.Append(aV);
    }
    else if (aState==BooleanOperations_ON) {
      myLSON.Append(aV);
    }
  }
}

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:

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_VertexSolid::Perform ( ) [virtual]

Implements GEOMAlgo_Algo.

Definition at line 81 of file GEOMAlgo_VertexSolid.cxx.

{
  myErrorStatus=0;
  //
  try {
    if (myDSFiller==NULL) {
      myErrorStatus=10;
      return;
    }
    if(!myDSFiller->IsDone()) {
      myErrorStatus=11;
      return;
    }
    //
    Standard_Boolean bIsNewFiller;
    Standard_Integer aNbF;
    TopTools_IndexedMapOfShape aM;
    //
    const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
    const TopoDS_Shape& aObj=aDS.Object();
    //
    TopExp::MapShapes(aObj, TopAbs_FACE, aM);
    aNbF=aM.Extent();
    myRank=(aNbF) ? 2 : 1;
    //
    bIsNewFiller=myDSFiller->IsNewFiller();

    if (bIsNewFiller) {
      Prepare();
      myDSFiller->SetNewFiller(!bIsNewFiller);
    }
    BuildResult();
  }
  //
  catch (Standard_Failure) {
    myErrorStatus = 12;
  }
}

Here is the call graph for this function:

void GEOMAlgo_VertexSolid::Prepare ( ) [protected, virtual]

Implements GEOMAlgo_ShapeSolid.

Definition at line 123 of file GEOMAlgo_VertexSolid.cxx.

{
  Standard_Integer i, iBeg, iEnd, aNbVV, j, n1, n2, iFound;
  Standard_Real aTol;
  TopAbs_State aSt;
  TopAbs_ShapeEnum aType;
  BooleanOperations_StateOfShape aState;
  gp_Pnt aP3D;
  //
  const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
  BooleanOperations_ShapesDataStructure* pDS=(BooleanOperations_ShapesDataStructure*)&aDS;
  const BOPTools_InterferencePool& aIP=myDSFiller->InterfPool();
  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*) &aIP;
  BOPTools_CArray1OfVVInterference& aVVs=pIP->VVInterferences();
  const BOPTools_PaveFiller& aPF=myDSFiller->PaveFiller();
  BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)&aPF;
  const Handle(IntTools_Context)& aCtx=pPF->Context();
  //
  const TopoDS_Shape& aObj=aDS.Object();
  const TopoDS_Shape& aTool=aDS.Tool();
  //
  const TopoDS_Solid& aSolid=(myRank==1) ? TopoDS::Solid(aTool) : TopoDS::Solid(aObj);
  //
  BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
  //
  iBeg=1;
  iEnd=aDS.NumberOfShapesOfTheObject();
  if (myRank==2) {
    iBeg=iEnd+1;
    iEnd=aDS.NumberOfSourceShapes();
  }
  //
  for (i=iBeg; i<=iEnd; ++i) {
    aType=aDS.GetShapeType(i);
    if (aType!=TopAbs_VERTEX) {
      continue;
    }
    //
    const TopoDS_Vertex& aV=TopoDS::Vertex(aDS.Shape(i));
    //
    aState=aDS.GetState(i);
    if (aState==BooleanOperations_ON ||
        aState==BooleanOperations_IN ||
        aState==BooleanOperations_OUT) {
      continue;
    }
    //
    iFound=0;
    aNbVV=aVVs.Extent();
    for (j=1; j<=aNbVV; ++j) {
      BOPTools_VVInterference& aVV=aVVs(j);
      aVV.Indices(n1, n2);
      if (n1==i || n2==i) {
        pDS->SetState (n1, BooleanOperations_ON);
        pDS->SetState (n2, BooleanOperations_ON);
        iFound=1;
        break;
      }
    }
    if (iFound) {
      continue;
    }
    //
    aP3D=BRep_Tool::Pnt(aV);
    aTol=1.E-7;
    aSC.Perform(aP3D, aTol);
    aSt=aSC.State();
    if (aSt==TopAbs_IN) {
      pDS->SetState (i, BooleanOperations_IN);
    }
    else if (aSt==TopAbs_OUT) {
      pDS->SetState (i, BooleanOperations_OUT);
    }
  }
}

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:

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.

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: