1 // Created on: 2016-02-04
2 // Created by: Anastasia BORISOVA
3 // Copyright (c) 2016 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 _Prs3d_ToolDisk_HeaderFile
17 #define _Prs3d_ToolDisk_HeaderFile
19 #include <Prs3d_ToolQuadric.hxx>
21 //! Standard presentation algorithm that outputs graphical primitives for disk surface.
22 class Prs3d_ToolDisk : public Prs3d_ToolQuadric
26 //! Generate primitives for 3D quadric surface.
27 //! @param theInnerRadius [in] inner disc radius
28 //! @param theOuterRadius [in] outer disc radius
29 //! @param theNbSlices [in] number of slices within U parameter
30 //! @param theNbStacks [in] number of stacks within V parameter
31 //! @param theTrsf [in] optional transformation to apply
32 //! @return generated triangulation
33 Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theInnerRadius,
34 const Standard_Real theOuterRadius,
35 const Standard_Integer theNbSlices,
36 const Standard_Integer theNbStacks,
37 const gp_Trsf& theTrsf);
40 //! Initializes the algorithm creating a disk.
41 //! @param theInnerRadius [in] inner disk radius
42 //! @param theOuterRadius [in] outer disk radius
43 //! @param theNbSlices [in] number of slices within U parameter
44 //! @param theNbStacks [in] number of stacks within V parameter
45 Standard_EXPORT Prs3d_ToolDisk (const Standard_Real theInnerRadius,
46 const Standard_Real theOuterRadius,
47 const Standard_Integer theNbSlices,
48 const Standard_Integer theNbStacks);
50 //! Set angle range in radians [0, 2*PI] by default.
51 //! @param theStartAngle [in] Start angle in counter clockwise order
52 //! @param theEndAngle [in] End angle in counter clockwise order
53 void SetAngleRange (Standard_Real theStartAngle,
54 Standard_Real theEndAngle)
56 myStartAngle = theStartAngle;
57 myEndAngle = theEndAngle;
62 //! Computes vertex at given parameter location of the surface.
63 Standard_EXPORT virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) const Standard_OVERRIDE;
65 //! Computes normal at given parameter location of the surface.
66 virtual gp_Dir Normal (const Standard_Real , const Standard_Real ) const Standard_OVERRIDE
68 return gp_Dir (0.0, 0.0, -1.0);
73 Standard_Real myInnerRadius; //!< Inner disk radius
74 Standard_Real myOuterRadius; //!< Outer disk radius
75 Standard_Real myStartAngle; //!< Start angle in counter clockwise order
76 Standard_Real myEndAngle; //!< End angle in counter clockwise order