Back to index

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

#include <GEOMAlgo_FinderShapeOnQuad.hxx>

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

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_FinderShapeOnQuad (const gp_Pnt &theTopLeftPoint, const gp_Pnt &theTopRigthPoint, const gp_Pnt &theBottomLeftPoint, const gp_Pnt &theBottomRigthPoint)
Standard_EXPORT void SetSurface (const Handle(Geom_Surface)&aS)
Standard_EXPORT void SetShapeType (const TopAbs_ShapeEnum aST)
Standard_EXPORT void SetState (const GEOMAlgo_State aSF)
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
Standard_EXPORT const
Handle_Geom_Surface & 
Surface () const
Standard_EXPORT TopAbs_ShapeEnum ShapeType () const
Standard_EXPORT GEOMAlgo_State State () 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 void CheckData ()
virtual TopAbs_State GetPointState (const gp_Pnt &aP)
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

Handle_Geom_Surface mySurface
TopAbs_ShapeEnum myShapeType
GEOMAlgo_State myState
Standard_Integer myNbPntsMin
Standard_Integer myNbPntsMax
GeomAdaptor_Surface myGAS
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

Private Attributes

bool myConcaveQuad
std::vector< bool > myConcaveSide
std::vector< gp_Pnt > myPoints
std::vector< GeomAdaptor_Surface > myPlanes
gp_Vec myQuadNormal

Detailed Description

Definition at line 37 of file GEOMAlgo_FinderShapeOnQuad.hxx.


Constructor & Destructor Documentation

GEOMAlgo_FinderShapeOnQuad::GEOMAlgo_FinderShapeOnQuad ( const gp_Pnt &  theTopLeftPoint,
const gp_Pnt &  theTopRigthPoint,
const gp_Pnt &  theBottomLeftPoint,
const gp_Pnt &  theBottomRigthPoint 
)

Definition at line 35 of file GEOMAlgo_FinderShapeOnQuad.cxx.

{
  myPoints.resize(6);
  myPoints[0] = theTopLeftPoint    ;
  myPoints[1] = theTopRigthPoint   ;
  myPoints[2] = theBottomRigthPoint;
  myPoints[3] = theBottomLeftPoint ;
  myPoints[4] = myPoints[0];
  myPoints[5] = myPoints[1];

  // Find plane normal defined by corner points, it will be used to define a plane
  // for each quadrangle side.
  myQuadNormal.SetCoord (0,0,0);
  for ( int i = 1; i <= 4; ++i )
    myQuadNormal += gp_Vec( myPoints[i], myPoints[i+1] ) ^ gp_Vec( myPoints[i], myPoints[i-1] );
  //std::cout<<std::endl<<" X Vec : "<<myQuadNormal.X()<<" "<<myQuadNormal.Y()<<" "<<myQuadNormal.Z()<<" "<<endl;

  if ( myQuadNormal.SquareMagnitude() <= DBL_MIN ) {
    myErrorStatus = 101;
    return;
  }

  // detect concave quadrangle sides
  myConcaveQuad = false;
  myConcaveSide.resize (4, false);
  for ( int i = 1; i <= 4; ++i ) {
    gp_Vec localQN = gp_Vec( myPoints[i], myPoints[i+1] ) ^ gp_Vec( myPoints[i], myPoints[i-1] );
    if ( myQuadNormal * localQN < 0 )
      myConcaveSide[i-1] = myConcaveSide[i] = myConcaveQuad = true;
  }

  // loop on quadrangle sides
  myPlanes.reserve( 4 );
  for ( int i = 0; i < 4; ++i )
  {
    // point1 -> point2 vector
    gp_Vec aSideVec( myPoints[ i ], myPoints[ i + 1 ]);
    //std::cout<<" Y Vec : "<<aSideVec.X()<<" "<<aSideVec.Y()<<" "<<aSideVec.Z()<<" "<<endl;

    // plane normal
    gp_Vec aSideNorm = aSideVec ^ myQuadNormal;
    if ( aSideNorm.SquareMagnitude() <= DBL_MIN )
      continue;
    //std::cout<<" Z Vec : "<<aSideNorm.X()<<" "<<aSideNorm.Y()<<" "<<aSideNorm.Z()<<" "<<endl;

    // make plane
    Handle(Geom_Plane) aPlane = new Geom_Plane( myPoints[ i ], aSideNorm );
    myPlanes.push_back( GeomAdaptor_Surface() );
    myPlanes.back().Load( aPlane );
  }
}

Here is the call graph for this function:


Member Function Documentation

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

Reimplemented from GEOMAlgo_FinderShapeOn1.

Definition at line 95 of file GEOMAlgo_FinderShapeOnQuad.cxx.

Here is the call graph for this function:

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_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:

TopAbs_State GEOMAlgo_FinderShapeOnQuad::GetPointState ( const gp_Pnt &  aP) [protected, virtual]

Reimplemented from GEOMAlgo_FinderShapeOn1.

Definition at line 107 of file GEOMAlgo_FinderShapeOnQuad.cxx.

