1 // Created on: 2014-10-15
2 // Created by: Denis Bogolepov
3 // Copyright (c) 2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef OpenGl_Sphere_Header
17 #define OpenGl_Sphere_Header
19 #include <OpenGl_Quadric.hxx>
21 //! Tool class for generating sphere tessellation.
22 class OpenGl_Sphere : public OpenGl_Quadric
26 //! Creates undefined sphere primitive.
27 Standard_EXPORT OpenGl_Sphere();
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);
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;
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;
46 Standard_ShortReal myRadius; //!< Sphere radius
50 #endif // OpenGl_Sphere_Header