Back to index

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

#include <GEOMAlgo_ShapeInfoFiller.hxx>

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

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_ShapeInfoFiller ()
virtual Standard_EXPORT ~GEOMAlgo_ShapeInfoFiller ()
Standard_EXPORT void SetShape (const TopoDS_Shape &aS)
Standard_EXPORT const
TopoDS_Shape & 
Shape () const
Standard_EXPORT void SetTolerance (const Standard_Real aT)
Standard_EXPORT Standard_Real Tolerance () const
Standard_EXPORT const
GEOMAlgo_ShapeInfo
Info () const
Standard_EXPORT const
GEOMAlgo_ShapeInfo
Info (const TopoDS_Shape &aS) const
virtual Standard_EXPORT void Perform ()
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 FillNbSubShapes (const TopoDS_Shape &aS, GEOMAlgo_ShapeInfo &aInfo)
Standard_EXPORT void FillSubShapes (const TopoDS_Shape &aS)
Standard_EXPORT void FillShape (const TopoDS_Shape &aS)
Standard_EXPORT void FillVertex (const TopoDS_Shape &aS)
Standard_EXPORT void FillEdge (const TopoDS_Shape &aS)
Standard_EXPORT void FillFace (const TopoDS_Shape &aS)
Standard_EXPORT void FillSolid (const TopoDS_Shape &aS)
Standard_EXPORT void FillContainer (const TopoDS_Shape &aS)
Standard_EXPORT void FillDetails (const TopoDS_Face &aF, const gp_Pln &aPln)
Standard_EXPORT void FillDetails (const TopoDS_Face &aF, const gp_Sphere &aSph)
Standard_EXPORT void FillDetails (const TopoDS_Face &aF, const gp_Cylinder &aCyl)
Standard_EXPORT void FillDetails (const TopoDS_Face &aF, const gp_Cone &aCone)
Standard_EXPORT void FillDetails (const TopoDS_Face &aF, const gp_Torus &aTorus)
Standard_EXPORT void FillDetails (const TopoDS_Solid &aS)
virtual Standard_EXPORT void CheckResult ()

Protected Attributes

TopoDS_Shape myShape
GEOMAlgo_ShapeInfo myEmptyInfo
GEOMAlgo_IndexedDataMapOfShapeShapeInfo myMapInfo
Standard_Real myTolerance
Standard_Integer myErrorStatus
Standard_Integer myWarningStatus
Standard_Boolean myComputeInternalShapes

Detailed Description

Definition at line 41 of file GEOMAlgo_ShapeInfoFiller.hxx.


Constructor & Destructor Documentation

Definition at line 73 of file GEOMAlgo_ShapeInfoFiller.cxx.

:
  GEOMAlgo_Algo()
{
  myTolerance=0.0001;
}

Definition at line 83 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
}

Member Function Documentation

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

Reimplemented from GEOMAlgo_Algo.

