summaryrefslogtreecommitdiff
path: root/inc/ShapeAnalysis_FreeBoundData.lxx
blob: 269d2f8bec5a06783b31ab1bfa22251907f383f3 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// File:	ShapeAnalysis_FreeBoundData.lxx
// Created:	Thu Sep 17 18:05:04 1998
// Author:	data exchange team
//		<det@nnov.matra-dtv.fr>

#include <TopoDS.hxx>
#include <TopTools_HSequenceOfShape.hxx>

//=======================================================================
//function : SetFreeBound
//purpose  : Sets contour
//=======================================================================

inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
{
  myBound = freebound;
}

//=======================================================================
//function : SetArea
//purpose  : Sets area of the contour
//=======================================================================

inline void ShapeAnalysis_FreeBoundData::SetArea(const Standard_Real area)
{
  myArea = area;
}

//=======================================================================
//function : SetPerimeter
//purpose  : Sets perimeter of the contour
//=======================================================================

inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const Standard_Real perimeter)
{
  myPerimeter = perimeter;  
}

//=======================================================================
//function : SetRatio
//purpose  : Sets ratio of average length to average width of the contour
//=======================================================================

inline void ShapeAnalysis_FreeBoundData::SetRatio(const Standard_Real ratio)
{
  myRatio = ratio;
}

//=======================================================================
//function : SetWidth
//purpose  : Sets average width of the contour
//=======================================================================

inline void ShapeAnalysis_FreeBoundData::SetWidth(const Standard_Real width)
{
  myWidth = width;
}

//=======================================================================
//function : AddNotch
//purpose  : Adds notch on free bound with its maximum width
//=======================================================================

//=======================================================================
//function : FreeBound
//purpose  : Returns contour
//=======================================================================

inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
{
  return myBound;
}

//=======================================================================
//function : Area
//purpose  : Returns area of the contour
//=======================================================================

inline Standard_Real ShapeAnalysis_FreeBoundData::Area() const
{
  return myArea;
}

//=======================================================================
//function : Perimeter
//purpose  : Returns perimeter of the contour
//=======================================================================

inline Standard_Real ShapeAnalysis_FreeBoundData::Perimeter() const
{
  return myPerimeter;
}

//=======================================================================
//function : Ratio
//purpose  : Returns ratio of average length to average width of the contour
//=======================================================================

inline Standard_Real ShapeAnalysis_FreeBoundData::Ratio() const
{
  return myRatio;
}

//=======================================================================
//function : Width
//purpose  : Returns average width of the contour
//=======================================================================

inline Standard_Real ShapeAnalysis_FreeBoundData::Width() const
{
  return myWidth;
}

//=======================================================================
//function : NbNotches
//purpose  : Returns number of notches on the contour
//=======================================================================

inline Standard_Integer ShapeAnalysis_FreeBoundData::NbNotches() const
{
  return myNotches->Length();
}

//=======================================================================
//function : Notches
//purpose  : Returns sequence of notches on the contour
//=======================================================================

inline Handle_TopTools_HSequenceOfShape ShapeAnalysis_FreeBoundData::Notches() const
{
  return myNotches;
}

//=======================================================================
//function : Notch
//purpose  : Returns notch on the contour
//=======================================================================

inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const Standard_Integer index) const
{
  return TopoDS::Wire(myNotches->Value(index));
}