Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:36:02

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_ElementarySurface_HeaderFile
0018 #define _Geom_ElementarySurface_HeaderFile
0019 
0020 #include <gp_Ax3.hxx>
0021 #include <Geom_Surface.hxx>
0022 
0023 class Geom_ElementarySurface;
0024 DEFINE_STANDARD_HANDLE(Geom_ElementarySurface, Geom_Surface)
0025 
0026 //! Describes the common behavior of surfaces which
0027 //! have a simple parametric equation in a local
0028 //! coordinate system. The Geom package provides
0029 //! several implementations of concrete elementary surfaces:
0030 //! - the plane, and
0031 //! - four simple surfaces of revolution: the cylinder, the
0032 //! cone, the sphere and the torus.
0033 //! An elementary surface inherits the common behavior
0034 //! of Geom_Surface surfaces. Furthermore, it is located
0035 //! in 3D space by a coordinate system (a gp_Ax3
0036 //! object) which is also its local coordinate system.
0037 //! Any elementary surface is oriented, i.e. the normal
0038 //! vector is always defined, and gives the same
0039 //! orientation to the surface, at any point on the surface.
0040 //! In topology this property is referred to as the "outside
0041 //! region of the surface". This orientation is related to
0042 //! the two parametric directions of the surface.
0043 //! Rotation of a surface around the "main Axis" of its
0044 //! coordinate system, in the trigonometric sense given
0045 //! by the "X Direction" and the "Y Direction" of the
0046 //! coordinate system, defines the u parametric direction
0047 //! of that elementary surface of revolution. This is the
0048 //! default construction mode.
0049 //! It is also possible, however, to change the orientation
0050 //! of a surface by reversing one of the two parametric
0051 //! directions: use the UReverse or VReverse functions
0052 //! to change the orientation of the normal at any point on the surface.
0053 //! Warning
0054 //! The local coordinate system of an elementary surface
0055 //! is not necessarily direct:
0056 //! - if it is direct, the trigonometric sense defined by its
0057 //! "main Direction" is the same as the trigonometric
0058 //! sense defined by its two vectors "X Direction" and "Y Direction":
0059 //! "main Direction" = "X Direction" ^ "Y Direction"
0060 //! - if it is indirect, the two definitions of trigonometric
0061 //! sense are opposite:
0062 //! "main Direction" = - "X Direction" ^ "Y Direction"
0063 class Geom_ElementarySurface : public Geom_Surface
0064 {
0065 public:
0066   //! Changes the main axis (ZAxis) of the elementary surface.
0067   //!
0068   //! Raised if the direction of A1 is parallel to the XAxis of the
0069   //! coordinate system of the surface.
0070   void SetAxis(const gp_Ax1& theA1) { pos.SetAxis(theA1); }
0071 
0072   //! Changes the location of the local coordinates system of the
0073   //! surface.
0074   void SetLocation(const gp_Pnt& theLoc) { pos.SetLocation(theLoc); }
0075 
0076   //! Changes the local coordinates system of the surface.
0077   void SetPosition(const gp_Ax3& theAx3) { pos = theAx3; }
0078 
0079   //! Returns the main axis of the surface (ZAxis).
0080   const gp_Ax1& Axis() const { return pos.Axis(); }
0081 
0082   //! Returns the location point of the local coordinate system of the
0083   //! surface.
0084   const gp_Pnt& Location() const { return pos.Location(); }
0085 
0086   //! Returns the local coordinates system of the surface.
0087   const gp_Ax3& Position() const { return pos; }
0088 
0089   //! Reverses the U parametric direction of the surface.
0090   Standard_EXPORT virtual void UReverse() Standard_OVERRIDE;
0091 
0092   //! Return the  parameter on the  Ureversed surface for
0093   //! the point of parameter U on <me>.
0094   //!
0095   //! me->UReversed()->Value(me->UReversedParameter(U),V)
0096   //! is the same point as
0097   //! me->Value(U,V)
0098   Standard_EXPORT virtual Standard_Real UReversedParameter(const Standard_Real U) const
0099     Standard_OVERRIDE = 0;
0100 
0101   //! Reverses the V parametric direction of the surface.
0102   Standard_EXPORT virtual void VReverse() Standard_OVERRIDE;
0103 
0104   //! Return the  parameter on the  Vreversed surface for
0105   //! the point of parameter V on <me>.
0106   //!
0107   //! me->VReversed()->Value(U,me->VReversedParameter(V))
0108   //! is the same point as
0109   //! me->Value(U,V)
0110   Standard_EXPORT virtual Standard_Real VReversedParameter(const Standard_Real V) const
0111     Standard_OVERRIDE = 0;
0112 
0113   //! Returns GeomAbs_CN, the global continuity of any elementary surface.
0114   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0115 
0116   //! Returns True.
0117   Standard_EXPORT Standard_Boolean IsCNu(const Standard_Integer N) const Standard_OVERRIDE;
0118 
0119   //! Returns True.
0120   Standard_EXPORT Standard_Boolean IsCNv(const Standard_Integer N) const Standard_OVERRIDE;
0121 
0122   //! Dumps the content of me into the stream
0123   Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
0124                                         Standard_Integer  theDepth = -1) const Standard_OVERRIDE;
0125 
0126   DEFINE_STANDARD_RTTIEXT(Geom_ElementarySurface, Geom_Surface)
0127 
0128 protected:
0129   gp_Ax3 pos;
0130 };
0131 
0132 #endif // _Geom_ElementarySurface_HeaderFile