Definition at line 145 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  if (myShape.IsNull()) {
    myErrorStatus=10;
    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.

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_ShapeInfoFiller::FillContainer ( const TopoDS_Shape &  aS) [protected]

Definition at line 227 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsClosed;
  TopAbs_ShapeEnum aType;
  GEOMAlgo_KindOfClosed aKC;
  //
  aType=aS.ShapeType();
  //----------------------------------------------------
  if (myMapInfo.Contains(aS)) {
    return;
  }
  else {
    GEOMAlgo_ShapeInfo aInfoX;
    myMapInfo.Add(aS, aInfoX);
  }
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
  //----------------------------------------------------
  aInfo.SetType(aType);
  FillNbSubShapes(aS, aInfo);
  //
  if (aType==TopAbs_SHELL) {
    bIsClosed=BRep_Tool::IsClosed(aS);
    aKC=(bIsClosed) ? GEOMAlgo_KC_CLOSED :GEOMAlgo_KC_NOTCLOSED;
    aInfo.SetKindOfClosed(aKC);
  }
  else if (aType==TopAbs_WIRE) {
    TopoDS_Wire aW;
    TopoDS_Vertex aV1, aV2;
    //
    aW=TopoDS::Wire(aS);
    TopExp::Vertices(aW, aV1, aV2);
    //
    bIsClosed=aV1.IsSame(aV2);
    aKC=(bIsClosed) ? GEOMAlgo_KC_CLOSED :GEOMAlgo_KC_NOTCLOSED;
    aInfo.SetKindOfClosed(aKC);
  }
  //
  FillSubShapes(aS);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillDetails ( const TopoDS_Face &  aF,
const gp_Pln &  aPln 
) [protected]

Definition at line 272 of file GEOMAlgo_ShapeInfoFiller_1.cxx.

{
  Standard_Integer aNbV, aNbE, i, j;
  Standard_Real aDot, aD0, aD1, aLength, aWidth;
  gp_Dir aDx[4], aDX;
  gp_Pnt aPx[4], aP, aPc;
  gp_XYZ aXYZc;
  TopExp_Explorer aExp;
  TopoDS_Shape aE;
  TopoDS_Wire aW;
  TopoDS_Edge aEx;
  TopoDS_Iterator aIt;
  TopTools_IndexedMapOfShape aMV;
  BRepTools_WireExplorer aWExp;
  GEOMAlgo_KindOfName aKN, aKNE;
  GEOMAlgo_KindOfShape aKS;
  //
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
  aKN=GEOMAlgo_KN_UNKNOWN;
  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
  //
  aKS=aInfo.KindOfShape();
  if (aKS!=GEOMAlgo_KS_PLANE) {
    return;
  }
  //
  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
    aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
    return;
  }
  //
  aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
  //
  // 1. may be it is circle/ellipse
  if (aNbV==1 && aNbE==1) {
    aExp.Init(aF, TopAbs_EDGE);
    for (; aExp.More(); aExp.Next()) {
      aE=aExp.Current();
      break;
    }
    //
    const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
    aKNE=aInfoE.KindOfName();
    if (aKNE==GEOMAlgo_KN_CIRCLE) {
      aKN=GEOMAlgo_KN_DISKCIRCLE;
      aInfo.SetKindOfName(aKN);
      aInfo.SetRadius1(aInfoE.Radius1());
      aInfo.SetLocation(aInfoE.Location());
      aInfo.SetPosition(aInfoE.Position());
    }
    if (aKNE==GEOMAlgo_KN_ELLIPSE) {
      aKN=GEOMAlgo_KN_DISKELLIPSE;
      aInfo.SetKindOfName(aKN);
      aInfo.SetRadius1(aInfoE.Radius1());
      aInfo.SetRadius2(aInfoE.Radius2());
      aInfo.SetLocation(aInfoE.Location());
      aInfo.SetPosition(aInfoE.Position());
    }
  }
  //
  // 2. may be it is rectangle
  else  {
    aExp.Init(aF, TopAbs_EDGE);
    for (; aExp.More(); aExp.Next()) {
      aE=aExp.Current();
      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
      aKNE=aInfoE.KindOfName();
      if (aKNE!=GEOMAlgo_KN_SEGMENT) {
        return;
      }
    }
    //
    aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
    //
    if (aNbV==3 && aNbE==3) {
      aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE);
      //
      aXYZc.SetCoord(0.,0.,0.);
      TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
      for (i=1; i<=aNbV; ++i) {
        const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
        aP=BRep_Tool::Pnt(aV);
        const gp_XYZ& aXYZ=aP.XYZ();
        aXYZc=aXYZc+aXYZ;
        aPx[i-1]=aP;
      }
      aXYZc.Divide(3.);
      //
      aPc.SetXYZ(aXYZc);
      gp_Vec aVX(aPc, aPx[0]);
      aVX.Normalize();
      aDX.SetXYZ(aVX.XYZ());
      const gp_Dir& aDZ=aPln.Axis().Direction();
      //
      gp_Ax2 aAx2(aPc, aDZ, aDX);
      gp_Ax3 aAx3(aAx2);
      //
      aInfo.SetLocation(aPc);
      aInfo.SetPosition(aAx3);
      //
      return;
    }
    //
    if (!(aNbV==4 && aNbE==4)) {
      return;
    }
    //
    // aNbV==4 && aNbE==4 and all edges are segments
    aIt.Initialize(aF);
    for (; aIt.More(); aIt.Next()){
      aW=TopoDS::Wire(aIt.Value());
      break;
    }
    //
    aWExp.Init(aW, aF);
    for (i=0; aWExp.More(); aWExp.Next(), ++i) {
      aEx=aWExp.Current();
      const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
      aDx[i]=aInfoEx.Direction();
      aPx[i]=aInfoEx.Location();
    }
    //
    for (i=0; i<4; ++i) {
      j=(i==3) ? 0 : i+1;
      aDot=aDx[i]*aDx[j];
      if (fabs (aDot) > myTolerance) {
        aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
        return;
      }
    }
    //
    // rectangle
    aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
    //
    // shift location to the center and calc. sizes
    aXYZc.SetCoord(0.,0.,0.);
    TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
    for (i=1; i<=aNbV; ++i) {
      const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
      aP=BRep_Tool::Pnt(aV);
      const gp_XYZ& aXYZ=aP.XYZ();
      aXYZc=aXYZc+aXYZ;
    }
    //
    // Location : aPc in center of rectangle
    // Position : 0z is plane normal
    //            0x is along length
    //
    aXYZc.Divide(4.);
    aPc.SetXYZ(aXYZc);
    //
    gp_Lin aL0(aPx[0], aDx[0]);
    gp_Lin aL1(aPx[1], aDx[1]);
    //
    aD0=aL0.Distance(aPc);
    aD1=aL1.Distance(aPc);
    //
    aLength=aD0;
    aWidth =aD1;
    aDX=aL1.Direction();
    if (aD0<aD1) {
      aLength=aD1;
      aWidth =aD0;
      aDX=aL0.Direction();
    }
    //
    aLength=2.*aLength;
    aWidth =2.*aWidth;
    //
    aInfo.SetLocation(aPc);
    aInfo.SetLength(aLength);
    aInfo.SetWidth(aWidth);
    //
    const gp_Dir& aDZ=aPln.Axis().Direction();
    gp_Ax2 aAx2(aPc, aDZ, aDX);
    gp_Ax3 aAx3(aAx2);
    aInfo.SetPosition(aAx3);
  }

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillDetails ( const TopoDS_Face &  aF,
const gp_Sphere &  aSph 
) [protected]

Definition at line 459 of file GEOMAlgo_ShapeInfoFiller_1.cxx.

