Back to index

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

#include <GEOMAlgo_FinderShapeOn2.hxx>

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

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_FinderShapeOn2 ()
virtual Standard_EXPORT ~GEOMAlgo_FinderShapeOn2 ()
Standard_EXPORT void SetClsf (const Handle(GEOMAlgo_Clsf)&aClsf)
Standard_EXPORT const
Handle_GEOMAlgo_Clsf & 
Clsf () const
Standard_EXPORT void SetShapeType (const TopAbs_ShapeEnum aST)
Standard_EXPORT TopAbs_ShapeEnum ShapeType () const
Standard_EXPORT void SetState (const GEOMAlgo_State aSF)
Standard_EXPORT GEOMAlgo_State State () const
Standard_EXPORT void SetNbPntsMin (const Standard_Integer aNb)
Standard_EXPORT Standard_Integer NbPntsMin () const
Standard_EXPORT void SetNbPntsMax (const Standard_Integer aNb)
Standard_EXPORT Standard_Integer NbPntsMax () const
virtual Standard_EXPORT void Perform ()
Standard_EXPORT const
TopTools_ListOfShape & 
Shapes () const
Standard_EXPORT const
GEOMAlgo_IndexedDataMapOfShapeState
MSS () const
Standard_EXPORT void SetContext (const Handle(IntTools_Context)&theContext)
 Sets cashed geometrical tools

Standard_EXPORT const
Handle_IntTools_Context & 
Context () const
 Returns cashed geometrical tools

Standard_EXPORT void SetShape (const TopoDS_Shape &aS)
Standard_EXPORT void SetTolerance (const Standard_Real aT)
Standard_EXPORT const
TopoDS_Shape & 
Shape () const
Standard_EXPORT Standard_Real Tolerance () const
Standard_EXPORT const
TopoDS_Shape & 
Result () 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 CheckData ()
Standard_EXPORT void ProcessVertices ()
Standard_EXPORT void ProcessEdges ()
Standard_EXPORT void ProcessFaces ()
Standard_EXPORT void ProcessSolids ()
Standard_EXPORT void InnerPoints (const TopoDS_Face &aF, GEOMAlgo_ListOfPnt &aLP)
Standard_EXPORT void InnerPoints (const TopoDS_Edge &aE, GEOMAlgo_ListOfPnt &aLP)
Standard_EXPORT void InnerPoints (const TopoDS_Edge &aE, const Standard_Integer aNbPnts, GEOMAlgo_ListOfPnt &aLP)
virtual Standard_EXPORT void CheckResult ()

Protected Attributes

TopAbs_ShapeEnum myShapeType
GEOMAlgo_State myState
Standard_Integer myNbPntsMin
Standard_Integer myNbPntsMax
Handle_GEOMAlgo_Clsf myClsf
TopTools_ListOfShape myLS
GEOMAlgo_IndexedDataMapOfShapeState myMSS
TopoDS_Shape myShape
Standard_Real myTolerance
TopoDS_Shape myResult
Handle_IntTools_Context myContext
Standard_Integer myErrorStatus
Standard_Integer myWarningStatus
Standard_Boolean myComputeInternalShapes

Detailed Description

Definition at line 49 of file GEOMAlgo_FinderShapeOn2.hxx.


Constructor & Destructor Documentation

Definition at line 100 of file GEOMAlgo_FinderShapeOn2.cxx.

{
}

Member Function Documentation

void GEOMAlgo_FinderShapeOn2::CheckData ( ) [protected, virtual]

Reimplemented from GEOMAlgo_Algo.

Definition at line 268 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  Standard_Integer iErr;
  //
  myErrorStatus=0;
  //
  if(myClsf.IsNull()) {
    myErrorStatus=10; // myClsf=NULL
    return;
  }
  //
  myClsf->CheckData();
  iErr=myClsf->ErrorStatus();
  if (iErr) {
    myErrorStatus=41; // invalid data for classifier
    return;
  }
  //
  if (myShape.IsNull()) {
    myErrorStatus=11; // myShape=NULL
    return;
  }
  //
  if (!(myShapeType==TopAbs_VERTEX ||
        myShapeType==TopAbs_EDGE ||
        myShapeType==TopAbs_FACE ||
        myShapeType==TopAbs_SOLID)) {
    myErrorStatus=12; // unallowed sub-shape type
    return;
  }
  //
  if (myState==GEOMAlgo_ST_UNKNOWN ||
      myState==GEOMAlgo_ST_INOUT) {
    myErrorStatus=13; // unallowed state type
    return;
  }
}

