1 // Created on: 1995-06-13
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16 
17 #ifndef _BRepFeat_MakeCylindricalHole_HeaderFile
18 #define _BRepFeat_MakeCylindricalHole_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <gp_Ax1.hxx>
25 #include <BRepFeat_Status.hxx>
26 #include <TopoDS_Face.hxx>
27 #include <BRepFeat_Builder.hxx>
28 
29 // resolve name collisions with X11 headers
30 #ifdef Status
31   #undef Status
32 #endif
33 
34 //! Provides a tool to make cylindrical holes on a shape.
35 class BRepFeat_MakeCylindricalHole  : public BRepFeat_Builder
36 {
37 public:
38 
39   DEFINE_STANDARD_ALLOC
40 
41 
42   //! Empty constructor.
43     BRepFeat_MakeCylindricalHole();
44 
45   //! Sets the axis of the hole(s).
46     void Init (const gp_Ax1& Axis);
47 
48   //! Sets the shape and  axis on which hole(s)  will be
49   //! performed.
50     void Init (const TopoDS_Shape& S, const gp_Ax1& Axis);
51 
52   //! Performs every  holes of   radius  <Radius>.  This
53   //! command  has the  same effect as   a cut operation
54   //! with an  infinite cylinder   defined by the  given
55   //! axis and <Radius>.
56   Standard_EXPORT void Perform (const Standard_Real Radius);
57 
58   //! Performs evry   hole  of  radius  <Radius> located
59   //! between PFrom  and  PTo  on the  given  axis.   If
60   //! <WithControl> is set  to Standard_False no control
61   //! are  done  on   the  resulting  shape   after  the
62   //! operation is performed.
63   Standard_EXPORT void Perform (const Standard_Real Radius, const Standard_Real PFrom, const Standard_Real PTo, const Standard_Boolean WithControl = Standard_True);
64 
65   //! Performs the first hole of radius <Radius>, in the
66   //! direction of  the defined axis. First hole signify
67   //! first encountered after the origin of the axis. If
68   //! <WithControl> is set  to Standard_False no control
69   //! are  done  on   the  resulting  shape   after  the
70   //! operation is performed.
71   Standard_EXPORT void PerformThruNext (const Standard_Real Radius, const Standard_Boolean WithControl = Standard_True);
72 
73   //! Performs  evry  holes of  radius  <Radius> located
74   //! after  the   origin  of   the given    axis.    If
75   //! <WithControl> is  set to Standard_False no control
76   //! are done   on   the  resulting  shape   after  the
77   //! operation is performed.
78   Standard_EXPORT void PerformUntilEnd (const Standard_Real Radius, const Standard_Boolean WithControl = Standard_True);
79 
80   //! Performs a  blind   hole of radius    <Radius> and
81   //! length <Length>.  The length is  measured from the
82   //! origin of the given  axis. If <WithControl> is set
83   //! to  Standard_False no  control  are done after the
84   //! operation is performed.
85   Standard_EXPORT void PerformBlind (const Standard_Real Radius, const Standard_Real Length, const Standard_Boolean WithControl = Standard_True);
86 
87   //! Returns the status after a hole is performed.
88     BRepFeat_Status Status() const;
89 
90   //! Builds the    resulting shape  (redefined     from
91   //! MakeShape). Invalidates the  given parts  of tools
92   //! if  any,   and performs the  result   of the local
93   //! operation.
94   Standard_EXPORT void Build();
95 
96 
97 
98 
99 protected:
100 
101   //! Unhide the base class member to avoid Clang warnings
102   using BRepFeat_Builder::Perform;
103 
104 
105 private:
106 
107 
108   Standard_EXPORT BRepFeat_Status Validate();
109 
110 
111   gp_Ax1 myAxis;
112   Standard_Boolean myAxDef;
113   BRepFeat_Status myStatus;
114   Standard_Boolean myIsBlind;
115   Standard_Boolean myValidate;
116   TopoDS_Face myTopFace;
117   TopoDS_Face myBotFace;
118 
119 
120 };
121 
122 
123 #include <BRepFeat_MakeCylindricalHole.lxx>
124 
125 
126 
127 
128 
129 #endif // _BRepFeat_MakeCylindricalHole_HeaderFile
130