- C3d aggiornamento delle librerie ( 117960).
This commit is contained in:
SaraP
2023-10-12 08:53:50 +02:00
parent 22469b5803
commit 86f4bb48be
92 changed files with 3564 additions and 1277 deletions
+274 -5
View File
@@ -138,11 +138,12 @@ public:
// ---
class MATH_CLASS MbSurfaceFitToGridParameters {
private:
MbeSpaceType _surfaceType; ///< \ru Тип поверхности. \en A surface type.
double _tolerance; ///< \ru Точность распознавания. \en A fitting tolerance.
c3d::IndicesVector _indicies; ///< \ru Индексы полигонов сетки. \en Indicies of polygons.
MbeRejectOutliersType _typeReject; ///< \ru Способ отбраковки выбросов. \en Outliers rejection mode.
double _valueReject; ///< \ru Пороговое значения для отбраковки выбросов. \en Outliers rejection mode treshold value.
MbeSpaceType _surfaceType; ///< \ru Тип поверхности. \en A surface type.
double _tolerance; ///< \ru Точность распознавания. \en A fitting tolerance.
c3d::IndicesVector _indicies; ///< \ru Индексы полигонов сетки. \en Indicies of polygons.
MbeRejectOutliersType _typeReject; ///< \ru Способ отбраковки выбросов. \en Outliers rejection mode.
double _valueReject; ///< \ru Пороговое значения для отбраковки выбросов. \en Outliers rejection mode treshold value.
MbSurfaceFitConstraint _fitConstraint; ///< \ru Ограничение. \en Constraint.
///< \ru Предельные значения параметров аналитических поверхностей. \en Tresholds for analytical surfaces parameters.
double _angleConeMin; ///< \ru Минимально возможный половинный угол конуса (градусы). \en Mininmum allowed cone half-angle ( degrees ).
@@ -271,6 +272,8 @@ public:
double GetAngleConeMax() const { return _angleConeMax; }
/// \ru Выдать максимально возможный радиальный размер аналитических поверхностей. \en Get maximum allowed analytical shapes radial size.
double GetRadiusAnalyticShapeMax() const { return _radiusAnalyticShapeMax; }
/// \ru Выдать ограничение. \en Get the constraint.
const MbSurfaceFitConstraint & GetFitConstraint() const { return _fitConstraint; }
/// \ru Установить предельные значения параметров аналитических поверхностей. \en Set tresholds for analytical surfaces parameters.
void SetAnalyticBounds( double angleConeMin, double angleConeMax, double radiusAnalyticShapeMax )
{
@@ -285,6 +288,272 @@ public:
_countCpMax = countCpMax;
_smoothCoef = smoothCoef;
}
/** \brief \ru Ограничить ось примитива.
\en Add an axis constraint. \~
\details \ru Ограничить ось цилиндра, конуса или тора, а также нормаль плоскости.
По умолчанию ось примитива или нормаль плоскости будет коллинеарна направлению direction.
Дополнительно можно задать желаемый угол angle между осью примитива или нормалью плоскости и заданным направлением из промежутка [0; П/2].
Для построения плоскости с нормалью, которая перпендикулярна заданному направлению, необходимо задать угол П/2.
Функция сбрасывает выставленные ранее ограничения на ось.
\en Add an axis constraint to a cylinder, cone, torus or plane.
The axis of a primitive or plane normal will be collinear to a given direction by default.
Besides there may be given a desired angle between the axis of a primitive or plane normal and a given direction from [0; П/2].
Fitting a plane with a normal, which is perpendicular to a given direction, implies an angle П/2.
The function resets all previous axis constraints. \~
\param[in] direction - \ru Эталонное направление.
\en Reference direction. \~
\param[in] angle - \ru Угол между осью примитива и заданным направлением.
\en Angle between the axis of a primitive and a given direction. \~
\return \ru Возвращает true, если задан корректный угол, и false - иначе.
\en Returns true, if an angle is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddAxisConstraint( const MbVector3D & direction, double angle = 0. )
{
return _fitConstraint.AddAxisConstraint( direction, angle );
}
/** \brief \ru Зафиксировать ось примитива.
\en Add a coaxial constraint. \~
\details \ru Зафиксировать ось цилиндра, конуса, тора или сферы.
Вписывается примитив с заданной осью.
Если вписывается сфера, ее центр лежит на заданной оси.
Функция сбрасывает выставленные ранее ограничения на ось.
\en Add a coaxial constraint to a cylinder, cone, torus or sphere.
A primitive will be fit with a given axis.
If a sphere is fit, its center lies on a given axis.
The function resets all previous axis constraints. \~
\param[in] axis - \ru Ось.
\en Axis. \~
\ingroup Polygonal_Objects
*/
void AddCoaxialConstraint( const MbAxis3D & axis )
{
return _fitConstraint.AddCoaxialConstraint( axis );
}
/** \brief \ru Зафиксировать радиус цилиндра.
\en Fix cylinder radius. \~
\details \ru Зафиксировать радиус цилиндра.
Радиус должен быть положительным.
\en Fix cylinder radius.
The value has to be positive. \~
\param[in] radius - \ru Радиус цилиндра.
\en Cylinder radius. \~
\return \ru Возвращает true, если задан корректный радиус, и false - иначе.
\en Returns true, if a radius is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddCylinderRadiusConstraint( double radius )
{
return _fitConstraint.AddCylinderRadiusConstraint( radius );
}
/** \brief \ru Зафиксировать радиус сферы.
\en Fix sphere radius. \~
\details \ru Зафиксировать радиус сферы.
Радиус должен быть положительным.
\en Fix sphere radius.
The value has to be positive. \~
\param[in] radius - \ru Радиус сферы.
\en Sphere radius. \~
\return \ru Возвращает true, если задан корректный радиус, и false - иначе.
\en Returns true, if a radius is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddSphereRadiusConstraint( double radius )
{
return _fitConstraint.AddSphereRadiusConstraint( radius );
}
/** \brief \ru Зафиксировать угол конуса.
\en Fix cone angle. \~
\details \ru Зафиксировать угол конуса.
Угол должен быть из промежутка (0; П/2).
\en Fix cone angle.
The angle has to be from (0; П/2). \~
\param[in] angle - \ru Угол конуса.
\en Cone angle. \~
\return \ru Возвращает true, если задан корректный угол, и false - иначе.
\en Returns true, if an angle is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddConeAngleConstraint( double angle )
{
return _fitConstraint.AddConeAngleConstraint( angle );
}
/** \brief \ru Зафиксировать радиусы тора.
\en Fix torus radii. \~
\details \ru Зафиксировать радиусы тора.
Можно зафиксировать большой и малый радиусы тора (только один их них или сразу оба).
Значения должны быть положительными (=0 - значение не зафиксировано).
\en Fix torus radii.
There may be fixed the major radius (_size1) or the minor radius (_size2) of a torus (one or both of them).
The values have to be positive (=0 - value is not fixed). \~
\param[in] majorRadius - \ru Большой радиус тора.
\en Major torus radius. \~
\param[in] minorRadius - \ru Малый радиус тора.
\en Minor torus radius. \~
\return \ru Возвращает true, если заданы корректные радиусы, и false - иначе.
\en Returns true, if radii are correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddTorusRadiiConstraint( double majorRadius, double minorRadius )
{
return _fitConstraint.AddTorusRadiiConstraint( majorRadius, minorRadius );
}
/** \brief \ru Установить ограничение типа XYW.
\en Set the XYW-constraint. \~
\details \ru Установить ограничение типа XYW.
Ограничение типа XYW допускает только параллельный перенос вдоль осей OX и OY и поворот вокруг оси OZ заданной системы координат.
Для плоскости, цилиндра, конуса или тора должен быть зафиксирован угол theta между осью объекта и осью OZ заданной СК.
Угол theta должен принадлежать отрезку [0; П/2].
Для сферы должна быть зафиксирована координата z ее центра в заданной СК.
Для тора должна быть зафиксирована координата z центра его направляющей окружности в заданной СК.
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Set the XYW-constraint.
Translation along the OX и OY axes and rotation about the OZ axis of a local coordinate system are only allowed.
For a plane, a cylinder, a cone or a torus there has to be fixed the angle theta between an object's axis and the OZ axis of a given coordinate system.
The angle theta has to belong to [0; П/2].
For a sphere there has to be fixed the Z coordinate of its center.
For a torus there has to be fixed the Z coordinate of its directrix circle.
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType SetFitConstraintXYW( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place )
{
return _fitConstraint.InitializeXYW( typeSurface, typeDim, fixedValues, place );
}
/** \brief \ru Установить ограничение типа Z.
\en Set the Z-constraint. \~
\details \ru Установить ограничение типа Z.
Ограничение типа Z допускает только сдвиг вдоль оси OZ заданной системы координат.
Для плоскости, цилиндра, конуса или тора должны быть зафиксированы:
- зенитный угол theta: угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2],
- азимутальный угол phi: угол между проекцией оси объекта на плоскость OXY и осью OX заданной СК,
должен принадлежать промежутку [0; 2П).
Для цилиндра, конуса или тора должны быть зафиксированы координаты x и y некоторой точки на оси объекта.
Для сферы должны быть зафиксированы координаты x и y ее центра в заданной СК.
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Set the Z-constraint.
Translation along the OZ axis of a local coordinate system is only allowed.
For a plane, a cylinder, a cone or a torus there have to be fixed:
- the zenith angle theta: the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2],
- the azimuthal angle phi: the angle between the projection of an object's axis onto the OXY plane
and the OX axis of a given CS, has to belong to [0; 2П).
For a cylinder, a cone or a torus there have to be fixed the X and Y coordinates of a point of an object's axis.
For a sphere there have to be fixed the X and Y coordinates of its center.
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType SetFitConstraintZ( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place )
{
return _fitConstraint.InitializeZ( typeSurface, typeDim, fixedValues, place );
}
/** \brief \ru Установить ограничение типа XYZ.
\en Set the XYZ-constraint. \~
\details \ru Установить ограничение типа XYZ.
Ограничение типа XYZ допускает только параллельный перенос (запрещены повороты вокруг координатных осей заданной системы координат).
Для плоскости, цилиндра, конуса или тора должны быть зафиксированы:
- зенитный угол theta: угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2],
- азимутальный угол phi: угол между проекцией оси объекта на плоскость OXY и осью OX заданной СК,
должен принадлежать промежутку [0; 2П).
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Set the XYZ-constraint.
Translation is only allowed (any rotation is forbidden).
For a plane, a cylinder, a cone or a torus there have to be fixed:
- the zenith angle theta: the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2],
- the azimuthal angle phi: the angle between the projection of an object's axis onto the OXY plane
and the OX axis of a given CS, has to belong to [0; 2П).
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType SetFitConstraintXYZ( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place )
{
return _fitConstraint.InitializeXYZ( typeSurface, typeDim, fixedValues, place );
}
/** \brief \ru Установить ограничение типа ZW.
\en Set the ZW-constraint. \~
\details \ru Установить ограничение типа ZW.
Ограничение типа ZW допускает только сдвиг вдоль оси OZ и поворот вокруг оси OZ заданной системы координат.
Для плоскости, цилиндра, конуса или тора должны быть зафиксированы:
- зенитный угол theta: угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2],
- начальный азимутальный угол phi: угол между проекцией оси объекта в начальной позиции на плоскость OXY и осью OX заданной СК,
должен принадлежать промежутку [0; 2П),
- расстояние dist от оси OZ заданной СК до оси объекта.
Для cферы должно быть зафиксировано расстояние dist от ее центра до оси OZ заданной СК.
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Set the ZW-constraint.
Translation along the OZ axis and rotation about the OZ axis of a local coordinate system are only allowed.
For a plane, a cylinder, a cone or a torus there have to be fixed:
- the zenith angle theta: the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2],
- the initial azimuthal angle phi: the angle between the projection of an object's axis in the initial position onto the OXY plane
and the OX axis of a given CS, has to belong to [0; 2П),
- the distance between an object's axis the OZ axis of a given CS.
For a sphere there has to be fixed the distance between its center and the OZ axis of a given CS.
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType SetFitConstraintZW( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place )
{
return _fitConstraint.InitializeZW( typeSurface, typeDim, fixedValues, place );
}
OBVIOUS_PRIVATE_COPY( MbSurfaceFitToGridParameters )
};
+22
View File
@@ -1117,4 +1117,26 @@ MATH_FUNC( MbResultType ) SectionShell( MbSolid * solid,
MbSolid *& result );
//------------------------------------------------------------------------------
/** \brief \ru Построить балочную модель с постоянным поперечным сечением на основе оболочки.
\en Create a shell-based beam model with constant cross section. \~
\details \ru Построить балочную модель с постоянным поперечным сечением на основе оболочки.
\en Create a shell-based beam model with constant cross section. \~
\param[in] solid - \ru Тело, в котором ищутся балочные элементы.
\en The solid, which beam elements are searched in. \~
\param[in] params - \ru Входные параметры.
\en Input parameters. \~
\param[out] result - \ru Результат операции.
\en The operation result. \~
\result \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Shell_Modeling
\warning \ru В разработке.
\en Under development. \~
*/
// ---
MATH_FUNC( MbResultType ) ExtractBeamElement( const MbSolid & solid,
const MbBeamElementParams & params,
MbBeamElementResults & results );
#endif // __ACTION_SHELL_H
+4 -2
View File
@@ -65,7 +65,8 @@ class MATH_CLASS IProgressIndicator;
solidType = et_Sphere - шар (3 точки), \n
solidType = et_Torus - тор (3 точки), \n
solidType = et_Cylinder - цилиндр (3 точки), \n
solidType = et_Cone - конус (3 точки), \n
solidType = et_Cone - конус (3 точки, если конус не усеченный),
(4 точки, если конус усеченный), \n
solidType = et_Block - блок (4 точки), \n
solidType = et_Wedge - клин (4 точки), \n
solidType = et_Prism - призма (количество вершин основания+1 точка), \n
@@ -82,7 +83,8 @@ class MATH_CLASS IProgressIndicator;
solidType = et_Sphere - a sphere (3 points), \n
solidType = et_Torus - a torus (3 points), \n
solidType = et_Cylinder - a cylinder (3 points), \n
solidType = et_Cone - a cone (3 points), \n
solidType = et_Cone - a cone (3 points), in the case of non-frustum cone,
(4 points), in the case of frustum cone, \n
solidType = et_Block - a block (4 points), \n
solidType = et_Wedge - a wedge (4 points), \n
solidType = et_Prism - a prism (points count is equal to the base vertices count + 1), \n
+58 -3
View File
@@ -495,6 +495,8 @@ MATH_FUNC (MbResultType) IntersectionCurve( const MbSurface & surface1,
\en Create intersection curves of two faces. \~
\details \ru Создать кривые пересечения двух граней. Результат - массив кривых пересечения поверхностей. \n
\en Create intersection curves of two faces. The result is an array of intersection curves of surfaces. \n \~
\deprecated \ru Функция устарела, взамен использовать #IntersectionCurve с набором параметров #MbIntCurveParams и #MbIntCurveResults.
\en The function is deprecated, instead use #IntersectionCurve with the parameter list #MbIntCurveParams and #MbIntCurveResults. \~
\param[in] face1 - \ru Первая грань оболочки.
\en The first face of the shell. \~
\param[in] face2 - \ru Вторая грани оболочки.
@@ -507,17 +509,43 @@ MATH_FUNC (MbResultType) IntersectionCurve( const MbSurface & surface1,
\en Returns operation result code. \~
\ingroup Curve3D_Modeling
*/ // ---
MATH_FUNC (MbResultType) IntersectionCurve( MbFace & face1,
//DEPRECATE_DECLARE_REPLACE ( IntersectionCurve with MbFace and MbIntCurveResults )
MATH_FUNC (MbResultType) IntersectionCurve( MbFace & face1,
MbFace & face2,
const MbIntCurveParams & params,
MbWireFrame *& result );
//------------------------------------------------------------------------------
/** \brief \ru Создать кривые пересечения двух граней.
\en Create intersection curves of two faces. \~
\details \ru Создать кривые пересечения двух граней. Результат - массив кривых пересечения поверхностей. \n
\en Create intersection curves of two faces. The result is an array of intersection curves of surfaces. \n \~
\param[in] face1 - \ru Первая грань оболочки.
\en The first face of the shell. \~
\param[in] face2 - \ru Вторая грани оболочки.
\en The second face of the shell. \~
\param[in] params - \ru Параметры.
\en Parameters. \~
\param[out] results - \ru Выходные параметры.
\en Output parameters. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Curve3D_Modeling
*/ // ---
MATH_FUNC (MbResultType) IntersectionCurve( MbFace & face1,
MbFace & face2,
const MbIntCurveParams & params,
MbIntCurveResults & results );
//------------------------------------------------------------------------------
/** \brief \ru Создать кривые пересечения граней двух оболочек.
\en Create intersection curves of two shells faces. \~
\details \ru Создать кривые пересечения граней двух оболочек. Результат - массив кривых пересечения поверхностей. \n
\en Create intersection curves of two shells faces. The result is an array of intersection curves of surfaces. \n \~
\deprecated \ru Функция устарела, взамен использовать #IntersectionCurve с набором параметров #MbIntCurveParams и #MbIntCurveResults.
\en The function is deprecated, instead use #IntersectionCurve with the parameter list #MbIntCurveShellParams and #MbIntCurveResults. \~
\param[in] solid1 - \ru Первая оболочка.
\en The first shell. \~
\param[in] faceIndices1 - \ru Номера граней в первой оболочке.
@@ -534,7 +562,8 @@ MATH_FUNC (MbResultType) IntersectionCurve( MbFace & face1,
\en Returns operation result code. \~
\ingroup Curve3D_Modeling
*/ // ---
MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
//DEPRECATE_DECLARE_REPLACE ( IntersectionCurve with MbIntCurveShellParams and MbIntCurveResults )
MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
const c3d::IndicesVector & faceIndices1,
const MbSolid & solid2,
const c3d::IndicesVector & faceIndices2,
@@ -547,6 +576,8 @@ MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
\en Create intersection curves of two shells faces. \~
\details \ru Создать кривые пересечения граней двух оболочек. Результат - массив кривых пересечения поверхностей. \n
\en Create intersection curves of two shells faces. The result is an array of intersection curves of surfaces. \n \~
\deprecated \ru Функция устарела, взамен использовать #IntersectionCurve с набором параметров #MbIntCurveParams и #MbIntCurveResults.
\en The function is deprecated, instead use #IntersectionCurve with the parameter list #MbIntCurveShellParams and #MbIntCurveResults. \~
\param[in] solid1 - \ru Первая оболочка.
\en The first shell. \~
\param[in] faceIndices1 - \ru Номера граней в первой оболочке.
@@ -567,7 +598,8 @@ MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
\en Returns operation result code. \~
\ingroup Curve3D_Modeling
*/ // ---
MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
//DEPRECATE_DECLARE_REPLACE ( IntersectionCurve with MbIntCurveShellParams and MbIntCurveResults )
MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
const c3d::IndicesVector & faceIndices1,
bool same1,
const MbSolid & solid2,
@@ -577,6 +609,29 @@ MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
MbWireFrame *& result );
//------------------------------------------------------------------------------
/** \brief \ru Создать кривые пересечения граней двух оболочек.
\en Create intersection curves of two shells faces. \~
\details \ru Создать кривые пересечения граней двух оболочек. Результат - массив кривых пересечения поверхностей. \n
\en Create intersection curves of two shells faces. The result is an array of intersection curves of surfaces. \n \~
\param[in] solid1 - \ru Первая оболочка.
\en The first shell. \~
\param[in] solid2 - \ru Вторая оболочка.
\en The second shell. \~
\param[in] params - \ru Входные параметры.
\en Inpit parameters. \~
\param[out] results - \ru Выходные параметры.
\en Output parameters. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Curve3D_Modeling
*/ // ---
MATH_FUNC (MbResultType) IntersectionCurve( const MbSolid & solid1,
const MbSolid & solid2,
const MbIntCurveShellParams & params,
MbIntCurveResults & results );
//------------------------------------------------------------------------------
/** \brief \ru Создать линию пересечения поверхностей.
\en Create an intersection curve of surfaces. \~
+2
View File
@@ -12,6 +12,8 @@
#include <mb_cart_point.h>
#include <templ_p_array.h>
#include <templ_s_array.h>
class MATH_CLASS MbCurve;
+4 -4
View File
@@ -553,7 +553,7 @@ public:
d = 0.0;
C3D_ASSERT( d >= 0 );
if ( d > 0.0 ) {
if ( d > -NULL_EPSILON ) { // KOMPAS-66491. Нулевые расстояния должны добавляться в результат.
size_t count = allDistances.size();
bool add = true;
@@ -655,9 +655,9 @@ public:
/// \ru Режим проецирования сетки базового объекта на целевой объект. \en Projection mode of the base object grid onto the target object.
enum class ProjectionMode
{
om_Radiance = 0, /// \ru Поиск экстремальных расстояний по нормали к базовому объекту. \en Search for extreme distances along the normal to the base object. \~
om_NearestDistance = 1, /// \ru Поиск экстремальных расстояний по нормали к целевому объекту. \en Search for extreme distances along the normal to the target object. \~
om_SpecifiedDirection = 2 /// \ru Поиск экстремальных расстояний в заданном направлении. \en Search for extreme distances in a given direction. \~
om_Radiance = 0, ///< \ru Поиск экстремальных расстояний по нормали к базовому объекту. \en Search for extreme distances along the normal to the base object. \~
om_NearestDistance = 1, ///< \ru Поиск экстремальных расстояний по нормали к целевому объекту. \en Search for extreme distances along the normal to the target object. \~
om_SpecifiedDirection = 2 ///< \ru Поиск экстремальных расстояний в заданном направлении. \en Search for extreme distances in a given direction. \~
};
public:
+1 -1
View File
@@ -107,7 +107,7 @@ public:
/// \ru Оператор присваивания. \en Assignment operator.
MbRGBA & operator = ( const MbRGBA & c );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbRGBA, MATH_FUNC_EX ) // \ru Чтение и запись объекта класса. \en Reading and writing an object of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbRGBA, MATH_FUNC_EX ) // \ru Чтение и запись объекта класса. \en Reading and writing an object of the class.
}; // MbRGBA
+10 -2
View File
@@ -77,6 +77,7 @@ protected :
private:
NameAttributesVector parentNames; ///< \ru Топологические имена родителей объекта. \en Topological names of object parents.
bool isTemporal; ///< \ru Атрибут временный, на время операции (Этот признак не пишется и не читается). \en Attribute is temporary, for the duration of the operation only (This tag is not read or written).
c3d::string_t prompt; ///< \ru Строка описания. \en String of description.
protected :
/// \ru Конструктор копирования. \en Copy constructor.
@@ -86,6 +87,8 @@ public :
MbNameAttribute( bool isTemporal = false );
/// \ru Конструктор. \en Constructor.
MbNameAttribute( const MbName &, bool isTemporal = false );
/// \ru Конструктор по имени, описанию и флагу временности. \en Constructor by name, description and temporary flag.
MbNameAttribute( const MbName &, const TCHAR * prompt, bool isTemporal = false );
/// \ru Деструктор. \en Destructor.
virtual ~MbNameAttribute();
@@ -106,6 +109,9 @@ public :
/// \ru Установить имя. \en Set name.
void SetName( const MbName &, bool deleteParentNames = true );
/// \ru Выдать подсказку атрибута. \en Get a prompt of attribute.
const c3d::string_t & GetPrompt() const { return prompt; }
/// \ru Определить, есть ли хоть одно имя родительского объекта. \en Determine whether at least one name of parent object exists.
bool IsAnyParentName() const { return (parentNames.size() > 0); }
/// \ru Выдать количество родительских имен первого уровня. \en Get the number of parent names of the first level.
@@ -116,10 +122,12 @@ public :
bool DeleteParentName( const MbName & );
/// \ru Добавить имя родительского объекта. \en Add a name of parent object.
bool AddParentName( const MbName &, bool isTemporal = false );
/// \ru Добавить имя и описание родительского объекта. \en Add name and description of parent object.
bool AddParentName( const MbName &, const TCHAR * prompt, bool isTemporal = false );
/// \ru Добавить имена родительских объектов. \en Add names of parent objects.
bool AddParentNames( const MbNameAttribute &, double accuracy );
/// \ru Получить имена родительских объектов. \en Get names of parent objects.
void GetParentNames( c3d::ConstNamesVector & ) const;
/// \ru Получить имена и описания родительских объектов. \en Get names and descriptions of parent objects.
void GetParentNames( c3d::ConstNamesVector & names, c3d::StringTVector * prompts = nullptr ) const;
///< \ru Является ли атрибут временным. \en Whether this attribute is temporary.
bool IsTemporal() const { return isTemporal; }
+2 -2
View File
@@ -12,12 +12,12 @@
#include <attribute_item.h>
#include <io_base.h>
#include <io_memory_buffer.h>
#include <math_define.h>
#include <attr_registry.h>
#include <tool_cstring.h>
#include <tool_mutex.h>
#include <memory>
class MATH_CLASS MbExternalAttribute;
class MATH_CLASS MbUserAttribute;
@@ -170,7 +170,7 @@ public:
protected:
virtual ~MbUserAttribute(); // Use AddRef/Release or smart pointer SPtr<MbAttribute> to destruct it correctly.
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbUserAttribute )
DECLARE_PERSISTENT_CLASS_NEW_DEL_BASE( MbUserAttribute, MATH_FUNC_EX )
OBVIOUS_PRIVATE_COPY( MbUserAttribute )
};
+3
View File
@@ -581,6 +581,9 @@ namespace c3d // namespace C3D
/// \ru Подсказка для атрибута гладкости ребра. \en Hint for an edge smoothness attribute.
constexpr TCHAR c3dStr_EdgeSmoothnessInfo[] = _T( "c3d_EdgeSmoothnessInfo" );
/// \ru Подсказка для атрибута имени ребра, используемого для восстановления имён скруглений. \en Hint for the edge name attribute used to recover fillet names.
constexpr TCHAR c3dStr_EdgeForFilletNamesRecover[] = _T( "c3d_EdgeEdgeForFilletNamesRecover" );
} // namespace C3D
+1
View File
@@ -14,6 +14,7 @@
#include <mb_operation_result.h>
#include <mb_matrix3d.h>
#include <set>
#include <map>
class MbHRepSolid;
+42 -24
View File
@@ -850,8 +850,8 @@ MATH_FUNC (bool) FindFacesEdgesCarriers( const c3d::ConstEdgesVector & edges,
\en Repair incorrect edge of a shell. \~
\details \ru Починить некорректное ребро оболочки (псевдо-толерантное, псевдо-точное). \n
\en Repair incorrect edge of a shell (pseudo-tolerant, pseudo-exact). \n \~
\param[in] edge - \ru Ребро оболочки.
\en Shell edge. \~
\param[in,out] edge - \ru Ребро оболочки.
\en Shell edge. \~
\param[in] updateFacesBounds - \ru Обновить границы поверхностей в гранях ребра.
\en Update surface bounds of edge faces. \~
\return \ru Возвращает true, если была выполнена модификация ребра.
@@ -866,8 +866,8 @@ MATH_FUNC( bool ) RepairEdge( MbCurveEdge & edge, bool updateFacesBounds );
\en Repair incorrect edges of a shell. \~
\details \ru Починить некорректное ребро оболочки (псевдо-толерантное, псевдо-точное). \n
\en Repair incorrect edge of a shell (pseudo-tolerant, pseudo-exact). \n \~
\param[in] shell - \ru Оболочка.
\en Shell. \~
\param[in,out] shell - \ru Оболочка.
\en Shell. \~
\param[in] updateFacesBounds - \ru Обновить границы поверхностей в гранях ребра.
\en Update surface bounds of edge faces. \~
\return \ru Возвращает true, если была выполнена модификация ребра.
@@ -877,13 +877,31 @@ MATH_FUNC( bool ) RepairEdge( MbCurveEdge & edge, bool updateFacesBounds );
MATH_FUNC( bool ) RepairEdges( MbFaceShell & shell, bool updateFacesBounds = true );
//------------------------------------------------------------------------------
/** \brief \ru Починить некорректные вершины оболочки.
\en Repair incorrect vertices of a shell. \~
\details \ru Починить некорректные вершины оболочки : \n
- установить одну общую вершину в средней точке стыковки ребёр, \n
- уточнить толерантность вершины, если ее нет или она меньше реальной. \n
\en Repair incorrect vertices of a shell : \n
- set single vertex at the midpoint of the edge junction, \n
- clarify the tolerance of the vertex if it's not there or it 's less than the real one. \n ~
\param[in] shell - \ru Оболочка.
\en Shell. \~
\return \ru Возвращает true, если была выполнена модификация хотя бы одной вершины.
\en Returns true if at least one vertex has been modified. \~
\ingroup Algorithms_3D
*/ //---
MATH_FUNC( bool ) RepairVertices( MbFaceShell & shell );
//------------------------------------------------------------------------------
/** \brief \ru Устранить наличие общих подложек поверхностей.
\en Remove common surface substrates. \~
\details \ru Найти и устранить общие поверхности-подложки в гранях оболочки. \n
\en Find and eliminate common underlying surfaces of a shell faces. \n \~
\param[in] shell - \ru Модифицируемая оболочка.
\en A shell to be modified. \~
\param[in,out] shell - \ru Модифицируемая оболочка.
\en A shell to be modified. \~
\param[in] checkEdges - \ru Выполнить замену в ребрах.
\en Replace in shell edges. \~
\return \ru Возвращает true, если была выполнена модификация оболочки.
@@ -898,8 +916,8 @@ MATH_FUNC( bool ) RemoveCommonSurfaceSubstrates( MbFaceShell & shell, bool check
\en Reset bounding boxes of surfaces. \~
\details \ru Сбросить габариты поверхностей и обновить параметрические пределы базовых поверхностей. \n
\en Reset bounding boxes of surfaces and update parametric limits of basis surfaces. \n \~
\param[in] shell - \ru Модифицируемая оболочка.
\en A shell to be modified. \~
\param[in,out] shell - \ru Модифицируемая оболочка.
\en A shell to be modified. \~
\param[in] updateParameticLimits - \ru Обновить параметрические пределы поверхностей.
\en Update parametric limits of surfaces. \~
\return \ru Возвращает true, если была выполнена модификация оболочки.
@@ -914,8 +932,8 @@ MATH_FUNC( bool ) ResetSurfacesBoundingBoxes( MbFaceShell & shell, bool updateBa
\en Reset bounding boxes of a surface. \~
\details \ru Сбросить габариты поверхности и обновить параметрические пределы ее базовой поверхности. \n
\en Reset bounding boxes of a surface and update parametric limits of its basis surface. \n \~
\param[in] surface - \ru Модифицируемая поверхность.
\en A surface to be modified. \~
\param[in,out] surface - \ru Модифицируемая поверхность.
\en A surface to be modified. \~
\param[in] updateParameticLimits - \ru Обновить параметрические пределы поверхностей.
\en Update parametric limits of surfaces. \~
\return \ru Возвращает true, если была выполнена модификация поверхности.
@@ -930,8 +948,8 @@ MATH_FUNC( bool ) ResetSurfaceBoundingBoxes( MbSurface & surface, bool updateBas
\en Reset all temporary data of curves. \~
\details \ru Сбросить все временные данные у кривых пересечения ребер оболочки. \n
\en Reset all temporary data of curves of shell edges. \n \~
\param[in] shell - \ru Модифицируемая оболочка.
\en A shell to be modified. \~
\param[in,out] shell - \ru Модифицируемая оболочка.
\en A shell to be modified. \~
\return \ru Возвращает true, если была выполнена модификация кривых.
\en Returns true if the curve modification was performed. \~
\ingroup Algorithms_3D
@@ -978,8 +996,8 @@ MATH_FUNC (bool) CheckTopologyItemsMainNames( const MbFaceShell & s
\en Add edges smoothness attributes. \~
\details \ru Добавить в рёбра атрибуты с информацией о гладкости стыковки граней в ребре.
\en Add attributes to edges with information about the smoothness of joining faces in the edge. \~
\param[in] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\param[in,out] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\param[in] skipExisting - \ru Пропустить уже существующие (не обновлять в них данные).
\en Skip existing ones (do not update data in them). \~
\return \ru Возвращает true, если новые атрибуты были добавлены.
@@ -993,14 +1011,14 @@ MATH_FUNC (bool) AddEdgeSmoothnessAttributes( MbFaceShell & shell, bool skipExis
\en Add edges smoothness attributes. \~
\details \ru Добавить в рёбра атрибуты с информацией о гладкости стыковки граней в ребре.
\en Add attributes to edges with information about the smoothness of joining faces in the edge. \~
\param[in] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\param[in,out] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\param[in] skipExisting - \ru Пропустить уже существующие (не обновлять в них данные).
\en Skip existing ones (do not update data in them). \~
\param[in] filledEdges - \ru Ребра с созданными или сохраненным атрибутами гладкости.
\en Edges with created or saved smoothness attributes. \~
\param[in] emptyEdges - \ru Ребра без атрибутов гладкости (нет второй поверхности или сбой создания).
\en Edges without smoothness attributes (no second surface or creation failure). \~
\param[out] filledEdges - \ru Ребра с созданными или сохраненным атрибутами гладкости.
\en Edges with created or saved smoothness attributes. \~
\param[out] emptyEdges - \ru Ребра без атрибутов гладкости (нет второй поверхности или сбой создания).
\en Edges without smoothness attributes (no second surface or creation failure). \~
\return \ru Возвращает true, если новые атрибуты были добавлены.
\en Returns true if new attributes were added.\~
\ingroup Algorithms_3D
@@ -1014,8 +1032,8 @@ MATH_FUNC( bool ) AddEdgeSmoothnessAttributes( MbFaceShell & shell, bool skipExi
\en Update edges smoothness attributes data. \~
\details \ru Обновить в атрибутах информацию о гладкости стыковки граней в ребре.
\en Update data in the attributes for the smoothness of the joining of faces in an edge. \~
\param[in] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\param[in,out] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\return \ru Возвращает true, если атрибуты были обновлены.
\en Returns true if attributes were updated.\~
\ingroup Algorithms_3D
@@ -1027,8 +1045,8 @@ MATH_FUNC (bool) UpdateEdgeSmoothnessAttributes( MbFaceShell & shell );
\en Remove edges smoothness attributes. \~
\details \ru Удалить из рёбер атрибуты с информацией о гладкости стыковки граней в ребре.
\en Remove attributes from edges with information about the smoothness of the joining of faces in the edge. \~
\param[in] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\param[in,out] shell - \ru Оболочка, которую обрабатываем.
\en Shell to processing. \~
\return \ru Возвращает true, если атрибуты были удалены.
\en Returns true if attributes were removed.\~
\ingroup Algorithms_3D
+1 -1
View File
@@ -93,7 +93,7 @@ public:
/// \ru Оператор копирования. \en Copy operator. \~
MtGeomArgument & operator = ( const MtGeomArgument & );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MtGeomArgument, MATH_FUNC_EX ) // Serializing into a file format
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MtGeomArgument, MATH_FUNC_EX ) // Serializing into a file format
}; // MtGeomArgument
+1
View File
@@ -14,6 +14,7 @@
#include <templ_p_array.h>
#include <cur_contour.h>
#include <curve.h> // for PlaneCurveSPtr
#include <map>
class MATH_CLASS MpEdge;
+4 -1
View File
@@ -16,6 +16,7 @@
#include <mb_data.h>
#include <conv_predefined.h>
#include <reference_item.h>
#include <map>
class MbProductInfo;
@@ -510,7 +511,9 @@ public:
/// \ru Получить настройки для выдачи отладочной информации. \en Get the settings of debug info.
virtual C3DConverterDebugSettings GetDebugSettings() const { return C3DConverterDebugSettings(); };
/// \ru Получить пользовательский преобразователь строк. \en Get user string transformer.
virtual SPtr<IC3DCharEncodingTransformer> GetUserCharEncodingTransformer() const { return SPtr<IC3DCharEncodingTransformer>(nullptr); }
virtual SPtr<IC3DCharEncodingTransformer> GetUserCharEncodingTransformer() const { return SPtr<IC3DCharEncodingTransformer>( nullptr ); }
/// \ru Создавать раскрашенные копии компонент при импорте. \en Create colored replicas of components on import.
DEPRECATE_DECLARE virtual bool ImportComponentsWithColoredReplica() { return false; }
}; // IConvertorProperty3D
+1 -24
View File
@@ -18,6 +18,7 @@
#include <tool_cstring.h>
#include <model_item.h>
#include <model_entity.h>
#include "conv_res_type.h"
#include <map>
@@ -57,30 +58,6 @@ enum MbeModelExchangeFormat {
};
//------------------------------------------------------------------------------
/** \brief \ru Результат конвертирования.
\en Result of converting operation.
\ingroup Data_Interface
*/
// ---
enum MbeConvResType {
cnv_Success = 0, ///< \ru Успешное завершение. \en Success.
cnv_PartialSuccess, ///< \ru Успешно обработана только часть объектов. При экспорте некоторые из переданных объектов не соответствуют требованиям формата. \en Only some objects were successfully processed. While export it turned out that some objects don't meet the requirements of the exchange format.
cnv_Error, ///< \ru Ошибка в процессе конвертирования. \en Error.
cnv_UserCanceled, ///< \ru Процесс прерван пользователем. \en Process interrupted by user.
cnv_NoBody, ///< \ru Не найдено тел. \en No solids found.
cnv_NoObjects, ///< \ru Не найдено объектов. \en No objects found.
cnv_FileOpenError, ///< \ru Ошибка открытия файла. \en File open error.
cnv_FileWriteError, ///< \ru Ошибка записи файла. \en File write error.
cnv_FileDeleteError, ///< \ru Ошибка удаления файла. \en Could not delete file.
cnv_ImpossibleReadAssembly,///< \ru Не поддерживает работу со сборками. \en Assemblies are not supported.
cnv_LicenseNotFound, ///< \ru Ошибка получения лицензии. \en License check failure.
cnv_NotEnoughMemory, ///< \ru Недостаточно памяти. \en Not enough memory.
cnv_UnknownExtension, ///< \ru Неизвестное расширение файла. \en Unknown file extenstion.
cnv_UnsupportedVersion ///< \ru Неподдерживаемая версия формата. \en Unsupported format version.
};
namespace c3d {
class CONV_CLASS C3DExchangeBuffer;
+3
View File
@@ -35,6 +35,9 @@ public:
// \ru Добавить конфигурацию для выбора пользователем. \en Add configuration for selection by user.
virtual void AddConfiguration ( const c3d::string_t& configurationName ) = 0;
// \ru Добавить конфигурацию для выбора пользователем, не содержащую модель. \en Add configuration without model for selection by user.
virtual void AddEmptyConfiguration( const c3d::string_t & configurationName ) { AddConfiguration( configurationName ); };
// \ru Указать индекс активной конфигурации. \en Specify the index of active configuration.
virtual void SetActiveConfiguration ( const size_t index ) = 0;
+36
View File
@@ -0,0 +1,36 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Перечисление с результатом конвертирования.
\en Enumeration with the result of conversion. \~
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __CONV_RES_TYPE_H
#define __CONV_RES_TYPE_H
//------------------------------------------------------------------------------
/** \brief \ru Результат конвертирования.
\en Result of converting operation.
\ingroup Data_Interface
*/
// ---
enum MbeConvResType {
cnv_Success = 0, ///< \ru Успешное завершение. \en Success.
cnv_PartialSuccess, ///< \ru Успешно обработана только часть объектов. При экспорте некоторые из переданных объектов не соответствуют требованиям формата. \en Only some objects were successfully processed. While export it turned out that some objects don't meet the requirements of the exchange format.
cnv_Error, ///< \ru Ошибка в процессе конвертирования. \en Error.
cnv_UserCanceled, ///< \ru Процесс прерван пользователем. \en Process interrupted by user.
cnv_NoBody, ///< \ru Не найдено тел. \en No solids found.
cnv_NoObjects, ///< \ru Не найдено объектов. \en No objects found.
cnv_FileOpenError, ///< \ru Ошибка открытия файла. \en File open error.
cnv_FileWriteError, ///< \ru Ошибка записи файла. \en File write error.
cnv_FileDeleteError, ///< \ru Ошибка удаления файла. \en Could not delete file.
cnv_ImpossibleReadAssembly,///< \ru Не поддерживает работу со сборками. \en Assemblies are not supported.
cnv_LicenseNotFound, ///< \ru Ошибка получения лицензии. \en License check failure.
cnv_NotEnoughMemory, ///< \ru Недостаточно памяти. \en Not enough memory.
cnv_UnknownExtension, ///< \ru Неизвестное расширение файла. \en Unknown file extenstion.
cnv_UnsupportedVersion ///< \ru Неподдерживаемая версия формата. \en Unsupported format version.
};
#endif
+3 -2
View File
@@ -15,6 +15,7 @@
#include <vector>
#include <list>
#include <map>
class MbGrid;
class MbFloatGrid;
@@ -115,9 +116,9 @@ namespace JTC {
CONV_FUNC( SPtr<MbGrid> ) CreateGridByPolygonPoints( const std::vector<std::vector<MbCartPoint3D>>& polygonsAsPoints );
//------------------------------------------------------------------------------
// Создать номали сетки по умолчанию
// Создать нормали сетки по умолчанию
// ---
void CreateDefaultNormals( MbFloatGrid & grid );
void CreateDefaultNormals( MbGrid & grid );
#endif // !__CONV_TOPO_MESH_H
+97
View File
@@ -0,0 +1,97 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Строитель балочной кривой.
\en Constructor of beam curve.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __CR_BEAM_CREATOR_H
#define __CR_BEAM_CREATOR_H
#include <creator.h>
#include <op_shell_parameter.h>
//------------------------------------------------------------------------------
/** \brief \ru Строитель балочной кривой.
\en Constructor of beam curve. \~
\details \ru Строитель балочной кривой.
\en Constructor of beam curve. \~
\ingroup Model_Creators
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbBeamCreator : public MbCreator
{
private:
MbBeamElementParams _params; ///< \ru Параметры операции. \en Operation parameters.
c3d::CreatorsSPtrVector _creators; ///< \ru Журнал построения исходного тела \en History tree of the source solid.
protected:
/// \ru Конструктор копирования. \en Copy-constructor.
MbBeamCreator( const MbBeamCreator &, MbRegDuplicate * iReg );
private:
MbBeamCreator(); // \ru Конструктор по умолчанию. Не реализован. \en Default constructor. Not implemented.
public:
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbBeamCreator( const c3d::CreatorsSPtrVector & solidCreators, const MbBeamElementParams & beamParams );
/// \ru Деструктор. \en Destructor.
~MbBeamCreator() override;
// \ru Общие функции строителя. \en The common functions of the creator.
MbeCreatorType IsA() const override { return ct_BeamCurveCreator; }; // \ru Тип элемента. \en A type of element.
MbCreator & Duplicate( MbRegDuplicate * iReg = nullptr ) const override; // \ru Сделать копию. \en Create a copy.
bool IsSame( const MbCreator &, double accuracy ) const override; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSimilar( const MbCreator & ) const override; // \ru Являются ли объекты подобными? \en Whether the objects are similar?
bool SetEqual( const MbCreator & ) override; // \ru Сделать равным. \en Make equal.
void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) override; // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix.
void Move( const MbVector3D &, MbRegTransform * = nullptr ) override; // \ru Сдвиг. \en Translation.
void Rotate( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) override; // \ru Повернуть вокруг оси. \en Rotate about the axis.
MbePrompt GetPropertyName() override; // \ru Дать имя свойства объекта. \en Get the object property name.
void GetProperties( MbProperties & ) override; // \ru Выдать свойства объекта. \en Get properties of the object.
void SetProperties( const MbProperties & ) override; // \ru Записать свойства объекта. \en Set properties of the object.
/** \} */
bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * ) override; // \ru Построить кривую по журналу построения. \en Create a curve from the history tree. \~
OBVIOUS_PRIVATE_COPY( MbBeamCreator )
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBeamCreator )
};
IMPL_PERSISTENT_OPS( MbBeamCreator )
//------------------------------------------------------------------------------
/** \brief \ru Создание строителя балочной кривой.
\en Create a constructor of beam curve. \~
\details \ru Создание строителя балочной кривой.\n
\en Create a constructor of beam curve.\n \~
\param[in] sourceCurve - \ru Исходное тело.
\en Source solid. \~
\param[in] parameters - \ru Входные параметры.
\en Input parameters. \~
\param[in] names - \ru Именователь построенного каркаса.
\en An object defining the wireframe names. \~
\param[out] res - \ru Код результата операции.
\en Operation result code. \~
\param[out] result - \ru Выходные параметры.
\en Output parameters. \~
\result \ru Возвращает строитель.
\en Returns the constructor. \~
\ingroup Curve3D_Modeling
\warning \ru В разработке.
\en Under development. \~
*/
// ---
MATH_FUNC( c3d::CreatorSPtr ) CreateBeamCurves( const MbSolid & sourceSolid,
const MbBeamElementParams & parameters,
MbResultType & res,
MbBeamElementResults & result );
#endif // __CR_EXTENDING_CURVE_H
+45 -33
View File
@@ -21,25 +21,27 @@ class MATH_CLASS MbElementarySolidParams;
/** \brief \ru Строитель оболочки элементарного тела.
\en Constructor of shell for elementary solid. \~
\details \ru Строитель оболочки элементарного тела по набору опорных точек и типу: \n
solidType = et_Sphere - шар (3 точки), \n
solidType = et_Torus - тор (3 точки), \n
solidType = et_Cylinder - цилиндр (3 точки), \n
solidType = et_Cone - конус (3 точки), \n
solidType = et_Block - блок (4 точки), \n
solidType = et_Wedge - клин (4 точки), \n
solidType = et_Prism - призма (количество вершин основания+1 точка), \n
solidType = et_Pyramid - пирамида (количество вершин основания+1 точка), \n
solidType = et_Plate - плита (4 точки). \n
solidType = et_Sphere - шар (3 точки), \n
solidType = et_Torus - тор (3 точки), \n
solidType = et_Cylinder - цилиндр (3 точки), \n
solidType = et_Cone - конус (3 точки), если конус не усеченный,
(4 точки), если конус усеченный, \n
solidType = et_Block - блок (4 точки), \n
solidType = et_Wedge - клин (4 точки), \n
solidType = et_Prism - призма (количество вершин основания+1 точка), \n
solidType = et_Pyramid - пирамида (количество вершин основания+1 точка), \n
solidType = et_Plate - плита (4 точки). \n
\en Constructor of shell for elementary solid by a set of support points and a type: \n
solidType = et_Sphere - a sphere (3 points), \n
solidType = et_Torus - a torus (3 points), \n
solidType = et_Cylinder - a cylinder (3 points), \n
solidType = et_Cone - a cone (3 points), \n
solidType = et_Block - a block (4 points), \n
solidType = et_Wedge - a wedge (4 points), \n
solidType = et_Prism - a prism (points count is equal to the base vertices count + 1), \n
solidType = et_Pyramid - a pyramid (points count is equal to the base vertices count + 1), \n
solidType = et_Plate - a plate (4 points). \n \~
solidType = et_Sphere - a sphere (3 points), \n
solidType = et_Torus - a torus (3 points), \n
solidType = et_Cylinder - a cylinder (3 points), \n
solidType = et_Cone - a cone (3 points), in the case of a non-frustum cone,
(4 points), in the case of a frustum cone, \n
solidType = et_Block - a block (4 points), \n
solidType = et_Wedge - a wedge (4 points), \n
solidType = et_Prism - a prism (points count is equal to the base vertices count + 1), \n
solidType = et_Pyramid - a pyramid (points count is equal to the base vertices count + 1), \n
solidType = et_Plate - a plate (4 points). \n \~
\ingroup Model_Creators
*/
// ---
@@ -65,32 +67,42 @@ public :
\param[in] pnts - \ru Опорные точки. \n
pnts[0] определяет начало локальной системы координат. \n
Для сферы, тора, цилиндра и конуса: \n
Для сферы, тора, цилиндра, конуса: \n
pnts[1] определяет направление оси Z локальной системы. \n
pnts[2] определяет направление оси X локальной системы. \n
pnts[2] определяет направление оси X локальной системы.
Для усеченного конуса (в случае 4-ех точек), если точка pnts[2] лежит на прямой,
образованной точками pnts[0] и pnts[1], то направление оси X
локальной системы определяет точка pnts[3]. \n
Для блока, клина и плиты: \n
pnts[1] определяет направление оси X локальной системы. \n
pnts[2] определяет направление оси Y локальной системы. \n
Кроме того, \n
pnts[1] определяет высоту цилиндра, высоту конуса,
большой радиус тора, длину блока, длину клина. \n
pnts[2] определяет радиус цилиндра, радиус конуса, радиус сферы,
малый радиус тора, ширину блока, ширину клина. \n
Последняя точка определяет высоту блока, клина, плиты, вершину пирамиды.
\en Support points. \n
pnts[1] определяет высоту цилиндра, высоту конуса, высоту усеченного конуса,
большой радиус тора, длину блока, длину клина. \n
pnts[2] определяет радиус цилиндра, радиус конуса (в случае трех точек),
верхний или нижний радиус усеченного конуса (в случае четырех точек),
радиус сферы, малый радиус тора, ширину блока, ширину клина. \n
Последняя точка определяет высоту блока, клина, плиты, вершину пирамиды,
верхний или нижний радиус усеченного конуса (в случае четырех точек).
\en Support points. \
pnts[0] determines a local coordinate system origin. \n
For a sphere, a torus, a cylinder or a cone: \n
For a sphere, a torus, a cylinder, a cone: \n
pnts[1] determines the direction of Z-axis of a local coordinate system. \n
pnts[2] determines the direction of X-axis of a local coordinate system. \n
pnts[2] determines the direction of X-axis of a local coordinate system.
For a frustum cone (in the case of 4 points), if point pnts[2] lies on a line that
formed by points pnts[0] and pnts[1], then the X axis
of a local system is determined by point pnts[3].\n
For a block, a plate or a wedge: \n
pnts[1] determines the direction of X-axis of a local coordinate system. \n
pnts[2] determines the direction of Y-axis of a local coordinate system. \n
Also, \n
pnts[1] determines the height of a cylinder or a cone,
the major radius of a torus, the length of a block or a wedge. \n
pnts[2] determines the radius of a cylinder or a cone, radius of a sphere,
the minor radius of a torus, the width of a block or a wedge. \n
The last point determines the height of a block, a wedge or a plate, the vertex of a pyramid. \~
pnts[1] determines the height of a cylinder, a cone or a frustum cone,
the major radius of a torus, the length of a block or a wedge. \n
pnts[2] determines the radius of a cylinder or a cone (in the case of 3 points),
radius of the upper or lower base of a frustum cone (in the case of 4 points),
radius of a sphere, the minor radius of a torus, the width of a block or a wedge. \n
The last point determines the height of a block, a wedge or a plate, the vertex of a pyramid,
radius of the upper or lower base of a frustum cone (in the case of 4 points) \~
\param[in] t - \ru Тип элементарного тела.
\en Elementary solid type. \~
\param[in] n - \ru Именователь операции.
+2 -1
View File
@@ -84,7 +84,7 @@ enum MbeCreatorType {
ct_OffsetCurveCreator = 205, ///< \ru Строитель эквидистантной кривой. \en Constructor of the offset curve.
ct_IntersectionCurveCreator = 206, ///< \ru Строитель кривой пересечения. \en Constructor of the intersection curve.
ct_ConnectingCurveCreator = 207, ///< \ru Строитель кривой скругления двух кривых. \en Constructor of the curve connecting two curves. \n
ct_ExtensionCurveCreator = 208, ///< \ru Строитель удлиняемой кривой. \en Constructor of the extended curve. \n
ct_ExtensionCurveCreator = 208, ///< \ru Строитель продленной кривой. \en Constructor of the extended curve. \n
ct_FairBaseCreator = 209, ///< \ru Строитель плавной кривой. \en Constructor of fair curve. \n
ct_FairCurveCreator = 210, ///< \ru Строитель плавной кривой по ломаной. \en Constructor of fair curve by a polyline. \n
ct_FairFilletCreator = 211, ///< \ru Строитель изменения плавной кривой по ломаной. \en Constructor of changing a fair curve by a polyline. \n
@@ -92,6 +92,7 @@ enum MbeCreatorType {
ct_FairChangeCreator = 213, ///< \ru Строитель изменения плавной кривой по ломаной. \en Constructor of changing a fair curve by a polyline. \n
ct_UnwrapCurveCreator = 214, ///< \ru Строитель развёрнутой кривой. \en Constructor of the unwrapped curve. \n
ct_WrapCurveCreator = 215, ///< \ru Строитель cвёрнутой кривой. \en Constructor of the wrapped curve. \n
ct_BeamCurveCreator = 216, ///< \ru Строитель балочной кривой. \en Constructor of the beam curve. \n
// \ru Строители полигональных объектов. \en Creators of polygonal objects.
ct_SimpleMeshCreator = 400, ///< \ru Строитель полигонального объекта без истории. \en Constructor of a polygonal object without history.
+50 -10
View File
@@ -226,7 +226,8 @@ public :
\details \ru Создается дуга окружности, проходящая через все 3 заданные точки.
Точки p1 и p3 - крайние. Направление движения по дуге определяется так, чтобы точка p2 лежала на дуге.
\en A circular arc is created passing through 3 given points.
Points p1 and p3 are the end points. Direction of moving along the arc is defined so as point p2 lay on the arc. \~
Points p1 and p3 are the end points. Direction of moving along the arc is defined so as point p2 lay on the arc. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Точка, лежащая на дуге.
@@ -234,14 +235,16 @@ public :
\param[in] p3 - \ru Конец дуги.
\en End of the arc. \~
*/
MbArc( const MbCartPoint & p1, const MbCartPoint & p2, const MbCartPoint & p3 ); // \ru Конструктор дуги по трем точкам \en Constructor of the arc by three points
DEPRECATE_DECLARE_REPLACE( MbArc with MbArc::Create )
MbArc( const MbCartPoint & p1, const MbCartPoint & p2, const MbCartPoint & p3 );
/** \brief \ru Конструктор дуги окружности.
\en Constructor of a circular arc. \~
\details \ru Создается дуга окружности с концами в заданных точках.
\details \ru Создается дуга окружности с концами в заданных точках.
Радиус окружности определяется по заданному тангенсу 1/4 угла раствора дуги.
\en An arc is created with ends at the given points.
\en An arc is created with ends at the given points.
A circle radius is defined by the given tangent of 1/4 of arc opening angle. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Конец дуги.
@@ -249,7 +252,8 @@ public :
\param[in] a4 - \ru Тангенс 1/4 угла раствора дуги.
\en Tangent of 1/4 of the arc opening angle. \~
*/
MbArc( const MbCartPoint & p1, const MbCartPoint & p2, double a4 ); // \ru Конструктор дуги по начальной и конечной точкам и тангенса 1/4 угла раствора дуги \en Constructor of an arc from the start and end points and tangent of 1/4 of the arc opening angle
DEPRECATE_DECLARE_REPLACE( MbArc with MbArc::Create )
MbArc( const MbCartPoint & p1, const MbCartPoint & p2, double a4 );
/** \brief \ru Конструктор дуги эллипса.
\en Constructor of an elliptical arc. \~
@@ -362,7 +366,8 @@ public :
\param[in] angle - \ru Угол между осями OX локальной и текущей системами координат.
\en An angle between OX axes of the local and the current coordinate systems. \~
*/
MbArc( double aa, double bb, const MbCartPoint & c, double angle ); // \ru Конструктор эллипса \en Constructor of an ellipse
MbArc( double aa, double bb, const MbCartPoint & c, double angle ); // \ru Конструктор эллипса \en Constructor of an ellipse
//protected :
/// \ru Конструктор копирования. \en Copy-constructor.
explicit MbArc( const MbArc & init );
@@ -370,8 +375,39 @@ public :
/// \ru Деструктор \en Destructor
virtual ~MbArc();
public :
VISITING_CLASS( MbArc );
public:
/** \brief \ru Создать дугу окружности.
\en Create circular arc. \~
\details \ru Создается дуга окружности, проходящая через все 3 заданные точки.
Точки p1 и p3 - крайние. Направление движения по дуге определяется так, чтобы точка p2 лежала на дуге.
\en A circular arc is created passing through 3 given points.
Points p1 and p3 are the end points. Direction of moving along the arc is defined so as point p2 lay on the arc. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Точка, лежащая на дуге.
\en A point on the arc. \~
\param[in] p3 - \ru Конец дуги.
\en End of the arc. \~
*/
static MbArc * Create( const MbCartPoint & p1, const MbCartPoint & p2, const MbCartPoint & p3 );
/** \brief \ru Создать дугу окружности.
\en Create circular arc. \~
\details \ru Создается дуга окружности с концами в заданных точках.
Радиус окружности определяется по заданному тангенсу 1/4 угла раствора дуги.
\en An arc is created with ends at the given points.
A circle radius is defined by the given tangent of 1/4 of arc opening angle. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Конец дуги.
\en End of the arc. \~
\param[in] a4 - \ru Тангенс 1/4 угла раствора дуги.
\en Tangent of 1/4 of the arc opening angle. \~
*/
static MbArc * Create( const MbCartPoint & p1, const MbCartPoint & p2, double a4 );
public:
VISITING_CLASS( MbArc );
/** \ru \name Общие функции геометрического объекта.
\en \name Common functions of a geometric object.
@@ -637,8 +673,10 @@ public :
\en End of the arc. \~
\param[in] cl - \ru Признак замкнутости.
\en Closedness attribute. \~
\result \ru True, если инициализация завершилась успешно.
\en True if initialization completed successfully. \~
*/
void Init3Points( const MbCartPoint & p1, const MbCartPoint & p2, const MbCartPoint & p3, bool cl );
bool Init3Points( const MbCartPoint & p1, const MbCartPoint & p2, const MbCartPoint & p3, bool cl );
/** \brief \ru Инициализировать дугу окружности.
\en Initialize a circular arc. \~
@@ -974,8 +1012,10 @@ public :
correctFirstPnt == true - корректируется первая точка.
\en Determines which point to be corrected after the rounding.
correctFirstPnt == true - the first point is to be corrected. \~
\result \ru True, если инициализация завершилась успешно.
\en True if initialization completed successfully. \~
*/
void Init( double a2, MbCartPoint & p1, MbCartPoint & p2,
bool Init( double a2, MbCartPoint & p1, MbCartPoint & p2,
const DiskreteLengthData * diskrData = nullptr,
bool correctFirstPnt = true );
+323 -142
View File
@@ -62,6 +62,171 @@ protected :
// \ru Временные данные. \en Temporary data.
mutable MbCube cube; ///< \ru Габаритный куб. \en Bounding box.
protected:
/** \brief \ru Конструктор окружности с параметрами по умолчанию.
\en Constructor of a circle with default parameters. \~
\details \ru Создается окружность с центром в начале координат и с нулевым радиусом.
\en A circle is created with center in the origin and zero radius. \~
*/
MbArc3D();
public://protected:
/** \brief \ru Конструктор эллипса, окружности или их дуг.
\en Constructor of an ellipse, a circle or an elliptical or circular arc. \~
\details \ru Создается дуга с центром в точке pc. \n
Первая полуось определяется как расстояние между точками pc и p1.
Вторая полуось определяется как длина проекции вектора из pс в p2 на перпендикуляр к (p1 - pc).
Начальная точка дуги лежит на луче, выходящем из центра окружности и проходящем через точку p1.
Конечная точка - на луче из центра, проходящем через точку p2. \n
Параметр initSense определяет цельность и направление дуги.
Если initSense == 0, то строится полный эллипс или окружность. \n
Если initSense > 0, то направление движения против часовой стрелки, если смотреть навстречу векторному произведению (p1 - pc) и (p2 - pc). \n
Если initSense < 0, то направление движения против часовой стрелки, если смотреть навстречу векторному произведению (p1 - pc) и (p2 - pc). \n
\en An arc centered in point 'pc' is created. \n
The first semiaxis is determines as the distance between points pc and p1.
The second semiaxis is determined as the length of projection of the vector from pc to p2 onto the perpendicular to (p1 - pc).
The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'.
The end point is on the ray from the center passing through the point 'p2'. \n
Parameter 'initSense' specifies completeness and the arc direction.
If initSense == 0, then the complete ellipse or circle is constructed. \n
If initSense > 0, then the direction of moving is counterclockwise if seeing against the vector product (p1 - pc) and (p2 - pc). \n
If initSense < 0, , then the direction of moving is counterclockwise if seeing against the vector product (p1 - pc) and(p2 - pc). \n \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] pc - \ru Центр эллипса или окружности.
\en Center of the ellipse or the circle. \~
\param[in] p1 - \ru Точка, определяющая начало кривой и первую полуось.
\en A point determining the beginning of the curve and the first semiaxis. \~
\param[in] p2 - \ru Точка, определяющая конец кривой и вторую полуось.
\en A point determining the end of the curve and the second semiaxis. \~
\param[in] initSense - \ru Определяет цельность и направление. initSense == 0 - замкнутая кривая initSense > 0 - движение против часовой стрелки, initSense < 0 - по часовой стрелке.
\en Determines the completeness and the direction. initSense == 0 - closed curve initSense > 0 - moving counterclockwise, initSense < 0 - clockwise. \~
*/
DEPRECATE_DECLARE_REPLACE( MbArc3D with MbArc3D::Create )
MbArc3D( const MbCartPoint3D & pc, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int initSense = 0 );
/** \brief \ru Конструктор окружности или дуги окружности.
\en Constructor of a circle or a circular arc. \~
\details \ru Конструктор окружности или дуга окружности одним из двух способов.
\en Constructor of a circle or a circular arc by one of two methods.
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] p0 - \ru Центр (n == 0) или начальная точка (n != 0).
\en Center (n == 0) or starting point (n != 0). \~
\param[in] p1 - \ru Начальная точка (n == 0) или точка, через которую проходит окружность (n != 0).
\en Starting point (n == 0) or point the circle passes through (n == 1). \~
\param[in] p2 - \ru Точка, определяющая конец кривой и вторую полуось.
\en A point determining the end of the curve and the second semiaxis. \~
\param[in] n - \ru Определяет способ построения окружности.
Если n == 0, то окружность или дуга имеют центр в точке p0.
Если n == 1, то окружность или дуга проходят по трем заданным точкам. \n
Если |n| == 2 и closed == false, то дуга будет дополнять до полной окружности дугу, проходящую по трем заданным точкам. \n
\en The parameter defines the method of arc construction. \~
If n == 0, then a circle or a circular arc have the center in point p0.
If n == 1, then a circle or an arc passes through the specified three points. \n
If |n| == 2 & closed == false, then an arc passes through p0 and p2 but not p1. \n \~
\param[in] closed - \ru Определяет окружность (true) или дугу (false).
\en Specifies a circle (true) or an arc (false). \~
*/
DEPRECATE_DECLARE_REPLACE( MbArc3D with MbArc3D::Create )
MbArc3D( const MbCartPoint3D & p0, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int n, bool closed );
/** \brief \ru Конструктор окружности или дуги окружности.
\en Constructor of a circle or a circular arc. \~
\details \ru Создается дуга окружности с центром в точке pc и с заданным радиусом.
Радиус окружности или ее дуги определяется как расстояние между точками pc и p1.
Точки pc, p1 и p2 определяют плоскость дуги.
Точки p1 и p2 определяют границы дуги.
Вектор aZ определяет направление оси Z локальной системы координат дуги окружности.
Начальная точка дуги лежит в точке p1.
Конечная точка дуги лежит на луче, выходящем из центра окружности и проходящем через точку p2.
Параметр initSense определяет направление дуги.
\en A circular arc is created with a center in point 'pc'.
Points 'p1' and 'p2' specify the bounds of arc.
The start point of the arc lies on point 'p1'.
The end point is on the ray passing through the point 'p2'.
Parameter 'initSense' specifies the arc direction. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] pc - \ru Центр окружности.
\en Center of circle. \~
\param[in] p1 - \ru Точка, определяющая начало дуги.
\en A point specifying the beginning of the arc. \~
\param[in] p2 - \ru Точка, определяющая конец дуги.
\en A point specifying the end of the arc. \~
\param[in] aZ - \ru Направление оси Z локальной системы координат дуги окружности.
\en A direction of axis Z local coordinate system of the arc. \~
\param[in] initSense - \ru Направление дуги.
Если initSense > 0, то направление движения дуги против часовой стрелки, если cмотреть навстречу вектору aZ.
Если initSense < 0, то направление движения дуги по часовой стрелке, если cмотреть навстречу вектору aZ.
Если initSense == 0, то будет построена полная окружность.
\en Arc direction.
If initSense > 0, then the orientation is counterclockwise if you look towards the vector aZ.
If initSense < 0, then the orientation is clockwise if you look towards the vector aZ.
If initSense = 0, then the circle is building. \~
*/
DEPRECATE_DECLARE_REPLACE( MbArc3D with MbArc3D::Create )
MbArc3D( const MbCartPoint3D & pc, const MbCartPoint3D & p1, const MbCartPoint3D & p2,
const MbVector3D & aZ, int initSense );
/** \brief \ru Конструктор дуги эллипса.
\en Constructor of an elliptical arc. \~
\details \ru Создается дуга эллипса с заданными полуосями и локальной системой координат.
angle определяет угол дуги. Угол отсчитываются от оси OX против часовой стрелки.
Угол задан в радианах.
\en An elliptical arc is created with the given semiaxes and the local coordinate system.
'angle' determines the arc angle. The angle is measured from the OX axis counterclockwise.
The angle is given in radians. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] p0 - \ru Центр локальной системы координат эллипса.
\en The ellipse local coordinate system center. \~
\param[in] vZ - \ru Ось Z локальной системы координат эллипса.
\en Z-axis of the local coordinate system of the ellipse. \~
\param[in] vX - \ru Ось X локальной системы координат эллипса.
\en X-axis of the local coordinate system of the ellipse. \~
\param[in] aa - \ru Радиус полуоси вдоль X.
\en Radius of semiaxis along X. \~
\param[in] bb - \ru Радиус полуоси вдоль Y.
\en Radius of semiaxis along Y. \~
\param[in] angle - \ru Угол, определяющий конец дуги.
\en An angle specifying the end of the arc. \~
*/
DEPRECATE_DECLARE_REPLACE( MbArc3D with MbArc3D::Create )
MbArc3D( const MbCartPoint3D & p0, const MbVector3D & vZ, const MbVector3D & vX, double aa, double bb, double angle );
/** \brief \ru Конструктор дуги окружности.
\en Constructor of a circular arc. \~
\details \ru Создается дуга окружности с концами в заданных точках.
Радиус окружности определяется по заданному тангенсу 1/4 угла раствора дуги.
\en An arc is created with ends at the given points.
A circle radius is defined by the given tangent of 1/4 of arc opening angle. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Конец дуги.
\en End of the arc. \~
\param[in] a4 - \ru Тангенс 1/4 угла раствора дуги.
\en Tangent of 1/4 of the arc opening angle. \~
\param[in] vZ - \ru Ось дуги.
\en Axis of the arc. \~
*/
DEPRECATE_DECLARE_REPLACE( MbArc3D with MbArc3D::Create )
MbArc3D( const MbCartPoint3D & p1, const MbCartPoint3D & p2, double a_4, MbVector3D & vZ );
/** \brief \ru Конструктор окружности по двум точкам и направлению к центру в одной из них.
\en Constructor of a circle by two points and direction to the center from one of them. \~
\details \ru Создается окружность по двум точкам и направлению в одной из них.
\en A circle is created by two points and direction at one of them. \~
\deprecated \ru Метод устарел. \en The method is deprecated. \~
\param[in] p1 - \ru Начальная точка.
\en The starting point. \~
\param[in] p2 - \ru Конечная точка.
\en The end point. \~
\param[in] dirInPoint - \ru Направление из одной из точек (p1 или p2) к центру окружности.
\en Direction at one of points (p1 or p2) to the center of the circle. \~
\param[in] insecond - \ru Направление из первой точки (insecond == true) к центру окружности.
\en Direction from the first point (insecond == true) to the circle center. \~
*/
DEPRECATE_DECLARE_REPLACE( MbArc3D with MbArc3D::Create )
MbArc3D( const MbCartPoint3D & p1, const MbCartPoint3D & p2, const MbVector3D & dirInPoint, bool insecond );
public :
/** \brief \ru Конструктор дуги эллипса.
\en Constructor of an elliptical arc. \~
@@ -82,118 +247,6 @@ public :
*/
MbArc3D( const MbPlacement3D & place, double aa, double bb, double angle );
/** \brief \ru Конструктор эллипса, окружности или их дуг.
\en Constructor of an ellipse, a circle or an elliptical or circular arc. \~
\details \ru Создается дуга с центром в точке pc. \n
Первая полуось определяется как расстояние между точками pc и p1.
Вторая полуось определяется как длина проекции вектора из pс в p2 на перпендикуляр к (p1 - pc).
Начальная точка дуги лежит на луче, выходящем из центра окружности и проходящем через точку p1.
Конечная точка - на луче из центра, проходящем через точку p2. \n
Параметр initSense определяет цельность и направление дуги.
Если initSense == 0, то строится полный эллипс или окружность. \n
Если initSense > 0, то направление движения против часовой стрелки, если смотреть навстречу векторному произведению (p1 - pc) и (p2 - pc). \n
Если initSense < 0, то направление движения против часовой стрелки, если смотреть навстречу векторному произведению (p1 - pc) и (p2 - pc). \n
\en An arc centered in point 'pc' is created. \n
The first semiaxis is determines as the distance between points pc and p1.
The second semiaxis is determined as the length of projection of the vector from pc to p2 onto the perpendicular to (p1 - pc).
The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'.
The end point is on the ray from the center passing through the point 'p2'. \n
Parameter 'initSense' specifies completeness and the arc direction.
If initSense == 0, then the complete ellipse or circle is constructed. \n
If initSense > 0, then the direction of moving is counterclockwise if seeing against the vector product (p1 - pc) and (p2 - pc). \n
If initSense < 0, , then the direction of moving is counterclockwise if seeing against the vector product (p1 - pc) and(p2 - pc). \n \~
\param[in] pc - \ru Центр эллипса или окружности.
\en Center of the ellipse or the circle. \~
\param[in] p1 - \ru Точка, определяющая начало кривой и первую полуось.
\en A point determining the beginning of the curve and the first semiaxis. \~
\param[in] p2 - \ru Точка, определяющая конец кривой и вторую полуось.
\en A point determining the end of the curve and the second semiaxis. \~
\param[in] initSense - \ru Определяет цельность и направление. initSense == 0 - замкнутая кривая initSense > 0 - движение против часовой стрелки, initSense < 0 - по часовой стрелке.
\en Determines the completeness and the direction. initSense == 0 - closed curve initSense > 0 - moving counterclockwise, initSense < 0 - clockwise. \~
*/
MbArc3D( const MbCartPoint3D & pc, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int initSense = 0 );
/** \brief \ru Конструктор окружности или дуги окружности.
\en Constructor of a circle or a circular arc. \~
\details \ru Конструктор окружности или дуга окружности одним из двух способов.
\en Constructor of a circle or a circular arc by one of two methods.
\param[in] p0 - \ru Центр (n == 0) или начальная точка (n != 0).
\en Center (n == 0) or starting point (n != 0). \~
\param[in] p1 - \ru Начальная точка (n == 0) или точка, через которую проходит окружность (n != 0).
\en Starting point (n == 0) or point the circle passes through (n == 1). \~
\param[in] p2 - \ru Точка, определяющая конец кривой и вторую полуось.
\en A point determining the end of the curve and the second semiaxis. \~
\param[in] n - \ru Определяет способ построения окружности.
Если n == 0, то окружность или дуга имеют центр в точке p0.
Если n == 1, то окружность или дуга проходят по трем заданным точкам. \n
Если |n| == 2 и closed == false, то дуга будет дополнять до полной окружности дугу, проходящую по трем заданным точкам. \n
\en The parameter defines the method of arc construction. \~
If n == 0, then a circle or a circular arc have the center in point p0.
If n == 1, then a circle or an arc passes through the specified three points. \n
If |n| == 2 & closed == false, then an arc passes through p0 and p2 but not p1. \n \~
\param[in] closed - \ru Определяет окружность (true) или дугу (false).
\en Specifies a circle (true) or an arc (false). \~
*/
MbArc3D( const MbCartPoint3D & p0, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int n, bool closed );
/** \brief \ru Конструктор окружности или дуги окружности.
\en Constructor of a circle or a circular arc. \~
\details \ru Создается дуга окружности с центром в точке pc и с заданным радиусом.
Радиус окружности или ее дуги определяется как расстояние между точками pc и p1.
Точки pc, p1 и p2 определяют плоскость дуги.
Точки p1 и p2 определяют границы дуги.
Вектор aZ определяет направление оси Z локальной системы координат дуги окружности.
Начальная точка дуги лежит в точке p1.
Конечная точка дуги лежит на луче, выходящем из центра окружности и проходящем через точку p2.
Параметр initSense определяет направление дуги.
\en A circular arc is created with a center in point 'pc'.
Points 'p1' and 'p2' specify the bounds of arc.
The start point of the arc lies on point 'p1'.
The end point is on the ray passing through the point 'p2'.
Parameter 'initSense' specifies the arc direction. \~
\param[in] pc - \ru Центр окружности.
\en Center of circle. \~
\param[in] p1 - \ru Точка, определяющая начало дуги.
\en A point specifying the beginning of the arc. \~
\param[in] p2 - \ru Точка, определяющая конец дуги.
\en A point specifying the end of the arc. \~
\param[in] aZ - \ru Направление оси Z локальной системы координат дуги окружности.
\en A direction of axis Z local coordinate system of the arc. \~
\param[in] initSense - \ru Направление дуги.
Если initSense > 0, то направление движения дуги против часовой стрелки, если cмотреть навстречу вектору aZ.
Если initSense < 0, то направление движения дуги по часовой стрелке, если cмотреть навстречу вектору aZ.
Если initSense == 0, то будет построена полная окружность.
\en Arc direction.
If initSense > 0, then the orientation is counterclockwise if you look towards the vector aZ.
If initSense < 0, then the orientation is clockwise if you look towards the vector aZ.
If initSense = 0, then the circle is building. \~
*/
MbArc3D( const MbCartPoint3D & pc, const MbCartPoint3D & p1, const MbCartPoint3D & p2,
const MbVector3D & aZ, int initSense );
/** \brief \ru Конструктор дуги эллипса.
\en Constructor of an elliptical arc. \~
\details \ru Создается дуга эллипса с заданными полуосями и локальной системой координат.
angle определяет угол дуги. Угол отсчитываются от оси OX против часовой стрелки.
Угол задан в радианах.
\en An elliptical arc is created with the given semiaxes and the local coordinate system.
'angle' determines the arc angle. The angle is measured from the OX axis counterclockwise.
The angle is given in radians. \~
\param[in] p0 - \ru Центр локальной системы координат эллипса.
\en The ellipse local coordinate system center. \~
\param[in] vZ - \ru Ось Z локальной системы координат эллипса.
\en Z-axis of the local coordinate system of the ellipse. \~
\param[in] vX - \ru Ось X локальной системы координат эллипса.
\en X-axis of the local coordinate system of the ellipse. \~
\param[in] aa - \ru Радиус полуоси вдоль X.
\en Radius of semiaxis along X. \~
\param[in] bb - \ru Радиус полуоси вдоль Y.
\en Radius of semiaxis along Y. \~
\param[in] angle - \ru Угол, определяющий конец дуги.
\en An angle specifying the end of the arc. \~
*/
MbArc3D( const MbCartPoint3D & p0, const MbVector3D & vZ, const MbVector3D & vX, double aa, double bb, double angle );
/** \brief \ru Конструктор дуги эллипса.
\en Constructor of an elliptical arc. \~
\details \ru Создается дуга эллипса с локальной системой координат и полуосями заданного эллипса.
@@ -238,23 +291,6 @@ public :
*/
MbArc3D( const MbArc3D & init, MbCartPoint3D p1, MbCartPoint3D p2, int initSense );
/** \brief \ru Конструктор дуги окружности.
\en Constructor of a circular arc. \~
\details \ru Создается дуга окружности с концами в заданных точках.
Радиус окружности определяется по заданному тангенсу 1/4 угла раствора дуги.
\en An arc is created with ends at the given points.
A circle radius is defined by the given tangent of 1/4 of arc opening angle. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Конец дуги.
\en End of the arc. \~
\param[in] a4 - \ru Тангенс 1/4 угла раствора дуги.
\en Tangent of 1/4 of the arc opening angle. \~
\param[in] vZ - \ru Ось дуги.
\en Axis of the arc. \~
*/
MbArc3D( const MbCartPoint3D & p1, const MbCartPoint3D & p2, double a_4, MbVector3D & vZ );
/** \brief \ru Конструктор по локальной системе и двумерной дуге эллипса.
\en Constructor by a local system and two-dimensional elliptical arc. \~
\details \ru Конструктор по локальной системе координат и двумерной дуге эллипса.
@@ -266,10 +302,155 @@ public :
*/
MbArc3D( const MbArc & ellipse, const MbPlacement3D & place );
/** \brief \ru Конструктор окружности по двум точкам и направлению к центру в одной из них.
\en Constructor of a circle by two points and direction to the center from one of them. \~
//protected:
explicit MbArc3D( const MbArc3D & init );
public :
virtual ~MbArc3D();
public:
/** \brief \ru Создать эллипс, окружность или их дугу.
\en Create ellipse, a circle or an elliptical or circular arc. \~
\details \ru Создается дуга с центром в точке pc. \n
Первая полуось определяется как расстояние между точками pc и p1.
Вторая полуось определяется как длина проекции вектора из pс в p2 на перпендикуляр к (p1 - pc).
Начальная точка дуги лежит на луче, выходящем из центра окружности и проходящем через точку p1.
Конечная точка - на луче из центра, проходящем через точку p2. \n
Параметр initSense определяет цельность и направление дуги.
Если initSense == 0, то строится полный эллипс или окружность. \n
Если initSense > 0, то направление движения против часовой стрелки, если смотреть навстречу векторному произведению (p1 - pc) и (p2 - pc). \n
Если initSense < 0, то направление движения против часовой стрелки, если смотреть навстречу векторному произведению (p1 - pc) и (p2 - pc). \n
\en An arc centered in point 'pc' is created. \n
The first semiaxis is determines as the distance between points pc and p1.
The second semiaxis is determined as the length of projection of the vector from pc to p2 onto the perpendicular to (p1 - pc).
The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'.
The end point is on the ray from the center passing through the point 'p2'. \n
Parameter 'initSense' specifies completeness and the arc direction.
If initSense == 0, then the complete ellipse or circle is constructed. \n
If initSense > 0, then the direction of moving is counterclockwise if seeing against the vector product (p1 - pc) and (p2 - pc). \n
If initSense < 0, , then the direction of moving is counterclockwise if seeing against the vector product (p1 - pc) and(p2 - pc). \n \~
\param[in] pc - \ru Центр эллипса или окружности.
\en Center of the ellipse or the circle. \~
\param[in] p1 - \ru Точка, определяющая начало кривой и первую полуось.
\en A point determining the beginning of the curve and the first semiaxis. \~
\param[in] p2 - \ru Точка, определяющая конец кривой и вторую полуось.
\en A point determining the end of the curve and the second semiaxis. \~
\param[in] initSense - \ru Определяет цельность и направление. initSense == 0 - замкнутая кривая initSense > 0 - движение против часовой стрелки, initSense < 0 - по часовой стрелке.
\en Determines the completeness and the direction. initSense == 0 - closed curve initSense > 0 - moving counterclockwise, initSense < 0 - clockwise. \~
\return \ru Возвращает указатель на созданный объект или нулевой указатель в случае неудачи.
\en Returns pointer to the created object or null pointer in case of failure. \~
*/
static MbArc3D * Create( const MbCartPoint3D & pc, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int initSense = 0 );
/** \brief \ru Создать окружность или дугу окружности.
\en Create circle or a circular arc. \~
\details \ru Создать окружность или дугу окружности одним из двух способов.
\en Constructor of a circle or a circular arc by one of two methods.
\param[in] p0 - \ru Центр (n == 0) или начальная точка (n != 0).
\en Center (n == 0) or starting point (n != 0). \~
\param[in] p1 - \ru Начальная точка (n == 0) или точка, через которую проходит окружность (n != 0).
\en Starting point (n == 0) or point the circle passes through (n == 1). \~
\param[in] p2 - \ru Точка, определяющая конец кривой и вторую полуось.
\en A point determining the end of the curve and the second semiaxis. \~
\param[in] n - \ru Определяет способ построения окружности.
Если n == 0, то окружность или дуга имеют центр в точке p0.
Если n == 1, то окружность или дуга проходят по трем заданным точкам. \n
Если |n| == 2 и closed == false, то дуга будет дополнять до полной окружности дугу, проходящую по трем заданным точкам. \n
\en The parameter defines the method of arc construction. \~
If n == 0, then a circle or a circular arc have the center in point p0.
If n == 1, then a circle or an arc passes through the specified three points. \n
If |n| == 2 & closed == false, then an arc passes through p0 and p2 but not p1. \n \~
\param[in] closed - \ru Определяет окружность (true) или дугу (false).
\en Specifies a circle (true) or an arc (false). \~
\return \ru Возвращает указатель на созданный объект или нулевой указатель в случае неудачи.
\en Returns pointer to the created object or null pointer in case of failure. \~
*/
static MbArc3D * Create( const MbCartPoint3D & p0, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int n, bool closed );
/** \brief \ru Создать окружность или дугу окружности.
\en Create circle or a circular arc. \~
\details \ru Создается дуга окружности с центром в точке pc и с заданным радиусом.
Радиус окружности или ее дуги определяется как расстояние между точками pc и p1.
Точки pc, p1 и p2 определяют плоскость дуги.
Точки p1 и p2 определяют границы дуги.
Вектор aZ определяет направление оси Z локальной системы координат дуги окружности.
Начальная точка дуги лежит в точке p1.
Конечная точка дуги лежит на луче, выходящем из центра окружности и проходящем через точку p2.
Параметр initSense определяет направление дуги.
\en A circular arc is created with a center in point 'pc'.
Points 'p1' and 'p2' specify the bounds of arc.
The start point of the arc lies on point 'p1'.
The end point is on the ray passing through the point 'p2'.
Parameter 'initSense' specifies the arc direction. \~
\param[in] pc - \ru Центр окружности.
\en Center of circle. \~
\param[in] p1 - \ru Точка, определяющая начало дуги.
\en A point specifying the beginning of the arc. \~
\param[in] p2 - \ru Точка, определяющая конец дуги.
\en A point specifying the end of the arc. \~
\param[in] aZ - \ru Направление оси Z локальной системы координат дуги окружности.
\en A direction of axis Z local coordinate system of the arc. \~
\param[in] initSense - \ru Направление дуги.
Если initSense > 0, то направление движения дуги против часовой стрелки, если cмотреть навстречу вектору aZ.
Если initSense < 0, то направление движения дуги по часовой стрелке, если cмотреть навстречу вектору aZ.
Если initSense == 0, то будет построена полная окружность.
\en Arc direction.
If initSense > 0, then the orientation is counterclockwise if you look towards the vector aZ.
If initSense < 0, then the orientation is clockwise if you look towards the vector aZ.
If initSense = 0, then the circle is building. \~
\return \ru Возвращает указатель на созданный объект или нулевой указатель в случае неудачи.
\en Returns pointer to the created object or null pointer in case of failure. \~
*/
static MbArc3D * Create( const MbCartPoint3D & pc, const MbCartPoint3D & p1, const MbCartPoint3D & p2,
const MbVector3D & aZ, int initSense );
/** \brief \ru Создать дугу эллипса.
\en Create elliptical arc. \~
\details \ru Создается дуга эллипса с заданными полуосями и локальной системой координат.
angle определяет угол дуги. Угол отсчитываются от оси OX против часовой стрелки.
Угол задан в радианах.
\en An elliptical arc is created with the given semiaxes and the local coordinate system.
'angle' determines the arc angle. The angle is measured from the OX axis counterclockwise.
The angle is given in radians. \~
\param[in] p0 - \ru Центр локальной системы координат эллипса.
\en The ellipse local coordinate system center. \~
\param[in] vZ - \ru Ось Z локальной системы координат эллипса.
\en Z-axis of the local coordinate system of the ellipse. \~
\param[in] vX - \ru Ось X локальной системы координат эллипса.
\en X-axis of the local coordinate system of the ellipse. \~
\param[in] aa - \ru Радиус полуоси вдоль X.
\en Radius of semiaxis along X. \~
\param[in] bb - \ru Радиус полуоси вдоль Y.
\en Radius of semiaxis along Y. \~
\param[in] angle - \ru Угол, определяющий конец дуги.
\en An angle specifying the end of the arc. \~
\return \ru Возвращает указатель на созданный объект или нулевой указатель в случае неудачи.
\en Returns pointer to the created object or null pointer in case of failure. \~
*/
static MbArc3D * Create( const MbCartPoint3D & p0, const MbVector3D & vZ, const MbVector3D & vX, double aa, double bb, double angle );
/** \brief \ru Создать дугу окружности.
\en Create circular arc. \~
\details \ru Создается дуга окружности с концами в заданных точках.
Радиус окружности определяется по заданному тангенсу 1/4 угла раствора дуги.
\en An arc is created with ends at the given points.
A circle radius is defined by the given tangent of 1/4 of arc opening angle. \~
\param[in] p1 - \ru Начало дуги.
\en Beginning of the arc. \~
\param[in] p2 - \ru Конец дуги.
\en End of the arc. \~
\param[in] a4 - \ru Тангенс 1/4 угла раствора дуги.
\en Tangent of 1/4 of the arc opening angle. \~
\param[in] vZ - \ru Ось дуги.
\en Axis of the arc. \~
\return \ru Возвращает указатель на созданный объект или нулевой указатель в случае неудачи.
\en Returns pointer to the created object or null pointer in case of failure. \~
*/
static MbArc3D * Create( const MbCartPoint3D & p1, const MbCartPoint3D & p2, double a_4, MbVector3D & vZ );
/** \brief \ru Создать окружность по двум точкам и направлению к центру в одной из них.
\en Create circle by two points and direction to the center from one of them. \~
\details \ru Создается окружность по двум точкам и направлению в одной из них.
\en A circle is created by two points and direction at one of them. \~
\en A circle is created by two points and direction at one of them. \~
\param[in] p1 - \ru Начальная точка.
\en The starting point. \~
\param[in] p2 - \ru Конечная точка.
@@ -278,25 +459,25 @@ public :
\en Direction at one of points (p1 or p2) to the center of the circle. \~
\param[in] insecond - \ru Направление из первой точки (insecond == true) к центру окружности.
\en Direction from the first point (insecond == true) to the circle center. \~
\return \ru Возвращает указатель на созданный объект или нулевой указатель в случае неудачи.
\en Returns pointer to the created object or null pointer in case of failure. \~
*/
MbArc3D( const MbCartPoint3D & p1, const MbCartPoint3D & p2, const MbVector3D & dirInPoint, bool insecond );
//protected:
explicit MbArc3D( const MbArc3D & init );
public :
virtual ~MbArc3D();
static MbArc3D * Create( const MbCartPoint3D & p1, const MbCartPoint3D & p2, const MbVector3D & dirInPoint, bool insecond );
public:
VISITING_CLASS( MbArc3D );
void Init( const MbArc3D & );
void Init( const MbPlacement3D &, double aa, double bb, double angle );
void Init( const MbArc3D & init, double t1, double t2, int initSense );
/// \ru Инициализация окружности или дуги окружности по трем точкам, (n == 0) - окружность или дуга по центру и двум точкам, (n == 1) - окружность или дуга по трем точкам \en Initialization of a circular arc by three points; (n == 0) - a circle or an arc by the center and two points, (n == 1) - a circle or an arc by three points.
void Init( const MbCartPoint3D & p0, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int n, bool closed );
/// \ru Инициализация дуги окружности по начальной и конечной точкам и 1/2 угла раствора дуги. \en Initialization of a circular arc by the starting and the end points and 1/2 of the arc opening angle.
void Init( double a_2, const MbCartPoint3D & p1, const MbCartPoint3D & p2, MbVector3D & vZ );
/// \ru Инициализация окружности или дуги окружности по трем точкам, (n == 0) - окружность или дуга по центру и двум точкам, (n == 1) - окружность или дуга по трем точкам. Возвращает true в случае удачи. \en Initialization of a circular arc by three points; (n == 0) - a circle or an arc by the center and two points, (n == 1) - a circle or an arc by three points. Return true if successful.
bool Init( const MbCartPoint3D & p0, const MbCartPoint3D & p1, const MbCartPoint3D & p2, int n, bool closed );
/// \ru Инициализация дуги окружности по начальной и конечной точкам и 1/2 угла раствора дуги. Возвращает true в случае удачи. \en Initialization of a circular arc by the starting and the end points and 1/2 of the arc opening angle. Return true if successful.
bool Init( double a_2, const MbCartPoint3D & p1, const MbCartPoint3D & p2, MbVector3D & vZ );
/// \ru Инициализация дуги окружности по 2D-дуге и локальной системе координат. \en Initialization of an arc by 2D-arc and local coordinate system.
void Init( const MbArc & ellipse, const MbPlacement3D & pos );
/// \ru Инициализация окружности по двум точкам и направлению к центру в одной из них. Возвращает true в случае удачи. \en Initialization of a circle by two points and direction to the center in one of them. Returns true if successful.
bool Init( const MbCartPoint3D & p1, const MbCartPoint3D & p2, const MbVector3D & dirInPoint, bool insecond );
// \ru Общие функции математического объекта \en Common functions of the mathematical object
/** \ru \name Общие функции геометрического объекта.
+23 -7
View File
@@ -85,9 +85,18 @@ protected:
public :
/// \ru Пустой контур. \en Empty contour.
MbContour();
/// \ru Конструктор по набору кривых. \en Constructor by curves vector.
/** \brief \ru Конструктор по набору кривых.
\en Constructor by curves vector. \~
\details \ru Конструктор по набору кривых. Кривые добавляются в контур без проверки, что начало каждого последующего сегмента стыкуется с концом предыдущего. Выполнение данного условия должно гарантироваться вызывающим кодом. \n
\en Constructor by curves vector. Curves are added to the contour without checking that the beginning of each subsequent segment joins the end of the previous one. The condition must be guaranteed by the calling code. \n \~
\param[in] initCurves - \ru Кривые.
\en Curves. \~
\param[in] sameCurves - \ru Использовать оригиналы кривых (true) или их копии (false).
\en Use original curves (true) or copies thereof (false). \~
*/
template <class Curves>
MbContour( const Curves &, bool sameCurves );
MbContour( const Curves & initCurves, bool sameCurves );
protected :
explicit MbContour( const MbContour *, MbRegDuplicate * ); ///< \ru Конструктор копирования. \en Copy constructor.
public :
@@ -367,10 +376,14 @@ DEPRECATE_DECLARE_REPLACE( CheckClosed )
bool CheckConnection( double xEps, double yEps ) const; ///< \ru Проверка непрерывности контура \en Check for contour continuity.
/// \ru Скругление двух соседних элементов дугой нулевого радиуса. \en Rounding two neighboring elements by arc of zero radius.
/// \deprecated \ru Метод устарел. \en The method is deprecated.
DEPRECATE_DECLARE
void FilletTwoSegmentsZero( ptrdiff_t & index, int defaultSense, bool fullInsert );
/// \ru Скругление контура дугой нулевого радиуса. \en Rounding contour by arc of zero radius.
void FilletZero( int defaultSense, bool fullInsert = false );
/// \ru Вставка фаски между двумя соседними элементами для построения эквидистанты. \en Insertion of chamfer between two neighboring elements for construction of the offset.
/// \deprecated \ru Метод устарел. \en The method is deprecated.
DEPRECATE_DECLARE
void ChamferTwoSegmentsZero( ptrdiff_t & index, double rad );
/// \ru Вставка фаски для построения эквидистанты. \en Insertion of chamfer for construction of the offset.
void ChamferZero( double rad );
@@ -496,13 +509,13 @@ DEPRECATE_DECLARE_REPLACE( CheckClosed )
/** \brief \ru Инициализация по массиву кривых.
\en Initialization by array of curves. \~
\details \ru Инициализация по массиву кривых. \n
\en Initialization by array of curves. \n \~
\details \ru Инициализация по массиву кривых. Кривые добавляются в контур без проверки, что начало каждого последующего сегмента стыкуется с концом предыдущего. Выполнение данного условия должно гарантироваться вызывающим кодом. \n
\en Initialization by array of curves. Curves are added to the contour without checking that the beginning of each subsequent segment joins the end of the previous one. The condition must be guaranteed by the calling code. \n \~
\param[in] curves - \ru Кривые.
\en Curves. \~
\param[in] sameCurves - \ru Использовать оригиналы кривых (true) или их копии (false).
\en Use original curves (true) or copies thereof (false). \~
\return \ru Возвращает true, если кривые были добавлена.
\return \ru Возвращает true, если кривые были добавлены.
\en Returns true if curves were added. \~
*/
template <class Curves>
@@ -670,8 +683,11 @@ DEPRECATE_DECLARE_REPLACE( CheckClosed )
/** \} */
private:
ptrdiff_t _FindSegment( double & t, double & tSeg ) const; // \ru Нахождение сегмента контура \en Finding of a contour segment
MbContour & operator = ( const MbContour & initContour );
ptrdiff_t _FindSegment( double & t, double & tSeg ) const; // \ru Нахождение сегмента контура \en Finding of a contour segment
void FilletTwoSegmentsZeroRadius( ptrdiff_t & index, int defaultSense, bool fullInsert ); // \ru Скругление двух соседних элементов дугой нулевого радиуса. \en Rounding two neighboring elements by arc of zero radius.
void ChamferTwoSegmentsZeroRadius( ptrdiff_t & index, double rad ); // \ru Вставка фаски между двумя соседними элементами для построения эквидистанты. \en Insertion of chamfer between two neighboring elements for construction of the offset.
MbContour & operator = ( const MbContour & initContour );
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbContour )
}; // MbContour
+28 -3
View File
@@ -75,9 +75,20 @@ protected :
public :
MbContour3D(); ///< \ru Пустой контур. \en Empty contour.
/// \ru Конструктор по набору кривых. \en Constructor by curves.
/** \brief \ru Конструктор по набору кривых.
\en Constructor by curves vector. \~
\details \ru Конструктор по набору кривых. Кривые добавляются в контур без проверки, что начало каждого последующего сегмента стыкуется с концом предыдущего, а также без проверки на самопересечение контура. Выполнение данных условий должно гарантироваться вызывающим кодом. \n
\en Constructor by curves vector. Curves are added to the contour without checking that the beginning of each subsequent segment joins the end of the previous one, and without checking for self-intersection of the contour. The conditions must be guaranteed by the calling code. \n \~
\param[in] initSegments - \ru Кривые.
\en Curves. \~
\param[in] sameCurves - \ru Использовать оригиналы кривых (true) или их копии (false).
\en Use original curves (true) or copies thereof (false). \~
\param[in] version - \ru Версия.
\en Version. \~
*/
template <class CurvesVector>
MbContour3D( const CurvesVector & initSegments, bool sameCurves, VERSION version = Math::DefaultMathVersion() ); // \ru sameCurves - кривые или их копии \en SameCurves - curves or their copies
MbContour3D( const CurvesVector & initSegments, bool sameCurves, VERSION version = Math::DefaultMathVersion() );
protected:
MbContour3D( const MbContour3D &, MbRegDuplicate * ); ///< \ru Конструктор копирования. \en Copy constructor.
public :
@@ -260,7 +271,21 @@ public:
\en \name Function for working with segments of contour
\{ */
/// \ru Инициализация по набору кривых (sameCurves - кривые или их копии). \en Initialize by curves (sameCurves - curves or their copies).
/** \brief \ru Инициализация по массиву кривых.
\en Initialization by array of curves. \~
\details \ru Инициализация по массиву кривых. Кривые добавляются в контур без проверки, что начало каждого последующего сегмента стыкуется с концом предыдущего. Выполнение данного условия должно гарантироваться вызывающим кодом. \n
\en Initialization by array of curves. Curves are added to the contour without checking that the beginning of each subsequent segment joins the end of the previous one. The condition must be guaranteed by the calling code. \n \~
\param[in] initSegments - \ru Кривые.
\en Curves. \~
\param[in] sameCurves - \ru Использовать оригиналы кривых (true) или их копии (false).
\en Use original curves (true) or copies thereof (false). \~
\param[in] cls - \ru Признак замкнутости кривой.
\en An Attribute of curve closedness. \~
\param[in] version - \ru Версия.
\en Version. \~
\return \ru Возвращает true, если кривые были добавлены.
\en Returns true if curves were added. \~
*/
template <class CurvesVector>
bool Init( const CurvesVector & initSegments, bool sameCurves, bool cls, VERSION version = Math::DefaultMathVersion() );
/// \ru Инициализация по набору точек. \en Initialize by points.
+1
View File
@@ -78,6 +78,7 @@ protected :
mutable double metricLength; ///< \ru Метрическая длина кривой. \en Metric length of a curve. \~
mutable double lengthEvaluation; ///< \ru Оценочная длина кривой. \en Estimated length of a curve.
mutable double curveRadius; ///< \ru Радиус кривой, если она является дугой окружности в пространстве. \en The radius of the curve, if the curve is a spatial arc.
mutable c3d::DoublePair radiusAccuracy; ///< \ru Точности вычисления curveRadius. \en The precisions for the calculation of curveRadius.
mutable ThreeStates isStraight; ///< \ru Флаг прямолинейности. \en A straightness flag.
SPtr<MbCurveTessellation> tessellation; ///< \ru Разбивка кривой. \en Curve tessellation.
+2 -1
View File
@@ -146,7 +146,8 @@ private :
mutable MbCube cube; ///< \ru Габаритный куб кривой. \en Bounding box of a curve. \~
mutable double metricLength; ///< \ru Метрическая длина кривой. \en Metric length of a curve. \~
mutable double lengthEvaluation; ///< \ru Оценочная длина кривой. \en Estimated length of a curve. \~
mutable double curveRadius; ///< \ru Радиус кривой, если она является дугой окружности в пространстве. \en The radius of the curve, if the curve is a spatial arc.
mutable double curveRadius; ///< \ru Радиус кривой, если она является дугой окружности в пространстве. \en The radius of the curve, if the curve is a spatial arc.
mutable c3d::DoublePair radiusAccuracy; ///< \ru Точности вычисления curveRadius. \en The precisions for the calculation of curveRadius.
#ifdef C3D_SIGNAL_ENABLED
mutable bool inChange; ///< \ru Указывает на нахождение в процессе изменений. \en Indicates to being in the process of changes.
+1
View File
@@ -9,6 +9,7 @@
#include <mb_operation_result.h>
#include <mb_cart_point3d.h>
#include <templ_s_array.h>
//------------------------------------------------------------------------------
/** \brief \ru Нахождение точки перегиба кубической кривой Безье по двум концевым точкам,
+1
View File
@@ -22,6 +22,7 @@
#define __GC_API_H
#include <mb_matrix.h>
#include <math_version.h>
//
#include <gce_types.h>
#include <gce_kompas_interface.h>
+2 -2
View File
@@ -1320,8 +1320,8 @@ GCE_FUNC(constraint_item) GCE_AddAngleBisector( GCE_system gSys
\en Descriptor of a new constraint. \~
*/
//---
GCE_FUNC(constraint_item) GCE_AddAngle4P( GCE_system gSys, geom_item fPair[2]
, geom_item sPair[2], const GCE_adim_pars & dPars );
GCE_FUNC(constraint_item) GCE_AddAngle4P( GCE_system gSys, geom_item fPair[2]
, geom_item sPair[2], const GCE_adim_pars & dPars );
//----------------------------------------------------------------------------------------
/** \brief \ru Задать ограничение "Коллинеарность".
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief Абстрактный интерфейс для чёрного ящика
\brief Абстрактный интерфейс для чёрного ящика.
*/
//////////////////////////////////////////////////////////////////////////////////////////
+9 -2
View File
@@ -120,6 +120,7 @@ inline void ItGeom::GetTransMatrix( MbMatrix3D & mat ) const
// Internal data types forward declaration.
//---
struct MtUnifiedGeom;
struct MbGeomTol;
class MtParGeom;
//----------------------------------------------------------------------------------------
@@ -135,12 +136,12 @@ public:
MtGeomVariant( const MbCartPoint3D & );
MtGeomVariant( const MtUnifiedGeom & );
MtGeomVariant( const MtGeomVariant & );
MtGeomVariant( MtGeomVariant && gVar ): m_value( nullptr ) { TakeOn( gVar.m_value ); gVar.m_value = nullptr; }
MtGeomVariant( MtGeomVariant && gVar ) noexcept : m_value( nullptr ) { TakeOn( gVar.m_value ); gVar.m_value = nullptr; }
MtGeomVariant( const MtParGeom & g ) : m_value( nullptr ) { Assign(g); }
MtGeomVariant( const GCM_g_type );
MtGeomVariant & operator = ( const MtGeomVariant & gVar ) { return Assign( gVar ); }
/// \ru Переносное присвоение. \en Moving assignment.
MtGeomVariant & operator = ( MtGeomVariant && gVar ) { TakeOn( gVar.m_value ); gVar.m_value = nullptr; return *this; }
MtGeomVariant & operator = ( MtGeomVariant && gVar ) noexcept { TakeOn( gVar.m_value ); gVar.m_value = nullptr; return *this; }
~MtGeomVariant();
public:
@@ -150,8 +151,14 @@ public:
GCM_g_record GeomRecord() const;
/// \ru Выдать трансформацию объекта из стандартного положения. \en Get transformation of the object from the standart position.
MbMatrix3D & GetTransMatrix( MbMatrix3D & ) const;
/// \ru Выдать положение детали в виде ортонормированной ЛСК. \en Get position of part as orthonormalized LCS.
MbPlacement3D & GetPlacement( MbPlacement3D & pl ) const;
/// \ru Является ли объект пустым. \en Get logic value whether the object is empty.
bool IsNull() const;
/// \ru Проверить равны ли объекты геометрическию. \en Check if objects are geometrically equal.
bool IsEqualTo( const MtGeomVariant &, const MbGeomTol & ) const;
/// \ru Проверить равны ли структуры геометрической записи (gType,O,Z,X,Y,R1,R2). \en Check if corresponding elements of geometric records are equal (gType,O,Z,X,Y,R1,R2).
bool IsEqualTuples( const MtGeomVariant & gVar, const MbGeomTol & gTol ) const;
public: /* Assigning methods.
*/
+1 -1
View File
@@ -43,7 +43,7 @@ struct index_tag
//----------------------------------------------------------------------------------------
/// \ru Цветовая маркировка (применяется для графов) \en Color marking (used for graphs)
//---
enum color_code
enum color_code: char
{
white_color = 0
, gray_color = 1
+273
View File
@@ -0,0 +1,273 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Облегченные макросы сериализации, которые содержат только объявления функций.
\en Lightweight macros of serialization which contain functions declarations only. \~
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __IO_BASE_H
#define __IO_BASE_H
#include <math_define.h>
class reader;
class writer;
//------------------------------------------------------------------------------
// \ru Объявление операторов чтения/записи для объектов, для которых при записи и чтении точно известен тип.
// \en Declaration of read/write operators for objects which type is exactly known while reading and writing.
// \ru Такие объекты могут записываться в поток и читаться из потока с помощью операторов << и >> .
// \en Such objects can be written to the stream and read from the stream using operators << and >> .
// \ru Реализация операторов, объявленных макросами KNOWN_OBJECTS_RW_REF_OPERATORS_BASE и KNOWN_OBJECTS_RW_PTR_OPERATORS_BASE,
// находится в макросах IMP_KNOWN_OBJECTS_RW_REF_OPERATORS и IMP_KNOWN_OBJECTS_RW_PTR_OPERATORS.
// \en Implementation of the operators, declared by the macros KNOWN_OBJECTS_RW_REF_OPERATORS_BASE and KNOWN_OBJECTS_RW_PTR_OPERATORS_BASE,
// is located in the macros IMP_KNOWN_OBJECTS_RW_REF_OPERATORS and IMP_KNOWN_OBJECTS_RW_PTR_OPERATORS.
//---
#define KNOWN_OBJECTS_RW_REF_OPERATORS_BASE(Class) \
friend reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ); \
friend writer & CALL_DECLARATION operator << ( writer & out, const Class & ref ); \
friend writer & CALL_DECLARATION operator << ( writer & out, Class & ref );
#define KNOWN_OBJECTS_RW_PTR_OPERATORS_BASE(Class) \
friend reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ); \
friend writer & CALL_DECLARATION operator << ( writer & out, const Class * ptr ); \
friend writer & CALL_DECLARATION operator << ( writer & out, Class * ptr );
// \ru Объявление аналогичных операторов чтения/записи для экспорта/импорта.
// \en Declaration of similar read/write operators for export/import.
// \ru Макросы для DLLFUNC -> __declspec( dllexport ) или __declspec( dllimport ) объявлены в файле math_define.h (см. MATH_FUNC_EX).
// \en Macros for DLLFUNC -> __declspec( dllexport ) or __declspec( dllimport ) are declared the file math_define.h (see MATH_FUNC_EX).
// \ru Реализация операторов, объявленных макросами KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE и KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE,
// находится в макросах IMP_KNOWN_OBJECTS_RW_REF_OPERATORS_EX и IMP_KNOWN_OBJECTS_RW_PTR_OPERATORS_EX.
// \en Implementation of the operators, declared by the macros KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE and KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE,
// is located in the macros IMP_KNOWN_OBJECTS_RW_REF_OPERATORS_EX and IMP_KNOWN_OBJECTS_RW_PTR_OPERATORS_EX.
#define KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE(Class, DLLFUNC) \
friend DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, const Class & ref ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, Class & ref );
#define KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE(Class, DLLFUNC) \
friend DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, const Class * ptr ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, Class * ptr );
/** \brief \ru Переменная включает перегрузку операторов new/delete,
обеспечивающую последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en The variable enables overloading of new/delete operators
which provides sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Переменная включает перегрузку операторов new/delete,
обеспечивающую последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en The variable enables overloading of new/delete operators
which provides sequential access to the allocation/deallocation functions
from different threads. \~
\ingroup Base_Tools_IO
*/
// ---
#define __OVERLOAD_MEMORY_ALLOCATE_FREE_
#ifdef __DEBUG_MEMORY_ALLOCATE_FREE_
//----------------------------------------------------------------------------------------
/// \ru Объявление функций new, delete и операторов доступа. \en Declaration of functions new, delete and access operators. \~ \ingroup Base_Tools_IO
// \ru операторы * и -> автоматически не перегружаются, \en operators * and -> are not overloaded automatically,
// \ru для их использования нужно писать примерно так: \n \en one should write like this to use them: \n
// \ru вместо ptr->F(); ptr->operator ->()->F(); \n \en instead of ptr->F(); ptr->operator ->()->F(); \n
// \ru или ptr->operator *().F(); \n \en or ptr->operator *().F(); \n
// \ru или ptr->operator Class*()->F(); \n \en or ptr->operator Class*()->F(); \n
// \ru Для ссылок так же. \en Similarly for references.
// \ru Реализация находится в макросе IMP_PERSISTENT_NEW_DELETE_CLASS. \en The implementation is located in the macros IMP_PERSISTENT_NEW_DELETE_CLASS.
// ---
#define DECLARE_NEW_DELETE_CLASS( Class )
//--------------------------------------------------------------------------------------
/// \ru Объявление операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// \en Declaration of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads. \~
/// \ru Реализация находится в макросе IMP_PERSISTENT_NEW_DELETE_CLASS_EX. \en The implementation is located in the macros IMP_PERSISTENT_NEW_DELETE_CLASS_EX.
/// \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS_EX( Class ) \
public: \
void * operator new ( size_t ); \
void operator delete ( void *, size_t ); \
void * operator new [] ( size_t ); \
void operator delete [] ( void * );
#else // __DEBUG_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Объявление функций new, delete и операторов доступа. \en Declaration of functions new, delete and access operators. \~ \ingroup Base_Tools_IO
// \ru Реализация находится в макросе IMP_PERSISTENT_NEW_DELETE_CLASS. \en The implementation is located in the macros IMP_PERSISTENT_NEW_DELETE_CLASS.
// ---
#define DECLARE_NEW_DELETE_CLASS( Class )
#if defined(__OVERLOAD_MEMORY_ALLOCATE_FREE_) && !defined(C3D_DEBUG)
//--------------------------------------------------------------------------------------
/// \ru Объявление операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// Перегружаются все стандартные операторы new и delete.
/// \en Declaration of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads.
/// All standard new and delete operators are overloaded. \~
/// \ru Реализация находится в макросе IMP_PERSISTENT_NEW_DELETE_CLASS_EX.
/// \en The implementation is located in the macros IMP_PERSISTENT_NEW_DELETE_CLASS_EX.
/// \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS_EX( Class ) \
public: \
void * operator new ( size_t ); \
void * operator new ( size_t, const std::nothrow_t & ) throw(); \
void * operator new ( size_t, void * ); \
void * operator new [] ( size_t ); \
void * operator new [] ( size_t, const std::nothrow_t & ) throw(); \
void * operator new [] ( size_t, void * ); \
void operator delete ( void * ); \
void operator delete ( void *, const std::nothrow_t & ) throw(); \
void operator delete ( void *, void* ); \
void operator delete [] ( void * ); \
void operator delete [] ( void *, const std::nothrow_t & ) throw(); \
void operator delete [] ( void *, void * );
#else // __OVERLOAD_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Объявление операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// \en Declaration of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads. \~
/// \ru Реализация находится в макросе IMP_PERSISTENT_NEW_DELETE_CLASS_EX.
/// \en The implementation is located in the macros IMP_PERSISTENT_NEW_DELETE_CLASS_EX.
/// \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS_EX( Class )
#endif // __OVERLOAD_MEMORY_ALLOCATE_FREE_
#endif // __DEBUG_MEMORY_ALLOCATE_FREE_
//----------------------------------------------------------------------------------------
/**
\brief \ru Объявление дружественных операторов чтения и записи указателей и ссылок.
\en Declaration of friend operators of reading and writing of pointers and references. \~
\ru Реализация находится в макросе IMP_PERSISTENT_OPS_BASE.
\en The implementation is located in the macros IMP_PERSISTENT_OPS_BASE.
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_OPS_BASE( Class, DLLFUNC ) \
friend DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ); \
friend DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ); \
friend DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, const Class *& ptr ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, const Class & ref ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, const Class * ptr ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, Class & ref ); \
friend DLLFUNC writer & CALL_DECLARATION operator << ( writer& out, Class * ptr ); \
//----------------------------------------------------------------------------------------
/// \ru Конструктор для потокового класса. \en Constructor for a stream class. \~ \ingroup Base_Tools_IO
/// \ru Реализация должна быть обеспечена пользователем.
/// \en The implementation should be provided by the user.
// ---
#define DECLARE_PERSISTENT_CTOR( Class ) \
public: \
Class( TapeInit )
//----------------------------------------------------------------------------------------
/// \ru Функции чтения и записи. \en Functions of reading and writing. \~ \ingroup Base_Tools_IO
/// \ru Реализация должна быть обеспечена пользователем.
/// \en The implementation should be provided by the user.
// ---
#define DECLARE_PERSISTENT_FUNCS( Class ) \
public: \
static void Read ( reader & in, Class * obj ); \
static void Write( writer & out, const Class * obj )
//------------------------------------------------------------------------------
/// \ru Функции получения дескриптора класса. \~ \ingroup Base_Tools_IO
/// \ru Реализация находится в макросе IMP_CLASS_DESC_FUNC.
/// \en The implementation is located in the macros IMP_CLASS_DESC_FUNC.
// ---
#define DECLARE_CLASS_DESC_FUNC( Class ) \
public: \
ClassDescriptor GetClassDescriptor( const VersionContainer & ) const override;
//------------------------------------------------------------------------------
/** \brief \ru Объявление класса Class поточным.
\en Declaration of class Class as a stream one. \~
\details \ru Объявление класс Class поточным.
Устанавливается в декларации класса в файле *.h.
Декларирует операторы <<, >>, а также функции Read и Write,
которые должны быть определены в любом файле *.cpp
Class должен наследовать от TapeBase.
Для этого класса должен быть определен конструктор чтения,
а его тело должно быть в .cpp файле. \n
\en Declaration of class Class as a stream one.
It is set in the declaration of class in file *.h.
Declares operators <<, >> and also functions Read and Write
which must be defined in any file *.cpp
Class must be inherited from TapeBase.
The read constructor must be defined for the class
and its solid should be in .cpp file. \n \~
\ru Реализация находится в макросе IMP_PERSISTENT_CLASS_OPS.
\en The implementation is located in the macros IMP_PERSISTENT_CLASS_OPS.
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_CLASS_BASE( Class, DLLFUNC ) \
DECLARE_PERSISTENT_FUNCS( Class ); \
DECLARE_PERSISTENT_OPS_BASE( Class, DLLFUNC ); \
DECLARE_PERSISTENT_CTOR( Class ); \
DECLARE_NEW_DELETE_CLASS( Class ); \
DECLARE_CLASS_DESC_FUNC(Class)
/** \brief \ru Аналог макроса DECLARE_PERSISTENT_CLASS_BASE
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of DECLARE_PERSISTENT_CLASS_BASE macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса DECLARE_PERSISTENT_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of DECLARE_PERSISTENT_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ru Реализация находится в макросе IMP_PERSISTENT_CLASS_NEW_DEL_OPS.
\en The implementation is located in the macros IMP_PERSISTENT_CLASS_NEW_DEL_OPS.
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_CLASS_NEW_DEL_BASE( Class, DLLFUNC ) \
DECLARE_PERSISTENT_CLASS_BASE( Class, DLLFUNC ) \
DECLARE_NEW_DELETE_CLASS_EX( Class )
//----------------------------------------------------------------------------------------
/**
\brief \ru Операторы чтения и записи указателей и ссылок.
\en Operators of reading and writing of pointers and references. \~
\ingroup Base_Tools_IO
*/
// ---
#define IMPL_PERSISTENT_OPS( Class )
#endif // __IO_BASE_H
+817 -2
View File
@@ -16,14 +16,14 @@
//#define DISABLE_RWTCHAR
#include <io_tape_define.h>
#include <map>
#include <memory>
#include <io_memory_buffer.h>
#include <templ_pointer.h>
#include <templ_sfdp_array.h>
#include <alg_indicator.h>
#include <tool_cstring.h>
#include <hash32.h>
#include <tool_mutex.h>
#include <map>
#include <typeinfo>
@@ -168,6 +168,121 @@ private:
};
//----------------------------------------------------------------------------------------
/// \ru Шаблон функции создания нового экземпляра. \en Template of function of a new instance creation. \~ \ingroup Base_Tools_IO
//---
typedef TapeBase * ( CALL_DECLARATION * BUILD_FUNC ) ( void );
//----------------------------------------------------------------------------------------
/** \brief \ru Шаблон функции преобразования.
\en Template of conversion function. \~
\details \ru Шаблон функции преобразования из указателя на TapeBase к указателю на класс. \n
\en Template of function of conversion from a pointer to TapeBase to a pointer to the class. \n \~
\ingroup Base_Tools_IO
*/ //---
typedef void * ( CALL_DECLARATION * CAST_FUNC ) ( const TapeBase * );
//----------------------------------------------------------------------------------------
/**\ru Шаблон функции чтения экземпляра.
\en Template of instance reading function. \~
\ingroup Base_Tools_IO
*/ //---
typedef void ( CALL_DECLARATION * READ_FUNC ) ( reader & in, void * /*obj*/ );
//----------------------------------------------------------------------------------------
/// \ru Шаблон функции записи экземпляра. \en Template of instance writing function. \~ \ingroup Base_Tools_IO
//---
typedef void ( CALL_DECLARATION * WRITE_FUNC ) ( writer & out, void * /*obj*/ );
//----------------------------------------------------------------------------------------
/** \brief \ru Упакованное имя класса.
\en Packed class name. \~
\details \ru Упакованное имя одного класса - для набора массива потоковых классов в TapeClass. \n
\en Packed name of one class - for array of stream classes in TapeClass. \n \~
\ingroup Base_Tools_IO
*/ // ---
class MATH_CLASS ClassDescriptor
{
protected:
uint16 val; ///< \ru Хэш имени класса. \en The class name hash.
MbUuid appID_; ///< \ru Дополнительный идентификатор приложения. \en Additional application identifier.
private:
/// \ru Признак записи appID. \en AppID record flag.
static const uint16 rwIdFlag;
public:
/// \ru Конструктор. \en Constructor.
ClassDescriptor();
/// \ru Конструктор по хэшу. \en Constructor by hash.
ClassDescriptor( uint16 v );
/// \ru Конструктор по имени. \en Constructor by name.
ClassDescriptor( const char * name );
/// \ru Конструктор по хэшу. \en Constructor by hash.
ClassDescriptor( uint16 v, const MbUuid & appID );
/// \ru Конструктор по имени. \en Constructor by name.
ClassDescriptor( const char * name, const MbUuid & appID );
/// \ru Конструктор по хэшу. \en Constructor by hash.
ClassDescriptor( const ClassDescriptor & other );
/// \ru Оператор присваивания. \en An assignment operator.
ClassDescriptor & operator = ( const ClassDescriptor & other );
/// \ru Оператор равенства. \en The equality operator.
bool operator == ( const ClassDescriptor & other ) const;
/// \ru Оператор неравенства. \en The inequality operator.
bool operator != ( const ClassDescriptor & other ) const;
/// \ru Оператор сравнения. \en Comparison operator.
bool operator < ( const ClassDescriptor & other ) const;
/// \ru Оператор сравнения. \en Comparison operator.
bool operator > ( const ClassDescriptor & other ) const;
#ifdef C3D_DEBUG
/// \ru Оператор доступа. \en An access operator.
operator uint16() const { return val; }
#endif
/// \ru Оператор записи. \en Write operator.
void Write( writer & out );
/// \ru Оператор чтения. \en Read operator.
bool Read( reader & in );
};
//----------------------------------------------------------------------------------------
/** \brief \ru "Обертка" для одного потокового класса.
\en "Wrapper" for one stream class. \~
\details \ru "Обертка" для одного потокового класса ( не экземпляра! ).
Xранит упакованное имя класса и адреса функций, необходимых при чтении/записи. \n
\en "Wrapper" for one stream class ( not instance! ).
Stores packed class name and addresses of functions necessary while reading/writing. \n \~
\ingroup Base_Tools_IO
*/ // ---
class MATH_CLASS TapeClass {
protected:
ClassDescriptor hashValue; ///< \ru Упакованное имя класса. \en Packed class name.
BUILD_FUNC _builder; ///< \ru Функция создания нового экземпляра. \en Functions of a new instance creation.
CAST_FUNC _caster; ///< \ru Функция преобразования от TapeBase к указателю на класс. \en Function of conversion from TapeBase to a pointer to a class.
READ_FUNC _reader; ///< \ru Функция чтения. \en Read function.
WRITE_FUNC _writer; ///< \ru Функция записи. \en Write function.
public:
/// \ru Конструктор. \en Constructor.
/// \ru Конструктор. \en Constructor.
TapeClass( const char * name, BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w );
TapeClass( const char * name, MbUuid appID, BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w );
/// \ru Деструктор. \en Destructor.
virtual ~TapeClass();
/// \ru Получить упакованное имя класса. \en Get the packed class name.
ClassDescriptor GetPackedClassName() const;
/// \ru Получить упакованное имя класса для записи с учетом версии. \en Get the packed class name for writing subject to the version.
virtual ClassDescriptor GetPackedClassNameForWrite( VERSION ) const;
friend class TapeManager;
friend struct TapeClassContainer;
OBVIOUS_PRIVATE_COPY( TapeClass )
};
//----------------------------------------------------------------------------------------
/** \brief \ru Менеджер потоков.
\en Stream manager. \~
@@ -251,6 +366,36 @@ struct TapeClassContainer
};
//----------------------------------------------------------------------------------------
/** \brief \ru Поток для чтения и записи.
\en Stream for reading and writing. \~
\details \ru Поток для чтения и записи. \n
\en Stream for reading and writing. \n \~
\deprecated \ru Класс устарел и будет удален в версии 2023.
\en The class is deprecated and will be removed in version 2023. \~
\ingroup Base_Tools_IO
*/ // ---
class MATH_CLASS rw : public writer, public reader {
public:
typedef std::unique_ptr<rw> rw_ptr;
public:
/// \ru Создать читатель/писатель для буфера в памяти. \en Create reader/writer for membuf.
static rw_ptr CreateMemWriter( membuf & sb, uint8 om );
/// \ru Конструктор. \en Constructor.
rw( iobuf & buf, uint16 om );
virtual ~rw() {}
private:
/// \ru Конструктор. \en Constructor.
rw( iobuf_Seq & sb, bool ownBuf, bool openSys, uint16 om, TapeRegistrator * reg );
OBVIOUS_PRIVATE_COPY( rw )
};
//----------------------------------------------------------------------------------------
/// \ru Функция чтения базового класса. \en Function of reading the base class. \~ \ingroup Base_Tools_IO
// ---
@@ -1818,5 +1963,675 @@ size_t ReadClusterBody( void * in, VERSION version, Cluster & obj, uint16 cluste
iostrm.setState( io::fail ); \
}
//------------------------------------------------------------------------------
// \ru Реализация функций записи по неконстантной ссылке/указателю (объявленных в KNOWN_OBJECTS_RW_REF_OPERATORS_BASE, KNOWN_OBJECTS_RW_PTR_OPERATORS_BASE)
// для объектов, для которых при записи и чтении точно известен тип.
// \en Implementation of writing functions by non-constant reference/pointer (declared in KNOWN_OBJECTS_RW_REF_OPERATORS_BASE, KNOWN_OBJECTS_RW_PTR_OPERATORS_BASE)
// for objects which type is exactly known while reading and writing.
//---
#define IMP_KNOWN_OBJECTS_RW_REF_OPERATORS(Class) \
writer & CALL_DECLARATION operator << ( writer & out, Class & ref ) { return operator << ( out, (const Class &)ref ); }
#define IMP_KNOWN_OBJECTS_RW_PTR_OPERATORS(Class) \
writer & CALL_DECLARATION operator << ( writer & out, Class * ptr ) { return operator << ( out, (const Class *)ptr ); }
//------------------------------------------------------------------------------
// \ru Реализация функций записи по неконстантной ссылке/указателю (объявленных в KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE, KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE)
// для объектов, для которых при записи и чтении точно известен тип.
// \en Implementation of writing functions by non-constant reference/pointer (declared in KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE, KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE)
// for objects which type is exactly known while reading and writing.
//---
#define IMP_KNOWN_OBJECTS_RW_REF_OPERATORS_EX(Class, DLLFUNC) \
DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, Class & ref ) { return operator << ( out, (const Class &)ref ); }
#define IMP_KNOWN_OBJECTS_RW_PTR_OPERATORS_EX(Class, DLLFUNC) \
DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, Class * ptr ) { return operator << ( out, (const Class *)ptr ); }
//----------------------------------------------------------------------------------------
/**
\brief \ru Реализация дружественных операторов чтения и записи указателей и ссылок, объявленных в макросе DECLARE_PERSISTENT_OPS_BASE.
\en Implementation of friend operators of reading and writing of pointers and references declared in DECLARE_PERSISTENT_OPS_BASE macro. \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_OPS_BASE( Class, DLLFUNC ) \
DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ) { \
in.readObject( dynamic_cast<TapeBase *>(&ref) ); \
return in; \
} \
DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ) { \
ptr = dynamic_cast<Class *>( in.readObjectPointer() ); \
return in; \
} \
DLLFUNC reader & CALL_DECLARATION operator >> ( reader & in, const Class *& ptr ) \
{ \
ptr = dynamic_cast<Class *>( in.readObjectPointer() ); \
return in; \
} \
DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, const Class & ref ) { \
out.writeObject( dynamic_cast<const TapeBase *>(&ref) ); \
return out; \
} \
DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, const Class * ptr ) { \
out.writeObjectPointer( dynamic_cast<const TapeBase*>(ptr) ); \
return out; \
} \
DLLFUNC writer & CALL_DECLARATION operator << ( writer & out, Class & ref ) { \
out.writeObject( dynamic_cast<TapeBase *>(&ref) ); \
return out; \
} \
DLLFUNC writer & CALL_DECLARATION operator << ( writer& out, Class * ptr ) { \
out.writeObjectPointer( dynamic_cast<TapeBase *>(ptr) ); \
return out; \
}
//------------------------------------------------------------------------------
/// \ru Функции получения дескриптора (хэш + APP UID) класса. \~ \ingroup Base_Tools_IO
/// \ru Реализация макроса DECLARE_CLASS_DESC_FUNC. \en Implementation of DECLARE_CLASS_DESC_FUNC marco.
// ---
#define IMP_CLASS_DESC_FUNC( AppID, Class ) \
ClassDescriptor Class::GetClassDescriptor( const VersionContainer & v) const \
{ return ClassDescriptor( GetPureName(v), AppID ); }
//----------------------------------------------------------------------------------------
/** \brief \ru Конструирование нового экземпляра класса.
\en Construction of a new instance of the class. \~
\details \ru Конструирование нового экземпляра класса. \n
Определяются функция конструирования нового экземпляра класса,
функция преобразования от указателя на TapeBase к указателю на класс
и класс (не экземпляр!) добавляется в массив потоковых
путем создания переменной r ## Class типа TapeClass
(а в конструкторе TapeClass производится
добавление в массив потоковых классов).
Символ ## - это указание препроцессору о необходимости "склейки"
текущего идентификатора с последующим.
\en Construction of a new instance of the class. \n
Definition of functions of construction a new instance of the class,
function of conversion from a pointer to TapeBase to a pointer to the class
and addition of the class (not an instance) to the array of stream classes
by creating variable r ## Class of type TapeClass
(and in constructor of TapeClass
addition to array of stream classes is performed).
Symbol ## is a directive for preprocessor about the necessity of "gluing"
of the current identifier with the next one. \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_REGISTRATION( AppID, Class ) \
TapeBase * CALL_DECLARATION make ## _ ## Class () { \
return new Class(tapeInit); \
} \
void * CALL_DECLARATION cast ## _ ## Class ( const TapeBase * obj ) { \
return dynamic_cast<Class *>(const_cast<TapeBase *>(obj) ); \
} \
\
TapeClass r ## Class( \
typeid(Class).name(), \
AppID, \
(BUILD_FUNC) make ## _ ## Class, \
(CAST_FUNC ) cast ## _ ## Class, \
(READ_FUNC ) Class::Read, \
(WRITE_FUNC) Class::Write \
)
//------------------------------------------------------------------------------
// \ru Как записать переименованный класс в старую версию (с) Столяров А.Г. \en How to write the renamed class to the old version (c) Stolyarov A.G.
/* #define IMP_PERSISTENT_REGISTRATION_OLDCLASS( Class, OldClass ) \
TapeBase * CALL_DECLARATION make ## _ ## Class () { \
return dynamic_cast<TapeBase *>( new Class(tapeInit) ); \
} \
void * CALL_DECLARATION cast ## _ ## Class ( const TapeBase * obj ) { \
return dynamic_cast<Class *>(const_cast<TapeBase *>(obj) ); \
} \
TapeClass r ## Class( \
typeid(Class).name(), \
typeid(OldClass).name(), \
(BUILD_FUNC) make ## _ ## Class, \
(CAST_FUNC ) cast ## _ ## Class, \
(READ_FUNC ) Class::Read, \
(WRITE_FUNC) Class::Write \
)
#define IMP_PERSISTENT_OLDCLASS( Class, OldClass ) \
IMP_PERSISTENT_REGISTRATION_OLDCLASS( Class, OldClass ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
IMP_PERSISTENT_OLDCLASS( Class, OldClass );
class TapeClassForNewObjects : public TapeClass {
protected :
ClassDescriptor hashValueOld; // \ru упакованное имя класса для старой версии файла \en packed class name for the old version of file
public :
TapeClassForNewObjects( const char * name, const char * oldName, BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w );
virtual ~TapeClassForNewObjects();
virtual ClassDescriptor GetPackedClassNameForWrite( long version ) const;
OBVIOUS_PRIVATE_COPY(TapeClassForNewObjects);
};
TapeClassForNewObjects::TapeClassForNewObjects( const char * name, const char * oldName,
BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w )
: TapeClass( name, b, c, r, w )
, hashValueOld( ::hash(::pureName( oldName ) ) )
{
}
ClassDescriptor TapeClassForNewObjects::GetPackedClassNameForWrite( long version ) const {
uint16 res = version > CHANGE_VERSION ? TapeClass::GetPackedClassName() : uint16(hashValueOld);
return res;
}
*/
#ifdef __DEBUG_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Реализация функций new, delete и операторов доступа (объявленных в DECLARE_NEW_DELETE_CLASS).
/// \en Implementation of functions new, delete and access operators (declared in DECLARE_NEW_DELETE_CLASS).
/// \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
//--------------------------------------------------------------------------------------
/// \ru Реализация операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков (объявленных в DECLARE_NEW_DELETE_CLASS_EX).
/// \en Implementation of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads (declared in DECLARE_NEW_DELETE_CLASS_EX). \~
/// \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class ) \
void * Class::operator new( size_t size ) { \
return ::Allocate( size, typeid(Class).name() ); } \
void Class::operator delete ( void *ptr, size_t size ) { \
::Free( ptr, size, typeid(Class).name() ); } \
\
void * Class::operator new[] ( size_t size ) { \
return ::AllocateArray( size, typeid(Class[]).name()); } \
void Class::operator delete[] ( void *ptr ) { \
::FreeArray( ptr, typeid(Class[]).name() ); }
#else // __DEBUG_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Реализация функций new, delete и операторов доступа (объявленных в DECLARE_NEW_DELETE_CLASS).
/// \en Implementation of functions new, delete and access operators (declared в DECLARE_NEW_DELETE_CLASS).
/// \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
#if defined(__OVERLOAD_MEMORY_ALLOCATE_FREE_) && !defined(C3D_DEBUG)
//--------------------------------------------------------------------------------------
/// \ru Реализация операторов new и delete, обеспечивающая последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков (объявленных в DECLARE_NEW_DELETE_CLASS_EX).
/// Перегружаются все стандартные операторы new и delete.
/// \en Implementation of new and delete operators which provides sequential access
/// to the allocation/deallocation functions from different threads (declared in DECLARE_NEW_DELETE_CLASS_EX).
/// All standard new and delete operators are overloaded. \~
/// \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class ) \
void* Class::operator new( size_t size ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new( size ); } \
void Class::operator delete( void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete( ptr ); } \
\
void* Class::operator new( size_t size, void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new( size, ptr ); } \
void Class::operator delete( void *ptr, void *ptr2 ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete( ptr, ptr2 ); } \
\
void* Class::operator new[]( size_t size ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new[]( size ); } \
void Class::operator delete[]( void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete[]( ptr ); } \
\
void* Class::operator new []( size_t size, void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new[]( size, ptr ); } \
void Class::operator delete []( void *ptr, void *ptr2 ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete[]( ptr, ptr2 ); } \
\
void* Class::operator new( size_t size, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new( size, nt ); } \
void Class::operator delete( void *ptr, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete( ptr, nt ); } \
\
void* Class::operator new []( size_t size, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new[]( size, nt ); } \
void Class::operator delete []( void *ptr, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete[]( ptr, nt ); }
#else // __OVERLOAD_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Реализация операторов new и delete, обеспечивающая последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков (объявленных в DECLARE_NEW_DELETE_CLASS_EX).
/// \en Implementation of new and delete operators which provides sequential access
/// to the allocation/deallocation functions from different threads (declared in DECLARE_NEW_DELETE_CLASS_EX). \~
/// \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
#endif // __OVERLOAD_MEMORY_ALLOCATE_FREE_
#endif // __DEBUG_MEMORY_ALLOCATE_FREE_
//------------------------------------------------------------------------------
/** \brief \ru Реализация объявления DECLARE_PERSISTENT_CLASS_BASE.
\en Implementation of DECLARE_PERSISTENT_CLASS_BASE declaration. \~
\details \ru Реализация объявления DECLARE_PERSISTENT_CLASS_BASE.
Описывает необходимые действия для поточного класса.
Устанавливается в любой .cpp файл.
Class должен наследовать от TapeBase.
Должны быть реализованы функции чтения Read и записи Write. \n
\en Implementation of DECLARE_PERSISTENT_CLASS_BASE declaration.
Describes the necessary operations for a stream class.
It is set into any .cpp file.
Class must be inherited from TapeBase.
Function Read of reading and function Write of writing should be implemented. \n \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_OPS( AppID, Class, DLLFUNC ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ); \
IMP_PERSISTENT_OPS_BASE( Class, DLLFUNC ); \
IMP_CLASS_DESC_FUNC( AppID, Class )
//------------------------------------------------------------------------------
/** \brief \ru Реализация объявления DECLARE_PERSISTENT_CLASS_BASE для абстрактного поточного класса.
\en Implementation of DECLARE_PERSISTENT_CLASS_BASE declaration for an abstract stream class. \~
\details \ru Реализация объявления DECLARE_PERSISTENT_CLASS_BASE для абстрактного поточного класса.
Описывает необходимые действия для поточного класса.
Устанавливается в любой .cpp файл.
Class должен наследовать от TapeBase.
Должны быть реализованы функции чтения Read и записи Write. \n
\en Implementation of DECLARE_PERSISTENT_CLASS_BASE declaration for an abstract stream class.
Describes the necessary operations for a stream class.
It is set into any .cpp file.
Class must be inherited from TapeBase.
Function Read of reading and function Write of writing should be implemented. \n \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_A_PERSISTENT_CLASS_OPS( AppID, Class, DLLFUNC ) \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ); \
IMP_PERSISTENT_OPS_BASE( Class, DLLFUNC ); \
IMP_CLASS_DESC_FUNC( AppID, Class )
//------------------------------------------------------------------------------
/** \brief \ru Реализация объявления DECLARE_PERSISTENT_CLASS_NEW_DEL_BASE.
\en Implementation of DECLARE_PERSISTENT_CLASS_NEW_DEL_BASE declaration. \~
\details \ru Реализация объявления DECLARE_PERSISTENT_CLASS_NEW_DEL_BASE.
Описывает необходимые действия для поточного класса.
Устанавливается в любой .cpp файл.
Class должен наследовать от TapeBase.
Должны быть реализованы функции чтения Read и записи Write. \n
\en Implementation of DECLARE_PERSISTENT_CLASS_NEW_DEL_BASE declaration.
Describes the necessary operations for a stream class.
It is set into any .cpp file.
Class must be inherited from TapeBase.
Function Read of reading and function Write of writing should be implemented. \n \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_NEW_DEL_OPS( AppID, Class, DLLFUNC ) \
IMP_PERSISTENT_CLASS_OPS( AppID, Class, DLLFUNC ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class );
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для абстрактного поточного класса, \en Describes the necessary operations for the abstract stream class
// \ru не наследующего ни от кого кроме TapeBase, и у которого \en which is not inherited from any class except TapeBase and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_A_PERSISTENT_CLASS_WD( AppID, Class ) \
void Class::Read( reader &, Class * ) {} \
void Class::Write( writer &, const Class * ) {} \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для абстрактного поточного класса с проверкой главной версии потока (версии математического ядра),
// \en Describes the necessary operations for the abstract stream class with check of the main stream version (the mathenatical kernel version),
// \ru не наследующего ни от кого кроме TapeBase, и у которого \en which is not inherited from any class except TapeBase and which
// \ru нет своих полей данных для записи в поток. \en has no its own data fields for writing to stream.
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_A_PERSISTENT_MATH_CLASS_WD( AppID, Class ) \
void Class::Read( reader &, Class * ) {} \
void Class::Write( writer & out, const Class * ) \
{ if ( out.MathVersion() < wrv_FirstRelease ) out.setState( io::cantWriteObject ); } \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для абстрактного \en Describes the necessary operations for abstract
// \ru поточного класса \en stream class
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется наличие функций \en 2. There must be the following functions
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_A_PERSISTENT_CLASS( AppID, Class ) \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции абстрактного поточного класса, \en Describes the necessary operations for the abstract stream class
// \ru наследующего от другого такого же, и у которого \en inherited from another class which is the same and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// \ru эти функции генерируются автоматически \en these functions are generated automatically
// ---
#define IMP_A_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base ) \
void Class::Read( reader & in, Class * obj ) { \
Base::Read( in, obj ); \
} \
void Class::Write( writer & out, const Class * obj ) { \
Base::Write( out, obj ); \
} \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции поточного класса, \en Describes the necessary operations of the stream class
// \ru наследующего от другого такого же, и у которого \en inherited from another class which is the same and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// \ru эти функции генерируются автоматически \en these functions are generated automatically
// ---
#define IMP_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
IMP_A_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base )
//------------------------------------------------------------------------------
/** \brief \ru Аналог макроса IMP_PERSISTENT_CLASS_FROM_BASE
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_CLASS_FROM_BASE macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_CLASS_FROM_BASE
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_CLASS_FROM_BASE macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_FROM_BASE_NEW_DEL( AppID, Class, Base ) \
IMP_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base ) \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для поточного класса, \en Describes the necessary operations for the stream class
// \ru не наследующего ни от кого кроме TapeBase, и у которого \en which is not inherited from any class except TapeBase and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_PERSISTENT_CLASS_WD( AppID, Class ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
void Class::Read( reader &, Class * ) {} \
void Class::Write( writer &, const Class * ) {} \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
/** \brief \ru Аналог макроса IMP_PERSISTENT_CLASS_WD
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_CLASS_WD macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_CLASS_WD
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_CLASS_WD macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_WD_NEW_DEL( AppID, Class ) \
IMP_PERSISTENT_CLASS_WD( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
//------------------------------------------------------------------------------
/** \brief \ru Реализация объявления DECLARE_PERSISTENT_CLASS.
\en Implementation of DECLARE_PERSISTENT_CLASS declaration. \~
\details \ru Реализация объявления DECLARE_PERSISTENT_CLASS.
Описывает необходимые действия для поточного класса.
Устанавливается в любой .cpp файл.
Class должен наследовать от TapeBase.
Должны быть реализованы функции чтения Read и записи Write. \n
\en Implementation of DECLARE_PERSISTENT_CLASS declaration.
Describes the necessary operations for a stream class.
It is set into any .cpp file.
Class must be inherited from TapeBase.
Function Read of reading and function Write of writing should be implemented. \n \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS( AppID, Class ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ); \
IMP_CLASS_DESC_FUNC( AppID, Class )
/** \brief \ru Аналог макроса IMP_PERSISTENT_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_NEW_DEL( AppID, Class ) \
IMP_PERSISTENT_CLASS( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class );
//----------------------------------------------------------------------------------------
/// \ru Конструирование нового экземпляра класса для класса без записи. \en Construction of a new instance of the class for a class without writing. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_RO_REGISTRATION( AppID, Class ) \
TapeBase * CALL_DECLARATION make ## _ ## Class () { \
return new Class(tapeInit); \
} \
void * CALL_DECLARATION cast ## _ ## Class ( const TapeBase * obj ) { \
return dynamic_cast<Class*>(const_cast<TapeBase *>(obj) ); \
} \
TapeClass r ## Class( \
typeid(Class).name(), \
AppID, \
(BUILD_FUNC) make ## _ ## Class, \
(CAST_FUNC ) cast ## _ ## Class, \
(READ_FUNC ) Class::Read, \
(WRITE_FUNC) 0 \
)
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые действия для поточного класса без записи \en Describes the necessary operations for a stream class without writing.
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется наличие функций \en 2. There must be the following functions
// - void Class:Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_PERSISTENT_RO_CLASS( AppID, Class ) \
IMP_PERSISTENT_RO_REGISTRATION( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
//------------------------------------------------------------------------------
/** \brief \ru Аналог макроса IMP_PERSISTENT_RO_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_RO_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_RO_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_RO_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_RO_CLASS_NEW_DEL( AppID, Class ) \
IMP_PERSISTENT_RO_CLASS( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
/**
\brief \ru Объявление операторов чтения и записи указателей и ссылок.
\en Declaration of operators of reading and writing of pointers and references. \~
\deprecated
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_OPS_B( Class ) \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ); \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ); \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, const Class *& ptr ); \
friend inline writer & CALL_DECLARATION operator << ( writer & out, const Class & ref ); \
friend inline writer & CALL_DECLARATION operator << ( writer & out, const Class * ptr ); \
friend inline writer & CALL_DECLARATION operator << ( writer & out, Class & ref ); \
friend inline writer & CALL_DECLARATION operator << ( writer& out, Class * ptr );
//----------------------------------------------------------------------------------------
/**
\brief \ru Операторы чтения указателей и ссылок для класса без записи.
\en Operators of reading pointers and references for a class without writing. \~
\deprecated
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_RO_OPS( Class ) \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ) { \
in.readObject( dynamic_cast<TapeBase *>(&ref) ); \
return in; \
} \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ) { \
ptr = dynamic_cast<Class *>( in.readObjectPointer() ); \
return in; \
}
//----------------------------------------------------------------------------------------
/// \ru Функции чтения для класса без записи. \en Function of reading for class without writing. \~ \ingroup Base_Tools_IO
/// \deprecated
// ---
#define DECLARE_PERSISTENT_RO_FUNCS( Class ) \
public: \
static void Read( reader & in, Class * obj )
//----------------------------------------------------------------------------------------
/// \ru Конструктор для потокового класса. \en Constructor for a stream class. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_CTOR( Class ) \
Class::Class( TapeInit ) {}
//----------------------------------------------------------------------------------------
/// \ru Конструктор для класса с одной потоковой базой. \en Constructor for a class with one stream base. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_CTOR1( Class, Base ) \
Class::Class( TapeInit ) : Base( tapeInit ) {}
//----------------------------------------------------------------------------------------
/// \ru Конструктор для класса с двумя потоковыми базами. \en Constructor for a class with two stream bases. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_CTOR2( Class, Base1, Base2 ) \
Class::Class( TapeInit ) : Base1( tapeInit ), Base2( tapeInit ) {}
#endif // __IO_TAPE_H
+9 -788
View File
@@ -13,10 +13,12 @@
////////////////////////////////////////////////////////////////////////////////
//
// \ru Классы, для которых при записи и чтении точно известен тип, \en Classes for which the type is exactly known while reading and writing
// \ru могут записываться в поток и читаться из потока с помощью \en can be written to the stream and read from the stream using
// \ru операторов << и >>, \en << and >> operators.
// \ru Это, например, классы лежащие в массиве SArray \en They are, for instance, classes contained in array SArray
// \ru Классы, для которых при записи и чтении точно известен тип, могут записываться в поток
// и читаться из потока с помощью операторов << и >>.
// Это, например, классы лежащие в массиве SArray.
// \en Classes for which the type is exactly known while reading and writing can be written
// to the stream and read from the stream using << and >> operators.
// They are, for instance, classes contained in array SArray.
//
// \ru Для таких объектов необходимо в описании класса установить : \en For such objects one should set in the class definition:
// \ru KNOWN_OBJECTS_RW_REF_OPERATORS( Class ) - для работы со ссылками и объектами класса \en KNOWN_OBJECTS_RW_REF_OPERATORS( Class ) - for work with references and class objects
@@ -185,14 +187,10 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <math_x.h>
#include <memory>
#include <io_memory_buffer.h>
#include <io_base.h>
#include <io_buffer.h>
#include <tool_uuid.h>
#include <system_cpp_standard.h>
#include <system_dependency.h>
#include <math_version.h>
#include <math_define.h>
#include <io_tree.h>
#include <tool_memory_leaks_check.h>
@@ -200,19 +198,16 @@
#include <tool_memory_debug.h>
#endif
#include <system_types.h>
//----------------------------------------------------------------------------------------
// \ru Предварительное объявление классов.
// \en The forward declaration of classes. \~
// ---
class MATH_CLASS TapeManager;
class MATH_CLASS reader;
class MATH_CLASS writer;
class MATH_CLASS TapeRegistrator;
class MATH_CLASS iobuf_Seq;
class MATH_CLASS IProgressIndicator;
class MATH_CLASS ProgressBarWrapper;
class MATH_CLASS ClassDescriptor;
struct TapeClassContainer;
//----------------------------------------------------------------------------------------
@@ -240,58 +235,6 @@ enum TapeInit {
};
//----------------------------------------------------------------------------------------
/** \brief \ru Упакованное имя класса.
\en Packed class name. \~
\details \ru Упакованное имя одного класса - для набора массива потоковых классов в TapeClass. \n
\en Packed name of one class - for array of stream classes in TapeClass. \n \~
\ingroup Base_Tools_IO
*/ // ---
class MATH_CLASS ClassDescriptor
{
protected:
uint16 val; ///< \ru Хэш имени класса. \en The class name hash.
MbUuid appID_; ///< \ru Дополнительный идентификатор приложения. \en Additional application identifier.
private:
/// \ru Признак записи appID. \en AppID record flag.
static const uint16 rwIdFlag;
public:
/// \ru Конструктор. \en Constructor.
ClassDescriptor();
/// \ru Конструктор по хэшу. \en Constructor by hash.
ClassDescriptor( uint16 v );
/// \ru Конструктор по имени. \en Constructor by name.
ClassDescriptor( const char * name );
/// \ru Конструктор по хэшу. \en Constructor by hash.
ClassDescriptor( uint16 v, const MbUuid & appID );
/// \ru Конструктор по имени. \en Constructor by name.
ClassDescriptor( const char * name, const MbUuid & appID );
/// \ru Конструктор по хэшу. \en Constructor by hash.
ClassDescriptor( const ClassDescriptor & other );
/// \ru Оператор присваивания. \en An assignment operator.
ClassDescriptor & operator = ( const ClassDescriptor & other );
/// \ru Оператор равенства. \en The equality operator.
bool operator == ( const ClassDescriptor & other ) const;
/// \ru Оператор неравенства. \en The inequality operator.
bool operator != ( const ClassDescriptor & other ) const;
/// \ru Оператор сравнения. \en Comparison operator.
bool operator < (const ClassDescriptor & other ) const;
/// \ru Оператор сравнения. \en Comparison operator.
bool operator > ( const ClassDescriptor & other ) const;
#ifdef C3D_DEBUG
/// \ru Оператор доступа. \en An access operator.
operator uint16() const { return val; }
#endif
/// \ru Оператор записи. \en Write operator.
void Write( writer & out );
/// \ru Оператор чтения. \en Read operator.
bool Read( reader & in );
};
//------------------------------------------------------------------------------
/** \brief \ru Базовый класс для потоковых классов.
\en Base class for stream classes. \~
@@ -336,68 +279,6 @@ private:
};
//----------------------------------------------------------------------------------------
/// \ru Шаблон функции создания нового экземпляра. \en Template of function of a new instance creation. \~ \ingroup Base_Tools_IO
//---
typedef TapeBase * (CALL_DECLARATION * BUILD_FUNC) ( void );
//----------------------------------------------------------------------------------------
/** \brief \ru Шаблон функции преобразования.
\en Template of conversion function. \~
\details \ru Шаблон функции преобразования из указателя на TapeBase к указателю на класс. \n
\en Template of function of conversion from a pointer to TapeBase to a pointer to the class. \n \~
\ingroup Base_Tools_IO
*/ //---
typedef void * (CALL_DECLARATION * CAST_FUNC) ( const TapeBase * );
//----------------------------------------------------------------------------------------
/**\ru Шаблон функции чтения экземпляра.
\en Template of instance reading function. \~
\ingroup Base_Tools_IO
*/ //---
typedef void (CALL_DECLARATION * READ_FUNC) ( reader & in, void * /*obj*/ );
//----------------------------------------------------------------------------------------
/// \ru Шаблон функции записи экземпляра. \en Template of instance writing function. \~ \ingroup Base_Tools_IO
//---
typedef void (CALL_DECLARATION * WRITE_FUNC) ( writer & out, void * /*obj*/ );
//----------------------------------------------------------------------------------------
/** \brief \ru "Обертка" для одного потокового класса.
\en "Wrapper" for one stream class. \~
\details \ru "Обертка" для одного потокового класса ( не экземпляра! ).
Xранит упакованное имя класса и адреса функций, необходимых при чтении/записи. \n
\en "Wrapper" for one stream class ( not instance! ).
Stores packed class name and addresses of functions necessary while reading/writing. \n \~
\ingroup Base_Tools_IO
*/ // ---
class MATH_CLASS TapeClass {
protected:
ClassDescriptor hashValue; ///< \ru Упакованное имя класса. \en Packed class name.
BUILD_FUNC _builder; ///< \ru Функция создания нового экземпляра. \en Functions of a new instance creation.
CAST_FUNC _caster; ///< \ru Функция преобразования от TapeBase к указателю на класс. \en Function of conversion from TapeBase to a pointer to a class.
READ_FUNC _reader; ///< \ru Функция чтения. \en Read function.
WRITE_FUNC _writer; ///< \ru Функция записи. \en Write function.
public:
/// \ru Конструктор. \en Constructor.
/// \ru Конструктор. \en Constructor.
TapeClass( const char * name, BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w );
TapeClass( const char * name, MbUuid appID, BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w );
/// \ru Деструктор. \en Destructor.
virtual ~TapeClass();
/// \ru Получить упакованное имя класса. \en Get the packed class name.
ClassDescriptor GetPackedClassName() const;
/// \ru Получить упакованное имя класса для записи с учетом версии. \en Get the packed class name for writing subject to the version.
virtual ClassDescriptor GetPackedClassNameForWrite( VERSION ) const;
friend class TapeManager;
friend struct TapeClassContainer;
OBVIOUS_PRIVATE_COPY( TapeClass )
};
//----------------------------------------------------------------------------------------
/** \brief \ru Cпособы записи указателей.
\en Methods of writing pointers. \~
@@ -814,36 +695,6 @@ OBVIOUS_PRIVATE_COPY( writer_ex )
};
//----------------------------------------------------------------------------------------
/** \brief \ru Поток для чтения и записи.
\en Stream for reading and writing. \~
\details \ru Поток для чтения и записи. \n
\en Stream for reading and writing. \n \~
\deprecated \ru Класс устарел и будет удален в версии 2023.
\en The class is deprecated and will be removed in version 2023. \~
\ingroup Base_Tools_IO
*/ // ---
class MATH_CLASS rw : public writer, public reader {
public:
typedef std::unique_ptr<rw> rw_ptr;
public:
/// \ru Создать читатель/писатель для буфера в памяти. \en Create reader/writer for membuf.
static rw_ptr CreateMemWriter( membuf & sb, uint8 om );
/// \ru Конструктор. \en Constructor.
rw( iobuf & buf, uint16 om );
virtual ~rw() {}
private:
/// \ru Конструктор. \en Constructor.
rw( iobuf_Seq & sb, bool ownBuf, bool openSys, uint16 om, TapeRegistrator * reg );
OBVIOUS_PRIVATE_COPY( rw )
};
//----------------------------------------------------------------------------------------
/**
\brief \ru Дружественные операторы чтения и записи указателей и ссылок.
@@ -882,385 +733,6 @@ OBVIOUS_PRIVATE_COPY( rw )
return out; \
}
/**
\brief \ru Объявление операторов чтения и записи указателей и ссылок.
\en Declaration of operators of reading and writing of pointers and references. \~
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_OPS_B( Class ) \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ); \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ); \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, const Class *& ptr ); \
friend inline writer & CALL_DECLARATION operator << ( writer & out, const Class & ref ); \
friend inline writer & CALL_DECLARATION operator << ( writer & out, const Class * ptr ); \
friend inline writer & CALL_DECLARATION operator << ( writer & out, Class & ref ); \
friend inline writer & CALL_DECLARATION operator << ( writer& out, Class * ptr );
//----------------------------------------------------------------------------------------
/**
\brief \ru Операторы чтения и записи указателей и ссылок.
\en Operators of reading and writing of pointers and references. \~
\ingroup Base_Tools_IO
*/
// ---
#define IMPL_PERSISTENT_OPS( Class )
//----------------------------------------------------------------------------------------
/**
\brief \ru Операторы чтения указателей и ссылок для класса без записи.
\en Operators of reading pointers and references for a class without writing. \~
\ingroup Base_Tools_IO
*/
// ---
#define DECLARE_PERSISTENT_RO_OPS( Class ) \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class & ref ) { \
in.readObject( dynamic_cast<TapeBase *>(&ref) ); \
return in; \
} \
friend inline reader & CALL_DECLARATION operator >> ( reader & in, Class *& ptr ) { \
ptr = dynamic_cast<Class *>( in.readObjectPointer() ); \
return in; \
}
//----------------------------------------------------------------------------------------
/// \ru Функции чтения и записи. \en Functions of reading and writing. \~ \ingroup Base_Tools_IO
// ---
#define DECLARE_PERSISTENT_FUNCS( Class ) \
public: \
static void Read ( reader & in, Class * obj ); \
static void Write( writer & out, const Class * obj )
//----------------------------------------------------------------------------------------
/// \ru Функции чтения для класса без записи. \en Function of reading for class without writing. \~ \ingroup Base_Tools_IO
// ---
#define DECLARE_PERSISTENT_RO_FUNCS( Class ) \
public: \
static void Read( reader & in, Class * obj )
//------------------------------------------------------------------------------
/// \ru Функции получения дескриптора класса. \~ \ingroup Base_Tools_IO
// ---
#define DECLARE_CLASS_DESC_FUNC( Class ) \
public: \
ClassDescriptor GetClassDescriptor( const VersionContainer & ) const override;
//------------------------------------------------------------------------------
/// \ru Функции получения дескриптора (хэш + APP UID) класса. \~ \ingroup Base_Tools_IO
// ---
#define IMP_CLASS_DESC_FUNC( AppID, Class ) \
ClassDescriptor Class::GetClassDescriptor( const VersionContainer & v) const \
{ return ClassDescriptor( GetPureName(v), AppID ); }
//----------------------------------------------------------------------------------------
/// \ru Конструктор для потокового класса. \en Constructor for a stream class. \~ \ingroup Base_Tools_IO
// ---
#define DECLARE_PERSISTENT_CTOR( Class ) \
public: \
Class( TapeInit )
//----------------------------------------------------------------------------------------
/// \ru Конструктор для потокового класса. \en Constructor for a stream class. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_CTOR( Class ) \
Class::Class( TapeInit ) {}
//----------------------------------------------------------------------------------------
/// \ru Конструктор для класса с одной потоковой базой. \en Constructor for a class with one stream base. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_CTOR1( Class, Base ) \
Class::Class( TapeInit ) : Base( tapeInit ) {}
//----------------------------------------------------------------------------------------
/// \ru Конструктор для класса с двумя потоковыми базами. \en Constructor for a class with two stream bases. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_CTOR2( Class, Base1, Base2 ) \
Class::Class( TapeInit ) : Base1( tapeInit ), Base2( tapeInit ) {}
//----------------------------------------------------------------------------------------
/** \brief \ru Конструирование нового экземпляра класса.
\en Construction of a new instance of the class. \~
\details \ru Конструирование нового экземпляра класса. \n
Определяются функция конструирования нового экземпляра класса,
функция преобразования от указателя на TapeBase к указателю на класс
и класс (не экземпляр!) добавляется в массив потоковых
путем создания переменной r ## Class типа TapeClass
(а в конструкторе TapeClass производится
добавление в массив потоковых классов).
Символ ## - это указание препроцессору о необходимости "склейки"
текущего идентификатора с последующим.
\en Construction of a new instance of the class. \n
Definition of functions of construction a new instance of the class,
function of conversion from a pointer to TapeBase to a pointer to the class
and addition of the class (not an instance) to the array of stream classes
by creating variable r ## Class of type TapeClass
(and in constructor of TapeClass
addition to array of stream classes is performed).
Symbol ## is a directive for preprocessor about the necessity of "gluing"
of the current identifier with the next one. \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_REGISTRATION( AppID, Class ) \
TapeBase * CALL_DECLARATION make ## _ ## Class () { \
return new Class(tapeInit); \
} \
void * CALL_DECLARATION cast ## _ ## Class ( const TapeBase * obj ) { \
return dynamic_cast<Class *>(const_cast<TapeBase *>(obj) ); \
} \
\
TapeClass r ## Class( \
typeid(Class).name(), \
AppID, \
(BUILD_FUNC) make ## _ ## Class, \
(CAST_FUNC ) cast ## _ ## Class, \
(READ_FUNC ) Class::Read, \
(WRITE_FUNC) Class::Write \
)
//------------------------------------------------------------------------------
// \ru Как записать переименованный класс в старую версию (с) Столяров А.Г. \en How to write the renamed class to the old version (c) Stolyarov A.G.
/* #define IMP_PERSISTENT_REGISTRATION_OLDCLASS( Class, OldClass ) \
TapeBase * CALL_DECLARATION make ## _ ## Class () { \
return dynamic_cast<TapeBase *>( new Class(tapeInit) ); \
} \
void * CALL_DECLARATION cast ## _ ## Class ( const TapeBase * obj ) { \
return dynamic_cast<Class *>(const_cast<TapeBase *>(obj) ); \
} \
TapeClass r ## Class( \
typeid(Class).name(), \
typeid(OldClass).name(), \
(BUILD_FUNC) make ## _ ## Class, \
(CAST_FUNC ) cast ## _ ## Class, \
(READ_FUNC ) Class::Read, \
(WRITE_FUNC) Class::Write \
)
#define IMP_PERSISTENT_OLDCLASS( Class, OldClass ) \
IMP_PERSISTENT_REGISTRATION_OLDCLASS( Class, OldClass ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
IMP_PERSISTENT_OLDCLASS( Class, OldClass );
class TapeClassForNewObjects : public TapeClass {
protected :
ClassDescriptor hashValueOld; // \ru упакованное имя класса для старой версии файла \en packed class name for the old version of file
public :
TapeClassForNewObjects( const char * name, const char * oldName, BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w );
virtual ~TapeClassForNewObjects();
virtual ClassDescriptor GetPackedClassNameForWrite( long version ) const;
OBVIOUS_PRIVATE_COPY(TapeClassForNewObjects);
};
TapeClassForNewObjects::TapeClassForNewObjects( const char * name, const char * oldName,
BUILD_FUNC b, CAST_FUNC c, READ_FUNC r, WRITE_FUNC w )
: TapeClass( name, b, c, r, w )
, hashValueOld( ::hash(::pureName( oldName ) ) )
{
}
ClassDescriptor TapeClassForNewObjects::GetPackedClassNameForWrite( long version ) const {
uint16 res = version > CHANGE_VERSION ? TapeClass::GetPackedClassName() : uint16(hashValueOld);
return res;
}
*/
//----------------------------------------------------------------------------------------
/// \ru Конструирование нового экземпляра класса для класса без записи. \en Construction of a new instance of the class for a class without writing. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_RO_REGISTRATION( AppID, Class ) \
TapeBase * CALL_DECLARATION make ## _ ## Class () { \
return new Class(tapeInit); \
} \
void * CALL_DECLARATION cast ## _ ## Class ( const TapeBase * obj ) { \
return dynamic_cast<Class*>(const_cast<TapeBase *>(obj) ); \
} \
TapeClass r ## Class( \
typeid(Class).name(), \
AppID, \
(BUILD_FUNC) make ## _ ## Class, \
(CAST_FUNC ) cast ## _ ## Class, \
(READ_FUNC ) Class::Read, \
(WRITE_FUNC) 0 \
)
/** \brief \ru Переменная включает перегрузку операторов new/delete,
обеспечивающую последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en The variable enables overloading of new/delete operators
which provides sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Переменная включает перегрузку операторов new/delete,
обеспечивающую последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en The variable enables overloading of new/delete operators
which provides sequential access to the allocation/deallocation functions
from different threads. \~
\ingroup Base_Tools_IO
*/
// ---
#define __OVERLOAD_MEMORY_ALLOCATE_FREE_
#ifdef __DEBUG_MEMORY_ALLOCATE_FREE_
//----------------------------------------------------------------------------------------
/// \ru Объявление функций new, delete и операторов доступа. \en Declaration of functions new, delete and access operators. \~ \ingroup Base_Tools_IO
// \ru операторы * и -> автоматически не перегружаются, \en operators * and -> are not overloaded automatically,
// \ru для их использования нужно писать примерно так: \n \en one should write like this to use them: \n
// \ru вместо ptr->F(); ptr->operator ->()->F(); \n \en instead of ptr->F(); ptr->operator ->()->F(); \n
// \ru или ptr->operator *().F(); \n \en or ptr->operator *().F(); \n
// \ru или ptr->operator Class*()->F(); \n \en or ptr->operator Class*()->F(); \n
// \ru Для ссылок так же. \en Similarly for references.
// ---
#define DECLARE_NEW_DELETE_CLASS( Class )
//--------------------------------------------------------------------------------------
/// \ru Реализация функций new, delete и операторов доступа. \en Implementation of functions new, delete and access operators. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
//--------------------------------------------------------------------------------------
/// \ru Объявление операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// \en Declaration of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads. \~
/// \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS_EX( Class ) \
public: \
void * operator new ( size_t ); \
void operator delete ( void *, size_t ); \
void * operator new [] ( size_t ); \
void operator delete [] ( void * );
//--------------------------------------------------------------------------------------
/// \ru Реализация операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// \en Implementation of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads. \~
/// \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class ) \
void * Class::operator new( size_t size ) { \
return ::Allocate( size, typeid(Class).name() ); } \
void Class::operator delete ( void *ptr, size_t size ) { \
::Free( ptr, size, typeid(Class).name() ); } \
\
void * Class::operator new[] ( size_t size ) { \
return ::AllocateArray( size, typeid(Class[]).name()); } \
void Class::operator delete[] ( void *ptr ) { \
::FreeArray( ptr, typeid(Class[]).name() ); }
#else // __DEBUG_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Объявление функций new, delete и операторов доступа. \en Declaration of functions new, delete and access operators. \~ \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS( Class )
//--------------------------------------------------------------------------------------
/// \ru Реализация функций new, delete и операторов доступа. \en Implementation of functions new, delete and access operators. \~ \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
#if defined(__OVERLOAD_MEMORY_ALLOCATE_FREE_) && !defined(C3D_DEBUG)
//--------------------------------------------------------------------------------------
/// \ru Объявление операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// Перегружаются все стандартные операторы new и delete.
/// \en Declaration of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads.
/// All standard new and delete operators are overloaded. \~
/// \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS_EX( Class ) \
public: \
void * operator new ( size_t ); \
void * operator new ( size_t, const std::nothrow_t & ) throw(); \
void * operator new ( size_t, void * ); \
void * operator new [] ( size_t ); \
void * operator new [] ( size_t, const std::nothrow_t & ) throw(); \
void * operator new [] ( size_t, void * ); \
void operator delete ( void * ); \
void operator delete ( void *, const std::nothrow_t & ) throw(); \
void operator delete ( void *, void* ); \
void operator delete [] ( void * ); \
void operator delete [] ( void *, const std::nothrow_t & ) throw(); \
void operator delete [] ( void *, void * );
//--------------------------------------------------------------------------------------
/// \ru Реализация операторов new и delete, обеспечивающая последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// Перегружаются все стандартные операторы new и delete.
/// \en Implementation of new and delete operators which provides sequential access
/// to the allocation/deallocation functions from different threads.
/// All standard new and delete operators are overloaded. \~
/// \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class ) \
void* Class::operator new( size_t size ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new( size ); } \
void Class::operator delete( void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete( ptr ); } \
\
void* Class::operator new( size_t size, void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new( size, ptr ); } \
void Class::operator delete( void *ptr, void *ptr2 ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete( ptr, ptr2 ); } \
\
void* Class::operator new[]( size_t size ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new[]( size ); } \
void Class::operator delete[]( void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete[]( ptr ); } \
\
void* Class::operator new []( size_t size, void *ptr ) { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new[]( size, ptr ); } \
void Class::operator delete []( void *ptr, void *ptr2 ) { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete[]( ptr, ptr2 ); } \
\
void* Class::operator new( size_t size, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new( size, nt ); } \
void Class::operator delete( void *ptr, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete( ptr, nt ); } \
\
void* Class::operator new []( size_t size, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
return ::operator new[]( size, nt ); } \
void Class::operator delete []( void *ptr, const std::nothrow_t &nt ) throw() { \
SET_MEMORY_SCOPED_LOCK; \
::operator delete[]( ptr, nt ); }
#else // __OVERLOAD_MEMORY_ALLOCATE_FREE_
//--------------------------------------------------------------------------------------
/// \ru Объявление операторов new и delete, обеспечивающих последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// \en Declaration of new and delete operators which provide sequential access
/// to the allocation/deallocation functions from different threads. \~
/// \ingroup Base_Tools_IO
// ---
#define DECLARE_NEW_DELETE_CLASS_EX( Class )
//--------------------------------------------------------------------------------------
/// \ru Реализация операторов new и delete, обеспечивающая последовательное обращение
/// к функциям выделения/освобождения памяти из разных потоков.
/// \en Implementation of new and delete operators which provides sequential access
/// to the allocation/deallocation functions from different threads. \~
/// \ingroup Base_Tools_IO
// ---
#define IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
#endif // __OVERLOAD_MEMORY_ALLOCATE_FREE_
#endif // __DEBUG_MEMORY_ALLOCATE_FREE_
//------------------------------------------------------------------------------
/** \brief \ru Объявление класса Class поточным.
@@ -1314,257 +786,6 @@ ClassDescriptor TapeClassForNewObjects::GetPackedClassNameForWrite( long version
DECLARE_PERSISTENT_CLASS( Class ) \
DECLARE_NEW_DELETE_CLASS_EX( Class )
//------------------------------------------------------------------------------
/** \brief \ru Реализация объявления DECLARE_PERSISTENT_CLASS.
\en Implementation of DECLARE_PERSISTENT_CLASS declaration. \~
\details \ru Реализация объявления DECLARE_PERSISTENT_CLASS.
Описывает необходимые действия для поточного класса.
Устанавливается в любой .cpp файл.
Class должен наследовать от TapeBase.
Должны быть реализованы функции чтения Read и записи Write. \n
\en Implementation of DECLARE_PERSISTENT_CLASS declaration.
Describes the necessary operations for a stream class.
It is set into any .cpp file.
Class must be inherited from TapeBase.
Function Read of reading and function Write of writing should be implemented. \n \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS( AppID, Class ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ); \
IMP_CLASS_DESC_FUNC( AppID, Class )
/** \brief \ru Аналог макроса IMP_PERSISTENT_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_NEW_DEL( AppID, Class ) \
IMP_PERSISTENT_CLASS( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class );
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые действия для поточного класса без записи \en Describes the necessary operations for a stream class without writing.
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется наличие функций \en 2. There must be the following functions
// - void Class:Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_PERSISTENT_RO_CLASS( AppID, Class ) \
IMP_PERSISTENT_RO_REGISTRATION( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class )
//------------------------------------------------------------------------------
/** \brief \ru Аналог макроса IMP_PERSISTENT_RO_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_RO_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_RO_CLASS
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_RO_CLASS macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_RO_CLASS_NEW_DEL( AppID, Class ) \
IMP_PERSISTENT_RO_CLASS( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для абстрактного \en Describes the necessary operations for abstract
// \ru поточного класса \en stream class
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется наличие функций \en 2. There must be the following functions
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_A_PERSISTENT_CLASS( AppID, Class ) \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции абстрактного поточного класса, \en Describes the necessary operations for the abstract stream class
// \ru наследующего от другого такого же, и у которого \en inherited from another class which is the same and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// \ru эти функции генерируются автоматически \en these functions are generated automatically
// ---
#define IMP_A_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base ) \
void Class::Read( reader & in, Class * obj ) { \
Base::Read( in, obj ); \
} \
void Class::Write( writer & out, const Class * obj ) { \
Base::Write( out, obj ); \
} \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции поточного класса, \en Describes the necessary operations of the stream class
// \ru наследующего от другого такого же, и у которого \en inherited from another class which is the same and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// \ru эти функции генерируются автоматически \en these functions are generated automatically
// ---
#define IMP_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
IMP_A_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base )
//------------------------------------------------------------------------------
/** \brief \ru Аналог макроса IMP_PERSISTENT_CLASS_FROM_BASE
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_CLASS_FROM_BASE macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_CLASS_FROM_BASE
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_CLASS_FROM_BASE macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_FROM_BASE_NEW_DEL( AppID, Class, Base ) \
IMP_PERSISTENT_CLASS_FROM_BASE( AppID, Class, Base ) \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для поточного класса, \en Describes the necessary operations for the stream class
// \ru не наследующего ни от кого кроме TapeBase, и у которого \en which is not inherited from any class except TapeBase and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_PERSISTENT_CLASS_WD( AppID, Class ) \
IMP_PERSISTENT_REGISTRATION( AppID, Class ); \
void Class::Read( reader &, Class * ) {} \
void Class::Write( writer &, const Class * ) {} \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
/** \brief \ru Аналог макроса IMP_PERSISTENT_CLASS_WD
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков.
\en Analog of IMP_PERSISTENT_CLASS_WD macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads. \~
\details \ru Аналог макроса IMP_PERSISTENT_CLASS_WD
с возможностью перегрузки операторов new/delete,
обеспечивающий последовательное обращение к функциям
выделения/освобождения памяти из разных потоков
(включается переменной __OVERLOAD_MEMORY_ALLOCATE_FREE_).
\en Analog of IMP_PERSISTENT_CLASS_WD macro
with support of new/delete operators overloading which provides
sequential access to the allocation/deallocation functions
from different threads
(enabled by defining __OVERLOAD_MEMORY_ALLOCATE_FREE_). \~
\ingroup Base_Tools_IO
*/
// ---
#define IMP_PERSISTENT_CLASS_WD_NEW_DEL( AppID, Class ) \
IMP_PERSISTENT_CLASS_WD( AppID, Class ); \
IMP_PERSISTENT_NEW_DELETE_CLASS_EX( Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для абстрактного поточного класса, \en Describes the necessary operations for the abstract stream class
// \ru не наследующего ни от кого кроме TapeBase, и у которого \en which is not inherited from any class except TapeBase and which
// \ru нет своих полей данных для записи в поток \en has no its own data fields for writing to stream
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_A_PERSISTENT_CLASS_WD( AppID, Class ) \
void Class::Read( reader &, Class * ) {} \
void Class::Write( writer &, const Class * ) {} \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
//----------------------------------------------------------------------------------------
// \ru Описывает необходимые операции для абстрактного поточного класса с проверкой главной версии потока (версии математического ядра),
// \en Describes the necessary operations for the abstract stream class with check of the main stream version (the mathenatical kernel version),
// \ru не наследующего ни от кого кроме TapeBase, и у которого \en which is not inherited from any class except TapeBase and which
// \ru нет своих полей данных для записи в поток. \en has no its own data fields for writing to stream.
// \ru Устанавливается в любой .cpp файл \en It is set to any .cpp file
// \ru Примечание : \en Note:
// \ru 1. Class должен наследовать от TapeBase \en 1. Class must be inherited from TapeBase
// \ru 2. Требуется (!!!) отсутствие (!!!) функций \en 2. The following functions must be (!!!) absent (!!!)
// - void Class::Read( reader& in, Class* obj );
// - void Class::Write( writer& out, const Class* obj );
// \ru где Class - имя класса \en where Class is a class name
// ---
#define IMP_A_PERSISTENT_MATH_CLASS_WD( AppID, Class ) \
void Class::Read( reader &, Class * ) {} \
void Class::Write( writer & out, const Class * ) \
{ if ( out.MathVersion() < wrv_FirstRelease ) out.setState( io::cantWriteObject ); } \
IMP_PERSISTENT_NEW_DELETE_CLASS( Class ) \
IMP_CLASS_DESC_FUNC( AppID, Class )
#endif // __IO_TAPE_DEFINE_H
+8
View File
@@ -95,6 +95,14 @@ struct MATH_CLASS MbCurvature
return ::atan( ( k1 + k2 ) / delta ) / M_PI_2;
}
/// \ru Преобразовать согласно матрице.
void Transform( const MbMatrix3D & matr )
{
normal.Transform( matr );
meanNormal.Transform( matr );
cdir1.Transform( matr );
cdir2.Transform( matr );
}
};
+1
View File
@@ -93,6 +93,7 @@
#define C3D_2022_VERSION 0x15001001L ///< \ru Версия файла - C3D 2022. \en The file version - C3D 2022. \~ \ingroup Base_Tools
#define MATH_22_VERSION 0x16000001L ///< \ru Версия файла - 22.0. \en The file version - 22.0. \~ \ingroup Base_Tools
#define MATH_22_HF1_VERSION 0x16000002L ///< \ru Версия файла - 22.0 HF1. \en The file version - 22.0 HF1. \~ \ingroup Base_Tools
#define MATH_22_HF2_VERSION 0x16000003L ///< \ru Версия файла - 22.0 HF2. \en The file version - 22.0 HF2. \~ \ingroup Base_Tools
#define MATH_22_UHF_VERSION 0x16000011L ///< \ru Версия файла - 22.0 UHF (Upper Hot Fix). \en The file version - 22.0 UHF (Upper Hot Fix). \~ \ingroup Base_Tools
#define C3D_2023_VERSION 0x16001001L ///< \ru Версия файла - C3D 2023. \en The file version - C3D 2023. \~ \ingroup Base_Tools
+2 -2
View File
@@ -13,7 +13,7 @@
#include <mb_cart_point3d.h>
#include <io_base.h>
class MATH_CLASS MbCartPoint;
class MATH_CLASS MbMatrix3D;
@@ -124,7 +124,7 @@ public :
bool IsSame( const MbAxis3D & other, double accuracy ) const;
/** \} */
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbAxis3D, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbAxis3D, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbAxis3D )
DECLARE_NEW_DELETE_CLASS_EX( MbAxis3D )
}; // MbAxis3D
+1 -1
View File
@@ -532,7 +532,7 @@ public :
/// \ru Является ли точка неопределенной? \en Is the point undefined?
bool IsUndefined() const { return (x == UNDEFINED_DBL || y == UNDEFINED_DBL); }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbCartPoint, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbCartPoint, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbCartPoint )
DECLARE_NEW_DELETE_CLASS_EX( MbCartPoint )
}; // MbCartPoint
+2 -1
View File
@@ -12,6 +12,7 @@
#define __MB_CART_POINT3D_H
#include <mb_vector3d.h>
#include <io_base.h>
class MATH_CLASS MbCartPoint;
@@ -455,7 +456,7 @@ public :
/// \ru Является ли точка неопределенной? \en Is the point undefined?
bool IsUndefined() const { return (x == UNDEFINED_DBL || y == UNDEFINED_DBL || z == UNDEFINED_DBL); }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbCartPoint3D, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbCartPoint3D, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class
DECLARE_NEW_DELETE_CLASS( MbCartPoint3D )
DECLARE_NEW_DELETE_CLASS_EX( MbCartPoint3D )
}; // MbCartPoint3D
+3 -25
View File
@@ -12,7 +12,9 @@
#include <mb_cart_point3d.h>
#include <io_base.h>
#include <mb_cube_tree.h>
#include <templ_s_array.h>
#include <utility>
#include <vector>
@@ -585,7 +587,7 @@ public :
bool useFixed, bool isotropy, MbMatrix3D & matrix ) const;
public:
KNOWN_OBJECTS_RW_REF_OPERATORS( MbCube )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbCube, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbCube )
DECLARE_NEW_DELETE_CLASS_EX( MbCube )
};
@@ -863,28 +865,4 @@ double MbCube::DistanceToPoint( const MbCartPoint3D & pnt ) const
}
//------------------------------------------------------------------------------
/// \ru Чтение куба из потока \en Reading of the box from a stream
// ---
inline
reader & CALL_DECLARATION operator >> ( reader & in, MbCube & obj )
{
in >> obj.pmin;
in >> obj.pmax;
return in;
}
//------------------------------------------------------------------------------
/// \ru Запись куба в поток \en Writing of the box into the stream
// ---
inline
writer & CALL_DECLARATION operator << ( writer & out, const MbCube & obj )
{
out << obj.pmin;
out << obj.pmax;
return out;
}
#endif // __MB_CUBE_H
+26 -4
View File
@@ -1236,7 +1236,7 @@ inline void MbCubeTree<Type, Cube, Point, Vector>::GetIntersectObjects( const Po
sameEps = std_max( sameEps, EXTENT_EPSILON );
C3D_ASSERT( !branchCube.IsEmpty() );
C3D_ASSERT( !rayPnt1.IsSame( rayPnt2, sameEps ) );
// C3D_ASSERT( !rayPnt1.IsSame( rayPnt2, sameEps ) );
if ( isBranch || isLeaf ) {
if ( !branchCube.IsEmpty() && !rayPnt1.IsSame( rayPnt2, sameEps ) ) {
@@ -1266,6 +1266,8 @@ inline void MbCubeTree<Type, Cube, Point, Vector>::GetIntersectObjects( const Po
}
}
bool diffPnt = !segmPnt1.IsSame( segmPnt2, sameEps );
if ( isBranch ) {
double w1 = minDoubleValue;
double w2 = minDoubleValue;
@@ -1286,16 +1288,36 @@ inline void MbCubeTree<Type, Cube, Point, Vector>::GetIntersectObjects( const Po
return; // вне области / out of region
if ( (wMin < (midst + eps)) && (lowerBranch != nullptr) ) {
lowerBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices );
if ( diffPnt ) {
lowerBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices );
}else{
lowerBranch->GetContainsObjects( segmPnt1, eps, itemIndices );
}
}
if ( (wMax > (midst - eps)) && (upperBranch != nullptr) ) {
upperBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices );
if ( diffPnt ) {
upperBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices );
}
else {
upperBranch->GetContainsObjects( segmPnt1, eps, itemIndices );
}
}
if ( (wMax > (lower - eps)) && (wMin < (upper + eps)) && (midstBranch != nullptr) ) {
midstBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices );
if ( diffPnt ) {
midstBranch->GetIntersectObjects( segmPnt1, segmPnt2, eps, itemIndices );
}
else {
midstBranch->GetContainsObjects( segmPnt1, eps, itemIndices );
}
}
}
else if ( isLeaf ) { // содержимое конечной ветви // terminal branch content
if ( !diffPnt ) {
GetContainsObjects( segmPnt1, eps, itemIndices );
return;
}
const Cube segmCube( segmPnt1, segmPnt2, true );
Point objPnt, segmPnt;
+7 -4
View File
@@ -13,11 +13,14 @@
#include <mb_enum.h>
#include <mb_smooth_nurbs_fit_curve.h>
#include <io_define.h>
#include <io_base.h>
#include <mb_cart_point3d.h>
#include <mb_cart_point.h>
#include <templ_s_array.h>
class MATH_CLASS IProgressIndicator;
//------------------------------------------------------------------------------
/** \brief \ru Данные для вычисления шага.
\en Data for step calculation. \~
@@ -171,7 +174,7 @@ public:
/// \ru Вырожденный ли объект? \en Is empty?
bool IsEmpty( double epsilon ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbStepData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbStepData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
}; // MbStepData
@@ -638,7 +641,7 @@ public:
// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsEqual( const MbFairCurveData &, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFairCurveData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFairCurveData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
}; // MbFairCurveData
@@ -703,7 +706,7 @@ public:
// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsEqual( const MbFairCurveMethod & ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFairCurveMethod, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFairCurveMethod, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
}; // MbFairCurveMethod
+2 -1
View File
@@ -580,10 +580,11 @@ enum MbeSurfacePoleType {
*/
//---
enum ElementaryShellType {
et_Undefined = -1, ///< \ru Тип не определен. \en Undefined type.
et_Sphere = 0, ///< \ru Шар (3 точки). \en Sphere (3 points).
et_Torus = 1, ///< \ru Тор (3 точки). \en Torus (3 points).
et_Cylinder = 2, ///< \ru Цилиндр (3 точки). \en Cylinder (3 points).
et_Cone = 3, ///< \ru Конус (3 точки). \en Cone (3 points).
et_Cone = 3, ///< \ru Конус (3 точки, если конус не усеченный, 4 точки, если конус усеченный). \en Cone (3 points, in the case of non-frustum cone, 4 points, in the case of frustum cone).
et_Block = 4, ///< \ru Блок (4 точки). \en Block (4 points).
et_Wedge = 5, ///< \ru Клин (4 точки). \en Wedge (4 points).
et_Prism = 6, ///< \ru Призма (n + 1 точек, n > 2). \en Prism (n + 1 points, n > 2).
+2 -1
View File
@@ -12,6 +12,7 @@
#include <mb_cart_point.h>
#include <io_base.h>
#include <mb_homogeneous.h>
@@ -586,7 +587,7 @@ private:
void CheckRotation() const { ::CheckRotation( *this, flag, true ); }
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbMatrix, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbMatrix, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
DECLARE_NEW_DELETE_CLASS( MbMatrix )
DECLARE_NEW_DELETE_CLASS_EX( MbMatrix )
};
+1 -2
View File
@@ -11,7 +11,6 @@
#define __MB_MATRIX3D_H
#include <io_tape_define.h>
#include <mb_cart_point3d.h>
#include <mb_homogeneous3d.h>
@@ -618,7 +617,7 @@ private:
void CheckScale() const;
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbMatrix3D, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbMatrix3D, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
DECLARE_NEW_DELETE_CLASS( MbMatrix3D )
DECLARE_NEW_DELETE_CLASS_EX( MbMatrix3D )
};
+1 -1
View File
@@ -245,7 +245,7 @@ private:
// \ru Проверить флаг вращения. \en Check rotation flag.
void CheckRotation() const { ::CheckRotation( *this, flag, true ); }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbPlacement, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPlacement, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPlacement )
DECLARE_NEW_DELETE_CLASS_EX( MbPlacement )
};
+1 -1
View File
@@ -501,7 +501,7 @@ private :
// \ru Проверить флаг вращения. \en Check rotation flag.
void CheckRotation() const { ::CheckRotation3D( *this, flag, true ); }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbPlacement3D, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPlacement3D, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPlacement3D )
DECLARE_NEW_DELETE_CLASS_EX( MbPlacement3D )
};
+85 -9
View File
@@ -94,7 +94,10 @@ enum class MbeNumericCharacteristicType
linearDimension, ///< \ru Линейный размер. \en Linear dimension.
angularDimension, ///< \ru Угловой размер. \en Angular dimension.
radialDimension, ///< \ru Радиальный размер. \en Radial dimension.
diameterDimension ///< \ru Диаметральный размер. \en Diameter dimension.
diameterDimension, ///< \ru Диаметральный размер. \en Diameter dimension.
shapeTolerance, ///< \ru Погрешность формы. \en Shape tolerance.
surfaceRoughness, ///< \ru Шероховатость поверхности. \en Surface roughness.
voidNumeric ///< \ru Численное значение игнорируется. \en Numeric characteristics ignored.
};
@@ -493,7 +496,7 @@ class MATH_CLASS MbNumericalCharacteristic final : public MbRefItem, public Tape
std::vector<SPtr<MbCalloutCurve>> m_callouts; ///< \ru Линии выноски. \en Callout lines.
/** \brief \ru Конструктор.
\en Constructor. \~
\en Constructor. \~
\param[in] type - \ru Тип характеристики,
\en Type of characteristics, \~
\param[in] rangeValue - \ru Численные значения,
@@ -506,15 +509,13 @@ public:
/** \brief \ru Сформировать размер.
\en Create annotation item. \~
\en Create annotation item. \~
\param[in] dimensionType - \ru Тип размера,
\en Type of dimension, \~
\param[in] rangeValue - \ru Численные значения,
\en Numerical values, \~
\param[in] baseObject - \ru Один из объектов привязки,
\en One of the objects the dimension is between, \~
\param[in] coObject - \ru Другой из объектов привязки.
\en Another object the dimension is between. \~
\param[in] callouts - \ru Линии-выноски.
\en Callout lines. \~
\return \ru Численное значение линейного размера с объектами привязки.
\en Numerical value of a linear dimension with bind objects. \~
\note \ru В контейнере выносных линий обязательно должна присутствовать размерная линия. Количество проекционных линий:
@@ -523,6 +524,48 @@ public:
\en . \~
*/
static SPtr<MbNumericalCharacteristic> CreateDimension( MbeNumericCharacteristicType dimensionType, MbValueRange && rangeValue, std::vector<SPtr<MbCalloutCurve>> && callouts );
/** \brief \ru Сформировать шероховатость поверхности.
\en Create surface condition. \~
\param[in] rangeValue - \ru Численные значения,
\en Numerical values, \~
\param[in] callouts - \ru Линии-выноски.
\en Callout lines. \~
\return \ru Численное значение линейного размера с объектами привязки.
\en Numerical value of a linear dimension with bind objects. \~
\note \ru В контейнере выносных линий обязательно должна присутствовать размерная линия. Количество проекционных линий:
- В случае линейного, углового или диаметрального размера размера две или ни одной.
- В случае радиального размера ни одной.
\en . \~
*/
static SPtr<MbNumericalCharacteristic> CreateSurfaceRoughness( MbValueRange && rangeValue, std::vector<SPtr<MbCalloutCurve>> && callouts );
/** \brief \ru Сформировать допуск формы.
\en Create shape tolerance. \~
\param[in] rangeValue - \ru Численные значения,
\en Numerical values, \~
\param[in] callouts - \ru Линии-выноски.
\en Callout lines. \~
\return \ru Численное значение линейного размера с объектами привязки.
\en Numerical value of a linear dimension with bind objects. \~
\note \ru В контейнере выносных линий обязательно должна присутствовать размерная линия. Количество проекционных линий:
- В случае линейного, углового или диаметрального размера размера две или ни одной.
- В случае радиального размера ни одной.
\en . \~
*/
static SPtr<MbNumericalCharacteristic> CreateShapeTolerance( MbValueRange && rangeValue, std::vector<SPtr<MbCalloutCurve>> && callouts );
/** \brief \ru Сформировать носитель выносных линий.
\en Create callouts holder. \~
\param[in] callouts - \ru Линии-выноски.
\en Callout lines. \~
\return \ru Численное значение типа "без характеристики".
\en Numerical value of the void type. \~
\note \ru В контейнере выносных линий не должно быть размерных линий.
\en . \~
*/
static SPtr<MbNumericalCharacteristic> CreateCallout( std::vector<SPtr<MbCalloutCurve>> && callouts );
/// \ru Получить тип характеристики. \en Get the type of characteristic.
MbeNumericCharacteristicType GetType() const;
@@ -559,7 +602,14 @@ enum class MbePMIType
{
general = 0, ///< \ru Общего вида. \en General type.
numericalCharacteristic = 1, ///< \ru Численная характеристика. \en Numerical characteristics.
technicalRequiremets = 2 ///< \ru Технические требования. Предназначены для передачи преимущественно текста вне окна модели. \en Technical requirements. Should be used to store mainly text items not to be displaied in the model view.
technicalRequiremets = 2, ///< \ru Технические требования. Предназначены для передачи преимущественно текста вне окна модели. \en Technical requirements. Should be used to store mainly text items not to be displaied in the model view.
callout = 3, ///< \ru Выносной элемент. \en Callout element.
calloutMarking = 4, ///< \ru Выносной элемент - маркировка. \en Marking callout element.
calloutDatum = 5, ///< \ru Выносной элемент - база. \en Datum callout element.
calloutNote = 6, ///< \ru Выносной элемент - заметка. \en Note callout element.
calloutCenterLine = 7, ///< \ru Выносной элемент - центральная линия. \en Center line callout element.
calloutFeatureControlFrame = 8, ///< \ru Выносной элемент - рамка управления характеристиками. \en Feature control frame callout element.
calloutReferencePoint = 9 ///< \ru Выносной элемент - точка отсчёта. \en Reference point callout element.
};
@@ -646,7 +696,33 @@ public:
const MbPlacement3D & plane = MbPlacement3D::global,
const c3d::string_t & pmiName = c3d::string_t(),
const c3d::ItemsSPtrVector & pmiVisual = c3d::ItemsSPtrVector(),
const std::vector<SPtr<MbTextItem>> & pmiText = std::vector<SPtr<MbTextItem>>() );
const std::vector<SPtr<MbTextItem>> & pmiText = std::vector<SPtr<MbTextItem>>() );
/** \brief \ru Создать элемент вида "Выноска".
\en Create annotation item of the "Callout" type. \~
\param[in] calloutSubType - \ru Уточнение типа выноски,
\en Exact callout type, \~
\param[in] calloutStorage - \ru Хранилище выносных линий,
\en Callout lines storage, \~
\param[in] plane - \ru Плоскость для отображения плоских элементов,
\en Plane for planar elements transformation into space, \~
\param[in] pmiName - \ru Название элемента аннотации,
\en Captrion of the annotation element, \~
\param[in] pmiVisual - \ru Геометрические компоненты элемента аннотации,
\en Geometric items ot the annotation element, \~
\param[in] pmiText \ru Текстовые компоненты элемента аннотации.
\en Text items ot the annotation element. \~
\return \ru Возвращает указатель на элемент аннотации, если передаётся хотя бы один
ненулевой текстовый или геометрический элемент, иначе нулевой указатель.
\en Returns pointer to new annotation element if only at least one text or geometric
element is given, otherwise null pointer. \~
*/
static SPtr<MbPMI> CreateCallout ( MbePMIType calloutSubType,
SRef<MbNumericalCharacteristic> calloutStorage,
const MbPlacement3D & plane = MbPlacement3D::global,
const c3d::string_t & pmiName = c3d::string_t(),
const c3d::ItemsSPtrVector & pmiVisual = c3d::ItemsSPtrVector(),
const std::vector<SPtr<MbTextItem>> & pmiText = std::vector<SPtr<MbTextItem>>() );
+4 -4
View File
@@ -954,7 +954,7 @@ public :
// \ru Установить новое значение свойства. \en Set the new value of the property.
void SetPropertyValue( TCHAR * ) override {}
OBVIOUS_PRIVATE_COPY( MathItemProperty<Type> )
OBVIOUS_PRIVATE_COPY( MathItemProperty )
};
@@ -1006,7 +1006,7 @@ public:
// \ru Установить новое значение свойства. \en Set the new value of the property.
void SetPropertyValue( TCHAR * ) override {}
OBVIOUS_PRIVATE_COPY( MathItemCopyProperty<Type> )
OBVIOUS_PRIVATE_COPY( MathItemCopyProperty )
};
@@ -1062,7 +1062,7 @@ public :
// \ru Установить новое значение свойства. \en Set the new value of the property.
void SetPropertyValue( TCHAR * ) override {}
OBVIOUS_PRIVATE_COPY( ConstRefItemProperty<Type> )
OBVIOUS_PRIVATE_COPY( ConstRefItemProperty )
};
//------------------------------------------------------------------------------
@@ -1103,7 +1103,7 @@ public:
: ConstRefItemProperty<Type>( name, initValue, change, n)
{}
OBVIOUS_PRIVATE_COPY( RefItemProperty<Type> )
OBVIOUS_PRIVATE_COPY( RefItemProperty )
};
+2
View File
@@ -169,6 +169,7 @@ enum MbePrompt
IDS_ITEM_0268, ///< \ru Клотоида. \en Clothoid.
IDS_ITEM_0269, ///< \ru Развернутая кривая. \en Unwrapped curve.
IDS_ITEM_0270, ///< \ru Свёрнутая кривая. \en Wrapped curve.
IDS_ITEM_0271, ///< \ru Балочная кривая. \en Beam curve.
// \ru Типы параметрических поверхностей. \en Types of parametric surfaces.
@@ -816,6 +817,7 @@ enum MbePrompt
IDS_PROP_0467, ///< \ru Форма обрезки боков поверхности. \en Shape of cropping the surface sides.
IDS_PROP_0468, ///< \ru Обработка опорных граней. \en Initial faces processing.
IDS_PROP_0469, ///< \ru Разделять оболочку на грани. \en Division the shell into faces.
IDS_PROP_0470, ///< \ru Обрезать опору по касательной. \en Trim the support faces tangentially.
IDS_PROP_0501, ///< \ru Число вершин. \en Number of vertices.
IDS_PROP_0502, ///< \ru Число ребер. \en Number of edges.
+2 -1
View File
@@ -11,6 +11,7 @@
#define __MB_RECT_H
#include <mb_cart_point.h>
#include <templ_s_array.h>
#include <mb_homogeneous.h>
#include <mb_cube_tree.h>
#include <utility>
@@ -323,7 +324,7 @@ public:
/// \ru Получить ссылку на себя. \en Get reference to itself.
const MbRect & GetCube() const { return *this; }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbRect, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbRect, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbRect )
DECLARE_NEW_DELETE_CLASS_EX( MbRect )
}; // MbRect
+1
View File
@@ -18,6 +18,7 @@
#include <mb_cart_point3d.h>
#include <mb_cart_point.h>
#include <templ_sptr.h>
#include <mb_operation_result.h>
#include <vector>
+3 -3
View File
@@ -15,7 +15,7 @@
#define __MB_VECTOR_H
#include <io_tape_define.h>
#include <io_base.h>
#include <mb_enum.h>
@@ -213,7 +213,7 @@ public :
/// \ru Являются ли объекты равными? \en Are the objects equal?
bool IsSame( const MbVector & other, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbVector, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbVector, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbVector )
DECLARE_NEW_DELETE_CLASS_EX( MbVector )
}; // MbVector
@@ -711,7 +711,7 @@ public :
/// \ru Являются ли объекты равными? \en Are the objects equal?
bool IsSame( const MbDirection & other, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbDirection, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbDirection, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbDirection )
DECLARE_NEW_DELETE_CLASS_EX( MbDirection )
}; // MbDirection
+2 -2
View File
@@ -11,7 +11,7 @@
#define __MB_VECTOR3D_H
#include <io_tape_define.h>
#include <io_base.h>
#include <mb_enum.h>
@@ -260,7 +260,7 @@ public :
/// \ru Являются ли объекты равными? \en Are the objects equal?
bool IsSame( const MbVector3D & other, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbVector3D, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbVector3D, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
DECLARE_NEW_DELETE_CLASS( MbVector3D )
DECLARE_NEW_DELETE_CLASS_EX( MbVector3D )
}; // MbVector3D
+2 -2
View File
@@ -94,8 +94,8 @@ public:
/// \ru Являются ли объекты равными? \en Are the objects equal?
bool IsSame( const MbFloatPoint & other, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX(MbFloatPoint, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX(MbFloatPoint, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE(MbFloatPoint, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE(MbFloatPoint, MATH_FUNC_EX);
}; // MbFloatPoint
+5 -6
View File
@@ -9,7 +9,6 @@
#ifndef __MESH_FLOAT_POINT3D_H
#define __MESH_FLOAT_POINT3D_H
#include <io_tape_define.h>
#include <mb_axis3d.h>
@@ -138,8 +137,8 @@ public:
/** \} */
DECLARE_NEW_DELETE_CLASS( MbFloatPoint3D )
DECLARE_NEW_DELETE_CLASS_EX( MbFloatPoint3D )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX(MbFloatPoint3D, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX(MbFloatPoint3D, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE(MbFloatPoint3D, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE(MbFloatPoint3D, MATH_FUNC_EX);
}; // MbFloatPoint3D
@@ -260,8 +259,8 @@ public:
/** \} */
DECLARE_NEW_DELETE_CLASS( MbFloatVector3D )
DECLARE_NEW_DELETE_CLASS_EX( MbFloatVector3D )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX(MbFloatVector3D, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX(MbFloatVector3D, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE(MbFloatVector3D, MATH_FUNC_EX);
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE(MbFloatVector3D, MATH_FUNC_EX);
}; // MbFloatVector3D
@@ -351,7 +350,7 @@ public :
/// \ru Дать пространственную точку по параметру на оси. \en Get the space point by a parameter on axis.
void PointOn( const float & t, MbFloatPoint3D & p ) const { p.Set( origin, axisZ, t ); }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFloatAxis3D, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFloatAxis3D, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbFloatAxis3D )
DECLARE_NEW_DELETE_CLASS_EX( MbFloatAxis3D )
}; // MbFloatAxis3D
+5 -5
View File
@@ -1,4 +1,4 @@
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Tриангуляция.
@@ -283,8 +283,8 @@ private :
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
void operator = ( const MbExactGrid & );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbExactGrid, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbExactGrid, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbExactGrid, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbExactGrid, MATH_FUNC_EX );
}; // MbExactGrid
@@ -548,8 +548,8 @@ private :
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
void operator = ( const MbFloatGrid & );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFloatGrid, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbFloatGrid, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFloatGrid, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbFloatGrid, MATH_FUNC_EX );
}; // MbFloatGrid
+6 -6
View File
@@ -12,7 +12,7 @@
#include <templ_s_array.h>
#include <io_tape_define.h>
#include <io_base.h>
#include <mesh_primitive.h>
#include <mesh_float_point3d.h>
#include <mesh_float_point.h>
@@ -144,8 +144,8 @@ private :
DECLARE_NEW_DELETE_CLASS( MbExactPolygon3D )
DECLARE_NEW_DELETE_CLASS_EX( MbExactPolygon3D )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbExactPolygon3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbExactPolygon3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbExactPolygon3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbExactPolygon3D, MATH_FUNC_EX );
}; // MbExactPolygon3D
@@ -271,8 +271,8 @@ private :
DECLARE_NEW_DELETE_CLASS( MbFloatPolygon3D )
DECLARE_NEW_DELETE_CLASS_EX( MbFloatPolygon3D )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFloatPolygon3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbFloatPolygon3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFloatPolygon3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbFloatPolygon3D, MATH_FUNC_EX );
}; // MbFloatPolygon3D
@@ -382,7 +382,7 @@ private:
// \ru Сбросить временные данные. \en Reset temporary data.
void ResetMutable() const;
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbPolygon, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbPolygon, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPolygon )
DECLARE_NEW_DELETE_CLASS_EX( MbPolygon )
};
+4 -4
View File
@@ -424,8 +424,8 @@ private:
DECLARE_NEW_DELETE_CLASS( MbExactApex3D )
DECLARE_NEW_DELETE_CLASS_EX( MbExactApex3D )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbExactApex3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbExactApex3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbExactApex3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbExactApex3D, MATH_FUNC_EX );
}; // MbExactApex3D
@@ -490,8 +490,8 @@ private:
DECLARE_NEW_DELETE_CLASS( MbFloatApex3D )
DECLARE_NEW_DELETE_CLASS_EX( MbFloatApex3D )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFloatApex3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbFloatApex3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFloatApex3D, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbFloatApex3D, MATH_FUNC_EX );
}; // MbFloatApex3D
+10 -10
View File
@@ -135,8 +135,8 @@ public :
/// \ru Записать свойства объекта. \en Set properties of the object.
void SetProperties( const MbProperties & properties );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbTriangle, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbTriangle, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbTriangle, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbTriangle, MATH_FUNC_EX );
}; // MbTriangle
@@ -276,8 +276,8 @@ public :
/// \ru Записать свойства объекта. \en Set properties of the object.
void SetProperties( const MbProperties &properties );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbQuadrangle, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbQuadrangle, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbQuadrangle, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbQuadrangle, MATH_FUNC_EX );
}; // MbQuadrangle
@@ -381,8 +381,8 @@ public :
/// \ru Записать свойства объекта. \en Set properties of the object.
void SetProperties( const MbProperties &properties );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbElement, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbElement, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbElement, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbElement, MATH_FUNC_EX );
}; // MbElement
@@ -478,8 +478,8 @@ public:
/// \ru Есть ли такой индекс в цикле? \en Is exist index n in the loop?
bool IsExist( uint n ) const { return ( std::find(pIndices.begin(), pIndices.end(), n) != pIndices.end() ); }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbGridLoop, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbGridLoop, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbGridLoop, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbGridLoop, MATH_FUNC_EX );
OBVIOUS_PRIVATE_COPY( MbGridLoop )
};
@@ -508,8 +508,8 @@ public:
/// \ru Выдать индекс треугольника сегмента. \en Get the index of segment triangle.
size_t GetFace( size_t idx ) const { return faces[idx]; }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbGridSegment, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbGridSegment, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbGridSegment, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbGridSegment, MATH_FUNC_EX );
};
#endif // __MESH_TRIANGLE_H
+2 -2
View File
@@ -231,7 +231,7 @@ private:
/// \ru Оператор присваивания. \en Assignment operator.
void operator = ( const StMLTipParams & );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( StMLTipParams, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( StMLTipParams, MATH_FUNC_EX )
}; // StMLTipParams
@@ -377,7 +377,7 @@ protected:
/** \} */
private:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( StVertexOfMultilineInfo, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( StVertexOfMultilineInfo, MATH_FUNC_EX )
}; // StVertexOfMultilineInfo
+2 -2
View File
@@ -11,7 +11,7 @@
#define __NAME_FLAGS_H
#include <io_tape_define.h>
#include <io_base.h>
#include <math_define.h>
@@ -38,7 +38,7 @@ public:
/// \ru Получить все битовые флаги. \en Get all bit-flags.
uint8 GetFlags() const { return flags; }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFlags, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFlags, MATH_FUNC_EX )
};
+2 -3
View File
@@ -15,14 +15,13 @@
#include <templ_s_array_rw.h>
#include <templ_css_array.h>
#include <reference_item.h>
#include <io_tape_define.h>
#include <io_base.h>
#include <hash32.h>
#include <mb_enum.h>
#include <name_version.h>
#include <name_flags.h>
#include <templ_lis_array.h>
#include <system_atomic.h>
#include <memory>
#include <vector>
#include <set>
@@ -624,7 +623,7 @@ public:
friend MATH_FUNC (int) MbDefNameCompare ( const MbName & n1, const MbName & n2 );
friend MATH_FUNC (int) MbMemDefNameCompare( const MbName & n1, const MbName & n2 );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbName, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For treatment of references and objects of the class
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbName, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For treatment of references and objects of the class
};
+14
View File
@@ -44,6 +44,20 @@ public:
const VersionContainer & GetVersionContainer() const { return m_ver; }
/// \ru Оператор получения математической версии. \en Operator for obtaining a mathematical version.
operator VERSION () const { return m_ver.GetMathVersion(); }
/// \ru Оператор равенства. \en An equality operator.
bool operator == ( const MbNameVersion & v ) const { return (v.GetVersionContainer().GetMathVersion() == m_ver.GetMathVersion()); }
/// \ru Оператор неравенства. \en Inequality operator.
bool operator != ( const MbNameVersion & v ) const { return (v.GetVersionContainer().GetMathVersion() != m_ver.GetMathVersion()); }
/// \ru Оператор больше.const MbNameVersion & \en "Greater than" operator.
bool operator > ( const MbNameVersion & v ) const { return (v.GetVersionContainer().GetMathVersion() < m_ver.GetMathVersion()); }
/// \ru Оператор больше или равно. \en "Greater than or equal to" operator.
bool operator >= ( const MbNameVersion & v ) const { return (v.GetVersionContainer().GetMathVersion() <= m_ver.GetMathVersion()); }
/// \ru Оператор меньше. \en "Less than" operator.
bool operator < ( const MbNameVersion & v ) const { return (v.GetVersionContainer().GetMathVersion() > m_ver.GetMathVersion()); }
/// \ru Оператор меньше или равно. \en "Less than or equal to" operator.
bool operator <= ( const MbNameVersion & v ) const { return (v.GetVersionContainer().GetMathVersion() >= m_ver.GetMathVersion()); }
/// \ru Оператор равенства. \en An equality operator.
bool operator == ( VERSION v ) const { return (v == m_ver.GetMathVersion()); }
/// \ru Оператор неравенства. \en Inequality operator.
+139 -4
View File
@@ -449,6 +449,141 @@ OBVIOUS_PRIVATE_COPY( MbIntCurveParams )
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры кривых пересечения граней двух оболочек.
\en Parameters for intersection of curves of two shells faces. \~
\details \ru Параметры кривых пересечения граней двух оболочек. \n
\en Parameters for intersection of curves of two shells faces. \n \~
\ingroup Curve3D_Building_Parameters
*/ // ---
class MATH_CLASS MbIntCurveShellParams : public MbIntCurveParams {
private:
c3d::IndicesVector _faces1; ///< \ru Номера граней в первой оболочке. \en The numbers of faces in the first shell.
c3d::IndicesVector _faces2; ///< \ru Номера граней во второй оболочке. \en The numbers of faces in the second shell.
bool _same1; ///< \ru Использовать ли тот же журнал построителей первого тела. \en Flag whether to use the same creators of the first body.
bool _same2; ///< \ru Использовать ли тот же журнал построителей второго тела. \en Flag whether to use the same creators of the second body.
bool _useCreators; ///< \ru Использовать ли построители. \en Flag of using creators.
public:
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\details \ru Конструктор по номерам граней с использованием построителей и установкой параметров объединения и разрезания кривых.
\en Constructor by faces numbers with use of creators and definition of curves merge and cut parameters. \~
\param[in] faceIndices1 - \ru Номера граней в первой оболочке.
\en The numbers of faces in the first shell. \~
\param[in] same1 - \ru Использовать ли тот же журнал построителей первого тела или сделать копию.
\en Flag whether to use the same creators of the first body or make a copy. \~
\param[in] faceIndices2 - \ru Номера граней во второй оболочке.
\en The numbers of faces in the second shell. \~
\param[in] same2 - \ru Использовать ли тот же самый журнал построителей второго тела или сделать копию.
\en Flag whether to use the same creators of the second body or make a copy. \~
\param[in] mergeCrvs - \ru Объединять кривые, разрезанные швом.
\en Merge curves cut by a surface seam. \~
\param[in] cutCrvs - \ru Разрезать кривые в точках пересечения.
\en Cut curves at intersection points. \~
\param[in] _snMaker - \ru Именователь с версией операции.
\en Names maker with operation version. \~
*/
MbIntCurveShellParams( const c3d::IndicesVector & faceIndices1, bool same1,
const c3d::IndicesVector & faceIndices2, bool same2,
bool mergeCrvs, bool cutCrvs,
const MbSNameMaker & snMaker )
: MbIntCurveParams( mergeCrvs, cutCrvs, snMaker )
, _faces1 ( faceIndices1 )
, _same1 ( same1 )
, _faces2 ( faceIndices2 )
, _same2 ( same2 )
, _useCreators( true ) {}
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\details \ru Конструктор по номерам граней с использованием построителей.
\en Constructor by faces numbers with use of creators. \~
\param[in] faceIndices1 - \ru Номера граней в первой оболочке.
\en The numbers of faces in the first shell. \~
\param[in] same1 - \ru Использовать ли тот же журнал построителей первого тела или сделать копию.
\en Flag whether to use the same creators of the first body or make a copy. \~
\param[in] faceIndices2 - \ru Номера граней во второй оболочке.
\en The numbers of faces in the second shell. \~
\param[in] same2 - \ru Использовать ли тот же самый журнал построителей второго тела или сделать копию.
\en Flag whether to use the same creators of the second body or make a copy. \~
\param[in] _snMaker - \ru Именователь с версией операции.
\en Names maker with operation version. \~
*/
MbIntCurveShellParams( const c3d::IndicesVector & faceIndices1, bool same1,
const c3d::IndicesVector & faceIndices2, bool same2,
const MbSNameMaker & snMaker )
: MbIntCurveParams( snMaker )
, _faces1 ( faceIndices1 )
, _same1 ( same1 )
, _faces2 ( faceIndices2 )
, _same2 ( same2 )
, _useCreators( true ) {}
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\details \ru Конструктор по номерам граней с установкой параметров объединения и разрезания кривых.
\en Constructor by faces numbers with definition of curves merge and cut parameters. \~
\param[in] faceIndices1 - \ru Номера граней в первой оболочке.
\en The numbers of faces in the first shell. \~
\param[in] faceIndices2 - \ru Номера граней во второй оболочке.
\en The numbers of faces in the second shell. \~
\param[in] mergeCrvs - \ru Объединять кривые, разрезанные швом.
\en Merge curves cut by a surface seam. \~
\param[in] cutCrvs - \ru Разрезать кривые в точках пересечения.
\en Cut curves at intersection points. \~
\param[in] _snMaker - \ru Именователь с версией операции.
\en Names maker with operation version. \~
*/
MbIntCurveShellParams( const c3d::IndicesVector & faceIndices1,
const c3d::IndicesVector & faceIndices2,
bool mergeCrvs, bool cutCrvs,
const MbSNameMaker & snMaker )
: MbIntCurveParams( mergeCrvs, cutCrvs, snMaker )
, _faces1 ( faceIndices1 )
, _same1 ( false )
, _faces2 ( faceIndices2 )
, _same2 ( false )
, _useCreators( false ) {}
/** \brief \ru Конструктор по параметрам.
\en Constructor by parameter \~
\details \ru Конструктор по номерам граней.
\en Constructor by faces numbers. \~
\param[in] faceIndices1 - \ru Номера граней в первой оболочке.
\en The numbers of faces in the first shell. \~
\param[in] faceIndices2 - \ru Номера граней во второй оболочке.
\en The numbers of faces in the second shell. \~
\param[in] _snMaker - \ru Именователь с версией операции.
\en Names maker with operation version. \~
*/
MbIntCurveShellParams( const c3d::IndicesVector & faceIndices1,
const c3d::IndicesVector & faceIndices2,
const MbSNameMaker & snMaker )
: MbIntCurveParams( snMaker )
, _faces1 ( faceIndices1 )
, _same1 ( false )
, _faces2 ( faceIndices2 )
, _same2 ( false )
, _useCreators( false ) {}
/// \ru Получить номера граней в первой оболочке. \en Get the numbers of faces in the first shell.
const c3d::IndicesVector & GetFaceIndices1() const { return _faces1; }
/// \ru Получить номера граней во второй оболочке. \en Get the numbers of faces in the second shell.
const c3d::IndicesVector & GetFaceIndices2() const { return _faces2; }
/// \ru Получить флаг использования того же журнал построителей для первого тела. \en Get the flag of using the same creators for the first body.
bool Same1() const { return _same1; }
/// \ru Получить флаг использования того же журнал построителей для второго тела. \en Get the flag of using the same creators for the second body.
bool Same2() const { return _same2; }
/// \ru Получить флаг использования построителей. \en Get the flag of using creators.
bool UseCreators() const { return _same2; }
OBVIOUS_PRIVATE_COPY( MbIntCurveShellParams )
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты кривой пересечения поверхностей.
\en Results of the surface intersection curve creation. \~
@@ -1327,7 +1462,7 @@ public:
\en Create a copy of the surface. \~
*/
MbCurvesWrappingParams( const MbCurvesWrappingParams & other, bool copyCurves, bool copySurface, MbRegDuplicate * iReg = nullptr );
// \ru Конструктор для чтения. \en Constructor for reading.
/// \ru Конструктор для чтения. \en Constructor for reading.
MbCurvesWrappingParams( TapeInit tapeInit );
/// \ru Деструктор. \ en Destructor.
~MbCurvesWrappingParams() {}
@@ -1599,7 +1734,7 @@ public:
// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsEqual( const MbFairCreateData &, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFairCreateData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFairCreateData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
}; // MbFairCreateData
@@ -1653,7 +1788,7 @@ public:
// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsEqual( const MbFairFilletData &, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFairFilletData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFairFilletData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
}; // MbFairFilletData
@@ -1710,7 +1845,7 @@ public:
// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsEqual( const MbFairChangeData &, double accuracy ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbFairChangeData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbFairChangeData, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
}; // MbFairChangeData
+404
View File
@@ -738,4 +738,408 @@ public:
/// \ru Получить максимальное количество итераций. \en Get the maximum iteration count. \~
size_t GetIterationMax() const { return _iterationMax; }
}; // MbObjectAlignmentParams
//------------------------------------------------------------------------------
/** \brief \ru Тип позиционного ограничения.
\en Position constraint type. \~
\details \ru Тип позиционного ограничения.
Определяет вариант фиксации положения объекта в пространстве.
Можно ограничить перемещения вдоль и повороты вокруг координатных осей некоторой локальной системы координат в разных комбинациях.
\en Position constraint type.
Defines the method of fixing the position of an object.
There may be different combinations of restrictions to translation along or rotation about the axes of a local coordinate system. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
enum class MbePositionConstraintType
{
z, ///< \ru Разрешен только сдвиг вдоль оси OZ плейсмента параметров. \en Translation along the OZ axis of a local coordinate system is only allowed.
w, ///< \ru Разрешен только поворот вокруг оси OZ плейсмента параметров. \en Rotation about the OZ axis of a local coordinate system is only allowed.
zw, ///< \ru Разрешен только сдвиг вдоль оси OZ и поворот вокруг оси OZ плейсмента параметров. \en Translation along the OZ axis and rotation about the OZ axis of a local coordinate system are only allowed.
xyz, ///< \ru Разрешен только параллельный перенос (запрещены повороты вокруг координатных осей плейсмента параметров). \en Translation is only allowed (any rotation is forbidden).
xyw, ///< \ru Разрешен только параллельный перенос вдоль осей OX и OY и поворот вокруг оси OZ плейсмента параметров. \en Translation along the OX и OY axes and rotation about the OZ axis of a local coordinate system are only allowed.
xyzw, ///< \ru Разрешен параллельный перенос вдоль координатных осей и поворот вокруг оси OZ плейсмента параметров. \en Translation along the coordinate axes and rotation about the OZ axis of a local coordinate system are only allowed.
uvw, ///< \ru Разрешен только поворот вокруг координатных осей плейсмента параметров (запрещен любой параллельный перенос). \en Rotation is only allowed (any translation is forbidden).
free, ///< \ru Без ограничений. \en Without constraints.
};
//------------------------------------------------------------------------------
/** \brief \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\details \ru Тип размерного ограничения.
Определяет вариант фиксации размеров объекта.
Можно зафиксировать радиус сферы, радиус цилиндра, уклон конуса, большой и малый радиусы тора (только один их них или сразу оба).
\en Dimensional constraint type.
Defines the method of fixing dimensional parameters of an object.
There may be fixed the radius of a sphere, the radius of a cylinder, the conicity angle of a cone, the major radius and the minor radius of a torus (one or both of them). \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
enum class MbeDimensionalConstraintType
{
none, ///< \ru Без ограничений. \en Without constraints.
first, ///< \ru Зафиксирован только первый размерный параметр объекта. \en The first dimensional parameter of an object is only fixed.
second, ///< \ru Зафиксирован только второй размерный параметр объекта (корректно только для тора). \en The second dimensional parameter of an object is only fixed (only valid for a torus).
both, ///< \ru Зафиксированы оба размерных параметра объекта (корректно только для тора). \en Both dimensional parameters of an object are fixed (only valid for a torus).
};
//------------------------------------------------------------------------------
/** \brief \ru Фиксированные значения параметров поверхности.
\en Fixed values of surface parameters. \~
\details \ru Фиксированные значения параметров поверхности:
- координаты x и y некоторой точки на оси объекта (невалидно для сферы и плоскости),
- координаты центра сферы,
- азимутальный угол (_phi): угол между проекцией оси объекта на плоскость OXY
и осью OX некоторой системы координат, принадлежит промежутку [0; 2П) (невалидно для сферы),
- зенитный угол (_theta): угол между осью объекта и осью OZ некоторой
системы координат, принадлежит отрезку [0; П/2] (невалидно для сферы),
- расстояние (_dist) от оси объекта до оси OZ некоторой системы координат (невалидно для сферы),
- расстояние (_dist) от центра сферы до начала координат некоторой системы,
- радиус сферы (_size1),
- радиус цилиндра (_size1),
- уклон конуса (_size1),
- большой (_size1) или малый (_size2) радиусы тора (только один их них или сразу оба).
\en Fixed values of surface parameters:
- the X and Y coordinates of a point of an object's axis (invalid for a sphere and a plane),
- coordinates of a sphere's center,
- azimuthal angle (_phi): the angle between the projection of an object's axis onto the OXY plane
and the OX axis of a coordinate system, belongs to [0; 2П) (invalid for a sphere),
- zenith angle (_theta): the angle between an object's axis and the OZ axis
of a coordinate system, belongs to [0; П/2] (invalid for a sphere),
- the distance (_dist) between an object's axis and the OZ axis of a coordinate system (invalid for a sphere),
- the distance (_dist) between a sphere's center and the origin of a coordinate system,
- the radius of a sphere (_size1),
- the radius of a cylinder (_size1),
- the conicity angle of a cone (_size1),
- the major radius (_size1) or the minor radius (_size2) of a torus (one or both of them). \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
struct MATH_CLASS MbConstraintFixedValues
{
public:
/** \ru \name Позиционные параметры.
\en \name Position parameters.
\{ */
double _x; ///< \ru Координата x точки на оси (для сферы - ее центра). \en The X coordinate of an axis point (for a sphere - of its center).
double _y; ///< \ru Координата y точки на оси (для сферы - ее центра). \en The Y coordinate of an axis point (for a sphere - of its center).
double _z; ///< \ru Координата z точки на оси (для сферы - ее центра). \en The Z coordinate of an axis point (for a sphere - of its center).
double _phi; ///< \ru Азимутальный угол (невалидно для сферы). \en Azimuthal angle (invalid for a sphere).
double _theta; ///< \ru Зенитный угол (невалидно для сферы). \en Zenith angle (invalid for a sphere).
double _dist; ///< \ru Расстояние от оси объекта до оси OZ некоторой СК (для сферы - от ее центра до начала СК). \en The distance between an object's axis and the OZ axis in a CS (for a sphere - between its center and the origin of a CS).
/** \} */
/** \ru \name Размерные параметры.
\en \name Dimensional parameters.
\{ */
double _size1; ///< \ru Первый размерный параметр объекта (невалидно для плоскости). \en The first dimensional parameter of an object (invalid for a plane).
double _size2; ///< \ru Второй размерный параметр объекта (валидно только для тора). \en The second dimensional parameter of an object (only valid for a torus).
/** \} */
public:
/// \ru Конструктор по умолчанию. \en Default constructor. \~
MbConstraintFixedValues()
: _x ( UNDEFINED_DBL )
, _y ( UNDEFINED_DBL )
, _z ( UNDEFINED_DBL )
, _phi ( UNDEFINED_DBL )
, _theta( UNDEFINED_DBL )
, _dist ( UNDEFINED_DBL )
, _size1( UNDEFINED_DBL )
, _size2( UNDEFINED_DBL )
{}
};
//------------------------------------------------------------------------------
/** \brief \ru Ограничение на вписывание примитива.
\en Constraint for primitive fitting. \~
\details \ru Ограничение на вписывание примитива.
Позиционное ограничение действует в заданной локальной системе координат.
Фиксированные значения для позиционных и размерных параметров заданы структурой.
\en Constraint for primitive fitting.
Position constraint operates in a given local coordinate system.
Fixed values for position and dimensional parameters are given by a structure. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbSurfaceFitConstraint
{
private:
MbePositionConstraintType _typePos; ///< \ru Тип позиционного ограничения. \en Position constraint type.
MbeDimensionalConstraintType _typeDim; ///< \ru Тип размерного ограничения. \en Dimensional constraint type.
MbConstraintFixedValues _fixedValues; ///< \ru Фиксированные значения параметров поверхности. \en Fixed values of surface parameters.
MbPlacement3D _place; ///< \ru Локальная система координат. \en Local coordinate system.
public:
/// \ru Конструктор по умолчанию. \en Default constructor. \~
MbSurfaceFitConstraint();
public:
/** \ru \name Позиционные ограничения.
\en \name Position constraints.
\{ */
/** \brief \ru Ограничить ось примитива.
\en Add an axis constraint. \~
\details \ru Ограничить ось цилиндра, конуса или тора, а также нормаль плоскости.
По умолчанию ось примитива или нормаль плоскости будет коллинеарна направлению direction.
Дополнительно можно задать желаемый угол angle между осью примитива или нормалью плоскости и заданным направлением из промежутка [0; П/2].
Для построения плоскости с нормалью, которая перпендикулярна заданному направлению, необходимо задать угол П/2.
Функция сбрасывает выставленные ранее ограничения на ось.
\en Add an axis constraint to a cylinder, cone, torus or plane.
The axis of a primitive or plane normal will be collinear to a given direction by default.
Besides there may be given a desired angle between the axis of a primitive or plane normal and a given direction from [0; П/2].
Fitting a plane with a normal, which is perpendicular to a given direction, implies an angle П/2.
The function resets all previous axis constraints. \~
\param[in] direction - \ru Эталонное направление.
\en Reference direction. \~
\param[in] angle - \ru Угол между осью примитива и заданным направлением.
\en Angle between the axis of a primitive and a given direction. \~
\return \ru Возвращает true, если задан корректный угол, и false - иначе.
\en Returns true, if an angle is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddAxisConstraint( const MbVector3D & direction, double angle = 0. );
/** \brief \ru Зафиксировать ось примитива.
\en Add a coaxial constraint. \~
\details \ru Зафиксировать ось цилиндра, конуса, тора или сферы.
Вписывается примитив с заданной осью.
Если вписывается сфера, ее центр лежит на заданной оси.
Функция сбрасывает выставленные ранее ограничения на ось.
\en Add a coaxial constraint to a cylinder, cone, torus or sphere.
A primitive will be fit with a given axis.
If a sphere is fit, its center lies on a given axis.
The function resets all previous axis constraints. \~
\param[in] axis - \ru Ось.
\en Axis. \~
\ingroup Polygonal_Objects
*/
void AddCoaxialConstraint( const MbAxis3D & axis );
/** \} */
/** \ru \name Размерные ограничения.
\en \name Dimensional constraints.
\{ */
/** \brief \ru Зафиксировать радиус цилиндра.
\en Fix cylinder radius. \~
\details \ru Зафиксировать радиус цилиндра.
Радиус должен быть положительным.
\en Fix cylinder radius.
The value has to be positive. \~
\param[in] radius - \ru Радиус цилиндра.
\en Cylinder radius. \~
\return \ru Возвращает true, если задан корректный радиус, и false - иначе.
\en Returns true, if a radius is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddCylinderRadiusConstraint( double radius );
/** \brief \ru Зафиксировать радиус сферы.
\en Fix sphere radius. \~
\details \ru Зафиксировать радиус сферы.
Радиус должен быть положительным.
\en Fix sphere radius.
The value has to be positive. \~
\param[in] radius - \ru Радиус сферы.
\en Sphere radius. \~
\return \ru Возвращает true, если задан корректный радиус, и false - иначе.
\en Returns true, if a radius is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddSphereRadiusConstraint( double radius );
/** \brief \ru Зафиксировать угол конуса.
\en Fix cone angle. \~
\details \ru Зафиксировать угол конуса.
Угол должен быть из промежутка (0; П/2).
\en Fix cone angle.
The angle has to be from (0; П/2). \~
\param[in] angle - \ru Угол конуса.
\en Cone angle. \~
\return \ru Возвращает true, если задан корректный угол, и false - иначе.
\en Returns true, if an angle is correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddConeAngleConstraint( double angle );
/** \brief \ru Зафиксировать радиусы тора.
\en Fix torus radii. \~
\details \ru Зафиксировать радиусы тора.
Можно зафиксировать большой и малый радиусы тора (только один их них или сразу оба).
Значения должны быть положительными (=0 - значение не зафиксировано).
\en Fix torus radii.
There may be fixed the major radius (_size1) or the minor radius (_size2) of a torus (one or both of them).
The values have to be positive (=0 - value is not fixed). \~
\param[in] majorRadius - \ru Большой радиус тора.
\en Major torus radius. \~
\param[in] minorRadius - \ru Малый радиус тора.
\en Minor torus radius. \~
\return \ru Возвращает true, если заданы корректные радиусы, и false - иначе.
\en Returns true, if radii are correct, or false otherwise. \~
\ingroup Polygonal_Objects
*/
bool AddTorusRadiiConstraint( double majorRadius, double minorRadius );
/** \} */
/** \brief \ru Инициализировать ограничение типа XYW (при условии валидности).
\en Initialize the XYW-constraint (in case of validity). \~
\details \ru Инициализировать ограничение типа XYW.
Ограничение типа XYW допускает только параллельный перенос вдоль осей OX и OY и поворот вокруг оси OZ заданной системы координат.
Для плоскости, цилиндра, конуса или тора должен быть зафиксирован зенитный угол theta:
угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2].
Для сферы должна быть зафиксирована координата z ее центра в заданной СК.
Для тора должна быть зафиксирована координата z центра его направляющей окружности в заданной СК.
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Initialize the XYW-constraint.
Translation along the OX и OY axes and rotation about the OZ axis of a local coordinate system are only allowed.
For a plane, a cylinder, a cone or a torus there has to be fixed the zenith angle theta:
the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2].
For a sphere there has to be fixed the Z coordinate of its center.
For a torus there has to be fixed the Z coordinate of its directrix circle.
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType InitializeXYW( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place );
/** \brief \ru Инициализировать ограничение типа Z (при условии валидности).
\en Initialize the Z-constraint (in case of validity). \~
\details \ru Инициализировать ограничение типа Z.
Ограничение типа Z допускает только сдвиг вдоль оси OZ заданной системы координат.
Для плоскости, цилиндра, конуса или тора должны быть зафиксированы:
- зенитный угол theta: угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2],
- азимутальный угол phi: угол между проекцией оси объекта на плоскость OXY и осью OX заданной СК,
должен принадлежать промежутку [0; 2П).
Для цилиндра, конуса или тора должны быть зафиксированы координаты x и y некоторой точки на оси объекта.
Для сферы должны быть зафиксированы координаты x и y ее центра в заданной СК.
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Initialize the Z-constraint.
Translation along the OZ axis of a local coordinate system is only allowed.
For a plane, a cylinder, a cone or a torus there have to be fixed:
- the zenith angle theta: the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2],
- the azimuthal angle phi: the angle between the projection of an object's axis onto the OXY plane
and the OX axis of a given CS, has to belong to [0; 2П).
For a cylinder, a cone or a torus there have to be fixed the X and Y coordinates of a point of an object's axis.
For a sphere there have to be fixed the X and Y coordinates of its center.
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType InitializeZ( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place );
/** \brief \ru Инициализировать ограничение типа XYZ (при условии валидности).
\en Initialize the XYZ-constraint (in case of validity). \~
\details \ru Инициализировать ограничение типа XYZ.
Ограничение типа XYZ допускает только параллельный перенос (запрещены повороты вокруг координатных осей заданной системы координат).
Для плоскости, цилиндра, конуса или тора должны быть зафиксированы:
- зенитный угол theta: угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2],
- азимутальный угол phi: угол между проекцией оси объекта на плоскость OXY и осью OX заданной СК,
должен принадлежать промежутку [0; 2П).
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Initialize the XYZ-constraint.
Translation is only allowed (any rotation is forbidden).
For a plane, a cylinder, a cone or a torus there have to be fixed:
- the zenith angle theta: the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2],
- the azimuthal angle phi: the angle between the projection of an object's axis onto the OXY plane
and the OX axis of a given CS, has to belong to [0; 2П).
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType InitializeXYZ( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place );
/** \brief \ru Инициализировать ограничение типа ZW (при условии валидности).
\en Initialize the ZW-constraint (in case of validity). \~
\details \ru Инициализировать ограничение типа ZW.
Ограничение типа ZW допускает только сдвиг вдоль оси OZ и поворот вокруг оси OZ заданной системы координат.
Для плоскости, цилиндра, конуса или тора должны быть зафиксированы:
- зенитный угол theta: угол между осью объекта и осью OZ заданной СК, должен принадлежать отрезку [0; П/2],
- начальный азимутальный угол phi: угол между проекцией оси объекта в начальной позиции на плоскость OXY и осью OX заданной СК,
должен принадлежать промежутку [0; 2П),
- расстояние dist от оси OZ заданной СК до оси объекта.
Для cферы должно быть зафиксировано расстояние dist от ее центра до оси OZ заданной СК.
При необходимости можно зафиксировать размерные параметры объекта.
Функция сбрасывает выставленные ранее ограничения (например, добавленные с помощью методов "Add*Constraint").
\en Initialize the ZW-constraint.
Translation along the OZ axis and rotation about the OZ axis of a local coordinate system are only allowed.
For a plane, a cylinder, a cone or a torus there have to be fixed:
- the zenith angle theta: the angle between an object's axis and the OZ axis of a given CS, has to belong to [0; П/2],
- the initial azimuthal angle phi: the angle between the projection of an object's axis in the initial position onto the OXY plane
and the OX axis of a given CS, has to belong to [0; 2П),
- the distance between an object's axis the OZ axis of a given CS.
For a sphere there has to be fixed the distance between its center and the OZ axis of a given CS.
There may be fixed some dimensional parameters of an object if necessary.
The function resets all previous constraints (for example, having been set by "Add*Constraint"). \~
\param[in] typeSurface - \ru Тип поверхности.
\en Surface type. \~
\param[in] typeDim - \ru Тип размерного ограничения.
\en Dimensional constraint type. \~
\param[in] fixedValues - \ru Фиксированные значения параметров поверхности.
\en Structure with fixed values of surface parameters. \~
\param[in] place - \ru Локальная система координат.
\en Local coordinate system. \~
\return \ru Возвращает код результата операции.
\en Returns operation result code. \~
\ingroup Polygonal_Objects
*/
MbResultType InitializeZW( MbeSpaceType typeSurface,
MbeDimensionalConstraintType typeDim,
const MbConstraintFixedValues & fixedValues,
const MbPlacement3D & place );
/// \ru Получить тип позиционного ограничения. \en Get the position constraint type. \~
MbePositionConstraintType GetPosType() const { return _typePos; }
/// \ru Получить тип размерного ограничения. \en Get the dimensional constraint type. \~
MbeDimensionalConstraintType GetDimType() const { return _typeDim; }
/// \ru Получить структуру фиксированных значений параметров поверхности. \en Get the structure with fixed values of surface parameters. \~
const MbConstraintFixedValues & GetFixedValues() const { return _fixedValues; }
/// \ru Получить локальную систему координат. \en Get the local coordinate system. \~
const MbPlacement3D & GetPlacement() const { return _place; }
/// \ru Проверить ограничение на пустоту. \en Check whether the constraint is empty. \~
bool IsEmpty() const;
/// \ru Установить пустое ограничение. \en Set empty constraint. \~
void SetEmpty();
OBVIOUS_PRIVATE_COPY( MbSurfaceFitConstraint );
};
#endif // __OP_MESH_PARAMETERS_H
+311 -55
View File
@@ -25,10 +25,13 @@
class MATH_CLASS MbPoint3D;
class MATH_CLASS MbPolyCurve3D;
class MATH_CLASS MbPolyline3D;
class MATH_CLASS MbCurveBoundedSurface;
class MATH_CLASS MbBeamCreator;
class MbRegTransform;
class MbRegDuplicate;
class MATH_CLASS IProgressIndicator;
//------------------------------------------------------------------------------
/** \brief \ru Параметры скругления или фаски ребра.
\en Parameters of fillet or chamfer of edge. \~
@@ -126,7 +129,6 @@ public:
}
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по параметрам.
@@ -909,6 +911,8 @@ KNOWN_OBJECTS_RW_REF_OPERATORS( FastenersValues ) // \ru Для работы с
class MbPatchCurveMating;
//------------------------------------------------------------------------------
/** \brief \ru Сопряжение по кривой заплатки.
\en Patch curve conjugation. \~
@@ -1786,7 +1790,7 @@ private:
void SetCloudPlane( MbPlane * );
bool CreateOwnCloudPlane();
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( NurbsSurfaceValues, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( NurbsSurfaceValues, MATH_FUNC_EX )
};
@@ -2322,7 +2326,7 @@ private:
const double mPrec,
VERSION vers );
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MeshSurfaceValues, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MeshSurfaceValues, MATH_FUNC_EX )
OBVIOUS_PRIVATE_COPY( MeshSurfaceValues )
};
@@ -2531,7 +2535,7 @@ private:
const SArray<double> & breaks ) const;
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( RuledSurfaceValues, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( RuledSurfaceValues, MATH_FUNC_EX )
OBVIOUS_PRIVATE_COPY( RuledSurfaceValues )
};
@@ -5496,6 +5500,15 @@ protected:
c3d::SNameMakerSPtr _operNames; ///< \ru Именователь операции. \en An object defining names generation in the operation.
public:
/** \brief \ru Конструктор параметров элементарного тела.
\en Elementary solid parameter constructor. \~
\details \ru Конструктор параметров элементарного тела с неопределенным типом.
\en Elementary solid parameters constructor with undefined type. \~
\param[in] operNames - \ru Именователь операции.
\en An object for naming the new objects. \~
*/
MbElementarySolidParams( const MbSNameMaker & operNames );
/** \brief \ru Конструктор параметров элементарного тела.
\en Elementary solid parameter constructor. \~
\details \ru Конструктор параметров элементарного тела по набору точек.
@@ -5507,13 +5520,7 @@ public:
\param[in] operNames - \ru Именователь операции.
\en An object for naming the new objects. \~
*/
MbElementarySolidParams( const ElementaryShellType & solidType, const c3d::SpacePointsVector & points, const MbSNameMaker & operNames )
: _solidType ( solidType )
, _points ( points )
, _initSurface( nullptr )
, _operNames ( &operNames.Duplicate() )
{
}
MbElementarySolidParams( const ElementaryShellType & solidType, const c3d::SpacePointsVector & points, const MbSNameMaker & operNames );
/** \brief \ru Конструктор параметров элементарного тела.
\en Elementary solid parameter constructor. \~
@@ -5530,10 +5537,39 @@ public:
/// \ru Деструктор. \en Destructor. \~
~MbElementarySolidParams() {}
/** \brief \ru Метод инициализации параметров элементарного тела.
\en Initializtion method for elementary solid parameters. \~
\details \ru Метод инициализации параметров элементарного тела по типу тела и набору точек.
\en Initializtion method for elementary solid parameters by solid type and a set of points. \~
\param[in] solidType - \ru Тип создаваемого тела.
\en The solid type. \~
\param[in] points - \ru Множество точек.
\en Set of points. \~
\return \ru Возвращает true в случае успеха.
\en Returns true in case of success. \~
*/
bool Init( const ElementaryShellType & solidType, const c3d::SpacePointsVector & points );
/** \brief \ru Метод инициализации параметров элементарного тела.
\en Initializtion method for elementary solid parameters. \~
\details \ru Метод инициализации параметров элементарного тела по элементарной поверхности.
\en Initializtion method for elementary solid parameters by an elementary surface. \~
\param[in] surface - \ru Элементарная поверхность.\n
Допускается тип поверхности - шар, тор, цилиндр, конус.
\en Elementary surface.\n
The acceptable surface types are sphere, torus, cylinder, cone. \~
\return \ru Возвращает true в случае успеха.
\en Returns true in case of success. \~
*/
bool Init( const SPtr<const MbElementarySurface> & surface );
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_operNames; }
/// \ru Получить множество точек. \en Get the set of points.
const c3d::SpacePointsVector & GetPoints() const { return _points; }
/// \ru Получить исходную поверхность. \en Get the initial surface.
const SPtr<const MbElementarySurface> & GetInitSurface() const { return _initSurface; }
@@ -5688,64 +5724,170 @@ OBVIOUS_PRIVATE_COPY( MbHoleSolidParams )
//------------------------------------------------------------------------------
/** \brief \ru Параметры построения гладкого сопряжения двух граней.
\en Parameters for creating a fillet face between two faces. \~
\details \ru Параметры построения гладкого сопряжения двух граней.
\en Parameters for creating a fillet face between two faces. \~
/** \brief \ru Набор граней одного тела для построения скругления несвязных групп граней.
\en Faces of one solid to create a fillet between two disjoint sets of faces. \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке. \en Under development.
*/
// ---
class MATH_CLASS MbFacesFilletParams
class MATH_CLASS MbFaceFilletBundle
{
private:
c3d::ConstSolidSPtr _solid1; ///< \ru Первое тело. \en The first solid.
c3d::ConstSolidSPtr _solid2; ///< \ru Второе тело. \en The second solid.
c3d::ConstFaceSPtr _face1; ///< \ru Сопрягаемая грань первого тела. \en The first solid face to fillet.
c3d::ConstFaceSPtr _face2; ///< \ru Сопрягаемая грань второго тела. \en The second solid face to fillet.
SPtr<MbSNameMaker> _nameMaker; ///< \ru Именователь операции. \en An object defining names generation in the operation.
public:
SmoothValues _params; ///< \ru Параметры операции скругления. \en The fillet operation parameters.
c3d::ConstSolidSPtr _solid; ///< \ru Тело. Всегда не null. \en The solid. Not null.
c3d::ConstFacesSPtrVector _faces; ///< \ru Грани тела. Хотя бы одна грань не null. \en The faces of the solid. At least one face is not null.
std::vector<bool> _faceSide; ///< \ru Сторона грани, с которой ее будет касаться поверхность скругления (синхронизованно с _faces). \en Side of a face that fillet surface will touch (synchronized with _faces).
std::vector<MbItemIndex> _faceIndex; ///< \ru Номера опорных граней. \en The reference face numbers (may be empty). \~
c3d::FunctionSPtr _function; ///< \ru Функция радиуса для набора граней (всегда не null). \en The function of the fillet radius for the face set (always not null).
public:
/** \brief \ru Конструктор. \en Constructor. \~
\details \ru Конструктор параметров построения гладкого сопряжения двух граней.
\en Constructor of parameters for creating a fillet face between two faces. \~
\param[in] solid1 - \ru Первое тело.
\en The first solid. \~
\param[in] face1 - \ru Сопрягаемая грань первого тела.
\en The first solid face to fillet. \~
\param[in] solid2 - \ru Второе тело.
\en The second solid. \~
\param[in] face2 - \ru Сопрягаемая грань второго тела.
\en The second solid face to fillet. \~
\param[in] params - \ru Параметры операции скругления.
\en The fillet operation parameters. \~
\param[in] names - \ru Именователь.
\en An object for naming the new objects. \~
/// \ru Конструктор по умолчанию. \en Empty constructor.
MbFaceFilletBundle();
/// \ru Конструктор по параметрам для набора граней. \en Constructor by parameters for a face set.
MbFaceFilletBundle( const c3d::ConstSolidSPtr & solid, const c3d::FunctionSPtr & func,
const c3d::ConstFacesSPtrVector & faces, const std::vector<bool> & faceSide );
/// \ru Конструктор по параметрам для одной грани. \en Constructor by parameters for one face.
MbFaceFilletBundle( const c3d::ConstSolidSPtr & solid, const c3d::FunctionSPtr & func,
const c3d::ConstFaceSPtr & face, bool faceSide );
/// \ru Конструктор копирования с регистратором. \en Copy constructor with registrator.
MbFaceFilletBundle( const MbFaceFilletBundle & other, MbRegDuplicate * iReg = nullptr );
/// \ru Получить тело. \en Get the solid.
const c3d::ConstSolidSPtr & GetSolid() const { return _solid; }
/// \ru Добавить в данные поверхность. \en Add surface to data. \~
bool AddFace( MbFace & face, bool side, MbSolid * sol = nullptr, MbFunction * func = nullptr);
/// \ru Получить грани. \en Get faces.
const c3d::ConstFacesSPtrVector & GetFaces() const { return _faces; }
/// \ru Получить стороны граней, с которых их будет касаться поверхность скругления. \en Get sides of a faces that fillet surface will touch.
const std::vector<bool> & GetFaceSide() const { return _faceSide; }
/// \ru Выдать номера опорных граней. \en Get reference face numbers.
const std::vector<MbItemIndex> & GetFaceIndex() const { return _faceIndex; }
/// \ru Получить функцию радиуса скругления для набора граней. \en Get the function of fillet radius for the face set.
const c3d::FunctionSPtr GetFunction() const { return _function; }
/// \ru Оператор присваивания без копирования топологических объектов. \en Assignment operator without copying topological objects.
void operator = ( const MbFaceFilletBundle & other );
};
//------------------------------------------------------------------------------
/** \brief \ru Данные для построения сопряжения несвязных граней.
\en Data to create fillet between disjoint faces. \~
\details \ru Данные для построения гладкого сопряжения двух несвязных (непересекающихся) наборов граней.
Каждый набор может состоять только из связных граней одного тела.
\en Data to create a smooth fillet faces between two disjoint sets of faces.
Each set can consists of connected faces of one solid. \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке. \en Under development. \~
\warning \ru Член класса SmoothValues _params будет удален в версии 2024. \en Class member SmoothValues _params will be removed in version 2024.
*/
// ---
class MATH_CLASS MbFacesFilletParams : public MbPrecision
{
private:
MbFaceFilletBundle _faceSet1; ///< \ru Первый набор сопрягаемых граней. \en The first set of conjugating faces.
MbFaceFilletBundle _faceSet2; ///< \ru Второй набор сопрягаемых граней. \en The second set of conjugating faces.
bool _faceSplit; ///< \ru Разделять оболочку на грани по сегментам опорных кривых. \en Split the shell into faces by segments of support curves.
bool _elongated; ///< \ru Обрезать опорную оболочку на границе по касательной (true)/по нормали (false) к граничному ребру. \en The support shell will cutted along the tangent (true)/along the normal (false) to the boundary edge. \~
MbeSideShape _sideShape; ///< \ru Форма обрезки боков поверхности. \en The form of cropping the sides of the surface.
double _conic; ///< \ru Коэффициент формы, изменяется от 0.05 до 0.95 (при 0 - дуга окружности). \en Coefficient of shape is changed from 0.05 to 0.95 (if 0 - circular arc).
bool _prolong; ///< \ru Продолжить по касательной. \en Prolong along the tangent.
ThreeStates _keepCant; ///< \ru Автоопределение сохранения кромки (ts_neutral), сохранение поверхности (ts_negative), сохранение кромки (ts_positive). \en Auto detection of boundary saving (ts_neutral), surface saving (ts_negative), boundary saving (ts_positive).
bool _equable; ///< \ru Флаг обработки некасательных стыков. True, если в углах сочленения вставлять тороидальную поверхность. \en Non tangent joints handling flag. True, if insert toroidal surface in corners of the joint.
SPtr<MbSNameMaker> _nameMaker; ///< \ru Именователь операции. \en An object defining names generation in the operation.
public:
/// \ru Конструктор по умолчанию. \en Empty constructor.
MbFacesFilletParams();
/** \brief \ru Конструктор по параметрам. \en Constructor by parameters. \~
\details \ru Конструктор данных построения гладкого сопряжения двух несвязных наборов граней.
\en Constructor by parameters to create smooth fillet faces between two disjoint sets of faces. \~
\param[in] faces1 - \ru Первый набор сопрягаемых граней.
\en The first set of conjugeting faces. \~
\param[in] faces2 - \ru Второй набор сопрягаемых граней.
\en The second set of conjugeting faces. \~
\param[in] faceSplit - \ru Разделять оболочку на грани по сегментам направляющих кривых.
\en Split the shell into faces by segments of guide curves. \~
\param[in] sideShape - \ru Форма обрезки боков поверхности.
\en The form of cropping the sides of the surface. \~
\param[in] function1 - \ru Функция радиуса для первого набора граней (всегда не null). Константная функция в случае скругления с постоянным радиусом.
\en The function of the fillet radius for the first set of faces (always not null). Constant function in case of fillet with constant radius.\~
\param[in] function2 - \ru Функция радиуса для второго набора граней (всегда не null). Константная функция в случае скругления с постоянным радиусом.
\en The function of the fillet radius for the second set of faces (always not null). Constant function in case of fillet with constant radius. \~
\param[in] conic - \ru Коэффициент формы, изменяется от 0.05 до 0.95 (при 0 - дуга окружности).
\en Coefficient of shape is changed from 0.05 to 0.95 (if 0 - circular arc). \~
\param[in] prolong - \ru Продолжить по касательной.
\en Prolong along the tangent. \~
\param[in] keepCant - \ru Автоопределение сохранения кромки (ts_neutral), сохранение поверхности (ts_negative), сохранение кромки (ts_positive).
\en Auto detection of boundary saving (ts_neutral), surface saving (ts_negative), boundary saving (ts_positive). \~
\param[in] equable - \ru В углах сочленения вставлять тороидальную поверхность.
\en In corners of the joint insert toroidal surface. \~
\param[in] nameMaker - \ru Именователь новых граней операции.
\en An object defining names generation in the operation. \~
*/
MbFacesFilletParams( const c3d::ConstSolidSPtr & solid1, const c3d::ConstFaceSPtr & face1,
const c3d::ConstSolidSPtr & solid2, const c3d::ConstFaceSPtr & face2,
const SmoothValues & params, const MbSNameMaker & names )
: _params ( params )
, _nameMaker( &names.Duplicate() )
, _solid1 ( solid1 )
, _solid2 ( solid2 )
, _face1 ( face1 )
, _face2 ( face2 ) {}
MbFacesFilletParams( const MbFaceFilletBundle & faces1, const MbFaceFilletBundle & faces2,
bool faceSplit, bool elongated, MbeSideShape sideShape,
double conic, bool prolong, ThreeStates keepCant, bool equable,
const MbSNameMaker & nameMaker );
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with registrator.
MbFacesFilletParams( const MbFacesFilletParams & other, MbRegDuplicate * iReg );
/// \ru Деструктор. \en Destructor.
~MbFacesFilletParams() {};
public:
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_nameMaker; }
/// \ru Получить первое тело. \en Get the first solid.
const c3d::ConstSolidSPtr & GetSolid1() const { return _solid1; }
const c3d::ConstSolidSPtr & GetSolid1() const { return _faceSet1.GetSolid(); }
/// \ru Получить второе тело. \en Get the second solid.
const c3d::ConstSolidSPtr & GetSolid2() const { return _solid2; }
const c3d::ConstSolidSPtr & GetSolid2() const { return _faceSet2.GetSolid(); }
/// \ru Получить сопрягаемую грань первого тела. \en Get the first solid face to fillet.
const c3d::ConstFaceSPtr & GetFace1() const { return _face1; }
/// \ru Получить сопрягаемую грань второго тела. \en Get the second solid face to fillet.
const c3d::ConstFaceSPtr & GetFace2() const { return _face2; }
/// \ru Получить грань в случае скругления двух граней. \en Get the face when creating a fillet face between two faces.
const c3d::ConstFaceSPtr & GetFace1() const { return _faceSet1.GetFaces().at( 0 ); }
/// \ru Получить грань в случае скругления двух граней. \en Get the face when creating a fillet face between two faces.
const c3d::ConstFaceSPtr & GetFace2() const { return _faceSet2.GetFaces().at( 0 ); }
/// \ru Получить первый набор сопрягаемых граней. \en Get the first set of conjugating faces.
const MbFaceFilletBundle & GetSet1() const { return _faceSet1; }
/// \ru Получить второй набор сопрягаемых граней. \en Get the second set of conjugating faces.
const MbFaceFilletBundle & GetSet2() const { return _faceSet2; }
bool GetFaceSplit() const { return _faceSplit; }
/// \ru Установить деление оболочки на грани по сегментам направляющих кривых. \en Set division the shell into faces by segments of guides.
void SetFaceSplit( bool s ) { _faceSplit = s; }
/// \ru Обрезать опорную оболочку на границе по касательной или по нормали к граничному ребру? \en How to cut the support shell on the boundary edge? \~
bool GetElongated() const { return _elongated; }
/// \ru Установить обрезку опорной оболочки на границе к граничному ребру. \en Set the support shell cutting on the boundary edge. \~
void SetElongated( bool e ) { _elongated = e; }
/// \ru Выдать форму обрезки боков поверхности. \en Get the shape of cropping the sides of the surface. \~
MbeSideShape GetSideShape() const { return _sideShape; }
/// \ru Установить форму обрезки боков поверхности. \en Set the shape of cropping the sides of the surface. \~
void SetSideShape( MbeSideShape s ) { _sideShape = s; }
/// \ru Получить функцию радиуса скругления для первого набора граней. \en Get the function of fillet radius for the first face set.
const c3d::FunctionSPtr GetRadiusFunction1() const { return _faceSet1.GetFunction(); }
/// \ru Получить функцию радиуса скругления для второго набора граней. \en Get the function of fillet radius for the second face set.
const c3d::FunctionSPtr GetRadiusFunction2() const { return _faceSet2.GetFunction(); }
/// \ru Получить коэффициент формы. \en Get coefficient of shape.
double GetFormCoef() const { return _conic; }
/// \ru Получить флаг продолжения по касательной. \en Get prolong along the tangent flag.
bool GetProlong() const { return _prolong; }
/// \ru Получить флаг сохранения кромки. \en Get keep cant state flag.
ThreeStates GetKeepCant() const { return _keepCant; }
/// \ru Получить флаг обработки некасательных стыков. \en Get non tangent joints handling flag.
bool GetEquable() const { return _equable; }
/// \ru Возвращает true, если скругляются ровно две несвязные грани. \en Returns true if filleting exactly two disjoint faces.
bool IsTwoFaceFillet() const { return _faceSet1.GetFaces().size() == 1 && _faceSet2.GetFaces().size() == 1; }
OBVIOUS_PRIVATE_COPY( MbFacesFilletParams )
};
@@ -6644,8 +6786,7 @@ public:
{}
/// \ru Оператор присваивания. \en Assignment operator.
MbSectionResults & operator = ( const MbSectionResults & other ) {
_tolerance = other._tolerance;
_hotPoint = other._hotPoint;
MbOperationResults::operator =( static_cast<const MbOperationResults &>(other) );
_solid = other._solid;
return *this;
}
@@ -6688,4 +6829,119 @@ public:
MbCartPoint3D & p3, MbVector3D & v3,
MbPlacement3D & pl, MbCartPoint3D & a ) const;
};
//------------------------------------------------------------------------------
/** \brief \ru Входные параметры операции "Балочный элемент".
\en Input parameters of "Beam element" operation. \~
\details \ru Входные параметры операции "Балочный элемент".
\en Input parameters of "Beam element" operation. \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbBeamElementParams : public MbPrecision
{
private:
c3d::SNameMakerSPtr _names; ///< \ru Именователь. \en An object for naming the new objects.
double _sectionRatio; ///< \ru Определяет положение плоского сечения на балочной кривой. Задается значением между 0 и 1, где 0 - в начале кривой, 1 - в конце. \en Determines the place of a planar section on the beam curve. Its value is between 0 and 1 where 0 is a begin point of the curve and 1 is an end of the curve.
private:
///< \ru Конструктор по умолчанию (не реализован). \en Default constructor (not implemented).
MbBeamElementParams();
public:
///< \ru Конструктор. \en Constructor.
MbBeamElementParams( const MbSNameMaker & names );
///< \ru Конструктор копирования. \en Copy constructor.
MbBeamElementParams( const MbBeamElementParams & other );
///< \ru Деструктор. \en Destructor.
virtual ~MbBeamElementParams();
public:
/** \brief \ru Задать положение плоского сечения на балочной кривой.
\en Set the place of the planar section on the beam curve. \~
\details \ru Задать положение плоского сечения на балочной кривой.
\en Set the place of the planar section on the beam curve. \~
\param[in] ratio - \ru Значение отношения, в котором эта точка делит кривую. В диапазоне от 0 до 1. ratio=0 соответствует началу кривой, ratio=1 - концу.
\en A value of the ratio, which this point divides the curve in. In the range 0...1. ratio=0 means beginning of the curve , ratio=1 means end of the curve. \~
*/
void SetSectionRatio( double ratio );
/** \brief \ru Получить информацию о положении сечения.
\en Get the information about section placement. \~
\details \ru Получить информацию о положении сечения. Т. е. значение отношения, в котором эта точка делит кривую. В диапазоне от 0 до 1. ratio=0 соответствует началу кривой, ratio=1 - концу.
\en Get the information about section placement. I. e. a value of the ratio, which this point divides the curve in. In the range 0...1. ratio=0 means beginning of the curve , ratio=1 means end of the curve.\~
\return \ru Значение отношения, в котором эта точка делит кривую.
\en A value of the ratio, which this point divides the curve in. \~
*/
double GetSectionRatio() const { return _sectionRatio; };
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation. \~
const MbSNameMaker & GetNameMaker() const { return *_names; }
KNOWN_OBJECTS_RW_REF_OPERATORS( MbBeamElementParams ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
};
//------------------------------------------------------------------------------
/** \brief \ru Выходные параметры операции "Балочный элемент".
\en Output parameters of "Beam element" operation. \~
\details \ru Выходные параметры операции "Балочный элемент".
\en Output parameters of "Beam element" operation. \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbBeamElementResults : public MbOperationResults
{
private:
c3d::WireFrameSPtr _resWireFrame; ///< \ru Результирующая балочная кривая. \en Resulting beam curve.
public:
///< \ru Конструктор. \en Constructor.
MbBeamElementResults();
///< \ru Деструктор. \en Destructor.
virtual ~MbBeamElementResults();
public:
/** \brief \ru Переопределить поля класса в соответствии с заданными параметрами.
\en Reinitialize class members according to the input parameters. \~
\details \ru Переопределить поля класса в соответствии с заданными параметрами.
\en Reinitialize class members according to the input parameters. \~
\param[in] edges - \ru Ребра балочных кривых.
\en The edges of the beam curves. \~
\param[in] creator - \ru Строитель операции "Балочный элемент".
\en The creator of the operation "Beam element". \~
*/
void Init( const c3d::WireEdgesSPtrVector & edges, const SPtr<MbBeamCreator> & creator );
/// \ru Получить результирующий каркас. \en Get the wire frame.
const c3d::WireFrameSPtr & GetWireFrame() const { return _resWireFrame; };
/// \ru Получить количество балочных элементов. \en Get count of beam elements.
size_t GetElementsCount() const;
/** \brief \ru Получить балочный элемент с заданным индексом.
\en Get the beam element with the given index. \~
\details \ru Получить балочный элемент с заданным индексом.
\en Get the beam element with the given index. \~
\param[in] idx - \ru Индекс элемента.
\en The index of the element. \~
\param[out] beamCurve - \ru Балочная кривая.
\en The beam curve. \~
\param[out] section - \ru Плоское сечение.
\en The planar section. \~
\return \ru true, в случае успеха.
\en true if success. \~
*/
bool GetBeamElement( size_t idx, c3d::SpaceCurveSPtr & beamCurve, SPtr<MbCurveBoundedSurface> & section ) const;
};
#endif // __OP_SHELL_PARAMETERS_H
+33 -17
View File
@@ -193,7 +193,7 @@ public:
\en Constructor by a solid. \~
\param[in] _solid - \ru Тело. Используется оригинал объекта.
\en A solid. Used original of object. \~
\param[in] _newMainName - \ru Новое главное имя для топологических элементов тела.
\param[in] newNameMaker - \ru Новое главное имя для топологических элементов тела.
\en New main name for names of solid's topological elements. \~
*/
MbSweptData( MbSolid & _solid, const MbSNameMaker * newNameMaker = nullptr );
@@ -326,10 +326,13 @@ public:
\en Surface. \~
\param[out] wireContours3D - \ru Набор трехмерных контуров.
\en Set of three-dimensional contours. \~
\param[in,out] contoursNames - \ru На входе - именователь ребер каркаса. На выходе - именователь полученных контуров.
\en At the input - the frame edge namer. At the output - the namer of the obtained contours. \~
*/
void GetWireFrameContours( c3d::PlaneContoursSPtrVector & wireContours,
c3d::SurfaceSPtr & wireSurface,
c3d::SpaceContoursSPtrVector & wireContours3D ) const;
c3d::SpaceContoursSPtrVector & wireContours3D,
RPArray<MbSNameMaker> * contoursNames = nullptr ) const;
/** \brief \ru Выдать двумерные контуры с поверхностью, полученные с проволочного каркаса.
\en Get two-dimensional contours with a surface obtained from a wireframe. \~
@@ -348,7 +351,8 @@ public:
*/
size_t GetWireFrameSurfaceContours( c3d::SurfacesSPtrVector & wireSurfaces,
std::vector<c3d::PlaneContoursSPtrVector> & wireContours,
std::vector<c3d::SNamesMakerSPtrVector> & contoursNames ) const;
std::vector<c3d::SNamesMakerSPtrVector> & contoursNames,
VERSION version = Math::DefaultMathVersion() ) const;
/** \brief \ru Выдать трехмерные контуры, полученные с проволочного каркаса.
\en Get space contours obtained from a wireframe. \~
@@ -1701,13 +1705,13 @@ private:
class MATH_CLASS MbSectionRail {
private:
std::vector<c3d::SolidSPtr> solids; ///< \ru Тела опорных граней или направляющих рёбер (могут отсутствовать). \en The solids of reference faces or guide edges (may be empty). \~
std::vector<c3d::FaceSPtr> faces; ///< \ru Опорные грани (могут отсутствовать). \en The reference faces (may be empty). \~
std::vector<bool> faceSide; ///< \ru С каких сторон касаться поверхностей при form==cs_Linea (синхронно с faces). \en On which sides to touch surfaces when form==cs_Linea (synchronously with faces). \~
std::vector<MbItemIndex> faceIndex; ///< \ru Номера опорных граней. \en The reference face numbers (may be empty). \~
std::vector<c3d::EdgeSPtr> edges; ///< \ru Направляющие рёбра (могут отсутствовать). \en The guide edges (may be empty). \~
std::vector<bool> edgeSide; ///< \ru С какой гранью ребра гладко стыковать поверхность (синхронно с edges). \en What face of edge should the surface join smoothly to (synchronously with edges). \~
std::vector<MbItemIndex> edgeIndex; ///< \ru Номера направляющих рёбер (могут отсутствовать). \en The guide edge numbers (may be empty). \~
std::vector<c3d::SolidSPtr> solids; ///< \ru Тела опорных граней или направляющих рёбер (могут отсутствовать). \en The solids of reference faces or guide edges (may be empty). \~
std::vector<c3d::SpaceCurveSPtr> curves; ///< \ru Направляющие кривые (могут отсутствовать). \en The guide curves (may be empty). \~
c3d::SpaceCurveSPtr track; ///< \ru Кривая, через которую должно пройти сечение (может отсутствовать). \en The curve that the section should pass through (may be nullptr). \~
c3d::FunctionSPtr function; ///< \ru Функция угла наклона, или длины, или радиуса (может отсутствовать). \en The function of the angle of inclination, or of the length, or of the fillet radius (may be nullptr). \~
@@ -1717,7 +1721,8 @@ public:
/// \ru Конструктор по умолчанию. \en Empty constructor.
MbSectionRail()
: faces ()
: solids ()
, faces ()
, faceSide ()
, faceIndex()
, edges ()
@@ -1761,6 +1766,19 @@ public:
public:
/// \ru Выдать тела опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges.
void GetSolids( std::vector<MbSolid *> & sols ) const;
void GetSolids( RPArray<MbSolid> & sols ) const;
/// \ru Выдать количество тел опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges count.
size_t GetSolidsCount() const { return solids.size(); }
/// \ru Выдать тело по индексу. \en Get solid by index.
const MbSolid * GetSolid( size_t i ) const { return ( i < solids.size() ) ? solids[i].get() : nullptr; }
MbSolid * SetSolid( size_t i ) { return ( i < solids.size() ) ? solids[i].get() : nullptr; }
/// \ru Очистить контейр тел. \en Solid conteiner clear.
void SolidsClear() { solids.clear(); }
/// \ru Выдать уникальные тела. \en Give out unique solids.
void GetUniqueSolids( std::vector<MbSolid *> & sols ) const;
/// \ru Добавить в данные поверхность. \en Add surface to data. \~
void AddFace( MbFace & _face, bool side, MbSolid * solid = nullptr );
/// \ru Выдать грани. \en Get faces.
@@ -1779,6 +1797,8 @@ public:
MbFace * SetFace( size_t i ) { return ( i < faces.size() ) ? faces[i].get() : nullptr; }
/// \ru Установить сторону касания грани. \en Set face side.
void SetFaceSide( size_t i, bool s ) { if ( i < faceSide.size() ) faceSide[i] = s; }
/// \ru Очистить контейр тел. \en Solid conteiner clear.
void FacesClear() { faces.clear(); }
/// \ru Добавить в данные направляющую кривую. \en Add guiding to data. \~
void AddEdge( MbCurveEdge & _edge, bool side, MbSolid * solid = nullptr );
@@ -1798,19 +1818,8 @@ public:
MbCurveEdge * SetEdge( size_t i ) { return ( i < edges.size() ) ? edges[i].get() : nullptr; }
/// \ru Установить сторону ребра. \en Set edge side.
void SetEdgeSide( size_t i, bool s ) { if ( i < edgeSide.size() ) edgeSide[i] = s; }
/// \ru Выдать тела опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges.
void GetSolids( std::vector<MbSolid *> & sols ) const;
void GetSolids( RPArray<MbSolid> & sols ) const;
/// \ru Выдать количество тел опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges count.
size_t GetSolidsCount() const { return solids.size(); }
/// \ru Выдать тело по индексу. \en Get solid by index.
const MbSolid * GetSolid( size_t i ) const { return ( i < solids.size() ) ? solids[i].get() : nullptr; }
MbSolid * SetSolid( size_t i ) { return ( i < solids.size() ) ? solids[i].get() : nullptr; }
/// \ru Очистить контейр тел. \en Solid conteiner clear.
void SolidsClear();
/// \ru Выдать уникальные тела. \en Give out unique solids.
void GetUniqueSolids( std::vector<MbSolid *> & sols ) const;
void EdgesClear() { edges.clear(); }
/// \ru Добавить в данные кривую. \en Add curve to data. \~
void AddCurve( MbCurve3D & _curve );
@@ -1823,6 +1832,8 @@ public:
/// \ru Выдать дополнительную направляющую кривую. \en Get additional guide curve.
const MbCurve3D * GetCurve( size_t i ) const { return ( i < curves.size() ) ? curves[i].get() : nullptr; }
MbCurve3D * SetCurve( size_t i ) { return ( i < curves.size() ) ? curves[i].get() : nullptr; }
/// \ru Очистить контейр тел. \en Solid conteiner clear.
void CurvesClear() { curves.clear(); }
/// \ru Добавить в данные кривую. \en Add curve to data. \~
void SetTrack( MbCurve3D & trk );
@@ -2013,6 +2024,7 @@ private:
MbeSideShape sideShape; ///< \ru Форма обрезки боков поверхности. \en The form of cropping the sides of the surface. \~
MbeFaceHandling handling; ///< \ru Обработка исходных опорных граней. \en The processing of initial reference faces. \~
bool faceSplit; ///< \ru Разделять оболочку на грани по сегментам направляющих кривых. \en Divide the shell into faces by segments of guides. \~
bool elongated; ///< \ru Обрезать опорную оболочку на границе по касательной (true)/по нормали (false) к граничному ребру. \en The support shell will cutted along the tangent (true)/along the normal (false) to the boundary edge. \~
double uMin; ///< \ru Минимальное значение первого параметра. \en Minimal value of the first parameter. \~
double uMax; ///< \ru Максимальное значение первого параметра. \en Maximal value of the first parameter. \~
double buildSag; ///< \ru Угловое отклонение при движении по кривым и поверхностям. \en Angular deviation while moving along curves and surfaces. \~
@@ -2258,6 +2270,10 @@ public:
bool GetFaceSplit() const { return faceSplit; }
/// \ru Установить деление оболочки на грани по сегментам направляющих кривых. \en Set division the shell into faces by segments of guides.
void SetFaceSplit( bool s ) { faceSplit = s; }
/// \ru Обрезать опорную оболочку на границе по касательной или по нормали к граничному ребру? \en How to cut the support shell on the boundary edge? \~
bool GetElongated() const { return elongated; }
/// \ru Установить обрезку опорной оболочки на границе к граничному ребру. \en Set the support shell cutting on the boundary edge. \~
void SetElongated( bool e ) { elongated = e; }
/// \ru Минимальное значение первого параметра. \en Minimal value of the first parameter.
double GetUMin() const { return uMin; }
-1
View File
@@ -17,7 +17,6 @@
#include <templ_sptr.h>
#include <pars_tree_variable.h>
#include <mb_enum.h>
#include <memory>
#include <set>
#include <map>
#include <functional>
+5 -4
View File
@@ -9,7 +9,8 @@
#ifndef __ITTREEVARS_H
#define __ITTREEVARS_H
#include <io_tape_define.h>
#include <io_base.h>
#include <tool_cstring.h>
#include <templ_ss_array.h>
class DefRange;
@@ -151,7 +152,7 @@ struct MATH_CLASS ItTreeVariable
virtual void SetName( const TCHAR * s ) { SetName(c3d::string_t(s ? s : _T(""))); };
/// \ru Операторы чтения, записи. \en Reading and writing operators.
DECLARE_PERSISTENT_OPS( ItTreeVariable )
DECLARE_PERSISTENT_OPS_BASE( ItTreeVariable, MATH_FUNC_EX )
};
@@ -182,7 +183,7 @@ struct ItIntervalTreeVariable
virtual refcount_t Release() const = 0;
/// \ru Операторы чтения, записи. \en Reading and writing operators.
DECLARE_PERSISTENT_OPS( ItIntervalTreeVariable )
DECLARE_PERSISTENT_OPS_BASE( ItIntervalTreeVariable, MATH_FUNC_EX )
};
@@ -228,7 +229,7 @@ struct MATH_CLASS ItUserFunc
virtual bool IsEqual ( const MbUserFunc & other ) const = 0;
/// \ru Операторы чтения, записи. \en Reading and writing operators.
DECLARE_PERSISTENT_OPS( ItUserFunc )
DECLARE_PERSISTENT_OPS_BASE( ItUserFunc, MATH_FUNC_EX )
};
#endif //__ITTREEVARS_H
+1
View File
@@ -12,6 +12,7 @@
#include <pars_tree_variable.h>
#include <math_define.h>
#include <io_tape_define.h>
#include <io_define.h>
-1
View File
@@ -13,7 +13,6 @@
#include <math_define.h>
#include <pars_tree_variable.h>
#include <vector>
#include <memory>
class MATH_CLASS BTreeNode;
class MATH_CLASS TreeIntervalNode;
+2 -2
View File
@@ -150,7 +150,7 @@ protected: // \ru Внутренние функции. \en Internal functions.
/// \ru Установить измененность. \en Set modification.
void SetChanged ( bool b ) const { changed = b; }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbPartSolidIndex, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPartSolidIndex, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPartSolidIndex )
OBVIOUS_PRIVATE_COPY ( MbPartSolidIndex )
}; // MbPartSolidIndex
@@ -382,7 +382,7 @@ private: // \ru Внутренние функции. \en Internal functions.
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
void operator = ( const MbPartSolidIndices & );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbPartSolidIndices, MATH_FUNC_EX )
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPartSolidIndices, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPartSolidIndices )
DECLARE_NEW_DELETE_CLASS_EX( MbPartSolidIndices )
};
+4 -4
View File
@@ -100,8 +100,8 @@ public:
itemName.SetName( other.itemName );
}
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbPositionData, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbPositionData, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPositionData, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbPositionData, MATH_FUNC_EX );
DECLARE_NEW_DELETE_CLASS( MbPositionData )
DECLARE_NEW_DELETE_CLASS_EX( MbPositionData )
};
@@ -178,8 +178,8 @@ public:
Init( other );
}
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbEdgeSequence, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbEdgeSequence, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbEdgeSequence, MATH_FUNC_EX );
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbEdgeSequence, MATH_FUNC_EX );
DECLARE_NEW_DELETE_CLASS( MbEdgeSequence )
DECLARE_NEW_DELETE_CLASS_EX( MbEdgeSequence )
};
+1 -1
View File
@@ -1767,7 +1767,7 @@ public:
private:
MbSMBendNames & operator = ( const MbSMBendNames & ); // \ru Не реализовано \en Not implemented
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX( MbSMBendNames, MATH_FUNC_EX ) // \ru Для работы с указателями класса \en For working with pointers of class
KNOWN_OBJECTS_RW_PTR_OPERATORS_EX_BASE( MbSMBendNames, MATH_FUNC_EX ) // \ru Для работы с указателями класса \en For working with pointers of class
};
+54
View File
@@ -145,8 +145,62 @@ public:
MbSurface & surf2, MbCurve & curv2,
MbCurve3D & curv0, MbFunction & weig0,
double d1, double d2, MbeSmoothForm fm, double cn, MbFunction & func, bool ev );
/** \brief \ru Создать поверхность скругления по двум поверхностям по закону.
\en Create a fillet surface from two surfaces according to the law. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] law - \ru Функция домножения радиуса rad, зависящая от параметра u поверхности.
\en Multiplication function of radius rad, depending on the parameter u of the surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbChannelSurface * CreateLawFillet( double rad, MbFunction & law, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, VERSION vers );
/** \brief \ru Создать поверхность скругления по поверхности и кромке с радиусом по закону
\en Create fillet surface by support surface and by kerb-curve with a radius that varies according to the law. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] law - \ru Функция домножения радиуса rad, зависящая от параметра u поверхности.
\en Multiplication function of radius rad, depending on the parameter u of the surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] byFirst - \ru true - кривая curve2 является кромкой, false - кривая curve1 является кромкой
\en True - curve2 curve is edge, false - curve1 curve is edge \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbChannelSurface * CreateKerbLawFillet( double rad, MbFunction & law, MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2, bool byFirst, VERSION vers );
protected:
/// \ru Конструктор для наследников обычной поверхности скругления. \en Constructor for inheritors of ordinary fillet surface.
MbChannelSurface( MbSurfaceCurve & curv1, double d1,
MbSurfaceCurve & curv2, double d2, MbFunction & func );
MbChannelSurface( MbSurfaceCurve & curv1, double d1,
MbSurfaceCurve & curv2, double d2, MbFunction & func, bool byFirst );
MbChannelSurface( const MbChannelSurface &, MbRegDuplicate * );
MbChannelSurface( const MbChannelSurface * ); // \ru Конструктор копирования с теми же опорными поверхностями для CurvesDuplicate() \en Copy constructor with the same support surfaces for CurvesDuplicate()
+199 -4
View File
@@ -12,10 +12,11 @@
#include <surf_smooth_surface.h>
#include <tool_multithreading.h>
class MATH_CLASS MbFunction;
struct MbFilletSurfaceCacheData;
//------------------------------------------------------------------------------
/** \brief \ru Поверхность скругления с постоянными радиусами обычная или с сохранением кромки.
@@ -45,6 +46,34 @@ class MATH_CLASS MbFunction;
\ingroup Surfaces
*/// ---
class MATH_CLASS MbFilletSurface : public MbSmoothSurface {
public:
//------------------------------------------------------------------------------
/** \brief \ru Версия реализации поверхности.
\en Version of implementation of surface. \~
*/
// ---
enum MbeFilletSurfaceVersion {
fsv_Ver0 = 0, ///< \ru Нулевая версия. \en The first version.
fsv_Ver1 = 1, ///< \ru Первая версия. \en The first version.
fsv_Count ///< \ru Количество версий. \en Count of versions.
};
//------------------------------------------------------------------------------
/** \brief \ru Реализованные типы скруглений с точной математикой.
\en Implemented types of fillets with exact mathematics. \~
*/
// ---
enum MbeFilletSurfType {
ft_UndefFillet = -1,
ft_SimpleFillet = 0, ///< \ru Скругление двух поверхностей с постоянным радиусом. \en Fillet of two surfaces with a constant radius.
ft_EllipticalFillet = 1, ///< \ru Скругление двух поверхностей с "дугой эллипса". \en Fillet of two surfaces by an "arc of an ellipse".
ft_ChordFillet = 2, ///< \ru Скругление двух поверхностей с постоянной хордой. \en Fillet of two surfaces with a constant chord.
ft_LawFillet = 3, ///< \ru Скругление двух поверхностей с радиусом, меняющимся по закону. \en Fillet of two surfaces with a radius that varies according to the law.
ft_KerbFillet = 4, ///< \ru Скругление поверхности и кромки с постоянным радиусом. \en Fillet surface and kerb-curve with constant radius.
ft_KerbLawFillet = 5, ///< \ru Скругление поверхности и кромки с радиусом по закону. \en Fillet surface and kerb-curve with a radius that varies according to the law.
ft_KerbTouchingFillet = 6 ///< \ru Скругление двух поверхностей по кромке одной из них. \en Fillet of two surfaces with the specified kerb-curve of touching
};
protected:
MbCurve3D * curve0; ///< \ru Кривая пересечения касательных к поверхностям - всегда не nullptr. \en Intersection curve of tangents to surfaces - always not nullptr.
MbFunction * weights0; ///< \ru Функция веса точек средней кривой curve0. \en Function of weight of points of curve0 mid-curve.
@@ -55,6 +84,26 @@ protected:
MbCurve3D * spine; ///< \ru Кривая центров дуг окружности для случая равномерной параметризации. \en Curve of centers of circular arcs in case of uniform parameterization.
MbVector3D * spineDerUMin; // \ru Производные spine в точках uMin и uMax ( для случая равномерной параметризации ). \en Derivatives of spine at uMin and uMax points (in case of uniform parameterization).
MbVector3D * spineDerUMax; // \ru Производные spine в точках uMin и uMax ( для случая равномерной параметризации ). \en Derivatives of spine at uMin and uMax points (in case of uniform parameterization).
MbeFilletSurfaceVersion version; ///< \ru Версия \en Version.
protected:
//------------------------------------------------------------------------------
/** \brief \ru Вспомогательные данные.
\en Auxiliary data. \~
\details \ru Вспомогательные данные служат для ускорения работы объекта.
\en Auxiliary data are used for fast calculations. \n \~
*/
// ---
class MbFilletSurfaceAuxiliaryData : public AuxiliaryData {
public:
MbFilletSurfaceCacheData * data;
MbFilletSurfaceAuxiliaryData();
MbFilletSurfaceAuxiliaryData( const MbFilletSurfaceAuxiliaryData & aux );
void Reset();
void CreateCache( const MbFilletSurfaceCacheData * init );
void DeleteCache() ;
virtual ~MbFilletSurfaceAuxiliaryData() { DeleteCache(); }
};
mutable CacheManager<MbFilletSurfaceAuxiliaryData> cache;
public:
@@ -145,6 +194,121 @@ public:
MbSurface & surf2, MbCurve & curv2,
MbCurve3D & curv0, double d1, double d2, MbeSmoothForm fm, double cn, bool ev );
/** \brief \ru Создать поверхность скругления по двум поверхностям с постоянным радиусом.
\en Create a fillet surface by two surfaces with a constant radius. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] cn - \ru Коэффициент формы, изменяется от 0.05 до 0.95 (при 0 - дуга окружности)
\en Coefficient of shape is changed between 0.05 and 0.95 (if 0 - circular arc) \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateSimpleFillet( double rad, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, double conicFact, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям "дугой эллипса".
\en Create a fillet surface by two surfaces by an "arc of an ellipse". \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] rad1 - \ru Радиус скругления со знаком для поверхности кривой curv1
\en Fillet radius with sign for surface of curv1 curve \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] rad2 - \ru Радиус скругления со знаком для поверхности кривой curv2
\en Fillet radius with sign for surface of curv2 curve \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateEllipticalFillet( MbSurfaceCurve & curv1, double rad1, MbSurfaceCurve & curv2, double rad2, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям с постоянной хордой.
\en Create a fillet surface by two surfaces with a constant chord. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] h - \ru Величина хорды.
\en Fillet radius. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateChordFillet( double h, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, VERSION vers );
/** \brief \ru Создать поверхность скругления по поверхности и кромке с постоянным радиусом
\en Create fillet surface a constant radius by support surface and support kerb-curve. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] byFirst - \ru true - кривая curve2 является кромкой, false - кривая curve1 является кромкой
\en True - curve2 curve is fillet, false - curve1 curve is fillet. \~
\param[in] cn - \ru Коэффициент формы, изменяется от 0.05 до 0.95 (при 0 - дуга окружности)
\en Coefficient of shape is changed between 0.05 and 0.95 (if 0 - circular arc) \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateKerbFillet( double rad, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, bool byFirst, double conicFact, VERSION vers );
/// \ru Создать поверхность скругления по поверхности и кромке с касанием
/// \en
/** \brief \ru Создать поверхность скругления по двум поверхностям с указанием кромки касания
\en Create a fillet surface by two support surfaces, specifying the kerb-curve of touching \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] byFirst - \ru true - кривая curve2 является кромкой, false - кривая curve1 является кромкой
\en True - curve2 curve is fillet, false - curve1 curve is fillet. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateKerbTouchingFillet( MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, bool byFirst, VERSION vers );
protected:
/// \ru Конструктор для наследников обычной поверхности скругления. \en Constructor for inheritors of ordinary fillet surface.
MbFilletSurface( MbSurfaceCurve & curv1, double d1,
@@ -181,6 +345,7 @@ public:
\en \name Common functions of a geometric object
\{ */
MbeSpaceType IsA() const override; // \ru Тип элемента \en A type of element
MbeFilletSurfaceVersion GetVersion() const { return version; } ///< \ru Версия \en Version.
MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const override; // \ru Сделать копию элемента. \en Create a copy of the element.
bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const override;
bool SetEqual ( const MbSpaceItem & ) override; // \ru Сделать равным. \en Make equal.
@@ -248,6 +413,10 @@ public:
void Explore( double & u, double & v, bool ext,
MbCartPoint3D & pnt, MbVector3D & uDer, MbVector3D & vDer,
MbVector3D * uuDer, MbVector3D * vvDer, MbVector3D * uvDer, MbVector3D * nor ) const override;
/// \ru Вычислить двумерные значения точки и производных для опорной кривой (0 - первая, иначе - вторая) (для внутреннего использования)
/// \en Calculate the two-dimensional values of the point and derivatives for the surface curve (0 - first, otherwise - second) (for internal use) \~
bool SurfaceCurveExplore( size_t ind, double t, MbCartPoint & pnt, MbVector * fir, MbVector * sec, MbVector * thir ) const;
// \ru Вычислить значения всех производных в точке. \en Calculate all derivatives at point. \~
void _PointNormal( double u, double v,
MbCartPoint3D & pnt, MbVector3D & uDer, MbVector3D & vDer,
@@ -321,6 +490,15 @@ public:
void GetTesselation( const MbStepData & stepData,
double u1, double u2, double v1, double v2,
SArray<double> & uu, SArray<double> & vv ) const override;
/// \ru Опорная кривая на первой поверхности. \en Support curve on the first surface.
void GetCurve1( SPtr<const MbSurfaceCurve> & c ) const override;
/// \ru Опорная кривая на второй поверхности. \en Support curve on the second surface.
void GetCurve2( SPtr<const MbSurfaceCurve> & c ) const override;
/// \ru Дать опорную кривую на первой поверхности для изменения. \en Get the support curve on the first surface for changing.
void SetCurve1( SPtr<MbSurfaceCurve> & c ) override;
/// \ru Дать опорную кривую на второй поверхности для изменения. \en Get the support curve on the second surface for changing.
void SetCurve2( SPtr<MbSurfaceCurve> & c ) override;
/** \} */
/** \ru \name Функции поверхности скругления
@@ -405,8 +583,8 @@ public:
double GetVPeriod( double u ) const;
/// \ru Кривая пересечения касательных к поверхностям. \en Intersection curve of tangents to surfaces.
const MbCurve3D & GetCurve0() const { return *curve0; }
const MbCurve3D * GetCurve0() const { return curve0; }
/** \brief \ru Скругление не круговое.
\en Fillet isn't circular. \~
\details \ru Скругление не круговое.
@@ -484,6 +662,7 @@ bool SetWeights( MbFunction & func );
MbCurve3D * GetSpine() const;
void SetSpine( MbCurve3D * );
MbeFilletSurfType GetFilletType() const; // \ru Выдать тип скругления. \en Get fillet type.
/** \} */
protected:
@@ -596,7 +775,23 @@ protected:
// \ru Проверка параметров. \en Check parameters.
void CheckUParam( double & u ) const;
void CheckVParam( double & v ) const;
// Расчет производных опорных кривых для случая скругления по двум поверхностям (постоянный, элиптический, хорда, закон)
void FilletCaseDerivatives( ptrdiff_t ord, double a, double b, MbFilletSurfaceCacheData & dat ) const;
// Расчет производных опорных кривых для случая скругления поверхности и кромки (постоянный)
void KerbCaseDerivatives( ptrdiff_t ord, const MbSurfaceCurve * (&curves)[2], double (&uu)[2], MbFilletSurfaceCacheData & dat ) const;
// Расчет производных опорных кривых для случая поверхности скругления по двум поверхностям с кромкой на одной из них
void KerbTouchingCaseDerivatives( ptrdiff_t ord, const MbSurfaceCurve * (&curves)[2], double (&uu)[2], MbFilletSurfaceCacheData & dat ) const;
// Расчитать производные опорных кривых.
void CalculateCurvesDerivatives( double u, ptrdiff_t ord, MbFilletSurfaceCacheData & dat ) const;
// Расчитать производные поверхности.
void Explore( double & u, double & v, bool ext, ptrdiff_t ordU, MbFilletSurfaceCacheData & dat ) const;
bool NeedInsertPoints() override { return version == fsv_Ver0; } // Есть ли необходимость вставки новых точек.
MbSurfaceCurve * GetExactCurve( size_t ind ); // Получить опорную кривую.
const MbSurfaceCurve * GetExactCurve( size_t ind ) const; // Получить опорную кривую.
#ifdef C3D_DEBUG
bool TestDerivatives() const; // Тестирование корректности математики поверхности.
#endif // C3D_DEBUG
void operator = ( const MbFilletSurface & ); // \ru Не реализовано. \en Not implemented.
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbFilletSurface )
+1
View File
@@ -19,6 +19,7 @@
#include <function.h>
#include <tool_multithreading.h>
#include <surf_tessellation.h>
#include <map>
class MATH_CLASS MbSurfaceCurve;
+20 -11
View File
@@ -12,11 +12,12 @@
#include <surface.h>
#include <cur_surface_curve.h>
#include <templ_sptr.h>
constexpr bool _EVEN_ = false; // \ru Неравномерная параметризация по дуге при u = const \en Uneven parameterization along an arc where u = const
class MATH_CLASS MbSurfaceCurve;
class MATH_CLASS MbSurfaceIntersectionCurve;
@@ -227,15 +228,23 @@ public:
/// \ru Дать коэффициент для радиуса. \en Get coefficient for radius.
virtual double DistanceRatio( bool firstCurve, MbCartPoint3D & p, double distance ) const;
/// \ru Опорная кривая на первой поверхности. \en Support curve on the first surface.
const MbSurfaceCurve & GetCurve1() const { return *curve1; }
/// \ru Опорная кривая на второй поверхности. \en Support curve on the second surface.
const MbSurfaceCurve & GetCurve2() const { return *curve2; }
/// \ru Дать опорную кривую на первой поверхности для изменения. \en Get the support curve on the first surface for changing.
MbSurfaceCurve & SetCurve1() const { return *curve1; }
/// \ru Дать опорную кривую на второй поверхности для изменения. \en Get the support curve on the second surface for changing.
MbSurfaceCurve & SetCurve2() const { return *curve2; }
/// \ru Опорная кривая на первой поверхности. Для внутреннего использования. Всегда устанавливает не null.
/// \en Support curve on the first surface. For internal use. Always sets not null.
virtual void GetCurve1( SPtr<const MbSurfaceCurve> & c ) const { c = curve1; }
/// \ru Опорная кривая на второй поверхности. Для внутреннего использования. Всегда устанавливает не null.
/// \en Support curve on the second surface. For internal use. Always sets not null.
virtual void GetCurve2( SPtr<const MbSurfaceCurve> & c ) const { c = curve2; }
/// \ru Дать опорную кривую на первой поверхности для изменения. Для внутреннего использования. Всегда устанавливает не null.
/// \en Get the support curve on the first surface for changing. For internal use. Always sets not null.
virtual void SetCurve1( SPtr<MbSurfaceCurve> & c ) { c = curve1; }
/// \ru Дать опорную кривую на второй поверхности для изменения. Для внутреннего использования. Всегда устанавливает не null.
/// \en Get the support curve on the second surface for changing. For internal use. Always sets not null.
virtual void SetCurve2( SPtr<MbSurfaceCurve> & c ) { c = curve2; }
/// \ru Дать первую опорную поверхность. \en Get the first surface.
const MbSurface & GetSurface1() const;
/// \ru Дать вторую опорную поверхность. \en Get the second surface.
const MbSurface & GetSurface2() const;
/** \brief \ru Построить граничную кривую вдоль поверхности (V = const).
\en Construct boundary curve along a surface (V = const). \~
\details \ru Построить граничную кривую вдоль поверхности (V = const).
@@ -333,6 +342,7 @@ protected:
void InitSmoothSurface ( const MbSmoothSurface & );
void Init ( const MbSmoothSurface & );
virtual bool NeedInsertPoints() { return true; }
private:
// \ru Определениe точки пересечения края поверхности и кривой на смежной поверхности. \en Determination of intersection point between the surface boundary and the adjacent surface.
@@ -409,5 +419,4 @@ MbSmoothSurface * CreateSmoothSurface( const MbSurface & surface1, SArray<MbCart
MbeSmoothForm form, bool firstFree, double distance1, double distance2,
double conic, bool even, ptrdiff_t begN, ptrdiff_t endN, VERSION version );
#endif // __SURF_SMOOTH_SURFACE_H
+7
View File
@@ -1382,6 +1382,13 @@ public:
virtual bool GetMatrixToSurface( const MbSurface & surf, MbMatrix & matr, VERSION version, double precision = METRIC_PRECISION ) const;
/// \ru Определить, выпуклая ли поверхность. \en Determine whether the surface is convex.
/** \brief \ru Определить, выпуклая ли поверхность.
\en Determine whether the surface is convex. \~
\details \ru Определить, выпуклая ли поверхность.
\en Determine whether the surface is convex.
\result \ru ts_positive - поверхность выпуклая, ts_negative - поверхность вогнутая, ts_neutral - невозможно опеределить.
\en ts_positive - the surface is convex, ts_negative - the surface is concave, ts_neutral - impossible to determine. \~
*/
virtual ThreeStates Salient() const;
/** \brief \ru Вычислить ближайшее расстояние до кривой.
+3
View File
@@ -191,6 +191,8 @@ public:
inline const NodeList & GetNodes() { return nodes; }
/// \ru Получить множество точек. \en Get points set.
inline const PointList & GetPoints() { return points; }
/// \ru Получить индексы точек. \en Get indices of points.
inline const IndexList & GetIndices() { return indices; }
/// \ru Получить глубину дерева. \en Get depth of tree.
inline size_t GetNumLevel() { return numLevel; }
/// \ru Получить ограничивающий куб. \en Get axis aligned bounding box.
@@ -468,6 +470,7 @@ void KdTree<Scalar>::GetRadiusNeighbors( const MbCartPoint3D & queryPoint, doubl
}
}
//-------------------------------------------------------------------------------
// \ru Разделить часть массива между индексами start и end на две части, одна из которых меньше
// чем splitValue, другое с элементами больше или равными чем splitValue. Сравнение элементов
+1 -1
View File
@@ -109,7 +109,7 @@ public :
TEMPLATE_FRIEND void qp_sort TEMPLATE_SUFFIX ( SFPArray<Type> &, bool always );
private:
OBVIOUS_PRIVATE_COPY( SFPArray<Type> )
OBVIOUS_PRIVATE_COPY( SFPArray );
// \ru Т.к. наследование private, то сделаем здесь операторы чтения-записи \en Since there is a private inheritance, then make here operators of reading/writing
//ID K8 KNOWN_OBJECTS_RW_REF_OPERATORS( SFPArray<Type> )
+2 -2
View File
@@ -351,10 +351,10 @@ inline CommonMutex* CacheManager<T>::GetLockHard()
{
if ( lock == nullptr ) {
CommonMutex* ll = GetGlobalLock();
ll->lock();
ll->Lock();
if ( lock == nullptr )
lock = new CommonMutex();
ll->unlock();
ll->Unlock();
}
return lock;
}
+4 -4
View File
@@ -180,10 +180,10 @@ public:
/** \brief \ru Установить блокировку. \en Set a lock. \~
*/
void lock();
void Lock();
/** \brief \ru Снять блокировку. \en Unset a lock. \~
*/
void unlock();
void Unlock();
private:
// \ru Запрет копирования. \en Copy forbidden.
@@ -415,7 +415,7 @@ class MATH_CLASS ScopedLock
{
CommonMutex* m_mutex;
public:
ScopedLock( CommonMutex* mutex, bool parallelCheck = true );
ScopedLock( CommonMutex* mtx, bool parallelCheck = true );
~ScopedLock();
/** \brief \ru Выполнена ли реальная блокировка. \en Whether a real locking performed. \~
@@ -440,7 +440,7 @@ class MATH_CLASS ScopedRecursiveLock
{
CommonRecursiveMutex* m_mutex;
public:
ScopedRecursiveLock( CommonRecursiveMutex* mutex, bool parallelCheck = true );
ScopedRecursiveLock( CommonRecursiveMutex* mtx, bool parallelCheck = true );
~ScopedRecursiveLock();
/** \brief \ru Выполнена ли реальная блокировка. \en Whether a real locking performed. \~
+8
View File
@@ -1949,6 +1949,14 @@ public:
bool UpdateLoopRect( size_t loopIndex );
/// \ru Сбросить габариты циклов. \en Reset rectangle bounds of loops.
void ResetLoopsRects() const;
/** \brief \ru Определить, выпуклая ли грань.
\en Determine whether the face is convex. \~
\details \ru Определить, выпуклая ли грань.
\en Determine whether the face is convex.
\result \ru ts_positive - грань выпуклая, ts_negative - грань вогнутая, ts_neutral - невозможно опеределить.
\en ts_positive - the face is convex, ts_negative - the face is concave, ts_neutral - impossible to determine. \~
*/
ThreeStates Salient() const;
public:
/// \ru Создан ли временный объект сопровождения грани? \en Is a temporary object for the maintenance of a face created?
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.