Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:17:00

0001 // Created on: 2016-02-04
0002 // Created by: Anastasia BORISOVA
0003 // Copyright (c) 2016 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Prs3d_ToolDisk_HeaderFile
0017 #define _Prs3d_ToolDisk_HeaderFile
0018 
0019 #include <Prs3d_ToolQuadric.hxx>
0020 
0021 //! Standard presentation algorithm that outputs graphical primitives for disk surface.
0022 class Prs3d_ToolDisk : public Prs3d_ToolQuadric
0023 {
0024 public:
0025   //! Generate primitives for 3D quadric surface.
0026   //! @param[in] theInnerRadius  inner disc radius
0027   //! @param[in] theOuterRadius  outer disc radius
0028   //! @param[in] theNbSlices     number of slices within U parameter
0029   //! @param[in] theNbStacks     number of stacks within V parameter
0030   //! @param[in] theTrsf         optional transformation to apply
0031   //! @return generated triangulation
0032   Standard_EXPORT static occ::handle<Graphic3d_ArrayOfTriangles> Create(const double theInnerRadius,
0033                                                                         const double theOuterRadius,
0034                                                                         const int    theNbSlices,
0035                                                                         const int    theNbStacks,
0036                                                                         const gp_Trsf& theTrsf);
0037 
0038 public:
0039   //! Initializes the algorithm creating a disk.
0040   //! @param[in] theInnerRadius  inner disk radius
0041   //! @param[in] theOuterRadius  outer disk radius
0042   //! @param[in] theNbSlices     number of slices within U parameter
0043   //! @param[in] theNbStacks     number of stacks within V parameter
0044   Standard_EXPORT Prs3d_ToolDisk(const double theInnerRadius,
0045                                  const double theOuterRadius,
0046                                  const int    theNbSlices,
0047                                  const int    theNbStacks);
0048 
0049   //! Set angle range in radians [0, 2*PI] by default.
0050   //! @param[in] theStartAngle  Start angle in counter clockwise order
0051   //! @param[in] theEndAngle    End   angle in counter clockwise order
0052   void SetAngleRange(double theStartAngle, double theEndAngle)
0053   {
0054     myStartAngle = theStartAngle;
0055     myEndAngle   = theEndAngle;
0056   }
0057 
0058 protected:
0059   //! Computes vertex at given parameter location of the surface.
0060   Standard_EXPORT gp_Pnt Vertex(const double theU, const double theV) const override;
0061 
0062   //! Computes normal at given parameter location of the surface.
0063   gp_Dir Normal(const double, const double) const override { return gp_Dir(gp_Dir::D::NZ); }
0064 
0065 protected:
0066   double myInnerRadius; //!< Inner disk radius
0067   double myOuterRadius; //!< Outer disk radius
0068   double myStartAngle;  //!< Start angle in counter clockwise order
0069   double myEndAngle;    //!< End   angle in counter clockwise order
0070 };
0071 
0072 #endif