Back to index

salome-geom  6.5.0
Static Public Member Functions
GEOMAlgo_SurfaceTools Class Reference

#include <GEOMAlgo_SurfaceTools.hxx>

List of all members.

Static Public Member Functions

static Standard_EXPORT
Standard_Boolean 
IsAnalytic (const Handle(Geom_Surface)&aS)
static Standard_EXPORT
Standard_Boolean 
IsCoaxial (const gp_Pnt &aP1, const gp_Pnt &aP2, const gp_Cylinder &aCyl, const Standard_Real aTol)
static Standard_EXPORT
Standard_Boolean 
IsConformState (const TopAbs_State aST1, const GEOMAlgo_State aST2)
static Standard_EXPORT
Standard_Integer 
GetState (const gp_Pnt &aP, const GeomAdaptor_Surface &aS, const Standard_Real aTol, TopAbs_State &aSt)
static Standard_EXPORT
Standard_Integer 
GetState (const gp_Pnt &aP, const Handle(Geom_Surface)&aS, const Standard_Real aTol, TopAbs_State &aSt)
static Standard_EXPORT
Standard_Real 
Distance (const gp_Pnt &aP, const gp_Pln &aPln)
static Standard_EXPORT
Standard_Real 
Distance (const gp_Pnt &aP, const gp_Cylinder &aCyl)
static Standard_EXPORT
Standard_Real 
Distance (const gp_Pnt &aP, const gp_Sphere &aSph)
static Standard_EXPORT TopAbs_State ReverseState (const TopAbs_State aSt)

Detailed Description

Definition at line 51 of file GEOMAlgo_SurfaceTools.hxx.


Member Function Documentation

Standard_Real GEOMAlgo_SurfaceTools::Distance ( const gp_Pnt &  aP,
const gp_Pln &  aPln 
) [static]

Definition at line 175 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Real aD;
  //
  const gp_Ax3& aPos=aPL.Position();
  const gp_Pnt& aLoc=aPos.Location ();
  const gp_Dir& aDir=aPos.Direction();
  //
  aD= (aDir.X() * (aP.X() - aLoc.X()) +
       aDir.Y() * (aP.Y() - aLoc.Y()) +
       aDir.Z() * (aP.Z() - aLoc.Z()));
  return aD;
}

Here is the caller graph for this function:

Standard_Real GEOMAlgo_SurfaceTools::Distance ( const gp_Pnt &  aP,
const gp_Cylinder &  aCyl 
) [static]

Definition at line 160 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Real aD;
  //
  const gp_Ax1& aAxis=aCyl.Axis();
  gp_Lin aLin(aAxis);
  aD=aLin.Distance(aP);
  //
  return aD;
}
Standard_Real GEOMAlgo_SurfaceTools::Distance ( const gp_Pnt &  aP,
const gp_Sphere &  aSph 
) [static]

Definition at line 146 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Real aD;
  //
  const gp_Pnt& aLoc=aSph.Location();
  aD=aLoc.Distance(aP);
  //
  return aD;
}
Standard_Integer GEOMAlgo_SurfaceTools::GetState ( const gp_Pnt &  aP,
const GeomAdaptor_Surface &  aS,
const Standard_Real  aTol,
TopAbs_State &  aSt 
) [static]