{
  Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
  TopoDS_Edge aE;
  TopExp_Explorer aExp;
  TopTools_MapOfShape aM;
  GEOMAlgo_KindOfShape aKS, aKSE;
  //
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
  //
  aKS=aInfo.KindOfShape();
  if (aKS!=GEOMAlgo_KS_SPHERE) {
    return;
  }
  //
  aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
  if (!(aNbV==2 && aNbE==3)) {
    return;
  }
  //
  aNbSE=0;
  aNbDE=0;
  aExp.Init(aF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    aE=TopoDS::Edge(aExp.Current());
    if(aM.Add(aE)) {
      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
      aKSE=aInfoE.KindOfShape();
      //
      if (BRep_Tool::IsClosed(aE, aF)) {
        ++aNbSE;
      }
      else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
        ++aNbDE;
      }
    }
  }
  //
  if (!(aNbSE==1 && aNbDE==2)) {
    return;
  }
  aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
}

Here is the call graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillDetails ( const TopoDS_Face &  aF,
const gp_Cylinder &  aCyl 
) [protected]

Definition at line 638 of file GEOMAlgo_ShapeInfoFiller_1.cxx.

{
  Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
  Standard_Real aT0, aT1, aHeight;
  gp_Pnt aPC[3], aPc;
  TopoDS_Edge aE;
  TopExp_Explorer aExp;
  TopTools_MapOfShape aM;
  GEOMAlgo_KindOfShape aKS;
  GEOMAlgo_KindOfName aKN, aKNE;
  GEOMAlgo_KindOfClosed aKCE;
  //
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
  aKN=GEOMAlgo_KN_UNKNOWN;
  aInfo.SetKindOfName(aKN);
  //
  aKS=aInfo.KindOfShape();
  if (aKS!=GEOMAlgo_KS_CYLINDER) {
    return;
  }
  //
  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
    return;
  }
  //
  aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
  if (!(aNbV==2 && aNbE==3)) {
    return;
  }
  //
  i=0;
  aNbCE=0;
  aNbSE=0;
  aExp.Init(aF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    aE=TopoDS::Edge(aExp.Current());
    if(aM.Add(aE)) {
      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
      aKNE=aInfoE.KindOfName();
      aKCE=aInfoE.KindOfClosed();
      if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
        aPC[aNbCE]=aInfoE.Location();
        ++aNbCE;
      }
      else if (aKNE==GEOMAlgo_KN_SEGMENT) {
        if (BRep_Tool::IsClosed(aE, aF)) {
          ++aNbSE;
        }
      }
    }
  }
  //
  if (!(aNbCE==2 && aNbSE==1)) {
    return;
  }
  //
  const gp_Ax1& aAx1=aCyl.Axis();
  const gp_Dir& aDir=aAx1.Direction();
  const gp_Pnt& aPLoc=aAx1.Location();
  gp_Lin aLin(aPLoc, aDir);
  //
  aT0=ElCLib::Parameter(aLin, aPC[0]);
  aT1=ElCLib::Parameter(aLin, aPC[1]);
  //
  aPc=aPC[0];;
  if (aT0>aT1) {
    aPc=aPC[1];
  }
  aHeight=aPC[0].Distance(aPC[1]);
  //
  gp_Ax3 aAx3=aCyl.Position();
  aAx3.SetLocation(aPc);
  //
  aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
  aInfo.SetPosition(aAx3);
  aInfo.SetLocation(aPc);
  aInfo.SetHeight(aHeight);
}

Here is the call graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillDetails ( const TopoDS_Face &  aF,
const gp_Cone &  aCone 
) [protected]

Definition at line 509 of file GEOMAlgo_ShapeInfoFiller_1.cxx.

{
  Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
  Standard_Real aR[3], aHeight;
  gp_Pnt aPC[3], aPD, aPc, aPX[3];
  TopoDS_Vertex aVD;
  TopoDS_Edge aE;
  TopoDS_Iterator aIt;
  TopExp_Explorer aExp;
  TopTools_MapOfShape aM;
  GEOMAlgo_KindOfShape aKS, aKSE;
  GEOMAlgo_KindOfName aKN, aKNE;
  GEOMAlgo_KindOfClosed aKCE;
  //
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
  aKN=GEOMAlgo_KN_UNKNOWN;
  aInfo.SetKindOfName(aKN);
  //
  aKS=aInfo.KindOfShape();
  if (aKS!=GEOMAlgo_KS_CONE) {
    return;
  }
  //
  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
    return;
  }
  //
  aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
  if (!(aNbV==2 && aNbE==3)) {
    return;
  }
  //
  i=0;
  aNbCE=0;
  aNbSE=0;
  aNbDE=0;
  aExp.Init(aF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    aE=TopoDS::Edge(aExp.Current());
    if(aM.Add(aE)) {
      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
      aKNE=aInfoE.KindOfName();
      aKCE=aInfoE.KindOfClosed();
      aKSE=aInfoE.KindOfShape();
      if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
        aPC[i]=aInfoE.Location();
        aR[i]=aInfoE.Radius1();
        //
        aIt.Initialize(aE);
        for (; aIt.More(); aIt.Next()) {
          aVD=TopoDS::Vertex(aIt.Value());
          break;
        }
        aPX[i]=BRep_Tool::Pnt(aVD);
        //
        ++i;
        ++aNbCE;
      }
      else if (aKNE==GEOMAlgo_KN_SEGMENT) {
        if (BRep_Tool::IsClosed(aE, aF)) {
          ++aNbSE;
        }
      }
      else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
        aIt.Initialize(aE);
        for (; aIt.More(); aIt.Next()) {
          aVD=TopoDS::Vertex(aIt.Value());
          break;
        }
        //
        aPD=BRep_Tool::Pnt(aVD);
        //
        ++aNbDE;
      }
    }
  }
  //
  if (!((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1)) {
    return;
  }
  //
  if (aNbDE==1) {
    aPC[1]=aPD;
    aR[1]=0.;
  }
  //
  aHeight=aPC[0].Distance(aPC[1]);
  //
  Standard_Real aRmin, aRmax;
  gp_Ax2 aAx2new;
  //
  if (aR[0]>aR[1]) {
    aRmin=aR[1];
    aRmax=aR[0];
    aPc=aPC[0];
    gp_Vec aVz(aPC[0], aPC[1]);
    gp_Vec aVx(aPC[0], aPX[0]);
    gp_Dir aDz(aVz);
    gp_Dir aDx(aVx);
    gp_Ax2 aAx2(aPc, aDz, aDx);
    aAx2new=aAx2;
  }
  else {
    aRmin=aR[0];
    aRmax=aR[1];
    aPc=aPC[1];
    gp_Vec aVz(aPC[1], aPC[0]);
    gp_Vec aVx(aPC[1], aPX[1]);
    gp_Dir aDz(aVz);
    gp_Dir aDx(aVx);
    gp_Ax2 aAx2(aPc, aDz, aDx);
    aAx2new=aAx2;
  }
  //
  gp_Ax3 aAx3(aAx2new);
  aInfo.SetLocation(aPc);
  aInfo.SetPosition(aAx3);
  aInfo.SetRadius1(aRmax);
  aInfo.SetRadius2(aRmin);
  aInfo.SetHeight(aHeight);
  //
  aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
}

