Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:40

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 
0026   //! Generate primitives for 3D quadric surface.
0027   //! @param theInnerRadius [in] inner disc radius
0028   //! @param theOuterRadius [in] outer disc radius
0029   //! @param theNbSlices    [in] number of slices within U parameter
0030   //! @param theNbStacks    [in] number of stacks within V parameter
0031   //! @param theTrsf        [in] optional transformation to apply
0032   //! @return generated triangulation
0033   Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real    theInnerRadius,
0034                                                                     const Standard_Real    theOuterRadius,
0035                                                                     const Standard_Integer theNbSlices,
0036                                                                     const Standard_Integer theNbStacks,
0037                                                                     const gp_Trsf&         theTrsf);
0038 public:
0039 
0040   //! Initializes the algorithm creating a disk.
0041   //! @param theInnerRadius [in] inner disk radius
0042   //! @param theOuterRadius [in] outer disk radius
0043   //! @param theNbSlices    [in] number of slices within U parameter
0044   //! @param theNbStacks    [in] number of stacks within V parameter
0045   Standard_EXPORT Prs3d_ToolDisk (const Standard_Real    theInnerRadius,
0046                                   const Standard_Real    theOuterRadius,
0047                                   const Standard_Integer theNbSlices,
0048                                   const Standard_Integer theNbStacks);
0049 
0050   //! Set angle range in radians [0, 2*PI] by default.
0051   //! @param theStartAngle [in] Start angle in counter clockwise order
0052   //! @param theEndAngle   [in] End   angle in counter clockwise order
0053   void SetAngleRange (Standard_Real theStartAngle,
0054                       Standard_Real theEndAngle)
0055   {
0056     myStartAngle = theStartAngle;
0057     myEndAngle   = theEndAngle;
0058   }
0059 
0060 protected:
0061 
0062   //! Computes vertex at given parameter location of the surface.
0063   Standard_EXPORT virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) const Standard_OVERRIDE;
0064 
0065   //! Computes normal at given parameter location of the surface.
0066   virtual gp_Dir Normal (const Standard_Real , const Standard_Real ) const Standard_OVERRIDE
0067   {
0068     return gp_Dir (0.0, 0.0, -1.0);
0069   }
0070 
0071 protected:
0072 
0073   Standard_Real myInnerRadius; //!< Inner disk radius
0074   Standard_Real myOuterRadius; //!< Outer disk radius
0075   Standard_Real myStartAngle;  //!< Start angle in counter clockwise order
0076   Standard_Real myEndAngle;    //!< End   angle in counter clockwise order
0077 
0078 };
0079 
0080 #endif