0027787: Visualization, TKOpenGl - Optimize rendering by additional check whether...
[occt.git] / src / OpenGl / OpenGl_Sphere.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_Sphere_Header
17 #define OpenGl_Sphere_Header
18
19 #include <OpenGl_Quadric.hxx>
20
21 //! Tool class for generating sphere tessellation.
22 class OpenGl_Sphere : public OpenGl_Quadric
23 {
24 public:
25
26   //! Creates undefined sphere primitive.
27   Standard_EXPORT OpenGl_Sphere();
28
29   //! Initialize sphere primitive.
30   Standard_EXPORT Standard_Boolean Init (const Standard_ShortReal theRadius,
31                                          const Standard_Integer   theNbSlices = 10,
32                                          const Standard_Integer   theNbStacks = 10);
33
34 protected:
35
36   //! Returns surface point for the given parameters.
37   Standard_EXPORT virtual OpenGl_Vec3 evalVertex (const Standard_ShortReal theU,
38                                                   const Standard_ShortReal theV) const Standard_OVERRIDE;
39
40   //! Returns surface normal for the given parameters.
41   Standard_EXPORT virtual OpenGl_Vec3 evalNormal (const Standard_ShortReal theU,
42                                                   const Standard_ShortReal theV) const Standard_OVERRIDE;
43
44 protected:
45
46   Standard_ShortReal myRadius; //!< Sphere radius
47
48 };
49
50 #endif // OpenGl_Sphere_Header