Warning, /include/opencascade/ShapeAnalysis_FreeBoundData.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1998-09-17
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016
0017 #include <TopoDS.hxx>
0018 #include <TopoDS_Shape.hxx>
0019 #include <NCollection_Sequence.hxx>
0020 #include <NCollection_HSequence.hxx>
0021
0022 //=================================================================================================
0023
0024 inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
0025 {
0026 myBound = freebound;
0027 }
0028
0029 //=================================================================================================
0030
0031 inline void ShapeAnalysis_FreeBoundData::SetArea(const double area)
0032 {
0033 myArea = area;
0034 }
0035
0036 //=================================================================================================
0037
0038 inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const double perimeter)
0039 {
0040 myPerimeter = perimeter;
0041 }
0042
0043 //=======================================================================
0044 // function : SetRatio
0045 // purpose : Sets ratio of average length to average width of the contour
0046 //=======================================================================
0047
0048 inline void ShapeAnalysis_FreeBoundData::SetRatio(const double ratio)
0049 {
0050 myRatio = ratio;
0051 }
0052
0053 //=======================================================================
0054 // function : SetWidth
0055 // purpose : Sets average width of the contour
0056 //=======================================================================
0057
0058 inline void ShapeAnalysis_FreeBoundData::SetWidth(const double width)
0059 {
0060 myWidth = width;
0061 }
0062
0063 //=======================================================================
0064 // function : AddNotch
0065 // purpose : Adds notch on free bound with its maximum width
0066 //=======================================================================
0067
0068 //=================================================================================================
0069
0070 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
0071 {
0072 return myBound;
0073 }
0074
0075 //=================================================================================================
0076
0077 inline double ShapeAnalysis_FreeBoundData::Area() const
0078 {
0079 return myArea;
0080 }
0081
0082 //=======================================================================
0083 // function : Perimeter
0084 // purpose : Returns perimeter of the contour
0085 //=======================================================================
0086
0087 inline double ShapeAnalysis_FreeBoundData::Perimeter() const
0088 {
0089 return myPerimeter;
0090 }
0091
0092 //=======================================================================
0093 // function : Ratio
0094 // purpose : Returns ratio of average length to average width of the contour
0095 //=======================================================================
0096
0097 inline double ShapeAnalysis_FreeBoundData::Ratio() const
0098 {
0099 return myRatio;
0100 }
0101
0102 //=======================================================================
0103 // function : Width
0104 // purpose : Returns average width of the contour
0105 //=======================================================================
0106
0107 inline double ShapeAnalysis_FreeBoundData::Width() const
0108 {
0109 return myWidth;
0110 }
0111
0112 //=======================================================================
0113 // function : NbNotches
0114 // purpose : Returns number of notches on the contour
0115 //=======================================================================
0116
0117 inline int ShapeAnalysis_FreeBoundData::NbNotches() const
0118 {
0119 return myNotches->Length();
0120 }
0121
0122 //=======================================================================
0123 // function : Notches
0124 // purpose : Returns sequence of notches on the contour
0125 //=======================================================================
0126
0127 inline occ::handle<NCollection_HSequence<TopoDS_Shape>> ShapeAnalysis_FreeBoundData::Notches() const
0128 {
0129 return myNotches;
0130 }
0131
0132 //=================================================================================================
0133
0134 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const int index) const
0135 {
0136 return TopoDS::Wire(myNotches->Value(index));
0137 }