Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:58:02

0001 // Created on: 1996-11-21
0002 // Created by: Joelle CHAUVET
0003 // Copyright (c) 1996-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 _GeomPlate_Surface_HeaderFile
0018 #define _GeomPlate_Surface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Plate_Plate.hxx>
0024 #include <Geom_Surface.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <gp_XY.hxx>
0027 #include <NCollection_Sequence.hxx>
0028 class gp_Trsf;
0029 class gp_GTrsf2d;
0030 class Geom_Curve;
0031 class Geom_Geometry;
0032 
0033 //! Describes the characteristics of plate surface objects
0034 //! returned by BuildPlateSurface::Surface. These can be
0035 //! used to verify the quality of the resulting surface before
0036 //! approximating it to a Geom_BSpline surface generated
0037 //! by MakeApprox. This proves necessary in cases where
0038 //! you want to use the resulting surface as the support for
0039 //! a shape. The algorithmically generated surface cannot
0040 //! fill this function as is, and as a result must be converted first.
0041 class GeomPlate_Surface : public Geom_Surface
0042 {
0043 
0044 public:
0045   Standard_EXPORT GeomPlate_Surface(const occ::handle<Geom_Surface>& Surfinit,
0046                                     const Plate_Plate&               Surfinter);
0047 
0048   //! Reverses the U direction of parametrization of <me>.
0049   //! The bounds of the surface are not modified.
0050   Standard_EXPORT void UReverse() override;
0051 
0052   //! Return the parameter on the Ureversed surface for
0053   //! the point of parameter U on <me>.
0054   //! @code
0055   //!   me->UReversed()->Value(me->UReversedParameter(U),V)
0056   //! @endcode
0057   //! is the same point as
0058   //! @code
0059   //!   me->Value(U,V)
0060   //! @endcode
0061   Standard_EXPORT double UReversedParameter(const double U) const override;
0062 
0063   //! Reverses the V direction of parametrization of <me>.
0064   //! The bounds of the surface are not modified.
0065   Standard_EXPORT void VReverse() override;
0066 
0067   //! Return the parameter on the Vreversed surface for
0068   //! the point of parameter V on <me>.
0069   //! @code
0070   //!   me->VReversed()->Value(U,me->VReversedParameter(V))
0071   //! @endcode
0072   //! is the same point as
0073   //! @code
0074   //!   me->Value(U,V)
0075   //! @endcode
0076   Standard_EXPORT double VReversedParameter(const double V) const override;
0077 
0078   //! Computes the parameters on the transformed surface for
0079   //! the transform of the point of parameters U,V on <me>.
0080   //! @code
0081   //!   me->Transformed(T)->Value(U',V')
0082   //! @endcode
0083   //! is the same point as
0084   //! @code
0085   //!   me->Value(U,V).Transformed(T)
0086   //! @endcode
0087   //! Where U',V' are the new values of U,V after calling
0088   //! @code
0089   //!   me->TransformParameters(U,V,T)
0090   //! @endcode
0091   //! This methods does not change <U> and <V>
0092   //!
0093   //! It can be redefined. For example on the Plane,
0094   //! Cylinder, Cone, Revolved and Extruded surfaces.
0095   Standard_EXPORT void TransformParameters(double& U, double& V, const gp_Trsf& T) const override;
0096 
0097   //! Returns a 2d transformation used to find the new
0098   //! parameters of a point on the transformed surface.
0099   //! @code
0100   //!   me->Transformed(T)->Value(U',V')
0101   //! @endcode
0102   //! is the same point as
0103   //! @code
0104   //!   me->Value(U,V).Transformed(T)
0105   //! @endcode
0106   //! Where U',V' are obtained by transforming U,V with
0107   //! the 2d transformation returned by
0108   //! @code
0109   //!   me->ParametricTransformation(T)
0110   //! @endcode
0111   //! This method returns an identity transformation
0112   //!
0113   //! It can be redefined. For example on the Plane,
0114   //! Cylinder, Cone, Revolved and Extruded surfaces.
0115   Standard_EXPORT gp_GTrsf2d ParametricTransformation(const gp_Trsf& T) const override;
0116 
0117   Standard_EXPORT void Bounds(double& U1, double& U2, double& V1, double& V2) const override;
0118 
0119   //! Is the surface closed in the parametric direction U ?
0120   //! Returns True if for each parameter V the distance
0121   //! between the point P (UFirst, V) and P (ULast, V) is
0122   //! lower or equal to Resolution from gp. UFirst and ULast
0123   //! are the parametric bounds in the U direction.
0124   Standard_EXPORT bool IsUClosed() const override;
0125 
0126   //! Is the surface closed in the parametric direction V ?
0127   //! Returns True if for each parameter U the distance
0128   //! between the point P (U, VFirst) and P (U, VLast) is
0129   //! lower or equal to Resolution from gp. VFirst and VLast
0130   //! are the parametric bounds in the V direction.
0131   Standard_EXPORT bool IsVClosed() const override;
0132 
0133   //! Is the parametrization of a surface periodic in the
0134   //! direction U ?
0135   //! It is possible only if the surface is closed in this
0136   //! parametric direction and if the following relation is
0137   //! satisfied :
0138   //! for each parameter V the distance between the point
0139   //! P (U, V) and the point P (U + T, V) is lower or equal
0140   //! to Resolution from package gp. T is the parametric period
0141   //! and must be a constant.
0142   Standard_EXPORT bool IsUPeriodic() const override;
0143 
0144   //! returns the Uperiod.
0145   //! raises if the surface is not uperiodic.
0146   Standard_EXPORT double UPeriod() const override;
0147 
0148   //! Is the parametrization of a surface periodic in the
0149   //! direction U ?
0150   //! It is possible only if the surface is closed in this
0151   //! parametric direction and if the following relation is
0152   //! satisfied :
0153   //! for each parameter V the distance between the point
0154   //! P (U, V) and the point P (U + T, V) is lower or equal
0155   //! to Resolution from package gp. T is the parametric period
0156   //! and must be a constant.
0157   Standard_EXPORT bool IsVPeriodic() const override;
0158 
0159   //! returns the Vperiod.
0160   //! raises if the surface is not vperiodic.
0161   Standard_EXPORT double VPeriod() const override;
0162 
0163   //! Computes the U isoparametric curve.
0164   Standard_EXPORT occ::handle<Geom_Curve> UIso(const double U) const override;
0165 
0166   //! Computes the V isoparametric curve.
0167   Standard_EXPORT occ::handle<Geom_Curve> VIso(const double V) const override;
0168 
0169   //! Global Continuity of the surface in direction U and V :
0170   //! C0 : only geometric continuity,
0171   //! C1 : continuity of the first derivative all along the surface,
0172   //! C2 : continuity of the second derivative all along the surface,
0173   //! C3 : continuity of the third derivative all along the surface,
0174   //! G1 : tangency continuity all along the surface,
0175   //! G2 : curvature continuity all along the surface,
0176   //! CN : the order of continuity is infinite.
0177   //! Example :
0178   //! If the surface is C1 in the V parametric direction and C2
0179   //! in the U parametric direction Shape = C1.
0180   Standard_EXPORT GeomAbs_Shape Continuity() const override;
0181 
0182   //! Returns the order of continuity of the surface in the
0183   //! U parametric direction.
0184   //! Raised if N < 0.
0185   Standard_EXPORT bool IsCNu(const int N) const override;
0186 
0187   //! Returns the order of continuity of the surface in the
0188   //! V parametric direction.
0189   //! Raised if N < 0.
0190   Standard_EXPORT bool IsCNv(const int N) const override;
0191 
0192   //! Computes the point of parameter U,V on the surface.
0193   //!
0194   //! Raised only for an "OffsetSurface" if it is not possible to
0195   //! compute the current point.
0196   Standard_EXPORT gp_Pnt EvalD0(const double U, const double V) const override;
0197 
0198   //! Computes the point P and the first derivatives in the
0199   //! directions U and V at this point.
0200   //! Raised if the continuity of the surface is not C1.
0201   Standard_EXPORT Geom_Surface::ResD1 EvalD1(const double U, const double V) const override;
0202 
0203   //! Computes the point P, the first and the second derivatives in
0204   //! the directions U and V at this point.
0205   //! Raised if the continuity of the surface is not C2.
0206   Standard_EXPORT Geom_Surface::ResD2 EvalD2(const double U, const double V) const override;
0207 
0208   //! Computes the point P, the first,the second and the third
0209   //! derivatives in the directions U and V at this point.
0210   //! Raised if the continuity of the surface is not C2.
0211   Standard_EXPORT Geom_Surface::ResD3 EvalD3(const double U, const double V) const override;
0212 
0213   //! ---Purpose ;
0214   //! Computes the derivative of order Nu in the direction U and Nv
0215   //! in the direction V at the point P(U, V).
0216   //!
0217   //! Raised if the continuity of the surface is not CNu in the U
0218   //! direction or not CNv in the V direction.
0219   //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
0220   Standard_EXPORT gp_Vec EvalDN(const double U,
0221                                 const double V,
0222                                 const int    Nu,
0223                                 const int    Nv) const override;
0224 
0225   Standard_EXPORT occ::handle<Geom_Geometry> Copy() const override;
0226 
0227   //! Transformation of a geometric object. This transformation
0228   //! can be a translation, a rotation, a symmetry, a scaling
0229   //! or a complex transformation obtained by combination of
0230   //! the previous elementaries transformations.
0231   //! (see class Transformation of the package Geom).
0232   Standard_EXPORT void Transform(const gp_Trsf& T) override;
0233 
0234   Standard_EXPORT occ::handle<Geom_Surface> CallSurfinit() const;
0235 
0236   Standard_EXPORT void SetBounds(const double Umin,
0237                                  const double Umax,
0238                                  const double Vmin,
0239                                  const double Vmax);
0240 
0241   Standard_EXPORT void RealBounds(double& U1, double& U2, double& V1, double& V2) const;
0242 
0243   Standard_EXPORT void Constraints(NCollection_Sequence<gp_XY>& Seq) const;
0244 
0245   DEFINE_STANDARD_RTTIEXT(GeomPlate_Surface, Geom_Surface)
0246 
0247 private:
0248   Plate_Plate               mySurfinter;
0249   occ::handle<Geom_Surface> mySurfinit;
0250   double                    myUmin;
0251   double                    myUmax;
0252   double                    myVmin;
0253   double                    myVmax;
0254 };
0255 
0256 #endif // _GeomPlate_Surface_HeaderFile