Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-07 08:44:47

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_HeaderFile
0018 #define _BRepFeat_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColgp_SequenceOfPnt.hxx>
0025 #include <Standard_Real.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <TopAbs_Orientation.hxx>
0028 #include <Standard_OStream.hxx>
0029 #include <BRepFeat_StatusError.hxx>
0030 class TopoDS_Shape;
0031 class gp_Pnt;
0032 class Geom_Curve;
0033 class TopoDS_Face;
0034 class BRepTopAdaptor_FClass2d;
0035 class Geom2dAdaptor_Curve;
0036 class TopoDS_Solid;
0037 
0038 //! BRepFeat is necessary for the
0039 //! creation and manipulation of both form and mechanical features in a
0040 //! Boundary Representation framework. Form features can be depressions or
0041 //! protrusions and include the following types:
0042 //! -          Cylinder
0043 //! -          Draft Prism
0044 //! -          Prism
0045 //! -          Revolved feature
0046 //! -          Pipe
0047 //! Depending on whether you wish to make a depression or a protrusion,
0048 //! you can choose your operation type between the following:
0049 //! - removing matter (a Boolean cut: Fuse setting 0)
0050 //! - adding matter (Boolean fusion: Fuse setting 1)
0051 //! The semantics of form feature creation is based on the
0052 //! construction of shapes:
0053 //! -          for a certain length in a certain direction
0054 //! -          up to a limiting face
0055 //! -          from a limiting face at a height
0056 //! -          above and/or below a plane
0057 //! The shape defining the construction of a feature can be either a
0058 //! supporting edge or a concerned area of a face.
0059 //! In case of supporting edge, this contour can be attached to a face
0060 //! of the basis shape by binding. When the contour is bound to this face,
0061 //! the information that the contour will slide on the face becomes
0062 //! available to the relevant class methods. In case of the concerned
0063 //! area of a face, you could, for example, cut it out and move it at
0064 //! a different height, which will define the limiting face of a
0065 //! protrusion or depression. Topological definition with local
0066 //! operations of this sort makes calculations simpler and faster
0067 //! than a global operation. The latter would entail a second phase of
0068 //! removing unwanted matter to get the same result.
0069 //! Mechanical features include ribs - protrusions - and grooves (or
0070 //! slots) - depressions along planar (linear) surfaces or revolution surfaces.
0071 //! The semantics of mechanical features is based on giving
0072 //! thickness to a contour. This thickness can either be unilateral
0073 //! - on one side of the contour - or bilateral - on both sides. As in
0074 //! the semantics of form features, the thickness is defined by
0075 //! construction of shapes in specific contexts.
0076 //! However, in case of mechanical features, development contexts
0077 //! differ. Here they include extrusion:
0078 //! -          to a limiting face of the basis shape
0079 //! -          to or from a limiting plane
0080 //! -          to a height.
0081 class BRepFeat
0082 {
0083 public:
0084   DEFINE_STANDARD_ALLOC
0085 
0086   Standard_EXPORT static void SampleEdges(const TopoDS_Shape& S, TColgp_SequenceOfPnt& Pt);
0087 
0088   Standard_EXPORT static void Barycenter(const TopoDS_Shape& S, gp_Pnt& Pt);
0089 
0090   Standard_EXPORT static Standard_Real ParametricBarycenter(const TopoDS_Shape&       S,
0091                                                             const Handle(Geom_Curve)& C);
0092 
0093   //! Ori = True taking account the orientation
0094   Standard_EXPORT static void ParametricMinMax(const TopoDS_Shape&       S,
0095                                                const Handle(Geom_Curve)& C,
0096                                                Standard_Real&            prmin,
0097                                                Standard_Real&            prmax,
0098                                                Standard_Real&            prbmin,
0099                                                Standard_Real&            prbmax,
0100                                                Standard_Boolean&         flag,
0101                                                const Standard_Boolean    Ori = Standard_False);
0102 
0103   Standard_EXPORT static Standard_Boolean IsInside(const TopoDS_Face& F1, const TopoDS_Face& F2);
0104 
0105   Standard_EXPORT static Standard_Boolean IsInOut(const BRepTopAdaptor_FClass2d& FC,
0106                                                   const Geom2dAdaptor_Curve&     AC);
0107 
0108   Standard_EXPORT static void FaceUntil(const TopoDS_Shape& S, TopoDS_Face& F);
0109 
0110   Standard_EXPORT static TopoDS_Solid Tool(const TopoDS_Shape&      SRef,
0111                                            const TopoDS_Face&       Fac,
0112                                            const TopAbs_Orientation Orf);
0113 
0114   //! Prints the Error description of the State <St> as a String on
0115   //! the Stream <S> and returns <S>.
0116   Standard_EXPORT static Standard_OStream& Print(const BRepFeat_StatusError SE,
0117                                                  Standard_OStream&          S);
0118 };
0119 
0120 #endif // _BRepFeat_HeaderFile