Here is the caller graph for this function:

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

Reimplemented in GEOMAlgo_Gluer.

Definition at line 59 of file GEOMAlgo_Algo.cxx.

Standard_EXPORT const Handle_GEOMAlgo_Clsf& GEOMAlgo_FinderShapeOn2::Clsf ( ) const
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_EXPORT const Handle_IntTools_Context& GEOMAlgo_ShapeAlgo::Context ( ) const [inherited]

Returns cashed geometrical tools

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_FinderShapeOn2::InnerPoints ( const TopoDS_Face &  aF,
GEOMAlgo_ListOfPnt aLP 
) [protected]

Definition at line 595 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  //
  Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds;
  TopLoc_Location aLoc;
  Handle(Poly_Triangulation) aTRF;
  TColStd_MapOfInteger aMBN;
  GEOMAlgo_DataMapOfPassKeyInteger aMPKI;
  GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt;
  gp_Pnt aP, aP1, aP2;
  //
  aLP.Clear();
  //
  aTRF=BRep_Tool::Triangulation(aF, aLoc);
  if (aTRF.IsNull()) {
    if (!GEOMAlgo_FinderShapeOn::BuildTriangulation(aF)) {
      myWarningStatus=20; // no triangulation found
      return;
    }
    aTRF=BRep_Tool::Triangulation(aF, aLoc);
  }
  //
  const gp_Trsf& aTrsf=aLoc.Transformation();
  const Poly_Array1OfTriangle& aTrs=aTRF->Triangles();
  const TColgp_Array1OfPnt& aNodes=aTRF->Nodes();
  //
  // map link/nbtriangles
  j1=aTrs.Lower();
  j2=aTrs.Upper();
  for (j=j1; j<=j2; ++j) {
    const Poly_Triangle& aTr=aTrs(j);
    aTr.Get(n[0], n[1], n[2]);
    n[3]=n[0];
    for (k=0; k<3; ++k) {
      GEOMAlgo_PassKey aPK;
      //
      aPK.SetIds(n[k], n[k+1]);
      if (aMPKI.IsBound(aPK)) {
        Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
        ++iCntX;
      }
      else {
        aMPKI.Bind(aPK, 1);
      }
    }
  }
  //
  // boundary nodes aMBN
  aNbLinks=aMPKI.Extent();
  aIt.Initialize(aMPKI);
  for (; aIt.More(); aIt.Next()) {
    iCnt=aIt.Value();
    if (iCnt==1) {
      const GEOMAlgo_PassKey& aPK=aIt.Key();
      //qf
      /*
      aNbMax=aPK.NbMax();
      pIds=(Standard_Integer*)aPK.Key();
      for (k=1; k<3; ++k) {
        aNx=*(pIds+aNbMax-k);
        aMBN.Add(aNx);
      }
      */
      aNx=(Standard_Integer)aPK.Id(1);
      aMBN.Add(aNx);
      aNx=(Standard_Integer)aPK.Id(2);
      aMBN.Add(aNx);
      //qt
    }
  }
  //
  // inner nodes=all_nodes - boundary_nodes
  j1=aNodes.Lower();
  j2=aNodes.Upper();
  for (j=j1; j<=j2; ++j) {
    if (!aMBN.Contains(j)) {
      aP=aNodes(j).Transformed(aTrsf);
      aLP.Append(aP);
    }
  }
  //
  aNb=aLP.Extent();
  //
  if (!aNb && myNbPntsMin) {
    // try to fill it yourself
    Standard_Boolean bIsDone;
    Standard_Integer aN1, aN2;
    Handle(Geom_Surface) aS;
    GeomAdaptor_Surface aGAS;
    GeomAbs_SurfaceType aType;
    //
    aS=BRep_Tool::Surface(aF);
    aGAS.Load(aS);
    aType=aGAS.GetType();
    if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
      // inner links
      aNbLinks=aMPKI.Extent();
      aIt.Initialize(aMPKI);
      for (; aIt.More(); aIt.Next()) {
        iCnt=aIt.Value();
        if (iCnt>1) {
          // take the first having occured inner link
          // and discretize it
          const GEOMAlgo_PassKey& aPK=aIt.Key();
          //qf
          /*
          aNbMax=aPK.NbMax();
          pIds=(Standard_Integer*)aPK.Key();
          aN1=*(pIds+aNbMax-1);
          aN2=*(pIds+aNbMax-2);
          */
          //
          aN1=(Standard_Integer)aPK.Id(1);
          aN2=(Standard_Integer)aPK.Id(2);
          //qt
          aP1=aNodes(aN1).Transformed(aTrsf);
          aP2=aNodes(aN2).Transformed(aTrsf);
          //
          if (aType==GeomAbs_Cylinder) {
            Standard_Real aTolSM;
            gp_Cylinder aCyl;
            //
            aTolSM=1.523e-6;//~1.-cos(0.1 deg)
            aCyl=aGAS.Cylinder();
            if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
              continue;
            }
          }
          //
          BRepLib_MakeEdge aBME(aP1, aP2);
          bIsDone=aBME.IsDone();
          if (!bIsDone) {
            myErrorStatus=30; //can not obtain the line fron the link
            return;
          }
          //
          const TopoDS_Shape& aSx=aBME.Shape();
          const TopoDS_Edge& aE=TopoDS::Edge(aSx);
          //
          InnerPoints(aE, myNbPntsMin, aLP);
          break;
        }// if (iCnt>1)
      }// for (; aIt.More(); aIt.Next())
    }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
  }// if (!aNb && myNbPntsMin) {
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_FinderShapeOn2::InnerPoints ( const TopoDS_Edge &  aE,
GEOMAlgo_ListOfPnt aLP 
) [protected]

