Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-30 08:46:55

0001 // Created on: 2016-02-04
0002 // Created by: Anastasia BORISOVA
0003 // Copyright (c) 2016 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Prs3d_ToolCylinder_HeaderFile
0017 #define _Prs3d_ToolCylinder_HeaderFile
0018 
0019 #include <Prs3d_ToolQuadric.hxx>
0020 
0021 //! Standard presentation algorithm that outputs graphical primitives for cylindrical surface.
0022 class Prs3d_ToolCylinder : public Prs3d_ToolQuadric
0023 {
0024 public:
0025   //! Generate primitives for 3D quadric surface and return a filled array.
0026   //! @param[in] theBottomRad  cylinder bottom radius
0027   //! @param[in] theTopRad     cylinder top radius
0028   //! @param[in] theHeight     cylinder height
0029   //! @param[in] theNbSlices   number of slices within U parameter
0030   //! @param[in] theNbStacks   number of stacks within V parameter
0031   //! @param[in] theTrsf       optional transformation to apply
0032   //! @return generated triangulation
0033   Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create(
0034     const Standard_Real    theBottomRad,
0035     const Standard_Real    theTopRad,
0036     const Standard_Real    theHeight,
0037     const Standard_Integer theNbSlices,
0038     const Standard_Integer theNbStacks,
0039     const gp_Trsf&         theTrsf);
0040 
0041 public:
0042   //! Initializes the algorithm creating a cylinder.
0043   //! @param[in] theBottomRad  cylinder bottom radius
0044   //! @param[in] theTopRad     cylinder top radius
0045   //! @param[in] theHeight     cylinder height
0046   //! @param[in] theNbSlices   number of slices within U parameter
0047   //! @param[in] theNbStacks   number of stacks within V parameter
0048   Standard_EXPORT Prs3d_ToolCylinder(const Standard_Real    theBottomRad,
0049                                      const Standard_Real    theTopRad,
0050                                      const Standard_Real    theHeight,
0051                                      const Standard_Integer theNbSlices,
0052                                      const Standard_Integer theNbStacks);
0053 
0054 protected:
0055   //! Computes vertex at given parameter location of the surface.
0056   Standard_EXPORT virtual gp_Pnt Vertex(const Standard_Real theU,
0057                                         const Standard_Real theV) const Standard_OVERRIDE;
0058 
0059   //! Computes normal at given parameter location of the surface.
0060   Standard_EXPORT virtual gp_Dir Normal(const Standard_Real theU,
0061                                         const Standard_Real theV) const Standard_OVERRIDE;
0062 
0063 protected:
0064   Standard_Real myBottomRadius; //!< cylinder bottom radius
0065   Standard_Real myTopRadius;    //!< cylinder top radius
0066   Standard_Real myHeight;       //!< cylinder height
0067 };
0068 
0069 #endif // _Prs3d_ToolCylinder_HeaderFile