Loading files
c09a95501This file is pinned to the selected release. Download the original to open it in your design tool.
// Created on: 1998-09-17
// Created by: data exchange team
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_HSequence.hxx>
//=================================================================================================
inline void ShapeAnalysis_FreeBoundData::SetFreeBound(const TopoDS_Wire& freebound)
{
myBound = freebound;
}
//=================================================================================================
inline void ShapeAnalysis_FreeBoundData::SetArea(const double area)
{
myArea = area;
}
//=================================================================================================
inline void ShapeAnalysis_FreeBoundData::SetPerimeter(const double perimeter)
{
myPerimeter = perimeter;
}
//=======================================================================
// function : SetRatio
// purpose : Sets ratio of average length to average width of the contour
//=======================================================================
inline void ShapeAnalysis_FreeBoundData::SetRatio(const double ratio)
{
myRatio = ratio;
}
//=======================================================================
// function : SetWidth
// purpose : Sets average width of the contour
//=======================================================================
inline void ShapeAnalysis_FreeBoundData::SetWidth(const double width)
{
myWidth = width;
}
//=======================================================================
// function : AddNotch
// purpose : Adds notch on free bound with its maximum width
//=======================================================================
//=================================================================================================
inline TopoDS_Wire ShapeAnalysis_FreeBoundData::FreeBound() const
{
return myBound;
}
//=================================================================================================
inline double ShapeAnalysis_FreeBoundData::Area() const
{
return myArea;
}
//=======================================================================
// function : Perimeter
// purpose : Returns perimeter of the contour
//=======================================================================
inline double ShapeAnalysis_FreeBoundData::Perimeter() const
{
return myPerimeter;
}
//=======================================================================
// function : Ratio
// purpose : Returns ratio of average length to average width of the contour
//=======================================================================
inline double ShapeAnalysis_FreeBoundData::Ratio() const
{
return myRatio;
}
//=======================================================================
// function : Width
// purpose : Returns average width of the contour
//=======================================================================
inline double ShapeAnalysis_FreeBoundData::Width() const
{
return myWidth;
}
//=======================================================================
// function : NbNotches
// purpose : Returns number of notches on the contour
//=======================================================================
inline int ShapeAnalysis_FreeBoundData::NbNotches() const
{
return myNotches->Length();
}
//=======================================================================
// function : Notches
// purpose : Returns sequence of notches on the contour
//=======================================================================
inline occ::handle<NCollection_HSequence<TopoDS_Shape>> ShapeAnalysis_FreeBoundData::Notches() const
{
return myNotches;
}
//=================================================================================================
inline TopoDS_Wire ShapeAnalysis_FreeBoundData::Notch(const int index) const
{
return TopoDS::Wire(myNotches->Value(index));
}