Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-04-14
0002 // Created by: Isabelle GRIGNON
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 _BRepGProp_Face_HeaderFile
0018 #define _BRepGProp_Face_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepAdaptor_Surface.hxx>
0025 #include <Geom2dAdaptor_Curve.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <gp_Pnt2d.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029 #include <GeomAbs_IsoType.hxx>
0030 #include <TColStd_HArray1OfReal.hxx>
0031 class TopoDS_Face;
0032 class gp_Pnt;
0033 class gp_Vec;
0034 class TopoDS_Edge;
0035 class gp_Pnt2d;
0036 class gp_Vec2d;
0037 
0038 
0039 
0040 class BRepGProp_Face 
0041 {
0042 public:
0043 
0044   DEFINE_STANDARD_ALLOC
0045 
0046   
0047   //! Constructor. Initializes the object with a flag IsUseSpan
0048   //! that says if it is necessary to define spans on a face.
0049   //! This option has an effect only for BSpline faces. Spans
0050   //! are returned by the methods GetUKnots and GetTKnots.
0051     BRepGProp_Face(const Standard_Boolean IsUseSpan = Standard_False);
0052   
0053   //! Constructor. Initializes the object with the face and the
0054   //! flag IsUseSpan that says if it is necessary to define
0055   //! spans on a face. This option has an effect only for
0056   //! BSpline faces. Spans are returned by the methods GetUKnots
0057   //! and GetTKnots.
0058     BRepGProp_Face(const TopoDS_Face& F, const Standard_Boolean IsUseSpan = Standard_False);
0059   
0060   Standard_EXPORT void Load (const TopoDS_Face& F);
0061   
0062   Standard_EXPORT Standard_Integer VIntegrationOrder() const;
0063   
0064   //! Returns Standard_True if the face is not trimmed.
0065     Standard_Boolean NaturalRestriction() const;
0066 
0067   //! Returns the TopoDS face.
0068   const TopoDS_Face& GetFace() const; 
0069   
0070   //! Returns the value of the boundary curve of the face.
0071     gp_Pnt2d Value2d (const Standard_Real U) const;
0072   
0073   Standard_EXPORT Standard_Integer SIntOrder (const Standard_Real Eps) const;
0074   
0075   Standard_EXPORT Standard_Integer SVIntSubs() const;
0076   
0077   Standard_EXPORT Standard_Integer SUIntSubs() const;
0078   
0079   Standard_EXPORT void UKnots (TColStd_Array1OfReal& Knots) const;
0080   
0081   Standard_EXPORT void VKnots (TColStd_Array1OfReal& Knots) const;
0082   
0083   Standard_EXPORT Standard_Integer LIntOrder (const Standard_Real Eps) const;
0084   
0085   Standard_EXPORT Standard_Integer LIntSubs() const;
0086   
0087   Standard_EXPORT void LKnots (TColStd_Array1OfReal& Knots) const;
0088   
0089   //! Returns the number of points required to do the
0090   //! integration in the U parametric direction with
0091   //! a good accuracy.
0092   Standard_EXPORT Standard_Integer UIntegrationOrder() const;
0093   
0094   //! Returns the parametric bounds of the Face.
0095   Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const;
0096   
0097   //! Computes the point of parameter U, V on the Face <S> and
0098   //! the normal to the face at this point.
0099   Standard_EXPORT void Normal (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& VNor) const;
0100   
0101   //! Loading the boundary arc.
0102   //! Returns FALSE if edge has no P-Curve.
0103   Standard_EXPORT bool Load (const TopoDS_Edge& E);
0104   
0105   //! Returns the parametric value of the start point of
0106   //! the current arc of curve.
0107     Standard_Real FirstParameter() const;
0108   
0109   //! Returns the parametric value of the end point of
0110   //! the current arc of curve.
0111     Standard_Real LastParameter() const;
0112   
0113   //! Returns the number of points required to do the
0114   //! integration along the parameter of curve.
0115   Standard_EXPORT Standard_Integer IntegrationOrder() const;
0116   
0117   //! Returns the point of parameter U and the first derivative
0118   //! at this point of a boundary curve.
0119     void D12d (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1) const;
0120   
0121   //! Loading the boundary arc. This arc is either a top, bottom,
0122   //! left or right bound of a UV rectangle in which the
0123   //! parameters of surface are defined.
0124   //! If IsFirstParam is equal to Standard_True, the face is
0125   //! initialized by either left of bottom bound. Otherwise it is
0126   //! initialized by the top or right one.
0127   //! If theIsoType is equal to GeomAbs_IsoU, the face is
0128   //! initialized with either left or right bound. Otherwise -
0129   //! with either top or bottom one.
0130   Standard_EXPORT void Load (const Standard_Boolean IsFirstParam, const GeomAbs_IsoType theIsoType);
0131   
0132   //! Returns an array of U knots of the face. The first and last
0133   //! elements of the array will be theUMin and theUMax. The
0134   //! middle elements will be the U Knots of the face greater
0135   //! then theUMin and lower then theUMax in increasing order.
0136   //! If the face is not a BSpline, the array initialized with
0137   //! theUMin and theUMax only.
0138   Standard_EXPORT void GetUKnots (const Standard_Real theUMin, const Standard_Real theUMax, Handle(TColStd_HArray1OfReal)& theUKnots) const;
0139   
0140   //! Returns an array of combination of T knots of the arc and
0141   //! V knots of the face. The first and last elements of the
0142   //! array will be theTMin and theTMax. The middle elements will
0143   //! be the Knots of the arc and the values of parameters of
0144   //! arc on which the value points have V coordinates close to V
0145   //! knots of face. All the parameter will be greater then
0146   //! theTMin and lower then theTMax in increasing order.
0147   //! If the face is not a BSpline, the array initialized with
0148   //! theTMin and theTMax only.
0149   Standard_EXPORT void GetTKnots (const Standard_Real theTMin, const Standard_Real theTMax, Handle(TColStd_HArray1OfReal)& theTKnots) const;
0150 
0151 
0152 
0153 
0154 protected:
0155 
0156 
0157 
0158 
0159 
0160 private:
0161 
0162 
0163 
0164   BRepAdaptor_Surface mySurface;
0165   Geom2dAdaptor_Curve myCurve;
0166   Standard_Boolean mySReverse;
0167   Standard_Boolean myIsUseSpan;
0168 
0169 
0170 };
0171 
0172 
0173 #include <BRepGProp_Face.lxx>
0174 
0175 
0176 
0177 
0178 
0179 #endif // _BRepGProp_Face_HeaderFile