Definition at line 747 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  //
  Standard_Integer j, aNbNodes, aIndex, aNb;
  Handle(Poly_PolygonOnTriangulation) aPTE;
  Handle(Poly_Triangulation) aTRE;
  TopLoc_Location aLoc;
  gp_Pnt aP;
  //
  aLP.Clear();
  BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
  if (aTRE.IsNull() || aPTE.IsNull()) {
    Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
    if (aPE.IsNull()) {
      if (!GEOMAlgo_FinderShapeOn::BuildTriangulation(aE)) {
        myErrorStatus=20; // no triangulation found
        return;
      }
      aPE = BRep_Tool::Polygon3D(aE, aLoc);
    }
    const gp_Trsf& aTrsf=aLoc.Transformation();
    const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
    //
    aNbNodes=aPE->NbNodes();
    Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
    for (j=low+1; j<up; ++j) {
      aP=aNodes(j).Transformed(aTrsf);
      aLP.Append(aP);
    }
  }
  else {
    const gp_Trsf& aTrsf=aLoc.Transformation();
    const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
    //
    aNbNodes=aPTE->NbNodes();
    const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
    for (j=2; j<aNbNodes; ++j) {
      aIndex=aInds(j);
      aP=aNodes(aIndex).Transformed(aTrsf);
      aLP.Append(aP);
    }
  }
  //
  aNb=aLP.Extent();
  if (!aNb && myNbPntsMin) {
    // try to fill it yourself
    InnerPoints(aE, myNbPntsMin, aLP);
    aNb=aLP.Extent();
  }
}

Here is the call graph for this function:

void GEOMAlgo_FinderShapeOn2::InnerPoints ( const TopoDS_Edge &  aE,
const Standard_Integer  aNbPnts,
GEOMAlgo_ListOfPnt aLP 
) [protected]

Definition at line 803 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  // try to fill it yourself
  Standard_Boolean bInf1, bInf2;
  Standard_Integer j, aNbT;
  Standard_Real dT, aT, aT1, aT2;
  gp_Pnt aP;
  Handle(Geom_Curve) aC3D;
  //
  aC3D=BRep_Tool::Curve(aE, aT1, aT2);
  if (aC3D.IsNull()) {
    return;
  }
  //
  bInf1=Precision::IsNegativeInfinite(aT1);
  bInf2=Precision::IsPositiveInfinite(aT2);
  if (bInf1 || bInf2) {
    return;
  }
  //
  aNbT=myNbPntsMin+1;
  dT=(aT2-aT1)/aNbT;
  for (j=1; j<=aNbPntsMin; ++j) {
    aT=aT1+j*dT;
    aC3D->D0(aT, aP);
    aLP.Append(aP);
  }
}

Here is the call graph for this function:

Definition at line 187 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  return myMSS;
}
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMax ( ) const

Definition at line 179 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  return myNbPntsMax;
}
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMin ( ) const

Definition at line 163 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  return myNbPntsMin;
}

Reimplemented from GEOMAlgo_ShapeAlgo.

