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 <TopTools_HSequenceOfShape.hxx>
0019
0020 //=======================================================================
0021 //function : SetFreeBound
0022 //purpose : Sets contour
0023 //=======================================================================
0024
0025 inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
0026 {
0027 myBound = freebound;
0028 }
0029
0030 //=======================================================================
0031 //function : SetArea
0032 //purpose : Sets area of the contour
0033 //=======================================================================
0034
0035 inline void ShapeAnalysis_FreeBoundData::SetArea(const Standard_Real area)
0036 {
0037 myArea = area;
0038 }
0039
0040 //=======================================================================
0041 //function : SetPerimeter
0042 //purpose : Sets perimeter of the contour
0043 //=======================================================================
0044
0045 inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const Standard_Real perimeter)
0046 {
0047 myPerimeter = perimeter;
0048 }
0049
0050 //=======================================================================
0051 //function : SetRatio
0052 //purpose : Sets ratio of average length to average width of the contour
0053 //=======================================================================
0054
0055 inline void ShapeAnalysis_FreeBoundData::SetRatio(const Standard_Real ratio)
0056 {
0057 myRatio = ratio;
0058 }
0059
0060 //=======================================================================
0061 //function : SetWidth
0062 //purpose : Sets average width of the contour
0063 //=======================================================================
0064
0065 inline void ShapeAnalysis_FreeBoundData::SetWidth(const Standard_Real width)
0066 {
0067 myWidth = width;
0068 }
0069
0070 //=======================================================================
0071 //function : AddNotch
0072 //purpose : Adds notch on free bound with its maximum width
0073 //=======================================================================
0074
0075 //=======================================================================
0076 //function : FreeBound
0077 //purpose : Returns contour
0078 //=======================================================================
0079
0080 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
0081 {
0082 return myBound;
0083 }
0084
0085 //=======================================================================
0086 //function : Area
0087 //purpose : Returns area of the contour
0088 //=======================================================================
0089
0090 inline Standard_Real ShapeAnalysis_FreeBoundData::Area() const
0091 {
0092 return myArea;
0093 }
0094
0095 //=======================================================================
0096 //function : Perimeter
0097 //purpose : Returns perimeter of the contour
0098 //=======================================================================
0099
0100 inline Standard_Real ShapeAnalysis_FreeBoundData::Perimeter() const
0101 {
0102 return myPerimeter;
0103 }
0104
0105 //=======================================================================
0106 //function : Ratio
0107 //purpose : Returns ratio of average length to average width of the contour
0108 //=======================================================================
0109
0110 inline Standard_Real ShapeAnalysis_FreeBoundData::Ratio() const
0111 {
0112 return myRatio;
0113 }
0114
0115 //=======================================================================
0116 //function : Width
0117 //purpose : Returns average width of the contour
0118 //=======================================================================
0119
0120 inline Standard_Real ShapeAnalysis_FreeBoundData::Width() const
0121 {
0122 return myWidth;
0123 }
0124
0125 //=======================================================================
0126 //function : NbNotches
0127 //purpose : Returns number of notches on the contour
0128 //=======================================================================
0129
0130 inline Standard_Integer ShapeAnalysis_FreeBoundData::NbNotches() const
0131 {
0132 return myNotches->Length();
0133 }
0134
0135 //=======================================================================
0136 //function : Notches
0137 //purpose : Returns sequence of notches on the contour
0138 //=======================================================================
0139
0140 inline Handle(TopTools_HSequenceOfShape) ShapeAnalysis_FreeBoundData::Notches() const
0141 {
0142 return myNotches;
0143 }
0144
0145 //=======================================================================
0146 //function : Notch
0147 //purpose : Returns notch on the contour
0148 //=======================================================================
0149
0150 inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const Standard_Integer index) const
0151 {
0152 return TopoDS::Wire(myNotches->Value(index));
0153 }