Here is the call graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillDetails ( const TopoDS_Face &  aF,
const gp_Torus &  aTorus 
) [protected]

Definition at line 723 of file GEOMAlgo_ShapeInfoFiller_1.cxx.

{
  Standard_Integer aNbV, aNbE, aNbSE;
  TopoDS_Edge aE;
  TopExp_Explorer aExp;
  TopTools_MapOfShape aM;
  GEOMAlgo_KindOfShape aKS;
  //
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
  //
  aKS=aInfo.KindOfShape();
  if (aKS!=GEOMAlgo_KS_TORUS) {
    return;
  }
  //
  aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
  if (!(aNbV==1 && aNbE==2)) {
    return;
  }
  //
  aNbSE=0;
  aExp.Init(aF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    aE=TopoDS::Edge(aExp.Current());
    if (aM.Add(aE)) {
      //const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
      if (BRep_Tool::IsClosed(aE, aF)) {
        ++aNbSE;
      }
    }
  }
  //
  if (aNbSE!=2) {
    return;
  }
  aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
}

Here is the call graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillDetails ( const TopoDS_Solid &  aS) [protected]

Definition at line 58 of file GEOMAlgo_ShapeInfoFiller_1.cxx.

{
  Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct, aNbCrc, aNbX;
  TopoDS_Shape aFCyl, aFCon;
  TopTools_IndexedMapOfShape aMF;
  GEOMAlgo_KindOfName aKNF;
  //
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd);
  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
  //
  TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
  //
  aNbF=aMF.Extent();
  if (!aNbF) {
    return;
  }
  //
  if (aNbF==1) {
    const TopoDS_Shape& aF=aMF(1);
    GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
    aKNF=aInfoF.KindOfName(); // mb: sphere, torus
    if (aKNF==GEOMAlgo_KN_SPHERE ||
        aKNF==GEOMAlgo_KN_TORUS) {
      aInfo.SetKindOfName(aKNF);
      aInfo.SetLocation(aInfoF.Location());
      aInfo.SetPosition(aInfoF.Position());
      aInfo.SetRadius1(aInfoF.Radius1());
      if(aKNF==GEOMAlgo_KN_TORUS) {
        aInfo.SetRadius2(aInfoF.Radius2());
      }
      return;
    }
  }
  //
  aNbCyl=0;
  aNbCon=0;
  aNbPgn=0;
  aNbRct=0;
  aNbCrc=0;
  for (i=1; i<=aNbF; ++i) {
    const TopoDS_Shape& aF=aMF(i);
    GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
    aKNF=aInfoF.KindOfName();
    if (aKNF==GEOMAlgo_KN_CYLINDER) {
      aFCyl=aF;
      ++aNbCyl;
    }
    else if (aKNF==GEOMAlgo_KN_CONE) {
      aFCon=aF;
      ++aNbCon;
    }
    else if (aKNF==GEOMAlgo_KN_DISKCIRCLE) {
      ++aNbCrc;
    }
    else if (aKNF==GEOMAlgo_KN_POLYGON ||
            aKNF==GEOMAlgo_KN_TRIANGLE ||
            aKNF==GEOMAlgo_KN_QUADRANGLE) {
      ++aNbPgn;
    }
    else if (aKNF==GEOMAlgo_KN_RECTANGLE) {
      ++aNbPgn;
      ++aNbRct;
    }
  }
  //
  aNbX=aNbCyl+aNbCrc;
  if (aNbCyl==1 && aNbCrc==2 && aNbX==aNbF) {
    // cylinder (as they understand it)
    GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aFCyl);
    aKNF=aInfoF.KindOfName();
    aInfo.SetKindOfName(aKNF);
    aInfo.SetLocation(aInfoF.Location());
    aInfo.SetPosition(aInfoF.Position());
    aInfo.SetRadius1(aInfoF.Radius1());
    aInfo.SetHeight(aInfoF.Height());
    return;
  }
  //
  aNbX=aNbCon+aNbCrc;
  if (aNbCon==1 && (aNbCrc==1 || aNbCrc==2) && aNbX==aNbF) {
    // cone
    GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aFCon);
    aKNF=aInfoF.KindOfName();
    aInfo.SetKindOfName(aKNF);
    aInfo.SetLocation(aInfoF.Location());
    aInfo.SetPosition(aInfoF.Position());
    aInfo.SetRadius1(aInfoF.Radius1());
    aInfo.SetRadius2(aInfoF.Radius2());
    aInfo.SetHeight(aInfoF.Height());
    return;
  }
  //
  //modified by NIZNHY-PKV Wed Jan 11 11:04:31 2012f
  if (aNbF!=aNbPgn) {
    return;// -> GEOMAlgo_KN_UNKNOWN
  }
  //modified by NIZNHY-PKV Wed Jan 11 11:04:37 2012t
  if (aNbPgn!=6) {
    aInfo.SetKindOfName(GEOMAlgo_KN_POLYHEDRON);
    return;
  }
  // aNbPgn==6
  if (aNbPgn!=aNbRct) {
    aInfo.SetKindOfName(GEOMAlgo_KN_POLYHEDRON);
    return;
  }
  //===================================================
  // aNbRct=6;
  // box
  Standard_Integer j, aNbFi, aNbV, iMax, iMin, iMid;
  Standard_Real aDot, aLength, aWidth, aHeight, aDist[3];
  Standard_Real aDistMin, aDistMax;
  gp_Pnt aPi, aPc;
  gp_Dir aDir[3];
  gp_XYZ aXYZc;
  TColStd_IndexedMapOfInteger aMp;
  TopTools_IndexedMapOfShape aMV, aMFi;
  //
  // barycenter aPc
  TopExp::MapShapes(aSd, TopAbs_VERTEX, aMV);
  aNbV=aMV.Extent();
  if (aNbV!=8) {
    return;
  }
  //
  aXYZc.SetCoord(0.,0.,0.);
  for (i=1; i<=aNbV; ++i) {
    const TopoDS_Vertex& aVi=TopoDS::Vertex(aMV(i));
    aPi=BRep_Tool::Pnt(aVi);
    const gp_XYZ& aXYZ=aPi.XYZ();
    aXYZc=aXYZc+aXYZ;
  }
  //
  aXYZc.Divide(aNbV);
  aPc.SetXYZ(aXYZc);
  //
  // 3 faces
  for (i=1; i<=aNbF; ++i) {
    if (aMp.Contains(i)) {
      continue;
    }
    //
    const TopoDS_Shape& aFi=aMF(i);
    const GEOMAlgo_ShapeInfo& aIFi=myMapInfo.FindFromKey(aFi);
    const gp_Dir& aDNi=aIFi.Position().Direction();
    //
    for (j=i+1; j<=aNbF; ++j) {
      if (aMp.Contains(j)) {
        continue;
      }
      //
      const TopoDS_Shape& aFj=aMF(j);
      const GEOMAlgo_ShapeInfo& aIFj=myMapInfo.FindFromKey(aFj);
      const gp_Dir& aDNj=aIFj.Position().Direction();
      //
      aDot=aDNi*aDNj;
      if (fabs(1.-aDot)<0.0001) {
        aMp.Add(i);
        aMp.Add(j);
        aMFi.Add(aFi);
        break;
      }
      //
    }
  }
  aNbFi=aMFi.Extent();
  if (aNbFi!=3) {
    return;
  }
  //
  aDistMin=1.e15;
  aDistMax=-aDistMin;
  for (i=0; i<aNbFi; ++i) {
    const TopoDS_Shape& aFi=aMFi(i+1);
    const GEOMAlgo_ShapeInfo& aIFi=myMapInfo.FindFromKey(aFi);
    aPi=aIFi.Location();
    aDist[i]=aPc.Distance(aPi);
    if (aDist[i]>aDistMax) {
      aDistMax=aDist[i];
      iMax=i;
    }
    if (aDist[i]<aDistMin) {
      aDistMin=aDist[i];
      iMin=i;
    }
    gp_Vec aVi(aPc, aPi);
    gp_Dir aDi(aVi);
    aDir[i]=aDi;
  }
  //
  if (iMax==iMin) {
    iMax=0;
    iMin=1;
  }
  iMid=3-iMax-iMin;
  //
  aLength=2.*aDist[iMax];
  aWidth=2.*aDist[iMid];
  aHeight=2.*aDist[iMin];
  //
  gp_Ax2 aAx2(aPc, aDir[iMin], aDir[iMax]);
  gp_Ax3 aAx3(aAx2);
  //
  aInfo.SetKindOfName(GEOMAlgo_KN_BOX);
  aInfo.SetLocation(aPc);
  aInfo.SetLength(aLength);
  aInfo.SetWidth(aWidth);
  aInfo.SetHeight(aHeight);
  aInfo.SetPosition(aAx3);
}

