Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:27

0001 // Created on: 1996-07-26
0002 // Created by: Maria PUMBORIOS
0003 // Copyright (c) 1996-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 _FilletSurf_Builder_HeaderFile
0018 #define _FilletSurf_Builder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <FilletSurf_InternalBuilder.hxx>
0025 #include <FilletSurf_StatusDone.hxx>
0026 #include <FilletSurf_ErrorTypeStatus.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 #include <NCollection_List.hxx>
0029 #include <Standard_Real.hxx>
0030 #include <Standard_Integer.hxx>
0031 #include <FilletSurf_StatusType.hxx>
0032 class TopoDS_Shape;
0033 class Geom_Surface;
0034 class TopoDS_Face;
0035 class Geom_Curve;
0036 class Geom2d_Curve;
0037 class Geom_TrimmedCurve;
0038 
0039 //! API giving the following geometric information about fillets
0040 //! list of corresponding NUBS surfaces
0041 //! for each surface:
0042 //! the 2 support faces
0043 //! on each face: the 3d curve and the corresponding 2d curve
0044 //! the 2d curves on the fillet
0045 //! status of start and end section of the fillet
0046 //! first and last parameter on edge of the fillet.
0047 class FilletSurf_Builder
0048 {
0049 public:
0050   DEFINE_STANDARD_ALLOC
0051 
0052   //! initialize of the information necessary for the
0053   //! computation of the fillet on the
0054   //! Shape S from a list of edges E and a radius R.
0055   //!
0056   //! Ta is the angular tolerance
0057   //! Tapp3d is the 3d approximation tolerance
0058   //! Tapp2d is the 2d approximation tolerance
0059   Standard_EXPORT FilletSurf_Builder(const TopoDS_Shape&                   S,
0060                                      const NCollection_List<TopoDS_Shape>& E,
0061                                      const double                          R,
0062                                      const double                          Ta     = 1.0e-2,
0063                                      const double                          Tapp3d = 1.0e-4,
0064                                      const double                          Tapp2d = 1.0e-5);
0065 
0066   //! ---Purpose computation of the fillet (list of NUBS)
0067   Standard_EXPORT void Perform();
0068 
0069   Standard_EXPORT void Simulate();
0070 
0071   //! gives the status about the computation of the fillet
0072   //! returns:
0073   //! IsOK :no problem during the computation
0074   //! IsNotOk: no result is produced
0075   //! IsPartial: the result is partial
0076   Standard_EXPORT FilletSurf_StatusDone IsDone() const;
0077 
0078   //! gives information about error status if
0079   //! IsDone=IsNotOk
0080   //! returns
0081   //! EdgeNotG1: the edges are not G1
0082   //! FacesNotG1 : two connected faces on a same support are
0083   //! not G1
0084   //! EdgeNotOnShape: the edge is not on shape
0085   //! NotSharpEdge: the edge is not sharp
0086   //! PbFilletCompute: problem during the computation of the fillet
0087   Standard_EXPORT FilletSurf_ErrorTypeStatus StatusError() const;
0088 
0089   //! gives the number of NUBS surfaces of the Fillet.
0090   Standard_EXPORT int NbSurface() const;
0091 
0092   //! Returns the arc of the section of index IndexSec of surface
0093   //! of index IndexSurf. The basis curve of the trimmed curve is a Geom_Circle.
0094   //! @param[in] IndexSurf 1-based surface index
0095   //! @param[in] IndexSec 1-based section index
0096   //! @return the section as a trimmed circular arc
0097   [[nodiscard]] Standard_EXPORT occ::handle<Geom_TrimmedCurve> Section(const int IndexSurf,
0098                                                                        const int IndexSec) const;
0099 
0100   //! @deprecated Use Section() returning handle by value instead.
0101   Standard_DEPRECATED("Use Section() returning handle by value instead")
0102   Standard_EXPORT void Section(const int                       IndexSurf,
0103                                const int                       IndexSec,
0104                                occ::handle<Geom_TrimmedCurve>& Circ) const;
0105 
0106   //! gives the NUBS surface of index Index.
0107   Standard_EXPORT const occ::handle<Geom_Surface>& SurfaceFillet(const int Index) const;
0108 
0109   //! gives the 3d tolerance reached during approximation
0110   //! of surface of index Index
0111   Standard_EXPORT double TolApp3d(const int Index) const;
0112 
0113   //! gives the first support face relative to SurfaceFillet(Index);
0114   Standard_EXPORT const TopoDS_Face& SupportFace1(const int Index) const;
0115 
0116   //! gives the second support face relative to SurfaceFillet(Index);
0117   Standard_EXPORT const TopoDS_Face& SupportFace2(const int Index) const;
0118 
0119   //! gives the 3d curve of SurfaceFillet(Index) on SupportFace1(Index)
0120   Standard_EXPORT const occ::handle<Geom_Curve>& CurveOnFace1(const int Index) const;
0121 
0122   //! gives the 3d curve of SurfaceFillet(Index) on SupportFace2(Index)
0123   Standard_EXPORT const occ::handle<Geom_Curve>& CurveOnFace2(const int Index) const;
0124 
0125   //! gives the PCurve associated to CurvOnSup1(Index) on the support face
0126   Standard_EXPORT const occ::handle<Geom2d_Curve>& PCurveOnFace1(const int Index) const;
0127 
0128   //! gives the PCurve associated to CurveOnFace1(Index) on the Fillet
0129   Standard_EXPORT const occ::handle<Geom2d_Curve>& PCurve1OnFillet(const int Index) const;
0130 
0131   //! gives the PCurve associated to CurveOnSup2(Index) on the support face
0132   Standard_EXPORT const occ::handle<Geom2d_Curve>& PCurveOnFace2(const int Index) const;
0133 
0134   //! gives the PCurve associated to CurveOnSup2(Index) on the fillet
0135   Standard_EXPORT const occ::handle<Geom2d_Curve>& PCurve2OnFillet(const int Index) const;
0136 
0137   //! gives the parameter of the fillet on the first edge.
0138   Standard_EXPORT double FirstParameter() const;
0139 
0140   //! gives the parameter of the fillet on the last edge
0141   Standard_EXPORT double LastParameter() const;
0142 
0143   Standard_EXPORT FilletSurf_StatusType StartSectionStatus() const;
0144 
0145   Standard_EXPORT FilletSurf_StatusType EndSectionStatus() const;
0146 
0147   Standard_EXPORT int NbSection(const int IndexSurf) const;
0148 
0149 private:
0150   FilletSurf_InternalBuilder myIntBuild;
0151   FilletSurf_StatusDone      myisdone;
0152   FilletSurf_ErrorTypeStatus myerrorstatus;
0153 };
0154 
0155 #endif // _FilletSurf_Builder_HeaderFile