Back to home page

EIC code displayed by LXR

 
 

    


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

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_Surface_HeaderFile
0018 #define _Geom_Surface_HeaderFile
0019 
0020 #include <Geom_Curve.hxx>
0021 
0022 class gp_Trsf;
0023 class gp_GTrsf2d;
0024 class gp_Pnt;
0025 class gp_Vec;
0026 
0027 class Geom_Surface;
0028 DEFINE_STANDARD_HANDLE(Geom_Surface, Geom_Geometry)
0029 
0030 //! Describes the common behavior of surfaces in 3D space.
0031 //! The Geom package provides many implementations of concrete derived surfaces,
0032 //! such as planes, cylinders, cones, spheres and tori, surfaces of linear extrusion,
0033 //! surfaces of revolution, Bezier and BSpline surfaces, and so on.
0034 //! The key characteristic of these surfaces is that they are parameterized.
0035 //! Geom_Surface demonstrates:
0036 //! - how to work with the parametric equation of a surface
0037 //!   to compute the point of parameters (u, v), and, at this point, the 1st, 2nd ... Nth derivative;
0038 //! - how to find global information about a surface in
0039 //!   each parametric direction (for example, level of continuity, whether the surface is closed,
0040 //!   its periodicity, the bounds of the parameters and so on);
0041 //! - how the parameters change when geometric transformations are applied to the surface,
0042 //!   or the orientation is modified.
0043 //!
0044 //! Note that all surfaces must have a geometric continuity, and any surface is at least "C0".
0045 //! Generally, continuity is checked at construction time or when the curve is edited.
0046 //! Where this is not the case, the documentation makes this explicit.
0047 //!
0048 //! Warning
0049 //! The Geom package does not prevent the construction of
0050 //! surfaces with null areas, or surfaces which self-intersect.
0051 class Geom_Surface : public Geom_Geometry
0052 {
0053 
0054 public:
0055 
0056   //! Reverses the U direction of parametrization of <me>.
0057   //! The bounds of the surface are not modified.
0058   Standard_EXPORT virtual void UReverse() = 0;
0059 
0060   //! Reverses the U direction of parametrization of <me>.
0061   //! The bounds of the surface are not modified.
0062   //! A copy of <me> is returned.
0063   Standard_NODISCARD Standard_EXPORT Handle(Geom_Surface) UReversed() const;
0064 
0065   //! Returns the  parameter on the  Ureversed surface for
0066   //! the point of parameter U on <me>.
0067   //! @code
0068   //!   me->UReversed()->Value(me->UReversedParameter(U),V)
0069   //! @endcode
0070   //! is the same point as
0071   //! @code
0072   //!   me->Value(U,V)
0073   //! @endcode
0074   Standard_EXPORT virtual Standard_Real UReversedParameter (const Standard_Real U) const = 0;
0075 
0076   //! Reverses the V direction of parametrization of <me>.
0077   //! The bounds of the surface are not modified.
0078   Standard_EXPORT virtual void VReverse() = 0;
0079 
0080   //! Reverses the V direction of parametrization of <me>.
0081   //! The bounds of the surface are not modified.
0082   //! A copy of <me> is returned.
0083   Standard_NODISCARD Standard_EXPORT Handle(Geom_Surface) VReversed() const;
0084 
0085   //! Returns the  parameter on the  Vreversed surface for
0086   //! the point of parameter V on <me>.
0087   //! @code
0088   //!   me->VReversed()->Value(U,me->VReversedParameter(V))
0089   //! @endcode
0090   //! is the same point as
0091   //! @code
0092   //!   me->Value(U,V)
0093   //! @endcode
0094   Standard_EXPORT virtual Standard_Real VReversedParameter (const Standard_Real V) const = 0;
0095 
0096   //! Computes the  parameters on the  transformed  surface for
0097   //! the transform of the point of parameters U,V on <me>.
0098   //! @code
0099   //!   me->Transformed(T)->Value(U',V')
0100   //! @endcode
0101   //! is the same point as
0102   //! @code
0103   //!   me->Value(U,V).Transformed(T)
0104   //! @endcode
0105   //! Where U',V' are the new values of U,V after calling
0106   //! @code
0107   //!   me->TransformParameters(U,V,T)
0108   //! @endcode
0109   //! This method does not change <U> and <V>
0110   //!
0111   //! It  can be redefined.  For  example on  the Plane,
0112   //! Cylinder, Cone, Revolved and Extruded surfaces.
0113   Standard_EXPORT virtual void TransformParameters (Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const;
0114   
0115   //! Returns a 2d transformation  used to find the  new
0116   //! parameters of a point on the transformed surface.
0117   //! @code
0118   //!   me->Transformed(T)->Value(U',V')
0119   //! @endcode
0120   //! is the same point as
0121   //! @code
0122   //!   me->Value(U,V).Transformed(T)
0123   //! @endcode
0124   //! Where U',V' are  obtained by transforming U,V with
0125   //! the 2d transformation returned by
0126   //! @code
0127   //!   me->ParametricTransformation(T)
0128   //! @endcode
0129   //! This method returns an identity transformation
0130   //!
0131   //! It  can be redefined.  For  example on  the Plane,
0132   //! Cylinder, Cone, Revolved and Extruded surfaces.
0133   Standard_EXPORT virtual gp_GTrsf2d ParametricTransformation (const gp_Trsf& T) const;
0134 
0135   //! Returns the parametric bounds U1, U2, V1 and V2 of this surface.
0136   //! If the surface is infinite, this function can return a value
0137   //! equal to Precision::Infinite: instead of Standard_Real::LastReal.
0138   Standard_EXPORT virtual void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const = 0;
0139 
0140   //! Checks whether this surface is closed in the u parametric direction.
0141   //! Returns true if, in the u parametric direction:
0142   //! taking uFirst and uLast as the parametric bounds in
0143   //! the u parametric direction, for each parameter v,
0144   //! the distance between the points P(uFirst, v) and
0145   //! P(uLast, v) is less than or equal to gp::Resolution().
0146   Standard_EXPORT virtual Standard_Boolean IsUClosed() const = 0;
0147 
0148   //! Checks whether this surface is closed in the u parametric direction.
0149   //! Returns true if, in the v parametric direction:
0150   //! taking vFirst and vLast as the parametric bounds in the v parametric direction,
0151   //! for each parameter u, the distance between the points
0152   //! P(u, vFirst) and P(u, vLast) is less than or equal to gp::Resolution().
0153   Standard_EXPORT virtual Standard_Boolean IsVClosed() const = 0;
0154 
0155   //! Checks if this surface is periodic in the u parametric direction.
0156   //! Returns true if:
0157   //! - this surface is closed in the u parametric direction, and
0158   //! - there is a constant T such that the distance
0159   //!   between the points P (u, v) and P (u + T, v)
0160   //!   (or the points P (u, v) and P (u, v + T)) is less than or equal to gp::Resolution().
0161   //!
0162   //! Note: T is the parametric period in the u parametric direction.
0163   Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const = 0;
0164 
0165   //! Returns the period of this surface in the u parametric direction.
0166   //! Raises if the surface is not uperiodic.
0167   Standard_EXPORT virtual Standard_Real UPeriod() const;
0168 
0169   //! Checks if this surface is periodic in the v parametric direction.
0170   //! Returns true if:
0171   //! - this surface is closed in the v parametric direction, and
0172   //! - there is a constant T such that the distance
0173   //!   between the points P (u, v) and P (u + T, v)
0174   //!   (or the points P (u, v) and P (u, v + T)) is less than or equal to gp::Resolution().
0175   //!
0176   //! Note: T is the parametric period in the v parametric direction.
0177   Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const = 0;
0178 
0179   //! Returns the period of this surface in the v parametric direction.
0180   //! raises if the surface is not vperiodic.
0181   Standard_EXPORT virtual Standard_Real VPeriod() const;
0182 
0183   //! Computes the U isoparametric curve.
0184   Standard_EXPORT virtual Handle(Geom_Curve) UIso (const Standard_Real U) const = 0;
0185 
0186   //! Computes the V isoparametric curve.
0187   Standard_EXPORT virtual Handle(Geom_Curve) VIso (const Standard_Real V) const = 0;
0188 
0189   //! Returns the Global Continuity of the surface in direction U and V :
0190   //! - C0: only geometric continuity,
0191   //! - C1: continuity of the first derivative all along the surface,
0192   //! - C2: continuity of the second derivative all along the surface,
0193   //! - C3: continuity of the third derivative all along the surface,
0194   //! - G1: tangency continuity all along the surface,
0195   //! - G2: curvature continuity all along the surface,
0196   //! - CN: the order of continuity is infinite.
0197   //!
0198   //! Example:
0199   //! If the surface is C1 in the V parametric direction and C2
0200   //! in the U parametric direction Shape = C1.
0201   Standard_EXPORT virtual GeomAbs_Shape Continuity() const = 0;
0202 
0203   //! Returns the order of continuity of the surface in the U parametric direction.
0204   //! Raised if N < 0.
0205   Standard_EXPORT virtual Standard_Boolean IsCNu (const Standard_Integer N) const = 0;
0206 
0207   //! Returns the order of continuity of the surface in the V parametric direction.
0208   //! Raised if N < 0.
0209   Standard_EXPORT virtual Standard_Boolean IsCNv (const Standard_Integer N) const = 0;
0210 
0211   //! Computes the point of parameter U,V on the surface.
0212   //!
0213   //! Raised only for an "OffsetSurface" if it is not possible to
0214   //! compute the current point.
0215   Standard_EXPORT virtual void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const = 0;
0216 
0217 
0218   //! Computes the point P and the first derivatives in the directions U and V at this point.
0219   //! Raised if the continuity of the surface is not C1.
0220   //!
0221   //! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
0222   Standard_EXPORT virtual void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const = 0;
0223 
0224   //! Computes the point P, the first and the second derivatives in
0225   //! the directions U and V at this point.
0226   //! Raised if the continuity of the surface is not C2.
0227   Standard_EXPORT virtual 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 = 0;
0228 
0229   //! Computes the point P, the first,the second and the third
0230   //! derivatives in the directions U and V at this point.
0231   //! Raised if the continuity of the surface is not C2.
0232   Standard_EXPORT virtual 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 = 0;
0233 
0234   //! Computes the derivative of order Nu in the direction U and Nv in the direction V at the point P(U, V).
0235   //!
0236   //! Raised if the continuity of the surface is not CNu in the U direction or not CNv in the V direction.
0237   //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
0238   Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const = 0;
0239 
0240   //! Computes the point of parameter (U, V) on the surface.
0241   //!
0242   //! It is implemented with D0.
0243   //! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
0244   //!
0245   //! Raised only for an "OffsetSurface" if it is not possible to compute the current point.
0246   Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
0247 
0248   //! Dumps the content of me into the stream
0249   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0250 
0251   DEFINE_STANDARD_RTTIEXT(Geom_Surface,Geom_Geometry)
0252 
0253 };
0254 
0255 #endif // _Geom_Surface_HeaderFile