Definition at line 216 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  myWarningStatus=0;
  myLS.Clear();
  myMSS.Clear();
  //
  CheckData();
  if(myErrorStatus) {
    return;
  }
  //
  // Initialize the context
  GEOMAlgo_ShapeAlgo::Perform();
  //
  myClsf->SetTolerance(myTolerance);
  //
  // 1
  ProcessVertices();
  if(myErrorStatus) {
    return;
  }
  if (myShapeType==TopAbs_VERTEX) {
    return;
  }
  //
  // 2
  ProcessEdges();
  if(myErrorStatus) {
    return;
  }
  if (myShapeType==TopAbs_EDGE) {
    return;
  }
  //
  // 3
  ProcessFaces();
  if(myErrorStatus) {
    return;
  }
  if (myShapeType==TopAbs_FACE) {
    return;
  }
  //
  // 4
  ProcessSolids();
  //
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 350 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState, bIsToBreak;
  Standard_Integer i, aNb, iCnt, iErr;
  TopAbs_State aSt;
  TopTools_IndexedMapOfShape aM;
  TopExp_Explorer aExp;
  GEOMAlgo_ListIteratorOfListOfPnt aIt;
  //
  TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
  aNb=aM.Extent();
  for (i=1; i<=aNb; ++i) {
    GEOMAlgo_ListOfPnt aLP;
    GEOMAlgo_StateCollector aSC;
    //
    const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
    //
    aExp.Init(aE, TopAbs_VERTEX);
    for (; aExp.More(); aExp.Next()) {
      const TopoDS_Shape& aV=aExp.Current();
      //
      bIsConformState=myMSS.Contains(aV);
      if (!bIsConformState) {
        break;// vertex has non-conformed state
      }
      else {
        aSt=myMSS.FindFromKey(aV);
        aSC.AppendState(aSt);
      }
    }
    //
    if (!bIsConformState) {
      continue; // vertex has non-conformed state,skip edge
    }
    //
    if (BRep_Tool::Degenerated(aE)) {
      myMSS.Add(aE, aSt);
      continue;
    }
    //
    if (myState==GEOMAlgo_ST_ON) {
      Standard_Boolean bCanBeON;
      Standard_Real aT1, aT2;
      Handle(Geom_Curve) aC;
      //
      aC=BRep_Tool::Curve(aE, aT1, aT2);
      bCanBeON=myClsf->CanBeON(aC);
      if(!bCanBeON) {
        continue;
      }
    }
    //
    InnerPoints(aE, aLP);
    if (myErrorStatus) {
      return;
    }
    //
    bIsConformState=Standard_True;
    aIt.Initialize(aLP);
    for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
      if (myNbPntsMax) {
        if (iCnt > myNbPntsMax) {
          break;
        }
      }
      //
      const gp_Pnt& aP=aIt.Value();
      //
      myClsf->SetPnt(aP);
      myClsf->Perform();
      iErr=myClsf->ErrorStatus();
      if (iErr) {
        myErrorStatus=40; // point can not be classified
        return;
      }
      //
      aSt=myClsf->State();
      //
      bIsToBreak=aSC.AppendState(aSt);
      if (bIsToBreak) {
        break;
      }
    }
    //
    aSt=aSC.State();
    //
    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
    if (myShapeType==TopAbs_EDGE) {
      if (bIsConformState) {
        myMSS.Add(aE, aSt);
      }
    }
    else if (bIsConformState || aSt==TopAbs_ON) {
      myMSS.Add(aE, aSt);
    }
  } //  for (i=1; i<=aNb; ++i) next edge
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 453 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState, bIsToBreak, bCanBeON;
  Standard_Integer i, aNbF, iCnt, iErr;
  TopAbs_State aSt;
  TopTools_IndexedMapOfShape aM;
  TopExp_Explorer aExp;
  GEOMAlgo_ListIteratorOfListOfPnt aIt;
  //
  TopExp::MapShapes(myShape, TopAbs_FACE, aM);
  aNbF=aM.Extent();
  for (i=1; i<=aNbF; ++i) {
    GEOMAlgo_StateCollector aSC;
    GEOMAlgo_ListOfPnt aLP;
    //
    const TopoDS_Face& aF=TopoDS::Face(aM(i));
    //
    if (myState==GEOMAlgo_ST_ON) {
      Handle(Geom_Surface) aS;
      //
      aS=BRep_Tool::Surface(aF);
      bCanBeON=myClsf->CanBeON(aS);
      if(!bCanBeON) {
        continue;
      }
    }
    //
    aExp.Init(aF, TopAbs_EDGE);
    for (; aExp.More(); aExp.Next()) {
      const TopoDS_Shape& aE=aExp.Current();
      bIsConformState=myMSS.Contains(aE);
      if (!bIsConformState) {
        break;// edge has non-conformed state
      }
      else {
        aSt=myMSS.FindFromKey(aE);
        aSC.AppendState(aSt);
      }
    }
    //
    if (!bIsConformState) {
      continue; // edge has non-conformed state,skip face
    }
    //
    InnerPoints(aF, aLP);
    if (myErrorStatus) {
      return;
    }
    //
    bIsConformState=Standard_True;
    aIt.Initialize(aLP);
    for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
      if (myNbPntsMax) {
        if (iCnt > myNbPntsMax) {
          break;
        }
      }
      //
      const gp_Pnt& aP=aIt.Value();
      //
      myClsf->SetPnt(aP);
      myClsf->Perform();
      iErr=myClsf->ErrorStatus();
      if (iErr) {
        myErrorStatus=40; // point can not be classified
        return;
      }
      //
      aSt=myClsf->State();
      //
      bIsToBreak=aSC.AppendState(aSt);
      if (bIsToBreak) {
        break;
      }
    }
    //
    aSt=aSC.State();
    //
    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
    if (myShapeType==TopAbs_FACE) {
      if (bIsConformState) {
        myMSS.Add(aF, aSt);
      }
    }
    else if (bIsConformState || aSt==TopAbs_ON) {
      myMSS.Add(aF, aSt);
    }
  }//  for (i=1; i<=aNb; ++i) next face
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 548 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState;
  Standard_Integer i, aNbS, j, aNbF;
  TopTools_IndexedMapOfShape aM, aMF;
  TopAbs_State aSt;
  //
  TopExp::MapShapes(myShape, TopAbs_SOLID, aM);
  aNbS=aM.Extent();
  for (i=1; i<=aNbS; ++i) {
    GEOMAlgo_StateCollector aSC;
    //
    const TopoDS_Shape& aSd=aM(i);
    aMF.Clear();
    TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
    aNbF=aMF.Extent();
    for (j=1; j<=aNbF; ++j) {
      const TopoDS_Shape& aF=aMF(j);
      bIsConformState=myMSS.Contains(aF);
      if (!bIsConformState) {
        break;// face has non-conformed state
      }
      else {
        aSt=myMSS.FindFromKey(aF);
        aSC.AppendState(aSt);
      }
    }
    //
    if (!bIsConformState) {
      continue; // face has non-conformed state,skip solid
    }
    //
    aSt=aSC.State();
    //
    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
    if (bIsConformState) {
      myMSS.Add(aSd, aSt);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 309 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState;
  Standard_Integer i, aNb, iErr;
  gp_Pnt aP;
  TopTools_IndexedMapOfShape aM;
  TopAbs_State aSt;
  //
  TopExp::MapShapes(myShape, TopAbs_VERTEX, aM);
  aNb=aM.Extent();
  for (i=1; i<=aNb; ++i) {
    const TopoDS_Vertex& aV=TopoDS::Vertex(aM(i));
    aP=BRep_Tool::Pnt(aV);
    //
    myClsf->SetPnt(aP);
    myClsf->Perform();
    iErr=myClsf->ErrorStatus();
    if (iErr) {
      myErrorStatus=40; // point can not be classified
      return;
    }
    //
    aSt=myClsf->State();
    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
    //
    if (myShapeType==TopAbs_VERTEX){
      if (bIsConformState) {
        myMSS.Add(aV, aSt);
      }
    }
    else if (bIsConformState || aSt==TopAbs_ON) {
      myMSS.Add(aV, aSt);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const TopoDS_Shape & GEOMAlgo_ShapeAlgo::Result ( ) const [inherited]

Definition at line 101 of file GEOMAlgo_ShapeAlgo.cxx.

{
  return myResult;
}

Definition at line 107 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myClsf=aClsf;
}

Here is the caller graph for this function:

void GEOMAlgo_ShapeAlgo::SetContext ( const Handle(IntTools_Context)&  theContext) [inherited]

Sets cashed geometrical tools

Definition at line 53 of file GEOMAlgo_ShapeAlgo.cxx.

{
  myContext=theContext;
}
void GEOMAlgo_FinderShapeOn2::SetNbPntsMax ( const Standard_Integer  aNb)

Definition at line 171 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myNbPntsMax=aNb;
}
void GEOMAlgo_FinderShapeOn2::SetNbPntsMin ( const Standard_Integer  aNb)

Definition at line 155 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myNbPntsMin=aNb;
}
void GEOMAlgo_ShapeAlgo::SetShape ( const TopoDS_Shape &  aS) [inherited]

Definition at line 69 of file GEOMAlgo_ShapeAlgo.cxx.

{
  myShape=aS;
}

Here is the caller graph for this function:

void GEOMAlgo_FinderShapeOn2::SetShapeType ( const TopAbs_ShapeEnum  aST)

Definition at line 123 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myShapeType=aType;
}

