f2abee4c18
- C3d aggiornamento delle librerie ( 117967).
347 lines
18 KiB
C++
347 lines
18 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
||
/**
|
||
\file
|
||
\brief \ru Параметры операций над каркасом.
|
||
\en Parameters of operations on the wire frame. \~
|
||
|
||
*/
|
||
////////////////////////////////////////////////////////////////////////////////
|
||
|
||
#ifndef __OP_WIREFRAME_PARAMETERS_H
|
||
#define __OP_WIREFRAME_PARAMETERS_H
|
||
|
||
#include <wire_frame.h>
|
||
|
||
|
||
//------------------------------------------------------------------------------
|
||
/** \brief \ru Параметры скругления каркаса.
|
||
\en Parameters of wire frame fillets. \~
|
||
\details \ru Параметры скругления каркаса: \n
|
||
type - тип скругления( обычное или на поверхности ). \n
|
||
radiuses - радиусы скругления, i-й радиус соответствует стыку i-го и i+1-го ребра. \n
|
||
\en Parameters of wire frame fillets: \n
|
||
'type' is a fillet type( ordinary or on a surface ). \n
|
||
'radiuses' are the fillet radii, the i-th radius corresponds to the joint of the i-th and the i+1-th edges. \n \~
|
||
\warning \ru В разработке.
|
||
\en Under development. \~
|
||
\ingroup WireFrame_Parameters
|
||
*/ // ---
|
||
class MATH_CLASS MbWireFrameFilletsParams : public MbPrecision {
|
||
private:
|
||
MbeConnectingType _type; ///< \ru Тип выполняемых скруглений. \en Fillet type( ordinary or on a surface ).
|
||
c3d::DoubleVector _radiuses; ///< \ru Множество радиусов скругления. \en An array of fillet radii.
|
||
c3d::SNameMakerSPtr _snMaker; ///< \ru Именователь с версией операции. \en Names maker with operation version.
|
||
|
||
public:
|
||
/** \brief \ru Конструктор по параметрам.
|
||
\en Constructor by parameters.\~
|
||
\details \ru Конструктор по параметрам.
|
||
\en Constructor by parameters.\~
|
||
\param[in] type - \ru Тип выполняемых скруглений. \en Fillet type.\~
|
||
\param[in] radiuses - \ru Множество радиусов скругления. \en An array of fillet radii. \~
|
||
\param[in] nameMaker - \ru Именователь с версией операции. \en Names maker with operation version.\~
|
||
*/
|
||
MbWireFrameFilletsParams( MbeConnectingType type, const c3d::DoubleVector & radiuses, const MbSNameMaker & nameMaker );
|
||
/// \ru Конструктор для чтения. \en Constructor for reading.
|
||
MbWireFrameFilletsParams( TapeInit tapeInit );
|
||
/// \ru Деструктор. \ en Destructor.
|
||
~MbWireFrameFilletsParams() {}
|
||
|
||
public:
|
||
/// \ru Получить множество радиусов скругления. \en Get an array of fillet radii.
|
||
const c3d::DoubleVector & GetRadii() const { return _radiuses; }
|
||
/// \ru Получить тип выполняемых скруглений. \en Get the type of fillets.
|
||
MbeConnectingType GetConnectingType() const { return _type; }
|
||
/// \ru Получить именователь. \en Get names maker.
|
||
const MbSNameMaker & GetNameMaker() const { return *_snMaker; }
|
||
|
||
OBVIOUS_PRIVATE_COPY( MbWireFrameFilletsParams )
|
||
};
|
||
|
||
|
||
//-------------------------------------------------------------------------------
|
||
/** \brief \ru Точка на каркасе.
|
||
\en Wire frame point. \~
|
||
\details \ru Точка на каркасе. Лежит на одном из ребер каркаса, учитывая толерантность вершин. Содержит информацию о номере ребра и параметре ребра. \n
|
||
\en Wire frame point. Belong to on one of the edges of the frame, taking into account the tolerance of the vertices. Contains information about the edge number and edge parameter. \n \~
|
||
\warning \ru В разработке.
|
||
\en Under development. \~
|
||
\ingroup Data_Structures
|
||
*/
|
||
// ---
|
||
class MATH_CLASS MbWireFramePoint {
|
||
private:
|
||
MbCartPoint3D _point; ///< \ru Точка на ребре каркаса с учетом толерантности вершин. \en A point on a frame edge taking into account vertex tolerance.
|
||
size_t _edgeIndex; ///< \ru Номер ребра каркаса. \en Frame edge number.
|
||
double _edgeParam; ///< \ru Параметр на ребре каркаса. \en Parameter on the edge of the frame.
|
||
|
||
public:
|
||
/// \ru Конструктор по умолчанию. \en Default constructor.
|
||
MbWireFramePoint()
|
||
: _point ( UNDEFINED_DBL, UNDEFINED_DBL, UNDEFINED_DBL )
|
||
, _edgeIndex( SYS_MAX_T )
|
||
, _edgeParam( UNDEFINED_DBL )
|
||
{
|
||
}
|
||
|
||
/// \ru Конструктор копирования. \en Copy constructor.
|
||
MbWireFramePoint( const MbWireFramePoint & other )
|
||
: _point ( other._point )
|
||
, _edgeIndex( other._edgeIndex )
|
||
, _edgeParam( other._edgeParam )
|
||
{}
|
||
|
||
/** \brief \ru Инициализация по параметрам.
|
||
\en Initialization by parameters. \~
|
||
\details \ru Инициализация вершины ребра каркаса по параметрам.
|
||
\en Initialization wire frame edge vertex by parameters. \~
|
||
\param[in] wireFrame - \ru Проволочный каркас.
|
||
\en WireFrame. \~
|
||
\param[in] edgeIndex - \ru Индекс ребра в каркасе.
|
||
\en Index of the edge in the frame. \~
|
||
\param[in] firstVertex - \ru Первая вершина.
|
||
\en First vertex. \~
|
||
*/
|
||
bool InitPointOnVertex( const MbWireFrame & wireFrame, size_t edgeIndex, bool firstVertex );
|
||
|
||
/** \brief \ru Инициализация по параметрам.
|
||
\en Initialization by parameters. \~
|
||
\details \ru Инициализация точки на кривой ребра.
|
||
\en Initialization point on edge curve. \~
|
||
\param[in] wireFrame - \ru Проволочный каркас.
|
||
\en WireFrame. \~
|
||
\param[in] edgeIndex - \ru Индекс ребра в каркасе.
|
||
\en Index of the edge in the frame. \~
|
||
\param[in] edgeParam - \ru Параметр на ребре.
|
||
\en Edge parameter. \~
|
||
*/
|
||
bool InitPointOnEdge( const MbWireFrame & wireFrame, size_t edgeIndex, double edgeParam );
|
||
|
||
/// \ru Выдать точку. \en Get point.
|
||
const MbCartPoint3D & GetEdgePoint() const { return _point; }
|
||
/// \ru Выдать номер ребра. \en Get edge number.
|
||
size_t GetEdgeIndex() const { return _edgeIndex; }
|
||
/// \ru Выдать параметр на ребре. \en Get edge parameter.
|
||
double GetEdgeParam() const { return _edgeParam; }
|
||
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||
bool IsSame( const MbWireFramePoint & other, double accuracy ) const;
|
||
|
||
/// \ru Проверка на корректность созданного объекта. \en Checking the correctness of the created object.
|
||
bool IsValid() const
|
||
{
|
||
return _point.x != UNDEFINED_DBL &&
|
||
_point.y != UNDEFINED_DBL &&
|
||
_point.z != UNDEFINED_DBL &&
|
||
_edgeIndex != SYS_MAX_T &&
|
||
_edgeParam != UNDEFINED_DBL;
|
||
}
|
||
|
||
/// \ru Оператор присваивания. \en Assignment operator.
|
||
const MbWireFramePoint & operator = ( const MbWireFramePoint & other ) {
|
||
_point = other._point;
|
||
_edgeIndex = other._edgeIndex;
|
||
_edgeParam = other._edgeParam;
|
||
return *this;
|
||
}
|
||
|
||
/// \ru Оператор сравнения. \en Comparison operator.
|
||
bool operator < ( const MbWireFramePoint & other ) {
|
||
bool res = _edgeIndex < other._edgeIndex;
|
||
if ( _edgeIndex == other._edgeIndex ) {
|
||
res = _edgeParam - other._edgeParam < - DOUBLE_EPSILON;
|
||
}
|
||
return res;
|
||
}
|
||
|
||
KNOWN_OBJECTS_RW_REF_OPERATORS( MbWireFramePoint ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class. \~
|
||
};
|
||
|
||
|
||
//-------------------------------------------------------------------------------
|
||
/** \brief \ru Информация для преобразования каркаса в Nurbs.
|
||
\en Information for transformation of a wire frame to NURBS. \~
|
||
\details \ru Информация для преобразования каркаса в Nurbs. \n
|
||
\en Information for transformation of a wire frame to NURBS. \n \~
|
||
\warning \ru В разработке.
|
||
\en Under development. \~
|
||
\ingroup WireFrame_Parameters
|
||
*/
|
||
// ---
|
||
class MATH_CLASS MbNurbsWireFrameInfo {
|
||
private:
|
||
MbWireFramePoint _pbeg; ///< \ru Начало участка каркаса. \en Wire frame piece start.
|
||
MbWireFramePoint _pend; ///< \ru Конец участка каркаса. \en Wire frame piece end.
|
||
bool _sense; ///< \ru Направление сплайн-кривой. \en Direction of spline-curve.
|
||
bool _matchParams; ///< \ru Сохранять ли при преобразовании однозначное соответствие параметрических областей. \en Whether to save correspondence of parametric regions while transforming or not.
|
||
bool _extendRange; ///< \ru Строится ли преобразование на продолжении для незамкнутой подложки. \en Whether transformation is constructed on the extension for a non-closed substrate.
|
||
VERSION _version; ///< \ru Версия исполнения. \en The version of execution.
|
||
|
||
private:
|
||
MbNurbsWireFrameInfo();
|
||
public:
|
||
|
||
/// \ru Конструктор. \en Constructor.
|
||
MbNurbsWireFrameInfo( const MbWireFramePoint & p1, const MbWireFramePoint & p2, bool sense, bool match, bool ext, VERSION version )
|
||
: _pbeg ( p1 )
|
||
, _pend ( p2 )
|
||
, _sense ( sense )
|
||
, _matchParams( match )
|
||
, _extendRange( ext )
|
||
, _version ( version )
|
||
{}
|
||
/// \ru Конструктор. \en Constructor.
|
||
MbNurbsWireFrameInfo( const MbNurbsWireFrameInfo & other, const MbWireFramePoint & p1, const MbWireFramePoint & p2, bool sense )
|
||
: _pbeg ( p1 )
|
||
, _pend ( p2 )
|
||
, _sense ( sense )
|
||
, _matchParams( other._matchParams )
|
||
, _extendRange( other._extendRange )
|
||
, _version ( other._version )
|
||
{}
|
||
/// \ru Конструктор копирования. \en Copy constructor.
|
||
MbNurbsWireFrameInfo( const MbNurbsWireFrameInfo & other )
|
||
: _pbeg ( other._pbeg )
|
||
, _pend ( other._pend )
|
||
, _sense ( other._sense )
|
||
, _matchParams( other._matchParams )
|
||
, _extendRange( other._extendRange )
|
||
, _version ( other._version )
|
||
{}
|
||
/// \ru Конструктор для чтения. \en Constructor for reading.
|
||
MbNurbsWireFrameInfo( TapeInit tapeInit );
|
||
|
||
|
||
/// \ru Функция инициализации. \en The initialization function.
|
||
void Init( const MbWireFramePoint & p1, const MbWireFramePoint & p2, bool sense )
|
||
{
|
||
_pbeg = p1;
|
||
_pend = p2;
|
||
_sense = sense;
|
||
}
|
||
/// \ru Функция инициализации. \en The initialization function.
|
||
void Init( const MbWireFramePoint & p1, const MbWireFramePoint & p2, bool sense, bool match, bool ext, VERSION version )
|
||
{
|
||
_matchParams = match;
|
||
_extendRange = ext;
|
||
_version = version;
|
||
Init( p1, p2, sense );
|
||
}
|
||
|
||
public:
|
||
/// \ru Получить начало участка кривой. \en Get the start curve region.
|
||
const MbWireFramePoint & GetPBeg() const { return _pbeg; }
|
||
/// \ru Получить конец участка кривой. \en Get the end curve region.
|
||
const MbWireFramePoint & GetPEnd() const { return _pend; }
|
||
/// \ru Получить направление сплайн-кривой. \en Get the direction of spline-curve.
|
||
bool GetSense() const { return _sense; }
|
||
/// \ru Сохранять ли при преобразовании однозначное соответствие параметрических областей. \en Whether to save correspondence of parametric regions by transformation or not.
|
||
bool MatchParams() const { return _matchParams; }
|
||
/// \ru Строится ли преобразование на продолжении для незамкнутой подложки. \en Whether transformation is constructed on the extension for a non-closed substrate or not.
|
||
bool ExtendRange() const { return _extendRange; }
|
||
/// \ru Получить версию исполнения. \en Get the version of execution.
|
||
VERSION GetMathVersion() const { return _version; }
|
||
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||
bool IsSame( const MbNurbsWireFrameInfo & other, double accuracy ) const;
|
||
|
||
/// \ru Оператор присваивания. \en An assignment operator.
|
||
const MbNurbsWireFrameInfo & operator = ( const MbNurbsWireFrameInfo & other ) {
|
||
_pbeg = other._pbeg;
|
||
_pend = other._pend;
|
||
_sense = other._sense;
|
||
_matchParams = other._matchParams;
|
||
_extendRange = other._extendRange;
|
||
_version = other._version;
|
||
return *this;
|
||
}
|
||
|
||
KNOWN_OBJECTS_RW_REF_OPERATORS( MbNurbsWireFrameInfo ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class. \~
|
||
};
|
||
|
||
|
||
//-------------------------------------------------------------------------------
|
||
/** \brief \ru Параметры преобразования каркаса в Nurbs.
|
||
\en Parameters for transformation of a wire frame to NURBS. \~
|
||
\details \ru Параметры преобразования каркаса в Nurbs. \n
|
||
\en Parameters for transformation of a wire frame to NURBS. \n \~
|
||
\ingroup WireFrame_Parameters
|
||
*/
|
||
// ---
|
||
class MATH_CLASS MbNurbsWireFrameParams : public MbPrecision {
|
||
private:
|
||
MbNurbsWireFrameInfo _frameIntoNurbsInfo; ///< \ru Информация для преобразования каркаса в Nurbs. \en Information for transformation of a wire frame to NURBS. \~
|
||
c3d::SNameMakerSPtr _snMaker; ///< \ru Именователь с версией операции. \en Names maker with operation version.
|
||
|
||
private:
|
||
MbNurbsWireFrameParams();
|
||
|
||
public:
|
||
/// \ru Конструктор. \en Constructor.
|
||
MbNurbsWireFrameParams( const MbNurbsWireFrameInfo & info,
|
||
const MbSNameMaker & nameMaker )
|
||
: _frameIntoNurbsInfo( info )
|
||
, _snMaker( &nameMaker.Duplicate() )
|
||
{}
|
||
|
||
/// \ru Конструктор. \en Constructor.
|
||
explicit MbNurbsWireFrameParams( const MbWireFramePoint & p1,
|
||
const MbWireFramePoint & p2,
|
||
bool sense,
|
||
bool match,
|
||
bool ext,
|
||
const MbSNameMaker & nameMaker,
|
||
VERSION ver );
|
||
|
||
/// \ru Конструктор. \en Constructor.
|
||
explicit MbNurbsWireFrameParams( const MbNurbsWireFrameParams & other,
|
||
const MbWireFramePoint & p1,
|
||
const MbWireFramePoint & p2,
|
||
bool sense,
|
||
const MbSNameMaker & nameMaker );
|
||
|
||
/// \ru Конструктор копирования. \en Copy constructor.
|
||
MbNurbsWireFrameParams( const MbNurbsWireFrameParams & other );
|
||
|
||
/// \ru Конструктор для чтения. \en Constructor for reading.
|
||
MbNurbsWireFrameParams( TapeInit tapeInit );
|
||
|
||
/// \ru Функция инициализации. \en The initialization function.
|
||
void Init( const MbWireFramePoint & p1, const MbWireFramePoint & p2, bool sense )
|
||
{
|
||
_frameIntoNurbsInfo.Init( p1, p2, sense );
|
||
}
|
||
/// \ru Функция инициализации. \en The initialization function.
|
||
void Init( const MbWireFramePoint & p1, const MbWireFramePoint & p2, bool sense, bool match, bool ext ) {
|
||
_frameIntoNurbsInfo.Init( p1, p2, sense, match, ext, Math::DefaultMathVersion() );
|
||
}
|
||
|
||
public:
|
||
/// \ru Получить параметр начала участка кривой. \en Get the parameter of the start curve region.
|
||
const MbWireFramePoint & GetPBeg() const { return _frameIntoNurbsInfo.GetPBeg(); }
|
||
/// \ru Получить параметр конца участка кривой. \en Get the parameter of the end curve region.
|
||
const MbWireFramePoint & GetPEnd() const { return _frameIntoNurbsInfo.GetPEnd(); }
|
||
/// \ru Получить направление сплайн-кривой. \en Get the direction of spline-curve.
|
||
bool GetSense() const { return _frameIntoNurbsInfo.GetSense(); }
|
||
/// \ru Сохранять ли при преобразовании однозначное соответствие параметрических областей. \en Whether to save correspondence of parametric regions by transformation or not.
|
||
bool MatchParams() const { return _frameIntoNurbsInfo.MatchParams(); }
|
||
/// \ru Строится ли преобразование на продолжении для незамкнутой подложки. \en Whether transformation is constructed on the extension for a non-closed substrate or not.
|
||
bool ExtendRange() const { return _frameIntoNurbsInfo.ExtendRange(); }
|
||
/// \ru Получить версию исполнения. \en Get the version of execution.
|
||
VERSION GetMathVersion() const { return _frameIntoNurbsInfo.GetMathVersion(); }
|
||
|
||
/// \ru Получить информацию для преобразования каркаса в Nurbs. \en Get information for transformation of a wire frame to NURBS.
|
||
const MbNurbsWireFrameInfo & GetNurbsWireFrameInfo() const { return _frameIntoNurbsInfo; }
|
||
|
||
/// \ru Получить именователь. \en Get names maker.
|
||
const MbSNameMaker & GetNameMaker() const { return *_snMaker; }
|
||
|
||
/// \ru Оператор присваивания. \en An assignment operator.
|
||
const MbNurbsWireFrameParams & operator = ( const MbNurbsWireFrameParams & other ) {
|
||
MbPrecision::operator=( other );
|
||
_frameIntoNurbsInfo = other._frameIntoNurbsInfo;
|
||
return *this;
|
||
}
|
||
|
||
};
|
||
|
||
#endif // __OP_WIREFRAME_PARAMETERS_H
|