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 | |
62ef08df |
16 | #ifndef _Prs3d_ToolCylinder_HeaderFile |
17 | #define _Prs3d_ToolCylinder_HeaderFile |
625e1958 |
18 | |
62ef08df |
19 | #include <Prs3d_ToolQuadric.hxx> |
625e1958 |
20 | |
21 | //! Standard presentation algorithm that outputs graphical primitives for cylindrical surface. |
62ef08df |
22 | class Prs3d_ToolCylinder : public Prs3d_ToolQuadric |
625e1958 |
23 | { |
24 | public: |
25 | |
caf231b0 |
26 | //! Generate primitives for 3D quadric surface and return a filled array. |
113bda70 |
27 | //! @param theBottomRad [in] cylinder bottom radius |
28 | //! @param theTopRad [in] cylinder top radius |
29 | //! @param theHeight [in] cylinder height |
30 | //! @param theNbSlices [in] number of slices within U parameter |
31 | //! @param theNbStacks [in] number of stacks within V parameter |
32 | //! @param theTrsf [in] optional transformation to apply |
33 | //! @return generated triangulation |
caf231b0 |
34 | Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theBottomRad, |
35 | const Standard_Real theTopRad, |
36 | const Standard_Real theHeight, |
37 | const Standard_Integer theNbSlices, |
38 | const Standard_Integer theNbStacks, |
39 | const gp_Trsf& theTrsf); |
40 | public: |
41 | |
113bda70 |
42 | //! Initializes the algorithm creating a cylinder. |
43 | //! @param theBottomRad [in] cylinder bottom radius |
44 | //! @param theTopRad [in] cylinder top radius |
45 | //! @param theHeight [in] cylinder height |
46 | //! @param theNbSlices [in] number of slices within U parameter |
47 | //! @param theNbStacks [in] number of stacks within V parameter |
62ef08df |
48 | Standard_EXPORT Prs3d_ToolCylinder (const Standard_Real theBottomRad, |
49 | const Standard_Real theTopRad, |
50 | const Standard_Real theHeight, |
51 | const Standard_Integer theNbSlices, |
52 | const Standard_Integer theNbStacks); |
625e1958 |
53 | |
54 | protected: |
55 | |
56 | //! Computes vertex at given parameter location of the surface. |
f0da4970 |
57 | Standard_EXPORT virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) const Standard_OVERRIDE; |
625e1958 |
58 | |
59 | //! Computes normal at given parameter location of the surface. |
f0da4970 |
60 | Standard_EXPORT virtual gp_Dir Normal (const Standard_Real theU, const Standard_Real theV) const Standard_OVERRIDE; |
625e1958 |
61 | |
62 | protected: |
63 | |
113bda70 |
64 | Standard_Real myBottomRadius; //!< cylinder bottom radius |
65 | Standard_Real myTopRadius; //!< cylinder top radius |
66 | Standard_Real myHeight; //!< cylinder height |
caf231b0 |
67 | |
625e1958 |
68 | }; |
69 | |
62ef08df |
70 | #endif // _Prs3d_ToolCylinder_HeaderFile |