Salome HOME
PAL9165. emit message only if no valid ImportExport file found
[modules/geom.git] / src / GEOMAlgo / BlockFix_BlockFixAPI.cxx
1 // File:        BlockFix_BlockFixAPI.cxx
2 // Created:     Tue Dec  7 11:59:05 2004
3 // Author:      Pavel DURANDIN
4 // Copyright:   Open CASCADE SA 2004
5
6
7 #include <BlockFix_BlockFixAPI.ixx>
8 #include <BlockFix.hxx>
9 #include <BlockFix_UnionFaces.hxx>
10 #include <BlockFix_UnionEdges.hxx>
11 #include <Precision.hxx>
12
13 //=======================================================================
14 //function : ShapeConvert_CanonicAPI
15 //purpose  : 
16 //=======================================================================
17
18 BlockFix_BlockFixAPI::BlockFix_BlockFixAPI()
19 {
20   myTolerance = Precision::Confusion();
21 }
22
23 //=======================================================================
24 //function : Perform
25 //purpose  : 
26 //=======================================================================
27
28 void BlockFix_BlockFixAPI::Perform() 
29 {
30
31   // processing spheres with degenerativities
32   TopoDS_Shape aShape = Shape();
33   myShape = BlockFix::RotateSphereSpace(aShape,myTolerance);
34   
35   // faces unification
36   BlockFix_UnionFaces aFaceUnifier;
37   aFaceUnifier.GetTolerance() = myTolerance;
38   TopoDS_Shape aResult;
39   aResult = aFaceUnifier.Perform(myShape);
40   
41   
42   BlockFix_UnionEdges anEdgeUnifier;
43   myShape = anEdgeUnifier.Perform(aResult,myTolerance);
44   
45   TopoDS_Shape aRes = BlockFix::FixRanges(myShape,myTolerance);
46   myShape = aRes;
47   
48 }