0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / OpenGl / OpenGl_Cylinder.hxx
1 // Created on: 2014-10-15
2 // Created by: Denis Bogolepov
3 // Copyright (c) 2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef OpenGl_Cylinder_Header
17 #define OpenGl_Cylinder_Header
18
19 #include <OpenGl_Quadric.hxx>
20
21 //! Tool class for generating cylinder tessellation of quadric surface.
22 class OpenGl_Cylinder : public OpenGl_Quadric
23 {
24 public:
25
26   //! Create undefined cylinder primitive.
27   Standard_EXPORT OpenGl_Cylinder();
28
29   //! Initialize cylinder primitive.
30   Standard_EXPORT Standard_Boolean Init (const Standard_ShortReal theBotRad,
31                                          const Standard_ShortReal theTopRad,
32                                          const Standard_ShortReal theHeight,
33                                          const Standard_Integer   theNbSlices = 10,
34                                          const Standard_Integer   theNbStacks = 10);
35
36 protected:
37
38   //! Returns surface point for the given parameters.
39   Standard_EXPORT virtual OpenGl_Vec3 evalVertex (const Standard_ShortReal theU,
40                                                   const Standard_ShortReal theV) const Standard_OVERRIDE;
41
42   //! Returns surface normal for the given parameters.
43   Standard_EXPORT virtual OpenGl_Vec3 evalNormal (const Standard_ShortReal theU,
44                                                   const Standard_ShortReal theV) const Standard_OVERRIDE;
45
46 private:
47
48   Standard_ShortReal myBotRad; //!< Radius of the cylinder at bottom
49   Standard_ShortReal myTopRad; //!< Radius of the cylinder at top
50   Standard_ShortReal myHeight; //!< Height of the cylinder
51
52 };
53
54 #endif // OpenGl_Cylinder_Header