Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:13

0001 // Created on: 1993-07-12
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-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 _BRepLib_MakeFace_HeaderFile
0018 #define _BRepLib_MakeFace_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepLib_FaceError.hxx>
0025 #include <BRepLib_MakeShape.hxx>
0026 class TopoDS_Face;
0027 class gp_Pln;
0028 class gp_Cylinder;
0029 class gp_Cone;
0030 class gp_Sphere;
0031 class gp_Torus;
0032 class Geom_Surface;
0033 class TopoDS_Wire;
0034 class Geom_Curve;
0035 
0036 
0037 //! Provides methods to build faces.
0038 //!
0039 //! A face may be built :
0040 //!
0041 //! * From a surface.
0042 //!
0043 //! - Elementary surface from gp.
0044 //!
0045 //! - Surface from Geom.
0046 //!
0047 //! * From a surface and U,V values.
0048 //!
0049 //! * From a wire.
0050 //!
0051 //! - Find the surface automatically if possible.
0052 //!
0053 //! * From a surface and a wire.
0054 //!
0055 //! - A flag Inside is given, when this flag is True
0056 //! the  wire is  oriented to bound a finite area on
0057 //! the surface.
0058 //!
0059 //! * From a face and a wire.
0060 //!
0061 //! - The new wire is a perforation.
0062 class BRepLib_MakeFace  : public BRepLib_MakeShape
0063 {
0064 public:
0065 
0066   DEFINE_STANDARD_ALLOC
0067 
0068   
0069   //! Not done.
0070   Standard_EXPORT BRepLib_MakeFace();
0071   
0072   //! Load a face. Useful to add wires.
0073   Standard_EXPORT BRepLib_MakeFace(const TopoDS_Face& F);
0074   
0075   //! Make a face from a plane.
0076   Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P);
0077   
0078   //! Make a face from a cylinder.
0079   Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C);
0080   
0081   //! Make a face from a cone.
0082   Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C);
0083   
0084   //! Make a face from a sphere.
0085   Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S);
0086   
0087   //! Make a face from a torus.
0088   Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C);
0089   
0090   //! Make a face from a Surface. Accepts tolerance value (TolDegen)
0091   //! for resolution of degenerated edges.
0092   Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real TolDegen);
0093   
0094   //! Make a face from a plane.
0095   Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
0096   
0097   //! Make a face from a cylinder.
0098   Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
0099   
0100   //! Make a face from a cone.
0101   Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
0102   
0103   //! Make a face from a sphere.
0104   Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
0105   
0106   //! Make a face from a torus.
0107   Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
0108   
0109   //! Make a face from a Surface. Accepts min & max parameters
0110   //! to construct the face's bounds. Also accepts tolerance value (TolDegen)
0111   //! for resolution of degenerated edges.
0112   Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real TolDegen);
0113   
0114   //! Find a surface from the wire and make a face.
0115   //! if <OnlyPlane> is true, the computed surface will be
0116   //! a plane. If it is not possible to find a plane, the
0117   //! flag NotDone will be set.
0118   Standard_EXPORT BRepLib_MakeFace(const TopoDS_Wire& W, const Standard_Boolean OnlyPlane = Standard_False);
0119   
0120   //! Make a face from a plane and a wire.
0121   Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
0122   
0123   //! Make a face from a cylinder and a wire.
0124   Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
0125   
0126   //! Make a face from a cone and a wire.
0127   Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
0128   
0129   //! Make a face from a sphere and a wire.
0130   Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
0131   
0132   //! Make a face from a torus and a wire.
0133   Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
0134   
0135   //! Make a face from a Surface and a wire.
0136   Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
0137   
0138   //! Adds the wire <W> in the face <F>
0139   Standard_EXPORT BRepLib_MakeFace(const TopoDS_Face& F, const TopoDS_Wire& W);
0140   
0141   //! Load the face.
0142   Standard_EXPORT void Init (const TopoDS_Face& F);
0143   
0144   //! Creates the face  from the  surface. If Bound is
0145   //! True a wire is made from the natural bounds.
0146   //! Accepts tolerance value (TolDegen) for resolution
0147   //! of degenerated edges.
0148   Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Boolean Bound, const Standard_Real TolDegen);
0149   
0150   //! Creates the face from the surface and the min-max
0151   //! values. Accepts tolerance value (TolDegen) for resolution
0152   //! of degenerated edges.
0153   Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real TolDegen);
0154   
0155   //! Adds the wire <W> in the current face.
0156   Standard_EXPORT void Add (const TopoDS_Wire& W);
0157   
0158   Standard_EXPORT BRepLib_FaceError Error() const;
0159   
0160   //! Returns the new face.
0161   Standard_EXPORT const TopoDS_Face& Face() const;
0162 Standard_EXPORT operator TopoDS_Face() const;
0163   
0164   //! Checks the specified curve is degenerated
0165   //! according to specified tolerance.
0166   //! Returns <theActTol> less than <theMaxTol>, which shows
0167   //! actual tolerance to decide the curve is degenerated.
0168   //! Warning: For internal use of BRepLib_MakeFace and BRepLib_MakeShell.
0169   Standard_EXPORT static Standard_Boolean IsDegenerated (const Handle(Geom_Curve)& theCurve, const Standard_Real theMaxTol, Standard_Real& theActTol);
0170 
0171 
0172 
0173 
0174 protected:
0175 
0176 
0177 
0178 
0179 
0180 private:
0181 
0182   
0183   //! Reorient the current face if  the boundary  is not
0184   //! finite.
0185   Standard_EXPORT void CheckInside();
0186 
0187 
0188   BRepLib_FaceError myError;
0189 
0190 
0191 };
0192 
0193 
0194 
0195 
0196 
0197 
0198 
0199 #endif // _BRepLib_MakeFace_HeaderFile