1 // Created on: 1998-09-17
2 // Created by: data exchange team
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <TopTools_HSequenceOfShape.hxx>
20 //=======================================================================
21 //function : SetFreeBound
22 //purpose : Sets contour
23 //=======================================================================
25 inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
30 //=======================================================================
32 //purpose : Sets area of the contour
33 //=======================================================================
35 inline void ShapeAnalysis_FreeBoundData::SetArea(const Standard_Real area)
40 //=======================================================================
41 //function : SetPerimeter
42 //purpose : Sets perimeter of the contour
43 //=======================================================================
45 inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const Standard_Real perimeter)
47 myPerimeter = perimeter;
50 //=======================================================================
52 //purpose : Sets ratio of average length to average width of the contour
53 //=======================================================================
55 inline void ShapeAnalysis_FreeBoundData::SetRatio(const Standard_Real ratio)
60 //=======================================================================
62 //purpose : Sets average width of the contour
63 //=======================================================================
65 inline void ShapeAnalysis_FreeBoundData::SetWidth(const Standard_Real width)
70 //=======================================================================
72 //purpose : Adds notch on free bound with its maximum width
73 //=======================================================================
75 //=======================================================================
76 //function : FreeBound
77 //purpose : Returns contour
78 //=======================================================================
80 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
85 //=======================================================================
87 //purpose : Returns area of the contour
88 //=======================================================================
90 inline Standard_Real ShapeAnalysis_FreeBoundData::Area() const
95 //=======================================================================
96 //function : Perimeter
97 //purpose : Returns perimeter of the contour
98 //=======================================================================
100 inline Standard_Real ShapeAnalysis_FreeBoundData::Perimeter() const
105 //=======================================================================
107 //purpose : Returns ratio of average length to average width of the contour
108 //=======================================================================
110 inline Standard_Real ShapeAnalysis_FreeBoundData::Ratio() const
115 //=======================================================================
117 //purpose : Returns average width of the contour
118 //=======================================================================
120 inline Standard_Real ShapeAnalysis_FreeBoundData::Width() const
125 //=======================================================================
126 //function : NbNotches
127 //purpose : Returns number of notches on the contour
128 //=======================================================================
130 inline Standard_Integer ShapeAnalysis_FreeBoundData::NbNotches() const
132 return myNotches->Length();
135 //=======================================================================
137 //purpose : Returns sequence of notches on the contour
138 //=======================================================================
140 inline Handle(TopTools_HSequenceOfShape) ShapeAnalysis_FreeBoundData::Notches() const
145 //=======================================================================
147 //purpose : Returns notch on the contour
148 //=======================================================================
150 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const Standard_Integer index) const
152 return TopoDS::Wire(myNotches->Value(index));