Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2021-07-20
0002 // Copyright (c) 2021 OPEN CASCADE SAS
0003 // Created by: Oleg AGASHIN
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 _Poly_TriangulationParameters_HeaderFile
0017 #define _Poly_TriangulationParameters_HeaderFile
0018 
0019 #include <Standard_Transient.hxx>
0020 #include <Standard_DefineHandle.hxx>
0021 
0022 //! Represents initial set of parameters triangulation is built for.
0023 class Poly_TriangulationParameters : public Standard_Transient
0024 {
0025 public:
0026 
0027   //! Constructor.
0028   //! Initializes object with the given parameters.
0029   //! @param theDeflection linear deflection
0030   //! @param theAngle angular deflection
0031   //! @param theMinSize minimum size
0032   Poly_TriangulationParameters (const Standard_Real theDeflection = -1.,
0033                                 const Standard_Real theAngle      = -1.,
0034                                 const Standard_Real theMinSize    = -1.)
0035     : myDeflection (theDeflection)
0036     , myAngle      (theAngle)
0037     , myMinSize    (theMinSize)
0038   {
0039   }
0040 
0041   //! Destructor.
0042   virtual ~Poly_TriangulationParameters()
0043   {
0044   }
0045 
0046   //! Returns true if linear deflection is defined.
0047   Standard_Boolean HasDeflection() const
0048   {
0049     return !(myDeflection < 0.);
0050   }
0051 
0052   //! Returns true if angular deflection is defined.
0053   Standard_Boolean HasAngle() const
0054   {
0055     return !(myAngle < 0.);
0056   }
0057 
0058   //! Returns true if minimum size is defined.
0059   Standard_Boolean HasMinSize() const
0060   {
0061     return !(myMinSize < 0.);
0062   }
0063 
0064   //! Returns linear deflection or -1 if undefined.
0065   Standard_Real Deflection() const
0066   {
0067     return myDeflection;
0068   }
0069 
0070   //! Returns angular deflection or -1 if undefined.
0071   Standard_Real Angle() const
0072   {
0073     return myAngle;
0074   }
0075 
0076   //! Returns minimum size or -1 if undefined.
0077   Standard_Real MinSize() const
0078   {
0079     return myMinSize;
0080   }
0081 
0082   DEFINE_STANDARD_RTTIEXT (Poly_TriangulationParameters, Standard_Transient)
0083 
0084 private:
0085 
0086   Standard_Real myDeflection;
0087   Standard_Real myAngle;
0088   Standard_Real myMinSize;
0089 };
0090 
0091 DEFINE_STANDARD_HANDLE (Poly_TriangulationParameters, Standard_Transient)
0092 
0093 #endif