Definition at line 50 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Integer iErr;
  Standard_Real aDp, aR;
  GeomAbs_SurfaceType aType;
  gp_Sphere aSph;
  gp_Cylinder aCyl;
  gp_Pln aPln;
  //
  iErr=0;
  aState=TopAbs_UNKNOWN;
  //
  aType=aGAS.GetType();
  switch (aType) {
  case GeomAbs_Plane:
    aPln=aGAS.Plane();
    aR=0.;
    aDp=GEOMAlgo_SurfaceTools::Distance(aP, aPln);
    break;

  case GeomAbs_Cylinder:
    aCyl=aGAS.Cylinder();
    aR=aCyl.Radius();
    aDp=GEOMAlgo_SurfaceTools::Distance(aP, aCyl);
    break;

  case GeomAbs_Sphere:
    aSph=aGAS.Sphere();
    aR=aSph.Radius();
    aDp=GEOMAlgo_SurfaceTools::Distance(aP, aSph);
    break;

  default:
    iErr=1; // unprocessed surface type
    break;
  }
  //
  if (!iErr) {
    aState=TopAbs_ON;
    if (aDp>aR+aTol) {
      aState=TopAbs_OUT;
    }
    else if (aDp<aR-aTol) {
      aState=TopAbs_IN;
    }
  }
  //
  return iErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Integer GEOMAlgo_SurfaceTools::GetState ( const gp_Pnt &  aP,
const Handle(Geom_Surface)&  aS,
const Standard_Real  aTol,
TopAbs_State &  aSt 
) [static]

Definition at line 106 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Integer iErr;
  GeomAdaptor_Surface aGAS;
  //
  aState=TopAbs_UNKNOWN;
  aGAS.Load(aSurf);
  //
  iErr=GEOMAlgo_SurfaceTools::GetState(aP, aGAS, aTol, aState);
  //
  return iErr;
}

Here is the call graph for this function:

Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic ( const Handle(Geom_Surface)&  aS) [static]

Definition at line 218 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Boolean bRet;
  GeomAbs_SurfaceType aType;
  GeomAdaptor_Surface aGAS;
  //
  aGAS.Load(aSurf);
  aType=aGAS.GetType();
  bRet=(aType==GeomAbs_Plane ||
        aType==GeomAbs_Cylinder ||
        aType==GeomAbs_Sphere);
  return bRet;
}

Here is the caller graph for this function:

Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial ( const gp_Pnt &  aP1,
const gp_Pnt &  aP2,
const gp_Cylinder &  aCyl,
const Standard_Real  aTol 
) [static]

Definition at line 193 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Boolean bRet=Standard_False;
  Standard_Real aSM;
  //
  gp_Vec aV12(aP1, aP2);
  gp_Dir aD12(aV12);
  //
  const gp_Ax1& aAxis=aCyl.Axis();
  const gp_Dir& aDAxis=aAxis.Direction();
  //
  aSM=fabs(aD12*aDAxis);
  if (fabs(1.-aSM) > aTol) {
    return bRet;
  }
  //
  return !bRet;
}

Here is the caller graph for this function:

Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState ( const TopAbs_State  aST1,
const GEOMAlgo_State  aST2 
) [static]

Definition at line 235 of file GEOMAlgo_SurfaceTools.cxx.

{
  Standard_Boolean bRet=Standard_False;
  //
  switch (aST2) {
    case GEOMAlgo_ST_IN:
      if (aST1==TopAbs_IN) {
        bRet=!bRet;
      }
      break;
    case GEOMAlgo_ST_OUT:
      if (aST1==TopAbs_OUT) {
        bRet=!bRet;
      }
      break;
    case GEOMAlgo_ST_ON:
      if (aST1==TopAbs_ON) {
        bRet=!bRet;
      }
      break;
    case GEOMAlgo_ST_ONIN:
      if (aST1==TopAbs_ON || aST1==TopAbs_IN) {
        bRet=!bRet;
      }
      break;
    case GEOMAlgo_ST_ONOUT:
      if (aST1==TopAbs_ON || aST1==TopAbs_OUT) {
        bRet=!bRet;
      }
      break;
    default:
      break;
  }
  return bRet;
}

Here is the caller graph for this function:

TopAbs_State GEOMAlgo_SurfaceTools::ReverseState ( const TopAbs_State  aSt) [static]

Definition at line 125 of file GEOMAlgo_SurfaceTools.cxx.

{
  TopAbs_State aRSt=aState;
  //
  switch (aState) {
    case TopAbs_IN:
     aRSt=TopAbs_OUT;
     break;
   case TopAbs_OUT:
     aRSt=TopAbs_IN;
     break;
   default:
     break;
  }
  //
  return aRSt;
}

Here is the caller graph for this function:


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