{
  // Return IN if aP has TopAbs_IN with all sides.
  // In the case of concave quadrangle, return IN if
  // aP is OUT of only one concave side
  double nbIn = 0.;
  for ( int i = 0; i < myPlanes.size(); ++i )
  {
    TopAbs_State aSt;
    GEOMAlgo_SurfaceTools::GetState(aP, myPlanes[i], myTolerance, aSt);
    if ( aSt == TopAbs_IN )
    {
      nbIn += myConcaveSide[i] ? 0.5 : 1.0;
    }
    else if ( aSt == TopAbs_ON )
    {
      // check that aP is between quadrangle corners
      Handle(Geom_Plane) aSidePlane = Handle(Geom_Plane)::DownCast( myPlanes[i].Surface() );
      gp_Vec aSideNorm = aSidePlane->Axis().Direction();
      gp_Vec aSideVec = myQuadNormal ^ aSideNorm;
      gp_Vec c1p ( myPoints[i], aP );
      gp_Vec pc2 ( aP, myPoints[i+1] );
      if ( aSideVec * c1p >= 0. && aSideVec * pc2 >= 0. )
        return TopAbs_ON;
      // consider to be IN (???????????)
      //nbIn += myConcaveSide[i] ? 0.5 : 1.0;
    }
  }
  Standard_Real inThreshold = myPlanes.size(); // usually 4.0
  if ( myConcaveQuad )
    inThreshold = 2.5; // 1.0 + 1.0 + 0.5

  if ( nbIn >= inThreshold )
    return TopAbs_IN;

  return TopAbs_OUT;
}

Here is the call graph for this function:

void GEOMAlgo_FinderShapeOn1::InnerPoints ( const TopoDS_Face &  aF,
GEOMAlgo_ListOfPnt aLP 
) [protected, inherited]

Definition at line 534 of file GEOMAlgo_FinderShapeOn1.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();
      //
      aNx=(Standard_Integer)aPK.Id(1);
      aMBN.Add(aNx);
      aNx=(Standard_Integer)aPK.Id(2);
      aMBN.Add(aNx);
    }
  }
  //
  // 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();
          //
          aN1=(Standard_Integer)aPK.Id(1);
          aN2=(Standard_Integer)aPK.Id(2);
          //
          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_FinderShapeOn1::InnerPoints ( const TopoDS_Edge &  aE,
GEOMAlgo_ListOfPnt aLP 
) [protected, inherited]

Definition at line 671 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  Standard_Integer aNbPntsMin;
  //
  myErrorStatus=0;
  aNbPntsMin=21;
  //
  aLP.Clear();
  InnerPoints(aE, aNbPntsMin, aLP);
}

Here is the call graph for this function:

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

Definition at line 687 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  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;
  }
  //
  //modified by NIZNHY-PKV Thu Jan 26 09:51:20 2012f
  /*
  aNbT=myNbPntsMin+1;
  dT=(aT2-aT1)/aNbT;
  for (j=1; j<=aNbPntsMin; ++j) {
    aT=aT1+j*dT;
    aC3D->D0(aT, aP);
    aLP.Append(aP);
  }
  */
  aNbT=aNbPntsMin+1;
  dT=(aT2-aT1)/aNbT;
  for (j=1; j<aNbT; ++j) {
    aT=aT1+j*dT;
    aC3D->D0(aT, aP);
    aLP.Append(aP);
  }
  //modified by NIZNHY-PKV Thu Jan 26 09:51:24 2012t
}

Here is the call graph for this function:

Definition at line 186 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  return myMSS;
}
Standard_Integer GEOMAlgo_FinderShapeOn1::NbPntsMax ( ) const [inherited]

Definition at line 178 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  return myNbPntsMax;
}
Standard_Integer GEOMAlgo_FinderShapeOn1::NbPntsMin ( ) const [inherited]

Definition at line 162 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  return myNbPntsMin;
}
void GEOMAlgo_FinderShapeOn1::Perform ( ) [virtual, inherited]

Reimplemented from GEOMAlgo_ShapeAlgo.

Definition at line 215 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myErrorStatus=0;
  myWarningStatus=0;
  myLS.Clear();
  myMSS.Clear();
  //
  CheckData();
  if(myErrorStatus) {
    return;
  }
  //
  // Initialize the context
  GEOMAlgo_ShapeAlgo::Perform();
  //
  // 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:

void GEOMAlgo_FinderShapeOn1::ProcessEdges ( ) [protected, inherited]