Here is the call graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillEdge ( const TopoDS_Shape &  aS) [protected]

Definition at line 494 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bDegenerated, bIsAllowedType;
  Standard_Integer aNbV;
  Standard_Real aR1, aR2;
  gp_Pnt aP, aP1, aP2, aPc;
  gp_Dir aD;
  gp_Ax2 aAx2;
  Standard_Real aT1, aT2;
  GeomAbs_CurveType aCT;
  Handle(Geom_Curve) aC3D;
  TopoDS_Edge aE;
  //----------------------------------------------------
  if (myMapInfo.Contains(aS)) {
    return;
  }
  else {
    GEOMAlgo_ShapeInfo aInfoX;
    myMapInfo.Add(aS, aInfoX);
  }
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
  //----------------------------------------------------
  aInfo.SetType(TopAbs_EDGE);
  //
  FillNbSubShapes(aS, aInfo);
  //
  aE=TopoDS::Edge(aS);
  //
  bDegenerated=BRep_Tool::Degenerated(aE);
  if (bDegenerated) {
    aInfo.SetKindOfShape(GEOMAlgo_KS_DEGENERATED);
    FillSubShapes(aS);
    return;
  }
  //
  aC3D=BRep_Tool::Curve(aE, aT1, aT2);
  GeomAdaptor_Curve aGAC(aC3D);
  aCT=aGAC.GetType();
  bIsAllowedType=IsAllowedType(aCT);
  if (!bIsAllowedType) {
    FillSubShapes(aS);
    return;
  }
  // Line
  if (aCT==GeomAbs_Line) {
    Standard_Boolean bInf1, bInf2;
    Standard_Real aLength;
    gp_Lin aLin;
    gp_XYZ aXYZ1, aXYZ2, aXYZc;
    //
    aLin=aGAC.Line();
    aP=aLin.Location();
    aD=aLin.Direction();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_LINE);
    aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
    aInfo.SetLocation(aP);
    aInfo.SetDirection(aD);
    //
    bInf1=Precision::IsNegativeInfinite(aT1);
    bInf2=Precision::IsPositiveInfinite(aT2);
    if (bInf1||bInf2) {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
      aInfo.SetKindOfName(GEOMAlgo_KN_LINE);
    }
    else {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
      aInfo.SetKindOfName(GEOMAlgo_KN_SEGMENT);
      aGAC.D0(aT1, aP1);
      aGAC.D0(aT2, aP2);
      aInfo.SetPnt1(aP1);
      aInfo.SetPnt2(aP2);
      //
      aLength=aP1.Distance(aP2);
      aXYZ1=aP1.XYZ();
      aXYZ2=aP2.XYZ();
      aXYZc=aXYZ1+aXYZ2;
      aXYZc.Multiply(0.5);
      //
      aPc.SetXYZ(aXYZc);
      gp_Vec aVec(aPc, aP2);
      gp_Dir aDir(aVec);
      //
      aInfo.SetLocation(aPc);
      aInfo.SetDirection(aDir);
      aInfo.SetLength(aLength);
    }
  }// if (aCT==GeomAbs_Line) {
  //
  // Circle
  else if (aCT==GeomAbs_Circle) {
    gp_Circ aCirc;
    //
    aCirc=aGAC.Circle();
    aP=aCirc.Location();
    aAx2=aCirc.Position();
    aR1=aCirc.Radius();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_CIRCLE);
    aInfo.SetLocation(aP);
    aInfo.SetPosition(aAx2);
    aInfo.SetRadius1(aR1);
    //
    aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
    if (!aNbV) {
      myErrorStatus=11; // circle edge without vertices
      return;
    }
    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    aGAC.D0(aT1, aP1);
    aGAC.D0(aT2, aP2);
    aInfo.SetPnt1(aP1);
    aInfo.SetPnt2(aP2);
    //
    if (aNbV==1) {
      aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
      aInfo.SetKindOfName(GEOMAlgo_KN_CIRCLE);
    }
    else {
      aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
      aInfo.SetKindOfName(GEOMAlgo_KN_ARCCIRCLE);
      //
      gp_Vec aVecX(aP, aP1);
      gp_Dir aDirX(aVecX);
      gp_Ax2 aAx2new(aP, aAx2.Direction(), aDirX);
      aInfo.SetPosition(aAx2new);
    }
  }// else if (aCT==GeomAbs_Circle) {
  //
  // Ellipse
  else if (aCT==GeomAbs_Ellipse) {
    gp_Elips aElips;
    //
    aElips=aGAC.Ellipse();
    aP=aElips.Location();
    aAx2=aElips.Position();
    aR1=aElips.MajorRadius();
    aR2=aElips.MinorRadius();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_ELLIPSE);
    aInfo.SetLocation(aP);
    aInfo.SetPosition(aAx2);
    aInfo.SetRadius1(aR1);
    aInfo.SetRadius2(aR2);
    //
    aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
    if (!aNbV) {
      myErrorStatus=11; // ellipse edge without vertices
      return;
    }
    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    aGAC.D0(aT1, aP1);
    aGAC.D0(aT2, aP2);
    aInfo.SetPnt1(aP1);
    aInfo.SetPnt2(aP2);
    //
    if (aNbV==1) {
      aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
      aInfo.SetKindOfName(GEOMAlgo_KN_ELLIPSE);
    }
    else {
      aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
      aInfo.SetKindOfName(GEOMAlgo_KN_ARCELLIPSE);
      //
      gp_Vec aVecX(aP, aP1);
      gp_Dir aDirX(aVecX);
      gp_Ax2 aAx2new(aP, aAx2.Direction(), aDirX);
      aInfo.SetPosition(aAx2new);
    }
  }// else if (aCT==GeomAbs_Ellipse) {
  //
  FillSubShapes(aS);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillFace ( const TopoDS_Shape &  aS) [protected]