Here is the caller graph for this function:

Definition at line 139 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  myState=aState;
}

Here is the caller graph for this function:

void GEOMAlgo_ShapeAlgo::SetTolerance ( const Standard_Real  aT) [inherited]

Definition at line 85 of file GEOMAlgo_ShapeAlgo.cxx.

{
  myTolerance=aT;
}

Here is the caller graph for this function:

const TopoDS_Shape & GEOMAlgo_ShapeAlgo::Shape ( ) const [inherited]

Definition at line 77 of file GEOMAlgo_ShapeAlgo.cxx.

{
  return myShape;
}
const TopTools_ListOfShape & GEOMAlgo_FinderShapeOn2::Shapes ( ) const

Definition at line 195 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  Standard_Integer i, aNb;
  TopTools_ListOfShape* pL;
  //
  pL=(TopTools_ListOfShape*) &myLS;
  pL->Clear();
  //
  aNb=myMSS.Extent();
  for (i=1; i<=aNb; ++i) {
    const TopoDS_Shape& aS=myMSS.FindKey(i);
    if (aS.ShapeType()==myShapeType) {
      pL->Append(aS);
    }
  }
  return myLS;
}

Here is the caller graph for this function:

TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn2::ShapeType ( ) const

Definition at line 131 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  return myShapeType;
}

