Back to index

salome-geom  6.5.0
Functions
BlockFix_PeriodicSurfaceModifier.cxx File Reference
#include <BlockFix_PeriodicSurfaceModifier.ixx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <ShapeFix_Edge.hxx>
#include <TopExp.hxx>

Go to the source code of this file.

Functions

static Standard_Boolean ModifySurface (const TopoDS_Face &aFace, const Handle(Geom_Surface)&aSurface, Handle(Geom_Surface)&aNewSurface)

Function Documentation

static Standard_Boolean ModifySurface ( const TopoDS_Face &  aFace,
const Handle(Geom_Surface)&  aSurface,
Handle(Geom_Surface)&  aNewSurface 
) [static]

Definition at line 66 of file BlockFix_PeriodicSurfaceModifier.cxx.

{
  Handle(Geom_Surface) S = aSurface;

  if(S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
    Handle(Geom_CylindricalSurface) aCyl =
      Handle(Geom_CylindricalSurface)::DownCast(S);
    Standard_Real Umin, Umax, Vmin, Vmax;
    BRepTools::UVBounds(aFace, Umin, Umax, Vmin, Vmax);
    if (Umin < -Precision::PConfusion() || Umax > 2*M_PI + Precision::PConfusion()) {
      gp_Ax3 ax3 = aCyl->Position();
      gp_Ax1 NDir = ax3.Axis();
      gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion());
      Handle(Geom_CylindricalSurface) aNewCyl =
        new Geom_CylindricalSurface(newax3,aCyl->Radius());
      aNewSurface = aNewCyl;
      return Standard_True;
    }
  }

  if(S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
    Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
    Standard_Real Umin, Umax, Vmin, Vmax;
    BRepTools::UVBounds(aFace, Umin, Umax, Vmin, Vmax);
    if (Umin < -Precision::PConfusion() || Umax > 2*M_PI + Precision::PConfusion()) {
      gp_Ax3 ax3 = aSphere->Position();
      gp_Ax1 NDir = ax3.Axis();
      gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion());
      Handle(Geom_SphericalSurface) aNewSphere = new Geom_SphericalSurface(newax3,aSphere->Radius());
      aNewSurface = aNewSphere;
      return Standard_True;
    }
  }

  return Standard_False;
}

Here is the call graph for this function:

Here is the caller graph for this function: