Back to index

salome-geom  6.5.0
Public Member Functions | Private Attributes | Friends
BlockFix_SphereSpaceModifier Class Reference

#include <BlockFix_SphereSpaceModifier.hxx>

List of all members.

Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT BlockFix_SphereSpaceModifier ()
Standard_EXPORT void SetTolerance (const Standard_Real Toler)
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face &F, Handle(Geom_Surface)&S, TopLoc_Location &L, Standard_Real &Tol, Standard_Boolean &RevWires, Standard_Boolean &RevFace)
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge &E, Handle(Geom_Curve)&C, TopLoc_Location &L, Standard_Real &Tol)
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex &V, gp_Pnt &P, Standard_Real &Tol)
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge &E, const TopoDS_Face &F, const TopoDS_Edge &NewE, const TopoDS_Face &NewF, Handle(Geom2d_Curve)&C, Standard_Real &Tol)
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex &V, const TopoDS_Edge &E, Standard_Real &P, Standard_Real &Tol)
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge &E, const TopoDS_Face &F1, const TopoDS_Face &F2, const TopoDS_Edge &NewE, const TopoDS_Face &NewF1, const TopoDS_Face &NewF2)
Standard_EXPORT Standard_Boolean ForRotation (const TopoDS_Face &F)
Standard_EXPORT ~BlockFix_SphereSpaceModifier ()
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const
Standard_EXPORT Standard_Boolean IsKind (const Handle(Standard_Type)&) const

Private Attributes

Standard_Real myTolerance
TopTools_DataMapOfShapeInteger myMapOfFaces
TColStd_IndexedMapOfTransient myMapOfSpheres


Standard_EXPORT friend
Handle_Standard_Type & 
BlockFix_SphereSpaceModifier_Type_ ()

Detailed Description

Definition at line 70 of file BlockFix_SphereSpaceModifier.hxx.

Constructor & Destructor Documentation

Definition at line 50 of file BlockFix_SphereSpaceModifier.cxx.


Definition at line 29 of file BlockFix_SphereSpaceModifier.ixx.


Member Function Documentation