Definition at line 305 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  Standard_Boolean bIsAllowedType;
  Standard_Integer aNbWires;//, iRet
  Standard_Boolean bInf, bInfU1, bInfU2, bInfV1, bInfV2;
  Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2;
  gp_Pnt aP0;
  gp_Dir aDN;
  gp_Ax3 aAx3;
  GeomAbs_SurfaceType aST;
  Handle(Geom_Surface) aSurf;
  TopoDS_Face aF;
  //GEOMAlgo_KindOfName aKindOfName;
  //----------------------------------------------------
  if (myMapInfo.Contains(aS)) {
    return;
  }
  else {
    GEOMAlgo_ShapeInfo aInfoX;
    myMapInfo.Add(aS, aInfoX);
  }
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
  //----------------------------------------------------
  aInfo.SetType(TopAbs_FACE);
  //
  FillNbSubShapes(aS, aInfo);
  //
  FillSubShapes(aS);
  //
  aF=TopoDS::Face(aS);
  //
  aNbWires=NbWires(aF);
  //
  aSurf=BRep_Tool::Surface(aF);
  GeomAdaptor_Surface aGAS(aSurf);
  aST=aGAS.GetType();
  bIsAllowedType=IsAllowedType(aST);
  if (!bIsAllowedType) {
    return;
  }
  //
  // 1. Plane
  if (aST==GeomAbs_Plane) {
    gp_Pln aPln;
    //
    aPln=aGAS.Plane();
    aP0=aPln.Location();
    aAx3=aPln.Position();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
    aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
    aInfo.SetLocation(aP0);
    aInfo.SetPosition(aAx3);
    //
    if (aNbWires>1) return;
    //
    //aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
    BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
    bInfU1=Precision::IsNegativeInfinite(aUMin);
    bInfU2=Precision::IsPositiveInfinite(aUMax);
    bInfV1=Precision::IsNegativeInfinite(aVMin);
    bInfV2=Precision::IsPositiveInfinite(aVMax);
    //
    bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
    if (bInf) {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
    }
    else {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    }
    //
    FillDetails(aF, aPln);
  }// if (aCT==GeomAbs_Line) {
  //
  // 2. Sphere
  else if (aST==GeomAbs_Sphere) {
    gp_Sphere aSphere;
    //
    aSphere=aGAS.Sphere();
    aP0=aSphere.Location();
    aAx3=aSphere.Position();
    aR1=aSphere.Radius();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE);
    aInfo.SetLocation(aP0);
    aInfo.SetPosition(aAx3);
    aInfo.SetRadius1(aR1);
    //
    if (aNbWires>1) return;
    //
    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
    //
    FillDetails(aF, aSphere);
  }// else if (aST==GeomAbs_Sphere) {
  //
  // 3. Cylinder
  else if (aST==GeomAbs_Cylinder) {
    gp_Cylinder aCyl;
    //
    aCyl=aGAS.Cylinder();
    aP0=aCyl.Location();
    aAx3=aCyl.Position();
    aR1=aCyl.Radius();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER);
    aInfo.SetLocation(aP0);
    aInfo.SetPosition(aAx3);
    aInfo.SetRadius1(aR1);
    //
    if (aNbWires>1) return;
    //
    BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
    bInfU1=Precision::IsNegativeInfinite(aUMin);
    bInfU2=Precision::IsPositiveInfinite(aUMax);
    bInfV1=Precision::IsNegativeInfinite(aVMin);
    bInfV2=Precision::IsPositiveInfinite(aVMax);
    //
    bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
    if (bInf) {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
    }
    else {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    }
    FillDetails(aF, aCyl);
  }
  //
  // 4. Cone
  else if (aST==GeomAbs_Cone) {
    gp_Cone aCone;
    //
    aCone=aGAS.Cone();
    aP0=aCone.Location();
    aAx3=aCone.Position();
    //aR1=aCyl.Radius();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_CONE);
    aInfo.SetLocation(aP0);
    aInfo.SetPosition(aAx3);
    //aInfo.SetRadius1(aR1);
    //
    if (aNbWires>1) return;
    //
    BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
    bInfU1=Precision::IsNegativeInfinite(aUMin);
    bInfU2=Precision::IsPositiveInfinite(aUMax);
    bInfV1=Precision::IsNegativeInfinite(aVMin);
    bInfV2=Precision::IsPositiveInfinite(aVMax);
    //
    bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
    if (bInf) {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
    }
    else {
      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    }
    FillDetails(aF, aCone);
  }
  //
  // 5. Torus
  else if (aST==GeomAbs_Torus) {
    gp_Torus aTorus;
    //
    aTorus=aGAS.Torus();
    aP0=aTorus.Location();
    aAx3=aTorus.Position();
    aR1=aTorus.MajorRadius();
    aR2=aTorus.MinorRadius();
    //
    aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS);
    aInfo.SetLocation(aP0);
    aInfo.SetPosition(aAx3);
    aInfo.SetRadius1(aR1);
    aInfo.SetRadius2(aR2);
    //
    if (aNbWires>1) return;
    //
    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
    //
    FillDetails(aF, aTorus);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes ( const TopoDS_Shape &  aS,
GEOMAlgo_ShapeInfo aInfo 
) [protected]

