1 // Created on: 1998-08-25
2 // Created by: Pavel DURANDIN
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.
17 #include <ShapeAnalysis_FreeBoundData.ixx>
18 #include <TopTools_HSequenceOfShape.hxx>
21 //=======================================================================
22 //function : ShapeAnalysis_FreeBoundData
23 //purpose : Empty constructor
24 //=======================================================================
26 ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData()
28 myNotches = new TopTools_HSequenceOfShape();
32 //=======================================================================
33 //function : ShapeAnalysis_FreeBoundData
34 //purpose : Creates object with contour given in the form of TopoDS_Wire
35 //=======================================================================
37 ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData(const TopoDS_Wire& freebound)
39 myNotches = new TopTools_HSequenceOfShape();
41 SetFreeBound(freebound);
44 //=======================================================================
46 //purpose : Clears all properties of the contour. Contour bound itself is not cleared.
47 //=======================================================================
49 void ShapeAnalysis_FreeBoundData::Clear()
56 myNotchesParams.Clear();
59 //=======================================================================
61 //purpose : Adds notch on free bound with its maximum width
62 //=======================================================================
64 void ShapeAnalysis_FreeBoundData::AddNotch(const TopoDS_Wire& notch,const Standard_Real width)
66 if (myNotchesParams.IsBound(notch)) return;
67 myNotches->Append(notch);
68 myNotchesParams.Bind(notch, width);
72 //=======================================================================
73 //function : NotchWidth
74 //purpose : Returns maximum width of notch specified by its rank number
76 //=======================================================================
78 Standard_Real ShapeAnalysis_FreeBoundData::NotchWidth(const Standard_Integer index) const
80 TopoDS_Wire wire = TopoDS::Wire(myNotches -> Value(index));
81 return myNotchesParams.Find(wire);
84 //=======================================================================
85 //function : NotchWidth
86 //purpose : Returns maximum width of notch specified as TopoDS_Wire
88 //=======================================================================
90 Standard_Real ShapeAnalysis_FreeBoundData::NotchWidth(const TopoDS_Wire& notch) const
92 return myNotchesParams.Find(notch);