Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ShapeAnalysis_ShapeTolerance_HeaderFile
0018 #define _ShapeAnalysis_ShapeTolerance_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TopAbs_ShapeEnum.hxx>
0026 #include <TopTools_HSequenceOfShape.hxx>
0027 class TopoDS_Shape;
0028 
0029 
0030 //! Tool for computing shape tolerances (minimal, maximal, average),
0031 //! finding shape with tolerance matching given criteria,
0032 //! setting or limitating tolerances.
0033 class ShapeAnalysis_ShapeTolerance 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   //! Empty constructor
0041   Standard_EXPORT ShapeAnalysis_ShapeTolerance();
0042   
0043   //! Determines a tolerance from the ones stored in a shape
0044   //! Remark : calls InitTolerance and AddTolerance,
0045   //! hence, can be used to start a series for cumulating tolerance
0046   //! <mode> = 0 : returns the average value between sub-shapes,
0047   //! <mode> > 0 : returns the maximal found,
0048   //! <mode> < 0 : returns the minimal found.
0049   //! <type> defines what kinds of sub-shapes to consider:
0050   //! SHAPE (default) : all : VERTEX, EDGE, FACE,
0051   //! VERTEX : only vertices,
0052   //! EDGE   : only edges,
0053   //! FACE   : only faces,
0054   //! SHELL  : combined SHELL + FACE, for each face (and containing
0055   //! shell), also checks EDGE and VERTEX
0056   Standard_EXPORT Standard_Real Tolerance (const TopoDS_Shape& shape, const Standard_Integer mode, const TopAbs_ShapeEnum type = TopAbs_SHAPE);
0057   
0058   //! Determines which shapes have a tolerance over the given value
0059   //! <type> is interpreted as in the method Tolerance
0060   Standard_EXPORT Handle(TopTools_HSequenceOfShape) OverTolerance (const TopoDS_Shape& shape, const Standard_Real value, const TopAbs_ShapeEnum type = TopAbs_SHAPE) const;
0061   
0062   //! Determines which shapes have a tolerance within a given interval
0063   //! <type> is interpreted as in the method Tolerance
0064   Standard_EXPORT Handle(TopTools_HSequenceOfShape) InTolerance (const TopoDS_Shape& shape, const Standard_Real valmin, const Standard_Real valmax, const TopAbs_ShapeEnum type = TopAbs_SHAPE) const;
0065   
0066   //! Initializes computation of cumulated tolerance
0067   Standard_EXPORT void InitTolerance();
0068   
0069   //! Adds data on new Shape to compute Cumulated Tolerance
0070   //! (prepares three computations : maximal, average, minimal)
0071   Standard_EXPORT void AddTolerance (const TopoDS_Shape& shape, const TopAbs_ShapeEnum type = TopAbs_SHAPE);
0072   
0073   //! Returns the computed tolerance according to the <mode>
0074   //! <mode> = 0 : average
0075   //! <mode> > 0 : maximal
0076   //! <mode> < 0 : minimal
0077   Standard_EXPORT Standard_Real GlobalTolerance (const Standard_Integer mode) const;
0078 
0079 
0080 
0081 
0082 protected:
0083 
0084 
0085 
0086 
0087 
0088 private:
0089 
0090 
0091 
0092   Standard_Real myTols[3];
0093   Standard_Integer myNbTol;
0094 
0095 
0096 };
0097 
0098 
0099 
0100 
0101 
0102 
0103 
0104 #endif // _ShapeAnalysis_ShapeTolerance_HeaderFile