GeomAbs_Shape BlockFix_SphereSpaceModifier::Continuity ( const TopoDS_Edge &  E,
const TopoDS_Face &  F1,
const TopoDS_Face &  F2,
const TopoDS_Edge &  NewE,
const TopoDS_Face &  NewF1,
const TopoDS_Face &  NewF2 

Definition at line 258 of file BlockFix_SphereSpaceModifier.cxx.

  return BRep_Tool::Continuity(E,F1,F2);
Standard_EXPORT Standard_Boolean BlockFix_SphereSpaceModifier::ForRotation ( const TopoDS_Face &  F)
Standard_EXPORT const BlockFix_SphereSpaceModifier::Handle ( Standard_Type  ) const

Here is the caller graph for this function:

Standard_Boolean BlockFix_SphereSpaceModifier::IsKind ( const Handle(Standard_Type)&  AType) const

Definition at line 74 of file BlockFix_SphereSpaceModifier.ixx.

  return (STANDARD_TYPE(BlockFix_SphereSpaceModifier) == AType || BRepTools_Modification::IsKind(AType));

Here is the call graph for this function:

Standard_Boolean BlockFix_SphereSpaceModifier::NewCurve ( const TopoDS_Edge &  E,
Handle(Geom_Curve)&  C,
TopLoc_Location &  L,
Standard_Real &  Tol 

Definition at line 155 of file BlockFix_SphereSpaceModifier.cxx.

  return Standard_False;
Standard_Boolean BlockFix_SphereSpaceModifier::NewCurve2d ( const TopoDS_Edge &  E,
const TopoDS_Face &  F,
const TopoDS_Edge &  NewE,
const TopoDS_Face &  NewF,
Handle(Geom2d_Curve)&  C,
Standard_Real &  Tol 

Definition at line 178 of file BlockFix_SphereSpaceModifier.cxx.

  //check if undelying surface of the face was modified
  if(myMapOfFaces.IsBound(F)) {
    Standard_Integer anIndex = myMapOfFaces.Find(F);

    Handle(Geom_Surface) aNewSphere = Handle(Geom_Surface)::DownCast(myMapOfSpheres.FindKey(anIndex));

    Standard_Real f,l;
    TopLoc_Location LC, LS;
    Handle(Geom_Curve) C3d = BRep_Tool::Curve ( E, LC, f, l );
    Handle(Geom_Surface) S = BRep_Tool::Surface(F, LS);

    //taking into accound the orientation of the seam
    C = BRep_Tool::CurveOnSurface(E,F,f,l);
    Tol = BRep_Tool::Tolerance(E);

    BRep_Builder B;
    TopoDS_Edge TempE;
    B.Add(TempE, TopExp::FirstVertex(E));
    B.Add(TempE, TopExp::LastVertex(E));

      B.UpdateEdge(TempE, Handle(Geom_Curve)::DownCast(C3d->Transformed(LC.Transformation())), Precision::Confusion());
    B.Range(TempE, f, l);

    Handle(ShapeFix_Edge) sfe = new ShapeFix_Edge;
    Handle(Geom_Surface) STemp = Handle(Geom_Surface)::DownCast(aNewSphere->Transformed(LS.Transformation()));
    TopLoc_Location LTemp;

    Standard_Boolean isClosed = BRep_Tool::IsClosed (E, F);
    Standard_Real aWorkTol = 2*myTolerance+Tol;
    sfe->FixAddPCurve(TempE, STemp, LTemp, isClosed, Max(Precision::Confusion(), aWorkTol));

    //keep the orientation of original edge
    C = BRep_Tool::CurveOnSurface(TempE, STemp, LTemp, f, l);

    // shifting seam of sphere
    if(isClosed  && !C.IsNull()) {
      Standard_Real f2,l2;
      Handle(Geom2d_Curve) c22 =
        BRep_Tool::CurveOnSurface(TopoDS::Edge(TempE.Reversed()),STemp, LTemp,f2,l2);
      Standard_Real dPreci = Precision::PConfusion()*Precision::PConfusion();
      if((C->Value(f).SquareDistance(c22->Value(f2)) < dPreci)
         ||(C->Value(l).SquareDistance(c22->Value(l2)) < dPreci)) {
        gp_Vec2d shift(S->UPeriod(),0.);
    //sphere was modified
    return Standard_True;

  return Standard_False;

Here is the call graph for this function:

Standard_Boolean BlockFix_SphereSpaceModifier::NewParameter ( const TopoDS_Vertex &  V,
const TopoDS_Edge &  E,
Standard_Real &  P,
Standard_Real &  Tol 

Definition at line 246 of file BlockFix_SphereSpaceModifier.cxx.

  return Standard_False;
Standard_Boolean BlockFix_SphereSpaceModifier::NewPoint ( const TopoDS_Vertex &  V,
gp_Pnt &  P,
Standard_Real &  Tol 

Definition at line 166 of file BlockFix_SphereSpaceModifier.cxx.

  return Standard_False;
Standard_Boolean BlockFix_SphereSpaceModifier::NewSurface ( const TopoDS_Face &  F,
Handle(Geom_Surface)&  S,
TopLoc_Location &  L,
Standard_Real &  Tol,
Standard_Boolean &  RevWires,
Standard_Boolean &  RevFace 

Definition at line 124 of file BlockFix_SphereSpaceModifier.cxx.

  TopLoc_Location LS;
  Handle(Geom_Surface) SIni = BRep_Tool::Surface(F, LS);

  //check if pole of the sphere in the parametric space
  if(ModifySurface(F, SIni, S)) {

    RevWires = Standard_False;
    RevFace = Standard_False;

    L = LS;
    Tol = BRep_Tool::Tolerance(F);

    Standard_Integer anIndex = myMapOfSpheres.Add(S);
    return Standard_True;

  return Standard_False;

Here is the call graph for this function:

void BlockFix_SphereSpaceModifier::operator delete ( void *  anAddress) [inline]

Definition at line 82 of file BlockFix_SphereSpaceModifier.hxx.

        if (anAddress) Standard::Free((Standard_Address&)anAddress);
void* BlockFix_SphereSpaceModifier::operator new ( size_t  ,
void *  anAddress 
) [inline]

Definition at line 74 of file BlockFix_SphereSpaceModifier.hxx.

        return anAddress;
void* BlockFix_SphereSpaceModifier::operator new ( size_t  size) [inline]

Definition at line 78 of file BlockFix_SphereSpaceModifier.hxx.

        return Standard::Allocate(size);
void BlockFix_SphereSpaceModifier::SetTolerance ( const Standard_Real  Toler)

Definition at line 61 of file BlockFix_SphereSpaceModifier.cxx.

  myTolerance = Tol;

Friends And Related Function Documentation

Standard_EXPORT friend Handle_Standard_Type& BlockFix_SphereSpaceModifier_Type_ ( ) [friend]

Definition at line 33 of file BlockFix_SphereSpaceModifier.ixx.


    static Handle_Standard_Type aType1 = STANDARD_TYPE(BRepTools_Modification);
  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(BRepTools_Modification);
  static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
  if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
  static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
  if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);

  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
  static Handle_Standard_Type _aType = new Standard_Type("BlockFix_SphereSpaceModifier",

  return _aType;

Member Data Documentation

TopTools_DataMapOfShapeInteger BlockFix_SphereSpaceModifier::myMapOfFaces [private]

Definition at line 127 of file BlockFix_SphereSpaceModifier.hxx.

TColStd_IndexedMapOfTransient BlockFix_SphereSpaceModifier::myMapOfSpheres [private]

Definition at line 128 of file BlockFix_SphereSpaceModifier.hxx.

Definition at line 126 of file BlockFix_SphereSpaceModifier.hxx.

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