Integration of OCCT 6.5.0 from SVN
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_FreeBoundData.lxx
1 // File:        ShapeAnalysis_FreeBoundData.lxx
2 // Created:     Thu Sep 17 18:05:04 1998
3 // Author:      data exchange team
4 //              <det@nnov.matra-dtv.fr>
5
6 #include <TopoDS.hxx>
7 #include <TopTools_HSequenceOfShape.hxx>
8
9 //=======================================================================
10 //function : SetFreeBound
11 //purpose  : Sets contour
12 //=======================================================================
13
14 inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
15 {
16   myBound = freebound;
17 }
18
19 //=======================================================================
20 //function : SetArea
21 //purpose  : Sets area of the contour
22 //=======================================================================
23
24 inline void ShapeAnalysis_FreeBoundData::SetArea(const Standard_Real area)
25 {
26   myArea = area;
27 }
28
29 //=======================================================================
30 //function : SetPerimeter
31 //purpose  : Sets perimeter of the contour
32 //=======================================================================
33
34 inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const Standard_Real perimeter)
35 {
36   myPerimeter = perimeter;  
37 }
38
39 //=======================================================================
40 //function : SetRatio
41 //purpose  : Sets ratio of average length to average width of the contour
42 //=======================================================================
43
44 inline void ShapeAnalysis_FreeBoundData::SetRatio(const Standard_Real ratio)
45 {
46   myRatio = ratio;
47 }
48
49 //=======================================================================
50 //function : SetWidth
51 //purpose  : Sets average width of the contour
52 //=======================================================================
53
54 inline void ShapeAnalysis_FreeBoundData::SetWidth(const Standard_Real width)
55 {
56   myWidth = width;
57 }
58
59 //=======================================================================
60 //function : AddNotch
61 //purpose  : Adds notch on free bound with its maximum width
62 //=======================================================================
63
64 //=======================================================================
65 //function : FreeBound
66 //purpose  : Returns contour
67 //=======================================================================
68
69 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
70 {
71   return myBound;
72 }
73
74 //=======================================================================
75 //function : Area
76 //purpose  : Returns area of the contour
77 //=======================================================================
78
79 inline Standard_Real ShapeAnalysis_FreeBoundData::Area() const
80 {
81   return myArea;
82 }
83
84 //=======================================================================
85 //function : Perimeter
86 //purpose  : Returns perimeter of the contour
87 //=======================================================================
88
89 inline Standard_Real ShapeAnalysis_FreeBoundData::Perimeter() const
90 {
91   return myPerimeter;
92 }
93
94 //=======================================================================
95 //function : Ratio
96 //purpose  : Returns ratio of average length to average width of the contour
97 //=======================================================================
98
99 inline Standard_Real ShapeAnalysis_FreeBoundData::Ratio() const
100 {
101   return myRatio;
102 }
103
104 //=======================================================================
105 //function : Width
106 //purpose  : Returns average width of the contour
107 //=======================================================================
108
109 inline Standard_Real ShapeAnalysis_FreeBoundData::Width() const
110 {
111   return myWidth;
112 }
113
114 //=======================================================================
115 //function : NbNotches
116 //purpose  : Returns number of notches on the contour
117 //=======================================================================
118
119 inline Standard_Integer ShapeAnalysis_FreeBoundData::NbNotches() const
120 {
121   return myNotches->Length();
122 }
123
124 //=======================================================================
125 //function : Notches
126 //purpose  : Returns sequence of notches on the contour
127 //=======================================================================
128
129 inline Handle_TopTools_HSequenceOfShape ShapeAnalysis_FreeBoundData::Notches() const
130 {
131   return myNotches;
132 }
133
134 //=======================================================================
135 //function : Notch
136 //purpose  : Returns notch on the contour
137 //=======================================================================
138
139 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const Standard_Integer index) const
140 {
141   return TopoDS::Wire(myNotches->Value(index));
142 }