1 -- Created on: 1995-06-13
2 -- Created by: Jacques GOUSSARD
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class MakeCylindricalHole from BRepFeat inherits Builder from BRepFeat
25 ---Purpose: Provides a tool to make cylindrical holes on a shape.
27 uses Shape from TopoDS,
33 raises NotDone from StdFail,
34 ConstructionError from Standard
39 ---Purpose: Empty constructor.
40 returns MakeCylindricalHole from BRepFeat;
44 Init(me: in out; Axis: Ax1 from gp)
45 ---Purpose: Sets the axis of the hole(s).
50 Init(me: in out; S: Shape from TopoDS; Axis: Ax1 from gp)
51 ---Purpose: Sets the shape and axis on which hole(s) will be
57 Perform(me: in out; Radius: Real from Standard)
58 ---Purpose: Performs every holes of radius <Radius>. This
59 -- command has the same effect as a cut operation
60 -- with an infinite cylinder defined by the given
63 raises ConstructionError from Standard
64 -- The exception is raised when no shape or no axis is defined.
68 Perform(me: in out; Radius: Real from Standard;
69 PFrom,PTo: Real from Standard;
70 WithControl: Boolean from Standard = Standard_True)
71 ---Purpose: Performs evry hole of radius <Radius> located
72 -- between PFrom and PTo on the given axis. If
73 -- <WithControl> is set to Standard_False no control
74 -- are done on the resulting shape after the
75 -- operation is performed.
77 raises ConstructionError from Standard
78 -- The exception is raised when no shape or no axis is defined.
82 PerformThruNext(me: in out;
83 Radius: Real from Standard;
84 WithControl: Boolean from Standard = Standard_True)
85 ---Purpose: Performs the first hole of radius <Radius>, in the
86 -- direction of the defined axis. First hole signify
87 -- first encountered after the origin of the axis. If
88 -- <WithControl> is set to Standard_False no control
89 -- are done on the resulting shape after the
90 -- operation is performed.
92 raises ConstructionError from Standard
93 -- The exception is raised when no shape or no axis is defined.
97 PerformUntilEnd(me: in out;
98 Radius: Real from Standard;
99 WithControl: Boolean from Standard = Standard_True)
100 ---Purpose: Performs evry holes of radius <Radius> located
101 -- after the origin of the given axis. If
102 -- <WithControl> is set to Standard_False no control
103 -- are done on the resulting shape after the
104 -- operation is performed.
106 raises ConstructionError from Standard
107 -- The exception is raised when no shape or no axis is defined.
111 PerformBlind(me: in out;
112 Radius: Real from Standard;
113 Length: Real from Standard;
114 WithControl: Boolean from Standard = Standard_True)
115 ---Purpose: Performs a blind hole of radius <Radius> and
116 -- length <Length>. The length is measured from the
117 -- origin of the given axis. If <WithControl> is set
118 -- to Standard_False no control are done after the
119 -- operation is performed.
121 raises ConstructionError from Standard
122 -- The exception is raised when no shape or no axis is defined.
127 ---Purpose: Returns the status after a hole is performed.
129 returns Status from BRepFeat
133 --- Redefinition of BRepBuilderAPI_MakeShape methods
138 ---Purpose: Builds the resulting shape (redefined from
139 -- MakeShape). Invalidates the given parts of tools
140 -- if any, and performs the result of the local
144 --- Private implementation method
149 returns Status from BRepFeat
155 myAxis : Ax1 from gp;
156 myAxDef : Boolean from Standard;
157 myStatus : Status from BRepFeat;
158 myIsBlind : Boolean from Standard;
159 myValidate: Boolean from Standard;
160 myTopFace : Face from TopoDS;
161 myBotFace : Face from TopoDS;
164 end MakeCylindricalHole;