Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:47:18

0001 // Created on: 1993-04-14
0002 // Created by: Modelistation
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 _HLRBRep_Surface_HeaderFile
0018 #define _HLRBRep_Surface_HeaderFile
0019 
0020 #include <HLRBRep_Curve.hxx>
0021 
0022 #include <Standard.hxx>
0023 #include <Standard_DefineAlloc.hxx>
0024 
0025 #include <BRepAdaptor_Surface.hxx>
0026 #include <GeomAbs_SurfaceType.hxx>
0027 #include <TColgp_Array2OfPnt.hxx>
0028 #include <GeomAbs_Shape.hxx>
0029 #include <gp_Vec.hxx>
0030 #include <gp_Cylinder.hxx>
0031 #include <gp_Cone.hxx>
0032 #include <gp_Sphere.hxx>
0033 #include <gp_Torus.hxx>
0034 #include <gp_Ax1.hxx>
0035 class TopoDS_Face;
0036 class gp_Pnt;
0037 class gp_Vec;
0038 class gp_Pln;
0039 
0040 
0041 
0042 class HLRBRep_Surface 
0043 {
0044 public:
0045 
0046   DEFINE_STANDARD_ALLOC
0047 
0048   
0049   //! Creates an undefined surface with no face loaded.
0050   Standard_EXPORT HLRBRep_Surface();
0051   
0052   void Projector (const HLRAlgo_Projector* Proj)
0053   {
0054     myProj = Proj;
0055   }
0056   
0057   //! Returns the 3D Surface.
0058     BRepAdaptor_Surface& Surface();
0059   
0060   //! Sets the 3D Surface to be projected.
0061   Standard_EXPORT void Surface (const TopoDS_Face& F);
0062   
0063   //! returns true if it is a side face
0064   Standard_EXPORT Standard_Boolean IsSide (const Standard_Real tolf, const Standard_Real toler) const;
0065   
0066   Standard_EXPORT Standard_Boolean IsAbove (const Standard_Boolean back, const HLRBRep_Curve* A, const Standard_Real tolC) const;
0067   
0068     Standard_Real FirstUParameter() const;
0069   
0070     Standard_Real LastUParameter() const;
0071   
0072     Standard_Real FirstVParameter() const;
0073   
0074     Standard_Real LastVParameter() const;
0075   
0076     GeomAbs_Shape UContinuity() const;
0077   
0078     GeomAbs_Shape VContinuity() const;
0079   
0080   //! If necessary, breaks the surface in U intervals of
0081   //! continuity    <S>.  And   returns  the  number  of
0082   //! intervals.
0083     Standard_Integer NbUIntervals (const GeomAbs_Shape S);
0084   
0085   //! If necessary, breaks the surface in V intervals of
0086   //! continuity    <S>.  And   returns  the  number  of
0087   //! intervals.
0088     Standard_Integer NbVIntervals (const GeomAbs_Shape S);
0089   
0090     GeomAbs_Shape UIntervalContinuity() const;
0091   
0092     GeomAbs_Shape VIntervalContinuity() const;
0093   
0094     Standard_Boolean IsUClosed() const;
0095   
0096     Standard_Boolean IsVClosed() const;
0097   
0098     Standard_Boolean IsUPeriodic() const;
0099   
0100     Standard_Real UPeriod() const;
0101   
0102     Standard_Boolean IsVPeriodic() const;
0103   
0104     Standard_Real VPeriod() const;
0105   
0106   //! Computes the point of parameters U,V on the surface.
0107   Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
0108   
0109   //! Computes the point of parameters U,V on the surface.
0110     void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
0111   
0112   //! Computes the point  and the first derivatives on
0113   //! the surface.
0114   //! Raised   if  the continuity  of   the  current
0115   //! intervals is not C1.
0116     void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
0117   
0118   //! Computes   the point,  the  first  and  second
0119   //! derivatives on the surface.
0120   //! Raised  if   the   continuity   of the current
0121   //! intervals is not C2.
0122     void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const;
0123   
0124   //! Computes the point,  the first, second and third
0125   //! derivatives on the surface.
0126   //! Raised  if   the   continuity   of the current
0127   //! intervals is not C3.
0128     void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const;
0129   
0130   //! Computes  the  derivative of order   Nu  in the
0131   //! direction U and Nv in the  direction  V  at the point P(U,
0132   //! V).
0133   //! Raised if the current U  interval is not not CNu
0134   //! and the current V interval is not CNv.
0135   //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
0136     gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const;
0137   
0138   //! Returns the type of the surface : Plane, Cylinder,
0139   //! Cone,      Sphere,        Torus,    BezierSurface,
0140   //! BSplineSurface,               SurfaceOfRevolution,
0141   //! SurfaceOfExtrusion, OtherSurface
0142     GeomAbs_SurfaceType GetType() const;
0143   
0144   Standard_EXPORT gp_Pln Plane() const;
0145   
0146     gp_Cylinder Cylinder() const;
0147   
0148     gp_Cone Cone() const;
0149   
0150     gp_Sphere Sphere() const;
0151   
0152     gp_Torus Torus() const;
0153   
0154     Standard_Integer UDegree() const;
0155   
0156     Standard_Integer NbUPoles() const;
0157   
0158     Standard_Integer VDegree() const;
0159   
0160     Standard_Integer NbVPoles() const;
0161   
0162     Standard_Integer NbUKnots() const;
0163   
0164     Standard_Integer NbVKnots() const;
0165   
0166     gp_Ax1 Axis() const;
0167 
0168 
0169 
0170 
0171 protected:
0172 
0173 
0174 
0175 
0176 
0177 private:
0178 
0179   
0180   //! returns true if it is a side face
0181   Standard_EXPORT Standard_Boolean SideRowsOfPoles (const Standard_Real tol, const Standard_Integer nbuPoles, const Standard_Integer nbvPoles, TColgp_Array2OfPnt& Pnt) const;
0182 
0183 
0184   BRepAdaptor_Surface mySurf;
0185   GeomAbs_SurfaceType myType;
0186   const HLRAlgo_Projector* myProj;
0187 
0188 
0189 };
0190 
0191 
0192 #include <HLRBRep_Surface.lxx>
0193 
0194 
0195 
0196 
0197 
0198 #endif // _HLRBRep_Surface_HeaderFile