Definition at line 147 of file GEOMAlgo_FinderShapeOn2.cxx.

{
  return myState;
}
Standard_Real GEOMAlgo_ShapeAlgo::Tolerance ( ) const [inherited]

Definition at line 93 of file GEOMAlgo_ShapeAlgo.cxx.

{
  return myTolerance;
}

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

Handle_GEOMAlgo_Clsf GEOMAlgo_FinderShapeOn2::myClsf [protected]

Definition at line 131 of file GEOMAlgo_FinderShapeOn2.hxx.

Standard_Boolean GEOMAlgo_Algo::myComputeInternalShapes [protected, inherited]

Definition at line 73 of file GEOMAlgo_Algo.hxx.

Handle_IntTools_Context GEOMAlgo_ShapeAlgo::myContext [protected, inherited]

Definition at line 83 of file GEOMAlgo_ShapeAlgo.hxx.

Standard_Integer GEOMAlgo_Algo::myErrorStatus [protected, inherited]

Definition at line 71 of file GEOMAlgo_Algo.hxx.

TopTools_ListOfShape GEOMAlgo_FinderShapeOn2::myLS [protected]

Definition at line 132 of file GEOMAlgo_FinderShapeOn2.hxx.

Definition at line 133 of file GEOMAlgo_FinderShapeOn2.hxx.

Standard_Integer GEOMAlgo_FinderShapeOn2::myNbPntsMax [protected]

Definition at line 130 of file GEOMAlgo_FinderShapeOn2.hxx.

Standard_Integer GEOMAlgo_FinderShapeOn2::myNbPntsMin [protected]

Definition at line 129 of file GEOMAlgo_FinderShapeOn2.hxx.

TopoDS_Shape GEOMAlgo_ShapeAlgo::myResult [protected, inherited]

Definition at line 82 of file GEOMAlgo_ShapeAlgo.hxx.

TopoDS_Shape GEOMAlgo_ShapeAlgo::myShape [protected, inherited]

Definition at line 80 of file GEOMAlgo_ShapeAlgo.hxx.

TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn2::myShapeType [protected]

Definition at line 127 of file GEOMAlgo_FinderShapeOn2.hxx.

Definition at line 128 of file GEOMAlgo_FinderShapeOn2.hxx.

Standard_Real GEOMAlgo_ShapeAlgo::myTolerance [protected, inherited]

Definition at line 81 of file GEOMAlgo_ShapeAlgo.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: