6f72a222a96c722bf84239987e0548c5d3c89199
[occt.git] / src / IntPatch / IntPatch_WLineTool.hxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _IntPatch_WLineTool_HeaderFile
15 #define _IntPatch_WLineTool_HeaderFile
16
17 #include <Standard_DefineAlloc.hxx>
18
19 #include <IntPatch_SequenceOfLine.hxx>
20 #include <IntPatch_WLine.hxx>
21
22 class Adaptor3d_TopolTool;
23
24 //! IntPatch_WLineTool provides set of static methods related to walking lines.
25 class IntPatch_WLineTool
26 {
27 public:
28
29   DEFINE_STANDARD_ALLOC
30
31   //! I
32   //! Removes equal points (leave one of equal points) from theWLine
33   //! and recompute vertex parameters.
34   //!
35   //! II
36   //! Removes point out of borders in case of non periodic surfaces.
37   //! This step is done only if theRestrictLine is true.
38   //!
39   //! III
40   //! Removes exceed points using tube criteria:
41   //! delete 7D point if it lies near to expected lines in 2d and 3d.
42   //! Each task (2d, 2d, 3d) have its own tolerance and checked separately.
43   //!
44   //! Returns new WLine or null WLine if the number
45   //! of the points is less than 2.
46   Standard_EXPORT static
47     Handle(IntPatch_WLine) ComputePurgedWLine(const Handle(IntPatch_WLine)       &theWLine,
48                                               const Handle(Adaptor3d_HSurface) &theS1,
49                                               const Handle(Adaptor3d_HSurface) &theS2,
50                                               const Handle(Adaptor3d_TopolTool)  &theDom1,
51                                               const Handle(Adaptor3d_TopolTool)  &theDom2,
52                                               const Standard_Boolean      theRestrictLine);
53
54 //! Joins all WLines from theSlin to one if it is possible and records 
55 //! the result into theSlin again. Lines will be kept to be splitted if:
56 //! a) they are separated (has no common points);
57 //! b) resulted line (after joining) go through seam-edges or surface boundaries.
58 //!
59 //! In addition, if points in theSPnt lies at least in one of the line in theSlin,
60 //! this point will be deleted.
61   Standard_EXPORT static void JoinWLines(IntPatch_SequenceOfLine& theSlin,
62                                          IntPatch_SequenceOfPoint& theSPnt,
63                                          Handle(Adaptor3d_HSurface) theS1,
64                                          Handle(Adaptor3d_HSurface) theS2,
65                                          const Standard_Real theTol3D);
66
67 //! Extends every line from theSlin (if it is possible) to be started/finished
68 //! in strictly determined point (in the place of joint of two lines).
69 //! As result, some gaps between two lines will vanish.
70 //! The Walking lines are supposed (algorithm will do nothing for not-Walking line)
71 //! to be computed as a result of intersection. Both theS1 and theS2 
72 //! must be quadrics. Other cases are not supported.
73 //! theArrPeriods must be filled as follows (every value must not be negative;
74 //! if the surface is not periodic the period must be equal to 0.0 strictly):
75 //! {<U-period of 1st surface>, <V-period of 1st surface>,
76 //!               <U-period of 2nd surface>, <V-period of 2nd surface>}.
77   Standard_EXPORT static void
78             ExtendTwoWLines(IntPatch_SequenceOfLine& theSlin,
79                             const Handle(Adaptor3d_HSurface)& theS1,
80                             const Handle(Adaptor3d_HSurface)& theS2,
81                             const Standard_Real theToler3D,
82                             const Standard_Real* const theArrPeriods,
83                             const Bnd_Box2d& theBoxS1,
84                             const Bnd_Box2d& theBoxS2);
85
86   //! Max angle to concatenate two WLines to avoid result with C0-continuity
87   static const Standard_Real myMaxConcatAngle;
88 };
89
90 #endif