b311480e |
1 | // Created on: 1998-09-17 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <TopoDS.hxx> |
18 | #include <TopTools_HSequenceOfShape.hxx> |
19 | |
20 | //======================================================================= |
21 | //function : SetFreeBound |
22 | //purpose : Sets contour |
23 | //======================================================================= |
24 | |
25 | inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound) |
26 | { |
27 | myBound = freebound; |
28 | } |
29 | |
30 | //======================================================================= |
31 | //function : SetArea |
32 | //purpose : Sets area of the contour |
33 | //======================================================================= |
34 | |
35 | inline void ShapeAnalysis_FreeBoundData::SetArea(const Standard_Real area) |
36 | { |
37 | myArea = area; |
38 | } |
39 | |
40 | //======================================================================= |
41 | //function : SetPerimeter |
42 | //purpose : Sets perimeter of the contour |
43 | //======================================================================= |
44 | |
45 | inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const Standard_Real perimeter) |
46 | { |
47 | myPerimeter = perimeter; |
48 | } |
49 | |
50 | //======================================================================= |
51 | //function : SetRatio |
52 | //purpose : Sets ratio of average length to average width of the contour |
53 | //======================================================================= |
54 | |
55 | inline void ShapeAnalysis_FreeBoundData::SetRatio(const Standard_Real ratio) |
56 | { |
57 | myRatio = ratio; |
58 | } |
59 | |
60 | //======================================================================= |
61 | //function : SetWidth |
62 | //purpose : Sets average width of the contour |
63 | //======================================================================= |
64 | |
65 | inline void ShapeAnalysis_FreeBoundData::SetWidth(const Standard_Real width) |
66 | { |
67 | myWidth = width; |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : AddNotch |
72 | //purpose : Adds notch on free bound with its maximum width |
73 | //======================================================================= |
74 | |
75 | //======================================================================= |
76 | //function : FreeBound |
77 | //purpose : Returns contour |
78 | //======================================================================= |
79 | |
80 | inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const |
81 | { |
82 | return myBound; |
83 | } |
84 | |
85 | //======================================================================= |
86 | //function : Area |
87 | //purpose : Returns area of the contour |
88 | //======================================================================= |
89 | |
90 | inline Standard_Real ShapeAnalysis_FreeBoundData::Area() const |
91 | { |
92 | return myArea; |
93 | } |
94 | |
95 | //======================================================================= |
96 | //function : Perimeter |
97 | //purpose : Returns perimeter of the contour |
98 | //======================================================================= |
99 | |
100 | inline Standard_Real ShapeAnalysis_FreeBoundData::Perimeter() const |
101 | { |
102 | return myPerimeter; |
103 | } |
104 | |
105 | //======================================================================= |
106 | //function : Ratio |
107 | //purpose : Returns ratio of average length to average width of the contour |
108 | //======================================================================= |
109 | |
110 | inline Standard_Real ShapeAnalysis_FreeBoundData::Ratio() const |
111 | { |
112 | return myRatio; |
113 | } |
114 | |
115 | //======================================================================= |
116 | //function : Width |
117 | //purpose : Returns average width of the contour |
118 | //======================================================================= |
119 | |
120 | inline Standard_Real ShapeAnalysis_FreeBoundData::Width() const |
121 | { |
122 | return myWidth; |
123 | } |
124 | |
125 | //======================================================================= |
126 | //function : NbNotches |
127 | //purpose : Returns number of notches on the contour |
128 | //======================================================================= |
129 | |
130 | inline Standard_Integer ShapeAnalysis_FreeBoundData::NbNotches() const |
131 | { |
132 | return myNotches->Length(); |
133 | } |
134 | |
135 | //======================================================================= |
136 | //function : Notches |
137 | //purpose : Returns sequence of notches on the contour |
138 | //======================================================================= |
139 | |
857ffd5e |
140 | inline Handle(TopTools_HSequenceOfShape) ShapeAnalysis_FreeBoundData::Notches() const |
7fd59977 |
141 | { |
142 | return myNotches; |
143 | } |
144 | |
145 | //======================================================================= |
146 | //function : Notch |
147 | //purpose : Returns notch on the contour |
148 | //======================================================================= |
149 | |
150 | inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const Standard_Integer index) const |
151 | { |
152 | return TopoDS::Wire(myNotches->Value(index)); |
153 | } |