summaryrefslogtreecommitdiff
path: root/inc/ShapeAnalysis_ShapeTolerance.hxx
blob: e8b4bde81b5b33558be179015d8402bb9e03f722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _ShapeAnalysis_ShapeTolerance_HeaderFile
#define _ShapeAnalysis_ShapeTolerance_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile
#include <Handle_TopTools_HSequenceOfShape.hxx>
#endif
class TopoDS_Shape;
class TopTools_HSequenceOfShape;


//! Tool for computing shape tolerances (minimal, maximal, average), <br>
//!          finding shape with tolerance matching given criteria, <br>
//!          setting or limitating tolerances. <br>
class ShapeAnalysis_ShapeTolerance  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Empty constructor <br>
  Standard_EXPORT   ShapeAnalysis_ShapeTolerance();
  //! Determines a tolerance from the ones stored in a shape <br>
//!          Remark : calls InitTolerance and AddTolerance, <br>
//!          hence, can be used to start a series for cumulating tolerance <br>
//!          <mode> = 0 : returns the average value between sub-shapes, <br>
//!          <mode> > 0 : returns the maximal found, <br>
//!          <mode> < 0 : returns the minimal found. <br>
//!          <type> defines what kinds of sub-shapes to consider: <br>
//!          SHAPE (default) : all : VERTEX, EDGE, FACE, <br>
//!          VERTEX : only vertices, <br>
//!          EDGE   : only edges, <br>
//!          FACE   : only faces, <br>
//!          SHELL  : combined SHELL + FACE, for each face (and containing <br>
//!          shell), also checks EDGE and VERTEX <br>
  Standard_EXPORT     Standard_Real Tolerance(const TopoDS_Shape& shape,const Standard_Integer mode,const TopAbs_ShapeEnum type = TopAbs_SHAPE) ;
  //! Determines which shapes have a tolerance over the given value <br>
//!          <type> is interpreted as in the method Tolerance <br>
  Standard_EXPORT     Handle_TopTools_HSequenceOfShape OverTolerance(const TopoDS_Shape& shape,const Standard_Real value,const TopAbs_ShapeEnum type = TopAbs_SHAPE) const;
  //! Determines which shapes have a tolerance within a given interval <br>
//!          <type> is interpreted as in the method Tolerance <br>
  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;
  //! Initializes computation of cumulated tolerance <br>
  Standard_EXPORT     void InitTolerance() ;
  //! Adds data on new Shape to compute Cumulated Tolerance <br>
//!          (prepares three computations : maximal, average, minimal) <br>
  Standard_EXPORT     void AddTolerance(const TopoDS_Shape& shape,const TopAbs_ShapeEnum type = TopAbs_SHAPE) ;
  //! Returns the computed tolerance according to the <mode> <br>
//!          <mode> = 0 : average <br>
//!          <mode> > 0 : maximal <br>
//!          <mode> < 0 : minimal <br>
  Standard_EXPORT     Standard_Real GlobalTolerance(const Standard_Integer mode) const;





protected:





private:



Standard_Real myTols[3];
Standard_Integer myNbTol;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif