f522ce50 |
1 | // Created on: 2019-02-25 |
2 | // Created by: Artem NOVIKOV |
3 | // Copyright (c) 2019 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 _Prs3d_ToolSector_HeaderFile |
17 | #define _Prs3d_ToolSector_HeaderFile |
18 | |
f522ce50 |
19 | #include <Prs3d_ToolQuadric.hxx> |
20 | |
21 | //! Standard presentation algorithm that outputs graphical primitives for disk surface. |
22 | class Prs3d_ToolSector : public Prs3d_ToolQuadric |
23 | { |
24 | public: |
25 | |
113bda70 |
26 | //! Generate primitives for 3D quadric surface. |
27 | //! @param theRadius [in] sector radius |
28 | //! @param theNbSlices [in] number of slices within U parameter |
29 | //! @param theNbStacks [in] number of stacks within V parameter |
30 | //! @param theTrsf [in] optional transformation to apply |
31 | //! @return generated triangulation |
f522ce50 |
32 | Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theRadius, |
33 | const Standard_Integer theNbSlices, |
34 | const Standard_Integer theNbStacks, |
35 | const gp_Trsf& theTrsf); |
36 | public: |
37 | |
113bda70 |
38 | //! Initializes the algorithm creating a sector (quadrant). |
39 | //! @param theRadius [in] sector radius |
40 | //! @param theNbSlices [in] number of slices within U parameter |
41 | //! @param theNbStacks [in] number of stacks within V parameter |
f522ce50 |
42 | Standard_EXPORT Prs3d_ToolSector (const Standard_Real theRadius, |
43 | const Standard_Integer theNbSlices, |
44 | const Standard_Integer theNbStacks); |
45 | protected: |
46 | |
47 | //! Computes vertex at given parameter location of the surface. |
f0da4970 |
48 | Standard_EXPORT virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) const Standard_OVERRIDE; |
f522ce50 |
49 | |
50 | //! Computes normal at given parameter location of the surface. |
f0da4970 |
51 | virtual gp_Dir Normal (const Standard_Real , const Standard_Real ) const Standard_OVERRIDE |
52 | { |
53 | return gp_Dir (0.0, 0.0, -1.0); |
54 | } |
f522ce50 |
55 | |
56 | protected: |
57 | |
113bda70 |
58 | Standard_Real myRadius; //!< sector radius |
f522ce50 |
59 | |
60 | }; |
61 | |
62 | #endif |