Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:15:05

0001 // Created on: 1995-10-19
0002 // Created by: Bruno DUMORTIER
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 _BRepOffset_Offset_HeaderFile
0018 #define _BRepOffset_Offset_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepOffset_Status.hxx>
0025 #include <TopoDS_Face.hxx>
0026 #include <TopTools_DataMapOfShapeShape.hxx>
0027 #include <GeomAbs_JoinType.hxx>
0028 #include <GeomAbs_Shape.hxx>
0029 #include <TopTools_ListOfShape.hxx>
0030 class TopoDS_Edge;
0031 class TopoDS_Vertex;
0032 
0033 // resolve name collisions with X11 headers
0034 #ifdef Status
0035   #undef Status
0036 #endif
0037 
0038 //! This class compute elemenary offset surface.
0039 //! Evaluate the offset generated :
0040 //! 1 - from a face.
0041 //! 2 - from an edge.
0042 //! 3 - from a vertex.
0043 class BRepOffset_Offset
0044 {
0045 public:
0046   DEFINE_STANDARD_ALLOC
0047 
0048   Standard_EXPORT BRepOffset_Offset();
0049 
0050   Standard_EXPORT BRepOffset_Offset(const TopoDS_Face&     Face,
0051                                     const Standard_Real    Offset,
0052                                     const Standard_Boolean OffsetOutside = Standard_True,
0053                                     const GeomAbs_JoinType JoinType      = GeomAbs_Arc);
0054 
0055   //! This method will be  called when you want to share
0056   //! the  edges  soon generated  from  an other  face.
0057   //! e.g. when two faces are  tangents the common  edge
0058   //! will generate only one edge ( no pipe).
0059   //!
0060   //! The Map  will be fill  as  follow:
0061   //!
0062   //! Created(E) = E'
0063   //! with: E  = an edge of <Face>
0064   //! E' = the image of E in the offsetting  of
0065   //! another  face  sharing E  with a
0066   //! continuity at least G1
0067   Standard_EXPORT BRepOffset_Offset(const TopoDS_Face&                  Face,
0068                                     const Standard_Real                 Offset,
0069                                     const TopTools_DataMapOfShapeShape& Created,
0070                                     const Standard_Boolean OffsetOutside = Standard_True,
0071                                     const GeomAbs_JoinType JoinType      = GeomAbs_Arc);
0072 
0073   Standard_EXPORT BRepOffset_Offset(const TopoDS_Edge&     Path,
0074                                     const TopoDS_Edge&     Edge1,
0075                                     const TopoDS_Edge&     Edge2,
0076                                     const Standard_Real    Offset,
0077                                     const Standard_Boolean Polynomial = Standard_False,
0078                                     const Standard_Real    Tol        = 1.0e-4,
0079                                     const GeomAbs_Shape    Conti      = GeomAbs_C1);
0080 
0081   Standard_EXPORT BRepOffset_Offset(const TopoDS_Edge&     Path,
0082                                     const TopoDS_Edge&     Edge1,
0083                                     const TopoDS_Edge&     Edge2,
0084                                     const Standard_Real    Offset,
0085                                     const TopoDS_Edge&     FirstEdge,
0086                                     const TopoDS_Edge&     LastEdge,
0087                                     const Standard_Boolean Polynomial = Standard_False,
0088                                     const Standard_Real    Tol        = 1.0e-4,
0089                                     const GeomAbs_Shape    Conti      = GeomAbs_C1);
0090 
0091   //! Tol and Conti are only used if Polynomial is True
0092   //! (Used to perform the approximation)
0093   Standard_EXPORT BRepOffset_Offset(const TopoDS_Vertex&        Vertex,
0094                                     const TopTools_ListOfShape& LEdge,
0095                                     const Standard_Real         Offset,
0096                                     const Standard_Boolean      Polynomial = Standard_False,
0097                                     const Standard_Real         Tol        = 1.0e-4,
0098                                     const GeomAbs_Shape         Conti      = GeomAbs_C1);
0099 
0100   Standard_EXPORT void Init(const TopoDS_Face&     Face,
0101                             const Standard_Real    Offset,
0102                             const Standard_Boolean OffsetOutside = Standard_True,
0103                             const GeomAbs_JoinType JoinType      = GeomAbs_Arc);
0104 
0105   Standard_EXPORT void Init(const TopoDS_Face&                  Face,
0106                             const Standard_Real                 Offset,
0107                             const TopTools_DataMapOfShapeShape& Created,
0108                             const Standard_Boolean              OffsetOutside = Standard_True,
0109                             const GeomAbs_JoinType              JoinType      = GeomAbs_Arc);
0110 
0111   Standard_EXPORT void Init(const TopoDS_Edge&     Path,
0112                             const TopoDS_Edge&     Edge1,
0113                             const TopoDS_Edge&     Edge2,
0114                             const Standard_Real    Offset,
0115                             const Standard_Boolean Polynomial = Standard_False,
0116                             const Standard_Real    Tol        = 1.0e-4,
0117                             const GeomAbs_Shape    Conti      = GeomAbs_C1);
0118 
0119   Standard_EXPORT void Init(const TopoDS_Edge&     Path,
0120                             const TopoDS_Edge&     Edge1,
0121                             const TopoDS_Edge&     Edge2,
0122                             const Standard_Real    Offset,
0123                             const TopoDS_Edge&     FirstEdge,
0124                             const TopoDS_Edge&     LastEdge,
0125                             const Standard_Boolean Polynomial = Standard_False,
0126                             const Standard_Real    Tol        = 1.0e-4,
0127                             const GeomAbs_Shape    Conti      = GeomAbs_C1);
0128 
0129   //! Tol and Conti are only used if Polynomial is True
0130   //! (Used to perform the approximation)
0131   Standard_EXPORT void Init(const TopoDS_Vertex&        Vertex,
0132                             const TopTools_ListOfShape& LEdge,
0133                             const Standard_Real         Offset,
0134                             const Standard_Boolean      Polynomial = Standard_False,
0135                             const Standard_Real         Tol        = 1.0e-4,
0136                             const GeomAbs_Shape         Conti      = GeomAbs_C1);
0137 
0138   //! Only used in Rolling Ball. Pipe on Free Boundary
0139   Standard_EXPORT void Init(const TopoDS_Edge& Edge, const Standard_Real Offset);
0140 
0141   const TopoDS_Shape& InitialShape() const;
0142 
0143   Standard_EXPORT const TopoDS_Face& Face() const;
0144 
0145   Standard_EXPORT TopoDS_Shape Generated(const TopoDS_Shape& Shape) const;
0146 
0147   Standard_EXPORT BRepOffset_Status Status() const;
0148 
0149 protected:
0150 private:
0151   TopoDS_Shape                 myShape;
0152   BRepOffset_Status            myStatus;
0153   TopoDS_Face                  myFace;
0154   TopTools_DataMapOfShapeShape myMap;
0155 };
0156 
0157 #include <BRepOffset_Offset.lxx>
0158 
0159 #endif // _BRepOffset_Offset_HeaderFile