Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-04-21
0002 // Created by: Bruno DUMORTIER
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 _GeomAdaptor_SurfaceOfRevolution_HeaderFile
0018 #define _GeomAdaptor_SurfaceOfRevolution_HeaderFile
0019 
0020 #include <GeomAdaptor_Surface.hxx>
0021 
0022 class gp_Pln;
0023 class gp_Cylinder;
0024 class gp_Cone;
0025 class gp_Sphere;
0026 class gp_Torus;
0027 class Geom_BezierSurface;
0028 class Geom_BSplineSurface;
0029 
0030 DEFINE_STANDARD_HANDLE(GeomAdaptor_SurfaceOfRevolution, GeomAdaptor_Surface)
0031 
0032 //! This class defines a complete surface of revolution.
0033 //! The surface is obtained by rotating a curve a complete revolution
0034 //! about an axis. The curve and the axis must be in the same plane.
0035 //! If the curve and the axis are not in the same plane it is always
0036 //! possible to be in the previous case after a cylindrical projection
0037 //! of the curve in a referenced plane.
0038 //! For a complete surface of revolution the parametric range is
0039 //! 0 <= U <= 2*PI.       --
0040 //! The parametric range for V is defined with the revolved curve.
0041 //! The origin of the U parametrization is given by the position
0042 //! of the revolved curve (reference). The direction of the revolution
0043 //! axis defines the positive sense of rotation (trigonometric sense)
0044 //! corresponding to the increasing of the parametric value U.
0045 //! The derivatives are always defined for the u direction.
0046 //! For the v direction the definition of the derivatives depends on
0047 //! the degree of continuity of the referenced curve.
0048 class GeomAdaptor_SurfaceOfRevolution  : public GeomAdaptor_Surface
0049 {
0050   DEFINE_STANDARD_RTTIEXT(GeomAdaptor_SurfaceOfRevolution, GeomAdaptor_Surface)
0051 public:
0052 
0053   Standard_EXPORT GeomAdaptor_SurfaceOfRevolution();
0054   
0055   //! The Curve is loaded.
0056   Standard_EXPORT GeomAdaptor_SurfaceOfRevolution(const Handle(Adaptor3d_Curve)& C);
0057   
0058   //! The Curve and the Direction are loaded.
0059   Standard_EXPORT GeomAdaptor_SurfaceOfRevolution(const Handle(Adaptor3d_Curve)& C, const gp_Ax1& V);
0060 
0061   //! Shallow copy of adaptor
0062   Standard_EXPORT virtual Handle(Adaptor3d_Surface) ShallowCopy() const Standard_OVERRIDE;
0063   
0064   //! Changes the Curve
0065   Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C);
0066   
0067   //! Changes the Direction
0068   Standard_EXPORT void Load (const gp_Ax1& V);
0069   
0070   Standard_EXPORT gp_Ax1 AxeOfRevolution() const Standard_OVERRIDE;
0071   
0072   Standard_EXPORT Standard_Real FirstUParameter() const Standard_OVERRIDE;
0073   
0074   Standard_EXPORT Standard_Real LastUParameter() const Standard_OVERRIDE;
0075   
0076   Standard_EXPORT Standard_Real FirstVParameter() const Standard_OVERRIDE;
0077   
0078   Standard_EXPORT Standard_Real LastVParameter() const Standard_OVERRIDE;
0079   
0080   Standard_EXPORT GeomAbs_Shape UContinuity() const Standard_OVERRIDE;
0081   
0082   //! Return CN.
0083   Standard_EXPORT GeomAbs_Shape VContinuity() const Standard_OVERRIDE;
0084   
0085   //! Returns the number of U intervals for  continuity
0086   //! <S>. May be one if UContinuity(me) >= <S>
0087   Standard_EXPORT Standard_Integer NbUIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0088   
0089   //! Returns the number of V intervals for  continuity
0090   //! <S>. May be one if VContinuity(me) >= <S>
0091   Standard_EXPORT Standard_Integer NbVIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0092   
0093   //! Returns the  intervals with the requested continuity
0094   //! in the U direction.
0095   Standard_EXPORT void UIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0096   
0097   //! Returns the  intervals with the requested continuity
0098   //! in the V direction.
0099   Standard_EXPORT void VIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0100   
0101   //! Returns    a  surface trimmed in the U direction
0102   //! equivalent   of  <me>  between
0103   //! parameters <First>  and <Last>. <Tol>  is used  to
0104   //! test for 3d points confusion.
0105   //! If <First> >= <Last>
0106   Standard_EXPORT Handle(Adaptor3d_Surface) UTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
0107   
0108   //! Returns    a  surface trimmed in the V direction  between
0109   //! parameters <First>  and <Last>. <Tol>  is used  to
0110   //! test for 3d points confusion.
0111   //! If <First> >= <Last>
0112   Standard_EXPORT Handle(Adaptor3d_Surface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
0113   
0114   Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
0115   
0116   Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
0117   
0118   Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
0119   
0120   Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE;
0121   
0122   Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
0123   
0124   Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE;
0125 
0126   //! Returns the parametric U  resolution corresponding
0127   //! to the real space resolution <R3d>.
0128   Standard_EXPORT Standard_Real UResolution (const Standard_Real R3d) const Standard_OVERRIDE;
0129   
0130   //! Returns the parametric V  resolution corresponding
0131   //! to the real space resolution <R3d>.
0132   Standard_EXPORT Standard_Real VResolution (const Standard_Real R3d) const Standard_OVERRIDE;
0133   
0134   //! Returns the type of the surface : Plane, Cylinder,
0135   //! Cone,      Sphere,        Torus,    BezierSurface,
0136   //! BSplineSurface,               SurfaceOfRevolution,
0137   //! SurfaceOfExtrusion, OtherSurface
0138   Standard_EXPORT GeomAbs_SurfaceType GetType() const Standard_OVERRIDE;
0139   
0140   Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE;
0141   
0142   Standard_EXPORT gp_Cylinder Cylinder() const Standard_OVERRIDE;
0143   
0144   //! Apex of the Cone = Cone.Position().Location()
0145   //! ==> ReferenceRadius = 0.
0146   Standard_EXPORT gp_Cone Cone() const Standard_OVERRIDE;
0147   
0148   Standard_EXPORT gp_Sphere Sphere() const Standard_OVERRIDE;
0149   
0150   Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE;
0151 
0152   Standard_EXPORT Standard_Integer VDegree() const Standard_OVERRIDE;
0153   
0154   Standard_EXPORT Standard_Integer NbVPoles() const Standard_OVERRIDE;
0155 
0156   Standard_EXPORT Standard_Integer NbVKnots() const Standard_OVERRIDE;
0157   
0158   Standard_EXPORT Standard_Boolean IsURational() const Standard_OVERRIDE;
0159   
0160   Standard_EXPORT Standard_Boolean IsVRational() const Standard_OVERRIDE;
0161   
0162   Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE;
0163   
0164   Standard_EXPORT Handle(Geom_BSplineSurface) BSpline() const Standard_OVERRIDE;
0165   
0166   Standard_EXPORT const gp_Ax3& Axis() const;
0167   
0168   Standard_EXPORT Handle(Adaptor3d_Curve) BasisCurve() const Standard_OVERRIDE;
0169 
0170 private:
0171   Handle(Adaptor3d_Curve) myBasisCurve; ///< revolved curve
0172   gp_Ax1                   myAxis;       ///< axis of revolution
0173   Standard_Boolean         myHaveAxis;   ///< whether axis of revolution is initialized
0174   gp_Ax3                   myAxeRev;     ///< auxiliary trihedron according to the curve position
0175 };
0176 
0177 #endif // _GeomAdaptor_SurfaceOfRevolution_HeaderFile