Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:15:46

0001 // Created on: 1993-03-10
0002 // Created by: JCV
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 _Geom_CylindricalSurface_HeaderFile
0018 #define _Geom_CylindricalSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Geom_ElementarySurface.hxx>
0024 
0025 class gp_Ax3;
0026 class gp_Cylinder;
0027 class gp_Trsf;
0028 class gp_GTrsf2d;
0029 class Geom_Geometry;
0030 
0031 //! This class defines the infinite cylindrical surface.
0032 //!
0033 //! Every cylindrical surface is set by the following equation:
0034 //! @code
0035 //!   S(U,V) = Location + R*cos(U)*XAxis + R*sin(U)*YAxis + V*ZAxis,
0036 //! @endcode
0037 //! where R is cylinder radius.
0038 //!
0039 //! The local coordinate system of the CylindricalSurface is defined
0040 //! with an axis placement (see class ElementarySurface).
0041 //!
0042 //! The "ZAxis" is the symmetry axis of the CylindricalSurface,
0043 //! it gives the direction of increasing parametric value V.
0044 //!
0045 //! The parametrization range is :
0046 //! @code
0047 //!   U [0, 2*PI], V ]- infinite, + infinite[
0048 //! @endcode
0049 //!
0050 //! The "XAxis" and the "YAxis" define the placement plane of the
0051 //! surface (Z = 0, and parametric value V = 0) perpendicular to
0052 //! the symmetry axis. The "XAxis" defines the origin of the
0053 //! parameter U = 0. The trigonometric sense gives the positive
0054 //! orientation for the parameter U.
0055 //!
0056 //! When you create a CylindricalSurface the U and V directions of
0057 //! parametrization are such that at each point of the surface the
0058 //! normal is oriented towards the "outside region".
0059 //!
0060 //! The methods UReverse VReverse change the orientation of the
0061 //! surface.
0062 class Geom_CylindricalSurface : public Geom_ElementarySurface
0063 {
0064 
0065 public:
0066   //! A3 defines the local coordinate system of the cylindrical surface.
0067   //! The "ZDirection" of A3 defines the direction of the surface's axis of symmetry.
0068   //! At the creation the parametrization of the surface is defined
0069   //! such that the normal Vector (N = D1U ^ D1V) is oriented towards
0070   //! the "outside region" of the surface.
0071   //! Warnings:
0072   //! It is not forbidden to create a cylindrical surface with
0073   //! Radius = 0.0
0074   //! Raised if Radius < 0.0
0075   Standard_EXPORT Geom_CylindricalSurface(const gp_Ax3& A3, const double Radius);
0076 
0077   //! Creates a CylindricalSurface from a non transient gp_Cylinder.
0078   Standard_EXPORT Geom_CylindricalSurface(const gp_Cylinder& C);
0079 
0080   //! Set <me> so that <me> has the same geometric properties as C.
0081   Standard_EXPORT void SetCylinder(const gp_Cylinder& C);
0082 
0083   //! Changes the radius of the cylinder.
0084   //! Raised if R < 0.0
0085   Standard_EXPORT void SetRadius(const double R);
0086 
0087   //! returns a non transient cylinder with the same geometric properties as <me>.
0088   Standard_EXPORT gp_Cylinder Cylinder() const;
0089 
0090   //! Return the parameter on the Ureversed surface for
0091   //! the point of parameter U on <me>.
0092   //! Return 2.PI - U.
0093   Standard_EXPORT double UReversedParameter(const double U) const final;
0094 
0095   //! Return the parameter on the Vreversed surface for
0096   //! the point of parameter V on <me>.
0097   //! Return -V
0098   Standard_EXPORT double VReversedParameter(const double V) const final;
0099 
0100   //! Computes the parameters on the transformed surface for
0101   //! the transform of the point of parameters U,V on <me>.
0102   //! @code
0103   //!   me->Transformed(T)->Value(U',V')
0104   //! @endcode
0105   //! is the same point as
0106   //! @code
0107   //!   me->Value(U,V).Transformed(T)
0108   //! @endcode
0109   //! Where U',V' are the new values of U,V after calling
0110   //! @code
0111   //!   me->TransformParameters(U,V,T)
0112   //! @endcode
0113   //! This method multiplies V by T.ScaleFactor()
0114   Standard_EXPORT void TransformParameters(double& U, double& V, const gp_Trsf& T) const final;
0115 
0116   //! Returns a 2d transformation used to find the new
0117   //! parameters of a point on the transformed surface.
0118   //! @code
0119   //!   me->Transformed(T)->Value(U',V')
0120   //! @endcode
0121   //! is the same point as
0122   //! @code
0123   //!   me->Value(U,V).Transformed(T)
0124   //! @endcode
0125   //! Where U',V' are obtained by transforming U,V with the 2d transformation returned by
0126   //! @code
0127   //!   me->ParametricTransformation(T)
0128   //! @endcode
0129   //! This method returns a scale centered on the U axis with T.ScaleFactor
0130   Standard_EXPORT gp_GTrsf2d ParametricTransformation(const gp_Trsf& T) const final;
0131 
0132   //! The CylindricalSurface is infinite in the V direction so
0133   //! V1 = Realfirst, V2 = RealLast from package Standard.
0134   //! U1 = 0 and U2 = 2*PI.
0135   Standard_EXPORT void Bounds(double& U1, double& U2, double& V1, double& V2) const final;
0136 
0137   //! Returns the coefficients of the implicit equation of the quadric
0138   //! in the absolute cartesian coordinate system :
0139   //! These coefficients are normalized.
0140   //! @code
0141   //! A1.X**2 + A2.Y**2 + A3.Z**2 + 2.(B1.X.Y + B2.X.Z + B3.Y.Z) + 2.(C1.X + C2.Y + C3.Z) + D = 0.0
0142   //! @endcode
0143   Standard_EXPORT void Coefficients(double& A1,
0144                                     double& A2,
0145                                     double& A3,
0146                                     double& B1,
0147                                     double& B2,
0148                                     double& B3,
0149                                     double& C1,
0150                                     double& C2,
0151                                     double& C3,
0152                                     double& D) const;
0153 
0154   //! Returns the radius of this cylinder.
0155   Standard_EXPORT double Radius() const;
0156 
0157   //! Returns True.
0158   Standard_EXPORT bool IsUClosed() const final;
0159 
0160   //! Returns False.
0161   Standard_EXPORT bool IsVClosed() const final;
0162 
0163   //! Returns True.
0164   Standard_EXPORT bool IsUPeriodic() const final;
0165 
0166   //! Returns False.
0167   Standard_EXPORT bool IsVPeriodic() const final;
0168 
0169   //! The UIso curve is a Line. The location point of this line is
0170   //! on the placement plane (XAxis, YAxis) of the surface.
0171   //! This line is parallel to the axis of symmetry of the surface.
0172   Standard_EXPORT occ::handle<Geom_Curve> UIso(const double U) const final;
0173 
0174   //! The VIso curve is a circle. The start point of this circle
0175   //! (U = 0) is defined with the "XAxis" of the surface.
0176   //! The center of the circle is on the symmetry axis.
0177   Standard_EXPORT occ::handle<Geom_Curve> VIso(const double V) const final;
0178 
0179   //! Computes the point P (U, V) on the surface.
0180   //! P (U, V) = Loc + Radius * (cos (U) * XDir + sin (U) * YDir) +
0181   //! V * ZDir
0182   //! where Loc is the origin of the placement plane (XAxis, YAxis)
0183   //! XDir is the direction of the XAxis and YDir the direction of
0184   //! the YAxis.
0185   Standard_EXPORT gp_Pnt EvalD0(const double U, const double V) const final;
0186 
0187   //! Computes the current point and the first derivatives in the
0188   //! directions U and V.
0189   Standard_EXPORT Geom_Surface::ResD1 EvalD1(const double U, const double V) const final;
0190 
0191   //! Computes the current point, the first and the second derivatives
0192   //! in the directions U and V.
0193   Standard_EXPORT Geom_Surface::ResD2 EvalD2(const double U, const double V) const final;
0194 
0195   //! Computes the current point, the first, the second and the
0196   //! third derivatives in the directions U and V.
0197   Standard_EXPORT Geom_Surface::ResD3 EvalD3(const double U, const double V) const final;
0198 
0199   //! Computes the derivative of order Nu in the direction u and Nv
0200   //! in the direction v.
0201   //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
0202   Standard_EXPORT gp_Vec EvalDN(const double U,
0203                                 const double V,
0204                                 const int    Nu,
0205                                 const int    Nv) const final;
0206 
0207   //! Applies the transformation T to this cylinder.
0208   Standard_EXPORT void Transform(const gp_Trsf& T) final;
0209 
0210   //! Creates a new object which is a copy of this cylinder.
0211   Standard_EXPORT occ::handle<Geom_Geometry> Copy() const final;
0212 
0213   //! Dumps the content of me into the stream
0214   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const final;
0215 
0216   DEFINE_STANDARD_RTTIEXT(Geom_CylindricalSurface, Geom_ElementarySurface)
0217 
0218 private:
0219   double radius;
0220 };
0221 
0222 #endif // _Geom_CylindricalSurface_HeaderFile