mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
159 lines
5.4 KiB
Plaintext
Executable File
159 lines
5.4 KiB
Plaintext
Executable File
// Created on: 1998-09-17
|
|
// Created by: data exchange team
|
|
// Copyright (c) 1998-1999 Matra Datavision
|
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
//
|
|
// The content of this file is subject to the Open CASCADE Technology Public
|
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
// except in compliance with the License. Please obtain a copy of the License
|
|
// at http://www.opencascade.org and read it completely before using this file.
|
|
//
|
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
//
|
|
// The Original Code and all software distributed under the License is
|
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
// Initial Developer hereby disclaims all such warranties, including without
|
|
// limitation, any warranties of merchantability, fitness for a particular
|
|
// purpose or non-infringement. Please see the License for the specific terms
|
|
// and conditions governing the rights and limitations under the License.
|
|
|
|
|
|
#include <TopoDS.hxx>
|
|
#include <TopTools_HSequenceOfShape.hxx>
|
|
|
|
//=======================================================================
|
|
//function : SetFreeBound
|
|
//purpose : Sets contour
|
|
//=======================================================================
|
|
|
|
inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
|
|
{
|
|
myBound = freebound;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : SetArea
|
|
//purpose : Sets area of the contour
|
|
//=======================================================================
|
|
|
|
inline void ShapeAnalysis_FreeBoundData::SetArea(const Standard_Real area)
|
|
{
|
|
myArea = area;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : SetPerimeter
|
|
//purpose : Sets perimeter of the contour
|
|
//=======================================================================
|
|
|
|
inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const Standard_Real perimeter)
|
|
{
|
|
myPerimeter = perimeter;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : SetRatio
|
|
//purpose : Sets ratio of average length to average width of the contour
|
|
//=======================================================================
|
|
|
|
inline void ShapeAnalysis_FreeBoundData::SetRatio(const Standard_Real ratio)
|
|
{
|
|
myRatio = ratio;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : SetWidth
|
|
//purpose : Sets average width of the contour
|
|
//=======================================================================
|
|
|
|
inline void ShapeAnalysis_FreeBoundData::SetWidth(const Standard_Real width)
|
|
{
|
|
myWidth = width;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : AddNotch
|
|
//purpose : Adds notch on free bound with its maximum width
|
|
//=======================================================================
|
|
|
|
//=======================================================================
|
|
//function : FreeBound
|
|
//purpose : Returns contour
|
|
//=======================================================================
|
|
|
|
inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
|
|
{
|
|
return myBound;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : Area
|
|
//purpose : Returns area of the contour
|
|
//=======================================================================
|
|
|
|
inline Standard_Real ShapeAnalysis_FreeBoundData::Area() const
|
|
{
|
|
return myArea;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : Perimeter
|
|
//purpose : Returns perimeter of the contour
|
|
//=======================================================================
|
|
|
|
inline Standard_Real ShapeAnalysis_FreeBoundData::Perimeter() const
|
|
{
|
|
return myPerimeter;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : Ratio
|
|
//purpose : Returns ratio of average length to average width of the contour
|
|
//=======================================================================
|
|
|
|
inline Standard_Real ShapeAnalysis_FreeBoundData::Ratio() const
|
|
{
|
|
return myRatio;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : Width
|
|
//purpose : Returns average width of the contour
|
|
//=======================================================================
|
|
|
|
inline Standard_Real ShapeAnalysis_FreeBoundData::Width() const
|
|
{
|
|
return myWidth;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : NbNotches
|
|
//purpose : Returns number of notches on the contour
|
|
//=======================================================================
|
|
|
|
inline Standard_Integer ShapeAnalysis_FreeBoundData::NbNotches() const
|
|
{
|
|
return myNotches->Length();
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : Notches
|
|
//purpose : Returns sequence of notches on the contour
|
|
//=======================================================================
|
|
|
|
inline Handle_TopTools_HSequenceOfShape ShapeAnalysis_FreeBoundData::Notches() const
|
|
{
|
|
return myNotches;
|
|
}
|
|
|
|
//=======================================================================
|
|
//function : Notch
|
|
//purpose : Returns notch on the contour
|
|
//=======================================================================
|
|
|
|
inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const Standard_Integer index) const
|
|
{
|
|
return TopoDS::Wire(myNotches->Value(index));
|
|
}
|