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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepFeat_HeaderFile
18 #define _BRepFeat_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TColgp_SequenceOfPnt.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TopAbs_Orientation.hxx>
28 #include <Standard_OStream.hxx>
29 #include <BRepFeat_StatusError.hxx>
34 class BRepTopAdaptor_FClass2d;
35 class Geom2dAdaptor_Curve;
39 //! BRepFeat is necessary for the
40 //! creation and manipulation of both form and mechanical features in a
41 //! Boundary Representation framework. Form features can be depressions or
42 //! protrusions and include the following types:
46 //! - Revolved feature
48 //! Depending on whether you wish to make a depression or a protrusion,
49 //! you can choose your operation type between the following:
50 //! - removing matter (a Boolean cut: Fuse setting 0)
51 //! - adding matter (Boolean fusion: Fuse setting 1)
52 //! The semantics of form feature creation is based on the
53 //! construction of shapes:
54 //! - for a certain length in a certain direction
55 //! - up to a limiting face
56 //! - from a limiting face at a height
57 //! - above and/or below a plane
58 //! The shape defining the construction of a feature can be either a
59 //! supporting edge or a concerned area of a face.
60 //! In case of supporting edge, this contour can be attached to a face
61 //! of the basis shape by binding. When the contour is bound to this face,
62 //! the information that the contour will slide on the face becomes
63 //! available to the relevant class methods. In case of the concerned
64 //! area of a face, you could, for example, cut it out and move it at
65 //! a different height, which will define the limiting face of a
66 //! protrusion or depression. Topological definition with local
67 //! operations of this sort makes calculations simpler and faster
68 //! than a global operation. The latter would entail a second phase of
69 //! removing unwanted matter to get the same result.
70 //! Mechanical features include ribs - protrusions - and grooves (or
71 //! slots) - depressions along planar (linear) surfaces or revolution surfaces.
72 //! The semantics of mechanical features is based on giving
73 //! thickness to a contour. This thickness can either be unilateral
74 //! - on one side of the contour - or bilateral - on both sides. As in
75 //! the semantics of form features, the thickness is defined by
76 //! construction of shapes in specific contexts.
77 //! However, in case of mechanical features, development contexts
78 //! differ. Here they include extrusion:
79 //! - to a limiting face of the basis shape
80 //! - to or from a limiting plane
89 Standard_EXPORT static void SampleEdges (const TopoDS_Shape& S, TColgp_SequenceOfPnt& Pt);
91 Standard_EXPORT static void Barycenter (const TopoDS_Shape& S, gp_Pnt& Pt);
93 Standard_EXPORT static Standard_Real ParametricBarycenter (const TopoDS_Shape& S, const Handle(Geom_Curve)& C);
95 //! Ori = True taking account the orientation
96 Standard_EXPORT static void ParametricMinMax (const TopoDS_Shape& S, const Handle(Geom_Curve)& C, Standard_Real& prmin, Standard_Real& prmax, Standard_Real& prbmin, Standard_Real& prbmax, Standard_Boolean& flag, const Standard_Boolean Ori = Standard_False);
98 Standard_EXPORT static Standard_Boolean IsInside (const TopoDS_Face& F1, const TopoDS_Face& F2);
100 Standard_EXPORT static Standard_Boolean IsInOut (const BRepTopAdaptor_FClass2d& FC, const Geom2dAdaptor_Curve& AC);
102 Standard_EXPORT static void FaceUntil (const TopoDS_Shape& S, TopoDS_Face& F);
104 Standard_EXPORT static TopoDS_Solid Tool (const TopoDS_Shape& SRef, const TopoDS_Face& Fac, const TopAbs_Orientation Orf);
106 //! Prints the Error description of the State <St> as a String on
107 //! the Stream <S> and returns <S>.
108 Standard_EXPORT static Standard_OStream& Print (const BRepFeat_StatusError SE, Standard_OStream& S);
112 #endif // _BRepFeat_HeaderFile