Definition at line 700 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  Standard_Integer i, aNb, aNbS;
  TopTools_IndexedMapOfShape aM;
  TopAbs_ShapeEnum aST;
  TopAbs_ShapeEnum aTypes[]= {
    //TopAbs_FACE, TopAbs_EDGE, TopAbs_VERTEX
    TopAbs_COMPOUND,
    TopAbs_COMPSOLID,
    TopAbs_SOLID,
    TopAbs_SHELL,
    TopAbs_FACE,
    TopAbs_WIRE,
    TopAbs_EDGE,
    TopAbs_VERTEX
  };

  //
  aST=aS.ShapeType();
  aNb=sizeof(aTypes)/sizeof(aTypes[0]);
  for (i=0; i<aNb; ++i) {
    if (aTypes[i]==aST) {
      continue;
    }
    aM.Clear();
    TopExp::MapShapes(aS, aTypes[i], aM);
    aNbS=aM.Extent();
    aInfo.SetNbSubShapes(aTypes[i], aNbS);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillShape ( const TopoDS_Shape &  aS) [protected]

Definition at line 175 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  TopAbs_ShapeEnum aType;
  //
  aType=aS.ShapeType();
  switch(aType) {
    //
    case TopAbs_VERTEX:
      FillVertex(aS);
      break;
    //
    case TopAbs_EDGE:
      FillEdge(aS);
      break;
    //
    case TopAbs_FACE:
      FillFace(aS);
      break;
    //
    case TopAbs_SOLID:
      FillSolid(aS);
      break;
    //
    case TopAbs_WIRE:
    case TopAbs_SHELL:
    case TopAbs_COMPSOLID:
    case TopAbs_COMPOUND:
      FillContainer(aS);
      break;
    //
    default:
      break;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillSolid ( const TopoDS_Shape &  aS) [protected]

Definition at line 272 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  Standard_Integer aNbShells;
  TopoDS_Solid aSd;
  //
  myErrorStatus=0;
  //----------------------------------------------------
  if (myMapInfo.Contains(aS)) {
    return;
  }
  else {
    GEOMAlgo_ShapeInfo aInfoX;
    myMapInfo.Add(aS, aInfoX);
  }
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
  //----------------------------------------------------
  aInfo.SetType(TopAbs_SOLID);
  FillNbSubShapes(aS, aInfo);
  FillSubShapes(aS);
  //
  aSd=TopoDS::Solid(aS);
  //
  aNbShells=NbShells(aSd);
  if (aNbShells>1) {
    return;
  }
  //
  FillDetails(aSd);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillSubShapes ( const TopoDS_Shape &  aS) [protected]

Definition at line 213 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  TopoDS_Iterator aIt;
  //
  aIt.Initialize(aS);
  for (; aIt.More(); aIt.Next()){
    const TopoDS_Shape& aSx=aIt.Value();
    FillShape(aSx);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::FillVertex ( const TopoDS_Shape &  aS) [protected]

Definition at line 673 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  gp_Pnt aP;
  TopoDS_Vertex aV;
  //
  if (myMapInfo.Contains(aS)) {
    return;
  }
  else {
    GEOMAlgo_ShapeInfo aInfoX;
    myMapInfo.Add(aS, aInfoX);
  }
  GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
  //
  aV=TopoDS::Vertex(aS);
  aP=BRep_Tool::Pnt(aV);
  //
  aInfo.SetType(TopAbs_VERTEX);
  aInfo.SetLocation(aP);
  myMapInfo.Add(aS, aInfo);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 122 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  return Info(myShape);
}

Here is the caller graph for this function:

const GEOMAlgo_ShapeInfo & GEOMAlgo_ShapeInfoFiller::Info ( const TopoDS_Shape &  aS) const

Definition at line 130 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  if (!aS.IsNull()) {
    if (myMapInfo.Contains(aS)) {
      const GEOMAlgo_ShapeInfo& aInfo=myMapInfo.FindFromKey(aS);
      return aInfo;
    }
  }
  return myEmptyInfo;
}

Implements GEOMAlgo_Algo.

Definition at line 158 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myErrorStatus=0;
  //
  myMapInfo.Clear();
  //
  CheckData();
  if (myErrorStatus) {
    return;
  }
  //
  FillShape(myShape);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::SetShape ( const TopoDS_Shape &  aS)

Definition at line 106 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myShape=aS;
}

Here is the caller graph for this function:

void GEOMAlgo_ShapeInfoFiller::SetTolerance ( const Standard_Real  aT)

Definition at line 90 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  myTolerance=aT;
}
const TopoDS_Shape & GEOMAlgo_ShapeInfoFiller::Shape ( ) const

Definition at line 114 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  return myShape;
}
Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance ( ) const

Definition at line 98 of file GEOMAlgo_ShapeInfoFiller.cxx.

{
  return myTolerance;
}
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 119 of file GEOMAlgo_ShapeInfoFiller.hxx.

Standard_Integer GEOMAlgo_Algo::myErrorStatus [protected, inherited]

Definition at line 71 of file GEOMAlgo_Algo.hxx.

Definition at line 120 of file GEOMAlgo_ShapeInfoFiller.hxx.

TopoDS_Shape GEOMAlgo_ShapeInfoFiller::myShape [protected]

Definition at line 118 of file GEOMAlgo_ShapeInfoFiller.hxx.

Standard_Real GEOMAlgo_ShapeInfoFiller::myTolerance [protected]

Definition at line 121 of file GEOMAlgo_ShapeInfoFiller.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: