Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:19:45

0001 // Created on: 1995-06-13
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepFeat_MakeCylindricalHole_HeaderFile
0018 #define _BRepFeat_MakeCylindricalHole_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <gp_Ax1.hxx>
0024 #include <BRepFeat_Status.hxx>
0025 #include <TopoDS_Face.hxx>
0026 #include <BRepFeat_Builder.hxx>
0027 
0028 // resolve name collisions with X11 headers
0029 #ifdef Status
0030   #undef Status
0031 #endif
0032 
0033 //! Provides a tool to make cylindrical holes on a shape.
0034 class BRepFeat_MakeCylindricalHole : public BRepFeat_Builder
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Empty constructor.
0040   BRepFeat_MakeCylindricalHole();
0041 
0042   //! Sets the axis of the hole(s).
0043   void Init(const gp_Ax1& Axis);
0044 
0045   //! Sets the shape and axis on which hole(s) will be
0046   //! performed.
0047   void Init(const TopoDS_Shape& S, const gp_Ax1& Axis);
0048 
0049   //! Performs every hole of radius <Radius>. This
0050   //! command has the same effect as a cut operation
0051   //! with an infinite cylinder defined by the given
0052   //! axis and <Radius>.
0053   Standard_EXPORT void Perform(const double Radius);
0054 
0055   //! Performs every hole of radius <Radius> located
0056   //! between PFrom and PTo on the given axis. If
0057   //! <WithControl> is set to false no control
0058   //! are done on the resulting shape after the
0059   //! operation is performed.
0060   Standard_EXPORT void Perform(const double Radius,
0061                                const double PFrom,
0062                                const double PTo,
0063                                const bool   WithControl = true);
0064 
0065   //! Performs the first hole of radius <Radius>, in the
0066   //! direction of the defined axis. First hole signify
0067   //! first encountered after the origin of the axis. If
0068   //! <WithControl> is set to false no control
0069   //! are done on the resulting shape after the
0070   //! operation is performed.
0071   Standard_EXPORT void PerformThruNext(const double Radius, const bool WithControl = true);
0072 
0073   //! Performs every hole of radius <Radius> located
0074   //! after the origin of the given axis. If
0075   //! <WithControl> is set to false no control
0076   //! are done on the resulting shape after the
0077   //! operation is performed.
0078   Standard_EXPORT void PerformUntilEnd(const double Radius, const bool WithControl = true);
0079 
0080   //! Performs a blind hole of radius <Radius> and
0081   //! length <Length>. The length is measured from the
0082   //! origin of the given axis. If <WithControl> is set
0083   //! to false no control are done after the
0084   //! operation is performed.
0085   Standard_EXPORT void PerformBlind(const double Radius,
0086                                     const double Length,
0087                                     const bool   WithControl = true);
0088 
0089   //! Returns the status after a hole is performed.
0090   BRepFeat_Status Status() const;
0091 
0092   //! Builds the resulting shape (redefined from
0093   //! MakeShape). Invalidates the given parts of tools
0094   //! if any, and performs the result of the local
0095   //! operation.
0096   Standard_EXPORT void Build();
0097 
0098 protected:
0099   //! Unhide the base class member to avoid Clang warnings
0100   using BRepFeat_Builder::Perform;
0101 
0102 private:
0103   Standard_EXPORT BRepFeat_Status Validate();
0104 
0105   gp_Ax1          myAxis;
0106   bool            myAxDef;
0107   BRepFeat_Status myStatus;
0108   bool            myIsBlind;
0109   bool            myValidate;
0110   TopoDS_Face     myTopFace;
0111   TopoDS_Face     myBotFace;
0112 };
0113 
0114 #include <BRepFeat_MakeCylindricalHole.lxx>
0115 
0116 #endif // _BRepFeat_MakeCylindricalHole_HeaderFile