Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:13

0001 // Created on: 2016-04-19
0002 // Copyright (c) 2016 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 _BRepMesh_Deflection_HeaderFile
0017 #define _BRepMesh_Deflection_HeaderFile
0018 
0019 #include <Standard_Handle.hxx>
0020 #include <Standard_Transient.hxx>
0021 #include <IMeshData_Types.hxx>
0022 
0023 struct IMeshTools_Parameters;
0024 
0025 //! Auxiliary tool encompassing methods to compute deflection of shapes.
0026 class BRepMesh_Deflection : public Standard_Transient
0027 {
0028 public:
0029 
0030   //! Returns absolute deflection for theShape with respect to the 
0031   //! relative deflection and theMaxShapeSize.
0032   //! @param theShape shape for that the deflection should be computed.
0033   //! @param theRelativeDeflection relative deflection.
0034   //! @param theMaxShapeSize maximum size of the whole shape.
0035   //! @return absolute deflection for the shape.
0036   Standard_EXPORT static Standard_Real ComputeAbsoluteDeflection (
0037     const TopoDS_Shape& theShape,
0038     const Standard_Real theRelativeDeflection,
0039     const Standard_Real theMaxShapeSize);
0040 
0041   //! Computes and updates deflection of the given discrete edge.
0042   Standard_EXPORT static void ComputeDeflection (
0043     const IMeshData::IEdgeHandle& theDEdge,
0044     const Standard_Real           theMaxShapeSize,
0045     const IMeshTools_Parameters&  theParameters);
0046 
0047   //! Computes and updates deflection of the given discrete wire.
0048   Standard_EXPORT static void ComputeDeflection (
0049     const IMeshData::IWireHandle& theDWire,
0050     const IMeshTools_Parameters&  theParameters);
0051 
0052   //! Computes and updates deflection of the given discrete face.
0053   Standard_EXPORT static void ComputeDeflection (
0054     const IMeshData::IFaceHandle& theDFace,
0055     const IMeshTools_Parameters&  theParameters);
0056 
0057   //! Checks if the deflection of current polygonal representation
0058   //! is consistent with the required deflection.
0059   //! @param theCurrent [in] Current deflection.
0060   //! @param theRequired [in] Required deflection.
0061   //! @param theAllowDecrease [in] Flag controlling the check. If decrease is allowed,
0062   //! to be consistent the current and required deflections should be approximately the same.
0063   //! If not allowed, the current deflection should be less than required.
0064   //! @param theRatio [in] The ratio for comparison of the deflections (value from 0 to 1).
0065   Standard_EXPORT static Standard_Boolean IsConsistent (
0066     const Standard_Real theCurrent,
0067     const Standard_Real theRequired,
0068     const Standard_Boolean theAllowDecrease,
0069     const Standard_Real theRatio = 0.1);
0070 
0071   DEFINE_STANDARD_RTTIEXT(BRepMesh_Deflection, Standard_Transient)
0072 };
0073 
0074 #endif