CommitLineData
625e1958 1// Created on: 2016-02-04
2// Created by: Anastasia BORISOVA
3// Copyright (c) 2016 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
625e1958 18
19#include <Graphic3d_ArrayOfPrimitives.hxx>
20#include <Graphic3d_ArrayOfTriangles.hxx>
21#include <Poly_Triangulation.hxx>
22#include <Prs3d_Root.hxx>
23#include <Prs3d_Drawer.hxx>
24#include <SelectMgr_Selection.hxx>
25#include <Standard.hxx>
26#include <Standard_Handle.hxx>
625e1958 28
29//! Standard presentation algorithm that outputs graphical primitives for spherical surface.
62ef08df 30class Prs3d_ToolSphere : public Prs3d_ToolQuadric
625e1958 31{
32public:
33
caf231b0 34 //! Generate primitives for 3D quadric surface and return a filled array.
35 Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theRadius,
36 const Standard_Integer theNbSlices,
37 const Standard_Integer theNbStacks,
38 const gp_Trsf& theTrsf);
39public:
40
625e1958 41 //! Initializes the algorithm.
62ef08df 42 Standard_EXPORT Prs3d_ToolSphere (const Standard_Real theRadius,
43 const Standard_Integer theNbSlices,
44 const Standard_Integer theNbStacks);
625e1958 45
46protected:
47
48 //! Computes vertex at given parameter location of the surface.
49 Standard_EXPORT virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) Standard_OVERRIDE;
50
51 //! Computes normal at given parameter location of the surface.
52 Standard_EXPORT virtual gp_Dir Normal (const Standard_Real theU, const Standard_Real theV) Standard_OVERRIDE;
53
54protected:
55
caf231b0 56 Standard_Real myRadius;
625e1958 57
caf231b0 58};
625e1958 59
60#endif