Definition at line 298 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState, bIsToBreak;
  Standard_Integer i, aNb, iCnt;
  TopAbs_State aSt;
  TopTools_IndexedMapOfShape aM;
  TopExp_Explorer aExp;
  GEOMAlgo_ListIteratorOfListOfPnt aIt;
  GeomAbs_SurfaceType aType1;
  //
  aType1=myGAS.GetType();
  //
  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 && aType1==GeomAbs_Sphere) {
      Standard_Real aT1, aT2;
      Handle(Geom_Curve) aC;
      GeomAdaptor_Curve aGAC;
      GeomAbs_CurveType aType2;
      //
      aC=BRep_Tool::Curve(aE, aT1, aT2);
      aGAC.Load(aC);
      //
      aType2=aGAC.GetType();
      if (aType2==GeomAbs_Line) {
        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();
      aSt = GetPointState( aP );
      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:

void GEOMAlgo_FinderShapeOn1::ProcessFaces ( ) [protected, inherited]

Definition at line 397 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState, bIsToBreak;
  Standard_Integer i, aNbF, iCnt;
  TopAbs_State aSt;
  TopTools_IndexedMapOfShape aM;
  TopExp_Explorer aExp;
  GEOMAlgo_ListIteratorOfListOfPnt aIt;
  GeomAbs_SurfaceType aType1, aType2;
  //
  aType1=myGAS.GetType();
  //
  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;
      GeomAdaptor_Surface aGAS;
      //
      aS=BRep_Tool::Surface(aF);
      aGAS.Load(aS);
      aType2=aGAS.GetType();
      if (aType2!=aType1) {
        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();
      aSt = GetPointState( aP );
      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:

void GEOMAlgo_FinderShapeOn1::ProcessSolids ( ) [protected, inherited]

Definition at line 487 of file GEOMAlgo_FinderShapeOn1.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:

void GEOMAlgo_FinderShapeOn1::ProcessVertices ( ) [protected, inherited]

Definition at line 265 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsConformState;
  Standard_Integer i, aNb;
  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);
    //
    aSt = GetPointState( aP );
    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;
}
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_FinderShapeOn1::SetNbPntsMax ( const Standard_Integer  aNb) [inherited]

Definition at line 170 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myNbPntsMax=aNb;
}
void GEOMAlgo_FinderShapeOn1::SetNbPntsMin ( const Standard_Integer  aNb) [inherited]

Definition at line 154 of file GEOMAlgo_FinderShapeOn1.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_FinderShapeOn1::SetShapeType ( const TopAbs_ShapeEnum  aST) [inherited]

Definition at line 122 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myShapeType=aType;
}
void GEOMAlgo_FinderShapeOn1::SetState ( const GEOMAlgo_State  aSF) [inherited]

Definition at line 138 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  myState=aState;
}
void GEOMAlgo_FinderShapeOn1::SetSurface ( const Handle(Geom_Surface)&  aS) [inherited]

Definition at line 106 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  mySurface=aS;
}
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_FinderShapeOn1::Shapes ( ) const [inherited]

Definition at line 194 of file GEOMAlgo_FinderShapeOn1.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;
}
TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn1::ShapeType ( ) const [inherited]

Definition at line 130 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  return myShapeType;
}

Definition at line 146 of file GEOMAlgo_FinderShapeOn1.cxx.

{
  return myState;
}
Standard_EXPORT const Handle_Geom_Surface& GEOMAlgo_FinderShapeOn1::Surface ( ) const [inherited]

Here is the caller graph for this function:

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

Standard_Boolean GEOMAlgo_Algo::myComputeInternalShapes [protected, inherited]

Definition at line 73 of file GEOMAlgo_Algo.hxx.

Definition at line 55 of file GEOMAlgo_FinderShapeOnQuad.hxx.

std::vector<bool> GEOMAlgo_FinderShapeOnQuad::myConcaveSide [private]

Definition at line 56 of file GEOMAlgo_FinderShapeOnQuad.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.

GeomAdaptor_Surface GEOMAlgo_FinderShapeOn1::myGAS [protected, inherited]

Definition at line 141 of file GEOMAlgo_FinderShapeOn1.hxx.

TopTools_ListOfShape GEOMAlgo_FinderShapeOn1::myLS [protected, inherited]

Definition at line 142 of file GEOMAlgo_FinderShapeOn1.hxx.

Definition at line 143 of file GEOMAlgo_FinderShapeOn1.hxx.

Standard_Integer GEOMAlgo_FinderShapeOn1::myNbPntsMax [protected, inherited]

Definition at line 140 of file GEOMAlgo_FinderShapeOn1.hxx.

Standard_Integer GEOMAlgo_FinderShapeOn1::myNbPntsMin [protected, inherited]

Definition at line 139 of file GEOMAlgo_FinderShapeOn1.hxx.

std::vector<GeomAdaptor_Surface> GEOMAlgo_FinderShapeOnQuad::myPlanes [private]

Definition at line 58 of file GEOMAlgo_FinderShapeOnQuad.hxx.

std::vector<gp_Pnt> GEOMAlgo_FinderShapeOnQuad::myPoints [private]

Definition at line 57 of file GEOMAlgo_FinderShapeOnQuad.hxx.

Definition at line 59 of file GEOMAlgo_FinderShapeOnQuad.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_FinderShapeOn1::myShapeType [protected, inherited]

Definition at line 137 of file GEOMAlgo_FinderShapeOn1.hxx.

Definition at line 138 of file GEOMAlgo_FinderShapeOn1.hxx.

Handle_Geom_Surface GEOMAlgo_FinderShapeOn1::mySurface [protected, inherited]

Definition at line 136 of file GEOMAlgo_FinderShapeOn1.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: