Back to home page

EIC code displayed by LXR

 
 

    


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

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