Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:19:21

0001 // Created on: 1992-11-05
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1992-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 _BRepPrim_Revolution_HeaderFile
0018 #define _BRepPrim_Revolution_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepPrim_OneAxis.hxx>
0025 #include <Standard_Real.hxx>
0026 class Geom_Curve;
0027 class Geom2d_Curve;
0028 class gp_Ax2;
0029 class TopoDS_Face;
0030 class TopoDS_Edge;
0031 class gp_Pnt2d;
0032 
0033 //! Implement the OneAxis algorithm for a revolution
0034 //! surface.
0035 class BRepPrim_Revolution : public BRepPrim_OneAxis
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   //! Create a revolution body <M> is the meridian nd
0041   //! must be in the XZ plane of <A>. <PM> is the
0042   //! meridian in the XZ plane.
0043   Standard_EXPORT BRepPrim_Revolution(const gp_Ax2&                    A,
0044                                       const double                     VMin,
0045                                       const double                     VMax,
0046                                       const occ::handle<Geom_Curve>&   M,
0047                                       const occ::handle<Geom2d_Curve>& PM);
0048 
0049   //! The surface normal should be directed towards the
0050   //! outside.
0051   Standard_EXPORT TopoDS_Face MakeEmptyLateralFace() const override;
0052 
0053   //! Returns an edge with a 3D curve made from the
0054   //! meridian in the XZ plane rotated by <Ang> around
0055   //! the Z-axis. Ang may be 0 or myAngle.
0056   Standard_EXPORT TopoDS_Edge MakeEmptyMeridianEdge(const double Ang) const override;
0057 
0058   //! Returns the meridian point at parameter <V> in the
0059   //! plane XZ.
0060   Standard_EXPORT gp_Pnt2d MeridianValue(const double V) const override;
0061 
0062   //! Sets the parametric urve of the edge <E> in the
0063   //! face <F> to be the 2d representation of the
0064   //! meridian.
0065   Standard_EXPORT void SetMeridianPCurve(TopoDS_Edge& E, const TopoDS_Face& F) const override;
0066 
0067 protected:
0068   //! Create a revolution body. The meridian is set
0069   //! later. Reserved for derivated classes.
0070   Standard_EXPORT BRepPrim_Revolution(const gp_Ax2& A, const double VMin, const double VMax);
0071 
0072   Standard_EXPORT void Meridian(const occ::handle<Geom_Curve>&   M,
0073                                 const occ::handle<Geom2d_Curve>& PM);
0074 
0075 private:
0076   occ::handle<Geom_Curve>   myMeridian;
0077   occ::handle<Geom2d_Curve> myPMeridian;
0078 };
0079 
0080 #endif // _BRepPrim_Revolution_HeaderFile