Extern :
- C3d primo salvataggio.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,334 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Функции для анализа кривизны поверхности.
|
||||
\en Functions for surface curvature analysis. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_CURVATURE_ANALYSIS_H
|
||||
#define __ACTION_CURVATURE_ANALYSIS_H
|
||||
|
||||
|
||||
#include <surface.h>
|
||||
#include <topology.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Алгоритмы поиска экстремумов на поверхности.
|
||||
\en Algorithms for finding extremes on the surface. \~
|
||||
\details \ru Константы, задающие вызываемый алгоритм поиска экстремальных значений функции на поверхности.
|
||||
\en Constants defining the called algorithm for searching for extreme values of a function on a surface. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
enum MbeExtremsSearchingMethod
|
||||
{
|
||||
esm_GradientDescent = 1, ///< \ru Mетод градиентного спуска. \en Gradient Descent Method.
|
||||
esm_LineSegregation = 2 ///< \ru Mетод выделения линий смены убывания / возрастания функции по u и по v. \en The method of segregation of lines of change of decrease / increase of the function in u and v directions.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Функция, заданная на поверхности.
|
||||
\en The function define on the surface. \~
|
||||
\details \ru Рассчитывает значение самой функции и ее градиент.
|
||||
\en Calculates the value of the function itself and its gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
typedef void( *SurfaceFunction )( const MbSurface & surf, // Поверхность,
|
||||
const MbCartPoint & pnt, // точка на поверхности
|
||||
double & func, // рассчитываемое значение функции,
|
||||
MbVector * der );// рассчитываемое значение вектора градиента (если указатель не нулевой).
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить в точке поверхности минимальную нормальную кривизну, а также ее градиент.
|
||||
\en Calculate at the point of the surface the minimum normal curvature, as well as its gradient. \~
|
||||
\details \ru Вычисляется значение кривизны и опционально значение ее градиента в точке (если передается ненулевой указатель).
|
||||
\en The curvature value is calculated and, optionally, its gradient value at a point (if a non-zero pointer is passed). \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] func - \ru Рассчитываемое значение кривизны.
|
||||
\en Calculated curvature value. \~
|
||||
\param[out] der - \ru Рассчитываемое значение градиента кривизны.
|
||||
\en The calculated value of the curvature gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) MinSurfaceCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, MbVector * der = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить в точке поверхности максимальну нормальную кривизну, а также ее градиент.
|
||||
\en Calculate at the point of the surface the maximum normal curvature, as well as its gradient. \~
|
||||
\details \ru Вычисляется значение кривизны и опционально значение ее градиента в точке (если передается ненулевой указатель).
|
||||
\en The curvature value is calculated and, optionally, its gradient value at a point (if a non-zero pointer is passed). \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] func - \ru Рассчитываемое значение кривизны.
|
||||
\en Calculated curvature value. \~
|
||||
\param[out] der - \ru Рассчитываемое значение градиента кривизны.
|
||||
\en The calculated value of the curvature gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) MaxSurfaceCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, MbVector * der = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить в точке поверхности гауссову кривизну, а также ее градиент.
|
||||
\en Calculate at a surface point the Gaussian curvature, as well as its gradient. \~
|
||||
\details \ru Вычисляется значение кривизны и опционально значение ее градиента в точке (если передается ненулевой указатель).
|
||||
\en The curvature value is calculated and, optionally, its gradient value at a point (if a non-zero pointer is passed). \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] func - \ru Рассчитываемое значение кривизны.
|
||||
\en Calculated curvature value. \~
|
||||
\param[out] der - \ru Рассчитываемое значение градиента кривизны.
|
||||
\en The calculated value of the curvature gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) GaussCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, MbVector * der = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить в точке поверхности среднюю кривизну, а также ее градиент.
|
||||
\en Calculate at the point of the surface the mean curvature, as well as its gradient. \~
|
||||
\details \ru Вычисляется значение кривизны и опционально значение ее градиента в точке (если передается ненулевой указатель).
|
||||
\en The curvature value is calculated and, optionally, its gradient value at a point (if a non-zero pointer is passed). \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] func - \ru Рассчитываемое значение кривизны.
|
||||
\en Calculated curvature value. \~
|
||||
\param[out] der - \ru Рассчитываемое значение градиента кривизны.
|
||||
\en The calculated value of the curvature gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) MeanCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, MbVector * der = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить в точке поверхности нормальную кривизна в направлении u , а также ее градиент.
|
||||
\en Calculate at the surface point the normal curvature in the direction of u, as well as its gradient. \~
|
||||
\details \ru Вычисляется значение кривизны и опционально значение ее градиента в точке (если передается ненулевой указатель).
|
||||
\en The curvature value is calculated and, optionally, its gradient value at a point (if a non-zero pointer is passed). \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] func - \ru Рассчитываемое значение кривизны.
|
||||
\en Calculated curvature value. \~
|
||||
\param[out] der - \ru Рассчитываемое значение градиента кривизны.
|
||||
\en The calculated value of the curvature gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) UNormalCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, MbVector * der = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить в точке поверхности нормальную кривизна в направлении v, а также ее градиент.
|
||||
\en Calculate at the surface point the normal curvature in the direction of v, as well as its gradient. \~
|
||||
\details \ru Вычисляется значение кривизны и опционально значение ее градиента в точке (если передается ненулевой указатель).
|
||||
\en The curvature value is calculated and, optionally, its gradient value at a point (if a non-zero pointer is passed). \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] func - \ru Рассчитываемое значение кривизны.
|
||||
\en Calculated curvature value. \~
|
||||
\param[out] der - \ru Рассчитываемое значение градиента кривизны.
|
||||
\en The calculated value of the curvature gradient. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) VNormalCurvature( const MbSurface & surf, const MbCartPoint & pnt, double & func, MbVector * der = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки поверхности, в которых выбранная кривизна принимает наибольшие по модулю значения.
|
||||
\en Find the points of the surface at which the selected curvature takes the largest in modulus values. \~
|
||||
\details \ru Ищутся точки, в которых выбранная кривизна принимает на поверхности наибольшее положительное и наименьшее отрицательное значение.
|
||||
\en Looks for points at which the selected curvature takes on the surface the greatest positive and least negative value. \~
|
||||
\param[in] surf - \ru Исследуемая поверхность.
|
||||
\en Test surface. \~
|
||||
\param[in] func - \ru Функция расчета кривизны в точке.
|
||||
\en The function of calculating the curvature at a point. \~
|
||||
\param[out] maxNegCurv - \ru Наибольшее по модулю отрицательное значение кривизны (0, если нет такого).
|
||||
\en The largest in modulus value negative curvature (0, if there is no such). \~
|
||||
\param[out] maxNegLoc - \ru Точка, в которой кривизна принимает наибольшее по модулю отрицательное значение.
|
||||
\en The point at which the curvature takes the largest in modulus negative value. \~
|
||||
\param[out] maxPosCurv - \ru Наибольшее положительное значение кривизны (0, если нет такого).
|
||||
\en The greatest positive value of curvature (0, if there is no such). \~
|
||||
\param[out] maxPosLoc - \ru Точка, в которой кривизна принимает наибольшее положительное значение.
|
||||
\en The point at which the curvature takes the most positive value. \~
|
||||
\param[in] method - \ru Алгоритм поиска экстремумов.
|
||||
\en Extremum search algorithm. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) SurfaceMinMaxCurvature(const MbSurface & surface, SurfaceFunction func, double & maxNegCurv, MbCartPoint & maxNegLoc,
|
||||
double & maxPosCurv, MbCartPoint & maxPosLoc, MbeExtremsSearchingMethod method = esm_LineSegregation );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки оболочки, в которых выбранная кривизна принимает наибольшие по модулю значения.
|
||||
\en Find the points of the shell at which the selected curvature takes the most modulo values. \~
|
||||
\details \ru Ищутся точки на оболочке, в которых выбранная кривизна принимают наибольшее положительное и наименьшее отрицательное значение.
|
||||
\en Finds points on the shell at which the selected curvature takes the largest positive and lowest negative values. \~
|
||||
\param[in] faces - \ru Грани оболочки.
|
||||
\en Faces of the shell. \~
|
||||
\param[in] func - \ru Функция расчета кривизны в точке.
|
||||
\en The function of calculating the curvature at a point. \~
|
||||
\param[out] maxNegCurv - \ru Наибольшее по модулю отрицательное значение кривизны (0, если нет такого).
|
||||
\en The largest in modulus value negative curvature (0, if there is no such). \~
|
||||
\param[out] maxNegFace - \ru Грань, в которой кривизна принимает наибольшее по модулю отрицательное значение.
|
||||
\en The face at which the curvature takes the largest in modulus negative value. \~
|
||||
\param[out] maxNegLoc - \ru Точка, в которой кривизна принимает наибольшее по модулю отрицательное значение.
|
||||
\en The point at which the curvature takes the largest in modulus negative value. \~
|
||||
\param[out] maxPosCurv - \ru Наибольшее положительное значение кривизны (0, если нет такого).
|
||||
\en The greatest positive value of curvature (0, if there is no such). \~
|
||||
\param[out] maxPosFace - \ru Грань, в которой кривизна принимает наибольшее положительное значение.
|
||||
\en The face at which the curvature takes the most positive value. \~
|
||||
\param[out] maxPosLoc - \ru Точка, в которой кривизна принимает наибольшее положительное значение.
|
||||
\en The point at which the curvature takes the most positive value. \~
|
||||
\param[in] borderControl - \ru Учитывать границы граней при поиске экстремумов.
|
||||
\en Take into account the boundaries of the faces when searching for extrema. \~
|
||||
\param[in] method - \ru Алгоритм поиска экстремумов.
|
||||
\en Extremum search algorithm. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) FacesMinMaxCurvature( const RPArray<MbFace> & faces, SurfaceFunction func, double & maxNegCurv, MbFace *& maxNegFace, MbCartPoint & maxNegLoc,
|
||||
double & maxPosCurv, MbFace *& maxPosFace, MbCartPoint & maxPosLoc, bool borderControl = false,
|
||||
MbeExtremsSearchingMethod method = esm_LineSegregation );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки на поверхности, в которых главные нормальные кривизны принимают наибольшие по модулю значения.
|
||||
\en Find the points on the surface at which the major normal curvatures take the largest values in the module. \~
|
||||
\details \ru Ищутся точки на поверхности, в которых главные нормальные кривизны принимают наибольшее положительное и наименьшее отрицательное значение.
|
||||
\en Looks for points on the surface at which the major normal curvatures take the largest positive and smallest negative values. \~
|
||||
\param[in] surf - \ru Исследуемая поверхность.
|
||||
\en Test surface. \~
|
||||
\param[out] maxNegCurv - \ru Наибольшее по модулю отрицательное значение кривизны (0, если нет такого).
|
||||
\en The largest in modulus value negative curvature (0, if there is no such). \~
|
||||
\param[out] maxNegLoc - \ru Точка, в которой кривизна принимает наибольшее по модулю отрицательное значение.
|
||||
\en The point at which the curvature takes the largest in modulus negative value. \~
|
||||
\param[out] maxPosCurv - \ru Наибольшее положительное значение кривизны (0, если нет такого).
|
||||
\en The greatest positive value of curvature (0, if there is no such). \~
|
||||
\param[out] maxPosLoc - \ru Точка, в которой кривизна принимает наибольшее положительное значение.
|
||||
\en The point at which the curvature takes the most positive value. \~
|
||||
\param[in] method - \ru Алгоритм поиска экстремумов.
|
||||
\en Extremum search algorithm. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) SurfaceMinMaxCurvature(const MbSurface & surface, double & maxNegCurv, MbCartPoint & maxNegLoc,
|
||||
double & maxPosCurv, MbCartPoint & maxPosLoc, MbeExtremsSearchingMethod method = esm_LineSegregation );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки на оболочке, в которых главные нормальные кривизны принимают наибольшие по модулю значения.
|
||||
\en Find the points on the shell at which the major normal curvatures take the largest values in the module. \~
|
||||
\details \ru Ищутся точки на оболочке, в которых главные нормальные кривизны принимают наибольшее положительное и наименьшее отрицательное значение.
|
||||
\en Looks for points on the shell at which the major normal curvatures take the largest positive and smallest negative values. \~
|
||||
\param[in] faces - \ru Грани оболочки.
|
||||
\en Faces of the shell. \~
|
||||
\param[out] maxNegCurv - \ru Наибольшее по модулю отрицательное значение кривизны (0, если нет такого).
|
||||
\en The largest in modulus value negative curvature (0, if there is no such). \~
|
||||
\param[out] maxNegFace - \ru Грань, в которой кривизна принимает наибольшее по модулю отрицательное значение.
|
||||
\en The face at which the curvature takes the largest in modulus negative value. \~
|
||||
\param[out] maxNegLoc - \ru Точка, в которой кривизна принимает наибольшее по модулю отрицательное значение.
|
||||
\en The point at which the curvature takes the largest in modulus negative value. \~
|
||||
\param[out] maxPosCurv - \ru Наибольшее положительное значение кривизны (0, если нет такого).
|
||||
\en The greatest positive value of curvature (0, if there is no such). \~
|
||||
\param[out] maxPosFace - \ru Грань, в которой кривизна принимает наибольшее положительное значение.
|
||||
\en The face at which the curvature takes the most positive value. \~
|
||||
\param[out] maxPosLoc - \ru Точка, в которой кривизна принимает наибольшее положительное значение.
|
||||
\en The point at which the curvature takes the most positive value. \~
|
||||
\param[in] borderControl - \ru Учитывать границы граней при поиске экстремумов.
|
||||
\en Take into account the boundaries of the faces when searching for extrema. \~
|
||||
\param[in] method - \ru Алгоритм поиска экстремумов.
|
||||
\en Extremum search algorithm. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) FacesMinMaxCurvature( const RPArray<MbFace> & faces, double & maxNegCurv, MbFace *& maxNegFace, MbCartPoint & maxNegLoc,
|
||||
double & maxPosCurv, MbFace *& maxPosFace, MbCartPoint & maxPosLoc, bool borderControl = false,
|
||||
MbeExtremsSearchingMethod method = esm_LineSegregation );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Ориентированная кривизна для плоской кривой.
|
||||
\en Oriented curvature for a plane curve. \~
|
||||
\details \ru Для плоской кривой функция возвращает кривизну в точке, ориентированную относительно нормали плоскости,
|
||||
в которой она лежит. Для неплоской кривой функция просто возвращает кривизну в точке.
|
||||
\en For a flat curve, the function returns the curvature at a point oriented relative to the normal to the plane,
|
||||
in which she lies. For a non-flat curve, the function simply returns the curvature at the point. \~
|
||||
\param[in] curve - \ru Исследуемая кривая.
|
||||
\en Test curve. \~
|
||||
\param[in] param - \ru Параметр на кривой.
|
||||
\en Parameter on the curve. \~
|
||||
\param[in] planeNorm - \ru Нормаль плоскости, в которой лежит кривая. Если нормаль не передается в функцию, алгоритм самостоятельно
|
||||
выполняет проверку, лежит ли кривая в плоскости, и вычисляет нормаль, если проверка выполняется.
|
||||
\en The normal of the plane in which the curve lies. If the normal is not passed to the function, the algorithm itself
|
||||
checks if the curve is in the plane and calculates normal if the test is being performed. \~
|
||||
\return \ru Возвращается значение ориентированной кривизны в точке.
|
||||
\en The value of the oriented curvature at the point is returned. \~
|
||||
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( double ) CurveOrientedCurvature(const MbCurve3D & curve, double & param, const MbVector3D * planeNorm = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки на кривой, в которых кривизна принимает наибольшее и наименьшее значения.
|
||||
\en Find the points on the curve at which the curvature takes the largest and smallest values. \~
|
||||
\details \ru Для плоской кривой наибольшее и наименьшее значение может уходить в отрицательную область.
|
||||
Для неплоской кривой наибольшее и наименьшее значение всегда неотрицательны.
|
||||
\en For a flat curve, the largest and smallest value may go into the negative region.
|
||||
For a non-planar curve, the largest and smallest values are always non-negative. \~
|
||||
\param[in] curve - \ru Исследуемая кривая.
|
||||
\en Test curve. \~
|
||||
\param[out] maxCurv - \ru Наибольшее значение кривизны.
|
||||
\en The greatest value of curvature. \~
|
||||
\param[out] maxParam - \ru Точка, в которой кривизна принимает наибольшее значение.
|
||||
\en The point at which the curvature takes the largest value. \~
|
||||
\param[out] minCurv - \ru Наименьшее значение кривизны.
|
||||
\en The smallest value of curvature. \~
|
||||
\param[out] minParam - \ru Точка, в которой кривизна принимает наибольшее значение.
|
||||
\en The point at which the curvature takes the smallest value. \~
|
||||
\param[out] bendPoints - \ru Mассив параметров точек перегиба.
|
||||
\en Array of parameters of bend points. \~
|
||||
\param[out] maxPoints - \ru Mассив параметров, в которых достигается локальный максимум кривизны по модулю.
|
||||
\en An array of parameters in which the local maximum curvature modulo is reached. \~
|
||||
\param[out] minPoints - \ru Mассив параметров, в которых достигается локальный минимум кривизны по модулю.
|
||||
\en An array of parameters in which the local minimum curvature modulo is reached. \~
|
||||
\param[out] rapPoints - \ru Mассив параметров, в которых кривизна терпит разрыв.
|
||||
Для каждого разрыва вставляются две точки, до и после.
|
||||
\en Array of parameters in which curvature breaks.
|
||||
For each break two points are inserted, before and after. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) CurveMinMaxCurvature( const MbCurve3D & curve, double & maxCurv, double & maxParam, double & minCurv, double & minParam,
|
||||
std::vector<double> * bendPoints = NULL, std::vector<double> * maxPoints = NULL,
|
||||
std::vector<double> * minPoints = NULL, std::vector<c3d::DoublePair> * rapPoints = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Направление максимальной нормальной кривизны поверхности.
|
||||
\en The direction of the maximum normal surface curvature. \~
|
||||
\details \ru Вычисляется направление на поверхности, в котором нормальная кривизна поверхности принимает максимальное значение.
|
||||
\en The direction on the surface is calculated in which the normal curvature of the surface takes a maximum value. \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en Surface. \~
|
||||
\param[in] pnt - \ru Точка расчета.
|
||||
\en Point of calculation. \~
|
||||
\param[out] dir - \ru Рассчитываемое направление.
|
||||
\en The calculated direction. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
MATH_FUNC( void ) SurfaceMaxCurvatureDirection( const MbSurface & surf, const MbCartPoint & pnt, MbVector & dir );
|
||||
|
||||
#endif // __ACTION_CURVATURE_ANALYSIS_H
|
||||
@@ -0,0 +1,396 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Методы преобразования полигональных геометрических объектов в объекты BRep.
|
||||
\en Functions for conversion of the polygonal geometric object to BRep objects. \~
|
||||
\details \ru Методы преобразования полигональных геометрических объектов в объекты BRep.
|
||||
\en Functions for conversion of the polygonal geometric object to BRep objects. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_B_SHAPER_H
|
||||
#define __ACTION_B_SHAPER_H
|
||||
|
||||
|
||||
#include <mb_cart_point.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <mesh.h>
|
||||
#include <mb_enum.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <m2b_mesh_curvature.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbMesh;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbFace;
|
||||
class MATH_CLASS MbCollection;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Режим распознавания поверхностей.
|
||||
\en Surface reconstruction mode. \~
|
||||
\details \ru Режим распознавания поверхностей.
|
||||
\en Surface reconstruction mode. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
enum MbeSurfReconstructMode
|
||||
{
|
||||
srm_All = 0, ///< \ru Строить все поверхности. \en Build all surfaces.
|
||||
srm_NoGrids = 1, ///< \ru Не строить поверхности на базе триангуляции. \en Not build surfaces based on triangulation.
|
||||
srm_CanonicOnly = 2, ///< \ru Строить только элементарные поверхности. \en Build elementary surfaces only.
|
||||
srm_Default = srm_NoGrids ///< \ru Режим по умолчанию. \en Default mode.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Параметры построения оболочки тела по полигональной сетке.
|
||||
\en Parameters of BRep shell construction from polygonal mesh. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbMeshProcessorValues {
|
||||
public:
|
||||
|
||||
/** \brief \ru Использовать относительную точность (true).
|
||||
\en Use relative tolerance (true). \~
|
||||
\details \ru При использовании относительной точности отклонение граней тела от сетки проверяется относительно размера модели.
|
||||
\en While use of relative tolerance distance from shell to mesh is checked relative to model size. \~
|
||||
*/
|
||||
bool useRelativeTolerance;
|
||||
|
||||
/** \brief \ru Точность.
|
||||
\en Tolerance. \~
|
||||
\details \ru Точность работы метода: допустимое отклонение граней тела от вершин сетки.
|
||||
\en Tolerance: maximum distance from BRep faces to mesh vertices. \~
|
||||
*/
|
||||
double tolerance;
|
||||
|
||||
/** \brief \ru Режим распознавания поверхностей.
|
||||
\en Surface reconstruction mode. \~
|
||||
*/
|
||||
MbeSurfReconstructMode surfReconstructMode;
|
||||
|
||||
/// \ru Конструктор по умолчанию. \en Default constructor.
|
||||
explicit MbMeshProcessorValues( bool useRelTol = true, double tol = 0.01, MbeSurfReconstructMode mode = srm_Default )
|
||||
: useRelativeTolerance( useRelTol )
|
||||
, tolerance ( tol )
|
||||
, surfReconstructMode ( mode )
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Класс для создания оболочки в граничном представлении по полигональной сетке.
|
||||
\en Class for creating a BRep shell by polygonal mesh. \~
|
||||
\details \ru Предоставить интерфейс для управления преобразованием сетки в
|
||||
оболочку в граничном представлении. \n
|
||||
\en Provide an interface for managing of "Mesh to BRep" conversion. \n \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbMeshProcessor : public MbRefItem
|
||||
{
|
||||
protected:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbMeshProcessor();
|
||||
|
||||
public:
|
||||
/** \brief \ru Создать экземпляр процессора по коллекции.
|
||||
\en Create mesh processor by collection. \~
|
||||
\details \ru Создать экземпляр процессора по коллекции. Пользователь должен сам удалить объект.
|
||||
\en Create mesh processor by collection. User must delete created object. \~
|
||||
\param[in] collection - \ru Входная коллекция, содержащая треугольную сетку. \n
|
||||
\en Input collection containing triangle mesh. \~
|
||||
\return \ru Возвращает указатель на созданный объект.
|
||||
\en Returns pointer to created object. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
static MbMeshProcessor * Create( const MbCollection & collection );
|
||||
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbMeshProcessor();
|
||||
|
||||
/** \brief \ru Установить относительную точность.
|
||||
\en Set relative tolerance. \~
|
||||
\details \ru Установить относительную точность по габаритам текущей сетки.
|
||||
\en Set relative tolerance by current mesh box. \~
|
||||
\param[in] tolerance - \ru Относительная точность. \n
|
||||
\en Relative tolerance to set. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void SetRelativeTolerance( double tolerance ) = 0;
|
||||
|
||||
/** \brief \ru Установить точность.
|
||||
\en Set tolerance. \~
|
||||
\details \ru Установить точность распознавания поверхностей и расширения сегментов сетки.
|
||||
Метод должен быть вызван перед вызовом SegmentMesh.
|
||||
Точность по умолчанию равна 0.1.
|
||||
\en Set tolerance of surface reconstruction and segments extension.
|
||||
Method should be called before call to SegmentMesh.
|
||||
Default tolerance is 0.1. \n \~
|
||||
\param[in] tolerance - \ru Точность. \n
|
||||
\en Tolerance to set. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void SetTolerance( double tolerance ) = 0;
|
||||
|
||||
/** \brief \ru Получить точность.
|
||||
\en Get tolerance. \~
|
||||
\details \ru Получить текущую точность, используемую при распознавании поверхностей и расширения сегментов сетки.
|
||||
\en Get current tolerance used in surface reconstruction and segments extension. \~
|
||||
\return \ru Возвращает абсолютную точность.
|
||||
\en Returns absolute tolerance. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual double GetTolerance() const = 0;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Установить режим распознавания поверхностей.
|
||||
\en Set the surfaces reconstruction mode. \~
|
||||
\details \ru Задать типы поверхностей, генерируемых на сегментах. Поверхности неподдерживаемых типов строиться не будут. \n
|
||||
\en Set types of surfaces which will be generated on segments. The surfaces of unsupoprted type will not be built. \n \~
|
||||
\param[in] mode - \ru Режим распознавания поверхностей.
|
||||
\en Surface reconstruction mode.
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void SetReconstructionMode( MbeSurfReconstructMode mode ) = 0;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Установить флаг сглаживания входной сетки.
|
||||
\en Set flag to use smoothing of input mesh. \~
|
||||
\details \ru Установить флаг сглаживания входной сетки. Если флаг установлен в true,
|
||||
то перед запуском основного алгоритма сегментации будет выполнено сглаживание входной сетки.
|
||||
Рекомендуется использовать сглаживание на неточных сетках, например, полученных методом сканирования. \n
|
||||
\en Set flag to use smoothing of input mesh. If the flag set to true, then run smoothing of input mesh
|
||||
before main segmentation algorithm start.
|
||||
It is recommended to use mesh smoothing on inexact meshes, e.g. meshes obtained by scanning. \n \~
|
||||
\param[in] useSmoothing - \ru Флаг использования сглаживания входной сетки. По-умолчанию false.
|
||||
\en The flag to use smoothing of input mesh. Default false.
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
virtual void SetUseMeshSmoothing( bool useSmoothing ) = 0;
|
||||
|
||||
/** \brief \ru Получить исправленную (упрощенную) копию входной полигональной сетки.
|
||||
\en Get fixed (simplified) copy of the input mesh. \~
|
||||
\details \ru Получить исправленную копию входной сетки, на которой выполняются операции MbMeshProcessor:
|
||||
подсчет кривизн, сегментация, построение оболочки. Все индексы в выходных данных соответствуют
|
||||
индексам вершин и треугольников упрощенной сетки, возвращаемой данным методом. \n
|
||||
\en Get fixed copy of the input mesh. All further operations of MbMehsProcessor are
|
||||
performed for simplified mesh: curvature calculation, segmentation, shell creation.
|
||||
All indices in the output of these operations corresponds to indices of vertices and
|
||||
triangles of the simplified mesh returned from this function. \n \~
|
||||
\return \ru Возвращает исправленную версию входной полигональной сетки.
|
||||
\en Returns a fixed version of the input mesh. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual const MbCollection & GetSimplifiedMesh() = 0;
|
||||
|
||||
/** \brief \ru Получить сегментированную копию входной полигональной сетки.
|
||||
\en Get segmented copy of the input mesh. \~
|
||||
\details \ru Получить сегменитрованную копию входной сетки, на которой выполняются операции MbMeshProcessor:
|
||||
подсчет кривизн, сегментация, построение оболочки.
|
||||
Сегментация доступна внутри коллекции. \n
|
||||
\en Get segmented copy of the input mesh. All further operations of MbMehsProcessor are
|
||||
performed for simplified mesh: curvature calculation, segmentation, shell creation.
|
||||
Segmentation is stored inside collection. \n \~
|
||||
\return \ru Возвращает сегментированную версию входной полигональной сетки.
|
||||
\en Returns a segmented version of the input mesh. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual const MbCollection & GetSegmentedMesh() = 0;
|
||||
|
||||
/** \brief \ru Рассчитать главные кривизны и главные направления изменения кривизн в точках сетки.
|
||||
\en Calculate the principal curvatures and principal curvature directions at mesh points. \~
|
||||
\details \ru Рассчитать главные кривизны и главные направления изменения кривизн в точках сетки. \n
|
||||
\en Calculate the principal curvatures and principal curvature directions at mesh points. \n \~
|
||||
\return \ru Возвращает главные кривизны и главные направления в точках сетки.
|
||||
\en Returns principal curvatures and principal curvature directions at mesh points. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual const std::vector<MbCurvature> & CalculateCurvatures() = 0;
|
||||
|
||||
/** \brief \ru Сегментровать полигональную сетку.
|
||||
\en Segment a polygonal mesh. \~
|
||||
\details \ru Выполнить сегментацию полигональной сетки. \n
|
||||
\en Perform segmentation of a polygonal mesh. \n \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\param[in] createSurfaces - \ru Создавать ли поверхности на сегментах.
|
||||
\en Create surfaces on segments or not. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual MbResultType SegmentMesh( bool createSurfaces = true ) = 0;
|
||||
|
||||
/** \brief \ru Создать оболочку.
|
||||
\en Create shell. \~
|
||||
\details \ru Создать оболочку в граничном представлении, соответствующее модели, заданной полигональной сеткой.
|
||||
Используется текущая сегментация.
|
||||
Если сегментация не была вычислена, но вычисляется автоматическая сегментация (с параметрами по умолчанию). \n
|
||||
\en Create BRep shell that represents input mesh model.
|
||||
Current segmentation is used.
|
||||
If segmentation is not computed yet, then automatic segmentation is performed (with default paramters). \n \~
|
||||
\param[out] pShell - \ru Указатель на созданную оболочку.
|
||||
\en The pointer to created shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual MbResultType CreateBRepShell( MbFaceShell *& pShell ) = 0;
|
||||
|
||||
/** \brief \ru Вписать поверхность.
|
||||
\en Fit surface to segment . \~
|
||||
\details \ru Распознать поверхность по сегменту сетки с заданным индексом.
|
||||
Распознанная поверхность может быть получена с помощью метода GetSegmentSurface. \n
|
||||
\en Recognize surface for mesh segment with a given index.
|
||||
Recognized surface is available through GetSegmentSurface method. \n \~
|
||||
\param[in] idxSegment - \ru Индекс сегмента полигональной сетки.
|
||||
\en Index of a mesh segment. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void FitSurfaceToSegment( size_t idxSegment ) = 0;
|
||||
|
||||
/** \brief \ru Вписать поверхность заданного типа.
|
||||
\en Fit surface of a given type to a segment. \~
|
||||
\details \ru Построить поверхность заданного типа, аппроксимирующиую сегмент сетки с заданным индексом.
|
||||
Распознанная поверхность может быть получена с помощью метода GetSegmentSurface. \n
|
||||
\en Find surface of a given type approximating mesh segment with a given index.
|
||||
Recognized surface is available through GetSegmentSurface method. \n \~
|
||||
\param[in] idxSegment - \ru Индекс сегмента полигональной сетки.
|
||||
\en Index of a mesh segment. \~
|
||||
\param[in] surfaceType - \ru Тип вписываемой поверхности.
|
||||
\en Type of fitted surface. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void FitSurfaceToSegment( size_t idxSegment, MbeSpaceType surfaceType ) = 0;
|
||||
|
||||
/** \brief \ru Получить поверхность для сегмента.
|
||||
\en Get surface of segment. \~
|
||||
\details \ru Получить поверхность, вписанную в сегмент.
|
||||
Чтобы поверхность была определена предварительно должны быть вызваны методы
|
||||
SegmentMesh или FitSurfaceToSegment.
|
||||
Распознанная поверхность с помощью метода GetSegmentSurface. \n
|
||||
\en Get surface that approximates segment.
|
||||
To fit surface use corresponding methods SegmentMesh or FitSurfaceToSegment. \n \~
|
||||
\param[in] idxSegment - \ru Индекс сегмента полигональной сетки.
|
||||
\en Index of a mesh segment. \~
|
||||
\return \ru Возвращает указатель на поверхность для сегмента, если поверхность определена, иначе - NULL.
|
||||
\en Returns pointer to segment surface if it exists, else - NULL. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual const MbSurface * GetSegmentSurface( size_t idxSegment ) const = 0;
|
||||
|
||||
/** \brief \ru Очистить сегментацию полигональной сетки.
|
||||
\en Reset segmentation of the polygonal mesh. \~
|
||||
\details \ru Очистить сегментацию полигональной сетки, хранящуюся внутри MbMeshProcessor. \n
|
||||
\en Reset segmentation of the polygonal mesh stored inside MbMeshProcessor. \n \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void ResetSegmentation() = 0;
|
||||
|
||||
/** \brief \ru Найти ближайший путь между двумя вершинами коллекции.
|
||||
\en Find shortest path between two vertices. \~
|
||||
\details \ru Найти ближайший путь, проходящий по вершинам и ребрам коллекции, соединяющий две заданные вершины. \n
|
||||
\en Find shortest path between two vertices. The path should pass through collection vertices and edges. \n \~
|
||||
\param[in] v1 - \ru Индекс первой вершины.
|
||||
\en The index of first vertex. \~
|
||||
\param[in] v2 - \ru Индекс второй вершины.
|
||||
\en The index of second vertex. \~
|
||||
\param[out] path - \ru Путь из первой вершины во вторую.
|
||||
Массив содержит последовательные индексы всех вершин пути.
|
||||
\en The path from the first vertex to the second one.
|
||||
The array contains successive indices of path vertices. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual bool FindShortestVertexPath( uint v1, uint v2, std::vector<uint> & path ) = 0;
|
||||
|
||||
private: // UNDER DEVELOPMENT
|
||||
/** \} */
|
||||
/** \ru \name Функции для работы с разбиением сетки на сегменты и распознаванием поверхностей для сегментов.
|
||||
\en \name Functions for editting of mesh segmentation and reconstruction of surfaces for the segments.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Объединить два сегмента в текущей сегментации.
|
||||
\en Unite two segments in current segmentation. \~
|
||||
\details \ru Объединение сегментов в текущей сегментации.
|
||||
Результат объединения доступен через коллекцию, возвращаемую методом GetSegmentedMesh. \n
|
||||
\en Union of segments in current mesh segmentation.
|
||||
Result segmentation is available through collection returned by GetSegmentedMesh. \n \~
|
||||
\param[in] firstSegmentIdx - \ru Индекс первого сегмента для объединения. \n
|
||||
\en Index of the first segment for union. \~
|
||||
\param[in] secondSegmentIdx - \ru Индекс второго сегмента для объединения. \n
|
||||
\en Index of the second segment for union. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void UniteSegments( size_t firstSegmentIdx, size_t secondSegmentIdx ) = 0;
|
||||
|
||||
/** \brief \ru Сегментровать полигональную сетку по разделителям сегментов.
|
||||
\en Segment a polygonal mesh by segment separators. \~
|
||||
\details \ru Выполнить сегментацию полигональной сетки по заданным разделителям сегментов. \n
|
||||
\en Perform segmentation of a polygonal mesh by segment separators. \n \~
|
||||
\param[in] separators - \ru Массив разделителей.
|
||||
Каждый разделитель содержит путь по вершинам сетки, ребра которого разделяют сегменты.
|
||||
\en The array of segment separators.
|
||||
Each separator contains a path by mesh vertices. Edges of that path split mesh to segments. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual MbResultType SegmentMeshBySeparators( const std::vector<std::vector<uint>> & separators ) = 0;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbMeshProcessor )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку по полигональной сетке c автоматическим распознаванием поверхностей.
|
||||
\en Create shell from mesh with automatic surface reconstruction. \~
|
||||
\details \ru Создать оболочку в граничном представлении, соответствующее модели, заданной полигональной сеткой.
|
||||
Алгоритм в автоматическом режиме распознает и реконструирует грани, соответствующие элементарным
|
||||
поверхностям (плоскость, цилиндр, сфера, конус, тор). \n
|
||||
\en Create BRep shell that represents input mesh model.
|
||||
Algorithm automatically detect and reconstruct faces based on elementary surfaces (plane, cylinder, sphere, cone, torus). \n \~
|
||||
\param[in] mesh - \ru Входная сетка.
|
||||
\en The input mesh. \~
|
||||
\param[out] shell - \ru Указатель на созданную оболочку.
|
||||
\en The pointer to created shell. \~
|
||||
\param[in] params - \ru Параметры построения оболочки тела.
|
||||
\en Parameters of BRep shell construction. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC( MbResultType ) ConvertMeshToShell( MbMesh & mesh, MbFaceShell *& shell, const MbMeshProcessorValues & params = MbMeshProcessorValues() );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку по коллекции, содержащей полигональную сетку c автоматическим распознаванием поверхностей.
|
||||
\en Create shell from collection with automatic surface reconstruction. \~
|
||||
\details \ru Создать оболочку в граничном представлении, соответствующую модели, заданной полигональной сеткой.
|
||||
Алгоритм в автоматическом режиме распознает и реконструирует грани, соответствующие элементарным
|
||||
поверхностям (плоскость, цилиндр, сфера, конус, тор). \n
|
||||
\en Create BRep shell that represents input mesh model from collection.
|
||||
Algorithm automatically detect and reconstruct faces based on elementary surfaces (plane, cylinder, sphere, cone, torus). \n \~
|
||||
\param[in] collection - \ru Коллекция, содержащая входную сетку.
|
||||
\en The input collection. \~
|
||||
\param[out] shell - \ru Указатель на созданную оболочку.
|
||||
\en The pointer to created shell. \~
|
||||
\param[in] params - \ru Параметры построения оболочки тела.
|
||||
\en Parameters of BRep shell construction. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC( MbResultType ) ConvertCollectionToShell( MbCollection & collection, MbFaceShell *& shell, const MbMeshProcessorValues & params = MbMeshProcessorValues() );
|
||||
|
||||
#endif // __ACTION_B_SHAPER_H
|
||||
@@ -0,0 +1,757 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Методы построения двумерных кривых.
|
||||
\en Functions for two-dimensional curves construction. \~
|
||||
\details \ru Двумерные кривые могут быть построены с помощью аналитических функций,
|
||||
по набору точек, на базе других двумерных кривых.
|
||||
\en Two-dimensional curves can be constructed using analytical functions,
|
||||
for a point set or on the basis of other two-dimensional curves. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_CURVE_H
|
||||
#define __ACTION_CURVE_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_cart_point.h>
|
||||
#include <plane_item.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbContour;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbFace;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Перечисление способов создания эллипса (окружности) или их дуг в двумерном пространстве.
|
||||
\en Enumeration of ways to create an ellipse (circle) or their arcs in two-dimensional space. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
enum MbeArcCreateWay
|
||||
{
|
||||
/**
|
||||
\ru Окружность по центру и радиусу, задается 'center' и радиус в 'c'.
|
||||
\en Circle by center and radius, set the 'center' and radius in 'c'.
|
||||
*/
|
||||
acw_CircleByCenterAndRadius,
|
||||
|
||||
/**
|
||||
\ru Дуга окружности по центру и двум точкам.
|
||||
Задается: 'center', две точки в 'points', направление в 'option' (true - по часовой стрелке).
|
||||
Возвращается: начальный угол дуги в 'а', конечный угол в 'b', радиус в 'c'.
|
||||
\en Circular arc by center and two points.
|
||||
Set: 'center', two points in 'points', direction in 'option' (true - clockwise direction).
|
||||
Return: start angle in 'a', end in 'b', radius in 'c'.
|
||||
*/
|
||||
acw_ArcByCenterAnd2Points,
|
||||
|
||||
/**
|
||||
\ru Дуга окружности по центру и двум углам.
|
||||
Задается: 'center', начальный угол в 'a', конечный в 'b', радиус в 'c',
|
||||
направление в 'option' (true - по часовой стрелке). Углы задаются в радианах.
|
||||
\en Circular arc by center and two angles,
|
||||
Set: 'center', start angle in 'a', end in 'b', radius in 'c',
|
||||
direction in 'option' (true - clockwise direction). The angles are given in radians.
|
||||
*/
|
||||
acw_ArcByCenterAnd2Angles,
|
||||
/**
|
||||
\ru Дуга окружности по трем точкам, заданным в 'points', точки points[0] и points[2] конечные.
|
||||
Возвращается: начальный угол дуги в 'а', конечный угол в 'b', радиус в 'c'.
|
||||
\en Circular arc by three points specified in 'points', points[0] and points[2] are the end point.
|
||||
Return: start angle in 'a', end in 'b', radius in 'c'.
|
||||
*/
|
||||
acw_ArcBy3Points,
|
||||
|
||||
/**
|
||||
\ru Эллипс с заданными полуосями и углом наклона.
|
||||
Задается 'center', X полуось в 'a', Y полуось в 'b', угол наклона в 'с'. Угол задается в радианах.
|
||||
\en Ellipse by semiaxes and angle.
|
||||
Set : 'center', X semiaxis in 'a', Y semiaxis in 'b', angle in 'c'. The angle are given in radians.
|
||||
*/
|
||||
acw_EllipseByCenterAndSemiaxis,
|
||||
|
||||
/**
|
||||
\ru Эллипс по центру и трем точкам на нем.
|
||||
Задается 'center' и 3 точки в 'points'.
|
||||
Возвращаются: X полуось в 'a', Y полуось в 'b', угол наклона в 'с'. Угол задается в радианах.
|
||||
\en Ellipse by centre and three points on ellipse.
|
||||
Set: 'center', 3 points in 'points'.
|
||||
Return: X semiaxis in 'a', Y semiaxis in 'b', angle in 'c'. The angle are given in radians.
|
||||
*/
|
||||
acw_EllipseByCenterAnd3Points,
|
||||
|
||||
/**
|
||||
\ru Дуга эллипса, обрезанная двумя лучами из центра к заданным точкам.
|
||||
Задается 'center' и 2 точки в 'points', X полуось в 'a', Y полуось в 'b', угол наклона в 'с',
|
||||
направление в 'option' (true - по часовой стрелке). Угол задается в радианах.
|
||||
\en Elliptical arc is trimmed by two rays, starting from the center and passing through points.
|
||||
Set: 'center', 2 points in 'points', X semiaxis in 'a', Y semiaxis in 'b', angle in 'c',
|
||||
direction in 'option' (true - clockwise direction). The angle are given in radians.
|
||||
*/
|
||||
acw_EArcByCenterAnd2Points
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать прямую.
|
||||
\en Create a line. \~
|
||||
\details \ru Создать прямую по двум точкам. \n
|
||||
\en Create a line given two points. \n \~
|
||||
\param[in] point1 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] point2 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[out] result - \ru Прямая.
|
||||
\en The line. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) Line( const MbCartPoint & point1,
|
||||
const MbCartPoint & point2,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать отрезок прямой.
|
||||
\en Create a line segment. \~
|
||||
\details \ru Создать отрезок прямой по двум точкам. \n
|
||||
\en Create a line segment given two points. \n \~
|
||||
\param[in] point1 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] point2 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[out] result - \ru Отрезок.
|
||||
\en The segment. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) Segment( const MbCartPoint & point1,
|
||||
const MbCartPoint & point2,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать эллипс (окружность) или его дугу указанным способом.
|
||||
\en Create an ellipse (circle) or an elliptical (circular) arc in the specified way. \~
|
||||
\details \ru Создать эллипс (окружность) или его дугу указанным способом.\n Входные параметры интерпретируются в соответствии с выбранным путем создания.
|
||||
\en Create an ellipse (circle) or an elliptical (circular) arc in the specified way. \n The input parameters are interpreted according to the selected create way.
|
||||
\param[in] createWay - \ru Способ создания. Определяет как интерпретировать входные параметры.
|
||||
\en Create way. Defines how to interpret the input parameters.\~
|
||||
\param[in] center - \ru Центр
|
||||
\en Сenter. \~
|
||||
\param[in] points - \ru Конечные точки или точки через которые проходит кривая.
|
||||
\en Endpoints or points through which the curve passes. \~
|
||||
\param[in,out] a - \ru Интерпретация параметра зависит от способа создания дуги, см. enum #ArcCreateWay
|
||||
\en Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay. \~
|
||||
\param[in,out] b - \ru Интерпретация параметра зависит от способа создания дуги, см. enum #ArcCreateWay
|
||||
\en Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay. \~
|
||||
\param[in,out] с - \ru Интерпретация параметра зависит от способа создания дуги, см. enum #ArcCreateWay
|
||||
\en Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay. \~
|
||||
\param[in] option - \ru Интерпретация параметра зависит от способа создания дуги, см. enum #ArcCreateWay
|
||||
\en Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay. \~
|
||||
\param[out] result - \ru Эллипс (окружность) или его дуга.
|
||||
\en The ellipse (circle) or the elliptical (circular) arc. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
|
||||
MATH_FUNC( MbResultType ) Arc( MbeArcCreateWay createWay,
|
||||
const MbCartPoint & center,
|
||||
const std::vector<MbCartPoint> & points,
|
||||
double & a, double & b, double & c,
|
||||
bool option,
|
||||
MbCurve *& result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/**\attention \ru Функция устарела. Вместо неё применять #Arc.
|
||||
\en The function is deprecated. Use #Arc instead. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// 2018
|
||||
//---
|
||||
MATH_FUNC( MbResultType ) Arc( const MbCartPoint & centre,
|
||||
const SArray<MbCartPoint> & points,
|
||||
bool curveClosed, double angle,
|
||||
double & a, double & b,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать кривую, проходящую по набору точек.
|
||||
\en Create a curve passing through a set of points. \~
|
||||
\details \ru Создать кривую, проходящую по набору точек, следующего типа: \n
|
||||
- curveType == pt_LineSegment - отрезок, \n
|
||||
- curveType == pt_Arc - окружность или дуга, \n
|
||||
- curveType == pt_Polyline - ломаная, \n
|
||||
- curveType == pt_Bezier - кривая Безье, \n
|
||||
- curveType == pt_CubicSpline - кубический сплайн, \n
|
||||
- curveType == pt_Hermit - составной кубический сплайн Эрмита, \n
|
||||
- curveType == pt_Nurbs - неоднородный рациональный B-сплайн четвертого порядка (кубический). \n
|
||||
\en Create a curve passing through a set of points that has the following type: \n
|
||||
- curveType == pt_LineSegment - a line segment, \n
|
||||
- curveType == pt_Arc - a circle or an arc, \n
|
||||
- curveType == pt_Polyline - a polyline, \n
|
||||
- curveType == pt_Bezier - a Bezier curve, \n
|
||||
- curveType == pt_CubicSpline - a cubic spline, \n
|
||||
- curveType == pt_Hermit - a cubic Hermite spline, \n
|
||||
- curveType == pt_Nurbs - a nonuniform rational B-spline of fourth order (cubic). \n \~
|
||||
\param[in] pointList - \ru Набор точек.
|
||||
\en A point set. \~
|
||||
\param[in] curveClosed - \ru Замкнутость кривой.
|
||||
\en A curve closedness. \~
|
||||
\param[in] curveType - \ru Тип кривой.
|
||||
\en A curve type. \~
|
||||
\param[out] result - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SplineCurve( const SArray<MbCartPoint> & pointList,
|
||||
bool curveClosed, MbePlaneType curveType,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать NURBS-кривую.
|
||||
\en Create a NURBS-curve. \~
|
||||
\details \ru Создать NURBS-кривую, построенную по набору контрольных точек. \n
|
||||
Контейнер weightList может быть пустым. \n
|
||||
Контейнер knotList может быть пустым. \n
|
||||
\en Create a NURBS-curve given a sequence of control points. \n
|
||||
Container 'weightList' can be empty. \n
|
||||
Container 'knotList' can be empty. \n \~
|
||||
\param[in] pointList - \ru Множество точек.
|
||||
\en An array of points. \~
|
||||
\param[in] weightList - \ru Множество весов.
|
||||
\en An array of weights. \~
|
||||
\param[in] degree - \ru Порядок сплайна.
|
||||
\en A spline degree. \~
|
||||
\param[in] knotList - \ru Множество параметрических узлов (Узловой вектор).
|
||||
\en An array of parametric knots (A knot vector). \~
|
||||
\param[in] curveClosed - \ru Замкнутость кривой.
|
||||
\en A curve closedness. \~
|
||||
\param[out] result - \ru Сплайновая кривая.
|
||||
\en The spline curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) NurbsCurve( const SArray<MbCartPoint> & pointList,
|
||||
const SArray<double> & weightList, size_t degree,
|
||||
const SArray<double> & knotList, bool curveClosed,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать копию кривой в виде NURBS.
|
||||
\en Create a copy of a curve as a NURBS-curve. \~
|
||||
\details \ru Создать копию кривой в виде NURBS. \n
|
||||
\en Create a copy of a curve as a NURBS-curve. \n \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[out] result - \ru Сплайновая копия кривой.
|
||||
\en The spline copy of the curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) NurbsCopy( const MbCurve & curve,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать правильный многоугольник, вписанный в окружность или описанный вокруг окружности.
|
||||
\en Create a regular polygon inscribed in a circle or circumscribed around a circle. \~
|
||||
\details \ru Создать правильный многоугольник, вписанный в окружность (describe == false) или
|
||||
описанный вокруг окружности (describe == true) с центром centre, проходящей через point: \n
|
||||
- при vertexCount == 0 строится окружность с центром centre, проходящая через point, \n
|
||||
- при vertexCount == 1 строится отрезок c крайними точками centre и point, \n
|
||||
- при vertexCount == 2 строится прямоугольник со сторонами, параллельными глобальным осям и противоположными вершинами в centre и point, \n
|
||||
- при vertexCount >= 3 строится правильный многоугольник с заданным числом сторон,
|
||||
вписанный в окружность (describe == false) или описанный вокруг окружности (describe == true) с центром centre, проходящей через point: \n
|
||||
\en Create a regular polygon inscribed in a circle (describe == false) or
|
||||
circumscribed around a circle (describe == true) with the specified centre and passing through the given point: \n
|
||||
- if vertexCount == 0, a circle with center 'center' passing through 'point' is created, \n
|
||||
- if vertexCount == 1, a line segment with end points at 'centre' and 'point' is created, \n
|
||||
- if vertexCount, == 2 a rectangle aligned with the global axes with the opposite vertices at points 'centre' and 'point' is created, \n
|
||||
- if vertexCount >= 3, a regular polygon is created with a given number of sides,
|
||||
inscribed in a circle (describe == false) or circumscribed around a circle (describe == true) with the specified centre and passing through the given point: \n \~
|
||||
\param[in] centre - \ru Центр фигуры.
|
||||
\en A figure centre. \~
|
||||
\param[in] point - \ru Точка для построения.
|
||||
\en A point for the curve construction. \~
|
||||
\param[in] vertexCount - \ru Количество вершин правильного многоугольника.
|
||||
\en The number of vertices of a regular polygon. \~
|
||||
\param[in] describe - \ru Флаг построения многоугольника: описать вокруг окружности (true), вписать в окружность (false).
|
||||
\en A polygon construction flag: circumscribe the polygon around the circle, inscribe the polygon in the circle (false). \~
|
||||
\param[out] result - \ru Результат построения.
|
||||
\en The curve creation result. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) RegularPolygon( const MbCartPoint & centre,
|
||||
const MbCartPoint & point,
|
||||
size_t vertexCount,
|
||||
bool describe,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать косинусоиду.
|
||||
\en Create a cosine curve. \~
|
||||
\details \ru Создать косинусоиду по точкам, фазе и длине волны. \n
|
||||
\en Create a cosine curve given the points, phase and wave length. \n \~
|
||||
\param[in] point0 - \ru Начало локальной системы координат (ЛСК).
|
||||
\en The origin of local coordinate system (LCS). \~
|
||||
\param[in] point1 - \ru Точка на оси X ЛСК.
|
||||
\en A point on the X-axis of LCS. \~
|
||||
\param[in] point2 - \ru Точка на оси Y ЛСК.
|
||||
\en A point on the Y-axis of LCS. \~
|
||||
\param[in] phase - \ru Фаза.
|
||||
\en The phase. \~
|
||||
\param[in] waveLength - \ru Длина Волны.
|
||||
\en The wave length. \~
|
||||
\param[out] result - \ru Косинусоида.
|
||||
\en The cosine curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) Cosinusoid( const MbCartPoint & point0,
|
||||
const MbCartPoint & point1,
|
||||
const MbCartPoint & point2,
|
||||
double phase,
|
||||
double waveLength,
|
||||
MbCurve *& result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать косинусоиду.
|
||||
\en Create a cosine curve. \~
|
||||
\details \ru Создать косинусоиду по точкам, фазе и длине волны. \n
|
||||
\en Create a cosine curve given the points, phase and wave length. \n \~
|
||||
\param[in] origin - \ru Начало локальной системы координат (ЛСК).
|
||||
\en The origin of local coordinate system (LCS). \~
|
||||
\param[in] amplitude - \ru Амплитуда волны.
|
||||
\en The amplitude of the wave. \~
|
||||
\param[in] waveLength - \ru Длина Волны.
|
||||
\en The wave length. \~
|
||||
\param[in] wavesCount - \ru Количество волн.
|
||||
\en The number of waves. \~
|
||||
\param[in] phase - \ru Фаза.
|
||||
\en The phase. \~
|
||||
\param[out] result - \ru Косинусоида.
|
||||
\en The cosine curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) Cosinusoid( const MbCartPoint & origin,
|
||||
double amplitude,
|
||||
double waveLength,
|
||||
double wavesCount,
|
||||
double phase,
|
||||
MbCurve *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать составную кривую (контур).
|
||||
\en Create a composite curve (contour). \~
|
||||
\details \ru Создать составную кривую (контур) на базе исходной кривой. \n
|
||||
\en Create a composite curve (contour) on the basis of the given curve. \n \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[out] result - \ru Контур на основе кривой.
|
||||
\en The contour created on the basis of the curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) CreateContour( MbCurve & curve,
|
||||
MbContour *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать копию кривой.
|
||||
\en Create a copy of a curve. \~
|
||||
\details \ru Создать копию кривой с заменой некоторых кривых. \n
|
||||
\en Create a copy of a curve with substitution of some curves. \n \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\return \ru Возвращает модифицированную копию кривой, если получилось ее создать.
|
||||
\en Returns a modified copy of the curve if it has been successfully created. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) DuplicateCurve( const MbCurve & curve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать копию контура.
|
||||
\en Create a copy of a contour. \~
|
||||
\details \ru Создать копию контура с заменой некоторых кривых и его модификацией по флагу.
|
||||
Модификация - слияние подобных кривых и удаление вырожденных. \n
|
||||
\en Create a copy of a contour with substitution of some curves and its modification according to the flag.
|
||||
Modification is a merging of similar curves and deleting of degenerate ones. \n \~
|
||||
\param[in] cntr - \ru Исходный контур.
|
||||
\en The initial contour. \~
|
||||
\param[in] modifySegments - \ru Флаг разрешения замены и слияния сегментов.
|
||||
\en The flag determines whether segments can be replaced or merged. \~
|
||||
\param[in] names - \ru Именователь, синхронизированный с контуром.
|
||||
\en An object defining the names synchronized with contour. \~
|
||||
\return \ru Возвращает модифицированнную копию контура, если получилось его создать.
|
||||
\en Returns a modified copy of the contour if it has been successfully created. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbContour *) DuplicateContour( const MbContour & cntr,
|
||||
bool modifySegments,
|
||||
MbSNameMaker * names = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Создание эквидистантной кривой.
|
||||
/** \brief \ru Создать эквидистантную кривую.
|
||||
\en Create an offset curve. \~
|
||||
\details \ru Создать эквидистантную кривую по базовой кривой и смещению в крайних точках. \n
|
||||
\en Create the offset curve for a given curve with offset in the begin and the end points. \n \~
|
||||
\param[in] curve - \ru Базовая кривая.
|
||||
\en Base curve. \~
|
||||
\param[in] offset1 - \ru Смещение в точке Tmin базовой кривой.
|
||||
\en Offset distance on point Tmin of base curve. \~
|
||||
\param[in] offset2 - \ru Смещение в точке Tmax базовой кривой.
|
||||
\en Offset distance on point Tmax of base curve. \~
|
||||
\param[in] type - \ru Тип смещения точек: константный, линейный или кубический.
|
||||
\en The offset type: constant, or linear, or cubic. \~
|
||||
\return \ru Возвращает эквидистантную кривую.
|
||||
\en Returns the offset curve. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) OffsetCurve( const MbCurve & curve,
|
||||
double offset1,
|
||||
double offset2,
|
||||
MbeOffsetType type );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать эквидистантный контур.
|
||||
\en Create an offset contour. \~
|
||||
\details \ru Создать эквидистантный контур к исходному контуру. \n
|
||||
\en Create the offset contour for a given contour. \n \~
|
||||
\param[in] cntr - \ru Исходный контур.
|
||||
\en The initial contour. \~
|
||||
\param[in] rad - \ru Величина эквидистантного смещения.
|
||||
\en The offset value. \~
|
||||
\param[in] xEpsilon - \ru Точность по x.
|
||||
\en Tolerance in x direction. \~
|
||||
\param[in] yEpsilon - \ru Точность по y.
|
||||
\en Tolerance in y direction. \~
|
||||
\param[in] modifySegments - \ru Флаг разрешения замены и слияния сегментов.
|
||||
\en The flag determines whether segments can be replaced or merged. \~
|
||||
\param[in] version - \ru Версия исполнения.
|
||||
\en The version. \~
|
||||
\return \ru Возвращает эквидистантный контур, если получилось его создать.
|
||||
\en Returns the offset contour if it has been successfully created. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbContour *) OffsetContour( const MbContour & cntr,
|
||||
double rad,
|
||||
double xEpsilon,
|
||||
double yEpsilon,
|
||||
bool modifySegments,
|
||||
VERSION version = Math::DefaultMathVersion()/*BUG_61694*/ );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать эквидистантный контур, начинающийся и оканчивающийся на оси вращения.
|
||||
\en Create an offset contour with start and end points on the rotation axis. \~
|
||||
\details \ru Создать незамкнутый эквидистантный контур, начинающийся и оканчивающийся на оси вращения. \n
|
||||
Cчитается, что, если контур замкнуть, то он будет ориентирован против движения часовой стрелки. \n
|
||||
\en Create an open offset contour with start and end points on the rotation axis. \n
|
||||
It is considered that if one closes the contour, it will be oriented counterclockwise. \n \~
|
||||
\param[in] cntr - \ru Исходный контур.
|
||||
\en The initial contour. \~
|
||||
\param[in] q1 - \ru Начальная точка оси вращения.
|
||||
\en The start point of the rotation axis. \~
|
||||
\param[in] q2 - \ru Конечная точка оси вращения.
|
||||
\en The end point of the rotation axis. \~
|
||||
\param[in] rad - \ru Величина эквидистантного смещения.
|
||||
\en The offset value. \~
|
||||
\param[in] xEpsilon - \ru Точность по x.
|
||||
\en Tolerance in x direction. \~
|
||||
\param[in] yEpsilon - \ru Точность по y.
|
||||
\en Tolerance in y direction. \~
|
||||
\return \ru Возвращает эквидистантный контур, если получилось его создать.
|
||||
\en Returns the offset contour if it has been successfully created. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbContour *) AxisOffsetOpenContour( const MbContour & cntr,
|
||||
const MbCartPoint & q1,
|
||||
const MbCartPoint & q2,
|
||||
double rad,
|
||||
double xEpsilon,
|
||||
double yEpsilon );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Инициализировать кривую по новым параметрам.
|
||||
\en Initialize a curve with new parameters. \~
|
||||
\details \ru Инициализировать кривую по новым параметрам. \n
|
||||
\en Initialize a curve with new parameters. \n \~
|
||||
\param[in,out] curve - \ru Изменяемая кривая.
|
||||
\en The curve to be modified. \~
|
||||
\param[in] t1 - \ru Новый начальный параметр.
|
||||
\en A new start parameter. \~
|
||||
\param[in] t2 - \ru Новый конечный параметр.
|
||||
\en A new end parameter. \~
|
||||
\param[in] eps - \ru Точность.
|
||||
\en Tolerance. \~
|
||||
\return \ru Возвращает true, если получилось модифицировать кривую.
|
||||
\en Returns 'true' if the curve has been successfully modified. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) CurveTrim( MbCurve & curve,
|
||||
double t1,
|
||||
double t2,
|
||||
double eps = METRIC_PRECISION );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Добавить кривую в составную кривую (контур).
|
||||
\en Add a curve to a composite curve (a contour). \~
|
||||
\details \ru Добавить кривую curve в составную кривую (контур) contour. \n
|
||||
Если toEnd == true, то добавить в конец. \n
|
||||
Если toEnd == false, то добавить в начало. \n
|
||||
\en Add a curve to a composite curve (a contour) 'contour'. \n
|
||||
If toEnd == true, the curve is to be added to the end. \n
|
||||
If toEnd == true, the curve is to be added to the beginning. \n \~
|
||||
\param[in] curve - \ru Добавляемая кривая
|
||||
\en A curve to be added. \~
|
||||
\param[in,out] contour - \ru Модифицируемый контур.
|
||||
\en A contour to be modified. \~
|
||||
\param[in] toEnd - \ru Флаг места добавления кривой.
|
||||
\en The flag determines the place of the curve in the contour. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) AddCurveToContour( MbCurve & curve,
|
||||
MbContour & contour,
|
||||
bool toEnd );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти пересечения кривой с плоскостью.
|
||||
\en Calculate the intersections of a curve and a surface. \~
|
||||
\details \ru Найти пересечения кривой с плоскостью. \n
|
||||
Результат - массив точек или массив двумерных кривых на плоскости.
|
||||
\en Calculate the intersections of a curve and a surface. \n
|
||||
The result is an array of points or an array of two-dimensional curves on the plane. \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in] place - \ru Система координат плоскости.
|
||||
\en The plane coordinate system. \~
|
||||
\param[out] result - \ru Множество точек на плоскости.
|
||||
\en The array of points on the plane. \~
|
||||
\param[out] resultCurve - \ru Множество кривых на плоскости.
|
||||
\en The array of curves on the plane. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CurveSection( const MbCurve3D & curve,
|
||||
const MbPlacement3D & place,
|
||||
SArray<MbCartPoint> & result,
|
||||
RPArray<MbCurve> & resultCurve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти пересечения поверхности с плоскостью.
|
||||
\en Calculate the intersections of a surface and a plane. \~
|
||||
\details \ru Найти пересечения поверхности с плоскостью. \n
|
||||
Результат - массив кривых на поверхности и двумерных кривых на плоскости.
|
||||
\en Calculate the intersections of a surface and a plane. \n
|
||||
The result is an array of curves on the surface and two-dimensional curves on the plane. \~
|
||||
\param[in] surface - \ru Поверхность.
|
||||
\en A surface. \~
|
||||
\param[in] place - \ru Система координат плоскости.
|
||||
\en The plane coordinate system. \~
|
||||
\param[out] result - \ru Множество кривых на плоскости.
|
||||
\en The array of curves on the plane. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) SurfaceSection( const MbSurface & surface,
|
||||
const MbPlacement3D & place,
|
||||
RPArray<MbCurve> & result,
|
||||
VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать двумерный сегмент поверхности проецированием ориентированного ребра.
|
||||
\en Create a two-dimensional segment on a surface by projection of an oriented edge. \~
|
||||
\details \ru Создать двумерный сегмент поверхности проецированием ориентированного ребра. \n
|
||||
Результатом является двумерная кривая в параметрической области поверхности surface.
|
||||
\en Create a two-dimensional segment on a surface by projection of an oriented edge. \n
|
||||
The result is a two-dimensional curve in the parametric domain of the given surface. \~
|
||||
\param[in] face - \ru Грань поверхности.
|
||||
\en A face defined on the surface. \~
|
||||
\param[in] loopInd - \ru Номер цикла в грани.
|
||||
\en The number of a loop in the face. \~
|
||||
\param[in] edgeInd - \ru Номер проецируемого ребра в цикле.
|
||||
\en Index of the edge in the loop to be projected. \~
|
||||
\param[in] surface - \ru Поверхность проецирования.
|
||||
\en A surface to project on. \~
|
||||
\param[in] version - \ru Версия изготовления.
|
||||
\en Version. \~
|
||||
\param[out] result - \ru Двумерная кривая.
|
||||
\en A two-dimensional curve. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) FaceBoundSegment( const MbFace & face,
|
||||
size_t loopInd,
|
||||
size_t edgeInd, // \ru Проецируемое ребро грани \en The edge of face to be pojected.
|
||||
const MbSurface & surface, // \ru На поверхность \en On the surface
|
||||
VERSION version,
|
||||
MbCurve *& result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать двумерную границу поверхности проецированием пространственной кривой.
|
||||
\en Create a two-dimension boundary of a surface by projection of a space curve. \~
|
||||
\details \ru Создать двумерную границу поверхности проецированием пространственной кривой \n
|
||||
(предполагается, что пространственные граничные кривые лежат на поверхности). \n
|
||||
\en Create a two-dimension boundary of a surface by projection of a space curve \n
|
||||
(the boundary space curves are considered to belong to the surface) \n \~
|
||||
\param[in] surface - \ru Поверхность.
|
||||
\en A surface. \~
|
||||
\param[in] spaceCurve - \ru Пространственная кривая.
|
||||
\en A space curve. \~
|
||||
\param[in] version - \ru Версия изготовления.
|
||||
\en Version. \~
|
||||
\param[out] result - \ru Двумерный контур на поверхности.
|
||||
\en The two-dimensional contour on the surface. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SurfaceBoundContour( const MbSurface & surface,
|
||||
const MbCurve3D & spaceCurve,
|
||||
VERSION version,
|
||||
MbContour *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Скорректировать начальную точку.
|
||||
\en Correct the start point. \~
|
||||
\details \ru Изменить начальную точку кривой на новую.\n
|
||||
Меняет начальную точку у кривых типа:\n
|
||||
pt_Nurbs, pt_Hermit, pt_Polyline, pt_Bezier,
|
||||
pt_CubicSpline, pt_LineSegment, pt_ReparamCurve,\n
|
||||
или у контура pt_Contour, если первый его сегмент одного из перечисленных типов.
|
||||
\en Change the start point of curve with a new one.\n
|
||||
Changes the start point for curves of types:\n
|
||||
pt_Nurbs, pt_Hermit, pt_Polyline, pt_Bezier,
|
||||
pt_CubicSpline, pt_LineSegment, pt_ReparamCurve,\n
|
||||
or for contour pt_Contour if its first segment is of one of the listed types. \~
|
||||
\param[in] segment - \ru Изменяемая кривая.
|
||||
\en The modified curve. \~
|
||||
\param[in] p1 - \ru Новая начальная точка.
|
||||
\en A new start point. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) ChangeFirstPoint( MbCurve * segment, const MbCartPoint & p1 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Скорректировать конечную точку.
|
||||
\en Correct the last point. \~
|
||||
\details \ru Изменить конечную точку кривой на новую.\n
|
||||
Меняет начальную точку у кривых типа:\n
|
||||
pt_Nurbs, pt_Hermit, pt_Polyline, pt_Bezier,
|
||||
pt_CubicSpline, pt_LineSegment, pt_ReparamCurve,\n
|
||||
или у контура pt_Contour, если последний его сегмент одного из перечисленных типов.
|
||||
\en Change the end point of curve with a new one.\n
|
||||
Changes the end point for curves of types:\n
|
||||
pt_Nurbs, pt_Hermit, pt_Polyline, pt_Bezier,
|
||||
pt_CubicSpline, pt_LineSegment, pt_ReparamCurve,\n
|
||||
or for contour pt_Contour if its last segment is of one of the listed types. \~
|
||||
\param[in] segment - \ru Изменяемая кривая.
|
||||
\en The modified curve. \~
|
||||
\param[in] p1 - \ru Новая начальная точка.
|
||||
\en A new start point. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) ChangeLastPoint( MbCurve * segment, const MbCartPoint & p2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Является ли кривая прямолинейной независимо от ее параметризации.
|
||||
\en Whether the curve is like straight-line regardless of its parameterisation. \~
|
||||
\details \ru Является ли кривая прямолинейной независимо от ее параметризации.\n
|
||||
\en Whether the curve is like straight-line regardless of its parameterisation. \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en Curve. \~
|
||||
\param[in] eps - \ru Точность.
|
||||
\en Accuracy. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) IsLikeStraightLine( const MbCurve & curve, double eps );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить вырожденные сегменты из контура.
|
||||
\en Delete degenerate segments from contour. \~
|
||||
\details \ru Удалить вырожденные сегменты из контура с заменой некоторых кривых и модификацией по флагу. \n
|
||||
\en Delete degenerate segments from contour with substitution of some curves and its modification according to the flag. \n \~
|
||||
\param[in] cntr - \ru Исходный контур.
|
||||
\en The initial contour. \~
|
||||
\param[in] modifySegments - \ru Флаг разрешения замены сегментов.
|
||||
\en The flag determines whether segments can be replaced. \~
|
||||
\param[in] names - \ru Именователь, синхронизированный с контуром.
|
||||
\en An object defining the names synchronized with contour. \~
|
||||
\return \ru Возвращает модифицированнную копию контура, если получилось его создать.
|
||||
\en Returns a modified copy of the contour if it has been successfully created. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC( MbContour * ) DeleteDegenerateSegments( const MbContour & cntr,
|
||||
bool modifySegments,
|
||||
MbSNameMaker * names = NULL );
|
||||
|
||||
|
||||
#endif // __ACTION_CURVE_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,472 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Методы прямого редактирования тел.
|
||||
\en Functions for direct editing of solids. \~
|
||||
\details \ru Прямое моделирование позволяет редактировать и создавать подобные тела
|
||||
путём непосредственной модификации элементов уже построенных тел. \n
|
||||
Представленные ниже функции пока не доведены до коммерческого состояния
|
||||
и позволяют лишь познакомиться с будущими возможностями геометрического ядра.
|
||||
\en The direct modeling allows to edit and to create similar solids
|
||||
by direct modification of elements of already constructed solids. \n
|
||||
The following functions do not conform to the state of a commercial product yet
|
||||
and allows just to acquaint oneself with the future features of the geometrical kernel. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_DIRECT_H
|
||||
#define __ACTION_DIRECT_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <space_item.h>
|
||||
#include <op_shell_parameter.h>
|
||||
#include <topology_faceset.h>
|
||||
#include <mb_operation_result.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbSplineSurface;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
class MATH_CLASS MbFace;
|
||||
class MATH_CLASS MbSolid;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Модифицировать тело по матрице.
|
||||
\en Modify a solid by the matrix. \~
|
||||
\details \ru Выполнить трансформацию копии исходного тела по матрице, рассчитанной по габаритному кубу. \n
|
||||
\en Transform a copy of the solid using the matrix calculated by bounding box of solid. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] p - \ru Параметры трансформации.
|
||||
\en The transformation parameters. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) TransformedSolid( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const TransformValues & p,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Собрать грани оболочки для методов прямого моделирования.
|
||||
\en Modify a shell by the methods of direct modeling. \~
|
||||
\details \ru Функция собирает грани оболочки для методов прямого моделирования: \n
|
||||
удаление из тела выбранных граней с окружением (way==dmt_Remove), \n
|
||||
удаление выбранных граней скругления тела (way==dmt_Purify). \n
|
||||
Для удаления граней собираются замкнутые цилиндрические, конические, тороидальные, сферические грани тела,
|
||||
а также грани вращения, радиус которых не превосходит указанный радиус.
|
||||
Для удаления граней скругления собираются незамкнутые цилиндрические, тороидальные, сферические грани,
|
||||
а также грани скругления, радиус которых не превосходит указанный радиус. \n
|
||||
\en The method collects the faces of the shell for direct modeling methods: \n
|
||||
removal of the faces from a shell (way==dmt_Remove), \n
|
||||
removal of the fillet faces from a shell (way==dmt_Purify). \n
|
||||
The cylindrical, conical, toroidal, spherical, and revolution periodic faces are collect to remove way.
|
||||
The cylindrical, toroidal, spherical non-periodic, and fillet faces are collect to purify way. \n \~
|
||||
\param[in] shell - \ru Исходная оболочка тела.
|
||||
\en The initial faces set. \~
|
||||
\param[in] way - \ru Способ модификации.
|
||||
\en Way of the modification. \~
|
||||
\param[in] radius - \ru Радиус собираемых граней.
|
||||
\en Radius of collected faces. \~
|
||||
\param[in] faces - \ru Найденные грани для дальнейшей модификации.
|
||||
\en Found faces to be modified. \~
|
||||
\return \ru Возвращает код результата действий.
|
||||
\en Returns action result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CollectFacesForModification( MbFaceShell * shell,
|
||||
MbeModifyingType way,
|
||||
double radius,
|
||||
RPArray<MbFace> & faces );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Модифицировать или построить тело методами прямого моделирования.
|
||||
\en Modify a solid by the methods of direct modeling. \~
|
||||
\details \ru В зависимости от параметров модификации метод выполняет одно из следующих действий: \n
|
||||
1. Удаление из тела выбранных граней с окружением (param.way==dmt_Remove). \n
|
||||
2. Создание тела из выбранных граней с окружением (param.way==dmt_Create). \n
|
||||
3. Перемещение выбранных граней с окружением относительно оставшихся граней тела (param.way==dmt_Action). \n
|
||||
4. Замена выбранных граней тела эквидистантными гранями (param.way==dmt_Offset). \n
|
||||
5. Изменение радиуса выбранных граней скругления (param.way==dmt_Fillet). \n
|
||||
6. Замена выбранных граней тела деформируемыми гранями для редактирования (param.way==dmt_Supple). \n
|
||||
7. Удаление выбранных граней скругления тела (param.way==dmt_Purify).
|
||||
\en The method is for one of listed actions below depends of parameters: \n
|
||||
1. Removal of the specified faces with the neighborhood from a solid (param.way==dmt_Remove). \n
|
||||
2. Creation of a solid from the specified faces with the neighborhood (param.way==dmt_Create). \n
|
||||
3. Translation of the specified faces with neighborhood relative to the other faces of the solid (param.way==dmt_Action). \n
|
||||
4. Replacement of the specified faces of a solid with the offset faces (param.way==dmt_Offset). \n
|
||||
5. Changing of the radius of the specified fillet faces (param.way==dmt_Fillet). \n
|
||||
6. Replacement of the specified faces of a solid with a deformable faces for editing (param.way==dmt_Supple). \n
|
||||
7. Removal of the specified fillet faces from a solid (param.way==dmt_Purify). \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] params - \ru Параметры модификации.
|
||||
\en Parameters of the modification. \~
|
||||
\param[in] faces - \ru Изменяемые грани тела.
|
||||
\en Faces to be modified. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) FaceModifiedSolid( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const ModifyValues & params,
|
||||
const RPArray<MbFace> & faces,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Модифицировать или построить тело методами прямого моделирования.
|
||||
\en Modify a solid by the methods of direct modeling. \~
|
||||
\details \ru Метод выполняет удаление указанных рёбер, слияние их вершин и модификацию окружающих граней (param.way==dmt_Merger).
|
||||
По направлению вектора "param.direction" определяется: начальная ли вершина ребра будет слита с конечной вершиной, или конечная вершина ребра будет слита с начальной вершиной. \n
|
||||
\en The method performs the deletion of selectsd edges, merging their vertices and modification of surrounding faces (param.way==dmt_Merger).
|
||||
The direction of the vector "params.direction" determines whether the start vertex of an edge is merged with the end vertex, or whether the end vertex of an edge is merged with the start vertex. \n
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] params - \ru Параметры модификации, способ должен быть равен param.way==dmt_Merger.
|
||||
\en Parameters of the modification, the way must be equal to param.way==dmt_Merger. \~
|
||||
\param[in] edges - \ru Удаляемые рёьра тела.
|
||||
\en Edges to be removed. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
|
||||
MATH_FUNC (MbResultType) EdgeModifiedSolid( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const ModifyValues & params,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Заменить выбранные грани тела деформируемыми гранями.
|
||||
\en Replace the specified faces of solid with deformable faces. \~
|
||||
\details \ru Заменить выбранные грани тела деформируемыми гранями (превращение в NURBS для редактирования). \n
|
||||
\en Replace the specified faces of the solid with deformable faces (conversion to NURBS for editing). \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] p - \ru Параметры преобразования.
|
||||
\en The transformation parameters. \~
|
||||
\param[in] faces - \ru Заменяемые грани тела.
|
||||
\en Faces to replace. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ModifiedNurbsItem( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const NurbsValues & p,
|
||||
const RPArray<MbFace> & faces,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Заменить выбранную грань тела деформируемой гранью.
|
||||
\en Replace the specified face of the solid by a deformable face. \~
|
||||
\details \ru Заменить выбранную грань тела деформируемой гранью (превращение в NURBS для редактирования). \n
|
||||
\en Replace the specified face of the solid by a deformable face (conversion to NURBS for editing). \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] p - \ru Параметры преобразования.
|
||||
\en The transformation parameters. \~
|
||||
\param[in] face - \ru Заменяемая грань тела.
|
||||
\en A face to replace. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ModifiedNurbsItem( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const NurbsValues & p,
|
||||
const MbFace & face,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Получить NURBS-поверхности грани.
|
||||
\en Get the NURBS-surfaces of a face. \~
|
||||
\details \ru Выполнить построение деформируемой поверхности для исходной грани. \n
|
||||
\en Create a deformable surface for the initial face. \n \~
|
||||
\param[in] face - \ru Исходная грань.
|
||||
\en The initial face. \~
|
||||
\return \ru Возвращает NURBS-поверхности грани.
|
||||
\en Returns NURBS-surfaces of the face. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbSurface *) GetControlSurface( const MbFace & face );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Получить контрольные точки NURBS-поверхности грани.
|
||||
\en Get the control points of the NURBS-surface of a face. \~
|
||||
\details \ru Получить множество контрольных точек NURBS-поверхности грани и множества их весов. \n
|
||||
\en Get a set of the control points of a NURBS-surface of a face and a set of their weights. \n \~
|
||||
\param[in] face - \ru Исходная грань.
|
||||
\en The initial face. \~
|
||||
\param[out] controlPoints - \ru Контрольные точки NURBS-поверхности грани.
|
||||
\en The control points of the NURBS-surface of the face. \~
|
||||
\param[out] result - \ru Веса контрольных точек.
|
||||
\en The weights of the control points. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) FaceControlPoints( const MbFace & face,
|
||||
Array2<MbCartPoint3D> & controlPoints,
|
||||
Array2<double> & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Деформировать грань тела.
|
||||
\en Deform a face of a solid. \~
|
||||
\details \ru Деформировать грань тела путём подстановки присланных контрольных точек NURBS-поверхности грани. \n
|
||||
\en Deform a face of a solid by substitution the control points of NURBS-surface of the face with the given control points. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] face - \ru Изменяемая грань тела.
|
||||
\en A face of a solid to be modified. \~
|
||||
\param[in] faceSurface - \ru Новая NURBS-поверхность для грани.
|
||||
\en The new NURBS-surface of the face. \~
|
||||
\param[in] fixedPoints - \ru Неподвижные узлы.
|
||||
\en The fixed points. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsModification( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
MbFace * face,
|
||||
MbSurface & faceSurface,
|
||||
Array2<bool> & fixedPoints,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Деформировать грань тела.
|
||||
\en Deform a face of a solid. \~
|
||||
\details \ru Деформировать грань тела путём подстановки присланных контрольных точек NURBS-поверхности грани. \n
|
||||
\en Deform a face of a solid by substitution the control points of NURBS-surface of the face with the given control points. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного тела.
|
||||
\en The mode of copying of the initial solid. \~
|
||||
\param[in] face - \ru Изменяемая грань тела.
|
||||
\en A face of a solid to be modified. \~
|
||||
\param[in] controlPoints - \ru Контрольные точки NURBS-поверхности грани.
|
||||
\en The control points of the NURBS-surface of the face. \~
|
||||
\param[in] weights - \ru Веса контрольных точек.
|
||||
\en The weights of the control points. \~
|
||||
\param[in] fixedPoints - \ru Неподвижные узлы.
|
||||
\en The fixed points. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Модифицированное тело.
|
||||
\en The modified solid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsModification( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
MbFace * face,
|
||||
const Array2<MbCartPoint3D> & controlPoints,
|
||||
const Array2<double> & weights,
|
||||
Array2<bool> * fixedPoints,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить деформируемую призму.
|
||||
\en Create a deformable prism. \~
|
||||
\details \ru Построить тело в форме прямого параллелепипеда с деформируемыми гранями. \n
|
||||
\en Create a solid as a right parallelepiped with deformable faces. \n \~
|
||||
\param[in] place - \ru Локальная система координат.
|
||||
\en A local coordinate system. \~
|
||||
\param[in] ax - \ru Размер по X.
|
||||
\en The size in X-direction. \~
|
||||
\param[in] ay - \ru Размер по Y.
|
||||
\en The size in Y-direction. \~
|
||||
\param[in] az - \ru Размер по Z.
|
||||
\en The size in Z-direction. \~
|
||||
\param[in] outDir - \ru Ориентация нормалей наружу.
|
||||
\en An outer orientation of the normals. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] name - \ru Главное имя.
|
||||
\en The main name. \~
|
||||
\param[in] param - \ru Параметры NURBS-поверхностей граней параллелепипеда.
|
||||
\en The parameters of NURBS-surfaces of the parallelepiped faces. \~
|
||||
\param[out] result - \ru Тело из NURBS-поверхностей.
|
||||
\en The solid constructed from the NU|RBS-surfaces. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsBlockSolid( const MbPlacement3D & place,
|
||||
double ax,
|
||||
double ay,
|
||||
double az,
|
||||
bool outDir,
|
||||
const MbSNameMaker & names,
|
||||
SimpleName name,
|
||||
NurbsBlockValues & param,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить согласованную поверхность.
|
||||
\en Create a matched surface. \~
|
||||
\details \ru Для исходной поверхности выполнить построение изменённой поверхности
|
||||
путем выставления сопряжения вдоль кривой. \n
|
||||
\en Create a modified surface for the initial surface
|
||||
by specifying the conjugation along the curve. \n \~
|
||||
\param[in] curve - \ru Кривая пересечения поверхностей ребра.
|
||||
\en The intersection curve of the edge surfaces. \~
|
||||
\param[in] sences - \ru Ориентация кривой ребра в цикле.
|
||||
\en The edge curve sense in the loop. \~
|
||||
\param[in] faceSences - \ru Ориентация нормали на смежной грани.
|
||||
\en The adjacent face normal orientation. \~
|
||||
\param[in] surface - \ru Исходная сплайновая поверхность для изменяемой грани.
|
||||
\en The initial spline surface of the face to be modified. \~
|
||||
\param[in] tension - \ru Натяжение.
|
||||
\en The tension. \~
|
||||
\param[in] conType - \ru Тип сопряжения.
|
||||
\en The conjugation type. \~
|
||||
\param[in] insertNum - \ru Вставляемый ряд.
|
||||
\en The row number. \~
|
||||
\param[out] result - \ru NURBS-поверхность, полученная в результате преобразований.
|
||||
\en The NURBS-surface obtained as a result of the modifications. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsFaceConjugation( const MbSurfaceIntersectionCurve & curve,
|
||||
bool sences,
|
||||
bool faceSences,
|
||||
const MbSplineSurface & surface,
|
||||
double tension,
|
||||
MbeConjugationType conType,
|
||||
size_t insertNum,
|
||||
MbSplineSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить подобную поверхность.
|
||||
\en Create a similar surface. \~
|
||||
\details \ru Для исходной поверхности выполнить построение подобной поверхности
|
||||
по указанной поверхности-образцу. \n
|
||||
\en Create a surface similar to the initial one
|
||||
given the pattern surface. \n \~
|
||||
\param[in] originSurface - \ru Поверхность-образец.
|
||||
\en A pattern surface. \~
|
||||
\param[in] surface - \ru Исходная сплайновая поверхность для изменяемой грани.
|
||||
\en The initial spline surface of the face to be modified. \~
|
||||
\param[in] uToU - \ru Флаг сохранения параметрического направления как у поверхности-образца.
|
||||
\en Whether to keep the parametric direction of the pattern surface. \~
|
||||
\param[in] normSence - \ru Флаг сохранения направления нормали поверхности-образца.
|
||||
\en Whether to keep the normal direction of the pattern surface. \~
|
||||
\param[out] result - \ru NURBS-поверхность, полученная в результате преобразований.
|
||||
\en The NURBS-surface obtained as a result of the modifications. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsFaceSimilarity( const MbSurface & originSurface,
|
||||
const MbSplineSurface & surface,
|
||||
bool uToU,
|
||||
bool normSence,
|
||||
MbSplineSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить сглаженную поверхность.
|
||||
\en Create a smoothed surface. \~
|
||||
\details \ru Выполнить сглаживание копии исходной поверхности не изменяя ее порядок и количество контрольных точек. \n
|
||||
\en Perform smoothing of a copy of the initial surface without changing its order and the number of control points. \n \~
|
||||
\param[in] surface - \ru Исходная сплайновая поверхность для изменяемой грани.
|
||||
\en The initial spline surface of the face to be modified. \~
|
||||
\param[in] udegree - \ru Параметр сглаживания по первому параметру поверхности.
|
||||
\en The smoothing surface degree for direction of first parameter of surface. \~
|
||||
\param[in] vdegree - \ru Параметр сглаживания по второму параметру поверхности.
|
||||
\en The smoothing surface degree for direction of second parameter of surface. \~
|
||||
\param[out] result - \ru NURBS-поверхность, полученная в результате преобразований.
|
||||
\en The NURBS-surface obtained as a result of the modifications. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Direct_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SplineSurfaceSmoothing( const MbSplineSurface & surface,
|
||||
size_t udegree,
|
||||
size_t vdegree,
|
||||
MbSplineSurface *& result );
|
||||
|
||||
|
||||
#endif // __ACTION_DIRECT_H
|
||||
@@ -0,0 +1,279 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Методы построения полигональных геометрических объектов.
|
||||
\en Functions for construction of the polygonal geometric object. \~
|
||||
\details \ru Полигональные геометрические объекты могут быть построены по набору точек или на базе других объектов.
|
||||
\en Polygonal geometric objects can be constructed using a set of point or on the basis of other objects. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_MESH_H
|
||||
#define __ACTION_MESH_H
|
||||
|
||||
|
||||
#include <mb_cart_point.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <mesh.h>
|
||||
#include <mb_enum.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbMesh;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbSolid;
|
||||
class MATH_CLASS MbPlaneItem;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbFace;
|
||||
class MATH_CLASS MbCollection;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расчет полигона кривой.
|
||||
\en Calculation of polygon of curve. \~
|
||||
\details \ru Расчет трехмерного полигона двумерной кривой в плоскости XOY локальная системы координат.
|
||||
\en Calculation of three-dimensional polygon of two-dimensional curve located in the XOY-plane of a local coordinate system. \~
|
||||
\param[in] curve - \ru Двумерная кривая.
|
||||
\en A two-dimensional curve. \~
|
||||
\param[in] plane - \ru Локальная система координат.
|
||||
\en Local coordinate system. \~
|
||||
\param[in] sag - \ru Максимальное допустимое отклонение полигона от оригинала по прогибу или по углу между соседними элементами.
|
||||
\en Maximum allowable deviation of polygon from the original by sag or by angle between neighboring elements. \~
|
||||
\param[out] polygon - \ru Рассчитанный полигон.
|
||||
\en Calculated polygon. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CalculatePolygon( const MbCurve & curve,
|
||||
const MbPlacement3D & plane,
|
||||
double sag,
|
||||
MbPolygon3D & polygon );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить полигональный двухмерный объект.
|
||||
\en Create a polygonal two-dimensional object. \~
|
||||
\details \ru Построить полигональный объект для двумерного объекта в плоскости XOY
|
||||
локальной системы координат.
|
||||
\en Create a polygonal object for two-dimensional object in the XOY-plane
|
||||
of the local coordinate system. \~
|
||||
\param[in] obj - \ru Двумерный объект (если NULL, то объект не создаётся).
|
||||
\en Two-dimensional object (if NULL, object isn't created). \~
|
||||
\param[in] plane - \ru Локальная система координат.
|
||||
\en A local coordinate system. \~
|
||||
\param[in] sag - \ru Максимальное отклонение полигонального объекта от оригинала по прогибу.
|
||||
\en The maximum deviation of polygonal object from the original object by sag. \~
|
||||
\param[out] mesh - \ru Полигональный объект.
|
||||
\en Polygonal object. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CalculateWire( const MbPlaneItem & obj,
|
||||
const MbPlacement3D & plane,
|
||||
double sag,
|
||||
MbMesh & mesh );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить икосаэдр в виде полигональной модели.
|
||||
\en Construct an icosahedron mesh. \~
|
||||
\details \ru Построить икосаэдр в виде полигональной модели. \n
|
||||
\en Construct an icosahedron mesh. \n \~
|
||||
\param[in] place - \ru Местная система координат.
|
||||
\en Local placement. \~
|
||||
\param[in] radius - \ru Радиус описанной сферы.
|
||||
\en The radius of the sphere. \~
|
||||
\param[in] fn - \ru Способ построения полигонального объекта.
|
||||
\en Way for polygonal object constructing. \~
|
||||
\param[out] result - \ru Результат построения.
|
||||
\en The resulting mesh. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateIcosahedron( const MbPlacement3D & place,
|
||||
double radius,
|
||||
const MbFormNote & fn,
|
||||
MbMesh *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// .
|
||||
/** \brief \ru Построить полигональную сферу.
|
||||
\en Construct an spherical mesh. \~
|
||||
\details \ru Построить аппроксимацию сферы выпуклым многогранником. \n
|
||||
\en Construct an approximation of the sphere by a convex polyhedron. \n \~
|
||||
\param[in] place - \ru Местная система координат.
|
||||
\en Local placement. \~
|
||||
\param[in] radius - \ru Радиус сферы.
|
||||
\en The radius of the sphere. \~
|
||||
\param[in] epsilon - \ru Параметр аппроксимации сферы.
|
||||
\en The approximation parameter. \~
|
||||
\param[out] result - \ru Результат построения.
|
||||
\en The resulting mesh. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateSpherePolyhedron( const MbPlacement3D & place,
|
||||
double radius,
|
||||
double & epsilon,
|
||||
MbMesh *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить выпуклую оболочку для множества точек.
|
||||
\en Calculate a convex hull of a point set. \~
|
||||
\details \ru Вычислить сетку, представляющую выпуклой оболочку для множества точек.
|
||||
\en Calculate mesh being a convex hull of a point set. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateConvexPolyhedron( const SArray<MbFloatPoint3D> & points,
|
||||
MbMesh *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить выпуклую оболочку для триангуляционной сетки.
|
||||
\en Construct the convex hull of triangulation grid. \~
|
||||
\details \ru Построить сетку, представляющую собой выпуклую оболочку для тела,
|
||||
заданного его триангуляционной сеткой. По заданному объекту MbMesh
|
||||
строится охватывающая его вершины выпуклая триангуляционная сетка.
|
||||
Расстояние offset задает смещение точек результирующей сетки относительно
|
||||
заданной вдоль нормалей к её граням. Если offset = 0, то результирующая сетка
|
||||
будет в точности охватывать все вершины заданной. Смещение по нормали может
|
||||
быть как положительным, так и отрицательным (внутрь сетки). Используется для
|
||||
определения пересечения с некоторым допуском (offset). \n
|
||||
\en Construct the convex hull of triangulation grid. \n \~
|
||||
\param[in] mesh - \ru Исходная триангуляционная сетка.
|
||||
\en Initial triangulated mesh. \~
|
||||
\param[in] offset - \ru Отступ по нормали для результирующей сетки.
|
||||
\en The offset along a normal for the resulting grid. \~
|
||||
\param[out] resMesh - \ru Результирующая выпуклая триангуляционная сетка.
|
||||
\en The resulting triangulation convex grid. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateConvexPolyhedron( const MbMesh & mesh,
|
||||
double offset,
|
||||
MbMesh *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определить, пересекаются ли данные выпуклые сетки.
|
||||
\en Whether there is intersection of convex grids. \~
|
||||
\details \ru Определить, пересекаются ли данные выпуклые оболочки, заданные
|
||||
триангуляционными сетками. Пересечение определяется по алгоритму
|
||||
Гильберта-Джонсона-Керти (Gilbert-Johnson-Keerthi). Заданные сетки
|
||||
равноправны, их последовательность в алгоритме не важна. Сложность
|
||||
алгоритма линейная, зависит от количества вершин сеток. \n
|
||||
\en Whether there is intersection of convex grids. \n \~
|
||||
\param[in] mesh1 - \ru Первая выпуклая триангуляционная сетка.
|
||||
\en The first convex grid. \~
|
||||
\param[in] mesh2 - \ru Вторая выпуклая триангуляционная сетка.
|
||||
\en The second convex grid. \~
|
||||
\return \ru true - Выпуклые триангуляционные сетки пересекаются.
|
||||
false - Выпуклые триангуляционные сетки не пересекаются.
|
||||
\en true - true - there is an intersection,
|
||||
false - there are no intersections. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) AreIntersectConvexPolyhedrons( const MbMesh & mesh1,
|
||||
const MbMesh & mesh2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Отрезать часть полигонального объекта плоскостью.
|
||||
\en Cut a part of a polygonal object by a plane. \~
|
||||
\details \ru Отрезать часть полигонального объекта плоскостью XY локальной системы координат. \n
|
||||
part = 1 - оставляем часть объекта, расположенную сверху плоскости XY локальной системы координат, \n
|
||||
part = -1 - оставляем часть объекта, расположенную снизу плоскости XY локальной системы координат. \n
|
||||
\en Cut a part of a polygonal object off by a plane XY of local coordinate system. \n
|
||||
part = 1 - a part of polygonal object above the XY plane is to be retained. \n
|
||||
part = -1 - a part of polygonal object below the XY plane is to be retained. \n \~
|
||||
\param[in] mesh - \ru Исходный полигональный объект.
|
||||
\en The source polygonal object. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходного объекта.
|
||||
\en The mode of copying of the source polygonal object. \~
|
||||
\param[in] place - \ru Секущая плоскость.
|
||||
\en A cutting plane. \~
|
||||
\param[in] part - \ru Направление отсечения.
|
||||
\en The direction of cutting off. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] onlySection - \ru Флаг режима отсечения: false - сечем как тело, true - сечем как оболочку.
|
||||
\en The flag of the cutting off mode: false - cut as a solid, true - cut as a shell. \~
|
||||
\param[out] result - \ru Построенный полигональный объект.
|
||||
\en The resultant polygonal object. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) MeshCutting( MbMesh & mesh,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
int part,
|
||||
const MbSNameMaker & names,
|
||||
bool onlySection,
|
||||
MbMesh *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить контур сечения полигонального объекта плоскостью.
|
||||
\en Create a section contour of a polygon figure. \~
|
||||
\details \ru Построить контур сечения присланного объекта плоскостью XY локальной системы координат. \n
|
||||
\en Construct curves of the section of the mesh object lying on the XY plane of the local coordinate system. \n
|
||||
\param[in] mesh - \ru Исходный полигональный объект.
|
||||
\en The source polygonal object. \~
|
||||
\param[in] place - \ru Секущая плоскость.
|
||||
\en A cutting plane. \~
|
||||
\param[out] polylines - \ru Построенные ломагные контура сечения объекта.
|
||||
\en The resultant contours. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) MeshSection( const MbMesh & mesh,
|
||||
const MbPlacement3D & place,
|
||||
RPArray<MbCurve3D> & polylines );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить триангуляцию по облаку точек на основе алгоритма поворотного шара.
|
||||
\en Build a triangulation by point cloud with Ball Pivoting algorithm. \~
|
||||
\param[in] collection - \ru Коллекция трехмерных элементов.
|
||||
\en Collection of 3d elements. \~
|
||||
\param[in] radius - \ru Радиус поворотного шара, если radius==0 будет предпринята попытка его автоопределения.
|
||||
\en Radius of the pivoting ball, if radius==0 an autoguess for the ball pivoting radius is attempted \~
|
||||
\param[in] radiusMin - \ru Радиус кластеризации ( в % от радиуса поворотного шара ).
|
||||
\en Clusterization radius ( % from radius value). \~
|
||||
\param[in] angle - \ru Максимальный угол между двумя соседними элементами сетки.
|
||||
\en Max angle between two mesh faces \~
|
||||
\param[out] result - \ru Построенный полигональный объект.
|
||||
\en The resultant polygonal object. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CalculateBallPivotingGrid( const MbCollection & collection,
|
||||
double radius,
|
||||
double radiusMin,
|
||||
double angle,
|
||||
MbMesh *& result );
|
||||
|
||||
|
||||
#endif // __ACTION_MESH_H
|
||||
@@ -0,0 +1,299 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение фантомов операций.
|
||||
\en Creation of phantom operations. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_PHANTOM_H
|
||||
#define __ACTION_PHANTOM_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <space_item.h>
|
||||
#include <op_shell_parameter.h>
|
||||
#include <op_swept_parameter.h>
|
||||
#include <position_data.h>
|
||||
#include <topology_faceset.h>
|
||||
#include <mb_operation_result.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
class MATH_CLASS MbFace;
|
||||
class MATH_CLASS MbSolid;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить фантомные поверхности скругления/фаски.
|
||||
\en Create phantom surfaces of fillet/chamfer. \~
|
||||
\details \ru Построить фантомные поверхности скругления/фаски и сложить в контейнер surfaces. \n
|
||||
По окончании работ поверхности можно и нужно удалить. \n
|
||||
\en Create phantom surfaces of fillet/chamfer and store them in the container 'surfaces'. \n
|
||||
After finish working with the surfaces they should be deleted. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] edges - \ru Множество выбранных ребер для скругления/фаски.
|
||||
\en An array of edges for fillet/chamfer. \~
|
||||
\param[in] params - \ru Параметры операции скругления/фаски.
|
||||
\en Parameters of the fillet/chamfer operation. \~
|
||||
\param[out] result - \ru Поверхности скругления/фаски.
|
||||
\en The fillet/chamfer surfaces. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en Returns the creation result code. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SmoothPhantom( const MbSolid & solid,
|
||||
RPArray<MbCurveEdge> & edges,
|
||||
const SmoothValues & params,
|
||||
RPArray<MbSurface> & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить фантомные поверхности скругления/фаски.
|
||||
\en Create phantom surfaces of fillet/chamfer.\~
|
||||
\details \ru Построить фантомные поверхности скругления/фаски и сложить в контейнер surfaces. \n
|
||||
По окончании работ поверхности можно и нужно удалить.
|
||||
\en Create phantom surfaces of fillet/chamfer and store them in the container 'surfaces'. \n
|
||||
After finish working with the surfaces they should be deleted. \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] edges - \ru Множество выбранных ребер и функций изменения радиуса для скругления/фаски.
|
||||
\en An array of edges and radius laws for fillet/chamfer. \~
|
||||
\param[in] params - \ru Параметры операции скругления/фаски.
|
||||
\en Parameters of the fillet/chamfer operation. \~
|
||||
\param[out] result - \ru Поверхности скругления/фаски.
|
||||
\en The fillet/chamfer surfaces. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en Returns the creation result code. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SmoothPhantom( const MbSolid & solid,
|
||||
SArray<MbEdgeFunction> & edges,
|
||||
const SmoothValues & params,
|
||||
RPArray<MbSurface> & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить последовательности гладко стыкующихся рёбер.
|
||||
\en \~
|
||||
\details \ru Построить последовательности гладко стыкующихся рёбер, скругляемых одновременно,
|
||||
а также поверхности скругления/фаски (массив surfaces). \n
|
||||
По окончании работ поверхности можно и нужно удалить.
|
||||
\en \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] edges - \ru Множество выбранных ребер для скругления/фаски.
|
||||
\en An array of edges for fillet/chamfer. \~
|
||||
\param[in] params - \ru Параметры операции скругления/фаски.
|
||||
\en Parameters of the fillet/chamfer operation. \~
|
||||
\param[in] createSurfaces - \ru Создавать ли поверхности скругления/фаски для фантома?
|
||||
\en Create a fillet/chamfer surfaces for phantom. \~
|
||||
\param[out] sequences - \ru Последовательность гладко стыкующихся рёбер.
|
||||
\en Sequence of smooth mating edges. \~
|
||||
\param[out] result - \ru Поверхности скругления/фаски.
|
||||
\en The fillet/chamfer surfaces. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SmoothSequence( const MbSolid & solid,
|
||||
RPArray<MbCurveEdge> & edges,
|
||||
const SmoothValues & params,
|
||||
bool createSurfaces,
|
||||
RPArray<MbEdgeSequence> & sequences,
|
||||
RPArray<MbSurface> & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить последовательности гладко стыкующихся рёбер.
|
||||
\en \~
|
||||
\details \ru Построить последовательности гладко стыкующихся рёбер, скругляемых одновременно,
|
||||
а также поверхности скругления/фаски (массив surfaces). \n
|
||||
По окончании работ поверхности можно и нужно удалить.
|
||||
\en \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] edges - \ru Множество выбранных ребер и функций изменения радиуса для скругления/фаски.
|
||||
\en An array of edges and radius laws for fillet/chamfer. \~
|
||||
\param[in] params - \ru Параметры операции скругления/фаски.
|
||||
\en Parameters of the fillet/chamfer operation. \~
|
||||
\param[in] createSurfaces - \ru Создавать ли поверхности скругления/фаски для фантома?
|
||||
\en Create a fillet/chamfer surfaces for phantom. \~
|
||||
\param[out] sequences - \ru Последовательность гладко стыкующихся рёбер.
|
||||
\en Sequence of smooth mating edges. \~
|
||||
\param[out] result - \ru Поверхности скругления/фаски.
|
||||
\en The fillet/chamfer surfaces. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SmoothSequence( const MbSolid & solid,
|
||||
SArray<MbEdgeFunction> & edges,
|
||||
const SmoothValues & params,
|
||||
bool createSurfaces,
|
||||
RPArray<MbEdgeSequence> & sequences,
|
||||
RPArray<MbSurface> & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить фантомные эквидистантные поверхности для граней оболочки.
|
||||
\en Create phantom offset surfaces for faces of a shell. \~
|
||||
\details \ru Построить фантомные эквидистантные поверхности для граней оболочки, \n
|
||||
кроме имеющих перечислены кроме имеющих перечисленные индексы, и сложить в массив surfaces. \n
|
||||
По окончании работ поверхности можно и нужно удалить.
|
||||
\en Create phantom offset surfaces for faces of a shell, \n
|
||||
except the faces with specified indices and store them in array 'surfaces'. \n
|
||||
After finish working with the surfaces they should be deleted. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] outFaces - \ru Множество вскрываемых граней тела.
|
||||
\en An array of shelling faces of the solid. \~
|
||||
\param[in] offFaces - \ru Множество граней, для которых заданы индивидуальные значения толщин.
|
||||
\en An array of faces for which the individual values of thickness are specified. \~
|
||||
\param[in] offDists - \ru Множество индивидуальных значений толщин (должен быть синхронизирован с массивом offFaces).
|
||||
\en An array of individual values of thickness (must be synchronized with the array 'offFaces'). \~
|
||||
\param[in] params - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результат операции.
|
||||
\en The operation result. \~
|
||||
\param[out] hpShellFaceInd - \ru Номер грани в исходной оболочки для построения хот-точки.
|
||||
\en The face number in the initial shell for a hot-point creation. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en Returns the creation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) OffsetPhantom( const MbSolid & solid,
|
||||
RPArray<MbFace> & outFaces,
|
||||
RPArray<MbFace> & offFaces,
|
||||
SArray<double> & offDists,
|
||||
const SweptValues & params,
|
||||
const MbSNameMaker & operNames,
|
||||
MbFaceShell *& result,
|
||||
size_t * hpShellFaceInd = NULL ); // \ru Номер грани в исходной оболочки для построения хот-точки); \en The face number in the initial shell for a hot-point creation);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить фантом габаритного куба в локальной системе координат.
|
||||
\en Create a phantom of a bounding box in local coordinate system. \~
|
||||
\details \ru Построить фантом габаритного куба в локальной системе координат. \n
|
||||
\en Create a phantom of a bounding box in local coordinate system. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] place - \ru Локальная система координат (ЛСК).
|
||||
\en A local coordinate system (LCS). \~
|
||||
\param[in] bScale - \ru Является ли ЛСК масштабирующей.
|
||||
\en Whether the LCS is scaling. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Фантом локального куба.
|
||||
\en The phantom of the local bounding box. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en Returns the creation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LocalCubePhantom( const MbSolid & solid,
|
||||
const MbPlacement3D & place,
|
||||
bool bScale,
|
||||
const MbSNameMaker & operNames,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определить фантомное направление усечения.
|
||||
\en Determine a phantom direction of truncation. \~
|
||||
\details \ru Определить фантомное направление усечения по усеченной грани исходного тела. \n
|
||||
\en Determine a phantom direction of truncation given the truncated face of the initial solid. \n \~
|
||||
\param[in] truncatingEdge - \ru Ребро усеченной грани исходного тела.
|
||||
\en An edge of truncated face of the initial solid. \~
|
||||
\param[in] dirPlace - \ru Система координат направления усечения (Ось Z - направление усечения).
|
||||
\en A coordinate system of truncation direction (Z-axis is a truncation direction). \~
|
||||
\return \ru Возвращает true, если получилось определить направление.
|
||||
\en Returns true if the direction has been successfully determined. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) TruncatDirection( const MbCurveEdge & truncatingEdge,
|
||||
MbPlacement3D & dirPlace );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить опорные точки размеров операции скругления/фаски.
|
||||
\en Create support points of fillet/chamfer operation sizes. \~
|
||||
\details \ru Построить опорные точки размеров операции скругления/фаски и сложить в контейнер data. \n
|
||||
Первые две точки лежат на краях поверхности скругления/фаски.
|
||||
\en Create support points of fillet/chamfer operation sizes and store them in container 'data'. \n
|
||||
The first two points lie on the fillet/chamfer surface boundary. \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] edges - \ru Множество выбранных ребер для скругления/фаски.
|
||||
\en An array of edges for fillet/chamfer. \~
|
||||
\param[in] params - \ru Параметры операции скругления/фаски.
|
||||
\en Parameters of the fillet/chamfer operation. \~
|
||||
\param[out] result - \ru Опорные точки размеров операции скругления/фаски.
|
||||
\en Support points of the fillet/chamfer operation sizes. \~
|
||||
\param[in] edgeParam - \ru Параметр точки на ребре (0 <= edgeParam <= 1).
|
||||
\en The parameter of a point on the edge (0 <= edgeParam <= 1). \~
|
||||
\param[in] dimensionEdge - \ru Ребро, на котором дать опорные точки.
|
||||
\en The edge on which the support points are to be created. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en Returns the creation result code. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SmoothPositionData( const MbSolid & solid,
|
||||
RPArray<MbCurveEdge> & edges,
|
||||
const SmoothValues & params,
|
||||
RPArray<MbPositionData> & result,
|
||||
double edgeParam = 0.5,
|
||||
const MbCurveEdge * dimensionEdge = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить опорные точки размеров операции скругления/фаски.
|
||||
\en Create support points of fillet/chamfer operation sizes. \~
|
||||
\details \ru Построить опорные точки размеров операции скругления/фаски и сложить в контейнер data. \n
|
||||
Первые две точки лежат на краях поверхности скругления/фаски.
|
||||
\en Create support points of fillet/chamfer operation sizes and store them in container 'data'. \n
|
||||
The first two points lie on the fillet/chamfer surface boundary. \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] edges - \ru Множество выбранных ребер для скругления/фаски и функций изменения радиуса для скругления/фаски.
|
||||
\en The array of specified edges for fillet/chamfer and radius laws for fillet/chamfer. \~
|
||||
\param[in] params - \ru Параметры операции скругления/фаски.
|
||||
\en Parameters of the fillet/chamfer operation. \~
|
||||
\param[out] result - \ru Опорные точки размеров операции скругления/фаски.
|
||||
\en Support points of the fillet/chamfer operation sizes. \~
|
||||
\param[in] edgeParam - \ru Параметр точки на ребре (0 <= edgeParam <= 1).
|
||||
\en The parameter of a point on the edge (0 <= edgeParam <= 1). \~
|
||||
\param[in] dimensionEdge - \ru Ребро, на котором дать опорные точки.
|
||||
\en The edge on which the support points are to be created. \~
|
||||
\return \ru Возвращает код результата построения.
|
||||
\en Returns the creation result code. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SmoothPositionData( const MbSolid & solid,
|
||||
SArray<MbEdgeFunction> & edges,
|
||||
const SmoothValues & params,
|
||||
RPArray<MbPositionData> & result,
|
||||
double edgeParam = 0.5,
|
||||
const MbCurveEdge * dimensionEdge = NULL );
|
||||
|
||||
|
||||
#endif // __ACTION_PHANTOM_H
|
||||
@@ -0,0 +1,820 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Функции создания точек.
|
||||
\en Functions for points creation. \~
|
||||
\details \ru Функции, использующие в качестве выходных параметров точки или массивы точек.
|
||||
\en Functions that take points or arrays of points as input parameters. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_POINT_H
|
||||
#define __ACTION_POINT_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <mb_enum.h>
|
||||
#include <mb_cart_point.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <cur_line.h>
|
||||
#include <mb_variables.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbLineSegment;
|
||||
class MATH_CLASS MbLine3D;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать массив.
|
||||
\en Create an array. \~
|
||||
\details \ru Создать массив с контролем выделения памяти. \n
|
||||
\en Create an array with memory allocation control. \n \~
|
||||
\param[in] cnt - \ru Количество элементов массива.
|
||||
\en Number of elements in the array. \~
|
||||
\param[out] res - \ru Результат операции.
|
||||
\en The operation result. \~
|
||||
\return \ru Возвращает массив элементов, если он создан, или NULL в противном случае.
|
||||
\en Returns an array of elements if it has been created, otherwise returns NULL. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
template <class Type>
|
||||
inline SArray<Type> * CreateArray( size_t cnt, MbResultType & res )
|
||||
{
|
||||
SArray<Type> * arr = new SArray<Type> ( cnt, 1 );
|
||||
if ( arr != NULL && arr->GetAddr() == NULL ) {
|
||||
delete arr;
|
||||
arr = NULL;
|
||||
}
|
||||
if ( arr == NULL )
|
||||
res = rt_TooManyPoints;
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Выделить в массиве память под n элементов.
|
||||
\en Allocate memory in the array for n elements. \~
|
||||
\details \ru Выделить в массиве память под n элементов с контролем выделения памяти. \n
|
||||
\en Allocate memory in the array for n elements with memory allocation control. \n \~
|
||||
\param[in, out] arr - \ru Массив.
|
||||
\en An array. \~
|
||||
\param[in] n - \ru Количество элементов, под которые нужно выделить память.
|
||||
\en Number of elements for allocation. \~
|
||||
\param[out] res - \ru Результат операции.
|
||||
\en The operation result. \~
|
||||
\return \ru Возвращает true в случае успешного выделения памяти.
|
||||
\en Returns true if the memory has been successfully allocated. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
template <class Type>
|
||||
inline bool ReserveArray( SArray<Type> & arr, size_t n, MbResultType & res )
|
||||
{
|
||||
arr.Reserve( n );
|
||||
if ( arr.GetAddr() == NULL ) {
|
||||
res = rt_TooManyPoints;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Добавить в массив элемент.
|
||||
\en Add an element to the array. \~
|
||||
\details \ru Добавить в массив элемент с контролем выделения памяти. \n
|
||||
\en Add an element to the array with memory allocation control. \n \~
|
||||
\param[in, out] arr - \ru Массив.
|
||||
\en An array. \~
|
||||
\param[in] item - \ru Элемент, который нужно добавить.
|
||||
\en The element to add. \~
|
||||
\param[out] res - \ru Результат операции.
|
||||
\en The operation result. \~
|
||||
\return \ru Возвращает true в случае успешного добавления.
|
||||
\en Returns true if the element has been successfully added. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
template <class Type>
|
||||
inline bool AddItem( SArray<Type> & arr, const Type & item, MbResultType & res )
|
||||
{
|
||||
arr.Add( item );
|
||||
if ( arr.GetAddr() == NULL ) {
|
||||
res = rt_TooManyPoints;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Пространственно-параметрическая точка.
|
||||
\en A space-parametric point. \~
|
||||
\details \ru Пространственно-параметрическая точка. \n
|
||||
Содержит в себе трехмерную и двумерную точки.
|
||||
\en A space-parametric point. \n
|
||||
Contains a three-dimensional point and a two-dimensional point. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSpaceParamPnt {
|
||||
protected:
|
||||
MbCartPoint3D spacePnt; ///< \ru Пространственная точка. \en A spatial point.
|
||||
MbCartPoint paramPnt; ///< \ru Параметрическая точка. \en A parametric point.
|
||||
|
||||
public: // \ru Конструкторы \en Constructors
|
||||
/// \ru Конструктор по пространственной точке. \en A constructor that takes a space point.
|
||||
explicit MbSpaceParamPnt( const MbCartPoint3D & sp ) : spacePnt( sp ), paramPnt( UNDEFINED_DBL, 0.0 ) {}
|
||||
/// \ru Конструктор по пространственной и параметрической точкам. \en A constructor that takes a space point and a parametric point.
|
||||
explicit MbSpaceParamPnt( const MbCartPoint3D & sp, const MbCartPoint & pp ) : spacePnt( sp ), paramPnt( pp ) {}
|
||||
/// \ru Конструктор по пространственно-параметрической точке. \en A constructor that takes a space-parametric point.
|
||||
explicit MbSpaceParamPnt( const MbSpaceParamPnt & cp ) : spacePnt( cp.spacePnt ), paramPnt( cp.paramPnt ) {}
|
||||
~MbSpaceParamPnt() {}
|
||||
|
||||
public: // \ru Инициализация \en The initialization
|
||||
/// \ru Инициализация по пространственно-параметрической точке. \en Initialization with a space-parametric point.
|
||||
void Init( const MbSpaceParamPnt & cp ) { spacePnt = cp.spacePnt; paramPnt = cp.paramPnt; }
|
||||
/// \ru Инициализация по пространственной и параметрической точкам. \en Initialization with a space point and a parametric point.
|
||||
void Init( const MbCartPoint3D & sp, const MbCartPoint & pp ) { spacePnt = sp; paramPnt = pp; }
|
||||
public: // \ru Функции \en Functions
|
||||
/// \ru Установлена ли параметрическая точка? \en Whether the parametric point is speified.
|
||||
bool IsParamPnt() const { return (paramPnt.x != UNDEFINED_DBL); } //-V550
|
||||
/// \ru Перевести параметрическую точку в неустановленное состояние. \en Reset a parametric point.
|
||||
void ResetParamPnt() { paramPnt.x = UNDEFINED_DBL; }
|
||||
/// \ru Проверка на равенство параметрических точек по X с заданной погрешностью. \en Check if parametric points are equal by X component with the specified tolerance.
|
||||
bool IsParamEqualX( const MbSpaceParamPnt & cp, double eps ) const { return (::fabs(paramPnt.x - cp.paramPnt.x) < eps); }
|
||||
/// \ru Проверка на равенство параметрических точек по Y с заданной погрешностью. \en Check if parametric points are equal by Y component with the specified tolerance.
|
||||
bool IsParamEqualY( const MbSpaceParamPnt & cp, double eps ) const { return (::fabs(paramPnt.y - cp.paramPnt.y) < eps); }
|
||||
|
||||
/// \ru Получить ссылку на пространственную точку. \en Get a reference to the space point.
|
||||
const MbCartPoint3D & GetSpacePnt() const { return spacePnt; }
|
||||
/// \ru Получить ссылку на параметрическую точку. \en Get a reference to the parametric point.
|
||||
const MbCartPoint & GetParamPnt() const { return paramPnt; }
|
||||
|
||||
private: // \ru Нереализованные \en Not implemented
|
||||
MbSpaceParamPnt();
|
||||
MbSpaceParamPnt( const MbCartPoint & );
|
||||
void operator = ( const MbCartPoint3D & );
|
||||
void operator = ( const MbCartPoint & );
|
||||
void operator = ( const MbSpaceParamPnt & );
|
||||
bool operator == ( const MbSpaceParamPnt & ) const;
|
||||
};
|
||||
|
||||
|
||||
typedef std::pair<MbSpaceParamPnt,c3d::UintPair> MbLocPnt; ///< \ru Пространственно-параметрическая точка с индексированным положением. \en A space-parametric point with indexed position.
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать точки на поверхности.
|
||||
\en Create points on a surface. \~
|
||||
\details \ru Создать группу точек на поверхности. \n
|
||||
\en Create a group of points on a surface. \n \~
|
||||
\param[in] surface - \ru Поверхность-источник.
|
||||
\en The source surface. \~
|
||||
\param[in] stepType - \ru Тип шага по поверхности.
|
||||
\en Type of spacing on a surface. \~
|
||||
\param[in] uValue - \ru Величина шага по u или количество точек по u при шаге по параметру
|
||||
\en U-spacing value or number of points in u-direction while sampling by parameter \~
|
||||
\param[in] vValue - \ru Величина шага по v или количество точек по v при шаге по параметру.
|
||||
\en V-spacing value or number of points in v-direction while sampling by parameter. \~
|
||||
\param[in] truncateByBounds - \ru Усечь границами поверхности.
|
||||
\en Whether to truncate by surface boundary. \~
|
||||
\param[out] result - \ru Индексированные пространственно-параметрические точки.
|
||||
\en Indexed space-parametric points. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) PointsOnSurface( const MbSurface & surface,
|
||||
MbeStepType stepType,
|
||||
double uValue,
|
||||
double vValue,
|
||||
bool truncateByBounds,
|
||||
RPArray< SArray<MbLocPnt> > & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать точки на поверхности.
|
||||
\en Create points on a surface. \~
|
||||
\details \ru Создать группу точек на поверхности. \n
|
||||
\en Create a group of points on a surface. \n \~
|
||||
\param[in] surface - \ru Поверхность-источник.
|
||||
\en The source surface. \~
|
||||
\param[in] gridType - \ru Тип cетки на поверхности.
|
||||
\en A type of a grid on a surface. \~
|
||||
\param[in] uv0 - \ru Центральная точка сетки
|
||||
\en The central point of the grid. \~
|
||||
\param[in] angle - \ru Угол поворота сетки относительно направления U (в радианах)
|
||||
\en Rotaion angle of the grid relative to U direction (in radians). \~
|
||||
\param[in] stepType - \ru Тип шага по поверхности.
|
||||
\en Type of spacing on a surface. \~
|
||||
\param[in] step1 - \ru Величина шага по первому направлению
|
||||
\en A spacing value in the first direction \~
|
||||
\param[in] step2 - \ru Величина шага по второму направлению
|
||||
\en A spacing value in the second direction \~
|
||||
\param[in] truncateByBounds - \ru Усечь границами поверхности.
|
||||
\en Whether to truncate by surface boundary. \~
|
||||
\param[out] result - \ru Индексированные пространственно-параметрические точки.
|
||||
\en Indexed space-parametric points. \~
|
||||
\param[in] maxPntsCnt - \ru Максимально допустимое количество точек.
|
||||
\en The maximal acceptable number of points. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) PointsOnSurface( const MbSurface & surface,
|
||||
MbeItemGridType & gridType,
|
||||
const MbCartPoint & uv0,
|
||||
double angle,
|
||||
MbeStepType stepType,
|
||||
double step1,
|
||||
double step2,
|
||||
bool truncateByBounds,
|
||||
RPArray< SArray<MbLocPnt> > & result,
|
||||
size_t maxPntsCnt = c3d::ARRAY_MAX_COUNT );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определить умолчательную разбивку поверхности.
|
||||
\en Define the default sampling of a surface. \~
|
||||
\details \ru Определить умолчательную разбивку поверхности \n
|
||||
(вспомогательная функция для функции PointsOnSurface).
|
||||
\en Define the default sampling of a surface \n
|
||||
(an auxillary function for function PointsOnSurface). \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[out] uPntsCnt - \ru Количество разбиений по u.
|
||||
\en The points number in U direction. \~
|
||||
\param[out] vPntsCnt - \ru Количество разбиений по v.
|
||||
\en The points number in V direction. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) DefinePointsOnSurfaceCounts( const MbSurface & surface,
|
||||
size_t & uPntsCnt,
|
||||
size_t & vPntsCnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точку пересечения трех поверхностей.
|
||||
\en Calculate the intersection point of three surfaces. \~
|
||||
\details \ru Найти точку пересечения трех поверхностей по начальным приближениям. \n
|
||||
\en Calculate the intersection point of three surfaces given the initial estimates. \n \~
|
||||
\param[in] surf0 - \ru Первая поверхность.
|
||||
\en The first surface. \~
|
||||
\param[in] ext0 - \ru Флаг поиска на продолжении первой поверхности.
|
||||
\en Whether to use the extension of the first surface. \~
|
||||
\param[in] surf1 - \ru Вторая поверхность.
|
||||
\en The second surface. \~
|
||||
\param[in] ext1 - \ru Флаг поиска на продолжении второй поверхности.
|
||||
\en Whether to use the extension of the second surface. \~
|
||||
\param[in] surf2 - \ru Третья поверхность.
|
||||
\en The third surface. \~
|
||||
\param[in] ext2 - \ru Флаг поиска на продолжении третьей поверхности.
|
||||
\en Whether to use the extension of the third surface. \~
|
||||
\param[in,out] uv0 - \ru Началальное приближение и результат на поверхности surf0.
|
||||
\en The initial approximation and the result on surface surf0. \~
|
||||
\param[in,out] uv1 - \ru Началальное приближение и результат на поверхности surf1.
|
||||
\en The initial approximation and the result on surface surf1. \~
|
||||
\param[in,out] uv2 - \ru Началальное приближение и результат на поверхности surf2.
|
||||
\en The initial approximation and the result on surface surf2. \~
|
||||
\return \ru Возвращает код результата итерационного поиска точки пересечения.
|
||||
\en Returns the result code of the intersection point iterative search. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeNewtonResult) IntersectionPoint( const MbSurface & surf0, bool ext0,
|
||||
const MbSurface & surf1, bool ext1,
|
||||
const MbSurface & surf2, bool ext2,
|
||||
MbCartPoint & uv0,
|
||||
MbCartPoint & uv1,
|
||||
MbCartPoint & uv2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти все точки пересечения поверхности и кривой.
|
||||
\en Calculate all the points of intersection of a surface and a curve. \~
|
||||
\details \ru Найти все точки пересечения поверхности и кривой. \n
|
||||
\en Calculate all the points of intersection of a surface and a curve. \n \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en A surface. \~
|
||||
\param[in] surfExt - \ru Искать на продолжении поверхности.
|
||||
\en Use the surface extension. \~
|
||||
\param[in] curv - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in] curveExt - \ru Искать на продолжении кривой.
|
||||
\en Use the curve extension. \~
|
||||
\param[out] uv - \ru Параметры точек пересечения на поверхности.
|
||||
\en Parameters of the intersection points on the surface. \~
|
||||
\param[out] tt - \ru Параметры точек пересечения на кривой.
|
||||
\en Parameters of the intersection points on the curve. \~
|
||||
\param[in] touchInclude - \ru Считать касания пересечениями.
|
||||
\en Consider tangencies as intersections. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) IntersectionPoints( const MbSurface & surf, bool surfExt,
|
||||
const MbCurve3D & curv, bool curveExt,
|
||||
SArray<MbCartPoint> & uv,
|
||||
SArray<double> & tt,
|
||||
bool touchInclude = false );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определить параметры ближайших точек прямых.
|
||||
\en Determine the parameters of the nearest points of lines. \~
|
||||
\details \ru Определить параметры ближайших точек прямых, заданных точкой и вектором направления.
|
||||
\en Determine the parameters of the nearest points of lines which are defined by the given point and direction vector. \~
|
||||
\param[in] origin1, direction1 - \ru Точка и направление первой прямой.
|
||||
\en A point and direction of the first line. \~
|
||||
\param[in] origin2, direction2 - \ru Точка и направление второй прямой.
|
||||
\en A point and direction of the second line. \~
|
||||
\param[out] t1 - \ru Параметр на первой прямой.
|
||||
\en Parameter on the first line. \~
|
||||
\param[out] t2 - \ru Параметр на второй прямой.
|
||||
\en Parameter on the second line. \~
|
||||
\return \ru Возвращает true, если есть прямые не параллельны. \n
|
||||
\en Returns true, if lines are not parallel. \n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) LineLineNearestParams( const MbCartPoint3D & origin1, const MbVector3D & direction1,
|
||||
const MbCartPoint3D & origin2, const MbVector3D & direction2,
|
||||
double & t1, double & t2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определение расстояния между ближайшими точками p1 и p2 прямых line1 и line2
|
||||
\en Determination of the distance between the nearest points p1 and p2 of lines line1 and line2 \~
|
||||
\details \ru Определение расстояния между ближайшими точками p1 и p2 прямых line1 и line2
|
||||
\en Determination of the distance between the nearest points p1 and p2 of lines line1 and line2 \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (double) LineLineNearestPoints( const MbLine3D & line1, const MbLine3D & line2,
|
||||
MbCartPoint3D & p1, MbCartPoint3D & p2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определить параметры ближайших точек прямых.
|
||||
\en Determine the parameters of the nearest points of lines. \~
|
||||
\details \ru Определить параметры ближайших точек прямых, заданных точкой и вектором направления.
|
||||
\en Determine the parameters of the nearest points of lines which are defined by the given point and direction vector. \~
|
||||
\param[in] origin1, direction1 - \ru Точка и направление первой прямой.
|
||||
\en A point and direction of the first line. \~
|
||||
\param[in] origin2, direction2 - \ru Точка и направление второй прямой.
|
||||
\en A point and direction of the second line. \~
|
||||
\param[out] t1 - \ru Параметр на первой прямой.
|
||||
\en Parameter on the first line. \~
|
||||
\param[out] t2 - \ru Параметр на второй прямой.
|
||||
\en Parameter on the second line. \~
|
||||
\return \ru Возвращает true, если есть прямые не параллельны. \n
|
||||
\en Returns true, if lines are not parallel. \n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) LineLineNearestParams( const MbCartPoint & origin1, const MbVector & direction1,
|
||||
const MbCartPoint & origin2, const MbVector & direction2,
|
||||
double & t1, double & t2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точку пересечения двух прямых.
|
||||
\en Calculate the point of two lines intersection. \~
|
||||
\details \ru Найти точку пересечения двух точно пересекающихся прямых без проверки параллельности. \n
|
||||
\en Calculate the intersection point of two exactly intersecting lines without check. \n \~
|
||||
\param[in] line1 - \ru Первая прямая.
|
||||
\en The first line. \~
|
||||
\param[in] line2 - \ru Вторая прямая.
|
||||
\en The second line. \~
|
||||
\param[out] result - \ru Точка пересечения.
|
||||
\en The intersection point. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
inline void FastLineLine( const MbLine & line1,
|
||||
const MbLine & line2,
|
||||
MbCartPoint & result )
|
||||
{
|
||||
const MbDirection & dir1 = line1.GetDirection();
|
||||
const MbDirection & dir2 = line2.GetDirection();
|
||||
const MbCartPoint & pnt1 = line1.GetOrigin();
|
||||
const MbCartPoint & pnt2 = line2.GetOrigin();
|
||||
|
||||
double t = ( dir1.ax * (pnt2.y - pnt1.y) - dir1.ay * (pnt2.x - pnt1.x )) /
|
||||
( dir1.ay * dir2.ax - dir1.ax * dir2.ay );
|
||||
|
||||
result.x = pnt2.x + dir2.ax * t;
|
||||
result.y = pnt2.y + dir2.ay * t;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точку пересечения двух прямых.
|
||||
\en Calculate the point of two lines intersection. \~
|
||||
\details \ru Найти точку пересечения двух прямых. \n
|
||||
Прямые могут быть параллельны или совпадать. \n
|
||||
\en Calculate the point of two lines intersection. \n
|
||||
The curves can be parallel or coincident. \n \~
|
||||
\param[in] line1 - \ru Первая прямая.
|
||||
\en The first line. \~
|
||||
\param[in] line2 - \ru Вторая прямая.
|
||||
\en The second line. \~
|
||||
\param[out] result - \ru Точка пересечения.
|
||||
\en The intersection point. \~
|
||||
\return \ru Возвращает результат пересечения: \n
|
||||
1 - Прямые пересекаются. \n
|
||||
0 - Прямые параллельны или совпадают.
|
||||
\en Returns the result of intersection: \n
|
||||
1 - The lines intersect at a point. \n
|
||||
0 - The lines are parallel or coincident. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) LineLine( const MbLine & line1,
|
||||
const MbLine & line2,
|
||||
MbCartPoint & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точку пересечения двух прямых.
|
||||
\en Calculate the point of two lines intersection. \~
|
||||
\details \ru Найти точку пересечения двух прямых. \n
|
||||
Прямые могут быть параллельны или совпадать. \n
|
||||
\en Calculate the point of two lines intersection. \n
|
||||
The curves can be parallel or coincident. \n \~
|
||||
\param[in] line1 - \ru Первая прямая.
|
||||
\en The first line. \~
|
||||
\param[in] line2 - \ru Вторая прямая.
|
||||
\en The second line. \~
|
||||
\param[out] result - \ru Точка пересечения.
|
||||
\en The intersection point. \~
|
||||
\return \ru Возвращает результат пересечения: \n
|
||||
1 : прямые пересекаются; \n
|
||||
0 : прямые параллельны; \n
|
||||
1 : прямые совпадают - касательная точка пересечения.
|
||||
\en Returns the result of intersection: \n 1 : the curves intersect at a point; \n 0 : the curves are parallel; \n 1 : the curves are coincident - the tangent intersection point. \~\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) LineLine( const MbLine & line1,
|
||||
const MbLine & line2,
|
||||
MbCrossPoint & result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точку пересечения прямой и отрезка.
|
||||
\en Calculate the intersection point of a line and a line segment. \~
|
||||
\details \ru Найти точку пересечения прямой и отрезка. \n
|
||||
Отрезок может быть параллелен прямой или лежать на ней. \n
|
||||
\en Calculate the intersection point of a line and a line segment. \n
|
||||
The line segment can be parallel to the curve or lie on it. \n \~
|
||||
\param[in] line - \ru Прямая.
|
||||
\en The line. \~
|
||||
\param[in] lseg - \ru Отрезок.
|
||||
\en The segment. \~
|
||||
\param[out] result - \ru Точка пересечения.
|
||||
\en The intersection point. \~
|
||||
\return \ru Возвращает результат пересечения: \n
|
||||
1 : прямая и отрезок пересекаются; \n
|
||||
0 : прямая и отрезок параллельны; \n
|
||||
1 : отрезок лежит на прямой - касательная точка пересечения.
|
||||
\en Returns the result of intersection: \n 1 : the line and the line segment intersect at a point; \n 0 : the line and a line segment are parallel; \n 1 : the segment lies on the curve - a tangent intersection point. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) LineLineSeg( const MbLine & line,
|
||||
const MbLineSegment & lseg,
|
||||
MbCrossPoint & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки пересечения прямой и окружности.
|
||||
\en Calculate intersection points of a line and a circle. \~
|
||||
\details \ru Найти параметры точек пересечения прямой и окружности. \n
|
||||
\en Calculate the parameters of intersection points of a line and a circle. \n \~
|
||||
\param[in] line - \ru Прямая.
|
||||
\en The line. \~
|
||||
\param[in] centre - \ru Центр окружности.
|
||||
\en The circle center. \~
|
||||
\param[in] radius - \ru Радиус окружности.
|
||||
\en The circle radius. \~
|
||||
\param[out] result - \ru Точки пересечения (указатель на массив из двух(!) элементов).
|
||||
\en The intersection points (a pointer to the array of two (!) elements). \~
|
||||
\return \ru Возвращает количество найденных пересечений.
|
||||
\en Returns the number of intersections. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) LineCircle( const MbLine & line,
|
||||
const MbCartPoint & centre,
|
||||
double radius,
|
||||
MbCrossPoint * result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки пересечения двух кривых.
|
||||
\en Calculate intersection points of two curves. \~
|
||||
\details \ru Найти параметры точек пересечения двух произвольных кривых. \n
|
||||
Общий метод вызывается, если нет частной функции пересечения. \n
|
||||
\en Calculate the parameters of intersection points of two arbitrary curves. \n
|
||||
The general method is used if there is no special function for intersection. \n \~
|
||||
\param[in] pCurve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] pCurve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] result - \ru Множество точек пересечения.
|
||||
\en The array of intersection points. \~
|
||||
\param[in] touchInclude - \ru Считать касания пересечениями.
|
||||
\en Consider tangencies as intersections. \~
|
||||
\param[in] epsilon - \ru Точность совпадения точек пересечения кривых.
|
||||
\en The accuracy of coincidence points of intersection. \~
|
||||
\param[in] allowInaccuracy - \ru Разрешить понижать входную точность.
|
||||
\en Allow lowering input accuracy. \~
|
||||
\return \ru Количество найденных пересечений.
|
||||
\en The number of intersections. \~
|
||||
\warning \ru Применяется для двумерных построений, аналог CurveCurveIntersection.
|
||||
\en Used for two-dimensional constructions, the analogue of CurveCurveIntersection. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) IntersectTwoCurves( const MbCurve & pCurve1,
|
||||
const MbCurve & pCurve2,
|
||||
SArray<MbCrossPoint> & result,
|
||||
bool touchInclude = true,
|
||||
double epsilon = Math::LengthEps*c3d::METRIC_DELTA,
|
||||
bool allowInaccuracy = true );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки пересечения двух кривых.
|
||||
\en Calculate intersection points of two curves. \~
|
||||
\details \ru Найти параметры точек пересечения двух произвольных кривых. \n
|
||||
Общий метод вызывается, если нет частной функции пересечения. \n
|
||||
\en Calculate the parameters of intersection points of two arbitrary curves. \n
|
||||
The general method is used if there is no special function for intersection. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] result1 - \ru Параметры пересечений первой кривой.
|
||||
\en The parameters of intersections for the first curve. \~
|
||||
\param[out] result2 - \ru Параметры пересечений второй кривой.
|
||||
\en The parameters of intersections for the second curve. \~
|
||||
\param[in] xEpsilon - \ru Точность по x.
|
||||
\en Tolerance in x direction. \~
|
||||
\param[in] yEpsilon - \ru Точность по y.
|
||||
\en Tolerance in y direction. \~
|
||||
\param[in] touchInclude - \ru Считать касания пересечениями.
|
||||
\en Consider tangencies as intersections. \~
|
||||
\param[in] allowInaccuracy - \ru Разрешить нахождение решения с меньшей точностью при невозможности удовлетворить указанной.
|
||||
\en Allow to find a solution with less precision when we can't get a solution with given precision. \~
|
||||
\return \ru Количество найденных пересечений.
|
||||
\en The number of intersections. \~
|
||||
\warning \ru Применяется для трехмерных построений, аналог IntersectTwoCurves.
|
||||
\en Used for three-dimensional constructions, the analogue of IntersectTwoCurves. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CurveCurveIntersection( const MbCurve & curve1,
|
||||
const MbCurve & curve2,
|
||||
SArray<double> & result1,
|
||||
SArray<double> & result2,
|
||||
double xEpsilon,
|
||||
double yEpsilon,
|
||||
bool touchInclude, bool allowInaccuracy = true );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки самопересечения кривой.
|
||||
\en Calculate the points of curve self-intersection. \~
|
||||
\details \ru Найти параметры точек самопересечения кривой с заданной точностью. \n
|
||||
\en Calculate the self-intersection points parameters with the given tolerance. \n \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in] xEpsilon - \ru Точность по x.
|
||||
\en Tolerance in x direction. \~
|
||||
\param[in] yEpsilon - \ru Точность по y.
|
||||
\en Tolerance in y direction. \~
|
||||
\param[out] result1 - \ru Множество параметров самопересечения.
|
||||
\en The self-intersection parameters array. \~
|
||||
\param[out] result2 - \ru Множество параметров самопересечения.
|
||||
\en The self-intersection parameters array. \~
|
||||
\param[in] version - \ru Версия операции.
|
||||
\en The version of the operation. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CurveSelfIntersect( const MbCurve & curve,
|
||||
double xEpsilon,
|
||||
double yEpsilon,
|
||||
SArray<double> & result1,
|
||||
SArray<double> & result2,
|
||||
VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить точки касания.
|
||||
\en Remove touch points. \~
|
||||
\details \ru Удалить все точки касания кривых вне зависимости от положения параметра на кривой
|
||||
(внутри области определения или на границах кривой).
|
||||
\en Remove all curves touch points regardless the position on the curve
|
||||
(in the domain or on the borders). \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in, out] result - \ru Множество точек пересечения.
|
||||
\en The array of intersection points. \~
|
||||
\param[in] eps - \ru Погрешность для функции проверки параллельности касательных RoundColinear.
|
||||
\en Accuracy for the function RoundColinear of testing the parallelism of tangents. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) RemoveAllTouchParams( const MbCurve & curve1,
|
||||
const MbCurve & curve2,
|
||||
SArray<MbCrossPoint> & result,
|
||||
double eps = PARAM_NEAR );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки пересечения двух кривых.
|
||||
\en Calculate intersection points of two curves. \~
|
||||
\details \ru Найти параметры точек пересечения двух произвольных кривых. \n
|
||||
\en Calculate the parameters of intersection points of two arbitrary curves. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] result1 - \ru Параметры точек пересечения для первой кривой.
|
||||
\en The intersection points parameters for the first curve. \~
|
||||
\param[out] result2 - \ru Параметры точек пересечения для второй кривой.
|
||||
\en The intersection points parameters for the second curve. \~
|
||||
\param[in] mEps - \ru Возможная максимальная погрешность найденных пересечений.
|
||||
\en The intersection tolerance. \~
|
||||
\return \ru Количество найденных пересечений.
|
||||
\en The number of intersections. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CurveCurveIntersection( const MbCurve3D & curve1,
|
||||
const MbCurve3D & curve2,
|
||||
SArray<double> & result1,
|
||||
SArray<double> & result2,
|
||||
double mEps = Math::metricRegion );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверить кривую на самопересечение.
|
||||
\en Determine if the curve has self-intersections. \~
|
||||
\details \ru Проверить заданную кривую на самопересечение. \n
|
||||
\en Determine if the given curve has self-intersections. \n \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in] mEps - \ru Возможная максимальная погрешность найденных самопересечений.
|
||||
\en The tolerance of self-intersections. \~
|
||||
\return \ru Возвращает true, если кривая самопересекается.
|
||||
\en Returns true if the curve has self-intersections. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) IsSelfIntersect( const MbCurve3D & curve,
|
||||
double mEps = Math::metricRegion );
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Убрать касательные точки пересечения.
|
||||
\en Remove the tangent intersection points. \~
|
||||
\details \ru Убрать параметры касательных точек пересечения внутри областей определения кривых. \n
|
||||
\en Remove the tangent intersection points parameters inside the domains of curves. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] result1 - \ru Параметры точек пересечения для первой кривой.
|
||||
\en The intersection points parameters for the first curve. \~
|
||||
\param[out] result2 - \ru Параметры точек пересечения для второй кривой.
|
||||
\en The intersection points parameters for the second curve. \~
|
||||
\param[in] mEps - \ru Возможная максимальная погрешность найденных пересечений.
|
||||
\en The intersection tolerance. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) FilterTouchParams( const MbCurve3D & curve1,
|
||||
const MbCurve3D & curve2,
|
||||
SArray<double> & result1,
|
||||
SArray<double> & result2,
|
||||
double mEps = Math::metricRegion );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки скрещения двух кривых.
|
||||
\en Calculate the points of two curves crossing. \~
|
||||
\details \ru Найти параметры точек скрещения двух кривых. \n
|
||||
\en Calculate parameters of the points of two curves crossing. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] result1 - \ru Параметры точек скрещения для первой кривой.
|
||||
\en Parameters of the points of crossing for the first curve. \~
|
||||
\param[out] result2 - \ru Параметры точек скрещения для второй кривой.
|
||||
\en Parameters of the points of crossing for the second curve. \~
|
||||
\return \ru Количество найденных скрещений.
|
||||
\en The points of crossing number. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CurveCurveCrossing( const MbCurve3D & curve1,
|
||||
const MbCurve3D & curve2,
|
||||
SArray<double> & result1,
|
||||
SArray<double> & result2,
|
||||
double epsilon = Math::metricRegion );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти проекцию точки на поверхность относительно внешнего контура поверхности.
|
||||
\en Find the projection of a point on a surface relative to the outer contour of the surface. \~
|
||||
\details \ru Найти проекцию пространственной точки на поверхность в виде двумерной точки на поверхности
|
||||
относительно внешнего контура поверхности. \n
|
||||
\en Calculate the projection of a space point on a surface as a two-dimensional point on the surface.
|
||||
relative to the outer contour of the surface. \n \~
|
||||
\param[in] surface - \ru Поверхность.
|
||||
\en A surface. \~
|
||||
\param[in] pnt - \ru Пространственная точка.
|
||||
\en A space point. \~
|
||||
\param[in] byOuterRectOnly - \ru Классифицировать проекцию только относительно внешнего габаритного прямоугольника.
|
||||
\en Whether to classify the projection relative to the outer bounding box only. \~
|
||||
\param[out] result - \ru Двумерная параметрическая точка на поверхности.
|
||||
\en A two-dimensional parametric point on the surface. \~
|
||||
\return \ru Возвращает true, если найдена нормальная проекция точки на поверхность.
|
||||
\en Returns true if a normal projection of the point on the surface has been calculated. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) PointProjectionRelativeOuterLoop( const MbSurface & surface,
|
||||
const MbCartPoint3D & pnt,
|
||||
bool byOuterRectOnly,
|
||||
MbCartPoint & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Является ли проекция точки точно неоднозначной.
|
||||
\en Determine whether the point projection is multiple-valued. \~
|
||||
\details \ru Является ли проекция точки неоднозначной при проецировании
|
||||
в области определения поверхности. \n
|
||||
\en Determine whether the point projection is multiple-valued while projecting
|
||||
inside the surface domain. \n \~
|
||||
\param[in] surface - \ru Поверхность.
|
||||
\en A surface. \~
|
||||
\param[in] result - \ru Пространственная точка.
|
||||
\en A space point. \~
|
||||
\return \ru Возвращает true, если проекция точки является неоднозначной.
|
||||
\en Returns true if the point projection is multiple-valued \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) IsMultipleProjection( const MbSurface & surface,
|
||||
const MbCartPoint3D & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки касания двух поверхностей.
|
||||
\en Calculate the touch points of two surfaces. \~
|
||||
\details \ru Найти параметры точек касания двух поверхностей. \n
|
||||
\en Calculate the parameters of touch points of two surfaces. \n \~
|
||||
\param[in] surf1 - \ru Первая поверхность.
|
||||
\en A first surface. \~
|
||||
\param[in] ext1 - \ru Искать на продолжении первой поверхности.
|
||||
\en Use the first surface extension. \~
|
||||
\param[in] surf2 - \ru Вторая поверхность.
|
||||
\en A second surface. \~
|
||||
\param[in] ext2 - \ru Искать на продолжении второй поверхности.
|
||||
\en Use the second surface extension. \~
|
||||
\param[in] uv1arr - \ru Параметры точек касания первой поверхности.
|
||||
\en Parameters of touch points of first surface. \~
|
||||
\param[in] uv2arr - \ru Параметры точек касания второй поверхности.
|
||||
\en Parameters of touch points of second surface. \~
|
||||
\return \ru Возвращает true, если найдены точки касания.
|
||||
\en Returns true if the touch points has be calculate. \~
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
\ingroup Point_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( bool) TouchIntersectionPoints( const MbSurface & surf1, bool ext1,
|
||||
const MbSurface & surf2, bool ext2,
|
||||
std::vector<MbCartPoint> & uv1arr,
|
||||
std::vector<MbCartPoint> & uv2arr );
|
||||
|
||||
|
||||
#endif // __ACTION_POINT_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,842 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Методы построения незамкнутых тел.
|
||||
\en Functions for open solids construction. \~
|
||||
\details \ru Геометрическое ядро C3D поддерживает поверхностное моделирование.
|
||||
Результатом поверхностного моделирования являются элементы геометрической модели,
|
||||
которые будем называть незамкнутыми телами. Незамкнутые тела характерны тем,
|
||||
что они описывают не всю поверхность моделируемого объекта, а только часть её.
|
||||
Часто незамкнутое тело состоит из одной грани. В незамкнутом теле всегда присутствуют
|
||||
краевые рёбра. Незамкнутое тело описывает множество точек, принадлежащих только граням
|
||||
этого тела, тогда как замкнутое тело описывает множество точек, располагающихся
|
||||
на поверхности моделируемого объекта и внутри него.
|
||||
\en The geometric kernel C3D supports the surface modeling.
|
||||
The result of surface modeling are elements of geometric model
|
||||
which are called open solids here. Open solids
|
||||
describe not the whole surface of an object of modeling but only a part of it.
|
||||
An open solid often consists of one face. An open solid always contains
|
||||
boundary edges. An open solid describes a point set that belong to faces of the solid only,
|
||||
whereas a closed solid describes a point set
|
||||
on the surface of the modeled object and inside it. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_SHELL_H
|
||||
#define __ACTION_SHELL_H
|
||||
|
||||
|
||||
#include <templ_rp_array.h>
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <space_item.h>
|
||||
#include <op_boolean_flags.h>
|
||||
#include <op_shell_parameter.h>
|
||||
#include <op_swept_parameter.h>
|
||||
#include <topology_faceset.h>
|
||||
#include <mb_operation_result.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
class MATH_CLASS MbFace;
|
||||
class MATH_CLASS MbSolid;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbPatchCurve;
|
||||
class IProgressIndicator;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить заплатку.
|
||||
\en Create a patch. \~
|
||||
\details \ru Построить заплатку по выбранным ребрам. \n
|
||||
\en Create a patch from the specified edges. \n \~
|
||||
\param[in] initEdges - \ru Набор ребер.
|
||||
\en A set of edges. \~
|
||||
\param[in] p - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] n - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Построенная заплатка.
|
||||
\en The required patch. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) PatchShell( const RPArray<MbPatchCurve> & initEdges,
|
||||
const PatchValues & p,
|
||||
const MbSNameMaker & n,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить заплатку.
|
||||
\en Create a patch. \~
|
||||
\details \ru Построить заплатку по выбранным кривым. \n
|
||||
\en Create a patch from the specified curves. \n \~
|
||||
\param[in] initCurves - \ru Набор кривых.
|
||||
\en A set of curves. \~
|
||||
\param[in] p - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] n - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Построенная заплатка.
|
||||
\en The required patch. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) PatchShell( const RPArray<MbCurve3D> & initCurves,
|
||||
const PatchValues & p,
|
||||
const MbSNameMaker & n,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить незамкнутое тело по множеству групп точек.
|
||||
\en Create an open solid given a set of point groups. \~
|
||||
\details \ru Построить незамкнутое тело по сечениям, образованным сплайнами, построенными по группе контрольных точек. \n
|
||||
\en Create an open lofted solid whose profiles are defined by splines created from the specified groups of points. \n \~
|
||||
\param[in] points - \ru Набор точек.
|
||||
\en A point set. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] name - \ru Идентификатор.
|
||||
\en An identifier. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LoftedShell( const RPArray< SArray<MbCartPoint3D> > & points,
|
||||
const MbSNameMaker & names,
|
||||
SimpleName name,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить незамкнутое тело по множеству кривых.
|
||||
\en Create an open solid from a set of curves. \~
|
||||
\details \ru Построить незамкнутое тело по сечениям, образованным кривыми. \n
|
||||
\en Create an open lofted solids whose profiles are defined by the curves. \n \~
|
||||
\param[in] curves - \ru Набор кривых.
|
||||
\en A set of curves. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] name - \ru Идентификатор.
|
||||
\en An identifier. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LoftedShell( const RPArray<MbCurve3D> & curves,
|
||||
const MbSNameMaker & names,
|
||||
SimpleName name,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить незамкнутое эквидистантное тело.
|
||||
\en Create an open offset solid. \~
|
||||
\details \ru Построить незамкнутое эквидистантное тело на базе указанных в initFaces граней. \n
|
||||
\en Create an open offset solid on the basis of the faces 'initFaces'. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования тела.
|
||||
\en Whether to copy the solid. \~
|
||||
\param[in] initFaces - \ru Грани исходного тела для построения.
|
||||
\en Faces of the initial solid for construction. \~
|
||||
\param[in] checkFacesConnection - \ru Необходимость проверки связности выбранных граней.
|
||||
\en Whether to check connectivity of the specified faces. \~
|
||||
\param[in] p - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] copyFaceAttrs - \ru Копировать атрибуты из исходных граней в эквидистантные.
|
||||
\en Copy attributes of initial faces to offset faces. \~
|
||||
\param[out] result - \ru Эквидистантная оболочка.
|
||||
\en The offset shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) OffsetShell( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbFace> & initFaces,
|
||||
bool checkFacesConnection,
|
||||
SweptValues & p,
|
||||
const MbSNameMaker & operNames,
|
||||
bool copyFaceAttrs,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить незамкнутое тело по множеству точек.
|
||||
\en Create an open solid from a point set. \~
|
||||
\details \ru Построить незамкнутое тело по множеству точек, заданных в параметрах построения. \n
|
||||
\en Create an open solid from a point set specified in parameters. \n \~
|
||||
\param[in] params - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\param[in,out] progBar - \ru Индикатор прогресса выполнения операции.
|
||||
\en A progress indicator of the operation. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsSurfacesShell( NurbsSurfaceValues & params,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbSolid *& result,
|
||||
IProgressIndicator * progBar );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить незамкнутое тело по сети кривых.
|
||||
\en Create an open solid from a set of curves. \~
|
||||
\details \ru Построить незамкнутое тело по сети кривых, заданных в параметрах построения. \n
|
||||
\en Create an open solid from a set of curves specified in the parameters. \n \~
|
||||
\param[in] pars - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) MeshShell( MeshSurfaceValues & pars,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Усечь (обрезать) незамкнутое тело.
|
||||
\en Truncate an open solid. \~
|
||||
\details \ru Выполнить построение незамкнутого тела путём усечения исходного тела. \n
|
||||
\en Create an open solid by truncation the initial solid. \n \~
|
||||
\param[in] initSolid - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] selIndices - \ru Номера выбранных граней (если массив пуст, то вся оболочка).
|
||||
\en The numbers of selected faces (if the array is empty, the whole shell is selected). \~
|
||||
\param[in] initCopyMode - \ru Режим копирования исходных оболочек.
|
||||
\en Whether to copy the initial shells. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] truncatingItems - \ru Усекающие объекты.
|
||||
\en Truncating objects. \~
|
||||
\param[in] truncatingOrients - \ru Ориентация усекающих объектов.
|
||||
\en The truncating objects orientation. \~
|
||||
\param[in] truncatingSplitMode - \ru Кривые используются как линии разъема.
|
||||
\en The curves are used as parting lines. \~
|
||||
\param[in] truncatingCopyMode - \ru Режим копирования усекающих оболочек.
|
||||
\en Whether to copy the truncating shells. \~
|
||||
\param[in] mergeFlags - \ru Флаги слияния элементов оболочки.
|
||||
\en Control flags of shell items merging. \~
|
||||
\param[out] result - \ru Усеченная оболочка.
|
||||
\en The truncated shell. \~
|
||||
\param[out] resultPlace - \ru Фантомное направление усечения.
|
||||
\en A phantom direction of truncation. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) TruncateShell( MbSolid & initSolid,
|
||||
SArray<size_t> & selIndices,
|
||||
MbeCopyMode initCopyMode,
|
||||
const MbSNameMaker & operNames,
|
||||
RPArray<MbSpaceItem> & truncatingItems,
|
||||
SArray<bool> & truncatingOrients,
|
||||
bool truncatingSplitMode,
|
||||
MbeCopyMode truncatingCopyMode,
|
||||
const MbMergingFlags & mergeFlags,
|
||||
MbSolid *& result,
|
||||
MbPlacement3D *& resultPlace );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить линейчатое незамкнутое тело.
|
||||
\en Create an open ruled solid. \~
|
||||
\details \ru Построить линейчатое незамкнутое тело по двум кривым, заданным в параметрах. \n
|
||||
\en Create an open ruled solid from two curves specified in parameters. \n \~
|
||||
\param[in] pars - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) RuledShell( RuledSurfaceValues & pars,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверить кривую для построения линейчатого тела.
|
||||
\en Check the curve for a ruled solid creation. \~
|
||||
\details \ru Проверить вторую кривую на согласованность с первой кривой для построения
|
||||
линейчатого незамкнутого тела и выполнить необходимую модификацию второй кривой. \n
|
||||
\en Check the second curve for consistency with the first curve for creation
|
||||
of the open ruled solid and make the necessary modification of the second curve. \n \~
|
||||
\param[in] curve0 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve1 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] isInverted1 - \ru Была ли вторая кривая инвертирована.
|
||||
\en Whether the second curve was inverted. \~
|
||||
\param[out] isShifted1 - \ru Было ли смещено начало второй кривой.
|
||||
\en Whether the beginning of the first curve was shifted. \~
|
||||
\param[in] version - \ru Версия операции.
|
||||
\en The version of the operation. \~
|
||||
\warning \ru Вспомогательная функция операции RuledShell.
|
||||
\en An auxiliary function of operation 'RuledShell'. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (void) CheckRuledCurve( const MbCurve3D & curve0,
|
||||
const MbCurve3D & curve1,
|
||||
bool & isInverted1,
|
||||
bool & isShifted1,
|
||||
VERSION version );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверить параметры кривой для построения линейчатого тела.
|
||||
\en Check the curve parameters for creation of a ruled solid. \~
|
||||
\details \ru Проверить параметры кривой и выполнить нормализацию параметров замкнутой кривой. \n
|
||||
\en Check the curve parameters and perform the normalization of a closed curve parameters. \n \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in,out] params - \ru Множество параметров кривой.
|
||||
\en An array of the curve parameters. \~
|
||||
\param[in] isAscending - \ru Будет ли порядок параметров возрастающим.
|
||||
\en Whether the parameters are specified in the ascending order. \~
|
||||
\return \ru Возвращает true, если удалось нормализовать массив параметров.
|
||||
\en Returns true if the parameter array has been successfully normalized. \~
|
||||
\warning \ru Вспомогательная функция операции RuledShell.
|
||||
\en An auxiliary function of operation 'RuledShell'. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckRuledParams( const MbCurve3D & curve,
|
||||
SArray<double> & params,
|
||||
bool isAscending );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить продолжение незамкнутого тела выдавливанием.
|
||||
\en Create an extension of an open solid by extrusion. \~
|
||||
\details \ru Построить продолжение незамкнутого тела путём выдавливания указанных краевых рёбер заданной грани тела. \n
|
||||
\en Create an extension of an open solid by extrusion of specified boundary edges of the given face of the solid. \n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования оболочки.
|
||||
\en Whether to copy the shell. \~
|
||||
\param[in] face - \ru Продляемая грань в исходной оболочке.
|
||||
\en A face of the initial shell to be extended. \~
|
||||
\param[in] edges - \ru Множество ребер продляемой грани, через которые выполняется продление.
|
||||
\en An array of edges through which to extend the face. \~
|
||||
\param[in] params - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ExtensionShell( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
MbFace & face,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const ExtensionValues & params,
|
||||
const MbSNameMaker & operNames,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить тело соединения по двум кривым.
|
||||
\en Create a joint solid from two curves. \~
|
||||
\details \ru Построить незамкнутое тело соединения по двум кривым на поверхности. \n
|
||||
\en Create an open joint solid from two curves on a surface. \n \~
|
||||
\param[in] curve1 - \ru Первая поверхностная кривая.
|
||||
\en The first curve on a surface. \~
|
||||
\param[in] curve2 - \ru Вторая поверхностная кривая.
|
||||
\en The second curve on a surface. \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) JoinShell( MbSurfaceCurve & curve1,
|
||||
MbSurfaceCurve & curve2,
|
||||
JoinSurfaceValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить тело соединения по двум множествам рёбер.
|
||||
\en Create a joint solid from two sets of edges. \~
|
||||
\details \ru Построить незамкнутое тело соединения по двум множествам ребер. \n
|
||||
\en Create an open joint solid from two sets of edges. \n \~
|
||||
\param[in] edges1 - \ru Первая группа ребер.
|
||||
\en The first group of edges. \~
|
||||
\param[in] orients1 - \ru Ориентации ребер в первой группе.
|
||||
\en The edges senses in the first group. \~
|
||||
\param[in] edges2 - \ru Вторая группа ребер.
|
||||
\en The second group of edges. \~
|
||||
\param[in] orients2 - \ru Ориентация ребер во второй группе.
|
||||
\en The edges senses in the second group. \~
|
||||
\param[in] matr1 - \ru Матрица преобразования первой группы ребер в единую систему координат.
|
||||
\en The matrix of transformation of the first group of edges to the common coordinate system. \~
|
||||
\param[in] matr2 - \ru Матрица преобразования второй группы ребер в единую систему координат.
|
||||
\en The matrix of transformation of the second group of edges to the common coordinate system. \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\param[in] isPhantom - \ru Режим фантома операции.
|
||||
\en The operation phantom mode. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) JoinShell( const RPArray<MbCurveEdge> & edges1,
|
||||
const SArray<bool> & orients1,
|
||||
const RPArray<MbCurveEdge> & edges2,
|
||||
const SArray<bool> & orients2,
|
||||
const MbMatrix3D & matr1,
|
||||
const MbMatrix3D & matr2,
|
||||
JoinSurfaceValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbSolid *& result,
|
||||
bool isPhantom = false );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разделить оболочку на части по заданному набору ребер.
|
||||
\en Divide a shell into parts using a given set of edges. \~
|
||||
\details \ru Разделить оболочку на части по заданному набору ребер. \n
|
||||
\en Divide shell into parts using a given set of edges. \n \~
|
||||
\param[in] solid - \ru Оболочка.
|
||||
\en A shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования оболочки.
|
||||
\en Whether to copy the shell. \~
|
||||
\param[in] edges - \ru Набор ребер.
|
||||
\en Set of edges. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) DivideShell( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const MbSNameMaker & operNames,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверить кривую для построения тела соединения.
|
||||
\en Check a curve for creation a joint solid. \~
|
||||
\details \ru Проверить вторую кривую на согласованность с первой кривой для построения
|
||||
незамкнутого тела соединения и выполнить необходимую модификацию второй кривой. \n
|
||||
\en Check the second curve for consistency with the first curve for creation
|
||||
of the open joint solid and make the necessary modification of the second curve. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] isInverted1 - \ru Была ли вторая кривая инвертирована.
|
||||
\en Whether the second curve was inverted. \~
|
||||
\param[out] isShifted1 - \ru Было ли смещено начало второй кривой.
|
||||
\en Whether the beginning of the first curve was shifted. \~
|
||||
\param[in] version - \ru Версия операции.
|
||||
\en The version of the operation. \~
|
||||
\warning \ru Вспомогательная функция операции JoinShell.
|
||||
\en An auxiliary function of operation JoinShell. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (void) CheckJoinedCurve( const MbCurve3D & curve1,
|
||||
const MbCurve3D & curve2,
|
||||
bool & isInverted1,
|
||||
bool & isShifted1,
|
||||
VERSION version );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверить параметры кривой для построения тела соединения.
|
||||
\en Check the curve parameters for creation of a joint solid. \~
|
||||
\details \ru Проверить параметры кривой и нормализовать параметры замкнутой кривой. \n
|
||||
\en Check the curve parameters and normalize a closed curve parameters. \n \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in,out] params - \ru Множество параметров кривой.
|
||||
\en An array of the curve parameters. \~
|
||||
\param[in] isAscending - \ru Будет ли порядок параметров возрастающим.
|
||||
\en Whether the parameters are specified in the ascending order. \~
|
||||
\return \ru Возвращает true, если удалось нормализовать массив параметров.
|
||||
\en Returns true if the parameter array has been successfully normalized. \~
|
||||
\warning \ru Вспомогательная функция операции JoinShell.
|
||||
\en An auxiliary function of operation JoinShell. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckJoinedParams( const MbCurve3D & curve,
|
||||
SArray<double> & params,
|
||||
bool isAscending );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить кривую по множеству рёбер.
|
||||
\en Create a curve from a set of edges. \~
|
||||
\details \ru Создать кривую для поверхности соединения по списку ребер. \n
|
||||
\en Create a curve for a surface of the joint from a list of edges. \n \~
|
||||
\param[in] edges - \ru Набор ребер.
|
||||
\en A set of edges. \~
|
||||
\param[in] orients - \ru Ориентации ребер.
|
||||
\en Edges senses. \~
|
||||
\param[in] matr - \ru Матрица преобразования ребер.
|
||||
\en Edges transformation matrix. \~
|
||||
\param[out] res - \ru Результат операции.
|
||||
\en The operation result. \~
|
||||
\return \ru Возвращает указатель на кривую, если ее получилось создать,
|
||||
иначе возвращает ноль.
|
||||
\en Returns a pointer to the curve if it has been successfully created,
|
||||
otherwise it returns null. \~
|
||||
\warning \ru Вспомогательная функция операции JoinShell.
|
||||
\en An auxiliary function of operation JoinShell. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbCurve3D *) CreateJoinedCurve( const RPArray<MbCurveEdge> & edges,
|
||||
const SArray<bool> & orients,
|
||||
const MbMatrix3D & matr,
|
||||
MbResultType & res );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить тело сопряжения несвязанных граней.
|
||||
\en Create a solid of two non-connected faces. \~
|
||||
\details \ru Построить незамкнутое тело, состоящее из грани скругления между двумя несвязанными гранями. \n
|
||||
\en Create an open solid that consists of a fillet face between two non-connected faces. \n \~
|
||||
\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 operation parameters. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Построенная оболочка (тело).
|
||||
\en The resultant shell (solid). \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) FacesFillet( const MbSolid & solid1,
|
||||
const MbFace & face1,
|
||||
const MbSolid & solid2,
|
||||
const MbFace & face2,
|
||||
const SmoothValues & params,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить тело на базе элементарной поверхности.
|
||||
\en Create a solid given an elementary surface. \~
|
||||
\details \ru Построить тело, состоящее из одной грани, на базе исходной элементарной поверхности. \n
|
||||
\en Create a solid which consists of a face with the specified underlying elementary surface. \n \~
|
||||
\param[in] surface - \ru Поверхность.
|
||||
\en The surface. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ElementaryShell( const MbSurface & surface,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить тело на базе поверхности.
|
||||
\en Create a solid given a surface. \~
|
||||
\details \ru Построить тело, состоящее из одной грани, на базе исходной поверхности.
|
||||
Поверхность должна быть без самопересечений, с корректной ориентацией
|
||||
ограничивающих кривых в случае поверхности MbCurveBoundedSurface. \n
|
||||
\en Create a solid which consists of a face with the specified underlying surface.
|
||||
The surface should have no self-intersections,
|
||||
the bounding curves should be correctly oriented in case of surface MbCurveBoundedSurface. \n \~
|
||||
\param[in] surface - \ru Поверхность.
|
||||
\en The surface. \~
|
||||
\param[in] names - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SurfaceShell( const MbSurface & surface,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разрезать тело силуэтным контуром.
|
||||
\en Cut a solid by a silhouette contour. \~
|
||||
\details \ru Построить оболочки, полученные в результате разрезания тела его силуэтным контуром. \n
|
||||
\en Create solids as a result of cutting a solids by its silhouette contour.\n\~
|
||||
\param[in] shell - \ru Исходное тело.
|
||||
\en The solid\~
|
||||
\param[in] sameShell - \ru Способ передачи данных при копировании оболочек.
|
||||
\en Methods of transferring data while copying shells \~
|
||||
\param[in] eye - \ru Направление взгляда.
|
||||
\en Eye's direction. \~
|
||||
\param[out] outlineCurves - \ru Кривые, входящие в силуэтный контур.
|
||||
- \en Curves of the silhouette contour. \~
|
||||
\param[out] result - \ru Тела, полученные в результате применения операции.
|
||||
- \en The resultant solids.\~
|
||||
\return \ru Возвращает код результата операции.\~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CutShellSilhouetteContour( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbVector3D & eye,
|
||||
const VERSION version,
|
||||
RPArray<MbCurve3D> & outlineCurves,
|
||||
RPArray<MbSolid> & result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Сшить грани нескольких тел в одно тело.
|
||||
\en Stitch faces of several solids into single solid. \~
|
||||
\details \ru Сшить стыкующиеся друг с другом грани нескольких тел в одно тело. Ориентация граней может быть изменена. \n
|
||||
\en Stitch faces of several solids with coincident edges into single solid. The faces orientation can be changed. \n \~
|
||||
\param[in] initialSolids - \ru Множество тел для сшивки.
|
||||
\en An array of solids for stitching. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] formSolidBody - \ru Флаг формирования твердого тела из результирующей оболочки.
|
||||
\en Whether to form a solid solid from the resultant shell. \~
|
||||
\param[in] stitchPrecision - \ru Точность сшивки.
|
||||
\en Stitching accuracy. \~
|
||||
\param[out] resultSolid - \ru Результирующая оболочка или тело (в зависимости от флага).
|
||||
\en The resultant shell or solid (depends on the flag). \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeStitchResType) StitchToOneSheetSolid( const RPArray<const MbSolid> & initialSolids,
|
||||
const MbSNameMaker & operNames,
|
||||
bool formSolidBody,
|
||||
double stitchPrecision,
|
||||
MbSolid *& resultSolid );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определение оси токарного сечения и построение кривых сечения для тела.
|
||||
\en Search for lathe axis and construction of lathe elements for the solid. \~
|
||||
\details \ru Функция выполняет поиск токарной оси граней вращения и строит токарное сечение в некоторой плоскости. \n
|
||||
\en The function searches for lathe axis of rotation faces and builds the curves of lathe-section in a plane. \n \~
|
||||
\param[in] solid - \ru Тело. \en Solid. \~
|
||||
\param[in] axis - \ru Ось токарного сечения может быть нуль). \en Lathe axis, may be null. \~
|
||||
\param[in] angle - \ru Угол, управляющий построением перпендикулярных оси сечения отрезками, рекомендуется M_PI_4-M_PI. \en The angle, managing the construction of segments which perpendicular to the axis, recomended M_PI_4-M_PI. \~
|
||||
\param[out] position - \ru Плоскость, в плоскости XY которой лежат кривые сечения, а ось X является осью токарного сечения. \en Plane position of section, axis X is a axis of section. \~
|
||||
\param[out] curves - \ru Кривые токарного сечения располагаются в плоскости XY position. \en The curves of section located on plane XY of position. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LatheCurves( const MbSolid & solid,
|
||||
const MbAxis3D * axis,
|
||||
double angle,
|
||||
MbPlacement3D & position,
|
||||
RPArray<MbCurve> & curves );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение следа кривой при её вращении вокруг оси токарного сечения.
|
||||
\en Building of curves for lathe section for given curve. \~
|
||||
\details \ru Функция выполняет построение следа ребра в плоскости XY локальной системы координат при его вращении вокруг оси X. \n
|
||||
\en The function builds the generatrix track in the XY plane of the local coordinate system as it rotates around the axis X. \n \~
|
||||
\param[in] generatrix - \ru Кривая. \en Curve \~
|
||||
\param[in] position - \ru Плоскость, ось X которой является осью токарного сечения. \en Plane position of section, axis X is a axis of section. \~
|
||||
\param[out] curves - \ru Контейр кривых, в который будет добавлен след в плоскости XY position от вращения кривой generatrix вокруг оси X. \en The curve on plane XY of position will be added to contaner curves. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LatheCurve( const MbCurve3D & generatrix,
|
||||
const MbPlacement3D & position,
|
||||
RPArray<MbCurve> & curves );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить срединную оболочку по граням тела, основанным на
|
||||
эквидистантных поверхностях.
|
||||
\en Create a median shell by solid faces, based on equidistant
|
||||
surfaces. \~
|
||||
\details \ru Построить срединную оболочку по парам граней тела, основанным на
|
||||
эквидистантных поверхностях. Пары граней либо выбираются пользователем,
|
||||
либо находятся автоматически по заданному расстоянию между гранями.
|
||||
Грани должны принадлежать одному и тому же телу.\n
|
||||
\en Construct a median shell between pair of faces, based on equidistant
|
||||
surfaces. Pair of faces are selected by user or are found by given distance
|
||||
between faces. The faces must belong to the same body. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] sameShell - \ru Режим копирования тела.
|
||||
\en Whether to copy the solid. \~
|
||||
\param[in] faceIndexes - \ru Выбранные пары граней.
|
||||
\en Selected face pairs. \~
|
||||
\param[in] params - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующая оболочка.
|
||||
\en The required shell. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Shell_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC( MbResultType ) MedianShell( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const c3d::IndicesPairsVector & faceIndexes,
|
||||
const MedianShellValues & params,
|
||||
const MbSNameMaker & operNames,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение развёртки грани на плоскость.
|
||||
\en Construction of a face sweep on a plane. \~
|
||||
\details \ru Построение развёртки грани на плоскость.\n
|
||||
\en Construction of a face sweep on a plane.\n \~
|
||||
\param[in] face - \ru Исходная грань.
|
||||
\en The initial face. \~
|
||||
\param[in] values - \ru Параметры построения: локальная система координат развернутой поверхности грани, данные для вычисления шага при триангуляции, коэффициент Пуассона материала грани.
|
||||
\en The parameters: Local coordinate system for result surface, Data for step calculation during triangulation, the Poisson's ratio of face material. \~
|
||||
\param[out] result - \ru Тело - плоская развертка исходной грани.
|
||||
\en The built solid unbend face on plane. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) RectifyFace( const MbFace & face,
|
||||
const RectifyValues values,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать решетчатую оболочку.
|
||||
\en Create a lattice shell. \~
|
||||
\details \ru Создать решетчатую оболочку по трем управляющим точкам, параметрам решетки и количеству элементов. \n
|
||||
\en Create a lattice shell on the three control points of the lattice parameters and the number of elements. \~
|
||||
\param[in] point0 - \ru Точка, определяющая начало локальной системы координат поверхности.
|
||||
\en The origin of the surface local coordinate system. \~
|
||||
\param[in] point1 - \ru Точка, определяющая направление оси X локальной системы и размер элемента.
|
||||
\en A point specifying the direction of X-axis of the local system and the size of element. \~
|
||||
\param[in] point2 - \ru Точка, определяющая направление оси Y локальной системы.
|
||||
\en A point specifying the direction of Y-axis of the local system. \~
|
||||
\param[in] xRadius - \ru Шаг вдоль первой оси локальной системы координат.
|
||||
\en The step along the first axis of the local coordinate system. \~
|
||||
\param[in] yRadius - \ru Шаг вдоль второй оси локальной системы координат.
|
||||
\en The step along the second axis of the local coordinate system. \~
|
||||
\param[in] zRadius - \ru Шаг вдоль третьей оси локальной системы координат.
|
||||
\en The step along the third axis of the local coordinate system. \~
|
||||
\param[in] xCount - \ru Количество ячеек вдоль первой оси локальной системы координат.
|
||||
\en The number of cells along a first axis of the local coordinate system. \~
|
||||
\param[in] yCount - \ru Количество ячеек вдоль второй оси локальной системы координат.
|
||||
\en The number of cells along a second axis of the local coordinate system. \~
|
||||
\param[in] zCount - \ru Количество ячеек вдоль третьей оси локальной системы координат.
|
||||
\en The number of cells along a third axis of the local coordinate system. \~
|
||||
\param[out] result - \ru Построенная тело.
|
||||
\en The constructed solid. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) OctaLattice( const MbCartPoint3D & point_0,
|
||||
const MbCartPoint3D & point_1,
|
||||
const MbCartPoint3D & point_2,
|
||||
double xRadius,
|
||||
double yRadius,
|
||||
double zRadius,
|
||||
size_t xCount,
|
||||
size_t yCount,
|
||||
size_t zCount,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
#endif // __ACTION_SHELL_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,798 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Методы построения поверхностей.
|
||||
\en Functions for surfaces creation. \~
|
||||
\details \ru Поверхности являются основным элементом описания формы моделируемых объектов.
|
||||
На базе поверхностей строятся грани, которые используются в твёрдых телах.
|
||||
\en Surfaces is a basic element of the modeled objects shape description.
|
||||
Faces are constructed on the basis of surfaces and then are used in solid solids. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ACTION_SURFACE_H
|
||||
#define __ACTION_SURFACE_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <space_item.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbFace;
|
||||
class MATH_CLASS MbSolid;
|
||||
class MATH_CLASS MbSurfaceCurve;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
class MATH_CLASS MbGrid;
|
||||
class MATH_CLASS MbRegion;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать элементарную поверхность.
|
||||
\en Create an elementary surface. \~
|
||||
\details \ru Создать одну из элементарных поверхностей по трем управляющим точкам и типу: \n
|
||||
surfaceType == st_Plane - плоскость \n
|
||||
surfaceType == st_ConeSurface - коническая поверхность \n
|
||||
surfaceType == st_CylinderSurface - цилиндрическая поверхность \n
|
||||
surfaceType == st_SphereSurface - сферическая поверхность \n
|
||||
surfaceType == st_TorusSurface - поверхность тора \n
|
||||
\en Create one of elementary surfaces from three points and a type: \n
|
||||
surfaceType == st_Plane - a plane \n
|
||||
surfaceType == st_ConeSurface - a conical surface \n
|
||||
surfaceType == st_CylinderSurface - a cylindrical surface \n
|
||||
surfaceType == st_SphereSurface - a spherical surface \n
|
||||
surfaceType == st_TorusSurface - a torus surface \n \~
|
||||
\param[in] point0 - \ru Точка, определяющая начало локальной системы координат поверхности.
|
||||
\en The origin of the surface local coordinate system. \~
|
||||
\param[in] point1 - \ru Точка, определяющая направление оси X локальной системы и радиус поверхности.
|
||||
\en A point specifying the direction of X-axis of the local system and the surface radius. \~
|
||||
\param[in] point2 - \ru Точка, определяющая направление оси Y локальной системы.
|
||||
\en A point specifying the direction of Y-axis of the local system. \~
|
||||
\param[in] surfaceType - \ru Тип поверхности.
|
||||
\en The surface type. \~
|
||||
\param[out] result - \ru Построенная поверхность.
|
||||
\en The constructed surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ElementarySurface( const MbCartPoint3D & point0,
|
||||
const MbCartPoint3D & point1,
|
||||
const MbCartPoint3D & point2,
|
||||
MbeSpaceType surfaceType,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать плоскую NURBS - поверхность.
|
||||
\en Create a planar NURBS - surface. \~
|
||||
\details \ru Создать плоскую NURBS - поверхность по угловым точкам. \n
|
||||
\en Create a planar NURBS - surface given the corner points. \n \~
|
||||
\param[in] pUMinVMin - \ru Угловая точка поверхности.
|
||||
\en A corner point of a surface. \~
|
||||
\param[in] pUMaxVMin - \ru Угловая точка поверхности.
|
||||
\en A corner point of a surface. \~
|
||||
\param[in] pUMaxVMax - \ru Угловая точка поверхности.
|
||||
\en A corner point of a surface. \~
|
||||
\param[in] pUMinVMax - \ru Угловая точка поверхности.
|
||||
\en A corner point of a surface. \~
|
||||
\param[in] uCount - \ru Количество точек по U.
|
||||
\en A number of points by U direction. \~
|
||||
\param[in] vCount - \ru Количество точек по V.
|
||||
\en A number of points by V direction. \~
|
||||
\param[in] uDegree - \ru Порядок сплайнов по U.
|
||||
\en Splines degree by U. \~
|
||||
\param[in] vDegree - \ru Порядок сплайнов по V.
|
||||
\en Splines degree by V. \~
|
||||
\param[out] result - \ru Cплайновая поверхность.
|
||||
\en The spline surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SplineSurface( const MbCartPoint3D & pUMinVMin, const MbCartPoint3D & pUMaxVMin,
|
||||
const MbCartPoint3D & pUMaxVMax, const MbCartPoint3D & pUMinVMax,
|
||||
size_t uCount, size_t vCount,
|
||||
size_t uDegree, size_t vDegree,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать NURBS - поверхность.
|
||||
\en Create a NURBS - surface. \~
|
||||
\details \ru Создать NURBS - поверхность по массивам точек и весов. \n
|
||||
контейнер weightList может быть пустым. \n
|
||||
контейнер uKnotList может быть пустым. \n
|
||||
контейнер vKnotList может быть пустым. \n
|
||||
\en Create a NURBS - surface given arrays of points and weights. \n
|
||||
container 'weightList' can be empty. \n
|
||||
container 'uKnotList' can be empty. \n
|
||||
container 'vKnotList' can be empty. \n \~
|
||||
\param[in] pointList - \ru Множество точек.
|
||||
\en An array of points. \~
|
||||
\param[in] weightList - \ru Множество весов
|
||||
\en An array of weights. \~
|
||||
\param[in] uCount - \ru Размерность массива точек по U.
|
||||
\en The size of point array by U. \~
|
||||
\param[in] vCount - \ru Размерность массива точек по V.
|
||||
\en The size of point array by V. \~
|
||||
\param[in] uDegree - \ru Порядок сплайнов по U.
|
||||
\en Splines degree by U. \~
|
||||
\param[in] uKnotList - \ru Узловой вектор по U.
|
||||
\en A knot vector by U. \~
|
||||
\param[in] uClosed - \ru Замкнутость по U.
|
||||
\en Closedness by U. \~
|
||||
\param[in] vDegree - \ru Порядок сплайнов по V.
|
||||
\en Splines degree by V. \~
|
||||
\param[in] vKnotList - \ru Узловой вектор по V.
|
||||
\en A knot vector by V. \~
|
||||
\param[in] vClosed - \ru Замкнутость по V.
|
||||
\en Closedness by V. \~
|
||||
\param[out] result - \ru Cплайновая поверхность.
|
||||
\en The spline surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SplineSurface( const SArray<MbCartPoint3D> & pointList,
|
||||
const SArray<double> & weightList,
|
||||
size_t uCount, size_t vCount,
|
||||
size_t uDegree, const SArray<double> & uKnotList, bool uClosed,
|
||||
size_t vDegree, const SArray<double> & vKnotList, bool vClosed,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность выдавливания.
|
||||
\en Create an extrusion surface. \~
|
||||
\details \ru Создать поверхность выдавливания кривой. \n
|
||||
\en Create a surface of a curve extrusion. \n \~
|
||||
\param[in] curve - \ru Образующая кривая.
|
||||
\en The generating curve. \~
|
||||
\param[in] direction - \ru Вектор выдавливания.
|
||||
\en An extrusion vector. \~
|
||||
\param[in] simplify - \ru Упрощать поверхность, если возможно.
|
||||
\en Simplify a surface if it's possible. \~
|
||||
\param[out] result - \ru Поверхность выдавливания.
|
||||
\en An extrusion surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ExtrusionSurface( MbCurve3D & curve, const MbVector3D & direction,
|
||||
bool simplify, MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность вращения.
|
||||
\en Create a revolution surface. \~
|
||||
\details \ru Создать поверхность вращения кривой. \n
|
||||
\en Create a curve revolution surface. \n \~
|
||||
\param[in] curve - \ru Образующая кривая.
|
||||
\en The generating curve. \~
|
||||
\param[in] origin - \ru Точка положения оси вращения.
|
||||
\en The rotation axis origin. \~
|
||||
\param[in] axis - \ru Направление оси вращения.
|
||||
\en The rotation axis direction. \~
|
||||
\param[in] angle - \ru Угол вращения.
|
||||
\en A rotation angle. \~
|
||||
\param[in] simplify - \ru Упрощать поверхность, если возможно.
|
||||
\en Simplify a surface if it's possible. \~
|
||||
\param[out] result - \ru Поверхность вращения.
|
||||
\en The revolution surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) RevolutionSurface( MbCurve3D & curve, const MbCartPoint3D & origin, const MbVector3D & axis, double angle,
|
||||
bool simplify, MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность движения.
|
||||
\en Create an expansion surface. \~
|
||||
\details \ru Создать поверхность движения кривой. \n
|
||||
\en Create a surface of a curve sweeping. \n \~
|
||||
\param[in] curve - \ru Образующая кривая.
|
||||
\en The generating curve. \~
|
||||
\param[in] spine - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[out] result - \ru Поверхность движения с доворотами.
|
||||
\en The expansion surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ExpansionSurface( MbCurve3D & curve, MbCurve3D & spine,
|
||||
MbCurve3D * curve1,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать кинематическую поверхность.
|
||||
\en Create an evolution surface. \~
|
||||
\details \ru Создать кинематическую поверхность по образующей и направляющей. \n
|
||||
В случае, если spine имеет тип st_ConeSpiral, результатом построения
|
||||
является спиральная поверхность. \n
|
||||
\en Create an evolution surface from the generating curve and the guide curve. \n
|
||||
If 'spine' has type st_ConeSpiral, the result of the construction
|
||||
is a spiral surface. \n \~
|
||||
\param[in] curve - \ru Образующая кривая.
|
||||
\en The generating curve. \~
|
||||
\param[in] spine - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[out] result - \ru Кинематическая поверхность или спиральная поверхность.
|
||||
\en The evolution surface or a spiral surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) EvolutionSurface( MbCurve3D & curve, MbCurve3D & spine,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать спиральную поверхность.
|
||||
\en Create a spiral surface. \~
|
||||
\details \ru Создать спиральную поверхность по образующей и 3 точкам. \n
|
||||
\en Create a spiral surface from a generating line and three points. \n \~
|
||||
\param[in] curve - \ru Образующая кривая спирали.
|
||||
\en The generating curve of a spiral. \~
|
||||
\param[in] p0 - \ru Начало локальной системы координат (ЛСК).
|
||||
\en The origin of local coordinate system (LCS). \~
|
||||
\param[in] p1 - \ru Точка для формирования оси Z ЛСК.
|
||||
\en A point specifying Z-axis of LCS. \~
|
||||
\param[in] p2 - \ru Точка для формирования оси X ЛСК.
|
||||
\en A point specifying X-axis of LCS. \~
|
||||
\param[in] step - \ru Шаг спирали.
|
||||
\en A pitch. \~
|
||||
\param[out] result - \ru Спиральная поверхность.
|
||||
\en A spiral surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SpiralSurface( MbCurve3D & curve,
|
||||
const MbCartPoint3D & p0, const MbCartPoint3D & p1, const MbCartPoint3D & p2,
|
||||
double step,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать секториальную поверхность.
|
||||
\en Create a sectorial surface. \~
|
||||
\details \ru Создать секториальную поверхность по кривой и точке. \n
|
||||
\en Create a sectorial surface from a curve and a point. \n \~
|
||||
\param[in] curve - \ru Образующая кривая.
|
||||
\en The generating curve. \~
|
||||
\param[in] point - \ru Точка.
|
||||
\en A point. \~
|
||||
\param[out] result - \ru Линейчатая поверхность в виде сектора.
|
||||
\en The ruled surface in a form of a sector. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SectorSurface( MbCurve3D & curve, const MbCartPoint3D & point,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать линейчатую поверхность.
|
||||
\en Create a ruled surface. \~
|
||||
\details \ru Создать линейчатую поверхность по двум кривым. \n
|
||||
\en Create a ruled surface from two curves. \n \~
|
||||
\param[in] curve1 - \ru Первая образующая кривая.
|
||||
\en The first generating curve. \~
|
||||
\param[in] curve2 - \ru Вторая образующая кривая.
|
||||
\en The second generating curve. \~
|
||||
\param[in] simplify - \ru Упрощать поверхность, если возможно.
|
||||
\en Simplify a surface if it's possible. \~
|
||||
\param[out] result - \ru Линейчатая поверхность.
|
||||
\en The ruled surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) RuledSurface( MbCurve3D & curve1, MbCurve3D & curve2,
|
||||
bool simplify, MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать треугольную поверхность.
|
||||
\en Create a triangular surface. \~
|
||||
\details \ru Создать треугольную поверхность по трем кривым. \n
|
||||
\en Create a triangular surface from three curves. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in] curve3 - \ru Третья кривая.
|
||||
\en The third curve. \~
|
||||
\param[out] result - \ru Треугольная поверхность по трём кривым.
|
||||
\en The triangular surface by three curves. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CornerSurface( MbCurve3D & curve1,
|
||||
MbCurve3D & curve2,
|
||||
MbCurve3D & curve3,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать билинейную поверхность.
|
||||
\en Create a bilinear surface. \~
|
||||
\details \ru Создать билинейную поверхность по четырем кривым. \n
|
||||
\en Create a bilinear surface from four curves. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in] curve3 - \ru Третья кривая.
|
||||
\en The third curve. \~
|
||||
\param[in] curve4 - \ru Четвертая кривая.
|
||||
\en The fourth curve. \~
|
||||
\param[out] result - \ru Билинейная поверхность по четырём кривым.
|
||||
\en The bilinear surface from four curves. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CoverSurface( MbCurve3D & curve1,
|
||||
MbCurve3D & curve2,
|
||||
MbCurve3D & curve3,
|
||||
MbCurve3D & curve4,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность по семейству кривых.
|
||||
\en Create a surface by a set of curves. \~
|
||||
\details \ru Создать поверхность по семейству кривых. \n
|
||||
begDirection направление в начале поверхности может быть нулевой длины. \n
|
||||
endDirection направление в конце поверхности может быть нулевой длины. \n
|
||||
\en Create a surface by a set of curves. \n
|
||||
begDirection direction at the begining of the surface can be of zero length. \n
|
||||
endDirection direction at the end of the surface can be of zero length. \n \~
|
||||
\param[in] curveList - \ru Семейство образующих кривых вдоль U-направления.
|
||||
\en A set of generating curves along U direction. \~
|
||||
\param[in] closed - \ru Замкнутость вдоль V-направления.
|
||||
\en Closedness by V direction. \~
|
||||
\param[in] begDirection - \ru Вектор направления в начале поверхности.
|
||||
\en The vector of direction at the beginning of the surface. \~
|
||||
\param[in] endDirection - \ru Вектор направления в конце поверхности.
|
||||
\en The vector of direction at the end of the surface. \~
|
||||
\param[out] result - \ru Поверхность по семейству кривых.
|
||||
\en The surface from the set of curves. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LoftedSurface( const RPArray<MbCurve3D> & curveList, bool closed,
|
||||
const MbVector3D & begDirection, const MbVector3D & endDirection,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность по семейству кривых и направляющей.
|
||||
\en Create a surface from a set of curves and a spine curve. \~
|
||||
\details \ru Создать поверхность по семейству кривых и направляющей. \n
|
||||
\en Create a surface from a set of curves and a spine curve. \n \~
|
||||
\param[in] curveList - \ru Семейство образующих кривых вдоль U-направления.
|
||||
\en A set of generating curves along U direction. \~
|
||||
\param[in] spine - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[out] result - \ru Поверхность по семейству кривых и направляющей.
|
||||
\en The surface from a set of curves and a spine curve. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) LoftedSurface( const RPArray<MbCurve3D> & curveList,
|
||||
MbCurve3D & spine,
|
||||
MbSurface *& result,
|
||||
bool isSimToEvol = true );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность на сетке кривых.
|
||||
\en Create a surface constructed by the grid curves. \~
|
||||
\details \ru Создать поверхность на сетке кривых по двум семействам кривых. \n
|
||||
\en Create a surface constructed by the grid curves given two sets of curves. \n \~
|
||||
\param[in] uCurveList - \ru Семейство кривых вдоль U-направления.
|
||||
\en A curve set along U direction. \~
|
||||
\param[in] vCurveList - \ru Семейство кривых вдоль V-направления.
|
||||
\en A curve set along V direction. \~
|
||||
\param[out] result - \ru Поверхность на сетке кривых.
|
||||
\en The surface constructed by the grid curves. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) MeshSurface( const RPArray<MbCurve3D> & uCurveList,
|
||||
const RPArray<MbCurve3D> & vCurveList,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать эквидистантную поверхность.
|
||||
\en Create an offset surface. \~
|
||||
\details \ru Создать эквидистантную поверхность к исходной поверхности. \n
|
||||
\en Create an offset surface to a given surface. \n \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] distance - \ru Величина эквидистанты (знаковая).
|
||||
\en The offset distance (signed). \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\param[out] result - \ru Эквидистантная поверхность.
|
||||
\en The offset surface. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) OffsetSurface( MbSurface & surface,
|
||||
double distance,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать эквидистантную поверхность.
|
||||
\en Create an offset surface. \~
|
||||
\details \ru Создать эквидистантную поверхность по исходной поверхности. \n
|
||||
\en Create an offset surface from the initial surface. \n \~
|
||||
\param[in] surface - \ru Базовая поверхность.
|
||||
\en The base surface. \~
|
||||
\param[in] offsetUminVmin - \ru Смещение в точке Umin Vmin базовой поверхности.
|
||||
\en Offset distance on point Umin Vmin of base surface. \~
|
||||
\param[in] offsetUmaxVmin - \ru Смещение в точке Umax Vmin базовой поверхности.
|
||||
\en Offset distance on point Umax Vmin of base surface. \~
|
||||
\param[in] offsetUminVmax - \ru Смещение в точке Umin Vmax базовой поверхности.
|
||||
\en Offset distance on point Umin Vmax of base surface. \~
|
||||
\param[in] offsetUmaxVmax - \ru Смещение в точке Umax Vmax базовой поверхности.
|
||||
\en Offset distance on point Umax Vmax of base surface. \~
|
||||
\param[in] type - \ru Тип смещения точек: константный, линейный или кубический.
|
||||
\en The offset type: constant, or linear, or cubic. \~
|
||||
\param[out] result - \ru Эквидистантная поверхность.
|
||||
\en The offset surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) OffsetSurface( MbSurface & surface,
|
||||
double offsetUminVmin,
|
||||
double offsetUmaxVmin,
|
||||
double offsetUminVmax,
|
||||
double offsetUmaxVmax,
|
||||
MbeOffsetType type,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать продленную поверхность.
|
||||
\en Create an extended surface. \~
|
||||
\details \ru Создать продленную поверхность по исходной поверхности. \n
|
||||
\en Create an extended surface from the initial surface. \n \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] uMin - \ru Минимальное значение по U.
|
||||
\en The minimal parameter value by U. \~
|
||||
\param[in] uMax - \ru Максимальное значение по U.
|
||||
\en The maximal parameter value by U. \~
|
||||
\param[in] vMin - \ru Минимальное значение по V.
|
||||
\en The minimal parameter value by V. \~
|
||||
\param[in] vMax - \ru Максимальное значение по V.
|
||||
\en The maximal parameter value by V. \~
|
||||
\param[out] result - \ru Продлённая поверхность.
|
||||
\en The extended surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ExtendedSurface( MbSurface & surface,
|
||||
double uMin,
|
||||
double uMax,
|
||||
double vMin,
|
||||
double vMax,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать деформированную поверхность.
|
||||
\en Create a deformed surface. \~
|
||||
\details \ru Создать деформированную поверхность по исходной поверхности. \n
|
||||
\en Create a deformed surface from the initial surface. \n \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] uCount - \ru Количество точек по U.
|
||||
\en A number of points by U direction. \~
|
||||
\param[in] vCount - \ru Количество точек по V.
|
||||
\en A number of points by V direction. \~
|
||||
\param[in] uDegree - \ru Порядок сплайнов по U.
|
||||
\en Splines degree by U. \~
|
||||
\param[in] vDegree - \ru Порядок сплайнов по V.
|
||||
\en Splines degree by V. \~
|
||||
\param[in] dist - \ru Величина сдвига вдоль нормали.
|
||||
\en Shift along the normal. \~
|
||||
\param[out] result - \ru Деформированная поверхность.
|
||||
\en The deformed surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) DeformedSurface( MbSurface & surface,
|
||||
size_t uCount, size_t vCount,
|
||||
size_t uDegree, size_t vDegree,
|
||||
double dist,
|
||||
MbSurface *& result);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность с заданной границей.
|
||||
\en Create a surface with the given boundary. \~
|
||||
\details \ru Создать поверхность с заданной границей по массиву двумерных кривых. \n
|
||||
Контейнер boundList может быть пустым. \n
|
||||
\en Create a surface with the given boundary from an array of two-dimensional curves. \n
|
||||
Container 'boundList' can be empty. \n \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] boundList - \ru Множество двумерных границ в виде кривых (первая кривая - внешний контур).
|
||||
\en An array of two-dimensional boundaries in the form of curves (the first curve is an outer contour). \~
|
||||
\param[out] result - \ru Поверхность, ограниченная кривыми.
|
||||
\en The surface bounded by the curves. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) BoundedSurface( MbSurface & surface,
|
||||
const RPArray<MbCurve> & boundList,
|
||||
MbSurface *& result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность с заданной границей.
|
||||
\en Create a surface with the given boundary. \~
|
||||
\details \ru Создать поверхность с заданной границей по массиву двумерных контуров. \n
|
||||
\en Create a surface with the given boundary from an array of two-dimensional curves. \n \~
|
||||
\param[in] place - \ru Локальная система координат плоскости.
|
||||
\en The local coordinate system of a plane. \~
|
||||
\param[in] region - \ru Множество двумерных границ в виде региона (первая контур - внешний).
|
||||
\en An array of two-dimensional boundaries in the form of region (the first contour is outer). \~
|
||||
\param[out] result - \ru Поверхность, ограниченная кривыми.
|
||||
\en The surface bounded by the curves. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) BoundedSurface( const MbPlacement3D & place, const MbRegion & region,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать NURBS копию поверхности, ограниченную двумерными границами.
|
||||
\en Create a NURBS surface copy with two-dimensional boundaries. \~
|
||||
\details \ru Создать NURBS копию поверхности, ограниченную двумерными границами проецированием пространственных границ \n
|
||||
(предполагается, что пространственные граничные кривые лежат на поверхности). \n
|
||||
\en Create a NURBS surface copy with two-dimensional boundaries by projecting of the spatial boundaries \n
|
||||
(the boundary space curves are considered to belong to the surface) \n \~
|
||||
\param[in] surf - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] version - \ru Версия исполнения.
|
||||
\en The version. \~
|
||||
\param[out] resSurface - \ru Сплайновая поверхность (ограниченная кривыми).
|
||||
\en The spline surface (bounded by the curves). \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) NurbsSurface( const MbSurface & surf, VERSION version, MbSurface *& resSurface );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать поверхность симплексного сплайна.
|
||||
\en Create a simplex spline surface. \~
|
||||
\details \ru Создать поверхность симплексного сплайна по массиву вершин. \n
|
||||
\en Create a simplex spline surface from a point array. \n \~
|
||||
\param[in] pList - \ru Множество вершин.
|
||||
\en An array of points. \~
|
||||
\param[out] resSurface - \ru Поверхность симплексного сплайна.
|
||||
\en The simplex spline surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) SimplexSplineSurface( SArray<MbCartPoint3D> & pList, MbSurface *& resSurface );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать треугольную поверхность Безье.
|
||||
\en Create a triangular Bezier surface. \~
|
||||
\details \ru Создать треугольную поверхность Безье по 3 точкам. \n
|
||||
\en Create a triangular Bezier surface from three points. \n \~
|
||||
\param[in] k - \ru Порядок поверхности.
|
||||
\en The surface order. \~
|
||||
\param[in] p1 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] p2 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[in] p3 - \ru Третья точка.
|
||||
\en The third point. \~
|
||||
\param[out] resSurface - \ru Треугольная поверхность Безье.
|
||||
\en The triangular Bezier surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) TriBezierSurface( ptrdiff_t k, MbCartPoint3D & p1, MbCartPoint3D & p2, MbCartPoint3D & p3,
|
||||
MbSurface *& resSurface );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать треугольную В-сплайн поверхность.
|
||||
\en Create a triangular B-spline surface. \~
|
||||
\details \ru Создать треугольную В-сплайн поверхность по 3 точкам. \n
|
||||
\en Create a triangular B-spline surface from three points. \n \~
|
||||
\param[in] p0 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] p1 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[in] p2 - \ru Третья точка.
|
||||
\en The third point. \~
|
||||
\param[in] d - \ru Порядок поверхности.
|
||||
\en The surface order. \~
|
||||
\param[out] resSurface - \ru Треугольная В-сплайн поверхность.
|
||||
\en The triangular B-spline surface. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) TriSplineSurface( const MbCartPoint3D & p0,
|
||||
const MbCartPoint3D & p1,
|
||||
const MbCartPoint3D & p2,
|
||||
const MbCartPoint3D & p3,
|
||||
ptrdiff_t d, ptrdiff_t count,
|
||||
MbSurface *& resSurface );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить характеристическую ломаную сплайновой поверхности.
|
||||
\en Create a characteristic polyline of a spline surface. \~
|
||||
\details \ru Построить характеристическую ломаную сплайновой поверхности. \n
|
||||
Функция работает с поверхностями типа st_SplineSurface, st_HermitSurface,
|
||||
st_TriBezierSurface, st_TriSplineSurface. \n
|
||||
\en Create a characteristic polyline of a spline surface. \n
|
||||
The function accepts the surfaces of types st_SplineSurface, st_HermitSurface,
|
||||
st_TriBezierSurface, st_TriSplineSurface. \n \~
|
||||
\param[in] surf - \ru Поверхность.
|
||||
\en The surface. \~
|
||||
\param[out] segments - \ru Сегменты характеристической ломаной.
|
||||
\en The characteristic polyline. \~
|
||||
\result \ru Возвращает true - если характеристическая ломаная получена.
|
||||
\en Returns true - if the characteristic polyline is obtained. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) GetLineSegmentNURBSSurface( MbSurface & surf, RPArray<MbCurve3D> & segments );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создание поверхности на сетке точек.
|
||||
\en Create a surface from a points grid. \~
|
||||
\details \ru Создание поверхности на сетке точек и триангуляции. \n
|
||||
Множество треугольников должен представлять собой правильную триангуляцию.
|
||||
\en Create a surface from a points grid and triangulation. \n
|
||||
The triangles array should form a regular triangulation. \~
|
||||
\param[in] grid - \ru Триангуляция.
|
||||
\en A triangulation. \~
|
||||
\param[out] result - \ru Поверхность на сетке точек.
|
||||
\en The surface on a point set. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) GridSurface( MbGrid & grid, MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать средние плоскости.
|
||||
\en Create median planes. \~
|
||||
\details \ru Создать средние плоскости по двум кривым.\n
|
||||
\en Create median planes from two curves.\n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] places - \ru Набор систем координат, задающих плоскости.
|
||||
\en The set of coordinate systems which determine the planes. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) MiddlePlaces( const MbCurve3D & curve1,
|
||||
const MbCurve3D & curve2,
|
||||
std::vector<MbPlacement3D> & places );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение поверхности Кунса.
|
||||
\en Construction of a Coons surface. \~
|
||||
\details \ru Построение бикубической поверхности Кунса на четырех кривых и их поперечных производных, касательной к четырём кривым на прверхностях. \n
|
||||
\en The construction of Coons surface, which will be tangent to four surfaces and coincide with four curves on this surfaces on it sides.\n \~
|
||||
\param[in] surfaceCurve0 - \ru Кривая на поверхности 0.
|
||||
\en The curve on surface0. \~
|
||||
\param[in] surfaceCurve1 - \ru Кривая на поверхности 1.
|
||||
\en The curve on surface1. \~
|
||||
\param[in] surfaceCurve2 - \ru Кривая на поверхности 2.
|
||||
\en The curve on surface2. \~
|
||||
\param[in] surfaceCurve3 - \ru Кривая на поверхности 3.
|
||||
\en The curve on surface3. \~
|
||||
\param[out] result - \ru Построенная поверхность.
|
||||
\en The constructed surface. \~
|
||||
\result \ru Возвращает код результата построения.
|
||||
\en Returns operation result code. \~
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateCoonsSurface( const MbSurfaceCurve & surfaceCurve0,
|
||||
const MbSurfaceCurve & surfaceCurve1,
|
||||
const MbSurfaceCurve & surfaceCurve2,
|
||||
const MbSurfaceCurve & surfaceCurve3,
|
||||
MbSurface *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение поверхности-заплатки для заданных рёбер.
|
||||
\en Construction of a surface-patch by the edges. \~
|
||||
\details \ru Построение поверхности-заплатки, гладко стыкующейся с поверхностями ребер. \n
|
||||
\en Construction of a surface-patch, smoothly joining with the surfaces of the edges. \n \~
|
||||
\param[in] edges - \ru Ребра, с которыми требуется стыковать новую поверхность.
|
||||
\en Edges to join the new surface. \~
|
||||
\param[out] result - \ru Построенные поверхности.
|
||||
\en The constructed surfaces. \~
|
||||
\result \ru Возвращает код результата построения.
|
||||
\en Returns operation result code. \~
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
\ingroup Surface_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateSplinePatch( const std::vector<const MbCurveEdge *> & edges,
|
||||
std::vector<MbSurface *> & result );
|
||||
|
||||
|
||||
#endif // __ACTION_SURFACE_H
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,582 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение окружности, вычисление центра окружности.
|
||||
\en Circle construction, center of circle calculation. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CIRCLE_CURVE_H
|
||||
#define __ALG_CIRCLE_CURVE_H
|
||||
|
||||
#include <mb_cart_point.h>
|
||||
#include <alg_base.h>
|
||||
#include <alg_curve_distance.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbLine;
|
||||
class MATH_CLASS MbArc;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вспомогательная окружность.
|
||||
\en Auxiliary circle. \~
|
||||
\details \ru Вспомогательная окружность, заданная центром и радиусом. \n
|
||||
\en Auxiliary circle, defined by center and radius. \n \~
|
||||
\ingroup Data_Structures
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbTempCircle {
|
||||
private:
|
||||
MbCartPoint centre; ///< \ru Центр. \en Center.
|
||||
double radius; ///< \ru Радиус. \en Radius.
|
||||
|
||||
public :
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор окружности нулевого радиуса с центром в начале координат.\n
|
||||
\en Constructor of a circle with zero radius, centered at the origin of coordinate system.\n \~
|
||||
*/
|
||||
MbTempCircle()
|
||||
: centre()
|
||||
, radius( 0 )
|
||||
{};
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор окружности с центром в начале координат.\n
|
||||
\en Constructor of a circle, centered at the origin of coordinate system.\n \~
|
||||
\param[in] rad - \ru Радиус окружности.
|
||||
\en Radius of circle. \~
|
||||
*/
|
||||
MbTempCircle( double rad )
|
||||
: centre()
|
||||
, radius( rad )
|
||||
{};
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по центру и радиусу.\n
|
||||
\en Constructor by center and radius.\n \~
|
||||
\param[in] p - \ru Центр окружности.
|
||||
\en Center of circle. \~
|
||||
\param[in] rad - \ru Радиус окружности.
|
||||
\en Radius of circle. \~
|
||||
*/
|
||||
MbTempCircle( const MbCartPoint & p, double rad )
|
||||
: centre( p )
|
||||
, radius( rad )
|
||||
{};
|
||||
|
||||
/// \ru Копирующий конструктор. \en Copy-constructor.
|
||||
MbTempCircle( const MbTempCircle & other )
|
||||
: centre( other.centre)
|
||||
, radius( other.radius )
|
||||
{};
|
||||
|
||||
public :
|
||||
~MbTempCircle() {}
|
||||
|
||||
/**\ru \name Функции инициализации.
|
||||
\en \name Initialization functions.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Инициализация.
|
||||
\en Initialization. \~
|
||||
\details \ru Инициализация по окружности.\n
|
||||
\en Initialization by circle.\n \~
|
||||
\param[in] other - \ru Окружность.
|
||||
\en Circle. \~
|
||||
*/
|
||||
void Init( const MbTempCircle & other ) { centre = other.centre; radius = other.radius; }
|
||||
|
||||
/** \brief \ru Инициализация.
|
||||
\en Initialization. \~
|
||||
\details \ru Инициализация по центру и радиусу.\n
|
||||
\en Initialization by center and radius.\n \~
|
||||
\param[in] p - \ru Центр.
|
||||
\en Center. \~
|
||||
\param[in] rad - \ru радиус.
|
||||
\en radius. \~
|
||||
*/
|
||||
void Init( const MbCartPoint & p, double rad ) { centre = p; radius = rad; }
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Функции доступа к данным.
|
||||
\en \name Functions for access to data.
|
||||
\{ */
|
||||
|
||||
const MbCartPoint & GetCentre() const { return centre; } ///< \ru Центр окружности. \en Center of circle.
|
||||
const double & GetR()const { return radius; } ///< \ru Радиус окружности. \en Radius of circle.
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Функции изменения данных.
|
||||
\en \name Functions for changing data.
|
||||
\{ */
|
||||
|
||||
MbCartPoint & SetCentre() { return centre; } ///< \ru Выдать центр окружности для изменения. \en Get center of circle for editing.
|
||||
void SetCentre( const MbCartPoint & c ) { centre = c; } ///< \ru Изменить центр окружности. \en Set center of circle.
|
||||
|
||||
double & SetRadius() { return radius; } ///< \ru Выдать радиус окружности для изменения. \en Get radius of circle for editing.
|
||||
void SetRadius( double r ) { radius = r; } ///< \ru Изменить радиус окружности. \en Set radius of circle.
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Функции расчета данных.
|
||||
\en \name Functions for calculating data.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\details \ru Точка на окружности по параметру.\n
|
||||
\en Point on circle by parameter.\n \~
|
||||
\param[in] t - \ru Параметр на окружности.
|
||||
\en Parameter on circle. \~
|
||||
\param[out] p - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
*/
|
||||
void PointOn( double t, MbCartPoint & p ) const {
|
||||
p.x = ( centre.x + radius * ::cos(t) );
|
||||
p.y = ( centre.y + radius * ::sin(t) );
|
||||
}
|
||||
|
||||
/** \brief \ru Первая производная.
|
||||
\en First derivative. \~
|
||||
\details \ru Первая производная по параметру.\n
|
||||
\en First derivative by parameter.\n \~
|
||||
\param[in] t - \ru Параметр на окружности.
|
||||
\en Parameter on circle. \~
|
||||
\param[out] v - \ru Вектор первой производной.
|
||||
\en First derivative vector. \~
|
||||
*/
|
||||
void FirstDer( double t, MbVector & v ) const {
|
||||
v.x = -( radius * ::sin(t) );
|
||||
v.y = ( radius * ::cos(t) );
|
||||
}
|
||||
|
||||
/** \brief \ru Вычислить расстояние до точки.
|
||||
\en Calculate distance to point. \~
|
||||
\details \ru Расстояние от окружности до точки.\n
|
||||
\en Distance from circle to point.\n \~
|
||||
\param[in] p - \ru Точка.
|
||||
\en Point. \~
|
||||
\return \ru Вычислить расстояние до точки.
|
||||
\en Calculate distance to point. \~
|
||||
*/
|
||||
double DistanceToPoint( const MbCartPoint & p ) const {
|
||||
return ::fabs( centre.DistanceToPoint(p) - radius );
|
||||
}
|
||||
|
||||
/** \brief \ru Проекция точки.
|
||||
\en Point projection. \~
|
||||
\details \ru Проекция точки на окружность.\n
|
||||
\en Point projection on circle.\n \~
|
||||
\param[in] p - \ru Точка.
|
||||
\en Point. \~
|
||||
\return \ru Параметр проекции точки на окружности.
|
||||
\en Parameter of point projection on circle. \~
|
||||
*/
|
||||
double PointProjection( const MbCartPoint & p ) const {
|
||||
return c3d::CalcAngle0X( centre, p );
|
||||
}
|
||||
|
||||
/** \brief \ru Лежит ли точка на окружности?
|
||||
\en Is point on circle? \~
|
||||
\details \ru Проверка, лежит ли точка на окружности.\n
|
||||
\en Check if the point is on circle.\n \~
|
||||
\param[in] p - \ru Точка.
|
||||
\en Point. \~
|
||||
\param[in] eps - \ru Погрешность.
|
||||
\en Tolerance. \~
|
||||
\return \ru true, если точка лежит на окружности.
|
||||
\en true if the point on circle. \~
|
||||
*/
|
||||
bool IsPointOn( const MbCartPoint & p, double eps = Math::LengthEps ) const {
|
||||
return ( DistanceToPoint(p) < eps );
|
||||
}
|
||||
|
||||
/** \brief \ru Проверить на вырожденность.
|
||||
\en Check for degeneracy. \~
|
||||
\details \ru Проверить окружность на вырожденность.\n
|
||||
\en Check circle for degeneracy. \~
|
||||
\return \ru true, если окружность вырождена.
|
||||
\en true if the circle is degenerate. \~
|
||||
*/
|
||||
bool IsDegenerate() const { // \ru проверка вырожденности окружности \en check for circle degeneracy
|
||||
return ( radius < Math::minRadius || radius > Math::maxRadius );
|
||||
}
|
||||
/** \} */
|
||||
private:
|
||||
void operator = ( const MbTempCircle & other ) { centre = other.centre; radius = other.radius; }
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить центры окружностей.
|
||||
\en Calculate centers of circles. \~
|
||||
\details \ru Вычислить центры окружностей заданного радиуса rad, касающихся
|
||||
двух данных прямых pl1 и pl2.
|
||||
\en Calculate centers of circles with fixed radius rad, that touches
|
||||
two given lines pl1 and pl2. \~
|
||||
\param[in] pl1 - \ru Первая прямая.
|
||||
\en First line. \~
|
||||
\param[in] pl2 - \ru Вторая прямая.
|
||||
\en Second line \~
|
||||
\param[in] rad - \ru Радиус окружности.
|
||||
\en Radius of circle. \~
|
||||
\param[out] pc - \ru Результат - массив окружностей с искомым центром.
|
||||
\en Result - set of circles with required center. \~
|
||||
\return \ru Количество окружностей в массиве.
|
||||
\en The number of circles in array. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CircleTanLineLineRad( MbLine & pl1, MbLine & pl2, double rad, MbTempCircle * pc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить центры окружностей.
|
||||
\en Calculate centers of circles. \~
|
||||
\details \ru Вычислить центры окружностей заданного радиуса rad, касающихся
|
||||
данных прямой pl1 и окружности pc1.
|
||||
\en Calculate centers of circles with fixed radius rad, that touches
|
||||
given line pl1 and circle pc1. \~
|
||||
\param[in] pl1 - \ru Прямая.
|
||||
\en Line. \~
|
||||
\param[in] pc1 - \ru Окружность.
|
||||
\en Circle. \~
|
||||
\param[in] rad - \ru Радиус окружностей с искомым центром.
|
||||
\en Result - set of circles with the required center. \~
|
||||
\param[out] pc - \ru Результат - массив окружностей с искомым центром.
|
||||
\en Result - set of circles with the required center. \~
|
||||
\return \ru Количество окружностей в массиве.
|
||||
\en The number of circles in array. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CircleTanLineCircleRadius( const MbLine & pl1, const MbArc & pc1, double rad,
|
||||
MbTempCircle * pc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить центры окружностей.
|
||||
\en Calculate centers of circles. \~
|
||||
\details \ru Вычислить центры окружностей заданного радиуса rad, касающихся
|
||||
двух окружностей pc1 и pc2.
|
||||
\en Calculate centers of circles with fixed radius rad, that touches
|
||||
given circles pc1 and pc2. \~
|
||||
\param[in] pc1 - \ru Первая окружность.
|
||||
\en First circle. \~
|
||||
\param[in] pc2 - \ru Вторая окружность.
|
||||
\en Second circle. \~
|
||||
\param[in] rad - \ru Радиус окружностей с искомым центром.
|
||||
\en Radius of circles with the required center. \~
|
||||
\param[out] pc - \ru Результат - массив окружностей с искомым центром.
|
||||
\en Result - set of circles with the required center. \~
|
||||
\return \ru Количество окружностей в массиве.
|
||||
\en Count of circles in set. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CircleTanCircleCircleRad( MbArc & pc1, MbArc & pc2, double rad,
|
||||
MbTempCircle * pc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности с заданным центром,
|
||||
касающиеся заданной кривой.
|
||||
\en Create circles with given center,
|
||||
that touches given curve. \~
|
||||
\param[in] pCurve - \ru Кривая, касающаяся окружности.
|
||||
\en Curve, that touches circle. \~
|
||||
\param[in] pnt - \ru Центр окружности.
|
||||
\en Center of circle. \~
|
||||
\param[out] pCircle - \ru Набор окружностей.
|
||||
\en Set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanCurveCentre( const MbCurve & pCurve, MbCartPoint & pnt,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности, касающиеся заданной кривой,
|
||||
проходящие через две заданные точки.
|
||||
\en Create circles that touch given curve
|
||||
and pass through given two points. \~
|
||||
\param[in] pCurve - \ru Кривая, касающаяся окружности.
|
||||
\en Curve, that touches circle. \~
|
||||
\param[in] on1 - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\param[in] on2 - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\param[out] pCircle - \ru Набор окружностей.
|
||||
\en Set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
MbCartPoint & on1, MbCartPoint & on2,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности, касающиеся заданной кривой,
|
||||
с заданным радиусом, проходящие через заданную точку.
|
||||
\en Create circles that touch given curve
|
||||
and with a given radius, passing through a given point. \~
|
||||
\param[in] pCurve - \ru Кривая, касающаяся окружности.
|
||||
\en Curve that touches circle. \~
|
||||
\param[in] radius - \ru Радиус.
|
||||
\en Radius. \~
|
||||
\param[in] on - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\param[out] pCircle - \ru Набор окружностей.
|
||||
\en A set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTangentCurveRPointOn( const MbCurve & pCurve, double radius, MbCartPoint & on,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности с заданным радиусом,
|
||||
касающиеся двух кривых.
|
||||
\en Create circles with a given radius
|
||||
that touch two curves. \~
|
||||
\param[in] pCurve1 - \ru Первая кривая, касающаяся окружности.
|
||||
\en The first curve that touches circle. \~
|
||||
\param[in] pCurve2 - \ru Вторая кривая, касающаяся окружности.
|
||||
\en The second curve, that touches circle. \~
|
||||
\param[in] rad - \ru Радиус.
|
||||
\en Radius. \~
|
||||
\param[out] pCircle - \ru Набор окружностей.
|
||||
\en A set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanTwoCurvesRadius( const MbCurve & pCurve1, const MbCurve & pCurve2, double rad,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности, проходящие через заданную точку,
|
||||
касающиеся двух кривых.
|
||||
\en Create circles that pass through given point
|
||||
and touch two curves. \~
|
||||
\param[in] pCurve1 - \ru Первая кривая, касающаяся окружности.
|
||||
\en The first curve, that touches circle. \~
|
||||
\param[in] pCurve2 - \ru Вторая кривая, касающаяся окружности.
|
||||
\en The second curve that touches circle. \~
|
||||
\param[in] pOn - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\param[out] pCircle - \ru Набор окружностей.
|
||||
\en A set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanTwoCurvesPointOn( const MbCurve & pCurve1, const MbCurve & pCurve2, const MbCartPoint & pOn,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности с центром на первой кривой,
|
||||
касательные ко второй кривой, проходящие через заданную точку.
|
||||
\en Create circles with center on the first curve
|
||||
that touches second curve and passes through the given point. \~
|
||||
\param[in] pCurve1 - \ru Первая кривая, содержащая центр окружности.
|
||||
\en The first curve which contains center of circle. \~
|
||||
\param[in] pCurve2 - \ru Вторая кривая, касающаяся окружности.
|
||||
\en The second curve that touches circle. \~
|
||||
\param[in] pp - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\param[out] pCircle - \ru Набор окружностей.
|
||||
\en A set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleOriginOneTangentTwo( const MbCurve & pCurve1, const MbCurve & pCurve2, const MbCartPoint & pp,
|
||||
RPArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности, касательные заданной кривой,
|
||||
проходящие через заданную точку, составляющие в точке касания угол(p1, centre, ptan),
|
||||
равный данному.
|
||||
\en Create circles that touch given curve
|
||||
and pass through given point, with angle(p1, centre, ptan) at tangent point
|
||||
that equal to the given one. \~
|
||||
\param[in] curve - \ru Кривая, касающаяся окружности.
|
||||
\en Curve that touches the circle. \~
|
||||
\param[in] p1 - \ru Точка на окружности.
|
||||
\en Point on circle. \~
|
||||
\param[in] angle - \ru Угол, образованный тремя точками:\n
|
||||
заданной точкой на окружности p1,\n
|
||||
центром окружности,\n
|
||||
точкой касания.
|
||||
\en Angle formed by three points:\n
|
||||
given point on circle p1,\n
|
||||
center of circle,\n
|
||||
tangent point. \~
|
||||
\param[out] circles - \ru Набор окружностей.
|
||||
\en A set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanCurvePointOnAngle( MbCurve & curve, MbCartPoint & p1, double angle,
|
||||
PArray<MbTempCircle> & circles );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить дуги окружностей.
|
||||
\en Create arcs of circles. \~
|
||||
\details \ru Построить дуги окружностей по двум точкам,
|
||||
касающиеся заданной кривой.
|
||||
\en Create arcs of circles by two points
|
||||
that touches given curve. \~
|
||||
\param[in] pCurve - \ru Кривая, касающаяся дуг.
|
||||
\en Curve that touches arcs. \~
|
||||
\param[in] on1 - \ru Первая точка на дуге.
|
||||
\en First point on arc. \~
|
||||
\param[in] on2 - \ru Вторая точка на дуге.
|
||||
\en Second point on arc. \~
|
||||
\param[out] arc - \ru Набор дуг.
|
||||
\en Set of arcs. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
MbCartPoint & on1, MbCartPoint & on2,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить дуги окружностей.
|
||||
\en Create arcs of circles. \~
|
||||
\details \ru Построить дуги окружностей по радиусу и точке,
|
||||
касающиеся заданной кривой.
|
||||
\en Create arcs of circles by radius and point
|
||||
that touch given curve. \~
|
||||
\param[in] pCurve - \ru Кривая, касающаяся дуг.
|
||||
\en Curve that touches arcs. \~
|
||||
\param[in] radius - \ru Радиус.
|
||||
\en Radius. \~
|
||||
\param[in] on - \ru Точка на дуге.
|
||||
\en Point on arc. \~
|
||||
\param[out] arc - \ru Набор дуг.
|
||||
\en Set of arcs. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveRPointOn( const MbCurve & pCurve, double radius, MbCartPoint & on,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить дугу окружности.
|
||||
\en Create a circle arc. \~
|
||||
\details \ru Построить дугу окружности, сопряженную с указанной ограниченной кривой
|
||||
в начальной или конечной точке. Дуга всегда выходит из кривой.
|
||||
\en Create arc of circle conjugated with the given bounded curve
|
||||
at the start point or at the end point. An arc always starts at curve. \~
|
||||
\param[in] line - \ru Кривая для сопряжения.
|
||||
\en Curve to conjugate with. \~
|
||||
\param[in] p2 - \ru Точка на дуге.
|
||||
\en Point on arc. \~
|
||||
\param[out] arc - \ru Множество с дугой окружности.
|
||||
\en A set that contains the arc of circle. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveContinue( MbLine & line, MbCartPoint & p2,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить дугу окружности.
|
||||
\en Create a circle arc. \~
|
||||
\details \ru Построить дугу окружности заданного радиуса,
|
||||
сопряженной с указанной ограниченной кривой
|
||||
в начальной или конечной точке. Дуга всегда выходит из кривой.
|
||||
\en Create an arc of circle with the given radius
|
||||
conjugated with the given bounded curve
|
||||
at the start point or at the end point. An arc always starts at curve. \~
|
||||
\param[in] line - \ru Кривая для сопряжения.
|
||||
\en Curve to conjugate with. \~
|
||||
\param[in] rad - \ru Радиус.
|
||||
\en Radius. \~
|
||||
\param[in] p2 - \ru Точка на дуге.
|
||||
\en Point on arc. \~
|
||||
\param[out] arc - \ru Множество с дугой окружности.
|
||||
\en A set that contains the arc of circle. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveRadContinue( MbLine & line, double rad, MbCartPoint & p2,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружности.
|
||||
\en Create circles. \~
|
||||
\details \ru Построить окружности, касающиеся трех кривых.
|
||||
\en Create circles that touch three curves. \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in] curve3 - \ru Третья кривая.
|
||||
\en The third curve. \~
|
||||
\param[in] pnt - \ru Точка на перпендикуляре к точке касания кривой.\n
|
||||
Используется для тех кривых их трех перечисленных,
|
||||
которые не являются отрезком, прямой или полилинией.
|
||||
\en A point on perpendicular to curve at the tangent point.\n
|
||||
Used for those of the given three curves
|
||||
which are not segment, line or polyline. \~
|
||||
\param[out] circle - \ru Набор окружностей.
|
||||
\en A set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanThreeCurves( const MbCurve * curve1, const MbCurve * curve2, const MbCurve * curve3,
|
||||
MbCartPoint & pnt,
|
||||
PArray<MbTempCircle> & circle );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief \ru Копировать временные окружности
|
||||
\en Copy temporary circles \~
|
||||
\details \ru Копировать временные окружности.\n
|
||||
Очищает временный массив cTmp.
|
||||
\en Copy temporary circles.\n
|
||||
Clear temporary array cTmp. \~
|
||||
\param[in, out] cTmp - \ru Набор временных окружностей. Множество очищается.
|
||||
\en Set of temporary circles. Array will be cleared. \~
|
||||
\param[out] pCircle - \ru Набор дуг окружностей, созданных соответственно временным окружностям.
|
||||
\en Set of arcs of circles, created by temporary circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CreateNewCircles( PArray<MbTempCircle> & cTmp,
|
||||
PArray<MbArc> & pCircle );
|
||||
|
||||
|
||||
#endif // __ALG_CIRCLE_CURVE_H
|
||||
@@ -0,0 +1,316 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Операции с кривой в двумерном пространстве. Удаление части кривой.
|
||||
\en Operations with a curve in two-dimensional space. Deletion of a curve piece. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_DELETE_PART_H
|
||||
#define __ALG_CURVE_DELETE_PART_H
|
||||
|
||||
#include <curve.h>
|
||||
#include <templ_s_list.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить часть кривой.
|
||||
\en Delete the piece of a curve. \~
|
||||
\details \ru Удалить часть кривой по отношению к точке.\n
|
||||
У кривой удаляется часть,
|
||||
ограниченная двумя последовательными параметрами пересечения ее с кривыми из заданного списка,
|
||||
ближайшая к проекции заданной точки.
|
||||
\en Delete a piece of a curve by the point.\n
|
||||
Delete the piece
|
||||
bounded by two successive parameters of intersection of the curve with the curves from the given list
|
||||
and the nearest to the projection of the given point. \~
|
||||
\param[in] curveList - \ru Список кривых для пересечения.
|
||||
\en The list of curves for intersection. \~
|
||||
\param[in] pnt - \ru Точка, показывающая удаляемую часть кривой.
|
||||
\en The point indicating the piece of a curve to be deleted. \~
|
||||
\param[in, out] curve - \ru Изменяемая кривая.
|
||||
\en The curve to be modified. \~
|
||||
\param[out] part2 - \ru Конечный участок измененной кривой, если кривая распалась на две части.
|
||||
\en The finite piece of the modified curve if the curve is split into two pieces. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) DeleteCurvePart( List<MbCurve> & curveList,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить часть кривой.
|
||||
\en Delete the piece of a curve. \~
|
||||
\details \ru Удалить часть кривой по двум точкам.\n
|
||||
Для замкнутых кривых дополнительно задается третья точка,
|
||||
которая показывает удаляемую часть.
|
||||
\en Delete the piece of a curve by two points.\n
|
||||
The third point is additionally specified for closed curves,
|
||||
it indicates the piece of a curve to be deleted. \~
|
||||
\param[in] p1 - \ru Точка, показывающая первую границу удаляемого участка.
|
||||
\en The point indicating the first boundary of the piece to be deleted. \~
|
||||
\param[in] p2 - \ru Точка, показывающая вторую границу удаляемого участка.
|
||||
\en The point indicating the second boundary of the piece to be deleted. \~
|
||||
\param[in] p3 - \ru Точка, показывающая удаляемую часть замкнутой кривой.
|
||||
\en The point indicating the piece of a closed curve to be deleted. \~
|
||||
\param[in, out] curve - \ru Изменяемая кривая.
|
||||
\en The curve to be modified. \~
|
||||
\param[out] part2 - \ru Конечный участок измененной кривой, если кривая распалась на две части.
|
||||
\en The finite piece of the modified curve if the curve is split into two pieces. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) DeleteCurvePart( const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
const MbCartPoint & p3,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Оставить часть кривой.
|
||||
\en Keep the piece of a curve. \~
|
||||
\details \ru Оставить часть кривой по отношению к точке.
|
||||
У кривой оставляется часть,
|
||||
ограниченная двумя последовательными параметрами пересечения ее с кривыми из заданного списка,
|
||||
ближайшая к проекции заданной точки.
|
||||
\en Keep the piece of a curve by the point.
|
||||
Keep the curve piece
|
||||
bounded by two successive parameters of intersection of the initial curve with the curves from the given list
|
||||
and the nearest to the projection of the given point. \~
|
||||
\param[in] curveList - \ru Список кривых для пересечения.
|
||||
\en The list of curves for intersection. \~
|
||||
\param[in] pnt - \ru Точка, показывающая оставляемую часть кривой.
|
||||
\en The point indicating the piece of a curve to be kept. \~
|
||||
\param[in, out] curve - \ru Изменяемая кривая.
|
||||
\en The curve to be modified. \~
|
||||
\param[in, out] part2 - \ru Всегда NULL.
|
||||
\en This value is always NULL. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after its modification. \~
|
||||
\warning \ru Для внутреннего использования.
|
||||
\en For internal use only. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) TrimmCurvePart( List<MbCurve> & curveList,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Оставить часть кривой.
|
||||
\en Keep the piece of a curve. \~
|
||||
\details \ru Оставить часть кривой по двум точкам.\n
|
||||
Для замкнутых кривых дополнительно задается третья точка,
|
||||
которая показывает оставляемую часть.
|
||||
\en Keep the piece of a curve by two points.\n
|
||||
The third point is additionally specified for closed curves,
|
||||
it indicates the piece of a curve to be kept. \~
|
||||
\param[in] p1 - \ru Точка, показывающая первую границу удаляемого участка.
|
||||
\en The point indicating the first boundary of the piece to be deleted. \~
|
||||
\param[in] p2 - \ru Точка, показывающая вторую границу удаляемого участка.
|
||||
\en The point indicating the second boundary of the piece to be deleted. \~
|
||||
\param[in] p3 - \ru Точка, показывающая оставляемую часть замкнутой кривой.
|
||||
\en The point indicating the piece of a closed curve to be kept \~
|
||||
\param[in, out] curve - \ru Изменяемая кривая.
|
||||
\en The curve to be modified. \~
|
||||
\param[in, out] part2 - \ru Всегда NULL.
|
||||
\en This value is always NULL. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after its modification. \~
|
||||
\warning \ru Для внутреннего использования.
|
||||
\en For internal use only. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) TrimmCurvePart( const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
const MbCartPoint & p3,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Выровнить кривую.
|
||||
\en Justify the curve. \~
|
||||
\details \ru Выровнить кривую по отношению к заданной кривой и точке на кривой.\n
|
||||
Кривая усекается точкой пересечения ее с граничной кривой, ближайшей к заданной
|
||||
точке. Остается часть кривой со стороны указанной точки.
|
||||
\en Justify the curve relative to the given curve and a point on the curve.\n
|
||||
The curve is truncated by the point of its intersection with the boundary curve, which is the nearest to the given
|
||||
point. Only the piece of a curve at the side of the given point is kept. \~
|
||||
\param[in, out] curve - \ru Изменяемая кривая.
|
||||
\en The modified curve. \~
|
||||
\param[in] limitCurve - \ru Граничная кривая для выравнивания.
|
||||
\en Boundary curve for justification. \~
|
||||
\param[in] pnt - \ru Точка для выбора нужной части кривой.
|
||||
\en The point for selecting the piece of a curve. \~
|
||||
\param[in, out] part2 - \ru Всегда NULL.
|
||||
\en This value is always NULL. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\warning \ru Для внутреннего использования.
|
||||
\en For internal use only. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) JustifyCurve( MbCurve * curve, MbCurve * limitCurve,
|
||||
const MbCartPoint & pnt, MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Положение точки.
|
||||
\en The position of the point. \~
|
||||
\details \ru Положение точки относительно замкнутых границ.
|
||||
\en The position of the point relative to closed borders. \~
|
||||
\param[in] limits - \ru Набор кривых, задающий границы.
|
||||
В совокупности должен представлять собой замкнутые границы.
|
||||
\en The set of curves that defines boundaries.
|
||||
These curves should be closed boundaries in the aggregate. \~
|
||||
\param[in] pnt - \ru Точка для определения положения.
|
||||
\en The point for the position definition. \~
|
||||
\return \ru Положение точки относительно кривой.
|
||||
\en The point position relative to the curve. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeLocation) PointLocation( const RPArray<const MbCurve> & limits,
|
||||
const MbCartPoint & pnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Выкинуть части кривой.
|
||||
\en Exclude the piece of a curve. \~
|
||||
\details \ru Выкинуть части кривой, попадающие в замкнутые границы.
|
||||
\en Exclude curve pieces from closed boundaries. \~
|
||||
\param[in] curve - \ru Кривая, на которую накладываются границы.
|
||||
\en The bounded curve. \~
|
||||
\param[in] limits - \ru Множество замкнутых кривых-границ.
|
||||
\en The array of closed curves-boundaries. \~
|
||||
\param[in] inside - \ru Признак удаления внутри границ.
|
||||
\en The attribute of deletion inside boundaries. \~
|
||||
\param[out] part2 - \ru Множество оставшихся участков кривой.
|
||||
\en The array of remaining curve pieces. \~
|
||||
\param[out] cross - \ru Точки пересечения кривой с границами.
|
||||
\en The curve and boundaries intersection point. \~
|
||||
\param[out] isEqualCurve - \ru Признак совпадения разбиваемой кривой с какой-то из
|
||||
присланного массива границ. Имеет смысл при результате dp_NoChanged.
|
||||
\en The attribute of coincidence between the broken curve with one of
|
||||
the given array of boundaries. It is worthwhile if the result is dp_NoChanged. \~
|
||||
\param[in] cutOnCurve - \ru Если false, не удаляются части кривой,
|
||||
совпадающие с участками границы.
|
||||
\en If it equals to false, then the pieces of a curve
|
||||
coincident with pieces of the boundary are not to be deleted. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) BreakByClosedCurves( MbCurve & curve,
|
||||
const RPArray<const MbCurve> & limits,
|
||||
bool inside,
|
||||
PArray<MbCurve> & part2,
|
||||
SArray<MbCrossPoint> * cross = NULL,
|
||||
bool * isEqualCurve = NULL,
|
||||
bool cutOnCurve = false );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Выкинуть части кривой.
|
||||
\en Exclude the piece of a curve. \~
|
||||
\details \ru Выкинуть части кривой, совпадающие с набором кривых.
|
||||
\en Exclude pieces of a curve by coincidence with curves from a set. \~
|
||||
\param[in] curve - \ru Кривая, на которую накладываются границы.
|
||||
\en The bounded curve. \~
|
||||
\param[in] limits - \ru Множество кривых для тестирования попадания.
|
||||
\en The array of curves for the hit testing. \~
|
||||
\param[out] part2 - \ru Множество оставшихся кусков кривой.
|
||||
\en The array of remaining curve pieces. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) BreakByCurvesArr( MbCurve & curve,
|
||||
const RPArray<const MbCurve> & limits,
|
||||
PArray<MbCurve> & part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разбить кривую.
|
||||
\en Split the curve. \~
|
||||
\details \ru Разбить кривую на две части.\n
|
||||
В результате кривая разбивается на части, первая часть которой остается в curve,
|
||||
остальные части складываются в массив part2.
|
||||
\en Split the curve into two pieces.
|
||||
In result the curve is split into pieces. The first piece remains,
|
||||
the other pieces are added to the array part2. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\param[in, out] curve - \ru Разбиваемая кривая.
|
||||
\en The curve for splitting. \~
|
||||
\param[in] p1 - \ru Первая точка разбиения.
|
||||
\en The first point of splitting. \~
|
||||
\param[in] p2 - \ru Вторая точка разбиения.
|
||||
\en The second point of splitting. \~
|
||||
\param[out] part2 - \ru Множество частей кривой.
|
||||
\en The array of curve pieces. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) BreakCurve( MbCurve & curve,
|
||||
const MbCartPoint & p1, const MbCartPoint & p2,
|
||||
PArray<MbCurve> & part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разбить кривую..
|
||||
\en Split the curve. \~
|
||||
\details \ru Разбить кривую на ресколько равных частей.
|
||||
\en Split the curve by several equal pieces. \~
|
||||
\param[in, out] curve - \ru Разбиваемая кривая.
|
||||
\en The curve for splitting. \~
|
||||
\param[in] partsCount - \ru Количество частей.
|
||||
\en The count of pieces. \~
|
||||
\param[in] p1 - \ru Одна из точек разбиения.
|
||||
\en One of splitting points. \~
|
||||
\param[out] part2 - \ru Множество частей кривой.
|
||||
\en The array of curve pieces. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) BreakCurveNParts( MbCurve & curve, ptrdiff_t partsCount, const MbCartPoint & p1,
|
||||
PArray<MbCurve> & part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удлиннить кривую.
|
||||
\en Extend the curve. \~
|
||||
\details \ru Удлиннить кривую curve до кривой-границы limitCurve с конца ближайшего к точке pnt
|
||||
\en Extend the curve to the given curve-boundary limitCurve from the end nearest to the given point pnt. \~
|
||||
\param[in, out] curve - \ru Изменяемая кривая.
|
||||
\en The modified curve. \~
|
||||
\param[in] limitCurve - \ru Кривая-граница.
|
||||
\en The curve-boundary \~
|
||||
\param[in] pnt - \ru Точка, показывающая удлинняемый конец кривой.
|
||||
\en The point indicating the extended end of a curve. \~
|
||||
\return \ru Состояние кривой после ее модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) ExtendCurveToCurve( MbCurve * curve, const MbCurve * limitCurve,
|
||||
const MbCartPoint & pnt );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_DELETE_PART_H
|
||||
@@ -0,0 +1,426 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение кривых в двумерном пространстве.
|
||||
\en Construction of curves in two-dimensional space. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_DISTANCE_H
|
||||
#define __ALG_CURVE_DISTANCE_H
|
||||
|
||||
|
||||
#include <mb_cart_point.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbLineSegment;
|
||||
class MATH_CLASS MbArc;
|
||||
class MATH_CLASS MbLine;
|
||||
class MATH_CLASS MbTempCircle;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямую, параллельную заданной.
|
||||
\en Construct a line parallel to a given line. \~
|
||||
\details \ru Построить прямую, параллельную заданной через точку.
|
||||
\en Construct a line parallel to a given line and passing through a given point. \~
|
||||
\param[in] p - \ru Точка на прямой.
|
||||
\en The point on the line. \~
|
||||
\param[in] pl - \ru Параллельная прямая.
|
||||
\en The parallel line. \~
|
||||
\param[out] pl_par - \ru Результат - прямая, параллельная pl, через точку p.
|
||||
\en The result - the line parallel to the line pl and passing through the point p. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LineParallelPoint( const MbCartPoint & p, const MbLine & pl, MbLine & pl_par );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямую, параллельную заданной.
|
||||
\en Construct a line parallel to a given line. \~
|
||||
\details \ru Построить прямую, параллельную заданной, на расстоянии.
|
||||
\en Construct a line parallel to a given line at a given distance from it. \~
|
||||
\param[in] delta - \ru Расстояние до параллельной прямой.
|
||||
\en The distance to the parallel line. \~
|
||||
\param[in] pl - \ru Параллельная прямая.
|
||||
\en The parallel line. \~
|
||||
\param[out] pl_par - \ru Результат - прямая, параллельная pl, на расстоянии delta.
|
||||
\en The result - the line parallel to the line pl at a given distance delta. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LineParallelDistance( double delta, const MbLine & pl, MbLine & pl_par );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямую через точку.
|
||||
\en Construct a line passing through a given point. \~
|
||||
\details \ru Построить прямую, проходящую через точку,
|
||||
являющуюся биссектриссой угла между прямыми.
|
||||
\en Construct a line passing through a given point
|
||||
and being a bisector of angle between two given lines. \~
|
||||
\param[in] p - \ru Точка на прямой.
|
||||
\en The point on the line. \~
|
||||
\param[in] pl1 - \ru Прямая, задающая сторону угла.
|
||||
\en The line defining the angle side. \~
|
||||
\param[in] pl2 - \ru Прямая, задающая сторону угла.
|
||||
\en The line defining the angle side. \~
|
||||
\param[out] pl3 - \ru Результат.
|
||||
\en The result. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) LineBisector( const MbCartPoint & p, const MbLine & pl1, const MbLine & pl2, MbLine & pl3 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямую под углом.
|
||||
\en Construct a line passing at angle. \~
|
||||
\details \ru Построить прямую под углом angle к заданной pl через точку p
|
||||
\en Construct a line at an angle to a given line and passing through a given point. \~
|
||||
\param[in] angle - \ru Угол.
|
||||
\en The angle. \~
|
||||
\param[in] p - \ru Точка на прямой.
|
||||
\en The point on the line. \~
|
||||
\param[in] pl - \ru Прямая под углом angle к построенной.
|
||||
\en The line at the given angle to the created line. \~
|
||||
\param[out] pl_new - \ru Результат - построенная прямая.
|
||||
\en The result - the created line. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LinePointAngle( double angle, const MbCartPoint & p, const MbLine & pl, MbLine & pl_new );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить центр окружности.
|
||||
\en Calculate a circle center. \~
|
||||
\details \ru Вычислить центр окружности по двум точкам и радиусу.
|
||||
\en Calculate a circle center by two points and radius. \~
|
||||
\param[in] p1 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] p2 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[in] radius - \ru Радиус
|
||||
\en Radius. \~
|
||||
\param[out] circle - \ru Результат - массив временных окружностей.
|
||||
\en The result - the array of temporary circles. \~
|
||||
\return \ru Количество элементов в массиве circle.
|
||||
\en The count of elements in the array "circle". \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) Circle2PointsRadius( const MbCartPoint & p1, const MbCartPoint & p2,
|
||||
double radius, MbTempCircle * circle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить центр и радиус окружности.
|
||||
\en Calculate center and radius of a circle. \~
|
||||
\details \ru Вычислить центр и радиус окружности по трем точкам.
|
||||
\en Calculate center and radius of a circle by three points. \~
|
||||
\param[in] p1 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] p2 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[in] p3 - \ru Третья точка.
|
||||
\en The third point. \~
|
||||
\param[out] centre - \ru Результат - центр окружности.
|
||||
\en The result - the circle center. \~
|
||||
\return \ru true в случае возможности построения.
|
||||
\en true if the construction is possible. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) CircleCentre3Points( const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
const MbCartPoint & p3, MbCartPoint & centre );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить эллипс
|
||||
\en Construct an ellipse. \~
|
||||
\details \ru Построить эллипс.\n
|
||||
Зафиксирована конечная точка и длина первой полуоси.
|
||||
Вводится конечная точка второй полуоси.
|
||||
Вычислить длину второй полуоси, центр эллипса и угол наклона первой полуоси.
|
||||
\en Construct an ellipse.\n
|
||||
The finite point and the length of the first semi-axis are fixed.
|
||||
The end point of the second semi-axis is put in.
|
||||
Calculate the length of the second semi-axis, ellipse center and inclination angle of the first semi-axis. \~
|
||||
\param[in] p1 - \ru Конечная точка первой полуоси.
|
||||
\en The end point of the first semi-axis. \~
|
||||
\param[in] l1 - \ru Длина первой полуоси.
|
||||
\en The length of the first semi-axis. \~
|
||||
\param[in] p2 - \ru Конечная точка второй полуоси.
|
||||
\en The end point of the second semi-axis. \~
|
||||
\param[out] l2 - \ru Длина второй полуоси.
|
||||
\en The length of the second semi-axis. \~
|
||||
\param[out] pc - \ru Центр эллипса.
|
||||
\en The ellipse center. \~
|
||||
\param[out] angle - \ru Угол наклона первой полуоси.
|
||||
\en The inclination angle of the first semi-axis. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) EllipsePntPntDist( const MbCartPoint & p1, const double & l1,
|
||||
const MbCartPoint & p2, double & l2,
|
||||
MbCartPoint & pc, double & angle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямую через точку.
|
||||
\en Construct a line passing through a given point. \~
|
||||
\details \ru Построить прямую через точку, перпендикулярную данной кривой.\n
|
||||
Базовая точка прямой сопадает с точкой пересечения.
|
||||
\en Construct a line passing through a point and perpendicular to a given curve.\n
|
||||
A line origin is coincident with intersection point. \~
|
||||
\param[in] pnt - \ru Точка на прямой.
|
||||
\en The point on the line. \~
|
||||
\param[in] pCurve - \ru Перпендикулярная прямая.
|
||||
\en The perpendicular line. \~
|
||||
\param[out] pLine - \ru Результат - массив прямых.
|
||||
\en The result - the array of lines. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LinePointPerpCurve( const MbCartPoint & pnt, const MbCurve & pCurve,
|
||||
PArray<MbLine> & pLine );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямую через точку.
|
||||
\en Construct a line passing through a given point. \~
|
||||
\details \ru Построить прямую, проходящую через точку и касательную заданной окружности,
|
||||
заданной центром и радиусом.\n
|
||||
\en Construct a line passing through a point and tangent to a given circle
|
||||
with given center and radius.\n \~
|
||||
\param[in] p - \ru Точка на прямой.
|
||||
\en The point on the line. \~
|
||||
\param[in] centre - \ru Центр окружности.
|
||||
\en The circle center. \~
|
||||
\param[in] radius - \ru Радиус окружности.
|
||||
\en The circle radius. \~
|
||||
\param[out] pl - \ru Результат - массив прямых.
|
||||
\en The result - the array of lines. \~
|
||||
\return \ru Количество прямых.
|
||||
\en The number of lines. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) LinePointTangentCircle( const MbCartPoint & p, const MbCartPoint & centre, double radius,
|
||||
MbLine * pl );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружность.
|
||||
\en Construct a circle. \~
|
||||
\details \ru Построить окружность по радиусу и точке на ней,
|
||||
центр окружности лежит на заданной кривой.
|
||||
\en Construct a circle by radius and coincident point,
|
||||
a circle center lies on a given curve. \~
|
||||
\param[in] pCurve - \ru Кривая, содержащая центр окружности.
|
||||
\en The curve containing the circle center. \~
|
||||
\param[in] radius - \ru Радиус окружности.
|
||||
\en The circle radius. \~
|
||||
\param[in] on - \ru Точка на окружности.
|
||||
\en The point on the circle. \~
|
||||
\param[out] pCircle - \ru Результат - набор окружностей.
|
||||
\en The result - the set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleCentreOnCurveRadPointOn( const MbCurve & pCurve, double radius, const MbCartPoint & on,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружность.
|
||||
\en Construct a circle. \~
|
||||
\details \ru Построить окружность по двум точкам,
|
||||
центр которой лежит на заданной кривой.
|
||||
\en Construct a circle by two points,
|
||||
with a center lying on a given curve. \~
|
||||
\param[in] pCurve - \ru Кривая, содержащая центр окружности.
|
||||
\en The curve containing the circle center. \~
|
||||
\param[in] on1 - \ru Точка на окружности.
|
||||
\en The point on the circle. \~
|
||||
\param[in] on2 - \ru Точка на окружности.
|
||||
\en The point on the circle. \~
|
||||
\param[out] pCircle - \ru Результат - набор окружностей.
|
||||
\en The result - the set of circles. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleCentreOnCurveTwoPoints( const MbCurve & pCurve, const MbCartPoint & on1, const MbCartPoint & on2,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расстояние между объектами.
|
||||
\en Distance between objects. \~
|
||||
\details \ru Расстояние между двумя объектами.\n
|
||||
\en The distance between two objects.\n \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbDistance {
|
||||
public :
|
||||
double u; ///< \ru Параметр на первой кривой. \en Parameter on the first curve.
|
||||
double v; ///< \ru Параметр на второй кривой. \en Parameter on the second curve.
|
||||
double d; ///< \ru Минимальное расстояние. \en Minimal distance.
|
||||
}; // MbDistance
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить расстояние.
|
||||
\en Calculate distance. \~
|
||||
\details \ru Вычислить расстояние между двумя кривыми.
|
||||
\en Calculate distance between two curves. \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] dmin - \ru Результат - расстояние между кривыми.
|
||||
\en The result - the distance between curves. \~
|
||||
\return \ru true - кривые не пересекаются;
|
||||
false - кривые пересекаются.
|
||||
\en true if curves do not intersect.
|
||||
false if curves intersect. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) DistanceCurveCurve( const MbCurve & curve1, const MbCurve & curve2,
|
||||
MbDistance & dmin );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить дугу окружности.
|
||||
\en Construct a circle arc. \~
|
||||
\details \ru Построить дугу окружности по двум точкам, радиусу и направлению.
|
||||
\en Construct a circle arc by two points, radius and direction. \~
|
||||
\param[in] p1 - \ru Точка на окружности.
|
||||
\en The point on the circle. \~
|
||||
\param[in] p2 - \ru Точка на окружности.
|
||||
\en The point on the circle. \~
|
||||
\param[in] rad - \ru Радиус окружности.
|
||||
\en The circle radius. \~
|
||||
\param[in] clockwise - \ru Признак направления против часовой стенки.
|
||||
\en The attribute of counterclockwise direction. \~
|
||||
\param[out] arc - \ru Результат - массив окружностей.
|
||||
\en The result - the array of circles. \~
|
||||
\return \ru Количество окружностей в массиве.
|
||||
\en The count of circles in array. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (int) Arc2PointsRadius( const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
double rad, bool clockwise,
|
||||
MbArc * arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Рассчитать параметры кривых.
|
||||
\en Calculate parameters of curves. \~
|
||||
\details \ru Рассчитать параметры кривых для минимального расстояния.
|
||||
\en Calculate curves parameters for the minimal distance. \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] u - \ru Параметр на первой кривой.
|
||||
\en Parameter on the first curve. \~
|
||||
\param[out] v - \ru Параметр на второй кривой.
|
||||
\en Parameter on the second curve. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CalculateUV( const MbCurve & curve1, const MbCurve & curve2, double & u, double & v );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расставить точки на кривой.
|
||||
\en Put points on a curve. \~
|
||||
\details \ru Расставить заданное количество точек на кривой.\n
|
||||
Точки можно расставить только на ограниченную кривую.
|
||||
\en Put a given number of points on curve.\n
|
||||
Points may be put only on a bounded curve. \~
|
||||
\param[in] count - \ru Количество точек.
|
||||
\en The number of points. \~
|
||||
\param[in] on - \ru Точка, проекция которой будет добавлена в результат
|
||||
в случае замкнутой кривой.
|
||||
\en Projection of this point will be added in the result
|
||||
in a case of closed curve. \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[out] points - \ru Точки на кривой.
|
||||
\en Points on the curve. \~
|
||||
\param[out] pars - \ru Параметры на кривой.
|
||||
\en Parameters on the curve. \~
|
||||
\return \ru true, если точки были насчитаны.
|
||||
\en true if points were calculated. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) PointsOnCurve( ptrdiff_t count, const MbCartPoint & on, const MbCurve & curve,
|
||||
SArray<MbCartPoint> & points,
|
||||
SArray<double> & pars );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить кривые.
|
||||
\en Construct curves. \~
|
||||
\details \ru Построить кривые по коэффициентам конического сечения.
|
||||
\en Construct curves by conic section coefficients. \~
|
||||
\param[in] A, B, C, D, E, F - \ru Коэффициенты уравнения конического сечения
|
||||
A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0.
|
||||
\en The coefficients of the conic section equation
|
||||
A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0. \~
|
||||
\param[in] X1, Y1 - \ru Координаты первой граничной точки.
|
||||
\en The first boundary point coordinates. \~
|
||||
\param[in] X2, Y2 - \ru Координаты второй граничной точки.
|
||||
\en The second boundary point coordinates. \~
|
||||
\return \ru Результаты построения:
|
||||
- дуга окружности -> дуга окружности;
|
||||
- дуга эллипса -> дуга эллипса;
|
||||
- дуга параболы -> NURBS-кривая;
|
||||
- дуга гиперболы -> NURBS-кривая.
|
||||
\en The construction results:
|
||||
- circle arc -> circle arc;
|
||||
- ellipse arc -> ellipse arc;
|
||||
- parabola arc -> NURBS-curve;
|
||||
- hyperbola arc -> NURBS-curve. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) CanonicToParametricConic( double A, double B, double C, double D, double E, double F,
|
||||
double X1, double Y1, double X2, double Y2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Аппроксимация кривой дугами и отрезками.
|
||||
\en Approximation of a curve by arcs and segments. \~
|
||||
\details \ru Аппроксимация кривой дугами и отрезками.
|
||||
\en Approximation of a curve by arcs and segments. \~
|
||||
\param[in] curve - \ru Кривая для аппроксимации.
|
||||
\en The curve for approximation. \~
|
||||
\param[in] eps - \ru Метрическая погрешность.
|
||||
\en The metric tolerance. \~
|
||||
\param[in] maxRadius - \ru Максимальный радиус аппроксимации.
|
||||
\en The minimal approximation radius. \~
|
||||
\param[in] mate - \ru Флаг аппроксимации с учетом сопряжений.
|
||||
\en The approximation flag with consideration of conjugations. \~
|
||||
\param[in] version - \ru Версия построения.
|
||||
\en The version of construction. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) FatArcContour( const MbCurve & curve, double eps, double maxRadius, bool mate,
|
||||
VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_DISTANCE_H
|
||||
@@ -0,0 +1,130 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Операции с кривыми в двумерном пространстве.
|
||||
\en Operations with curves in two-dimensional space. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_ENVELOPE_H
|
||||
#define __ALG_CURVE_ENVELOPE_H
|
||||
|
||||
#include <cur_contour.h>
|
||||
#include <templ_s_list.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти первый сегмент контура.
|
||||
\en Find the first segment of a contour. \~
|
||||
\details \ru Найти первый сегмент контура.\n
|
||||
В контур добавляется часть кривой selectCurve между параметрами пересечение,
|
||||
ближайшими к проекции точки insidePoint.
|
||||
\en Find the first segment of a contour.\n
|
||||
A piece of the curve "selectCurve" between intersection parameters is added in contour,
|
||||
the parameters are the nearest to the projection of the point "insidePoint". \~
|
||||
\param[in] insidePnt - \ru Точка, вокруг которой надо построить контур.
|
||||
\en The point around which to create the contour. \~
|
||||
\param[in] selectCurve - \ru Ближайшая кривая.
|
||||
\en The nearest curve. \~
|
||||
\param[in] cross - \ru Множество точек пересечения ближайшей кривой.
|
||||
\en The array of points of intersection with the nearest curve. \~
|
||||
\param[out] contour - \ru Контур для добавления сегмента.
|
||||
\en The contour for adding the segment to. \~
|
||||
\param[out] crossRight - \ru Узел - массив точек пересечения кривой в сторону продолжения конутра.
|
||||
\en The node - the array of intersection points in the side of contour extension. \~
|
||||
\return \ru true, если сегмент добавлен.
|
||||
\en true if a segment has been added. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) BeginEnvelopeContour( MbCartPoint & insidePnt, const MbCurve * selectCurve,
|
||||
SArray<MbCrossPoint> & cross,
|
||||
MbContour & contour,
|
||||
SArray<MbCrossPoint> & crossRight );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти ближайшую кривую.
|
||||
\en Find the nearest curve. \~
|
||||
\details \ru Найти ближайшую к точке кривую.
|
||||
\en Find the curve nearest to a point. \~
|
||||
\param[in] curveList - \ru Список кривых.
|
||||
\en The list of curves. \~
|
||||
\param[in] pnt - \ru Точка.
|
||||
\en The point. \~
|
||||
\return \ru Ближайшую кривую.
|
||||
\en The nearest curve. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) FindNearestCurve( List<MbCurve> & curveList, MbCartPoint & pnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти точки пересечения.
|
||||
\en Find intersection points. \~
|
||||
\details \ru Найти точки пересечения выбранной кривой с
|
||||
остальными кривыми списка от кривой включительно.
|
||||
\en Find intersection points of the chosen curve with
|
||||
the other curves from the list. \~
|
||||
\param[in] selectCurve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in] fromCurve - \ru Итератор списка кривых.
|
||||
\en The iterator of the curves list. \~
|
||||
\param[out] cross - \ru Точки пересечения.
|
||||
\en Intersection points. \~
|
||||
\param[in] self - \ru Флаг поиска самопересечений.
|
||||
\en Flag of self-intersections search. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) IntersectWithAll( const MbCurve * selectCurve,
|
||||
LIterator<MbCurve> & fromCurve,
|
||||
SArray<MbCrossPoint> & cross, bool self );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Сортировать точки пересечения.
|
||||
\en Sort intersection points. \~
|
||||
\details \ru Сортировать точки пересечения по отношению к точки проекции
|
||||
выбранной кривой.
|
||||
\en Sort intersection points relative to the projection point
|
||||
of the chosen curve. \~
|
||||
\param[in] tProj - \ru Параметр проекции на кривую.
|
||||
\en Parameter of the projection on the curve. \~
|
||||
\param[in] selectCurve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in, out] cross - \ru Множество точек пересечения для сортировки.
|
||||
\en The array of intersection points for sorting. \~
|
||||
\param[out] crossLeft - \ru Узел точек пересечения слева от проекции.
|
||||
\en The node of intersection points on the left of the projection. \~
|
||||
\param[out] crossRight - \ru Узел точек пересечения справа от проекции.
|
||||
\en The node of intersection points on the right of the projection. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) SortCrossPoints( double tProj, const MbCurve * selectCurve,
|
||||
SArray<MbCrossPoint> & cross,
|
||||
SArray<MbCrossPoint> & crossLeft,
|
||||
SArray<MbCrossPoint> & crossRight );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить совпадающие точки.
|
||||
\en Delete coincident points. \~
|
||||
\details \ru Удалить из массива точки совпадающие с точкой проекции, заданной параметром.\n
|
||||
Если все точки совпадают с точкой проекции, то они не будут удалены.
|
||||
\en Delete points from the array which are coincident with the projection point specified by the parameter.\n
|
||||
If all the points are coincident with the projection point, then they will not be deleted. \~
|
||||
\param[in] tProj - \ru Параметр проекции.
|
||||
\en The projection parameter. \~
|
||||
\param[in, out] cross - \ru Множество точек пересечения.
|
||||
\en The array of intersection points. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) RemoveEquPoints( double tProj, SArray<MbCrossPoint> & cross );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_ENVELOPE_H
|
||||
@@ -0,0 +1,79 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение эквидистанты. Построение штриховки.
|
||||
\en Construction of equidistance. Construction of hatching. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_EQUID_H
|
||||
#define __ALG_CURVE_EQUID_H
|
||||
|
||||
#include <curve.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение эквидистантных кривых к кривой.
|
||||
\en Construction of offset curves to a curve. \~
|
||||
\details \ru Построение эквидистантных кривых к произвольной кривой справа и слева.
|
||||
Имя каждого эквидистантного контура совпадает с именем исходного.
|
||||
\en Construction of equidistant curves to arbitrary curve on the right and on the left.
|
||||
A name of every offset contour matches with the name of the initial one. \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve \~
|
||||
\param[in] radLeft - \ru Радиус эквидистанты слева по направлению.
|
||||
\en The equidistance radius on the left by direction. \~
|
||||
\param[in] radRight - \ru Радиус эквидистанты справа по направлению.
|
||||
\en The equidistance radius on the right by direction. \~
|
||||
\param[in] side - \ru Признак, с какой стороны строить:\n
|
||||
0 - слева по направлению,\n
|
||||
1 - справа по направлению,\n
|
||||
2 - с двух сторон.
|
||||
\en Attribute defining the side to construct:\n
|
||||
0 - on the left by derection,\n
|
||||
1 - on the right by derection,\n
|
||||
2 - on the both sides. \~
|
||||
\param[in] arcMode - \ru Cпособ обхода углов:\n
|
||||
true - дугой,
|
||||
false - срезом.
|
||||
\en The way of traverse of angles:\n
|
||||
true - by arc,
|
||||
false - by section. \~
|
||||
\param[in] degState - \ru Признак разрешения вырожденных сегментов:\n
|
||||
0 - вырожденные сегменты запрещены,\n
|
||||
1 - вырожденные сегменты разрешены.
|
||||
\en Attribute of degenerate segments allowance:\n
|
||||
0 - degenerate segments are forbidden,\n
|
||||
1 - degenerate segments are allowed. \~
|
||||
\param[out] equLeft - \ru Множество контуров слева.
|
||||
\en The array of contours on the left side. \~
|
||||
\param[out] equRight - \ru Множество контуров справа.
|
||||
\en The array of contours on the right side. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) Equid( const MbCurve *curve, double radLeft, double radRight,
|
||||
int side, bool arcMode, bool degState,
|
||||
PArray <MbCurve> &equLeft, PArray <MbCurve> &equRight );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение области штриховки кривых.
|
||||
\en Construction of curves hatching region. \~
|
||||
\details \ru Построение штриховки заданной ширины внутри или около кривых.
|
||||
\en Construction of hatching with a given width inside or near curves. \~
|
||||
\param[in] contour - \ru Исходная кривые.
|
||||
\en Initial curves \~
|
||||
\param[in] witdh - \ru Ширина штриховки.
|
||||
\en The hatching width. \~
|
||||
\param[out] borders - \ru Множество линий штриховки и границ штриховки.
|
||||
\en The array of hatching lines and hatching boundaries. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) MakeHatchingArea( const PArray<MbCurve> & contour, double witdh,
|
||||
PArray<MbCurve> & borders );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_EQUID_H
|
||||
@@ -0,0 +1,190 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение скругления, фаски между двумя кривыми в двумерном пространстве.
|
||||
\en Construction of fillet or chamfer between two curves in two-dimensional space. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_FILLET_H
|
||||
#define __ALG_CURVE_FILLET_H
|
||||
|
||||
#include <curve.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbLineSegment;
|
||||
class MATH_CLASS MbArc;
|
||||
class MATH_CLASS MbContour;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить скругление между кривыми.
|
||||
\en Construct fillet between curves. \~
|
||||
\details \ru Построить скругление постоянным радиусом между двумя кривыми.
|
||||
\en Construct fillet with a constant radius between two curves. \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] pnt1 - \ru Точка вблизи первой кривой.
|
||||
\en The point near the first curve. \~
|
||||
\param[in] trim1 - \ru Признак усечения первой кривой.
|
||||
\en The attribute of trimming of the first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in] pnt2 - \ru Точка вблизи второй кривой.
|
||||
\en The point near the second curve. \~
|
||||
\param[in] trim2 - \ru Признак усечения второй кривой.
|
||||
\en The attribute of trimming of the second curve. \~
|
||||
\param[in] rad - \ru Радиус скругления.
|
||||
\en The radius of fillet. \~
|
||||
\param[out] state1 - \ru Состояние первой кривой.
|
||||
\en The state of the first curve. \~
|
||||
\param[out] state2 - \ru Состояние второй кривой.
|
||||
\en The state of the second curve. \~
|
||||
\param[out] arc - \ru Дуга скругления.
|
||||
\en The arc of fillet. \~
|
||||
\return \ru true в случае успешной операции.
|
||||
\en true in case of successful operation. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) Fillet( MbCurve * curve1, const MbCartPoint & pnt1, bool trim1,
|
||||
MbCurve * curve2, const MbCartPoint & pnt2, bool trim2,
|
||||
double rad,
|
||||
MbeState & state1,
|
||||
MbeState & state2,
|
||||
MbArc *& arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить фаску.
|
||||
\en Construct a chamfer. \~
|
||||
\details \ru Построить фаску между двумя кривыми.
|
||||
\en Construct a chamfer between two curves. \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] pnt1 - \ru Точка вблизи первой кривой.
|
||||
\en The point near the first curve. \~
|
||||
\param[in] trim1 - \ru Признак усечения первой кривой.
|
||||
\en The attribute of trimming of the first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in] pnt2 - \ru Точка вблизи второй кривой.
|
||||
\en The point near the second curve. \~
|
||||
\param[in] trim2 - \ru Признак усечения второй кривой.
|
||||
\en The attribute of trimming of the second curve. \~
|
||||
\param[in] len - \ru Размер фаски на первой кривой.
|
||||
\en The size of the chamfer on the first curve. \~
|
||||
\param[in] angle - \ru Угол фаски или размер фаски на второй кривой в зависимости от типа построения.
|
||||
\en The angle of the chamfer or the size of the chamfer on the second curve according to the type of construction. \~
|
||||
\param[in] type - \ru Тип построения фаски:\n
|
||||
true - размер + угол,\n
|
||||
false - размер + размер.
|
||||
\en The type of chamfer construction:\n
|
||||
true - size + angle,\n
|
||||
false - size + size. \~
|
||||
\param[out] state1 - \ru Состояние первой кривой.
|
||||
\en The state of the first curve. \~
|
||||
\param[out] state2 - \ru Состояние второй кривой.
|
||||
\en The state of the second curve. \~
|
||||
\param[out] lineseg - \ru Отрезок фаски.
|
||||
\en The segment of the chamfer. \~
|
||||
\return \ru true в случае успешной операции.
|
||||
\en is true in case of successful operation. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) Chamfer( MbCurve * curve1, const MbCartPoint & pnt1, bool trim1,
|
||||
MbCurve * curve2, const MbCartPoint & pnt2, bool trim2,
|
||||
double len, double angle, bool type,
|
||||
MbeState & state1,
|
||||
MbeState & state2,
|
||||
MbLineSegment *& lineseg );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить скругление.
|
||||
\en Construct a fillet. \~
|
||||
\details \ru Построить скругление полилинии или контура.\n
|
||||
Изменяемая кривая mc должна быть полилинией или контуром.
|
||||
\en Construct a fillet of polyline or contour.\n
|
||||
The curve "mc" being modified should be a polyline or a contour. \~
|
||||
\param[in] mc - \ru Изменяемая кривая.
|
||||
\en The modified curve. \~
|
||||
\param[in] rad - \ru Радиус скругления.
|
||||
\en The radius of fillet. \~
|
||||
\param[in] nodeFlag - \ru Флаг выбора узлов скругления:\n
|
||||
true - скругление во всех узлах,\n
|
||||
false - скругление ближайшего узла.
|
||||
\en The flag of selection of fillet nodes.\n
|
||||
true - fillet at all nodes,\n
|
||||
false - fillet of the nearest node. \~
|
||||
\param[in] pnt - \ru Точка для выбора ближайшего узла.
|
||||
\en The point of choosing of the nearest node. \~
|
||||
\param[out] contour - \ru Контур, построенный по полилинии.
|
||||
\en Contour constructed by a polyline. \~
|
||||
\return \ru Состояние кривой после её модификации.
|
||||
\en The state of a curve after modification. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) FilletPolyContour( MbCurve * mc, double rad, bool nodeFlag,
|
||||
const MbCartPoint & pnt, MbContour *& contour );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить фаску.
|
||||
\en Construct a chamfer. \~
|
||||
\details \ru Построить фаску полилинии или контура.\n
|
||||
Изменяемая кривая mc должна быть полилинией или контуром.
|
||||
\en Construct a chamfer of polyline or contour.\n
|
||||
The curve "mc" being modified should be a polyline or a contour. \~
|
||||
\param[in] mc - \ru Изменяемая кривая.
|
||||
\en The modified curve. \~
|
||||
\param[in] l1 - \ru Размер фаски.
|
||||
\en The size of a chamfer. \~
|
||||
\param[in] par - \ru Угол фаски или размер фаски в зависимости от типа построения.
|
||||
\en The angle of a chamfer or the size of a chamfer on the second curve according to the type of construction. \~
|
||||
\param[in] chamferTypeFlag - \ru Тип построения фаски:\n
|
||||
true - размер + угол,\n
|
||||
false - размер + размер.
|
||||
\en The type of chamfer construction:\n
|
||||
true - size + angle,\n
|
||||
false - size + size. \~
|
||||
\param[in] nodeFlag - \ru Флаг выбора узлов скругления:\n
|
||||
true - скругление во всех узлах,\n
|
||||
false - скругление ближайшего узла.
|
||||
\en The flag of selection of fillet nodes.\n
|
||||
true - fillet at all nodes,\n
|
||||
false - fillet of the nearest node. \~
|
||||
\param[in] pnt - \ru Точка для выбора ближайшего узла.
|
||||
\en The point of choosing of the nearest node. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) ChamferPolyContour( MbCurve * mc, double l1, double par,
|
||||
bool chamferTypeFlag, bool nodeFlag,
|
||||
const MbCartPoint & pnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Продлить кривые.
|
||||
\en Extend curves. \~
|
||||
\details \ru Продлить две кривые до точки пересечения.
|
||||
\en Extend two curves to the point of intersection. \~
|
||||
\param[in, out] crv1 - \ru Первая кривая
|
||||
\en The first curve. \~
|
||||
\param[in, out] crv2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[in] p1 - \ru Точка для выбора места пересечения.
|
||||
\en The point for selection of intersection location. \~
|
||||
\param[in] p2 - \ru Точка для выбора места пересечения.
|
||||
\en The point for selection of intersection location. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) Corner( MbCurve * crv1, MbCurve * crv2,
|
||||
const MbCartPoint & p1, const MbCartPoint & p2 );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_FILLET_H
|
||||
@@ -0,0 +1,54 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Пересечение кривых в двумерном пространстве для штриховки.
|
||||
\en Intersection of curves in two-dimensional space for hatching. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_HATCH_H
|
||||
#define __ALG_CURVE_HATCH_H
|
||||
|
||||
#include <curve.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти пересечение с горизонтальной прямой.
|
||||
\en Find intersection with horizontal line. \~
|
||||
\details \ru Найти пересечение кривой с горизонтальной прямой.
|
||||
Для штриховки.
|
||||
\en Find intersection of a curve with horizontal line.
|
||||
For hatching. \~
|
||||
\param[in] y - \ru Координата у горизонтальной прямой.
|
||||
\en The coordinate of a horizontal line. \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[out] crossPnt - \ru Точки пересечения.
|
||||
\en Intersection points. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) HatchIntersectLine( double y, MbCurve * curve, SArray<MbCartPoint> & crossPnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти пересечение с окружностью.
|
||||
\en Find intersection with a circle. \~
|
||||
\details \ru Найти пересечение с окружностью.\n
|
||||
Для штриховки.
|
||||
\en Find intersection with a circle.\n
|
||||
For hatching. \~
|
||||
\param[in] circle - \ru Окружность.
|
||||
\en The circle. \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[out] crossPnt - \ru Точки пересечения.
|
||||
\en Intersection points. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) HatchIntersectCircle( MbCurve * circle, MbCurve * curve, SArray<MbCartPoint> & crossPnt );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_HATCH_H
|
||||
@@ -0,0 +1,163 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение прямой.
|
||||
\en Construction of line. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_CURVE_TANGENT_H
|
||||
#define __ALG_CURVE_TANGENT_H
|
||||
|
||||
#include <cur_line.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить касательные прямые.
|
||||
\en Construct a line. \~
|
||||
\details \ru Построить все возможные прямые через точку касательно данной кривой.\n
|
||||
Базовая точка прямой сопадает с точкой касания.
|
||||
\en Construct a line passing throgh a point and tangent to a given curve.\n
|
||||
A line origin is coincident with a tangency point. \~
|
||||
\param[in] pnt - \ru Точка, через которую проходит прямая.
|
||||
\en The point which the line passing through. \~
|
||||
\param[in] pCurve - \ru Кривая, которой должна касаться построенная прямая.
|
||||
\en The curve which the constructed line should be tangent to. \~
|
||||
\param[out] pLine - \ru Набор прямых.
|
||||
\en The set of lines. \~
|
||||
\param[in] lineAsCurve - \ru Обрабатывать прямую, ломаную и отрезок как кривую в общеи мслучае.
|
||||
\en Work with MbLline, MbPolyline, MbLineSegment as with MbCurve. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LinePointTangentCurve( MbCartPoint & pnt, const MbCurve & pCurve,
|
||||
PArray<MbLine> & pLine, bool lineAsCurve = false );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямые под углом.
|
||||
\en Construct lines passing at angle. \~
|
||||
\details \ru Построить прямые, проходящие под углом angle к оси 0X и касательные к кривой.\n
|
||||
Базовая точка прямой сопадает с точкой касания.
|
||||
\en Construct lines at angle "angle" to the axis OX and tangent to the curve.\n
|
||||
A line origin is coincident with a tangency point. \~
|
||||
\param[in] angle - \ru Угол к оси абсцисс.
|
||||
\en The angle to the abscissa axis. \~
|
||||
\param[in] pCurve - \ru Кривая, которой должна касаться построенная прямая.
|
||||
\en The curve which the constructed line should be tangent to. \~
|
||||
\param[out] pLine - \ru Набор прямых.
|
||||
\en The set of lines. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LineAngleTangentCurve( double angle, const MbCurve & pCurve,
|
||||
PArray<MbLine> & pLine );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямые, касательные к окружностям.
|
||||
\en Construct lines tangent to circles. \~
|
||||
\details \ru Построить прямые, касательные к двум окружностям,
|
||||
заданным центрами и радиусами.\n
|
||||
Базовая точка прямой сопадает с точкой касания первой окружности.
|
||||
Функция строит от 0 до 4 прямых.
|
||||
\en Construct lines tangent to two circles.
|
||||
with given centers and radii.\n
|
||||
A line origin is coincident with a point of tangency with the first circle.
|
||||
Function constructs from 0 to 4 variables. \~
|
||||
\param[in] centre1 - \ru Центр первой окружности.
|
||||
\en The center of the first circle. \~
|
||||
\param[in] radius1 - \ru Радиус первой окружности.
|
||||
\en The radius of the first circle. \~
|
||||
\param[in] centre2 - \ru Центр второй окружности.
|
||||
\en The center of the second circle. \~
|
||||
\param[in] radius2 - \ru Радиус второй окружности.
|
||||
\en The radius of the second circle. \~
|
||||
\param[out] pl - \ru Результат - массив прямых.
|
||||
\en The result - the array of lines. \~
|
||||
\param[out] sp - \ru Множество точек касания на второй кривой.
|
||||
\en The array of tangency points on the second curve. \~
|
||||
\return \ru Количество прямых в массиве pl,
|
||||
равное количеству базовых точек в массиве sp.
|
||||
\en The number of lines in array "pl"
|
||||
that is equal to the number of the base points in array "sp". \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) LineTan2Circles( const MbCartPoint & centre1, double radius1,
|
||||
const MbCartPoint & centre2, double radius2,
|
||||
MbLine * pl, MbCartPoint * sp );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить касательную прямую.
|
||||
\en Construct a tangent line. \~
|
||||
\details \ru Построить прямую, касательную двум кривым.\n
|
||||
Базовая точка прямой сопадает с точкой касания первой кривой.
|
||||
\en Construct a line tangent to two curves.\n
|
||||
A line origin is coincident with a point of tangency on the first curve. \~
|
||||
\param[in] pCurve1 - \ru Первая кривая, которой должна касаться построенная прямая.
|
||||
\en The first curve which the constructed line should be tangent to. \~
|
||||
\param[in] pCurve2 - \ru Вторая кривая, которой должна касаться построенная прямая.
|
||||
\en The second curve the constructed line should be tangent to. \~
|
||||
\param[out] pLine - \ru Результат - массив прямых.
|
||||
\en The result - the array of lines. \~
|
||||
\param[out] secodnPnt - \ru Множество точек касания на второй кривой.
|
||||
\en The array of tangency points on the second curve. \~
|
||||
\return \ru Количество прямых в массиве pLine,
|
||||
равное количеству точек в массиве secodnPnt.
|
||||
\en The number of lines in array "pline"
|
||||
that is equal to the number of points in array "secondPnt". \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) LineTangentTwoCurves( const MbCurve * pCurve1, const MbCurve * pCurve2,
|
||||
PArray<MbLine> * pLine,
|
||||
SArray<MbCartPoint> * secodnPnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить прямые под углом.
|
||||
\en Construct lines passing at angle. \~
|
||||
\details \ru Построить прямые, проходящие под углом angle к оси 0X,
|
||||
касательные к окружности, заданной центром и радиусом.
|
||||
\en Construct lines at angle "angle" to the axis OX,
|
||||
tangent to a circle with the given center and radius. \~
|
||||
\param[in] angle - \ru Угол.
|
||||
\en The angle. \~
|
||||
\param[in] centre - \ru Центр окружности.
|
||||
\en The circle center. \~
|
||||
\param[in] radius - \ru Радиус окружности.
|
||||
\en The circle radius. \~
|
||||
\param[out] pLine - \ru Результат - массив прямых.
|
||||
\en The result - the array of lines. \~
|
||||
\return \ru Количество прямых в массиве pLine.
|
||||
\en The number of lines in array "pLine", \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) LineAngleTanCircle( double angle, const MbCartPoint & centre, double radius, MbLine * pLine );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Перестывить прямые.
|
||||
\en Swap lines. \~
|
||||
\details \ru Перестывить прямые местами.
|
||||
\en Swap lines. \~
|
||||
\param[in] l1 - \ru Первая прямая.
|
||||
\en The first line. \~
|
||||
\param[in] l2 - \ru Вторая прямая.
|
||||
\en The second line. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
inline
|
||||
void SwapLines( MbLine & l1, MbLine & l2 )
|
||||
{
|
||||
std::swap( l1.SetOrigin(), l2.SetOrigin() );
|
||||
std::swap( l1.SetDirection(), l2.SetDirection() );
|
||||
}
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_TANGENT_H
|
||||
@@ -0,0 +1,446 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Радиальный размер к поверхности. Расстояние между поверхностями.
|
||||
\en Radial dimension of surface. Distance between surfaces. \~
|
||||
\details \ru Функции построения окружности или дуги для радиального размера к поверхности.
|
||||
Функция вычисления экстремальных расстояний между поверхностями.
|
||||
\en Functions of construction of a circle or an arc for radial dimension of surface.
|
||||
A function of calculation of extreme distances between surfaces. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __ALG_DIMENSION_H
|
||||
#define __ALG_DIMENSION_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_enum.h>
|
||||
#include <mb_cart_point.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCartPoint3D;
|
||||
class MATH_CLASS MbVector3D;
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbAxis3D;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbPlaneCurve;
|
||||
class MATH_CLASS MbSurface;
|
||||
class IProgressIndicator;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// \ru Построение окружности или дуги для радиального размера к поверхности, \en Construction of a circle or an arc for radial dimension of surface
|
||||
// \ru имеющей круговую параметрическую линию u=const или v=const \en which has a circular parametric line u=const or v=const.
|
||||
// \ru Перечень поверхностей, имеющих параметрическую линию u=const или u=const: \en The enumeration of surfaces which have a parametric line u=const or u=const:
|
||||
// MbCylinderSurface, v=const
|
||||
// MbConeSurface, v=const
|
||||
// MbSphereSurface, u=const
|
||||
// MbTorusSurface, u=const
|
||||
// MbLoftedSurface, v=const
|
||||
// MbElevationSurface, v=const
|
||||
// MbExtrusionSurface, v=const
|
||||
// MbRevolutionSurface, u=const
|
||||
// MbEvolutionSurface, u=const
|
||||
// MbExactionSurface, u=const
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружность или дугу для радиального размера к поверхности.
|
||||
\en Construct a circle or an arc for radial dimension of surface. \~
|
||||
\details \ru Построение выполняется по заданной параметрической точке поверхности. Поверхность
|
||||
должна иметь круговую параметрическую линию u=const или v=const. Перечень поверхностей,
|
||||
имеющих параметрическую линию u=const или v=const:
|
||||
MbCylinderSurface v=const, \n MbConeSurface v=const, \n
|
||||
MbSphereSurface u=const, \n MbTorusSurface u=const, \n
|
||||
MbLoftedSurface v=const, \n MbElevationSurface v=const, \n
|
||||
MbExtrusionSurface v=const, \n MbRevolutionSurface u=const, \n
|
||||
MbEvolutionSurface u=const, \n MbExactionSurface u=const.
|
||||
\en Construction is performed by the given parametric point on surface. A surface
|
||||
should have a circular parametric line u=const or v=const. The enumeration of surfaces
|
||||
which have a parametric line u=const or v=const.
|
||||
MbCylinderSurface v=const, \n MbConeSurface v=const, \n
|
||||
MbSphereSurface u=const, \n MbTorusSurface u=const, \n
|
||||
MbLoftedSurface v=const, \n MbElevationSurface v=const, \n
|
||||
MbExtrusionSurface v=const, \n MbRevolutionSurface u=const, \n
|
||||
MbEvolutionSurface u=const, \n MbExactionSurface u=const. \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] surface_uv - \ru Координаты исходной точки на поверхности.
|
||||
\en Coordinates of the initial point on surface. \~
|
||||
\param[out] plane_curve - \ru Требуемая окружность или дуга.
|
||||
\en The required circle or an arc. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) RadiusDimension3D( const MbSurface & surface,
|
||||
const MbCartPoint & surface_uv,
|
||||
MbPlaneCurve *& plane_curve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружность или дугу для радиального размера к поверхности.
|
||||
\en Construct a circle or an arc for radial dimension of surface. \~
|
||||
\details \ru Построение выполняется по заданной по заданной пространственной точке. Поверхность
|
||||
должна иметь круговую параметрическую линию u=const или v=const. Перечень поверхностей,
|
||||
имеющих параметрическую линию u=const или u=const:
|
||||
MbCylinderSurface v=const, \n MbConeSurface v=const, \n
|
||||
MbSphereSurface u=const, \n MbTorusSurface u=const, \n
|
||||
MbLoftedSurface v=const, \n MbElevationSurface v=const, \n
|
||||
MbExtrusionSurface v=const, \n MbRevolutionSurface u=const, \n
|
||||
MbEvolutionSurface u=const, \n MbExactionSurface u=const.
|
||||
\en Construction is performed by the given spatial point. A surface
|
||||
should have a circular parametric line u=const or v=const. The enumeration of surfaces
|
||||
which have a parametric line u=const or v=const.
|
||||
MbCylinderSurface v=const, \n MbConeSurface v=const, \n
|
||||
MbSphereSurface u=const, \n MbTorusSurface u=const, \n
|
||||
MbLoftedSurface v=const, \n MbElevationSurface v=const, \n
|
||||
MbExtrusionSurface v=const, \n MbRevolutionSurface u=const, \n
|
||||
MbEvolutionSurface u=const, \n MbExactionSurface u=const. \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] point - \ru Пространственные координаты исходной точки.
|
||||
\en Space coordinates of the initial point. \~
|
||||
\param[out] plane_curve - \ru Требуемая окружность или дуга.
|
||||
\en The required circle or an arc. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) RadiusDimension3D( const MbSurface & surface,
|
||||
const MbCartPoint3D & point,
|
||||
MbPlaneCurve *& plane_curve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить окружность или дугу для радиального размера к поверхности.
|
||||
\en Construct a circle or an arc for radial dimension of surface. \~
|
||||
\details \ru Построение выполняется по заданному плейсменту. Поверхность должна иметь
|
||||
круговую параметрическую линию u=const или v=const. Перечень поверхностей, имеющих
|
||||
параметрическую линию u=const или u=const:
|
||||
MbCylinderSurface v=const, \n MbConeSurface v=const, \n
|
||||
MbSphereSurface u=const, \n MbTorusSurface u=const, \n
|
||||
MbLoftedSurface v=const, \n MbElevationSurface v=const, \n
|
||||
MbExtrusionSurface v=const, \n MbRevolutionSurface u=const, \n
|
||||
MbEvolutionSurface u=const, \n MbExactionSurface u=const.
|
||||
\en Construction is performed by the given placement. A surface should have
|
||||
a circular parametric line u=const or v=const. The enumeration of surfaces with
|
||||
a parametric line u=const or v=const.
|
||||
MbCylinderSurface v=const, \n MbConeSurface v=const, \n
|
||||
MbSphereSurface u=const, \n MbTorusSurface u=const, \n
|
||||
MbLoftedSurface v=const, \n MbElevationSurface v=const, \n
|
||||
MbExtrusionSurface v=const, \n MbRevolutionSurface u=const, \n
|
||||
MbEvolutionSurface u=const, \n MbExactionSurface u=const. \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[in] place - \ru Исходный плейсмент.
|
||||
\en The initial placement. \~
|
||||
\param[out] plane_curve - \ru Требуемая окружность или дуга.
|
||||
\en The required circle or an arc. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) RadiusDimension3D( const MbSurface & surface,
|
||||
const MbPlacement3D & place,
|
||||
MbPlaneCurve *& plane_curve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Можно ли построить окружность или дугу для радиального размера к поверхности.
|
||||
\en Whether a circle or an arc can be constructed for radial dimension of surface. \~
|
||||
\details \ru Можно построить, если тип базовой поверхности: st_CylinderSurface или st_ConeSurface,
|
||||
или st_SphereSurface, или st_TorusSurface.
|
||||
\en It can be constructed if the type of a base surface is st_CylinderSurface or st_ConeSurface,
|
||||
or st_SphereSurface, or st_TorusSurface. \~
|
||||
\param[in] surface - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\return \ru true, если можно построить.
|
||||
\en true if it can be constructed. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) IsPossibleRadiusDimension3D( const MbSurface & surface );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Результат замера расстояния и угла между поверхностями.
|
||||
\en The result of measurement of dimension and angle between surfaces. \~
|
||||
\details \ru Результат замера расстояния и угла между поверхностями.
|
||||
\en The result of measurement of dimension and angle between surfaces. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
enum MbeSurfAxesMeasureRes
|
||||
{
|
||||
// \ru ошибочные результат \en mistaken result
|
||||
samr_SurfSurf_Failed = -3, ///< \ru Ошибка при работе с поверхностями. \en An error is occurred while working with surfaces.
|
||||
samr_AxisSurf_Failed = -2, ///< \ru Ошибка при работе с осью и поверхностю. \en An error is occurred while working with axis and surface.
|
||||
samr_AxisAxis_Failed = -1, ///< \ru Ошибка при работе с осями. \en An error is occurred while working with axes.
|
||||
// \ru пустой результат \en an empty result.
|
||||
samr_Undefined = 0, ///< \ru Не получилось или не измерялось. \en Failed or didn't measured.
|
||||
// \ru две оси \en two axes
|
||||
samr_AxisAxis_Coaxial, ///< \ru Оси совпадают. \en Axes are coincident.
|
||||
samr_AxisAxis_Parallel, ///< \ru Оси параллельны. \en Axes are parallel.
|
||||
samr_AxisAxis_Intersecting, ///< \ru Оси пересекаются. \en Axes are crossed.
|
||||
samr_AxisAxis_Distant, ///< \ru Оси на расстоянии. \en Axes are located at a distance.
|
||||
// \ru одна ось (какая из осей есть, см. по возвращаемому флагу функции замера) \en one axis (see the returned flag of measurement function to detect which one exactly)
|
||||
samr_AxisSurf_Colinear, ///< \ru Ось лежит на поверхности. \en The axis lies on the surface.
|
||||
samr_AxisSurf_Parallel, ///< \ru Ось параллельна поверхности. \en The axis is parallel to the surface.
|
||||
samr_AxisSurf_Intersecting, ///< \ru Ось пересекает поверхность. \en The axis crosses the surface.
|
||||
samr_AxisSurf_Distant, ///< \ru Ось на расстоянии от поверхности. \en The axis is located at a distance from the surface.
|
||||
// \ru две плоские поверхности \en two planar surfaces
|
||||
samr_SurfSurf_Colinear, ///< \ru Одна поверхность лежит на другой. \en One surface lies on another one.
|
||||
samr_SurfSurf_Parallel, ///< \ru Поверхности параллельны. \en Surfaces are parallel.
|
||||
samr_SurfSurf_Intersecting, ///< \ru Поверхности пересекаются. \en Surfaces are intersecting inside domain.
|
||||
// \ru samr_SurfSurf_Distant, // находятся на расстоянии \en samr_SurfSurf_Distant, // located at a distance
|
||||
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расстояние между осями поверхностей.
|
||||
\en Distance between axes of surfaces. \~
|
||||
\details \ru Рассчитывается расстояние между осями поверхностей, имеющих оси вращения,
|
||||
или расстояние между поверхностью, имеющей ось, и плоской поверхностью.
|
||||
\en Calculate distance between axes of revolution surfaces
|
||||
or distance between revolution surface and planar surface. \~
|
||||
\param[in] surface1, sameSense1 - \ru Первая поверхность и ее направление.
|
||||
\en The first surface and its direction. \~
|
||||
\param[in] surface2, sameSense2 - \ru Вторая поверхность и ее направление.
|
||||
\en The second surface and its direction. \~
|
||||
\param[out] axis1, exist1 - \ru Ось первой поверхности и флаг ее наличия.
|
||||
\en The axis of the first surface and the flag of its existence. \~
|
||||
\param[out] axis2, exist2 - \ru Ось второй поверхности и флаг ее наличия.
|
||||
\en The axis of the second surface and the flag of its existence. \~
|
||||
\param[out] p1 - \ru Точка на первой оси или поверхности.
|
||||
\en The point on the first axis or surface. \~
|
||||
\param[out] p2 - \ru Точка на второй оси или поверхности.
|
||||
\en The point on the second axis or surface. \~
|
||||
\param[out] angle - \ru Угол между осями или осью поверхностью.
|
||||
\en The angle between axes or between an axis and a surface. \~
|
||||
\param[out] distance - \ru Минимальное расстояние между осями.
|
||||
\en Minimal distance between axes. \~
|
||||
\param[in] angle - \ru Угловая погрешность.
|
||||
\en The angle accuracy. \~
|
||||
\return \ru Вариант полученного замера или вариант ошибки.
|
||||
\en The variant of the obtained measurement or the variant of error. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeSurfAxesMeasureRes) SurfAxesDistAngle( const MbSurface & surface1, bool sameSense1,
|
||||
const MbSurface & surface2, bool sameSense2,
|
||||
MbAxis3D & axis1, bool & exist1,
|
||||
MbAxis3D & axis2, bool & exist2,
|
||||
MbCartPoint3D & p1,
|
||||
MbCartPoint3D & p2,
|
||||
double & angle,
|
||||
double & distance,
|
||||
double angleEps = ANGLE_EPSILON );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расстояние между точками на поверхности.
|
||||
\en Distance between points on surface. \~
|
||||
\details \ru Класс содержит данные о расстоянии между точками и координатами этих точек
|
||||
на поверхностях.
|
||||
\en The class contains data about the distance between points and their coordinates
|
||||
on surfaces. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSurfDist {
|
||||
friend class MbMinMaxSurfDists;
|
||||
private:
|
||||
double d; ///< \ru Расстояние. \en Distance.
|
||||
MbCartPoint uv1; ///< \ru Параметр на первой поверхности. \en Parameter on the first surface.
|
||||
MbCartPoint uv2; ///< \ru Параметр на второй поверхности. \en Parameter on the second surface.
|
||||
uint8 sign; ///< \ru Знак расстояния. \en Sign of direction.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbSurfDist() : d( UNDEFINED_DBL ), uv1(), uv2(), sign( 1 ) {}
|
||||
/// \ru Конструктор по данным. \en The constructor by data.
|
||||
MbSurfDist( double _d, const MbCartPoint & _uv1, const MbCartPoint & _uv2, bool plus ) { Init( _d, _uv1, _uv2, plus ); }
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbSurfDist( const MbSurfDist & other ) { Init( other ); }
|
||||
/// \ru Деструктор. \en The destructor.
|
||||
virtual ~MbSurfDist() {}
|
||||
public:
|
||||
/// \ru Функция копирования. \en Copy function.
|
||||
void Init( const MbSurfDist & obj ) { d = obj.d; uv1 = obj.uv1; uv2 = obj.uv2; sign = obj.sign; }
|
||||
/// \ru Получить расстояние. \en Get distance.
|
||||
double GetDistance() const { return d; }
|
||||
/// \ru Получить точку на первой поверхности. \en Get the point on the first surface.
|
||||
const MbCartPoint & GetPointOne() const { return uv1; }
|
||||
/// \ru Получить точку на второй поверхности. \en Get the point on the second surface.
|
||||
const MbCartPoint & GetPointTwo() const { return uv2; }
|
||||
/// \ru Расстояние положительное? \en Is the distance positive?
|
||||
bool IsPositive() const { return (sign > 0); }
|
||||
/// \ru Расстояние отрицательное? \en Is the distance negative?
|
||||
bool IsNegative() const { return (sign < 1); }
|
||||
/// \ru Оператор присваивания. \en Assignment operator.
|
||||
const MbSurfDist & operator = ( const MbSurfDist & other ) { Init( other ); return (*this); }
|
||||
|
||||
private:
|
||||
void Init( double _d, const MbCartPoint & _uv1, const MbCartPoint & _uv2, bool plus );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru инициализатор \en Initializer
|
||||
// ---
|
||||
inline void MbSurfDist::Init( double _d, const MbCartPoint & _uv1, const MbCartPoint & _uv2, bool plus )
|
||||
{
|
||||
d = _d;
|
||||
uv1 = _uv1;
|
||||
uv2 = _uv2;
|
||||
sign = plus ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расстояния с точками между поверхностями.
|
||||
\en Distances between surfaces with points. \~
|
||||
\details \ru Расстояния с точками между поверхностями.
|
||||
\en Distances between surfaces with points. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbMinMaxSurfDists {
|
||||
private :
|
||||
SArray<MbSurfDist> surfDistances; ///< \ru Расстояние и параметры на поверхностях. \en Distance and parameters on surfaces.
|
||||
mutable double midDistance; ///< \ru Среднее расстояние. \en Average distance.
|
||||
mutable double minDistance; ///< \ru Минимальное расстояние. \en Minimal distance.
|
||||
mutable double maxDistance; ///< \ru Максимальное расстояние. \en Maximal distance.
|
||||
mutable bool sorted; ///< \ru Признак сортированности. \en Attribute of being sorted.
|
||||
|
||||
public:
|
||||
MbMinMaxSurfDists( size_t nReserve = 0 ); ///< \ru Конструктор. \en Constructor.
|
||||
virtual ~MbMinMaxSurfDists(); ///< \ru Деструктор. \en Destructor.
|
||||
|
||||
public:
|
||||
bool IsEmpty() const { return (surfDistances.Count() < 1); } ///< \ru Есть ли замеры? \en Are there any measurements?
|
||||
size_t GetCount() const { return surfDistances.Count(); } ///< \ru Количество замеров. \en The number of measurements.
|
||||
ptrdiff_t GetMaxIndex() const { return surfDistances.MaxIndex(); } ///< \ru Индекс последнего замера. \en Index of the last measurement
|
||||
void Reserve( size_t nReserve ); ///< \ru Зарезервировать память под nReserve элементов. \en Reserve memory for 'nReserve' elements.
|
||||
void RemoveAll( bool bAdjustMemory ); ///< \ru Удалить все элементы \en Delete all elements.
|
||||
void AdjustMemory(); ///< \ru Освободить лишнюю память \en Free the unnecessary memory.
|
||||
|
||||
/// \ru Получить расстояние по индексу. \en Get the distance by the index.
|
||||
bool GetDistance( size_t k, double & d ) const;
|
||||
/// \ru Получить расстояние со знаком, по индексу. \en Get the signed distance by the index.
|
||||
bool GetSignedDistance( size_t k, double & d ) const;
|
||||
/// \ru Считаем ли вы расстояние отрицательным. \en Whether the distance is negative.
|
||||
bool IsNegativeDistance( size_t k ) const { return ((k < surfDistances.Count()) ? surfDistances[k].IsNegative() : false); }
|
||||
/// \ru Получить минимальное расстояние. \en Get minimal distance.
|
||||
bool GetMinDistance( double & d ) const;
|
||||
/// \ru Получить максимальное расстояние. \en Get maximal distance.
|
||||
bool GetMaxDistance( double & d ) const;
|
||||
/// \ru Получить среднее расстояние. \en Get average distance.
|
||||
bool GetMidDistance( double & d ) const;
|
||||
/// \ru Получить расстояние и точки на поверхностях. \en Get distance and points on surface.
|
||||
bool GetSurfDistance( size_t k, double & d, MbCartPoint & uv1, MbCartPoint & uv2 ) const;
|
||||
/// \ru Получить расстояние и точки на поверхностях. \en Get distance and points on surface.
|
||||
bool GetSurfDistance( size_t k, double & d, bool & plus, MbCartPoint & uv1, MbCartPoint & uv2 ) const;
|
||||
/// \ru Добавить расстояние и точки на поверхностях. \en Add distance and points on surface.
|
||||
bool AddSurfDistance( double distance, bool plus, const MbCartPoint & uv1, const MbCartPoint & uv2,
|
||||
bool bAddEqual, double eps = LENGTH_EPSILON );
|
||||
/// \ru Сортировать по возрастанию расстояния. \en Sort by distance in the ascending order.
|
||||
void Sort();
|
||||
/// \ru Убрать объекты с одинаковыми расстояниями. \en Remove objects with similar distances.
|
||||
void RemoveEqualDistances( double eps = LENGTH_EPSILON );
|
||||
|
||||
void operator = ( const MbMinMaxSurfDists & ); ///< \ru Оператор присваивания. \en Assignment operator.
|
||||
|
||||
private:
|
||||
MbMinMaxSurfDists( const MbMinMaxSurfDists & );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru выдать расстояние \en get the distance
|
||||
// ---
|
||||
inline bool MbMinMaxSurfDists::GetDistance( size_t k, double & d ) const
|
||||
{
|
||||
if ( k < surfDistances.Count() ) {
|
||||
d = surfDistances[k].GetDistance();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru выдать расстояние со знаком \en get signed distance
|
||||
// ---
|
||||
inline bool MbMinMaxSurfDists::GetSignedDistance( size_t k, double & d ) const
|
||||
{
|
||||
if ( k < surfDistances.Count() ) {
|
||||
d = surfDistances[k].GetDistance();
|
||||
if ( surfDistances[k].IsNegative() )
|
||||
d = -d;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Экстремальные расстояния между поверхностями.
|
||||
\en Extreme distances between surfaces. \~
|
||||
\details \ru Экстремальные расстояния между поверхностями по сетке на первой поверхности,
|
||||
причем замеры осуществляются в заданном направлении (если есть вектор)
|
||||
или по нормалям к первой поверхности.
|
||||
\en Extreme distances between surfaces by mesh on the first surface,
|
||||
measurements are performed in a given direction (if the vector is set)
|
||||
or by normals of the first surface. \~
|
||||
\param[in] surface1 - \ru Первая поверхность.
|
||||
\en The first surface. \~
|
||||
\param[in] u1cnt - \ru Количество точек по u (первая поверхность).
|
||||
\en The number of points by u (the first surface) \~
|
||||
\param[in] v1cnt - \ru Количество точек по v (первая поверхность).
|
||||
\en The number of points by v (the first surface) \~
|
||||
\param[in] dir - \ru Вектор заданного направления (если нет, то по нормали).
|
||||
\en The vector of direction (if not set then by the normal). \~
|
||||
\param[in] orient - \ru Направление поиска.
|
||||
\en Direction of search. \~
|
||||
\param[in] useEqualDistances - \ru Оставлять равные равные расстояния.
|
||||
\en Whether to use the equal distances. \~
|
||||
\param[in] surface2 - \ru Вторая поверхность.
|
||||
\en The second surface. \~
|
||||
\param[in,out] nMin - \ru Кол-во регистрируемых минимумов.
|
||||
\en The number of registrated minimums. \~
|
||||
\param[in,out] nMax - \ru Кол-во регистрируемых максимумов.
|
||||
\en The number of registrated maximums. \~
|
||||
\param[out] allResults - \ru Все результаты.
|
||||
\en All results. \~
|
||||
\param[out] minResults - \ru Результаты-минимумы.
|
||||
\en Results-minimums. \~
|
||||
\param[out] maxResults - \ru Результаты-максимумы.
|
||||
\en Results-maximums. \~
|
||||
\param[in,out] indicator - \ru Интерфейс-индикатор процесса выполнения.
|
||||
\en Interface-indicator of the execution process. \~
|
||||
\return \ru Возвращает результат замера (получен, не получен или же процесс был прерван).
|
||||
\en Returns the result of measurement (obtained, not obtained, or the process has been aborted). \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeProcessState) MinMaxDistances( const MbSurface & surface1,
|
||||
ptrdiff_t u1cnt,
|
||||
ptrdiff_t v1cnt,
|
||||
const MbVector3D * dir,
|
||||
const MbeSenseValue & orient,
|
||||
bool useEqualDistances,
|
||||
const MbSurface & surface2,
|
||||
ptrdiff_t & nMin,
|
||||
ptrdiff_t & nMax,
|
||||
MbMinMaxSurfDists & allResults,
|
||||
MbMinMaxSurfDists & minResults,
|
||||
MbMinMaxSurfDists & maxResults,
|
||||
IProgressIndicator * indicator = NULL );
|
||||
|
||||
|
||||
#endif // __ALG_DIMENSION_H
|
||||
@@ -0,0 +1,82 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Данные для обеспечения дискретной длины/радиуса/расстояния в процессах пользовательского ввода кривых
|
||||
\en Data for support of discrete length/radius/distance in processes of input of curves by user. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_DISKRETE_LENGTH_DATA_H
|
||||
#define __ALG_DISKRETE_LENGTH_DATA_H
|
||||
|
||||
|
||||
#include <math_define.h>
|
||||
#include <templ_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Данные для обеспечения дискретной длины/радиуса/расстояния.
|
||||
\en Data for support of discrete length/radius/distance. \~
|
||||
\details \ru Данные для обеспечения дискретной длины/радиуса/расстояния в процессах
|
||||
пользовательского ввода кривых.\n
|
||||
Для округления до числа, кратного значению шага курсора:\n
|
||||
Стандартное округление - значение округляется в меньшую сторону, если
|
||||
разница между текущим значением и ближайшим кратным меньше половины шага курсора,
|
||||
в противном случае округление выполняется в большую сторону.
|
||||
\en Data for support of discrete length/radius/distance in processes
|
||||
of input of curves by user.\n
|
||||
For rounding to the multiple of value of the cursor step:\n
|
||||
Standard round-off - the value is rounded down if
|
||||
the difference between the current value and the nearest multiple of the initial value is less than a half of cursor step,
|
||||
the value is rounded up otherwise. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS DiskreteLengthData {
|
||||
private:
|
||||
double factor; ///< \ru Число, которому должна быть кратна корректируемая величина. \en Number, which should be a multiple of the value to be corrected.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
DiskreteLengthData( double fact );
|
||||
|
||||
/// \ru Установить число, которому должна быть кратна корректируемая величина. \en Set the number, which should be a multiple of the value to be corrected.
|
||||
void SetFactor( double fact );
|
||||
/// \ru Скорректировать присланную величину. \en Correct the given value.
|
||||
bool CorrectLength( double & len ) const;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Параметры построения синусоиды.
|
||||
\en Parameters of a sinusoid creation. \~
|
||||
\details \ru Параметры построения синусоиды для объекта "Волнистая линия". \n
|
||||
\en Parameters of sinusoid construction for object "Wavy line". \n \~
|
||||
\ingroup Data_Structures
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS CosinusoidPar {
|
||||
public :
|
||||
static const double maxAmpl; ///< \ru Максимальное значение амплитуды. \en Maximal value of amplitude.
|
||||
static const double minAmpl; ///< \ru Минимальное значение амплитуды. \en Minimal value of amplitude.
|
||||
|
||||
Param<double> m_WaveLineAmpl; ///< \ru Величина амплитуды. \en Amplitude value.
|
||||
Param<bool> m_WaveLineAmplByPercent; ///< \ru Амплитуда задается в процентах от длины волны. \en The amplitude is defined as a percentage of the wave length.
|
||||
double m_WaveLineLen; ///< \ru Величина длины волны. \en Wave length value.
|
||||
size_t m_WaveLineCount; ///< \ru Величина количество полуволн. \en Value of half-waves number.
|
||||
bool m_WaveLineByCount; ///< \ru Построение волнистой линии по количеству волн. \en Construction of wavy line by the number of waves.
|
||||
bool m_WaveLineDir; ///< \ru Направление первой полуволны вверх или вниз. \en Up or down direction of the first half-wave.
|
||||
|
||||
public :
|
||||
CosinusoidPar();
|
||||
CosinusoidPar( const CosinusoidPar & );
|
||||
virtual ~CosinusoidPar();
|
||||
|
||||
void Assign( const CosinusoidPar & );
|
||||
void Read ( reader & );
|
||||
void Write ( writer & ) const;
|
||||
};
|
||||
|
||||
|
||||
#endif // __ALG_DISKRETE_LENGTH_DATA_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,399 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Индикатор прогресса.
|
||||
\en A progress indicator. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __ALG_INDICATOR_H
|
||||
#define __ALG_INDICATOR_H
|
||||
|
||||
|
||||
#include <tool_cstring.h>
|
||||
#include <system_types.h>
|
||||
#include <templ_visitor.h>
|
||||
#include <math_define.h>
|
||||
#include <mb_property_title.h>
|
||||
#include <mb_enum.h>
|
||||
#include <reference_item.h>
|
||||
#include <tool_multithreading.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Данные о строке.
|
||||
\en Data of a string \~
|
||||
\details \ru Данные о строке (абстракция с возможностью посещения).
|
||||
\en Data of a string (an abstraction with a possibility of visit). \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS IStrData {
|
||||
public:
|
||||
IStrData() {} ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
virtual ~IStrData() {} ///< \ru Деструктор. \en Destructor.
|
||||
public:
|
||||
virtual bool Accept( Visitor & ) = 0; ///< \ru Прием посетителя. \en Acceptance of a visitor.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Конкретные данные о строке.
|
||||
\en Specific data of a string \~
|
||||
\details \ru Конкретные данные о строке. \n
|
||||
\en Specific data of a string \n \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
//---
|
||||
template<typename T>
|
||||
class StrData : public IStrData {
|
||||
private:
|
||||
T m_msg; ///< \ru Данные. \en Data.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по данным. \en Constructor by data.
|
||||
StrData( T msg ) : m_msg( msg ) {}
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~StrData() {}
|
||||
|
||||
/// \ru Прием посетителя. \en Acceptance of a visitor.
|
||||
virtual bool Accept( Visitor & visitor )
|
||||
{
|
||||
VisitorImpl<T> * impl = dynamic_cast<VisitorImpl<T> *>(&visitor);
|
||||
if( impl )
|
||||
impl->Visit( m_msg );
|
||||
else
|
||||
C3D_ASSERT_UNCONDITIONAL( false ); // \ru не реализована ф-ия посещения этого типа данных! \en the function of visit for this data type is not implemented!
|
||||
|
||||
return !!impl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Базовый класс для потокобезопасного посетителя, извлекающего строку.
|
||||
\en Base class for thread-safe visitor extracting a string. \~
|
||||
\details \ru Базовый класс для потокобезопасного посетителя, извлекающего строку.
|
||||
Можно использовать как образец при создании потокобезопасных посетителей, работающих с другими данными. \n
|
||||
\en Base class for thread-safe visitor extracting a string.
|
||||
Can be used as a sample when creating thread-safe visitors, working with other data.\n \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
//---
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Базовый класс для потокобезопасного посетителя, извлекающего строку.
|
||||
// \en Base class for thread-safe visitor extracting a string.
|
||||
// ---
|
||||
class BaseStrVisitor : public Visitor, public VisitorImpl<const TCHAR*> {
|
||||
protected:
|
||||
/// \ru Данные посетителя. \en Visitor data.
|
||||
struct BaseAuxiliaryData : public AuxiliaryData
|
||||
{
|
||||
c3d::string_t data;
|
||||
BaseAuxiliaryData() : data() {}
|
||||
};
|
||||
|
||||
///< \ru Менеджер, обеспечивающий потокобезопасный доступ к данным. \en Manager providing thread-safe access to the data.
|
||||
mutable CacheManager<BaseAuxiliaryData> cache;
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
BaseStrVisitor() : cache() {}
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~BaseStrVisitor() {}
|
||||
|
||||
public:
|
||||
|
||||
///< \ru Обработка посещения объекта. \en Processing of the object visit.
|
||||
virtual void Visit( const TCHAR*& str ) {
|
||||
if ( str )
|
||||
cache()->data.assign( str );
|
||||
}
|
||||
|
||||
///< \ru Извлечение строки объекта. \en Extracting a string of the object.
|
||||
virtual const TCHAR* GetString() const {
|
||||
return cache()->data.c_str();
|
||||
}
|
||||
|
||||
///< \ru Доступ к данным объекта. \en Access to the object data.
|
||||
c3d::string_t& Data() {
|
||||
return cache()->data;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#define EMPTY_STR StrData<const TCHAR *>( NULL ) ///< \ru Создание пустой строки \en Creation of an empty string
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Добытчик строки из данных о строке.
|
||||
\en The getter of a string from string data. \~
|
||||
\details \ru Добытчик строки из данных о строке. \n
|
||||
\en The getter of a string from string data. \n \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS IGetMsg {
|
||||
public:
|
||||
IGetMsg() {} ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
virtual ~IGetMsg() {} ///< \ru Деструктор. \en Destructor.
|
||||
public:
|
||||
/// \ru Данные о строке в строку. \en Convert data of a string to string.
|
||||
virtual const TCHAR * Msg( IStrData & msg ) const = 0;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс индикатора прогресса выполнения.
|
||||
\en Interface of the execution progress indicator. \~
|
||||
\details \ru Интерфейс индикатора прогресса выполнения. \n
|
||||
\en Interface of the execution progress indicator. \n \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS IProgressIndicator : public IGetMsg {
|
||||
public:
|
||||
IProgressIndicator() {} ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
virtual ~IProgressIndicator() {} ///< \ru Деструктор. \en Destructor.
|
||||
public:
|
||||
/// \ru Установка диапазона индикации, сброс состояния. \en Setting of an indication range, reset state.
|
||||
virtual bool Initialize( size_t range, size_t delta, IStrData & msg ) = 0;
|
||||
/// \ru Обработать прогресс на n у.е., вернет false - пора останавливаться \en Process the progress by 'n' units, if it returns 'false', then it is time to stop.
|
||||
virtual bool Progress ( size_t n ) = 0;
|
||||
/// \ru Ликвидация ошибок округления дорастим прогресс бар до 100% \en Rounding errors liquidation, increase of a progress bar to 100%
|
||||
virtual void Success () = 0;
|
||||
|
||||
/// \ru Проверка, не пора ли остановиться \en Check whether it is time to stop.
|
||||
virtual bool IsCancel () = 0;
|
||||
/// \ru Скажем, что пора остановиться. \en It is time to stop.
|
||||
virtual void SetCancel ( bool c ) = 0;
|
||||
/// \ru Команда пора остановиться \en Command to stop.
|
||||
virtual void Stop () = 0;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\details \ru Обертка индикатора прогресса выполнения
|
||||
(потокобезопасна при условии, если реализация IProgressIndicator также потокобезопасна). \n
|
||||
\en The wrapper of the execution progress indicator
|
||||
(thread-safe provided that IProgressIndicator implementation is also thread-safe). \n \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS ProgressBarWrapper : public MbRefItem {
|
||||
private:
|
||||
/// \ru Данные индикатора прогресса. \en The progress indicator data.
|
||||
struct ProgressBarWrapperData : public AuxiliaryData
|
||||
{
|
||||
c3d::string_t name; ///< \ru Название процесса. \en A name of a process.
|
||||
size_t range; ///< \ru Диапазон значений. \en A range of values.
|
||||
size_t delta; ///< \ru Минимальное приращение прогресса. \en A minimal increase of a progress.
|
||||
size_t value; ///< \ru Текущий прогресс. \en A current index.
|
||||
bool useParentName; ///< \ru Использовать имя родителя для наследника. \en Whether to use a name of a parent for its successor.
|
||||
|
||||
ProgressBarWrapperData();
|
||||
};
|
||||
|
||||
IProgressIndicator & progBar; ///< \ru Общий индикатор прогресса. \en A common progress indicator.
|
||||
ProgressBarWrapper * parentProgBar; ///< \ru Родительский индикатор прогресса. \en A parent progress indicator.
|
||||
mutable CacheManager<ProgressBarWrapperData> cache; ///< \ru Менеджер, обеспечивающий потокобезопасный доступ к данным. \en Manager providing thread-safe access to the data.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по индикатору прогресса выполнения. \en Constructor by an indicator of execution progress.
|
||||
ProgressBarWrapper( IProgressIndicator & pBar );
|
||||
virtual ~ProgressBarWrapper(); ///< \ru Деструктор. \en Destructor.
|
||||
|
||||
public:
|
||||
|
||||
/// \ru Проверка на остановку процесса. \en Check whether a process stopped.
|
||||
bool IsCancel() { return progBar.IsCancel(); }
|
||||
/// \ru Окончание процесса. \en End the process.
|
||||
void Success() { progBar.Success(); }
|
||||
/// \ru Остановка процесса. \en Stop the process.
|
||||
void Stop() { progBar.Stop(); }
|
||||
/// \ru Восстановление данных процесса. \en Restoring of a process data.
|
||||
bool Reset();
|
||||
/// \ru Установка состояния. \en Set the state.
|
||||
bool Init( size_t range, size_t delta, size_t value, IStrData & msg );
|
||||
/// \ru Установка состояния. \en Set the state.
|
||||
bool Init( size_t range, size_t delta, size_t value );
|
||||
/// \ru Узнать текущее состояние прогресса. \en Get the current state of a progress.
|
||||
size_t GetValue() const { return cache()->value; }
|
||||
/// \ru Задать имя процесса. \en Set the name of a process.
|
||||
bool SetName( IStrData & msg );
|
||||
/// \ru Увеличить прогресс выполнения. \en Increase the execution progress.
|
||||
bool SetProgress( size_t v );
|
||||
/// \ru Создать наследника (если msg нулевой, то используется имя родителя). \en Create a successor (if 'msg' is empty, then the name of a parent is used).
|
||||
ProgressBarWrapper & CreateChildAddRef( IStrData & msg ) const;
|
||||
/// \ru Создать наследника (если msg нулевой, то используется имя родителя). \en Create a successor (if 'msg' is empty, then the name of a parent is used).
|
||||
ProgressBarWrapper & CreateChild( IStrData & msg ) const;
|
||||
/// \ru Использовать базовое имя при создании наследника. \en Use a base name while creating a successor.
|
||||
void UseParentName( bool s ) { cache()->useParentName = s; }
|
||||
/// \ru Используется ли базовое имя. \en Whether a base name is used.
|
||||
bool IsParentNameUsed() const { return cache()->useParentName; }
|
||||
/// \ru Получить родительский индикатор прогресса. \en Get parent progress indicator.
|
||||
ProgressBarWrapper * GetParent() { return parentProgBar; }
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( ProgressBarWrapper )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать индикатор прогресса.
|
||||
\en < Create a progress indicator. \~
|
||||
\param[in] progInd - \ru Интерфейс индикатора прогресса выполнения.
|
||||
\en Interface of the execution progress indicator. \~
|
||||
\param[in] msg - \ru Данные о строке.
|
||||
\en Data of a string \~
|
||||
\return \ru Обертку индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ProgressBarWrapper *) CreateProgressBarAddRef( IProgressIndicator * progInd, IStrData & msg );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать индикатор прогресса.
|
||||
\en < Create a progress indicator. \~
|
||||
\param[in] progInd - \ru Интерфейс индикатора прогресса выполнения.
|
||||
\en Interface of the execution progress indicator. \~
|
||||
\param[in] msg - \ru Данные о строке.
|
||||
\en Data of a string \~
|
||||
\return \ru Обертку индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ProgressBarWrapper *) CreateProgressBar( IProgressIndicator * progInd, IStrData & msg );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Установить имя прогресса.
|
||||
\en Set the progress name. \~
|
||||
\param[in] progBar - \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\param[in] msg - \ru Данные о строке.
|
||||
\en Data of a string \~
|
||||
\return \ru true, если progBar != NULL и удалось задать имя процесса.
|
||||
\en true if 'progBar' is not null and the process name is successfully set. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
inline bool SetProgressBarName( ProgressBarWrapper * progBar, IStrData & msg )
|
||||
{
|
||||
if ( progBar != NULL )
|
||||
return progBar->SetName( msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Установить значение прогресса.
|
||||
\en Set the value of a progress. \~
|
||||
\details \ru Установить значение прогресса.
|
||||
\en Set the value of a progress. \~
|
||||
\param[in] progBar - \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\param[in] v - \ru Значение прогресса.
|
||||
\en The value of a progress. \~
|
||||
\return \ru true, в случае успешного выполнение операции.
|
||||
\en true if the operation is successful. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
inline bool SetProgressBarValue( ProgressBarWrapper * progBar, size_t v )
|
||||
{
|
||||
if ( progBar != NULL && !progBar->IsCancel() )
|
||||
return progBar->SetProgress( v );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Завершить индикатор прогресса.
|
||||
\en End the progress indicator. \~
|
||||
\details \ru Либо индикатор останавливается, либо, если он уже дошел до 100%, выдается
|
||||
сообщение об этом.
|
||||
\en Either the indicator stops or, if it already has reached 100%, then
|
||||
the corresponding message appears. \~
|
||||
\param[in] progBar - \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
inline void FinishProgressBar( ProgressBarWrapper * progBar )
|
||||
{
|
||||
if ( progBar != NULL ) {
|
||||
if ( progBar->IsCancel() ) progBar->Stop();
|
||||
else progBar->Success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить индикатор прогресса.
|
||||
\en Delete the progress indicator. \~
|
||||
\param[in] progBar - \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution prorgress indicator. \~
|
||||
\return \ru true, в случае успешного выполнение операции.
|
||||
\en true if the operation is successful. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
inline bool StopProgressBar( ProgressBarWrapper * progBar )
|
||||
{
|
||||
if ( progBar != NULL && progBar->IsCancel() ) {
|
||||
progBar->Stop();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Использовать имя родителя для наследника.
|
||||
\en Whether to use the name of a parent for its successor. \~
|
||||
\param[in] progBar - \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\param[in] useParentName - \ru Флаг использования имени родителя.
|
||||
\en The flag of using the parent name. \~
|
||||
\return \ru true, если progBar != NULL.
|
||||
\en true if 'progBar' is not null. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
inline bool UseParentName( ProgressBarWrapper * progBar, bool useParentName )
|
||||
{
|
||||
if ( progBar != NULL ) {
|
||||
progBar->UseParentName( useParentName );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Используется ли имя родителя для наследника.
|
||||
\en Whether the name of a parent is used for its successor. \~
|
||||
\param[in] progBar - \ru Обертка индикатора прогресса выполнения.
|
||||
\en The wrapper of the execution progress indicator. \~
|
||||
\return \ru true, если используется.
|
||||
\en true if it is used. \~
|
||||
\ingroup Base_Items
|
||||
*/
|
||||
// ---
|
||||
inline bool IsParentNameUsed( const ProgressBarWrapper * progBar )
|
||||
{
|
||||
if ( progBar != NULL )
|
||||
return progBar->IsParentNameUsed();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endif // __ALG_INDICATOR_H
|
||||
@@ -0,0 +1,165 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Определение расстояния между объектами.
|
||||
\en Definition of distance between objects. \~
|
||||
\details \ru Функции определения максимальных расстояний между различными
|
||||
трехмерными объектами.
|
||||
\en Functions for definition of maximal distances between different
|
||||
three-dimensional objects. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __ALG_MAX_DISTANCE_H
|
||||
#define __ALG_MAX_DISTANCE_H
|
||||
|
||||
|
||||
#include <math_define.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCartPoint;
|
||||
class MATH_CLASS MbCartPoint3D;
|
||||
class MATH_CLASS MbAxis3D;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти максимальное расстояние между точкой и кривой.
|
||||
\en Find the maximal distance between a point and a curve. \~
|
||||
\details \ru Максимальное расстояние между точкой и кривой.
|
||||
\en The maximal distance between a point and a curve. \~
|
||||
\param[in] pnt - \ru Исходная точка.
|
||||
\en The initial point. \~
|
||||
\param[in] curv - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[out] t - \ru Параметр на кривой, при котором достигается искомое расстояние.
|
||||
\en The parameter on a curve where the required distance is reached. \~
|
||||
\param[out] distance - \ru Искомое расстояние.
|
||||
\en The required distance. \~
|
||||
\return \ru true, если максимальное расстояние было найдено.
|
||||
\en true if the maximal distance has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) MaxDistance( const MbCartPoint3D & pnt, const MbCurve3D & curv,
|
||||
double & t,
|
||||
double & distance );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти максимальное расстояние между двумя кривыми.
|
||||
\en Find the maximal distance between two curves. \~
|
||||
\details \ru Найти максимальное расстояние между двумя кривыми.
|
||||
\en Find the maximal distance between two curves. \~
|
||||
\param[in] curv1, curv2 - \ru Исходные кривая.
|
||||
\en The initial curves. \~
|
||||
\param[out] t1, t2 - \ru Параметры на кривых, при которых достигается искомое расстояние.
|
||||
\en The parameters on curves where the required distance is reached. \~
|
||||
\param[out] distance - \ru Искомое расстояние.
|
||||
\en The required distance. \~
|
||||
\return \ru true, если максимальное расстояние было найдено.
|
||||
\en true if the maximal distance has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) MaxDistance( const MbCurve3D & curv1, const MbCurve3D & curv2,
|
||||
double & t1, double & t2,
|
||||
double & distance );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти максимальное расстояние между точкой и поверхностью.
|
||||
\en Find the maximal distance between a point and a surface. \~
|
||||
\details \ru Найти максимальное расстояние между точкой и поверхностью.
|
||||
\en Find the maximal distance between a point and a surface. \~
|
||||
\param[in] pnt - \ru Исходная точка.
|
||||
\en The initial point. \~
|
||||
\param[in] surf - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[out] uv - \ru Параметры точки на поверхности, при которой достигается искомое расстояние.
|
||||
\en The point parameters on a surface where the required distance is reached. \~
|
||||
\param[out] distance - \ru Искомое расстояние.
|
||||
\en The required distance. \~
|
||||
\return \ru true, если максимальное расстояние было найдено.
|
||||
\en true if the maximal distance has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) MaxDistance( const MbCartPoint3D & pnt, const MbSurface & surf,
|
||||
MbCartPoint & uv,
|
||||
double & distance );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти максимальное расстояние между кривой и поверхностью.
|
||||
\en Find the maximal distance between a curve and a surface. \~
|
||||
\details \ru Найти максимальное расстояние между кривой и поверхностью.
|
||||
\en Find the maximal distance between a curve and a surface. \~
|
||||
\param[in] curv - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] surf - \ru Исходная поверхность.
|
||||
\en The initial surface. \~
|
||||
\param[out] t - \ru Параметр на кривой, при котором достигается искомое расстояние.
|
||||
\en The parameter on a curve where the required distance is reached. \~
|
||||
\param[out] uv - \ru Параметры точки на поверхности, при которой достигается искомое расстояние.
|
||||
\en The point parameters on a surface where the required distance is reached. \~
|
||||
\param[out] distance - \ru Искомое расстояние.
|
||||
\en The required distance. \~
|
||||
\return \ru true, если максимальное расстояние было найдено.
|
||||
\en true if the maximal distance has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) MaxDistance( const MbCurve3D & curv, const MbSurface & surf,
|
||||
double & t, MbCartPoint & uv,
|
||||
double & distance );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти максимальное расстояние между поверхностями.
|
||||
\en Find the maximal distance between two surfaces. \~
|
||||
\details \ru Найти максимальное расстояние между поверхностями.
|
||||
\en Find the maximal distance between two surfaces. \~
|
||||
\param[in] surf1, surf2 - \ru Исходные поверхности.
|
||||
\en The initial surfaces. \~
|
||||
\param[out] uv1, uv2 - \ru Параметры точек на поверхностях, при которых достигается искомое расстояние.
|
||||
\en The parameters on surfaces where the required distance is reached. \~
|
||||
\param[out] distance - \ru Искомое расстояние.
|
||||
\en The required distance. \~
|
||||
\return \ru true, если максимальное расстояние было найдено.
|
||||
\en true if the maximal distance has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) MaxDistance( const MbSurface & surf1, const MbSurface & surf2,
|
||||
MbCartPoint & uv1, MbCartPoint & uv2,
|
||||
double & distance );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти максимальное расстояние от оси до кривой.
|
||||
\en Find the maximal distance between an axis an a curve. \~
|
||||
\details \ru Ищется максимальное расстояние от оси до кривой перпендикулярно оси.
|
||||
\en Find the maximal distance between an axis and a curve perpendicularly to an axis. \~
|
||||
\param[in] axis - \ru Исходная ось.
|
||||
\en The initial axis. \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[out] param - \ru Параметр на кривой, при котором достигается искомое расстояние.
|
||||
\en The parameter on a curve where the required distance is reached. \~
|
||||
\param[out] distance - \ru Искомое расстояние.
|
||||
\en The required distance. \~
|
||||
\return \ru true, если максимальное расстояние было найдено.
|
||||
\en true if the maximal distance has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) MaxDistance( const MbAxis3D & axis, const MbCurve3D & curve,
|
||||
double & param,
|
||||
double & distance );
|
||||
|
||||
|
||||
#endif // __ALG_MAX_DISTANCE_H
|
||||
@@ -0,0 +1,96 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief Функции преобразования полигональной модели в граничное представление.
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_MESH_TO_BREP_H
|
||||
#define __ALG_MESH_TO_BREP_H
|
||||
|
||||
#include <math_define.h>
|
||||
#include <mb_variables.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <templ_sptr.h>
|
||||
#include <topology.h>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
|
||||
class MATH_CLASS MbCartPoint3D;
|
||||
class MATH_CLASS MbVector3D;
|
||||
class MATH_CLASS MbFaceShell;
|
||||
class MATH_CLASS MbMesh;
|
||||
class MATH_CLASS MbGrid;
|
||||
class MATH_CLASS MbCollection;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbTriangle;
|
||||
class MATH_CLASS IProgressIndicator;
|
||||
class MATH_CLASS ProgressBarWrapper;
|
||||
struct MATH_CLASS GridsToShellValues;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Удалить дублирующие с заданной точностью друг друга точки.
|
||||
// ---
|
||||
bool RemoveRedundantPoints( std::vector<MbCartPoint3D> & points,
|
||||
std::vector<MbTriangle> & triangles,
|
||||
double epsilon,
|
||||
ProgressBarWrapper * baseProgBar );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Удалить дублирующие с заданной точностью друг друга точки.
|
||||
// ---
|
||||
bool RemoveRedundantPoints( std::vector< std::pair<MbCartPoint3D,MbVector3D> > & pointNormals,
|
||||
std::vector<MbTriangle> & triangles,
|
||||
double epsilon,
|
||||
ProgressBarWrapper * baseProgBar );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Удалить дублирующие с заданной точностью друг друга точки.
|
||||
// ---
|
||||
bool RemoveRedundantPoints( std::vector<MbCartPoint3D> & points,
|
||||
std::vector<uint> & indexes,
|
||||
double epsilon );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Объединить ребра двух смежных плоских граней с полигональной границей
|
||||
// (возвращает общее после сшивки ребро)
|
||||
// ---
|
||||
MbCurveEdge * StitchAdjacentGridsEdges( MbFace & face1, MbOrientedEdge & edge1,
|
||||
MbFace & face2, MbLoop & loop2, size_t e2Ind );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Обеспечить связность треугольных граней
|
||||
// ---
|
||||
bool ConnectTriangleFaces( const c3d::FacesSPtrVector & faces,
|
||||
const std::vector< std::pair<c3d::IndicesPair,c3d::IndicesPair> > & edgesPairs,
|
||||
std::vector< std::pair<c3d::IndicesPair,c3d::IndicesPair> > * combinedPairs,
|
||||
ProgressBarWrapper * baseProgBar );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Преобразовать триангуляцию в оболочку.
|
||||
// ---
|
||||
MbFaceShell * ConvertGridToShell( const MbGrid & grid, const GridsToShellValues & params, const MbSNameMaker & snMaker,
|
||||
MbResultType & res, IProgressIndicator * progBar = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Преобразовать полигональную модель в оболочку.
|
||||
// ---
|
||||
MbFaceShell * ConvertMeshToShell( const MbMesh & mesh, const GridsToShellValues & params, const MbSNameMaker & snMaker,
|
||||
MbResultType & res, IProgressIndicator * progBar = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Преобразовать триангуляцию в оболочку.
|
||||
// ---
|
||||
MbFaceShell * ConvertCollectionToShell( const MbCollection & grid,
|
||||
bool mergeFaces,
|
||||
const MbSNameMaker & snMaker,
|
||||
MbResultType & res,
|
||||
IProgressIndicator * progIndicator );
|
||||
|
||||
|
||||
#endif // __ALG_UTILITES_H
|
||||
@@ -0,0 +1,377 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение конических сечений в виде NURBS-кривой.
|
||||
\en Construction of conic sections as NURBS curves. \~
|
||||
\details \ru Построение конических сечений производится следующими способами:
|
||||
по двум точкам, вершине и дискриминанту, по трем точкам и вершине,
|
||||
по трем точкам и двум наклонам, по двум точкам, двум наклонам и дискриминанту,
|
||||
по четырем точкам и наклону и по пяти точкам. \n
|
||||
NURBS кривая, описывающая конику, строится по трем точкам: началу и концу коники и
|
||||
средней точке (вершине угола, в который надо вписать конику).
|
||||
Принимая весы начальной и конечной точки равными 1 и рассчитывая вес средней точки,
|
||||
по трем точкам и трем весам строится NURBS 3-го порядка, который будет искомой коникой.
|
||||
\en Construction of conic sections is performed in the following way:
|
||||
by two points, a vertex and a discriminant, by three points and a vertex,
|
||||
by three points and two inclinations, by two points, two inclinations and discriminant,
|
||||
by four points and inclination and by five points. \n
|
||||
A NURBS curve describing a conic is constructed by three points: a start and an end of a conic and
|
||||
an average point (a vertex of angle which should be inscribed into the conic).
|
||||
Let weights of the start point and the end point be equal to 1. After calculating of the weight of the average point
|
||||
NURBS of third degree is constructed by these three weights. This NURBS is the required conic. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __ALG_NURBS_CONIC_H
|
||||
#define __ALG_NURBS_CONIC_H
|
||||
|
||||
|
||||
#include <alg_curve_distance.h>
|
||||
|
||||
|
||||
class MbCurve3D;
|
||||
class MbNurbs3D;
|
||||
class MbCartPoint3D;
|
||||
class MbVector3D;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по двум точкам вершине и дискриминанту.
|
||||
\en Construct a conic section by two points, an angle vertex and a discriminant. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
двум точкам, которые задают начало и конец кривой, вершине инженерного
|
||||
треугольника и дискриминанту, который используется для определения третьей точки кривой.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
two points setting ends of a curve, a vertex of enginer
|
||||
triangle and a discriminant which is used for the definition of the third point. \~
|
||||
\param[in] mbPoint0 - \ru Координаты начала коники.
|
||||
\en Coordinates of the conic start point. \~
|
||||
\param[in] mbPoint1 - \ru Координаты вершины угла, в который надо вписать конику.
|
||||
\en Coordinates of the vertex of angle which should be inscribed into the conic. \~
|
||||
\param[in] mbPoint2 - \ru Координаты конца коники.
|
||||
\en Coordinates of the conic end point. \~
|
||||
\param[in] fDiscr - \ru Дискриминант < 1, если задать дискриминант >= 1, то он
|
||||
автоматически будет сброшен до значения 0.99999999.
|
||||
\en The discriminant is less than 1. Otherwise it
|
||||
will be set to 0.99999999 automatically. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось построить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for a given parameters has failed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve3D * ) NurbsConic_1( const MbCartPoint3D & mbPoint0, const MbCartPoint3D & mbPoint1,
|
||||
const MbCartPoint3D & mbPoint2, double fDiscr );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по двум точкам вершине и дискриминанту.
|
||||
\en Construct a conic section by two points, an angle vertex and a discriminant. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
двум точкам, которые задают начало и конец кривой, вершине инженерного
|
||||
треугольника и дискриминанту, который используется для определения третьей точки кривой.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
two points setting ends of a curve, a vertex of enginer
|
||||
triangle and a discriminant which is used for the definition of the third point. \~
|
||||
\param[in] mbPoint0 - \ru Координаты начала коники.
|
||||
\en Coordinates of the conic start point. \~
|
||||
\param[in] mbPoint1 - \ru Координаты вершины угла, в который надо вписать конику.
|
||||
\en Coordinates of the vertex of angle which should be inscribed into the conic. \~
|
||||
\param[in] mbPoint2 - \ru Координаты конца коники.
|
||||
\en Coordinates of the conic end point. \~
|
||||
\param[in] fDiscr - \ru Дискриминант < 1, если задать дискриминант >= 1, то он
|
||||
автоматически будет сброшен до значения 0.99999999.
|
||||
\en The discriminant is less than 1. Otherwise it
|
||||
will be set to 0.99999999 automatically. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось построить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for a given parameters has failed. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve * ) NurbsConic_1( const MbCartPoint & mbPoint0, const MbCartPoint & mbPoint1,
|
||||
const MbCartPoint & mbPoint2, double fDiscr );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по трем точкам и вершине.
|
||||
\en Construct a conic section by three points, and an angle vertex. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
трем точкам: началу, концу и средней точке кривой, а также вершине угла, в который
|
||||
должна быть вписана коника.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
three points: ends of a curve, its average point and by a vertex of an angle,
|
||||
a conic should be inscribed in. \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: начало, средняя точка, конец;
|
||||
точек должно быть 3.
|
||||
\en The container for points of a conic: start point, average point and end point;
|
||||
there should be exactly 3 points. \~
|
||||
\param[in] mbVertex - \ru Координаты вершины угла, в который надо вписать конику.
|
||||
\en Coordinates of the vertex of angle which should be inscribed into the conic. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve3D * ) NurbsConic_2( std::vector<MbCartPoint3D> & vmbConicPoints, const MbCartPoint3D & mbVertex );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по трем точкам и вершине.
|
||||
\en Construct a conic section by three points, and an angle vertex. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
трем точкам: началу, концу и средней точке кривой, а также вершине угла, в который
|
||||
должна быть вписана коника.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
three points: ends of a curve, its average point and by a vertex of an angle,
|
||||
a conic should be inscribed in. \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: начало, средняя точка, конец;
|
||||
точек должно быть 3.
|
||||
\en The container for points of a conic: start point, average point and end point;
|
||||
there should be exactly 3 points. \~
|
||||
\param[in] mbVertex - \ru Координаты вершины угла, в который надо вписать конику.
|
||||
\en Coordinates of the vertex of angle which should be inscribed into the conic. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve * ) NurbsConic_2( std::vector<MbCartPoint> & vmbConicPoints, const MbCartPoint & mbVertex );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по трем точкам и двум наклонам.
|
||||
\en Construct a conic section by three points and two inclinations. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
3-ем точкам, которые задают начало, конец и среднюю точку кривой и двум
|
||||
наклонам, выходящим из начальной и конечной точек.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
3 points setting begin, end and an average point of a curve and two
|
||||
inclinations outgoing from the start point and from the end point \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: начало, средняя точка, конец;
|
||||
точек должно быть 3.
|
||||
\en The container for points of a conic: start point, average point and end point;
|
||||
there should be exactly 3 points. \~
|
||||
\param[in] mbTangent1 - \ru Наклон в начале кривой.
|
||||
\en Inclination at start of a curve. \~
|
||||
\param[in] mbTangent2 - \ru Наклон в конце кривой.
|
||||
\en Inclination at end of a curve. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve3D * ) NurbsConic_3( const std::vector<MbCartPoint3D> & vmbConicPoints,
|
||||
MbVector3D & mbTangent1, MbVector3D & mbTangent2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по трем точкам и двум наклонам.
|
||||
\en Construct a conic section by three points and two inclinations. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
3-ем точкам, которые задают начало, конец и среднюю точку кривой и двум
|
||||
наклонам, выходящим из начальной и конечной точек.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
3 points setting begin, end and an average point of a curve and two
|
||||
inclinations outgoing from the start point and from the end point \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: начало, средняя точка, конец;
|
||||
точек должно быть 3.
|
||||
\en The container for points of a conic: start point, average point and end point;
|
||||
there should be exactly 3 points. \~
|
||||
\param[in] mbTangent1 - \ru Наклон в начале кривой.
|
||||
\en Inclination at start of a curve. \~
|
||||
\param[in] mbTangent2 - \ru Наклон в конце кривой.
|
||||
\en Inclination at end of a curve. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve * ) NurbsConic_3( const std::vector<MbCartPoint> & vmbConicPoints, MbVector & mbTangent1, MbVector & mbTangent2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по двум точкам, двум наклонам и дискриминанту.
|
||||
\en Construct a conic section by two points, two inclinations and a discriminant. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
2-ум точкам, которые задают начало и конец кривой, двум наклонам, выходящим из этих точек
|
||||
и дискриминанту.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
2 points setting start and end of a curve, two incllinations outgoing from these points
|
||||
and a discriminant. \~
|
||||
\param[in] mbPoint1 - \ru Координаты начала коники.
|
||||
\en Coordinates of the conic start point. \~
|
||||
\param[in] mbPoint2 - \ru Координаты конца коники.
|
||||
\en Coordinates of the conic end point. \~
|
||||
\param[in] mbTangent1 - \ru Наклон в начале коники.
|
||||
\en Inclination at start of conic. \~
|
||||
\param[in] mbTangent2 - \ru Наклон в конце коники.
|
||||
\en Inclination at end of conic. \~
|
||||
\param[in] fDiscr - \ru Дискриминант < 1, если задать дискриминант >= 1, то он
|
||||
автоматически будет сброшен до значения 0.99999999.
|
||||
\en The discriminant is less than 1. Otherwise it
|
||||
will be set to 0.99999999 automatically. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось построить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve3D * ) NurbsConic_4( const MbCartPoint3D & mbPoint1, const MbCartPoint3D & mbPoint2,
|
||||
const MbVector3D & mbTangent1, const MbVector3D & mbTangent2, double fDiscr );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по двум точкам, двум наклонам и дискриминанту.
|
||||
\en Construct a conic section by two points, two inclinations and a discriminant. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
2-ум точкам, которые задают начало и конец кривой, двум наклонам, выходящим из этих точек
|
||||
и дискриминанту.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
2 points setting start and end of a curve, two incllinations outgoing from these points
|
||||
and a discriminant. \~
|
||||
\param[in] mbPoint1 - \ru Координаты начала коники.
|
||||
\en Coordinates of the conic start point. \~
|
||||
\param[in] mbPoint2 - \ru Координаты конца коники.
|
||||
\en Coordinates of the conic end point. \~
|
||||
\param[in] mbTangent1 - \ru Наклон в начале коники.
|
||||
\en Inclination at start of conic. \~
|
||||
\param[in] mbTangent2 - \ru Наклон в конце коники.
|
||||
\en Inclination at end of conic. \~
|
||||
\param[in] fDiscr - \ru Дискриминант < 1, если задать дискриминант >= 1, то он
|
||||
автоматически будет сброшен до значения 0.99999999.
|
||||
\en The discriminant is less than 1. Otherwise it
|
||||
will be set to 0.99999999 automatically. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось построить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve * ) NurbsConic_4( const MbCartPoint & mbPoint1, const MbCartPoint & mbPoint2,
|
||||
const MbVector & mbTangent1, const MbVector & mbTangent2, double fDiscr );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по четырем точкам и наклону.
|
||||
\en Construct a conic section by four points, and an inclination. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
4-ем точкам и наклону в первой из них. \n
|
||||
Путем подставления начальных точек в общее уравнение коники Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0
|
||||
и касательной к ней в начальной точке (x1, y1): (2Ax1 + By1 + D)(x - x1) + (2Cy1 + Bx1 + E)(y - y1) = 0
|
||||
получим СЛАУ. Решив СЛАУ относительно параметров A,B,C,D,E, найдем искомую конику.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
4 points and inclination in the first of them. \n
|
||||
By substituting of start points in the common equation of the conic Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0
|
||||
and its tangent at the start point (x1, y1): (2Ax1 + By1 + D)(x - x1) + (2Cy1 + Bx1 + E)(y - y1) = 0
|
||||
we get the SLAE. Having SLAE solved relative to parameters A,B,C,D,E we find the required conic. \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: первая точка начальная, последняя - конечная;
|
||||
точек должно быть 4.
|
||||
\en The container for points of a conic: the first point is start point, the last point is end point.
|
||||
there should be exactly 4 points. \~
|
||||
\param[in] mbTangent1 - \ru Наклон в точке коники.
|
||||
\en Inclination at point of conic. \~
|
||||
\param[in] tanPntNb - \ru Номер точке, в которой задан наклон.
|
||||
\en Point number at which the inclination is specified. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve3D * ) NurbsConic_5( const std::vector<MbCartPoint3D> & vmbConicPoints, MbVector3D & mbTangent1, size_t tanPntNb = 1 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по четырем точкам и наклону.
|
||||
\en Construct a conic section by four points, and an inclination. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по
|
||||
4-ем точкам и наклону в первой из них. \n
|
||||
Путем подставления начальных точек в общее уравнение коники Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0
|
||||
и касательной к ней в начальной точке (x1, y1): (2Ax1 + By1 + D)(x - x1) + (2Cy1 + Bx1 + E)(y - y1) = 0
|
||||
получим СЛАУ. Решив СЛАУ относительно параметров A,B,C,D,E, найдем искомую конику.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by
|
||||
4 points and inclination in the first of them. \n
|
||||
By substituting of start points in the common equation of the conic Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0
|
||||
and its tangent at the start point (x1, y1): (2Ax1 + By1 + D)(x - x1) + (2Cy1 + Bx1 + E)(y - y1) = 0
|
||||
we get the SLAE. Having SLAE solved relative to parameters A,B,C,D,E we find the required conic. \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: первая точка начальная, последняя - конечная;
|
||||
точек должно быть 4.
|
||||
\en The container for points of a conic: the first point is start point, the last point is end point.
|
||||
there should be exactly 4 points. \~
|
||||
\param[in] mbTangent1 - \ru Наклон в точке коники.
|
||||
\en Inclination at point of conic. \~
|
||||
\param[in] tanPntNb - \ru Номер точке, в которой задан наклон.
|
||||
\en Point number at which the inclination is specified. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve * ) NurbsConic_5( const std::vector<MbCartPoint> & vmbConicPoints, MbVector & mbTangent1, size_t tanPntNb = 1 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по пяти точкам.
|
||||
\en Construct a conic section by five points. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по 5-ти точкам.\n
|
||||
Путем подставления начальных точек в общее уравнение коники Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 получим СЛАУ.
|
||||
Решив СЛАУ относительно параметров A,B,C,D,E, найдем искомую конику.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by 5 points.\n
|
||||
By substituting of start points in the common equation of the conic Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 we get the SLAE.
|
||||
Having SLAE solved relative to parameters A,B,C,D,E we find the required conic. \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: первая точка начальная, последняя - конечная;
|
||||
точек должно быть 5.
|
||||
\en The container for points of a conic: the first point is start point, the last point is end point.
|
||||
there should be exactly 5 points. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve3D * ) NurbsConic_6( const std::vector<MbCartPoint3D> & vmbConicPoints );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить коническое сечение по пяти точкам.
|
||||
\en Construct a conic section by five points. \~
|
||||
\details \ru Построение конического сечения в виде NURBS-кривой 3-го порядка по 5-ти точкам.\n
|
||||
Путем подставления начальных точек в общее уравнение коники Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 получим СЛАУ.
|
||||
Решив СЛАУ относительно параметров A,B,C,D,E, найдем искомую конику.
|
||||
\en Construction of a conic section as a NURBS curve of the third degree by 5 points.\n
|
||||
By substituting of start points in the common equation of the conic Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 we get the SLAE.
|
||||
Having SLAE solved relative to parameters A,B,C,D,E we find the required conic. \~
|
||||
\param[in] vmbConicPoints - \ru Контейнер точек коники: первая точка начальная, последняя - конечная;
|
||||
точек должно быть 5.
|
||||
\en The container for points of a conic: the first point is start point, the last point is end point.
|
||||
there should be exactly 5 points. \~
|
||||
\return \ru Указатель на построенную кривую \n
|
||||
NULL, если не удалось постороить конику для заданных параметров.
|
||||
\en The pointer to the constructed curve \n
|
||||
is NULL if a try to construct a conic for given parameters has failed. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( MbCurve * ) NurbsConic_6( const std::vector<MbCartPoint> & vmbConicPoints );
|
||||
|
||||
|
||||
#endif // __ALG_NURBS_CONIC_H
|
||||
@@ -0,0 +1,361 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Функции создания кривых для внешнего использования.
|
||||
\en Functions to create curves for external use. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __ALG_POLYLINE_H
|
||||
#define __ALG_POLYLINE_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <mb_cart_point.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <mb_enum.h>
|
||||
#include <mb_rect1d.h>
|
||||
#include <plane_item.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbVector;
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbCartPoint;
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbBezier;
|
||||
class MATH_CLASS MbNurbs;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbMatrix3D;
|
||||
class MATH_CLASS MbNurbs3D;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbContour3D;
|
||||
class MATH_CLASS MbCubicSpline3D;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
/** \brief \ru Параметры точки для создания полилинии.
|
||||
\en Point parameters for creation of a polyline. \~
|
||||
\details \ru Часть точек может быть удалена при построении, поэтому вводится старый индекс,
|
||||
который заполняется и используется в модели. Параметрами точки являются координаты точки и
|
||||
радиус скругления в этой точке. При создании заполняются поля m_lineSeg и m_arcSeg.
|
||||
m_lineSeg - это прямолинейный сегмент из этой точки в следующую. Для последней точки
|
||||
и замкнутой ломаной - из последней в первую. m_arcSeg - дуга скругления в данной точке.
|
||||
Если какой-то сегмент был полностью удален или не создан, то его указатель должен быть NULL.
|
||||
Объектами m_lineSeg и m_arcSeg не владеет, поэтому и не удаляет их. Объекты из полилинии.
|
||||
\en Some points may be deleted while the construction, therefore the old index is entered,
|
||||
it is filled and used in a model. Parameters of a point are its coordinates and
|
||||
fillet radius in this point. In a time of creation the fields 'm_lineSeg' and 'm_lineSeg' are being filled.
|
||||
'm_lineSeg' is the straight-line segment from this point to the next point. For the last point
|
||||
and a closed polyline - from the last point to the first point. 'm_arcSeg'is the arc of a fillet in the given point.
|
||||
If a segment has been fully deleted or it was not created then the pointer should be NULL.
|
||||
Object 'm_lineSeg' and 'm_arcSeg' are not owned, therefore they are not deleted. Objects from a polyline. \~
|
||||
\ingroup Data_Structures
|
||||
*/
|
||||
// ---
|
||||
struct MATH_CLASS Polyline3DPoint {
|
||||
public:
|
||||
size_t m_oldIndex; ///< \ru Исходный индекс в модели. \en The initial index of a model.
|
||||
MbCartPoint3D m_point; ///< \ru Координаты вершины ломаной. \en The coordinates of a polyline vertex.
|
||||
double m_radius; ///< \ru Радиус скругления в вершине. \en The fillet radius in a vertex.
|
||||
const MbCurve3D * m_lineSeg; ///< \ru Прямолинейный сегмент из этой вершины в следующую. \en The straight-line segment from this vertex to the next.
|
||||
const MbCurve3D * m_arcSeg; ///< \ru Дуга скругления в этой вершине (если m_radius > 0). \en the arc of a fillet in this vertex (if 'm_radius' > 0)
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по умолчанию. \en Default constructor.
|
||||
Polyline3DPoint()
|
||||
: m_oldIndex( SYS_MAX_T )
|
||||
, m_point ()
|
||||
, m_radius ( 0.0 )
|
||||
, m_lineSeg ( NULL )
|
||||
, m_arcSeg ( NULL )
|
||||
{}
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
Polyline3DPoint( const Polyline3DPoint & other )
|
||||
: m_oldIndex( other.m_oldIndex )
|
||||
, m_point ( other.m_point )
|
||||
, m_radius ( other.m_radius )
|
||||
, m_lineSeg ( other.m_lineSeg )
|
||||
, m_arcSeg ( other.m_arcSeg )
|
||||
{}
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~Polyline3DPoint()
|
||||
{}
|
||||
public:
|
||||
/// \ru Оператор присваивания. \en Assignment operator.
|
||||
void operator = ( const Polyline3DPoint & other ) {
|
||||
m_oldIndex = other.m_oldIndex;
|
||||
m_point = other.m_point;
|
||||
m_radius = other.m_radius;
|
||||
m_lineSeg = other.m_lineSeg;
|
||||
m_arcSeg = other.m_arcSeg;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить контур из отрезков по заданным точкам.
|
||||
\en Construct a contour from segments by given points. \~
|
||||
\details \ru Вершины сочленения скругляются. Каждой вершине соответствует радиус скругления. \n
|
||||
Eсли две вершины совпадают, то одна из них и соответствующий ей радиус удаляются.
|
||||
\en Vertices of joint are rounded. Some fillet radius corresponds to every vertex. \n
|
||||
If two vertices are coincident then one of them and the corresponding radius are deleted. \~
|
||||
\param[out] contour - \ru Контур.
|
||||
\en The countour. \~
|
||||
\param[in] closed - \ru Флаг замкнутости контура.
|
||||
\en Whether the contour is closed. \~
|
||||
\param[in] initList - \ru Множество точек полилинии.
|
||||
\en The array of points of a polyline. \~
|
||||
\param[out] errorIndexes - \ru Множество индексов сегментов, сочленение которых со следующим прошло с ошибками.
|
||||
\en The array of segments indices, each of which has been jointed with the next one with errors. \~
|
||||
\param[in] lengthEpsilon - \ru Погрешность построения элементов полилинии.
|
||||
\en The tolerance of polyline elements construction. \~
|
||||
\return \ru true, если сегментов больше нуля.
|
||||
\en true if the number of segments is greater than zero. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) InitContour3D( MbContour3D & contour, bool closed,
|
||||
SArray<Polyline3DPoint> & initList,
|
||||
SArray<ptrdiff_t> & errorIndexes,
|
||||
double lengthEpsilon = Math::lengthEpsilon );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вычислить погрешность точки на кривой.
|
||||
\en Calculate the tolerance of a point on a curve. \~
|
||||
\details \ru Погрешностью считается ограничивающая сфера точки.
|
||||
\en The tolerance is a sphere bounding a point. \~
|
||||
\param[in] crv - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] t - \ru Координата точки на кривой.
|
||||
\en A coordinate of a point on a curve. \~
|
||||
\param[out] pnt - \ru Трехмерная координата точки на кривой.
|
||||
\en A three-dimensional coordinate of a point on a curve. \~
|
||||
\param[out] eps - \ru Погрешность точки.
|
||||
\en The tolerance of a point. \~
|
||||
\param[in] version - \ru Версия.
|
||||
\en Version. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (void) GetEpsilonBound( const MbCurve3D & crv, double t,
|
||||
MbCartPoint3D & pnt, double & eps,
|
||||
VERSION version /*= Math::DefaultMathVersion()*/ ); // \ru KVA K13+ 6.5.2011 Версия нужна обязательно \en KVA K13+ 6.5.2011 A version is absolutely necessary.
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверить инцидентность двух вершин.
|
||||
\en Check the coincidence of two vertices. \~
|
||||
\details \ru Кривые рассматриваются как ребра).
|
||||
\en Curves are considered as edges. \~
|
||||
\param[in] crv1 - \ru Кривая 1.
|
||||
\en The curve 1. \~
|
||||
\param[in] t1 - \ru Если t1 == 1, рассматривается конец кривой, иначе начало.
|
||||
\en If 't1' equals 1 then the end of a curve is considered, the start of a curve is considered otherwise. \~
|
||||
\param[in] crv2 - \ru Кривая 2.
|
||||
\en The curve 2. \~
|
||||
\param[in] t2 - \ru Если t2 == 1, рассматривается конец кривой, иначе начало.
|
||||
\en If 't2' equals 1 then the end of a curve is considered, the start of a curve is considered otherwise. \~
|
||||
\param[in] version - \ru Версия.
|
||||
\en Version. \~
|
||||
\return \ru true, если вершины инцидентны.
|
||||
\en true if vertices are coincident. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) IsIncidence( const MbCurve3D & crv1, int t1,
|
||||
const MbCurve3D & crv2, int t2,
|
||||
VERSION version /*= Math::DefaultMathVersion()*/ ); // \ru KVA K13+ 6.5.2011 Версия нужна обязательно \en KVA K13+ 6.5.2011 A version is absolutely necessary.
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Дать ближайший к лучу параметр кривой.
|
||||
\en Get the curve parameter which is nearest to the ray. \~
|
||||
\details \ru Луч проходит через точку point в направлении вектора direct
|
||||
\en The ray is passed through the point 'point' in the direction of the vector 'direct' \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] point - \ru Точка луча.
|
||||
\en The point of a ray. \~
|
||||
\param[in] direct - \ru Вектор направления луча.
|
||||
\en The vector of ray direction. \~
|
||||
\return \ru Ближайший к лучу параметр кривой.
|
||||
\en The nearest curve parameter to the ray. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (double) GetNearCurveParam( const MbCurve3D & curve,
|
||||
const MbCartPoint3D & point, const MbVector3D & direct );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Дать ближайший к лучу параметр кривой.
|
||||
\en Get the curve parameter which is nearest to the ray. \~
|
||||
\details \ru Луч проходит через точку point в направлении вектора direct. \n
|
||||
setOnSide == true принуждает установить параметр кривой к ближайшему концу и
|
||||
вычислить флаг isBegin, определяющий близость к началу (true) или концу (false) кривой.
|
||||
\en The ray is passed through the point 'point' in the direction of the vector 'direct'. \n
|
||||
if 'setOnSide' equals true then the parameter of curve should be set for the nearest end and
|
||||
the flag 'isBegin' determines the proximity to the curve start (true) or to the curve end (false). \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] point - \ru Точка луча.
|
||||
\en The point of a ray. \~
|
||||
\param[in] direct - \ru Вектор направления луча.
|
||||
\en The vector of a ray direction. \~
|
||||
\param[in] setOnSide - \ru Надо ли приравнять параметр к ближайшему концу кривой.
|
||||
\en Whether the parameter should be equated to the nearest end of a curve. \~
|
||||
\param[out] isBegin - \ru если true, то параметр находится ближе к началу кривой. \n
|
||||
Если false, то параметр находится ближе к концу кривой.
|
||||
\en if true than the parameter is located closer to the start of a curve. \n
|
||||
if false than the parameter is located closer to the end of a curve. \~
|
||||
\return \ru Ближайший к лучу параметр кривой.
|
||||
\en The nearest curve parameter to the ray. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (double) GetNearCurveParam( const MbCurve3D & curve,
|
||||
const MbCartPoint3D & point, const MbVector3D & direct,
|
||||
bool setOnSide, bool & isBegin );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать гладкую кривую из кривой Безье.
|
||||
\en Create a smooth curve from a Bezier curve. \~
|
||||
\details \ru По исходной кривой Безье создается NURBS 4-го порядка. После NURBS разбивается
|
||||
в трижды кратных внутренних узлах, если они существуют. \n
|
||||
Если bline принимает значение true, то проверяется вырожденность в линию. Если рассматриваемый
|
||||
сегмент или кривая целиком - линия, то выполняется преобразование в линию.
|
||||
\en A NURBS of the fourth degree is created by an initial Bezier curve . Thereafter the NURBS is splitted
|
||||
in internal knots of triple multiplicity if they exist \n
|
||||
If 'bline' is true then the degeneration into a line is checked. If the considered
|
||||
segment or the entire curve is a line then it is trandformed into a line. \~
|
||||
\param[in] bez - \ru Кривая Безье.
|
||||
\en Bezier curve \~
|
||||
\param[out] arCurve - \ru Множество созданных кривых.
|
||||
\en The array of created curves. \~
|
||||
\param[in] bline - \ru Флаг проверки вырожденности в линию.
|
||||
\en The flag for the check of degeneration into a line. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CreateSmoothFromBezier( const MbBezier & bez, RPArray<MbCurve> & arCurve,
|
||||
bool bline );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать кривую заданного типа базе NURBS-кривой.
|
||||
\en Create a curve of a given type as NURBS-curve. \~
|
||||
\details \ru Работает для двух типов: pt_LineSegment и pt_Arc. Если не удалось
|
||||
аппроксимировать с заданной точностью функция вернет NULL.
|
||||
\en It works for the two types: 'pt_LineSegment' and 'pt_Arc'. If approximation with the given tolerance has failed
|
||||
then the function returns NULL. \~
|
||||
\param[in] nurbs - \ru Исходная NURBS-кривая.
|
||||
\en The initial NURBS-curve. \~
|
||||
\param[in] type - \ru Тип кривой, которую требуется создать.
|
||||
\en The type of a curve which is required to create. \~
|
||||
\param[in] eps - \ru Точность аппроксимации.
|
||||
\en The tolerance of approximation. \~
|
||||
\return \ru Указатель на кривую, если она была создана.
|
||||
\en The pointer to the curve if it has been created. \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) ConvertNurbsToCurveOfType( const MbNurbs & nurbs, MbePlaneType type, double eps );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить плоскую проекцию кривой.
|
||||
\en Construct a planar projection of a curve. \~
|
||||
\details \ru Построить двумерную кривую - проекцию кривой на плоскость XY локальной системы координат, заданной матрицей преобразования.
|
||||
Двумерные кубические сплайны Эрмита (MbHermit) и кубические сплайны (MbCubicSpline) заменяются на NURBS (MbNurbs).
|
||||
\en Construct a two-dimensional curve - projection of a curve to the plane XY of a coordinate system which is set by the matrix of transformation.
|
||||
Two-dimensional cubic splines of Hermite ('MbHermit') and cubic splines ('MbCubicSpline') are replaced by NURBS ('MbNurbs'). \~
|
||||
\param[in] curve3D - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] into - \ru Матрица преобразования из глобальной системы координат в видовую плоскость.
|
||||
\en The transformation matrix from the global coordinate system into a plane of view. \~
|
||||
\param[in] pRgn - \ru Параметрическая область кривой для создания проекции.
|
||||
\en The parametric region of a curve for the creation of a projection. \~
|
||||
\param[in] version - \ru Версия построения.
|
||||
\en The version of construction. \~
|
||||
\return \ru Указатель на полученную кривую.
|
||||
\en The pointer to the obtained curve. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) GetFlatCurve( const MbCurve3D & curve3D, const MbMatrix3D & into,
|
||||
MbRect1D * pRgn = NULL, VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Получить плоскую проекцию кривой.
|
||||
\en Get a planar projection of a curve. \~
|
||||
\details \ru Кривая проецируется на заданную плоскость.
|
||||
\en A curve is projected onto a given plane. \~
|
||||
\param[in] curve3D - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] place - \ru Плоскость, на которую требуется спроецировать кривую.
|
||||
\en The plane the curve should be projected on. \~
|
||||
\return \ru Указатель на полученную проекционную кривую.
|
||||
\en The pointer to the obtained projection curve. \~
|
||||
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) GetFlatProjection( const MbCurve3D & curve3D,
|
||||
const MbPlacement3D & place,
|
||||
VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Положение кривой относительно точек оси.
|
||||
\en The location of a curve relative to axis points. \~
|
||||
\details \ru Для определения направления оси вращения.
|
||||
\en For the definition of the rotation axis direction. \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] p1 - \ru Первая точка оси.
|
||||
\en The first point of an axis. \~
|
||||
\param[in] p2 - \ru Вторая точка оси.
|
||||
\en The second point of an axis. \~
|
||||
\return \ru 0 в случае сбоя при работе программы, \n
|
||||
иначе возвращается векторное произведение нормализованного вектора оси (p1, p2) и
|
||||
вектора (p1, w), где w - координаты центра тяжести кривой.
|
||||
\en 0 in a case of failure, \n
|
||||
otherwise the vector product of the normalized axis vector ('p1', 'p2') and
|
||||
the vector ('p1', 'w') is returned. ('w' is the coordinates of the curve's center of gravity). \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (double) CurveRelative( const MbCurve & curve, const MbCartPoint & p1, const MbCartPoint & p2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Знак площади тени кривой на отрезок.
|
||||
\en A sign of area of a curve's shadow on a segment. \~
|
||||
\details \ru Требуется для определения направления контура заметания.
|
||||
Если кривая не замкнута, то она замыкается через ось.
|
||||
\en This is required for the definition of the sweep contour direction.
|
||||
If a curve is not closed then it becomes closed through an axis. \~
|
||||
\param[in] curve - \ru Исходная кривая.
|
||||
\en The initial curve. \~
|
||||
\param[in] p1 - \ru Первая точка отрезка.
|
||||
\en The first point of a segment. \~
|
||||
\param[in] p2 - \ru Вторая точка отрезка.
|
||||
\en The second point of a segment. \~
|
||||
\param[in] sag - \ru Угол отклонения. Используется для расчета шага по кривой.
|
||||
\en The deviation angle. Used for calculation of the step by a curve. \~
|
||||
\return \ru Площадь тени со знаком.
|
||||
\en The area of the shadow with a sign. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (double) ContourRelative( const MbCurve & curve, const MbCartPoint & p1, const MbCartPoint & p2, double sag );
|
||||
|
||||
|
||||
#endif // __ALG_POLYLINE_H
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Получение линий очерка.
|
||||
\en Obtaining the isocline curves. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ALG_SILHOUETTE_HIDE_H
|
||||
#define __ALG_SILHOUETTE_HIDE_H
|
||||
|
||||
|
||||
#include <templ_rp_array.h>
|
||||
#include <math_define.h>
|
||||
#include <mb_variables.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbVector3D;
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbCurve;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbMesh;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Получить массив кривых плоской проекции очерка поверхности.
|
||||
\en Get the array of surface silhouette curves of planar projection. \~
|
||||
\details \ru Получить массив кривых плоской проекции очерка поверхности. \n
|
||||
\en Get the array of surface silhouette curves of planar projection. \n \~
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CreateSurfaceHide( const MbSurface & surf, const MbPlacement3D & eyePlace, double sag,
|
||||
RPArray<MbCurve> & hideCurves, VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Рассчитать сетку.
|
||||
\en Calculate mesh. \~
|
||||
\details \ru Рассчитать сетку массива кривых очерка поверхности. \n
|
||||
\en Calculate mesh of array of surface silhouette curves. \n \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CalculateHideMesh( const MbSurface & surf, const MbVector3D & eyeDir, double sag,
|
||||
MbMesh *& mesh, VERSION version = Math::DefaultMathVersion() );
|
||||
|
||||
|
||||
#endif // __ALG_SILHOUETTE_HIDE_H
|
||||
@@ -0,0 +1,392 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Сборочная единица.
|
||||
\en Assembly unit. \~
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ASSEMBLY_H
|
||||
#define __ASSEMBLY_H
|
||||
|
||||
#include <generic_utility.h>
|
||||
#include <gcm_manager.h>
|
||||
#include <model_item.h>
|
||||
#include <solid.h>
|
||||
#include <instance.h>
|
||||
|
||||
|
||||
class MbConstraintSystem;
|
||||
class MATH_CLASS MtGeomArgument;
|
||||
class MATH_CLASS MtGeomConstraint;
|
||||
class MATH_CLASS MtConstraintIter;
|
||||
struct ItAssemblyReactor;
|
||||
struct ItAssemblyImportData;
|
||||
struct ItModelVisitor;
|
||||
class MbModelTreeReader;
|
||||
class MATH_CLASS MbAssembly;
|
||||
|
||||
namespace c3d // namespace C3D
|
||||
{
|
||||
typedef SPtr<MbAssembly> AssemblySPtr;
|
||||
typedef SPtr<const MbAssembly> ConstAssemblySPtr;
|
||||
|
||||
typedef std::vector<MbAssembly *> AssembliesVector;
|
||||
typedef std::vector<const MbAssembly *> ConstAssembliesVector;
|
||||
|
||||
typedef std::vector<AssemblySPtr> AssembliesSPtrVector;
|
||||
typedef std::vector<ConstAssemblySPtr> ConstAssembliesSPtrVector;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Сборочная единица.
|
||||
\en Assembly unit. \~
|
||||
\details \ru Сборка состоит из множества объектов геометрической модели MbItem.
|
||||
Сборка может содержать объекты любого подкласса MbItem, в том числе и сборочные
|
||||
единицы (тип MbAssembly).
|
||||
\en The assembly consists of a set of objects of geometric model MbItem.
|
||||
The assembly may contain objects of any sub-class of MbItem, including
|
||||
assembly units (of type MbAssembly).
|
||||
\par \ru Отношение "часть-целое".
|
||||
\en Relationship "is a part of".
|
||||
\ru Сборочная единица - это объект модели объединяющий в себе набор других объектов.
|
||||
Такое объединение рассматривается как агрегация, устанавливающая отношение
|
||||
владения между сборкой и её собственными суб-объектами. Это предполагает что любой
|
||||
объект модели типа MbItem может принадлежать только одной сборке.
|
||||
\en Assembly unit is object of model aggregating a collection of other objects.
|
||||
Such an association is regarded as an aggregation establishing an ownership
|
||||
between the assembly and its proper sub-objects. This implies that any
|
||||
model object of type MbItem can belong to only assembly.
|
||||
\~
|
||||
\ingroup Model_Items
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS MbAssembly : public MbItem
|
||||
{
|
||||
private:
|
||||
typedef sorting_array<MbItem*,LessName> ItemContainer;
|
||||
typedef ItemContainer::iterator item_iterator;
|
||||
|
||||
private:
|
||||
ItemContainer assemblyItems; ///< \ru Множество объектов сборки. \en A set of assembly objects.
|
||||
MbConstraintSystem * constraintSystem; ///< \ru Система ограничений сборки. \en Constraint system of assembly unit.
|
||||
mutable ItAssemblyReactor * m_reactor; ///< \ru Обработчик события, связанные с решением сборки. \en The event handles related to solving the assembly.
|
||||
|
||||
protected:
|
||||
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
|
||||
explicit MbAssembly( const MbAssembly & init, MbRegDuplicate * iReg );
|
||||
|
||||
public:
|
||||
/// \ru Конструктор пустой сборки. \en Construct an empty assembly.
|
||||
MbAssembly();
|
||||
/// \ru Конструктор по объекту. \en The constructor by an object.
|
||||
explicit MbAssembly( MbItem & );
|
||||
/// \ru Конструктор по объектам в локальной системе координат. \en The constructor by objects in a local coordinate system.
|
||||
template <class ItemsVector>
|
||||
MbAssembly( const ItemsVector & items );
|
||||
// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbAssembly();
|
||||
|
||||
public:
|
||||
VISITING_CLASS( MbAssembly );
|
||||
|
||||
// \ru Общие функции геометрического объекта \en Common functions of a geometric object
|
||||
|
||||
virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en An object type.
|
||||
virtual MbSpaceItem & Duplicate( MbRegDuplicate * iReg = NULL ) const; // \ru Создать копию. \en Create a copy.
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * iReg = NULL ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
|
||||
virtual void Move( const MbVector3D &, MbRegTransform * iReg = NULL ); // \ru Сдвинуть вдоль вектора. \en Move along a vector.
|
||||
virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * iReg = NULL ); // \ru Повернуть вокруг оси. \en Rotate about an axis.
|
||||
virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal?
|
||||
virtual bool IsSimilar( const MbSpaceItem & ) const; // \ru Являются ли объекты подобными? \en Are the objects similar?
|
||||
virtual bool SetEqual ( const MbSpaceItem & ); // \ru Сделать объекты равным \en Make the objects equal
|
||||
virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate distance to point.
|
||||
virtual void AddYourGabaritTo( MbCube & r ) const; // \ru Добавь свой габарит в куб. \en Add own bounding box to the bounding box.
|
||||
virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & cube ) const; // \ru Рассчитать габарит в локальной системы координат. \en Calculate the bounding box in a local coordinate system.
|
||||
virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh.
|
||||
|
||||
virtual MbProperty & CreateProperty( MbePrompt n ) const; // \ru Создать собственное свойство. \en Create own property.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual void GetBasisItems( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты. \en Get the basis objects.
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
// \ru Выдать локальную систему координат объектов сборки. \en Get the local coordinate system of assembly items.
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const;
|
||||
// \ru Установить локальную систему координат объектов сборки. \en Set coordinate system of assembly items.
|
||||
virtual bool SetPlacement( const MbPlacement3D & );
|
||||
// \ru Перестроить объект по журналу построения. \en Rebuild object according to the history tree.
|
||||
virtual bool RebuildItem( MbeCopyMode sameShell, RPArray<MbSpaceItem> * items, IProgressIndicator * progInd );
|
||||
// \ru Создать полигональный объект - упрощенную копию данного объекта. \en Create a polygonal object - a simplified copy of the given object.
|
||||
// \note \ru В многопоточном режиме выполняется параллельно. \en In multithreaded mode runs in parallel.
|
||||
virtual MbItem * CreateMesh( const MbStepData & stepData, const MbFormNote & note, MbRegDuplicate * iReg ) const;
|
||||
// \ru Добавить полигональную сетку объекта. \en Add a polygonal mesh of the object.
|
||||
virtual bool AddYourMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const;
|
||||
// \ru Разрезать полигональный объект одной или двумя параллельными плоскостями. \en Cut the polygonal object by one or two parallel planes.
|
||||
virtual MbItem * CutMesh( const MbPlacement3D & cutPlace, double distance ) const;
|
||||
// \ru Найти ближайший объект или имя ближайшего объекта. \en Find the closest object or its name.
|
||||
virtual bool NearestMesh( MbeSpaceType sType, MbeTopologyType tType, MbePlaneType pType,
|
||||
const MbAxis3D & axis, double maxDistance, bool gridPriority, double & t, double & dMin,
|
||||
MbItem *& find, SimpleName & findName,
|
||||
MbRefItem *& element, SimpleName & elementName,
|
||||
MbPath & path, MbMatrix3D & from ) const;
|
||||
// \ru Дать все объекты указанного типа. \en Get all objects by type. \~
|
||||
virtual bool GetItems( MbeSpaceType type, const MbMatrix3D & from,
|
||||
RPArray<MbItem> & items, SArray<MbMatrix3D> & matrs );
|
||||
// \ru Дать все полигональные объекты, отображающие геометрические элементы, участвующие в геометрических огриничениях.\en Get all polygonal objects for drawing the elements participated in geometric constraints. \~
|
||||
bool GetConstraintMesh( std::vector<const MbMesh *> & meshes ) const;
|
||||
// \ru Дать все уникальные объекты указанного типа. \en Get all unique objects by type . \~
|
||||
virtual bool GetUniqItems( MbeSpaceType type, CSSArray<const MbItem *> & items ) const;
|
||||
// \ru Дать объект по его пути положения в модели и матрицу преобразования объекта в глобальную систему координат. \en Get the object by its path in the model and get the matrix of transformation of the object to the global coordinate system.
|
||||
virtual const MbItem * GetItemByPath( const MbPath & path, size_t ind, MbMatrix3D & from, size_t currInd = 0 ) const;
|
||||
// \ru Найти объект по геометрическому объекту (MbSpaceItem). \en Find the object by a geometric object (MbSpaceItem).
|
||||
virtual const MbItem * FindItem( const MbSpaceItem * s, MbPath & path, MbMatrix3D & from ) const;
|
||||
// \ru Найти объект по геометрическому объекту (MbPlaneItem). \en Find the object by a geometric object (MbSpaceItem).
|
||||
virtual const MbItem * FindItem( const MbPlaneItem * s, MbPath & path, MbMatrix3D & from ) const;
|
||||
// \ru Найти объект и матрицу его преобразования в глобальную систему координат. \en Find the object and the matrix of its transformation to the global coordinate system.
|
||||
virtual const MbItem * FindItem( const MbItem * s, MbPath & path, MbMatrix3D & from ) const;
|
||||
// \ru Дать объект с заданным именем и матрицу его преобразования в глобальную систему координат. \en Get the object with the specified name and the matrix of its transformation to the global coordinate system.
|
||||
virtual const MbItem * GetItemByName( SimpleName n, MbPath & path, MbMatrix3D & from ) const;
|
||||
|
||||
// \ru Преобразовать согласно матрице c использованием регистратора селектированные содержимые объекты. \en Transform selected objects according to the matrix using the registrator.
|
||||
virtual void TransformSelected( const MbMatrix3D & matr, MbRegTransform * iReg = NULL );
|
||||
// \ru Сдвинуть вдоль вектора с использованием регистратора селектированные содержимые объекты. \en Move selected objects along the vector using the registrator.
|
||||
virtual void MoveSelected( const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Повернуть вокруг оси на заданный угол с использованием регистратора селектированные содержимые объекты. \en Rotate selected objects about the axis by the given angle using the registrator.
|
||||
virtual void RotateSelected( const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
/// \ru Отдать селектированные содержимые объекты. \en Get selected objects.
|
||||
bool DetachSelected( RPArray<MbItem> & items, SArray<MbMatrix3D> & matrs, bool selected = true );
|
||||
/// \ru Отцепить все видимые или невидимые объекты. \en Detach all visible or invisible objects. \~
|
||||
bool DetachInvisible( RPArray<MbItem> & items, SArray<MbMatrix3D> & matrs, bool invisible = true );
|
||||
/// \ru Отцепить все объекты с указанным свойством. \en Detach all objects with pointed attribute. \~
|
||||
bool DetachByAttribute( RPArray<MbItem> & items, SArray<MbMatrix3D> & matrs, int attribute );
|
||||
/** \brief \ru Алгоритм общего назначения для обхода дерева модели в глубину.
|
||||
\en General-purpose algorithm traversing the model graph in depth. */
|
||||
void Traverse( ItModelVisitor & ) const;
|
||||
|
||||
public:
|
||||
/** \ru \name Функции сборочной единицы.
|
||||
\en \name The assembly unit functions.
|
||||
\{ */
|
||||
/// \ru Выдать непосредственный объект сборки по идентификатору. \en Get the immediate item of assembly by identifier.
|
||||
const MbItem * SubItem( SimpleName n ) const { return _ItemByName(n); }
|
||||
/// \ru Добавить объект в сборку. \en Add an item to the assembly.
|
||||
MbItem * AddItem( MbItem & item );
|
||||
/**
|
||||
\brief \ru Добавить вставку геометрического объекта.
|
||||
\en Add an instance of the geometric object. \~
|
||||
\param item - \ru Источник, на котором основан экземпляр вставки.
|
||||
\en A source item on which the instance is based.
|
||||
\param lcs - \ru Локальная система координат экземпляра вставляемого объекта.
|
||||
\en Local coordinate system of the instanced object. \~
|
||||
\return \ru Экземпляр класса MbInstance, размещающего объект в пространстве сборки.
|
||||
\en An Instance of class MbInstance placing the item in the space of the assembly.
|
||||
*/
|
||||
MbItem * AddInstance( MbItem & item, const MbPlacement3D & lcs );
|
||||
/** \brief \ru Заменить объект.
|
||||
\en Replace an item. \~
|
||||
\details \ru Заменить объект новым.
|
||||
\en Replace an item by a new one. \~
|
||||
\param[in] item - \ru Заменяемый объект.
|
||||
\en An item to be replaced. \~
|
||||
\param[in] newItem - \ru Новый объект.
|
||||
\en A new item. \~
|
||||
\return \ru Возвращает true, если замена была выполнена.
|
||||
\en Returns true if the replacement has been performed. \~
|
||||
*/
|
||||
bool ReplaceItem( const MbItem & item, MbItem & newItem, bool saveName = false );
|
||||
|
||||
/// \ru Выдать все объекты. \en Get all the items.
|
||||
void GetItems( RPArray<const MbItem> & items ) const;
|
||||
/// \ru Выдать все объекты. \en Get all the items.
|
||||
void GetItems( RPArray<MbItem> & items );
|
||||
|
||||
/// \ru Отцепить объект по индексу. \en Detach the item by index.
|
||||
MbItem* DetachItem ( size_t ind );
|
||||
/// \ru Отцепить объект, если такой есть в сборке. \en Detach the item if it belongs to the assembly.
|
||||
bool DetachItem ( MbItem * obj );
|
||||
/// \ru Удалить объект, если такой есть в сборке или в подсборках. \en Delete the item if it belongs to the assembly or its sub-assemblies.
|
||||
bool DeleteItem ( MbItem * obj );
|
||||
/// \ru Удалить все объекты сборки. \en Delete all the assembly items.
|
||||
void DeleteItems();
|
||||
/// \ru Выдать количество объектов сборки. \en Get the assembly item count.
|
||||
size_t ItemsCount() const { return assemblyItems.size(); }
|
||||
/// \ru Вернуть true, если сборка не содержит геометрических объекты. \en Return true, if the assembly has no geometric objects.
|
||||
bool IsEmpty() const { return assemblyItems.empty(); }
|
||||
/// \ru Выдать объект по индексу. \en Get the item by index.
|
||||
const MbItem * GetItem( size_t i ) const;
|
||||
/// \ru Выдать объект по индексу для модификации. \en Get the item by index for modification.
|
||||
MbItem * SetItem( size_t i );
|
||||
/// \ru Содержит ли сборка присланный объект? \en Does the assembly contain the given item?
|
||||
bool ContainsItem( const MbItem * obj ) const;
|
||||
/// \ru Вычислить габарит сборки. \en Calculate the bounding box of the assembly.
|
||||
void CalculateGabarit( MbCube & cube ) const;
|
||||
/// \ru Выдать количество граней. \en Get the number of faces.
|
||||
size_t GetFacesCount() const;
|
||||
/// \ru Заполнить контейнер гранями тела. \en Fill container by solid faces.
|
||||
template <class FacesVector>
|
||||
void GetFacesSet( FacesVector & faces ) const;
|
||||
public:
|
||||
/** \}
|
||||
\ru \name Функции системы ограничений.
|
||||
\en \name The constraint system functions.
|
||||
\{ */
|
||||
/// \ru Добавить ограничение для пары геометрических объектов. \en Add geometric constraint.
|
||||
MtGeomConstraint AddConstraint( MtMateType, const MtGeomArgument &, const MtGeomArgument &, MtParVariant = MtParVariant::undef );
|
||||
/// \ru Изменить значение управляющего размера. \en Change the value of driving dimension.
|
||||
MtResultCode3D ChangeDimension( MtGeomConstraint & dimCon, double newVal );
|
||||
/// \ru Решить ограничения сборки. \en Evaluate constraints.
|
||||
MtResultCode3D EvaluateConstraints();
|
||||
/// \ru Выдать диапазон итераторов для обхода всех ограничений сборки. \en Get a range of iterators to traverse all assembly constraints.
|
||||
void GetConstraints( MtConstraintIter & begIter, MtConstraintIter & endIter ) const;
|
||||
/// \ru Задать или сбросить обработчик событий решателя. \en Set or reset an handler of constraint solving events.
|
||||
void SetReactor( ItAssemblyReactor * ) const;
|
||||
/// \ru Импортировать систему ограничений из приложения САПР. \ru Import the constraint system from CAD application.
|
||||
bool Import( ItAssemblyImportData & );
|
||||
|
||||
public:
|
||||
/** \} */
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbAssembly );
|
||||
|
||||
static const MbPlacement3D & GetPlacement() { return MbPlacement3D::global; } // This function is deprecated. Use MbInstanse to give the assembly its own placement.
|
||||
|
||||
friend class MbModelTreeReader;
|
||||
|
||||
private:
|
||||
// \ru Инициализатор по массиву составляющих объектов. // \en Initializer to aggregate items in the assembly.
|
||||
template <class ItemsVector>
|
||||
void _Init( const ItemsVector & );
|
||||
// Найти объект по геометрическому объекту
|
||||
template <class ItemType>
|
||||
const MbItem * _FindItem( const ItemType * s, MbPath & path, MbMatrix3D & from ) const;
|
||||
// Поиск в глубину среди подчиненных
|
||||
template<class ItemType>
|
||||
const MbItem * _FindRecursively( const ItemType * s, MbPath & path, MbMatrix3D & from ) const;
|
||||
// \ru Выдать объект по идентификатору. \en Get the item by identifier.
|
||||
const MbItem * _ItemByName( SimpleName ) const;
|
||||
// \ru Генерация имени для нового элемента сборки. \en Generate identifier for new assembly item.
|
||||
SimpleName _NewItemName() const;
|
||||
/// \ru Добавить в сборку объекты сборки без трансформации. \en Add assembly items to the assembly without transformation.
|
||||
bool _AddAssemblyItems( MbAssembly & );
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbAssembly );
|
||||
}; // MbAssembly
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbAssembly )
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Экспериментальный посетитель дерева модели
|
||||
/*
|
||||
Возможные применения:
|
||||
- Сбор любых данных об/из иерархии модели;
|
||||
- Загрузка подсборок и вставок в утилиту поиска соударений (MbCollisionDetectionUtility);
|
||||
- Геометрический поиск с выдачей маршрута(MbPath) и матрицу отображения МСК вставок и подсборок;
|
||||
- Восстановление текущей матрицы и маршрута MbPath по hash-коду ссылок в системе
|
||||
геометрических ограничений;
|
||||
*/
|
||||
//---
|
||||
struct ItModelVisitor
|
||||
{
|
||||
public:
|
||||
virtual void VisitItem( const MbItem * ) = 0;
|
||||
virtual void FinishItem( const MbItem * ) = 0;
|
||||
virtual bool ExamineSubItem( const MbItem * owner, const MbItem * subItem ) = 0;
|
||||
virtual void ExamineInstance( const MbInstance * inst, const MbItem * srcItem ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Конструктор по объектам. \en The constructor by objects.
|
||||
//---
|
||||
template <class ItemsVector>
|
||||
MbAssembly::MbAssembly( const ItemsVector & items )
|
||||
: MbItem()
|
||||
, assemblyItems()
|
||||
, constraintSystem( NULL )
|
||||
, m_reactor( NULL )
|
||||
{
|
||||
#ifdef C3D_DEBUG
|
||||
// Check a condition of the single owner.
|
||||
for ( size_t i = 0, iCount = items.size(); i < iCount; ++i )
|
||||
{
|
||||
if ( items[i]->GetItemName() != UNDEFINED_SNAME )
|
||||
{
|
||||
C3D_ASSERT_UNCONDITIONAL( false ); // The item has already a name. It's probably means that the item is owned another assembly.
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // C3D_DEBUG
|
||||
|
||||
_Init( items );
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Инициализатор по массиву составляющих объектов.
|
||||
// \en Initializer to aggregate items in the assembly.
|
||||
//---
|
||||
template <class ItemsVector>
|
||||
void MbAssembly::_Init( const ItemsVector & items )
|
||||
{
|
||||
C3D_ASSERT( assemblyItems.empty() && (constraintSystem == NULL) );
|
||||
SimpleName idCounter = 0;
|
||||
|
||||
for ( size_t i = 0, iCount = items.size(); i < iCount; ++i )
|
||||
{
|
||||
if ( MbItem * item = items[i] ) {
|
||||
if ( item->GetItemName() == UNDEFINED_SNAME ) {
|
||||
item->SetItemName( idCounter );
|
||||
}
|
||||
else {
|
||||
C3D_ASSERT( idCounter <= item->GetItemName() );
|
||||
idCounter = max_of( idCounter, item->GetItemName() );
|
||||
}
|
||||
++idCounter;
|
||||
item->AddRef();
|
||||
assemblyItems.push_back( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Заполнить контейнер гранями тела. \en Fill container by solid faces.
|
||||
//---
|
||||
template <class FacesVector>
|
||||
void MbAssembly::GetFacesSet( FacesVector & faces ) const
|
||||
{
|
||||
for ( size_t i = assemblyItems.size(); i--; )
|
||||
{
|
||||
if ( const MbItem * assemblyItem = assemblyItems[i] )
|
||||
{
|
||||
if ( assemblyItem->IsA() == st_Solid )
|
||||
static_cast<const MbSolid &>(*assemblyItem).GetFacesSet( faces );
|
||||
else if ( assemblyItem->IsA() == st_Instance )
|
||||
static_cast<const MbInstance &>(*assemblyItem).GetFacesSet( faces );
|
||||
else if ( assemblyItem->IsA() == st_Assembly )
|
||||
static_cast<const MbAssembly &>(*assemblyItem).GetFacesSet( faces );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Заполнить контейнер гранями тела. \en Fill container by solid faces.
|
||||
//---
|
||||
template <class FacesVector>
|
||||
void MbInstance::GetFacesSet( FacesVector & faces ) const
|
||||
{
|
||||
if ( item != NULL ) {
|
||||
if ( item->IsA() == st_Solid )
|
||||
static_cast<const MbSolid &>( *item ).GetFacesSet( faces );
|
||||
else if ( item->IsA() == st_Assembly )
|
||||
static_cast<const MbAssembly &>( *item ).GetFacesSet( faces );
|
||||
else if ( item->IsA() == st_Instance )
|
||||
static_cast<const MbInstance &>( *item ).GetFacesSet( faces );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // __ASSEMBLY_H
|
||||
@@ -0,0 +1,100 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Вспомогательный объект геометрической модели.
|
||||
\en Assisting item of the geometric model. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ASSISTING_ITEM_H
|
||||
#define __ASSISTING_ITEM_H
|
||||
|
||||
|
||||
#include <space_item.h>
|
||||
#include <model_item.h>
|
||||
#include <mb_placement3d.h>
|
||||
#include <math_define.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCube;
|
||||
class MATH_CLASS MbProperties;
|
||||
class MATH_CLASS MbMesh;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вспомогательный объект геометрической модели.
|
||||
\en Assisting item of the geometric model. \~
|
||||
\details \ru Вспомогательный объект позволяет использовать в геометрической модели такие объекты,
|
||||
как локальная система координат, ось, матрица преобразования для позиционирования других объектов.\n
|
||||
\en The assisting item allows to use such an objects in a geometric model
|
||||
as a local coordinate system, axis, transformation matrix for the other objects location.\n \~
|
||||
\ingroup Model_Items
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbAssistingItem : public MbItem {
|
||||
protected :
|
||||
MbPlacement3D place; ///< \ru Локальная система координат. \en Local coordinate system.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
|
||||
explicit MbAssistingItem( const MbAssistingItem &, MbRegDuplicate * );
|
||||
public :
|
||||
/// \ru Конструктор по локальной системе координат. \en Constructor by a local coordinate system.
|
||||
MbAssistingItem( const MbPlacement3D & );
|
||||
public :
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbAssistingItem();
|
||||
|
||||
public :
|
||||
VISITING_CLASS( MbAssistingItem );
|
||||
|
||||
// \ru Общие функции геометрического объекта. \en Common functions of a geometric object.
|
||||
virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en An object type.
|
||||
virtual MbSpaceItem & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Создать копию. \en Create a copy.
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвинуть вдоль вектора. \en Move along a vector.
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси. \en Rotate about an axis.
|
||||
virtual bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Whether the objects are equal?
|
||||
virtual bool IsSimilar( const MbSpaceItem & init ) const; // \ru Являются ли объекты подобными? \en Whether the objects are similar?
|
||||
virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make the objects equal.
|
||||
virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate distance to point.
|
||||
virtual void AddYourGabaritTo( MbCube & r ) const; // \ru Добавь свой габарит в куб. \en Add own bounding box to the bounding box.
|
||||
virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & cube ) const; // \ru Рассчитать габарит в локальной системы координат. \en Calculate the bounding box in a local coordinate system.
|
||||
virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh.
|
||||
|
||||
virtual MbProperty & CreateProperty( MbePrompt name ) const; // \ru Создать собственное свойство. \en Create own property.
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
/// \ru Получить систему координат объекта. \en Get the coordinate system of an item.
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const;
|
||||
/// \ru Установить систему координат объекта. \en Set the coordinate system of an item.
|
||||
virtual bool SetPlacement( const MbPlacement3D & p );
|
||||
|
||||
// \ru Создать полигональный объект - упрощенную копию данного объекта. \en Create a polygonal object - a simplified copy of the given object.
|
||||
virtual MbItem * CreateMesh( const MbStepData & stepData, const MbFormNote & note, MbRegDuplicate * iReg ) const;
|
||||
|
||||
/// \ru Дать матрицу преобразования из локальной системы объекта. \en Get transform matrix from local coordinate system of object.
|
||||
virtual bool GetMatrixFrom( MbMatrix3D & from ) const;
|
||||
/// \ru Дать матрицу преобразования в локальную систему объекта. \en Get transform matrix into local coordinate system of object.
|
||||
virtual bool GetMatrixInto( MbMatrix3D & into ) const;
|
||||
|
||||
/** \ru \name Функции вспомогательного объекта.
|
||||
\en \name Functions of assisting item.
|
||||
\{ */
|
||||
/// \ru Выдать систему координат объекта. \en Get the coordinate system of an item.
|
||||
const MbPlacement3D & GetPlacement() const { return place; }
|
||||
/// \ru Выдать систему координат объекта для редактирования. \en Get the coordinate system of an item for editing.
|
||||
MbPlacement3D & SetPlacement() { return place; }
|
||||
/** \} */
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbAssistingItem )
|
||||
OBVIOUS_PRIVATE_COPY( MbAssistingItem )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbAssistingItem )
|
||||
|
||||
#endif // __ASSISTING_ITEM_H
|
||||
@@ -0,0 +1,320 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Функции сравнения и тестирования тел.
|
||||
\en Functions for solids comparison and testing. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef __ATS_CHECK_H
|
||||
#define __ATS_CHECK_H
|
||||
|
||||
|
||||
#include <name_item.h>
|
||||
#include <templ_p_array.h>
|
||||
#include <topology_item.h>
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <mb_vector3d.h>
|
||||
#include <templ_visitor.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbSolid;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Различия примитивов.
|
||||
\en Differences of primitives. \~
|
||||
\details \ru Различия примитивов.\n
|
||||
\en Differences of primitives.\n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
struct PrimitiveDifference {
|
||||
public:
|
||||
/// \ru Типы различий в именовании \en Types of naming differences
|
||||
enum DifferenceType
|
||||
{
|
||||
dt_Geometry = 0, ///< \ru Изменения в геометрии. \en Changes in geometry.
|
||||
dt_NameChanged, ///< \ru Изменилось наименование. \en Name has changed.
|
||||
dt_NameNotFound, ///< \ru Не найдено соответствие имени. \en A correspondence for the name was not found.
|
||||
dt_NameMultiple, ///< \ru Найдено более одного соответствия имени. \en There are more than one correspodences for the name.
|
||||
};
|
||||
private:
|
||||
MbeTopologyType objType; ///< \ru Тип объекта с различиями. \en The type of an object with differences.
|
||||
public:
|
||||
PrimitiveDifference( MbeTopologyType type ) : objType( type ) {} ///< \ru Коннструктор по типу топологического объекта. \en Constructor by a type of topological object.
|
||||
virtual ~PrimitiveDifference() {}
|
||||
public:
|
||||
MbeTopologyType GetObjType() const { return objType; } ///< \ru Тип топологического объекта. \en The type of topological object
|
||||
virtual void Accept( Visitor & visitor ) = 0; ///< \ru Прием посетителя. \en Acceptance of a visitor.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Различие в именовании двух примитивов.
|
||||
\en Naming difference between two primitives. \~
|
||||
\details \ru Различие в именовании двух примитивов или ненайденный примитив.\n
|
||||
\en Naming difference between two primitives or not found primitive.\n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
struct MATH_CLASS NameDifference : public PrimitiveDifference {
|
||||
public:
|
||||
MbName name1; ///< \ru Имя некоего примитива в первом объекте. \en The name of a primitive in the first object.
|
||||
MbName name2; ///< \ru Имя того же примитива во втором объекте. \en The name of a primitive in the first object.
|
||||
DifferenceType diffType; ///< \ru Тип различия. \en A type of difference.
|
||||
public:
|
||||
/// \ru Различие в именовании двух примитивов. \en Naming difference between two primitives.
|
||||
NameDifference( const MbName & n1, const MbName & n2, DifferenceType dType, MbeTopologyType oType );
|
||||
/// \ru Ненайденный примитив. \en The found primitive.
|
||||
NameDifference( const MbName & n, DifferenceType dType, MbeTopologyType oTType );
|
||||
public:
|
||||
/** \brief \ru Это различие в именовании?
|
||||
\en Is this a naming difference? \~
|
||||
\details \ru Это различие в именовании?\n
|
||||
\en Is this a naming difference?\n \~
|
||||
\return \ru true, если это различие в именовании,\n
|
||||
иначе это ненайденный примитив или геометрическое различие.\n
|
||||
\en true if this is a naming difference,\n
|
||||
otherwise this is a unfound primitive or geometric difference.\n \~
|
||||
*/
|
||||
bool IsNamesDifference() const;
|
||||
|
||||
VISITING_CLASS( NameDifference )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Различие в количестве.
|
||||
\en Difference in count. \~
|
||||
\details \ru Различие в количестве.\n
|
||||
\en Difference in count.\n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS CountDifference : public PrimitiveDifference {
|
||||
public:
|
||||
size_t cnt1; ///< \ru Количество компонентов данного типа в первом объекте. \en The number of components of the given type in the first object.
|
||||
size_t cnt2; ///< \ru Количество компонентов данного типа во втором объекте. \en The number of components of the given type in the second object.
|
||||
bool valid; ///< \ru Подсчитаны корректные объекты. \en Calculated objects are correct.
|
||||
public:
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор.\n
|
||||
\en Constructor.\n \~
|
||||
\param[in] n1 - \ru Количество компонентов данного типа в первом объекте.
|
||||
\en The number of components of the given type in the first object. \~
|
||||
\param[in] n2 - \ru Количество компонентов данного типа во втором объекте.
|
||||
\en The number of components of the given type in the second object. \~
|
||||
\param[in] good - \ru Подсчитаны корректные объекты.
|
||||
\en Calculated objects are correct. \~
|
||||
\param[in] oType - \ru Тип объекта с различиями.
|
||||
\en Type of an object with differences. \~
|
||||
*/
|
||||
CountDifference( size_t n1, size_t n2, bool good, MbeTopologyType oType )
|
||||
: PrimitiveDifference( oType )
|
||||
, cnt1( n1 )
|
||||
, cnt2( n2 )
|
||||
, valid( good )
|
||||
{}
|
||||
|
||||
VISITING_CLASS( CountDifference )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Различие точек.
|
||||
\en Difference of points. \~
|
||||
\details \ru Различие точек.\n
|
||||
\en Difference of points.\n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS PointDifference : public PrimitiveDifference {
|
||||
public:
|
||||
MbCartPoint3D pnt1; ///< \ru Первая точка. \en The first point.
|
||||
MbCartPoint3D pnt2; ///< \ru Вторая точка. \en The second point.
|
||||
public:
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор.\n
|
||||
\en Constructor.\n \~
|
||||
\param[in] p1 - \ru Первая точка.
|
||||
\en The first point. \~
|
||||
\param[in] p2 - \ru Вторая точка.
|
||||
\en The second point. \~
|
||||
\param[in] objType - \ru Тип объекта с различиями.
|
||||
\en Type of an object with differences. \~
|
||||
*/
|
||||
PointDifference( const MbCartPoint3D & p1, const MbCartPoint3D & p2, MbeTopologyType objType );
|
||||
|
||||
VISITING_CLASS( PointDifference )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Различие нормалей.
|
||||
\en Difference of normals. \~
|
||||
\details \ru Различие нормалей.\n
|
||||
\en Difference of normals.\n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS VectorDifference : public PrimitiveDifference {
|
||||
public:
|
||||
MbVector3D vect1; ///< \ru Первый вектор. \en The first vector.
|
||||
MbVector3D vect2; ///< \ru Второй вектор. \en The second vector.
|
||||
public:
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор.\n
|
||||
\en Constructor.\n \~
|
||||
\param[in] v1 - \ru Первый вектор.
|
||||
\en The first vector. \~
|
||||
\param[in] v2 - \ru Второй вектор.
|
||||
\en The second vector. \~
|
||||
\param[in] objType - \ru Тип объекта с различиями.
|
||||
\en Type of an object with differences. \~
|
||||
*/
|
||||
VectorDifference( const MbVector3D & v1, const MbVector3D & v2, MbeTopologyType objType );
|
||||
|
||||
VISITING_CLASS( VectorDifference )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Результат сравнения двух объектов.
|
||||
\en The result of comparison between two objects. \~
|
||||
\details \ru Результат сравнения двух объектов.\n
|
||||
\en The result of comparison between two objects.\n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS CompareItemsResult {
|
||||
protected:
|
||||
bool areItemsEqual; ///< \ru Признак отсутствия различий в моделях и в именованиях. \en Attribute of absence of differences in models and names.
|
||||
PArray<PrimitiveDifference> differences; ///< \ru Различия в именовании примитивов и ненайденные примитивы. \en Differences in primitives names and unfound primitives.
|
||||
public:
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор результата сравнения одинаковых моделей.\n
|
||||
\en Constructor of result of comparison between equal models.\n \~
|
||||
*/
|
||||
CompareItemsResult();
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~CompareItemsResult();
|
||||
public:
|
||||
|
||||
void Reset(); ///< \ru Сбросить различия. \en Reset differences.
|
||||
void Add( PrimitiveDifference & diff ); ///< \ru Добавить различие. \en Add a difference.
|
||||
|
||||
void SetItemsEqual( bool set ); ///< \ru Установить флаг отсутствия различий. \en Set the flag when differences are absence.
|
||||
|
||||
/** \brief \ru Тела одинаковые?
|
||||
\en Are solids equal? \~
|
||||
\details \ru Тела одинаковые?\n
|
||||
\en Are solids equal?\n \~
|
||||
\return \ru true, если нет ни различий в именовании, ни геометрических отличий.
|
||||
\en true if there are no naming differences and there are no geometric differences. \~
|
||||
*/
|
||||
bool AreItemsEqual() const;
|
||||
|
||||
size_t NamesDifferencesCount() const; ///< \ru Число различий в именовании. \en The number of naming differences.
|
||||
bool HaveGeometricDifferences() const; ///< \ru Есть геометрические различия? \en Is there any geometric difference?
|
||||
|
||||
const PArray<PrimitiveDifference> & GetPrimitiveDifferences() const; ///< \ru Дать результаты сравнения. \en Get comparison results.
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// \ru Функции \en Functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Способы "перемешивания".
|
||||
\en Ways of "mixing". \~
|
||||
\details \ru Способы "перемешивания" составляющих оболочки.
|
||||
\en Ways of shell components "mixing". \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
enum SolidMixUpMode {
|
||||
/// \ru Изменение порядка следования граней в массиве. \en A change of faces order in array.
|
||||
smm_FacesReorder = 1,
|
||||
|
||||
/// \ru Изменение порядок следования циклов на грянях (толко внутренних). \en A change of loops order in faces (internal only).
|
||||
smm_LoopsReorder = 2,
|
||||
|
||||
/// \ru Изменение начального ребра в циклах граней. \en A change of first edge in loops of faces.
|
||||
smm_LoopsBegReset = 4, //-V112
|
||||
|
||||
/// \ru Изменение направления ребер в циклах граней. \en A change of edges directions in loops of faces.
|
||||
smm_EdgesRedirection = 8,
|
||||
|
||||
/// \ru Разбивка ребер вставкой вершины. \en Splitting of edges by vertex insertion.
|
||||
smm_EdgesSection = 16,
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Стрессовый тест тела.
|
||||
\en A stress test for solid. \~
|
||||
\details \ru Стрессовый тест тела, перемешивание составляющих оболочки.\n
|
||||
\en A stress test for solid, shell components mixing.\n \~
|
||||
\param[in] solid - \ru Тестируемое тело.
|
||||
\en The tested solid. \~
|
||||
\param[in] mixUpModes - \ru Флаги из SolidMixUpMode.
|
||||
\en Flags from SolidMixUpMode. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC ( void ) SolidMixUp( MbSolid & solid, uint mixUpModes );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Сравнение двух тел.
|
||||
\en Two solids comparison. \~
|
||||
\details \ru Сравнение двух тел.\n
|
||||
\en Two solids comparison.\n \~
|
||||
\param[in] solid1 - \ru Первое тело.
|
||||
\en The first solid. \~
|
||||
\param[in] solid2 - \ru Второе тело.
|
||||
\en The second solid. \~
|
||||
\param[in] compareMassInertia - \ru Проверять сначала МЦХ тел.
|
||||
\en Check mass-inertial properties at first. \~
|
||||
\param[in] checkSense - \ru Проверять совпадение ориентаций рёбер и граней.
|
||||
\en Check orientations coincidence of edges and faces. \~
|
||||
\param[out] compareResult - \ru Результат сравнения двух тел.
|
||||
\en The result of comparison between two solids. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CompareSolids( const MbSolid & solid1,
|
||||
const MbSolid & solid2,
|
||||
CompareItemsResult & compareResult,
|
||||
bool compareMassInertia,
|
||||
bool checkSense );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Сравнение двух тел по именам.
|
||||
\en Comparison of two solids by name. \~
|
||||
\details \ru Сравнение двух тел по именам.\n
|
||||
\en Comparison of two solids by name.\n \~
|
||||
\param[in] before - \ru Тело до перестроения.
|
||||
\en The solid before construction. \~
|
||||
\param[in] after - \ru Тело после перестроения.
|
||||
\en The solid after construction. \~
|
||||
\param[out] compareResult - \ru Результат сравнения двух тел.
|
||||
\en The result of comparison between two solids. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) CompareSolidsByNames( const MbSolid & before,
|
||||
const MbSolid & after,
|
||||
CompareItemsResult & compareResult );
|
||||
|
||||
|
||||
#endif // __ATS_CHECK_H
|
||||
@@ -0,0 +1,343 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты. Цвет. Толщина линий отрисовки. Стиль линий отрисовки. Свойства для OpenGL.
|
||||
\en Attributes. Color. Thickness of drawing lines. Style of drawing lines. Properties for OpenGL. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_COLOR_H
|
||||
#define __ATTR_COLOR_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribut.h>
|
||||
#include <mb_variables.h>
|
||||
|
||||
|
||||
#define __RGB__ 3
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Преобразовать цвет по трём компонентам в uint32.
|
||||
\en Convert a color by 3 components in uint32. \~
|
||||
\details
|
||||
\warning \ru Значения компонент цвета должны лежать в диапазоне [ 0; 1 ].
|
||||
\en Values of color components should belong to the range [ 0; 1 ]. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
inline uint32 RGB2uint32( double r, double g, double b )
|
||||
{
|
||||
const double f1 = 255.0 / 256.0;
|
||||
uint32 uinturgb[3];
|
||||
const uint32 bt = 256;
|
||||
uinturgb[0] = uint32 ( 256.0 * r * f1 );
|
||||
uinturgb[1] = uint32 ( 256.0 * g * f1 );
|
||||
uinturgb[2] = uint32 ( 256.0 * b * f1 );
|
||||
for ( int n = 0; n < 3; n++ )
|
||||
if ( uinturgb[n] >= bt ) {
|
||||
uinturgb[n] = bt - 1;
|
||||
C3D_ASSERT_UNCONDITIONAL( false );
|
||||
}
|
||||
return uinturgb[0] + bt * ( uinturgb[1] + bt * uinturgb[2] );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Преобразовать unit32 в три компоненты цвета.
|
||||
\en Convert unit32 to 3 components of color. \~
|
||||
\details
|
||||
\warning \ru Компоненты цветов лежат в диапазоне [ 0; 1 ].
|
||||
\en Color components belong to the range [ 0; 1 ]. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
template<typename float_t>
|
||||
void uint322RGB( uint32 color, float_t& r, float_t& g, float_t& b ) {
|
||||
const float_t r255 = float_t(1.0 / 255.0);
|
||||
const uint32 u256 = (uint32)SYS_MAX_UINT8 + 1;
|
||||
r = float_t ( color % u256);
|
||||
g = float_t ( (color / 256) % u256);
|
||||
b = float_t ( (color / 65536) % u256);
|
||||
r *= r255; g *= r255; b *= r255;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Цвет.
|
||||
\en Color. \~
|
||||
\details \ru Цвет. \n
|
||||
\en Color. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbColor : public MbElementaryAttribute {
|
||||
protected :
|
||||
uint32 color; ///< \ru Цвет. \en Color.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbColor( const MbColor & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbColor( uint32 init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbColor();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить цвет. \en Set a color.
|
||||
void Init( uint32 init ) { color = init; }
|
||||
/// \ru Дать цвет. \en Get a color.
|
||||
uint32 Color() const { return color; }
|
||||
//int R() const { return red; } // \ru Красный цвет \en Red color
|
||||
//int G() const { return green; } // \ru Зеленый цвет \en Green color
|
||||
//int B() const { return blue; } // \ru Синий цвет \en Blue color
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbColor & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbColor )
|
||||
}; // MbColor
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbColor )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Толщина линий отрисовки.
|
||||
\en Thickness of drawing lines. \~
|
||||
\details \ru Толщина линий отрисовки. \n
|
||||
\en Thickness of drawing lines. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbWidth : public MbElementaryAttribute {
|
||||
protected :
|
||||
int width; ///< \ru Толщина линий отрисовки. \enThickness of drawing lines.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbWidth( const MbWidth & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbWidth( int init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbWidth();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить толщину. \en Set a thickness.
|
||||
void Init( int init ) { width = init; }
|
||||
/// \ru Дать толщину. \en Get a thickness.
|
||||
int Width() const { return width; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbWidth & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbWidth )
|
||||
}; // MbWidth
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbWidth )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Стиль линий отрисовки.
|
||||
\en Style of drawing lines. \~
|
||||
\details \ru Стиль линий отрисовки. \n
|
||||
\en Style of drawing lines. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbStyle : public MbElementaryAttribute {
|
||||
protected :
|
||||
int style; ///< \ru Стиль линий отрисовки. \en Style of drawing lines.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbStyle( const MbStyle & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbStyle( int init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbStyle();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить стиль линий отрисовки. \en Set style of drawing lines.
|
||||
void Init( int init ) { style = init; }
|
||||
/// \ru Дать стиль линий отрисовки. \en Get style of drawing lines.
|
||||
int Style() const { return style; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbStyle & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbStyle )
|
||||
}; // MbStyle
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbStyle )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Свойства для OpenGL.
|
||||
\en Properties for OpenGL. \~
|
||||
\details \ru Свойства для OpenGL для трех цветов: RED, GREEN, BLUE. \n
|
||||
\en Properties for OpenGL for colors: RED, GREEN, BLUE. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbVisual : public MbElementaryAttribute {
|
||||
protected :
|
||||
float ambient[__RGB__]; ///< \ru Коэффициент общего фона для трех цветов: RED, GREEN, BLUE. \en Coefficient of ambient background for colors: RED, GREEN, BLUE, range 0.0 - 1.0.
|
||||
float diffuse[__RGB__]; ///< \ru Коэффициент диффузного отражения для трех цветов: RED, GREEN, BLUE. \en Coefficient of diffuse reflection for colors: RED, GREEN, BLUE, range 0.0 - 1.0.
|
||||
float specularity[__RGB__]; ///< \ru Коэффициент зеркального отражения света трех цветов: RED, GREEN, BLUE. \en Coefficient of specular reflection for light colors: RED, GREEN, BLUE, range 0.0 - 1.0.
|
||||
float shininess; ///< \ru Блеск (показатель степени в законе зеркального отражения). \en Shininess (index according to the law of specular reflection), range 0 - 128.
|
||||
float opacity; ///< \ru Коэффициент непрозрачности (коэффициент суммарного отражения). \en Opacity coefficient (coefficient of total reflection), range 0.0 (transparent) - 1.0(opaque).
|
||||
float emission; ///< \ru Коэффициент излучения. \en Emissivity coefficient, range 0.0 - 1.0.
|
||||
float chrom; ///< \ru Коэффициент зеркального отражения объектов. \en Coefficient of specular reflection for objects, range 0.0 - 1.0.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbVisual( const MbVisual & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbVisual( float a = MB_AMBIENT, float d = MB_DIFFUSE, float s = MB_SPECULARITY,
|
||||
float h = MB_SHININESS, float t = MB_OPACITY, float e = MB_EMISSION );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbVisual();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить свойства для OpenGL. \en Set properties for OpenGL.
|
||||
void Init( float a = MB_AMBIENT, float d = MB_DIFFUSE, float s = MB_SPECULARITY,
|
||||
float h = MB_SHININESS, float t = MB_OPACITY, float e = MB_EMISSION, uint rgb = 0 ) {
|
||||
ambient[rgb%__RGB__] = a; // \ru Коэффициент общего фона. \en Coefficient of ambient background.
|
||||
diffuse[rgb%__RGB__] = d; // \ru Коэффициент диффузного отражения. \en Coefficient of diffuse reflection.
|
||||
specularity[rgb%__RGB__] = s; // \ru Коэффициент зеркального отражения света. \en Coefficient of specular reflection for light.
|
||||
shininess = h; // \ru Блеск (показатель степени. в законе зеркального отражения). \en Shininess (index according to the law of specular reflection).
|
||||
opacity = t; // \ru Коэффициент непрозрачности. \en Opacity coefficient.
|
||||
emission = e; // \ru Коэффициент излучения. \en Emissivity coefficient.
|
||||
chrom = s; // \ru Коэффициент зеркального отражения объектов. \en Coefficient of specular reflection for objects.
|
||||
}
|
||||
/// \ru Дать свойства для OpenGL. \en Get properties for OpenGL.
|
||||
void Get( float & a, float & d, float & s, float & h, float & t, float & e, uint rgb = 0 ) const {
|
||||
a = ambient[rgb%__RGB__]; // \ru Коэффициент общего фона. \en Coefficient of ambient background.
|
||||
d = diffuse[rgb%__RGB__]; // \ru Коэффициент диффузного отражения. \en Coefficient of diffuse reflection.
|
||||
s = specularity[rgb%__RGB__]; // \ru Коэффициент зеркального отражения света. \en Coefficient of Specular reflection for light.
|
||||
h = shininess; // \ru Блеск (показатель степени в законе зеркального отражения). \en Shininess (index according to the law of specular reflection).
|
||||
t = opacity; // \ru Коэффициент непрозрачности. \en Opacity coefficient.
|
||||
e = emission; // \ru Коэффициент излучения. \en Emissivity coefficient.
|
||||
}
|
||||
float Ambient ( uint rgb = 0 ) const { return ambient[rgb%__RGB__]; } // \ru Дать коэффициент общего фона. \en Get a coefficient of ambient background.
|
||||
float Diffuse ( uint rgb = 0 ) const { return diffuse[rgb%__RGB__]; } // \ru Дать коэффициент диффузного отражения. \en Get a coefficient of diffuse reflection.
|
||||
float Specularity ( uint rgb = 0 ) const { return specularity[rgb%__RGB__]; } // \ru Дать коэффициент зеркального отражения света. \en Get a coefficient of specular reflection for light.
|
||||
float Shininess () const { return shininess; } // \ru Дать блеск (показатель степени в законе зеркального отражения). \en Get shininess (index according to the law of specular reflection).
|
||||
float Opacity () const { return opacity; } // \ru Дать коэффициент непрозрачности. \en Get an opacity coefficient.
|
||||
float Emission () const { return emission; } // \ru Дать коэффициент излучения. \en Get a coefficient of emissivity.
|
||||
float Chrom () const { return chrom; } // \ru Дать коэффициент зеркального отражения объектов. \en Get a coefficient of specular reflection for objects.
|
||||
const float * Ambients () const { return ambient; } // \ru Дать коэффициенты общего фона. \en Get all coefficients of ambient background.
|
||||
const float * Diffuses () const { return diffuse; } // \ru Дать коэффициенты диффузного отражения. \en Get all coefficients of diffuse reflection.
|
||||
const float * Specularitys() const { return specularity; } // \ru Дать коэффициенты зеркального отражения света. \en Get all coefficients of specular reflection for light.
|
||||
|
||||
void SetAmbient ( float v, uint rgb = 0 ) { ambient[rgb%__RGB__] = v; } // \ru Установить коэффициент общего фона. \en Set a coefficient of ambient background.
|
||||
void SetDiffuse ( float v, uint rgb = 0 ) { diffuse[rgb%__RGB__] = v ; } // \ru Установить коэффициент диффузного отражения. \en Set a coefficient of diffuse reflection.
|
||||
void SetSpecularity ( float v, uint rgb = 0 ) { specularity[rgb%__RGB__] = v; } // \ru Установить коэффициент зеркального отражения света. \en Set a coefficient of specular reflection for light.
|
||||
void SetShininess ( float v ) { shininess = v; } // \ru Установить блеск (показатель степени в законе зеркального отражения). \en Set shininess (index according to the law of specular reflection).
|
||||
void SetOpacity ( float v ) { opacity = v; } // \ru Установить коэффициент непрозрачности. \en Set an opacity coefficient.
|
||||
void SetEmission ( float v ) { emission = v; } // \ru Установить коэффициент излучения. \en Set a coefficient of emissivity.
|
||||
void SetChrom ( float v ) { chrom = v; } // \ru Установить коэффициент зеркального отражения объектов. \en Set a coefficient of specular reflection for objects.
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbVisual & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbVisual )
|
||||
}; // MbVisual
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbVisual )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Количество u-линий и v-линий отрисовочной сетки.
|
||||
\en The number of u-mesh and v-mesh drawing lines. \~
|
||||
\details \ru Количество u-линий и v-линий отрисовочной сетки. \n
|
||||
\en The number of u-mesh and v-mesh drawing lines. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbWireCount : public MbElementaryAttribute {
|
||||
protected :
|
||||
size_t uMeshCount; ///< \ru Количество u-линий отрисовочной сетки. \en The number of u-mesh lines.
|
||||
size_t vMeshCount; ///< \ru Количество v-линий отрисовочной сетки. \en The number of v-mesh lines.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbWireCount( const MbWireCount & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbWireCount( size_t uCount, size_t vCount );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbWireCount();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить количество линий отрисовки. \en Set count of drawing lines.
|
||||
void Init( size_t uCount, size_t vCount ) { uMeshCount = uCount, vMeshCount = vCount; }
|
||||
/// \ru Выдать количество разбиений по u и v. \en The the number of splittings in u-direction and v-direction.
|
||||
void Get( size_t & uCount, size_t & vCount ) const { uCount = uMeshCount; vCount = vMeshCount; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbWireCount & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbWireCount )
|
||||
}; // MbWireCount
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbWireCount )
|
||||
|
||||
|
||||
#endif // __ATTR_COLOR_H
|
||||
@@ -0,0 +1,302 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Подтип обобщенные атрибуты.
|
||||
\en Common attributes subtype. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_COMMON_ATTRIBUE_H
|
||||
#define __ATTR_COMMON_ATTRIBUE_H
|
||||
|
||||
|
||||
#include <attribute.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Обобщенный атрибут - базовый класс.
|
||||
\en Common attribute - the base class. \~
|
||||
\details \ru Обобщенный атрибут - базовый класс. \n
|
||||
\en Common attribute - the base class. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbCommonAttribute : public MbAttribute {
|
||||
protected :
|
||||
c3d::string_t prompt_; ///< \ru Строка описания. \en String of description.
|
||||
bool changeable; ///< \ru Признак редактируемости. \en Attribute of editability.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbCommonAttribute( const c3d::string_t & prompt, bool change );
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbCommonAttribute( bool change );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbCommonAttribute();
|
||||
|
||||
public :
|
||||
virtual MbeAttributeType AttributeFamily() const; // \ru Выдать тип атрибута. \en Get attribute type.
|
||||
virtual MbeAttributeType AttributeType() const = 0; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ) = 0; // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
// \ru Выполнить действия при изменении владельца, не связанное с другими действиями. \en Perform actions which are not associated with other actions when changing the owner.
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner );
|
||||
// \ru Выполнить действия при конвертации владельца. \en Perform actions when converting the owner.
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg = NULL );
|
||||
// \ru Выполнить действия при объединении владельца. \en Perform actions when merging he owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner.
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при разделении владельца. \en Perform actions when splitting the owner.
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others );
|
||||
// \ru Выполнить действия при удалении владельца. \en Perform actions when deleting the owner.
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner );
|
||||
|
||||
virtual void GetCharValue( TCHAR * v ) const = 0; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual void GetProperties( MbProperties & ) = 0; // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ) = 0; // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
/** \brief \ru Выдать подсказку атрибута. \en Get a prompt of attribute.
|
||||
\details \ru Строковое значение, которое может быть использовано, как совего рода тэг, имя или пометка атрибута.
|
||||
\en String value which can be used as some kind of tag, name or label of an attribute.
|
||||
*/
|
||||
const c3d::string_t & GetPrompt() const;
|
||||
/// \ru Выдать признак изменяемости. \en Get an attribute of changeability.
|
||||
bool IsChangeable() const;
|
||||
|
||||
DECLARE_PERSISTENT_CLASS( MbCommonAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbCommonAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCommonAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru bool атрибут.
|
||||
\en Bool attribute. \~
|
||||
\details \ru bool атрибут. \n
|
||||
\en Bool attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbBoolAttribute : public MbCommonAttribute {
|
||||
private:
|
||||
bool value_; ///< \ru Значение. \en The value.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbBoolAttribute( const c3d::string_t & prompt, bool change, bool initValue );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbBoolAttribute();
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
bool GetValue() const; // \ru Выдать значение свойства. \en Get a value of the property.
|
||||
bool SetValue( bool val ); // \ru Установить новое значение свойства. \en Set new value of the property.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBoolAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbBoolAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBoolAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru int атрибут.
|
||||
\en Int attribute. \~
|
||||
\details \ru int атрибут. \n
|
||||
\en Int attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbIntAttribute : public MbCommonAttribute {
|
||||
private:
|
||||
int value_; ///< \ru Значение. \en The value.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbIntAttribute( const c3d::string_t & prompt, bool change, int initValue );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbIntAttribute();
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
int GetValue() const; // \ru Выдать значение свойства. \en Get a value of the property.
|
||||
bool SetValue( int val ); // \ru Установить новое значение свойства. \en Set new value of the property.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbIntAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbIntAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbIntAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru int64 атрибут.
|
||||
\en Int64 attribute. \~
|
||||
\details \ru int64 атрибут. \n
|
||||
\en Int64 attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbInt64Attribute : public MbCommonAttribute {
|
||||
private:
|
||||
int64 value_; ///< \ru Значение. \en The value.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbInt64Attribute( const c3d::string_t & prompt, bool change, int64 initValue );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbInt64Attribute();
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
int64 GetValue() const; // \ru Выдать значение свойства. \en Get a value of the property.
|
||||
bool SetValue( int64 val ); // \ru Установить новое значение свойства. \en Set new value of the property.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbInt64Attribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbInt64Attribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbInt64Attribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru double атрибут.
|
||||
\en Double attribute. \~
|
||||
\details \ru double атрибут. \n
|
||||
\en Double attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbDoubleAttribute : public MbCommonAttribute {
|
||||
private:
|
||||
double value_; ///< \ru Значение. \en The value.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbDoubleAttribute( const c3d::string_t & prompt, bool change, double initValue );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbDoubleAttribute();
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
double GetValue() const; // \ru Выдать значение свойства. \en Get a value of the property.
|
||||
bool SetValue( double val ); // \ru Установить новое значение свойства. \en Set new value of the property.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbDoubleAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbDoubleAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbDoubleAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru String атрибут.
|
||||
\en String attribute. \~
|
||||
\details \ru String атрибут. \n
|
||||
\en String attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbStringAttribute : public MbCommonAttribute {
|
||||
private:
|
||||
c3d::string_t value_; ///< \ru Значение. \en The value.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbStringAttribute( const c3d::string_t & prompt, bool change, const c3d::string_t & string );
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
c3d::string_t GetValue() const; // \ru Выдать значение свойства. \en Get a value of the property.
|
||||
bool SetValue( c3d::string_t & val ); // \ru Установить новое значение свойства. \en Set new value of the property.
|
||||
|
||||
protected:
|
||||
virtual ~MbStringAttribute(); // Use AddRef/Release or smart pointer SPtr<MbAttribute> to destruct it correctly.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbStringAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbStringAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbStringAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Бинарный атрибут.
|
||||
\en Binary attribute. \~
|
||||
\details \ru Бинарный атрибут. \n
|
||||
\en Binary attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbBinaryAttribute : public MbCommonAttribute {
|
||||
private:
|
||||
std::vector<unsigned char> value_; ///< \ru Значение. \en The value.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbBinaryAttribute( const c3d::string_t & prompt, bool change, const std::vector<unsigned char> & value );
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
std::vector<unsigned char> GetValue() const; // \ru Выдать значение свойства. \en Get a value of the property.
|
||||
bool SetValue( std::vector<unsigned char> & val ); // \ru Установить новое значение свойства. \en Set new value of the property.
|
||||
|
||||
protected:
|
||||
virtual ~MbBinaryAttribute(); // Use AddRef/Release or smart pointer SPtr<MbAttribute> to destruct it correctly.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBinaryAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbBinaryAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBinaryAttribute )
|
||||
|
||||
#endif // __ATTR_COMMON_ATTRIBUE_H
|
||||
@@ -0,0 +1,163 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты. Плотность.
|
||||
\en Attributes. Density. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_DENCITY_H
|
||||
#define __ATTR_DENCITY_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribut.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Плотность.
|
||||
\en Density. \~
|
||||
\details \ru Плотность. \n
|
||||
\en Density. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbDencity : public MbElementaryAttribute {
|
||||
protected :
|
||||
double dencity; ///< \ru Плотность. \en Density.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbDencity( const MbDencity & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbDencity( double init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbDencity();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить плотность. \en Set a density.
|
||||
void Init( double init ) { dencity = init; }
|
||||
/// \ru Дать плотность. \en Get a density.
|
||||
double Dencity() const { return dencity; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbDencity & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbDencity )
|
||||
|
||||
}; // MbDencity
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbDencity )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Жесткость.
|
||||
\en The stiffness. \~
|
||||
\details \ru Механические характеристики материала: модуль Юнга и коэффициент Пуассана. \n
|
||||
\en Mechanical properties of the material: Young's modulus and Poisson's ratio. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbElasticity : public MbElementaryAttribute {
|
||||
protected :
|
||||
double young; ///< \ru Модуль Юнга. \en The Young's modulus of material.
|
||||
double poisson; ///< \ru Коэффициент Пуассона. \en The Poisson's ratio of material.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbElasticity( const MbElasticity & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbElasticity( double e, double v );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbElasticity();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить свойства. \en Set a density.
|
||||
void Init( double e_, double v_ ) { young = e_; poisson = v_; }
|
||||
/// \ru Дать Модуль Юнга. \en Get an Young's modulus.
|
||||
double YoungModulus() const { return young; }
|
||||
/// \ru Дать Коэффициент Пуассона. \en Get a Poisson's ratio.
|
||||
double PoissonRatio() const { return poisson; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbElasticity & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbElasticity )
|
||||
|
||||
}; // MbElasticity
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbElasticity )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Деформации / Напряжения.
|
||||
\en The strains / The tensions. \~
|
||||
\details \ru Напряжённо деформированное состояние объекта - три деформации или три напряжения. \n
|
||||
\en Tension strain state of an object. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbStrains : public MbElementaryAttribute {
|
||||
protected :
|
||||
double strain1; ///< \ru Деформация 1 / Напряжение 1. \en The strain 1 / The tension 1.
|
||||
double strain2; ///< \ru Деформация 2 / Напряжение 2. \en The strain 2 / The tension 2.
|
||||
double strain3; ///< \ru Деформация 3 / Напряжение 3. \en The strain 3 / The tension 3.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbStrains( const MbStrains & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbStrains( double e1, double e2, double e3 );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbStrains();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Установить свойства. \en Set a density.
|
||||
void Init( double e1, double e2, double e3 ) { strain1 = e1; strain2 = e2; strain3 = e3; }
|
||||
/// \ru Дать деформированное состояние объекта. \en Get a deformed state.
|
||||
double Strain( size_t i ) const { if ( i <= 1 ) return strain1; else if ( i == 2 ) return strain1; else return strain3; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbStrains & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbStrains )
|
||||
|
||||
}; // MbStrains
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbStrains )
|
||||
|
||||
|
||||
#endif // __ATTR_DENCITY_H
|
||||
@@ -0,0 +1,68 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Подтип элементарные атрибуты.
|
||||
\en Elementary attributes subtype. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_ELEMENTARY_ATTRIBUTE_H
|
||||
#define __ATTR_ELEMENTARY_ATTRIBUTE_H
|
||||
|
||||
|
||||
#include <attribute.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Элементарный атрибут - базовый класс.
|
||||
\en Elementary attribute - the base class. \~
|
||||
\details \ru Элементарный атрибут - базовый класс. \n
|
||||
\en Elementary attribute - the base class. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbElementaryAttribute : public MbAttribute {
|
||||
protected:
|
||||
MbElementaryAttribute();
|
||||
public:
|
||||
virtual ~MbElementaryAttribute();
|
||||
|
||||
public :
|
||||
virtual MbeAttributeType AttributeFamily() const; // \ru Тип атрибута \en Type of an attribute
|
||||
virtual MbeAttributeType AttributeType() const = 0; // \ru Выдать подтип атрибута \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const = 0; // \ru Сделать копию элемента \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const = 0; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ) = 0; // \ru Инициализировать данные по присланным \en Initialize data.
|
||||
|
||||
// \ru Действия при изменении владельца, не связанное с другими действиями. \en Actions which are not associated with other actions when changing the owner.
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner );
|
||||
// \ru Действия при конвертации владельца. \en Actions when converting the owner.
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
/// \ru Действия при трансформировании владельца. \en Actions when transforming the owner.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg = NULL );
|
||||
// \ru Действия при перемещении владельца. \en Actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Действия при вращении владельца. \en Actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// \ru Действия при копировании владельца. \en Actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg = NULL );
|
||||
// \ru Действия при объединении владельца. \en Actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Действия при замене владельца. \en Actions when replacing the owner.
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Действия при разделении владельца. \en Actions when splitting the owner.
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others );
|
||||
// \ru Действия при удалении владельца. \en Actions when merging the owner.
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner );
|
||||
|
||||
virtual void GetProperties( MbProperties & ) = 0; // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual size_t SetProperties( const MbProperties & ) = 0; // \ru Установить свойства объекта \en Set properties of object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
DECLARE_PERSISTENT_CLASS( MbElementaryAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbElementaryAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbElementaryAttribute )
|
||||
|
||||
#endif // __ATTR_ELEMENTARY_ATTRIBUTE_H
|
||||
@@ -0,0 +1,89 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Геометрический атрибут.
|
||||
\en Geometric attribute. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_GEOMETRIC_ATTRIBUTE_H
|
||||
#define __ATTR_GEOMETRIC_ATTRIBUTE_H
|
||||
|
||||
|
||||
#include <attr_common_attribut.h>
|
||||
#include <attr_registry.h>
|
||||
#include <math_define.h>
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbSpaceItem;
|
||||
class MATH_CLASS MbProperty;
|
||||
class MATH_CLASS MbProperties;
|
||||
class MbRegTransform;
|
||||
class MbRegDuplicate;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Геометрический атрибут.
|
||||
\en Geometric attribute. \~
|
||||
\details \ru Геометрический атрибут. \n
|
||||
\en Geometric attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbGeomAttribute : public MbCommonAttribute {
|
||||
protected :
|
||||
MbSpaceItem * spaceItem; ///< \ru Геометрический объект. \en A geometric object.
|
||||
MbeCreatorType type; ///< \ru Тип операции. \en Operation type.
|
||||
bool keepItem; ///< \ru Сохранять исходный объект при копировании. \en Save the initial object when copying.
|
||||
|
||||
private:
|
||||
// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbGeomAttribute( const MbGeomAttribute & init, MbRegDuplicate * iReg );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbGeomAttribute( const MbSpaceItem & item, MbeCreatorType t, bool keepItem );
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbGeomAttribute( const MbSpaceItem & item, MbeCreatorType t, bool keepItem, const c3d::string_t & itemPrompt );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbGeomAttribute();
|
||||
|
||||
public:
|
||||
// \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbeAttributeType AttributeType() const;
|
||||
// \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const;
|
||||
// \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const;
|
||||
// \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual bool Init( const MbAttribute & );
|
||||
// \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg );
|
||||
// \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
/// \ru Дать геометрический объект. \en Get geometric object.
|
||||
const MbSpaceItem * GetSpaceItem() const { return spaceItem; }
|
||||
MbSpaceItem * SetSpaceItem() { return spaceItem; }
|
||||
/// \ru Заменить геометрический объект. \en Replace geometric object.
|
||||
void ChangeSpaceItem( MbSpaceItem & init );
|
||||
/// \ru Дать тип операции. \en Get operation type.
|
||||
MbeCreatorType GetOperationType() const { return type; }
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbGeomAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbGeomAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbGeomAttribute )
|
||||
|
||||
#endif // __ATTR_GEOMETRIC_ATTRIBUTE_H
|
||||
@@ -0,0 +1,322 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Идентификатор объекта.
|
||||
\en Object identifier. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_IDENTIFIER_H
|
||||
#define __ATTR_IDENTIFIER_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribut.h>
|
||||
#include <name_item.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Идентификатор объекта.
|
||||
\en Object identifier. \~
|
||||
\details \ru Идентификатор объекта. \n
|
||||
\en Object identifier. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbIdentifier : public MbElementaryAttribute {
|
||||
protected :
|
||||
int32 identifier; ///< \ru Идентификатор объекта. \en Object identifier.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbIdentifier( const MbIdentifier & );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbIdentifier( int32 init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbIdentifier();
|
||||
|
||||
// \ru Общие функции объекта. \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
// \ru Специфические свойства объекта. \en Specific functions of object.
|
||||
|
||||
/// \ru Установить идентификатор. \en Set identifier.
|
||||
void Init( int32 init ) { identifier = init; }
|
||||
/// \ru Дать идентификатор объекта. \en Get identifier of object.
|
||||
int32 Identifier() const { return identifier; }
|
||||
|
||||
private:
|
||||
MbIdentifier & operator = ( const MbIdentifier & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbIdentifier )
|
||||
}; // MbIdentifier
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbIdentifier )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Топологическое имя.
|
||||
\en Topological name. \~
|
||||
\details \ru Топологическое имя. \n
|
||||
\en Topological name. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbNameAttribute : public MbElementaryAttribute {
|
||||
typedef std::vector<MbNameAttribute *> NameAttributesVector;
|
||||
protected :
|
||||
MbName tName; ///< \ru Топологическое имя объекта. \en A name of a topological object
|
||||
private:
|
||||
NameAttributesVector parentNames; ///< \ru Топологические имена родителей объекта. \en Topological names of object parents.
|
||||
mutable bool isTemporal; ///< \ru Атрибут временный, на время операции (Этот признак не пишется и не читается). \en Attribute is temporary, for the duration of the operation only (This tag is not read or written).
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbNameAttribute( const MbNameAttribute & );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbNameAttribute( bool isTemporal = false );
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbNameAttribute( const MbName &, bool isTemporal = false );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbNameAttribute();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
// \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
|
||||
/// \ru Выдать имя. \en Get name.
|
||||
const MbName & GetName() const { return tName; }
|
||||
/// \ru Выдать имя. \en Get name.
|
||||
MbName & SetName() { return tName; }
|
||||
/// \ru Установить имя. \en Set name.
|
||||
void SetName( const MbName &, bool deleteParentNames = true );
|
||||
|
||||
/// \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.
|
||||
size_t GetParentNamesCount() const { return parentNames.size(); }
|
||||
/// \ru Удалить имена родительских объектов. \en Delete names of parent objects.
|
||||
void DeleteParentNames();
|
||||
/// \ru Добавить имя родительского объекта. \en Add a name of parent object.
|
||||
bool AddParentName( const MbName &, 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( std::vector<const MbName *> & ) const;
|
||||
///< \ru Является ли атрибут временным. \en Whether this attribute is temporary.
|
||||
bool IsTemporal() const { return isTemporal; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
MbNameAttribute & operator = ( const MbNameAttribute & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbNameAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbNameAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Метка времени обновления.
|
||||
\en Stamp of update time. \~
|
||||
\details \ru Метка времени обновления. \n
|
||||
\en Stamp of update time. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbUpdateStamp : public MbElementaryAttribute
|
||||
{
|
||||
protected :
|
||||
uint32 updStamp; ///< \ru Значение метки. \en The value of stamp.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbUpdateStamp( const MbUpdateStamp & );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbUpdateStamp();
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbUpdateStamp( uint32 stampVal );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbUpdateStamp();
|
||||
|
||||
// \ru Общие функции объекта \en Common functions of object
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Сбросить значение метки времени обновления. \en Reset a value of a stamp of update time.
|
||||
void ResetStamp() { updStamp = 0; }
|
||||
/// \ru Проверить, равно ли значение метки нулю. \en Check whether the value of a stamp is null.
|
||||
bool IsNull () const { return updStamp == 0; }
|
||||
/// \ru Дать значение метки времени обновления. \en Get the value of a stamp of update time.
|
||||
uint32 GetStamp () const { return updStamp; }
|
||||
|
||||
/// \ru Увеличить значение метки на единицу. \en Increase the value of stamp by one.
|
||||
void Increment () { updStamp++; }
|
||||
/// \ru Установить значение метки максимальным из присланного и действующего. \en Set the value of stamp to the maximum from the given value and the current value.
|
||||
void Maximize ( uint32 val ) { if (val > updStamp) updStamp = val; }
|
||||
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
MbUpdateStamp & operator = ( const MbUpdateStamp & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbUpdateStamp )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbUpdateStamp )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Атрибут "якорь".
|
||||
\en Attribute "anchor". \~
|
||||
\details \ru Атрибут "якорь". \n
|
||||
\en Attribute "anchor". \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbAnchorAttribute : public MbAttribute {
|
||||
public:
|
||||
enum AnchorType {
|
||||
ant_Undefined = 0, ///< \ru Неопределенный тип. \en An undefined type.
|
||||
ant_TopoName, ///< \ru Для топологического имени. \en For a topological name.
|
||||
};
|
||||
|
||||
protected :
|
||||
uint8 aType; ///< \ru Тип якорного атрибута. \en Type of an anchor attribute.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbAnchorAttribute( const MbAnchorAttribute & );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbAnchorAttribute();
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbAnchorAttribute( AnchorType type );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbAnchorAttribute();
|
||||
|
||||
// \ru Общие функции объекта. \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeFamily() const; // \ru Дать тип атрибута. \en Get type of an attribute.
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
/// \ru Дать тип якорного атрибута. \en Get type of an anchor attribute.
|
||||
AnchorType GetAnchorType() { return static_cast<AnchorType>(aType); }
|
||||
|
||||
// \ru Выполнить действия при изменении владельца, не связанное с другими действиями. \en Perform actions which are not associated with other actions when changing the owner.
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner );
|
||||
// \ru Выполнить действия при конвертации владельца \en Perform actions when converting the owner.
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg = NULL );
|
||||
// \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner.
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при разделении владельца. \en Perform actions when splitting the owner.
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others );
|
||||
// \ru Выполнить действия при удалении владельца. \en Perform actions when deleting the owner.
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner );
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
MbAnchorAttribute & operator = ( const MbAnchorAttribute & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbAnchorAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbAnchorAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Признак исполнения (варианта реализации модели).
|
||||
\en Indication of embodiment (variant of model implementation). \~
|
||||
\details \ru Признак исполнения (варианта реализации модели). \n
|
||||
\en Indication of embodiment (variant of model implementation). \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbEmbodimentAttribute : public MbElementaryAttribute {
|
||||
protected:
|
||||
SimpleName m_name; ///< \ru Имя исполнения. \en Name of embodiment.
|
||||
SimpleName m_parent; ///< \ru Имя родительского исполнения. \en Name of parent embodiment.
|
||||
bool m_current; ///< \ru Признак, является ли исполнение текущим. \en Flag, whether the embodiment is current.
|
||||
|
||||
protected:
|
||||
// \ru Конструктор. \en Constructor.
|
||||
MbEmbodimentAttribute( const MbEmbodimentAttribute & );
|
||||
public:
|
||||
// \ru Конструктор. \en Constructor.
|
||||
MbEmbodimentAttribute();
|
||||
// \ru Конструктор. \en Constructor.
|
||||
MbEmbodimentAttribute( const SimpleName & name1, const SimpleName & name2, bool curr = false );
|
||||
// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbEmbodimentAttribute();
|
||||
|
||||
// \ru Общие функции объекта. \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по атрибуту. \en Initialize by attribute.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
// \ru Специфические функции объекта. \en Specific functions of object.
|
||||
|
||||
// \ru Установить родительское исполнение. \en Set a parent embodiment.
|
||||
void Init( const SimpleName & name1, const SimpleName & name2, bool curr = false ) {
|
||||
m_name = name1; m_parent = name2; m_current = curr;
|
||||
}
|
||||
// \ru Выдать имя исполнения. \en Get a name of embodiment.
|
||||
SimpleName Name() const { return m_name; }
|
||||
// \ru Выдать имя родительского исполнения. \en Get a name of parent embodiment.
|
||||
SimpleName ParentName() const { return m_parent; }
|
||||
// \ru Является ли исполнение текущим. \en Whether the embodiment is current.
|
||||
bool IsCurrent() const { return m_current; }
|
||||
|
||||
private:
|
||||
void operator = ( const MbEmbodimentAttribute & ); // \ru Не реализовано. \en Not implemented.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbEmbodimentAttribute )
|
||||
|
||||
}; // MbEmbodimentAttribute
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbEmbodimentAttribute )
|
||||
|
||||
|
||||
#endif // __ATTR_IDENTIFIER_H
|
||||
@@ -0,0 +1,432 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты изделий.
|
||||
\en Product attributes.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <attribute.h>
|
||||
#include <math_define.h>
|
||||
#include <legend.h>
|
||||
#include <model_item.h>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <attr_common_attribut.h>
|
||||
#include <tool_cstring.h>
|
||||
|
||||
|
||||
#ifndef __ATTR_PRODUCT_H
|
||||
#define __ATTR_PRODUCT_H
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Родительский класс атрибутов изделий.
|
||||
\en Base calss of product attributes.
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbProductAttribute : public MbAttribute {
|
||||
protected :
|
||||
MbProductAttribute(); // \ru Конструктор. \en Constructor.
|
||||
public :
|
||||
// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbProductAttribute();
|
||||
|
||||
public :
|
||||
virtual MbeAttributeType AttributeFamily() const;
|
||||
// Выдать подтип атрибута (временно).
|
||||
virtual MbeAttributeType AttributeType() const = 0;
|
||||
// Сделать копию элемента.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const = 0;
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const = 0; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
// Инициализировать данные по присланным.
|
||||
virtual bool Init( const MbAttribute & ) = 0;
|
||||
|
||||
virtual MbePrompt GetPropertyName() = 0;
|
||||
|
||||
// Действия при изменении владельца, не связанное с другими действиями.
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner );
|
||||
// Действия при конвертации владельца.
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// Действия при трансформировании владельца.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg = NULL );
|
||||
// Действия при перемещении владельца.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// Действия при вращении владельца.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// Действия при копировании владельца.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg = NULL );
|
||||
// Действия при объединении владельца.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// Действия при замене владельца.
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// Действия при разделении владельца.
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others );
|
||||
// Действия при удалении владельца.
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS( MbProductAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbProductAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbProductAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Сведения о лице в организации.
|
||||
\en Information related to a person and the organization he/she in.
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbPersonOrganizationInfo : public MbProductAttribute {
|
||||
c3d::string_t personId; ///< \ru Идентификатор лица. \en Identifier of the person.
|
||||
c3d::string_t lastName; ///< \ru Фамилия. \en Last name.
|
||||
c3d::string_t firstName; ///< \ru Имя. \en First name.
|
||||
std::list<c3d::string_t> middleNames; ///< \ru Отчество/средние имена. \en Middle names.
|
||||
std::list<c3d::string_t> prefixTitles; ///< \ru Титулы предшествующие. \en Prefix titles.
|
||||
std::list<c3d::string_t> suffixTitles; ///< \ru Титулы завершающие. \en Suffix titles.
|
||||
c3d::string_t orgId; ///< \ru Идентификатор организации. \en Identifier of the organization.
|
||||
c3d::string_t orgLabel; ///< \ru Название организации. \en Label of the organization.
|
||||
c3d::string_t orgDescription; ///< \ru Описание организации. \en Description of the organization.
|
||||
std::set<c3d::string_t> roles; ///< \ru Роли лица по отношению к изделию. \en The person's roles concerning a product.
|
||||
protected :
|
||||
// Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию.
|
||||
MbPersonOrganizationInfo( const MbPersonOrganizationInfo & );
|
||||
public :
|
||||
// Конструктор без параметров для наследников.
|
||||
MbPersonOrganizationInfo();
|
||||
// Деструктор.
|
||||
virtual ~MbPersonOrganizationInfo();
|
||||
|
||||
public :
|
||||
// Выдать подтип атрибута (временно).
|
||||
virtual MbeAttributeType AttributeType() const;
|
||||
// Сделать копию элемента.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const;
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // Определить, являются ли объекты равными.
|
||||
// Инициализировать данные по присланным.
|
||||
virtual bool Init( const MbAttribute & ) ;
|
||||
virtual void GetProperties( MbProperties & ); // выдать свойства объекта
|
||||
|
||||
virtual MbePrompt GetPropertyName() ;
|
||||
|
||||
/**
|
||||
\brief \ru Получить данные. \en Get data. \~
|
||||
\param[out] oPersonId - \ru Идентификатор лица. \en Identifier of the person. \~
|
||||
\param[out] oLast - \ru Фамилия. \en Last name. \~
|
||||
\param[out] oFirst - \ru Имя. \en First name. \~
|
||||
\param[out] oMid - \ru Итератор для вставки всех строк, соответствующих отчеству/средним именам. \en Insert iterator for middle names. \~
|
||||
\param[out] oPre - \ru Итератор для вставки всех строк, соответствующих титулов предшествующих. \en Insert iterator for prefix titles. \~
|
||||
\param[out] oSuf - \ru Итератор для вставки всех строк, соответствующих титулов завершающих. \en Insert iterator for suffix titles. \~
|
||||
\param[out] oOrgId - \ru Идентификатор организации. \en Identifier of the organization. \~
|
||||
\param[out] oOrgLabel - \ru Название организации. \en Label of the organization. \~
|
||||
\param[out] oOrgDesc - \ru Описание организации. \en Description of the organization. \~
|
||||
*/
|
||||
template< typename OutMid, typename OutPre, typename OutSuf >
|
||||
void GetData( c3d::string_t& oPersonId, c3d::string_t& oLast, c3d::string_t& oFirst,
|
||||
OutMid oMid, OutPre oPre, OutSuf oSuf,
|
||||
c3d::string_t& oOrgId, c3d::string_t& oOrgLabel, c3d::string_t& oOrgDesc ) const;
|
||||
|
||||
|
||||
/**
|
||||
\brief \ru Получить данные. \en Get data. \~
|
||||
\param[out] oPersonId - \ru Идентификатор лица. \en Identifier of the person. \~
|
||||
\param[out] oLast - \ru Фамилия. \en Last name. \~
|
||||
\param[out] oFirst - \ru Имя. \en First name. \~
|
||||
\param[out] oMid - \ru Итератор для вставки всех строк, соответствующих отчеству/средним именам. \en Insert iterator for middle names. \~
|
||||
\param[out] oPre - \ru Итератор для вставки всех строк, соответствующих титулов предшествующих. \en Insert iterator for prefix titles. \~
|
||||
\param[out] oSuf - \ru Итератор для вставки всех строк, соответствующих титулов завершающих. \en Insert iterator for suffix titles. \~
|
||||
\param[out] oOrgId - \ru Идентификатор организации. \en Identifier of the organization. \~
|
||||
\param[out] oOrgLabel - \ru Название организации. \en Label of the organization. \~
|
||||
\param[out] oOrgDesc - \ru Описание организации. \en Description of the organization. \~
|
||||
*/
|
||||
template< typename OutMid, typename OutPre, typename OutSuf >
|
||||
void GetPOData( std::string& oPersonId, std::string& oLast, std::string& oFirst,
|
||||
OutMid oMid, OutPre oPre, OutSuf oSuf,
|
||||
std::string& oOrgId, std::string& oOrgLabel, std::string& oOrgDesc ) const;
|
||||
|
||||
/**
|
||||
\brief \ru Получить полное имя с префиксами и суффиксами. \en full name with prefixes and suffixes. \~
|
||||
*/
|
||||
c3d::string_t NameOneLine() const;
|
||||
|
||||
/**
|
||||
\brief \ru Получить данные организации. \en Get organization data. \~
|
||||
\param[out] oOrgId - \ru Идентификатор организации. \en Identifier of the organization. \~
|
||||
\param[out] oOrgLabel - \ru Название организации. \en Label of the organization. \~
|
||||
\param[out] oOrgDesc - \ru Описание организации. \en Description of the organization. \~
|
||||
*/
|
||||
void GetOrganization( c3d::string_t& oOrgId, c3d::string_t& oOrgLabel, c3d::string_t& oOrgDesc ) const;
|
||||
|
||||
|
||||
/**
|
||||
\brief \ru Получить данные организации. \en Get organization data. \~
|
||||
\param[out] oOrgId - \ru Идентификатор организации. \en Identifier of the organization. \~
|
||||
\param[out] oOrgLabel - \ru Название организации. \en Label of the organization. \~
|
||||
\param[out] oOrgDesc - \ru Описание организации. \en Description of the organization. \~
|
||||
*/
|
||||
void GetOrganizationInfo( std::string& oOrgId, std::string& oOrgLabel, std::string& oOrgDesc ) const;
|
||||
|
||||
/**
|
||||
\brief \ru Задать данные лица. \en Set person's data. \~
|
||||
\param[in] oPersonId - \ru Идентификатор лица. \en Identifier of the person. \~
|
||||
\param[in] oLast - \ru Фамилия. \en Last name. \~
|
||||
\param[in] oFirst - \ru Имя. \en First name. \~
|
||||
\param[in] firstMid - \ru Итератор первой строки, соответствующей отчеству/средним именам. \en First iterator for middle names. \~
|
||||
\param[in] lastMid - \ru Итератор за последней строкой, соответствующей отчеству/средним именам. \en Next after last iterator for middle names. \~
|
||||
\param[in] firstPre - \ru Итератор первой строки, соответствующей титулам предшествующих. \en First iterator for prefix titles. \~
|
||||
\param[in] lastPre - \ru Итератор первой строки, соответствующей титулам предшествующих. \en Next after last iterator for prefix titles. \~
|
||||
\param[in] firstSuf - \ru Итератор первой строки, соответствующей титулам завершающих. \en First iterator for suffix titles. \~
|
||||
\param[in] lastSuf - \ru Итератор первой строки, соответствующей титулам завершающих. \en Next after last iterator for suffix titles. \~
|
||||
*/
|
||||
template< typename InMid, typename InPre, typename InSuf >
|
||||
void SetPerson( const c3d::string_t& oPersonId, const c3d::string_t& oLast, const c3d::string_t& oFirst,
|
||||
InMid firstMid, InMid lastMid,
|
||||
InPre firstPre, InPre lastPre,
|
||||
InSuf firstSuf, InSuf lastSuf );
|
||||
|
||||
/**
|
||||
\brief \ru Задать данные лица. \en Set person's data. \~
|
||||
\param[in] oPersonId - \ru Идентификатор лица. \en Identifier of the person. \~
|
||||
\param[in] oLast - \ru Фамилия. \en Last name. \~
|
||||
\param[in] oFirst - \ru Имя. \en First name. \~
|
||||
\param[in] firstMid - \ru Итератор первой строки, соответствующей отчеству/средним именам. \en First iterator for middle names. \~
|
||||
\param[in] lastMid - \ru Итератор за последней строкой, соответствующей отчеству/средним именам. \en Next after last iterator for middle names. \~
|
||||
\param[in] firstPre - \ru Итератор первой строки, соответствующей титулам предшествующих. \en First iterator for prefix titles. \~
|
||||
\param[in] lastPre - \ru Итератор первой строки, соответствующей титулам предшествующих. \en Next after last iterator for prefix titles. \~
|
||||
\param[in] firstSuf - \ru Итератор первой строки, соответствующей титулам завершающих. \en First iterator for suffix titles. \~
|
||||
\param[in] lastSuf - \ru Итератор первой строки, соответствующей титулам завершающих. \en Next after last iterator for suffix titles. \~
|
||||
*/
|
||||
template< typename InMid, typename InPre, typename InSuf >
|
||||
void SetPersonInfo( const std::string& oPersonId, const std::string& oLast, const std::string& oFirst,
|
||||
InMid firstMid, InMid lastMid,
|
||||
InPre firstPre, InPre lastPre,
|
||||
InSuf firstSuf, InSuf lastSuf );
|
||||
|
||||
/**
|
||||
\brief \ru Задать данные организации. \en Set organization's data. \~
|
||||
\param[in] oOrgId - \ru Идентификатор организации. \en Identifier of the organization. \~
|
||||
\param[in] oOrgLabel - \ru Название организации. \en Label of the organization. \~
|
||||
\param[in] oOrgDesc - \ru Описание организации. \en Description of the organization. \~
|
||||
*/
|
||||
void SetOrganization( const c3d::string_t& initOrgId, const c3d::string_t& initOrgLabel, const c3d::string_t& initOrgDesc );
|
||||
|
||||
/**
|
||||
\brief \ru Задать данные организации. \en Set organization's data. \~
|
||||
\param[in] oOrgId - \ru Идентификатор организации. \en Identifier of the organization. \~
|
||||
\param[in] oOrgLabel - \ru Название организации. \en Label of the organization. \~
|
||||
\param[in] oOrgDesc - \ru Описание организации. \en Description of the organization. \~
|
||||
*/
|
||||
void SetOrganizationInfo( const std::string& initOrgId, const std::string& initOrgLabel, const std::string& initOrgDesc );
|
||||
|
||||
/**
|
||||
\brief \ru Задать данные лица и организации в упрощенной форме. \en Set person's and organization's simplified data. \~
|
||||
\param[in] person - \ru Фамилия автора. \en Author's second name. \~
|
||||
\param[in] organization - \ru Название организации. \en Label of the organization. \~
|
||||
*/
|
||||
void SetPersonOrganization( const c3d::string_t& person, const c3d::string_t& organization );
|
||||
|
||||
/**
|
||||
\brief \ru Задать данные лица и организации в упрощенной форме. \en Set person's and organization's simplified data. \~
|
||||
\param[in] person - \ru Фамилия автора. \en Author's second name. \~
|
||||
\param[in] organization - \ru Название организации. \en Label of the organization. \~
|
||||
*/
|
||||
void SetPersonOrganizationInfo( const std::string& person, const std::string& organization );
|
||||
|
||||
/// \ru Добавить роль автора. \en Add person's role.
|
||||
inline void AddRole( const c3d::string_t& role ) { roles.insert( role ); }
|
||||
|
||||
/// \ru Добавить роль автора. \en Add person's role.
|
||||
inline void AddToRoles( const std::string& role ) { roles.insert( c3d::ToC3Dstring( role ) ); }
|
||||
|
||||
/// \ru Получить роли автора. \en Get person's roles.
|
||||
template< typename T > void GetRoles( T dest ) const { std::copy( roles.begin(), roles.end(), dest ); }
|
||||
|
||||
/// \ru Добавить роли к приёмнику. \en Add person's roles to destination.
|
||||
template< typename T > void AddRolesTo( T dest ) const;
|
||||
|
||||
private:
|
||||
MbPersonOrganizationInfo & operator = ( const MbPersonOrganizationInfo & ); // forbidden
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbPersonOrganizationInfo ) // Атрибуты писать ни к чему, они создаются только для конвертирования
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbPersonOrganizationInfo )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Данные об изделии. \en Product data.
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbProductInfo : public MbProductAttribute
|
||||
{
|
||||
c3d::string_t id; ///< \ru Идентификатор. \en Identifier.
|
||||
c3d::string_t name; ///< \ru Название. \en Name.
|
||||
c3d::string_t description; ///< \ru Описание. \en Description.
|
||||
bool isAssembly; ///< \ru Является ли сборочной единицей. \en If the product is an assembly.
|
||||
|
||||
protected :
|
||||
// Объявление (перегрузка) конструктора копирования без реализации, чтобы не было копирования по умолчанию.
|
||||
MbProductInfo( const MbProductInfo & );
|
||||
public :
|
||||
MbProductInfo( c3d::StringTCRef initId, c3d::StringTCRef initName, c3d::StringTCRef initDesc, bool isAssm );
|
||||
|
||||
MbProductInfo( const TCHAR* initId, const TCHAR* initName, TCHAR* initDesc, bool isAssm );
|
||||
|
||||
MbProductInfo( bool isAssm, const std::string & initId, const std::string & initName, const std::string & initDesc );
|
||||
// Деструктор.
|
||||
virtual ~MbProductInfo();
|
||||
|
||||
public :
|
||||
// Выдать подтип атрибута (временно).
|
||||
virtual MbeAttributeType AttributeType() const;
|
||||
// Сделать копию элемента.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const ;
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // Определить, являются ли объекты равными.
|
||||
// Инициализировать данные по присланным.
|
||||
virtual bool Init( const MbAttribute & ) ;
|
||||
virtual void GetProperties( MbProperties & ); // выдать свойства объекта
|
||||
virtual size_t SetProperties( const MbProperties & ); // Установить свойства объекта.
|
||||
|
||||
virtual MbePrompt GetPropertyName() ;
|
||||
|
||||
const c3d::string_t& GetId() const; ///< \ru Получить идентификатор. \en Get id.
|
||||
|
||||
const c3d::string_t& GetName() const; ///< \ru Получить наименование. \en Get name.
|
||||
|
||||
const c3d::string_t& GetDescription() const; ///< \ru Получить описание. \en Get description.
|
||||
|
||||
/// \ru Получить данные. \en Get data.
|
||||
void GetData( c3d::string_t & oId, c3d::string_t & oName, c3d::string_t & oDesc ) const;
|
||||
|
||||
/// \ru Получить данные. \en Get data.
|
||||
void GetDataStd( std::string & oId, std::string & oName, std::string & oDesc ) const;
|
||||
|
||||
/// \ru Задать название. \en Set the name of the product.
|
||||
void SetNameC3D( const c3d::string_t& oName );
|
||||
|
||||
/// \ru Задать наименование. \en Set the designation of the product.
|
||||
void SetId( const std::string& oId );
|
||||
/// \ru Задать название. \en Set the name of the product.
|
||||
void SetName( const std::string& iName );
|
||||
/// \ru Задать описание. \en Set the description of the product.
|
||||
void SetDescription( const std::string& oDesc );
|
||||
|
||||
/// \ru Является ли изделие сборочной единицей. \en If the product is an assembly.
|
||||
bool IsAssembly() const;
|
||||
|
||||
private:
|
||||
MbProductInfo & operator = ( const MbProductInfo & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbProductInfo ) // Атрибуты писать ни к чему, они создаются только для конвертирования
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbProductInfo )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Класс Лицо и организация.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Получить данные
|
||||
// ---
|
||||
template< typename OutMid, typename OutPre, typename OutSuf >
|
||||
void MbPersonOrganizationInfo::GetData( c3d::string_t& oPersonId, c3d::string_t& oLast, c3d::string_t& oFirst,
|
||||
OutMid oMid, OutPre oPre, OutSuf oSuf,
|
||||
c3d::string_t& oOrgId, c3d::string_t& oOrgLabel, c3d::string_t& oOrgDesc ) const {
|
||||
oPersonId = personId;
|
||||
oLast = lastName;
|
||||
oFirst = firstName;
|
||||
std::copy( middleNames.begin(), middleNames.end(), oMid );
|
||||
std::copy( prefixTitles.begin(), prefixTitles.end(), oPre );
|
||||
std::copy( suffixTitles.begin(), suffixTitles.end(), oSuf );
|
||||
oOrgId = orgId;
|
||||
oOrgLabel = orgLabel;
|
||||
oOrgDesc = orgDescription;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Получить данные
|
||||
// ---
|
||||
template< typename OutMid, typename OutPre, typename OutSuf >
|
||||
void MbPersonOrganizationInfo::GetPOData( std::string& oPersonId, std::string& oLast, std::string& oFirst,
|
||||
OutMid oMid, OutPre oPre, OutSuf oSuf,
|
||||
std::string& oOrgId, std::string& oOrgLabel, std::string& oOrgDesc ) const {
|
||||
oPersonId = c3d::ToSTDstring( personId );
|
||||
oLast = c3d::ToSTDstring( lastName );
|
||||
oFirst = c3d::ToSTDstring( firstName );
|
||||
std::list< std::string > tmp;
|
||||
for( std::list<c3d::string_t>::const_iterator itr = middleNames.begin(); itr != middleNames.end(); ++itr )
|
||||
tmp.push_back( c3d::ToSTDstring( *itr ) );
|
||||
std::copy( tmp.begin(), tmp.end(), oMid );
|
||||
tmp.clear();
|
||||
for( std::list<c3d::string_t>::const_iterator itr = prefixTitles.begin(); itr != prefixTitles.end(); ++itr )
|
||||
tmp.push_back( c3d::ToSTDstring( *itr ) );
|
||||
std::copy( tmp.begin(), tmp.end(), oPre );
|
||||
tmp.clear();
|
||||
for( std::list<c3d::string_t>::const_iterator itr = suffixTitles.begin(); itr != suffixTitles.end(); ++itr )
|
||||
tmp.push_back( c3d::ToSTDstring( *itr ) );
|
||||
std::copy( tmp.begin(), tmp.end(), oSuf );
|
||||
oOrgId = c3d::ToSTDstring( orgId );
|
||||
oOrgLabel = c3d::ToSTDstring( orgLabel );
|
||||
oOrgDesc = c3d::ToSTDstring( orgDescription );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Задать данные лица
|
||||
// ---
|
||||
template< typename InMid, typename InPre, typename InSuf >
|
||||
void MbPersonOrganizationInfo::SetPerson( const c3d::string_t& oPersonId, const c3d::string_t& oLast, const c3d::string_t& oFirst,
|
||||
InMid firstMid, InMid lastMid,
|
||||
InPre firstPre, InPre lastPre,
|
||||
InSuf firstSuf, InSuf lastSuf ) {
|
||||
personId = oPersonId;
|
||||
lastName = oLast;
|
||||
firstName = oFirst;
|
||||
middleNames.assign( firstMid, lastMid );
|
||||
prefixTitles.assign( firstPre, lastPre );
|
||||
suffixTitles.assign( firstSuf, lastSuf );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Задать данные лица
|
||||
// ---
|
||||
template< typename InMid, typename InPre, typename InSuf >
|
||||
void MbPersonOrganizationInfo::SetPersonInfo( const std::string& oPersonId, const std::string& oLast, const std::string& oFirst,
|
||||
InMid firstMid, InMid lastMid,
|
||||
InPre firstPre, InPre lastPre,
|
||||
InSuf firstSuf, InSuf lastSuf ) {
|
||||
personId = c3d::ToC3Dstring( oPersonId );
|
||||
lastName = c3d::ToC3Dstring( oLast );
|
||||
firstName = c3d::ToC3Dstring( oFirst );
|
||||
std::list< c3d::string_t > tmp;
|
||||
for( InMid itr = firstMid; itr != lastMid; ++itr )
|
||||
tmp.push_back( c3d::ToC3Dstring( *itr ) );
|
||||
middleNames.swap( tmp );
|
||||
tmp.clear();
|
||||
for( InPre itr = firstPre; itr != lastPre; ++itr )
|
||||
tmp.push_back( c3d::ToC3Dstring( *itr ) );
|
||||
prefixTitles.swap(tmp);
|
||||
tmp.clear();
|
||||
for( InSuf itr = firstSuf; itr != lastSuf; ++itr )
|
||||
tmp.push_back( c3d::ToC3Dstring( *itr ) );
|
||||
suffixTitles.swap(tmp);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Добавить роли к приёмнику.
|
||||
// ---
|
||||
template< typename T >
|
||||
void MbPersonOrganizationInfo::AddRolesTo( T dest ) const {
|
||||
std::list<std::string> tmp;
|
||||
for( std::set<c3d::string_t>::const_iterator itr = roles.begin(); itr != roles.end(); ++itr )
|
||||
tmp.push_back( c3d::ToSTDstring( *itr ) );
|
||||
std::copy( tmp.begin(), tmp.end(), dest );
|
||||
}
|
||||
|
||||
|
||||
#endif // __ATTR_PRODUCT_H
|
||||
@@ -0,0 +1,91 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Инстанс определения атрибута.
|
||||
\en Attribute definition instance. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_REGISTRY_H
|
||||
#define __ATTR_REGISTRY_H
|
||||
|
||||
|
||||
#include <math_x.h>
|
||||
#include <map>
|
||||
#include <math_define.h>
|
||||
#include <tool_uuid.h>
|
||||
|
||||
|
||||
class IAttrDefinition;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Идентификатор пользовательского атрибута.
|
||||
\en Identifier of external attribute. \~
|
||||
\details \ru Идентификатор пользовательского атрибута.
|
||||
\en Identifier of external attribute. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// KVT class MbUserAttribType
|
||||
// KVT {
|
||||
// KVT public:
|
||||
// KVT uint subtype1;
|
||||
// KVT uint subtype2;
|
||||
// KVT uint subtype3;
|
||||
// KVT
|
||||
// KVT public:
|
||||
// KVT MbUserAttribType()
|
||||
// KVT : subtype1( 0 ), subtype2( 0 ), subtype3( 0 ) {}
|
||||
// KVT MbUserAttribType( uint type1, uint type2, uint type3 )
|
||||
// KVT : subtype1( type1 ), subtype2( type2 ), subtype3( type3 ) {}
|
||||
// KVT MbUserAttribType( const MbUserAttribType & other )
|
||||
// KVT : subtype1( other.subtype1 ), subtype2( other.subtype2 ), subtype3( other.subtype3 ) {}
|
||||
// KVT
|
||||
// KVT bool operator == ( const MbUserAttribType & other ) const
|
||||
// KVT { return subtype1 == other.subtype1 && subtype2 == other.subtype2 && subtype3 == other.subtype3; }
|
||||
// KVT bool operator < ( const MbUserAttribType & other ) const
|
||||
// KVT {
|
||||
// KVT if (subtype1 != other.subtype1)
|
||||
// KVT return subtype1 < other.subtype1;
|
||||
// KVT else if (subtype2 != other.subtype2)
|
||||
// KVT return subtype2 < other.subtype2;
|
||||
// KVT else if (subtype3 != other.subtype3)
|
||||
// KVT return subtype3 < other.subtype3;
|
||||
// KVT
|
||||
// KVT return false;
|
||||
// KVT }
|
||||
// KVT
|
||||
// KVT private:
|
||||
// KVT void operator = ( const MbUserAttribType & ); // \ru Не реализовано \en Not implemented
|
||||
// KVT };
|
||||
|
||||
typedef MbUuid MbUserAttribType;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Инстанс определения атрибута.
|
||||
\en Attribute definition instance. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS AttrDefInstance
|
||||
{
|
||||
private:
|
||||
MbUserAttribType id_;
|
||||
public:
|
||||
AttrDefInstance( const MbUserAttribType & id );
|
||||
virtual ~AttrDefInstance();
|
||||
|
||||
public:
|
||||
virtual IAttrDefinition * GetAttrDefinition() = 0;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти определение пользовательского атрибута.
|
||||
\en Find an external attribute definition. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
MATH_FUNC (IAttrDefinition *) GetUserAttrDefinition( const MbUserAttribType & id );
|
||||
|
||||
|
||||
#endif // __ATTR_REGISTRY_H
|
||||
@@ -0,0 +1,154 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты. Селектированность. Видимость. Изменённость.
|
||||
\en Attributes. Selection. Visibility. Modification. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_SELECTED_H
|
||||
#define __ATTR_SELECTED_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribut.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Селектированность.
|
||||
\en Selection. \~
|
||||
\details \ru Селектированность. \n
|
||||
\en Selection. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSelected : public MbElementaryAttribute {
|
||||
protected :
|
||||
bool selected; ///< \ru Селектированность. \en Selection.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy-constructor.
|
||||
MbSelected( const MbSelected & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbSelected( bool init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbSelected();
|
||||
|
||||
// \ru Общие функции объекта. \en Common functions of object.
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute.
|
||||
|
||||
/// \ru Установить селектированность. \en Set selection.
|
||||
void Init( bool init ) { selected = init; }
|
||||
/// \ru Дать селектированность. \en Get selection.
|
||||
bool Selected() const { return selected; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbSelected & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbSelected )
|
||||
|
||||
}; // MbSelected
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSelected )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Видимость.
|
||||
\en Visibility. \~
|
||||
\details \ru Видимость. \n
|
||||
\en Visibility. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbVisible : public MbElementaryAttribute {
|
||||
protected :
|
||||
bool visible; ///< \ru Видимость. \en Visibility.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy-constructor.
|
||||
MbVisible( const MbVisible & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbVisible( bool init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbVisible();
|
||||
|
||||
// \ru Общие функции объекта. \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute.
|
||||
|
||||
/// \ru Установить видимость. \en Set visibility.
|
||||
void Init( bool init ) { visible = init; }
|
||||
/// \ru Дать видимость. \en Get visibility.
|
||||
bool Visible() const { return visible; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbVisible & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbVisible )
|
||||
|
||||
}; // MbVisible
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbVisible )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Изменённость.
|
||||
\en Modification. \~
|
||||
\details \ru Изменённость. \n
|
||||
\en Modification. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbChanged : public MbElementaryAttribute {
|
||||
protected :
|
||||
bool changed; ///< \ru Изменённость. \en Modification.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор копирования. \en Copy-constructor.
|
||||
MbChanged( const MbChanged & init );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbChanged( bool init );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbChanged();
|
||||
|
||||
// \ru Общие функции объекта. \en Common functions of object.
|
||||
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Дать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute.
|
||||
|
||||
/// \ru Установить изменённость. \en Set modification.
|
||||
void Init( bool init ) { changed = init; }
|
||||
/// \ru Дать изменённость. \en Get modification.
|
||||
bool Changed() const { return changed; }
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
private:
|
||||
void operator = ( const MbChanged & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbChanged )
|
||||
|
||||
}; // MbChanged
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbChanged )
|
||||
|
||||
#endif // __ATTR_SELECTED_H
|
||||
@@ -0,0 +1,93 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибут ребра жесткости листового тела.
|
||||
\en Attribute of reinforsed rib of sheet solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_STAMPRIB_ATTRIBUTE_H
|
||||
#define __ATTR_STAMPRIB_ATTRIBUTE_H
|
||||
|
||||
|
||||
#include <attr_geometric_attribut.h>
|
||||
#include <op_swept_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Атрибут ребра жесткости листового тела.
|
||||
\en Attribute of reinforsed rib of sheet solid. \~
|
||||
\details \ru Атрибут ребра жесткости листового тела. Двумерный контур ребра
|
||||
жесткости и локальная система координат, в плоскости XY которой
|
||||
расположен двумерный контур содержатся в MbGeomAttribute.
|
||||
\en Attribute of reinforsed rib of sheet solid. Two-dimensional contour
|
||||
of a rib and a local coordinate system the two-dimensional contour
|
||||
is located in XY plane of are stored in MbGeomAttribute \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbStampRibAttribute : public MbGeomAttribute
|
||||
{
|
||||
protected :
|
||||
size_t index; ///< \ru Индекс сегмента в контуре, от которого будет установлено направление уклона. \en Index of a segment in the contour at which the inclination direction will be set.
|
||||
SheetRibValues pars; ///< \ru Параметры операции. \en The operation parameters.
|
||||
MbSNameMaker names; ///< \ru Именователь операции. \en An object defining names generation in the operation.
|
||||
MbVector3D bendNorm; ///< \ru Нормаль поверхности сгиба (только для внутреннего использования). \en A normal to bend surface (for internal usage only).
|
||||
MbCartPoint3D bendPoint; ///< \ru Точка на оси сгиба сгиба (только для внутреннего использования). \en A point on bend axis (for internal usage only).
|
||||
private:
|
||||
// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbStampRibAttribute( const MbStampRibAttribute & init, MbRegDuplicate * iReg );
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbStampRibAttribute( const MbSpaceItem & item, MbeCreatorType t, size_t index, const SheetRibValues & pars, const MbSNameMaker & n, bool keepItem);
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbStampRibAttribute( const MbSpaceItem & item, MbeCreatorType t, size_t index, const SheetRibValues & pars, const MbSNameMaker & n, bool keepItem, const c3d::string_t & itemPrompt );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbStampRibAttribute();
|
||||
|
||||
public:
|
||||
// \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbeAttributeType AttributeType() const;
|
||||
// \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const;
|
||||
// \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const;
|
||||
// \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual bool Init( const MbAttribute & );
|
||||
|
||||
// \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg );
|
||||
// \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
|
||||
virtual void GetCharValue( TCHAR * v ) const; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
/// \ru Дать индекс сегмента в контуре. \en Get index of a segment in the contour.
|
||||
const size_t & GetIndex() const { return index; }
|
||||
/// \ru Дать параметры операции. \en Get operation parameters.
|
||||
const SheetRibValues & GetRibValues() const { return pars; }
|
||||
/// \ru Дать именователь операции. \en Get an object defining a name of the operation.
|
||||
const MbSNameMaker & GetNameMaker() const { return names; }
|
||||
/// \ru Дать нормаль к поверхности сгиба. \en Get normal to bend surface.
|
||||
const MbVector3D & GetBendNormal() const { return bendNorm; }
|
||||
/// \ru Установить нормаль к поверхности сгиба. \en Set normal to bend surface.
|
||||
void SetBendNormal( const MbVector3D & n ) { bendNorm = n; }
|
||||
/// \ru Дать точку на оси сгиба. \en Get point on bend axis.
|
||||
const MbCartPoint3D & GetBendPoint() const { return bendPoint; }
|
||||
/// \ru Установить точку на оси сгиба. \en Set point on bend axis.
|
||||
void SetBendPoint( const MbCartPoint3D & p ) { bendPoint = p; }
|
||||
DECLARE_PERSISTENT_CLASS( MbStampRibAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbStampRibAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbStampRibAttribute )
|
||||
|
||||
#endif // __ATTR_STAMPRIB_ATTRIBUTE_H
|
||||
@@ -0,0 +1,426 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Пользовательские атрибуты.
|
||||
\en User attributes. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_USER_ATTRIBUT_H
|
||||
#define __ATTR_USER_ATTRIBUT_H
|
||||
|
||||
|
||||
#include <attribute.h>
|
||||
#include <io_memory_buffer.h>
|
||||
#include <math_define.h>
|
||||
#include <attr_registry.h>
|
||||
#include <tool_cstring.h>
|
||||
#include <tool_multithreading.h>
|
||||
#include <memory>
|
||||
|
||||
class MATH_CLASS MbExternalAttribute;
|
||||
class MATH_CLASS MbUserAttribute;
|
||||
class MATH_CLASS MbFixAttrSet;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс определения атрибута.
|
||||
\en Attribute definition interface. \~
|
||||
\details \ru Интерфейс определения атрибута. Определение атрибута - объект используемый
|
||||
для преобразования пользовательских внесистемных атрибутов в пользовательские системные,
|
||||
а так же для разборки пользовательских системных атрибутов
|
||||
на составные части - другие атрибуты системные атрибуты, и обратной сборки.
|
||||
\en Attribute definition interface. Attribute definition - the object used
|
||||
for converting user external attributes to user system attributes
|
||||
and for a disassembly of user system attributes
|
||||
to their components - other system attributes, and for reassembly. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class IAttrDefinition
|
||||
{
|
||||
public:
|
||||
/// \ru Преобразовать из пользовательского в "системный". \en Convert user attribute to "system" one.
|
||||
virtual MbUserAttribute * ReduceUserAttrib ( const MbExternalAttribute & source ) = 0;
|
||||
|
||||
/// \ru Преобразовать из "системного" в пользовательский. \en Convert "system" attribute to user one.
|
||||
virtual MbExternalAttribute * AdvanceUserAttrib( const MbUserAttribute & source ) = 0;
|
||||
|
||||
/// \ru "Разобрать" на составляющие атрибуты. \en Disassemble on attributes.
|
||||
virtual MbFixAttrSet * DisassembleUsetAttrib( const MbExternalAttribute & source ) = 0;
|
||||
|
||||
/// \ru "Собрать" из составляющих атрибутов. \en Reassemble from attributes.
|
||||
virtual bool ReassembleUsetAttrib ( const MbFixAttrSet & source, MbExternalAttribute & targer ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Шаблон "определения" пользовательского атрибута.
|
||||
\en A template of user attribute definition. \~
|
||||
\details \ru Шаблонный класс "Определения" пользовательского атрибута - используется для создания
|
||||
стандартных определений, с предопределенным функционалом.
|
||||
\en Template class "Definition" of user attribute - used for creation
|
||||
of standard definitions with predefined functionality. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
template <typename AttrClass>
|
||||
class UserAttrDefinition : public IAttrDefinition
|
||||
{
|
||||
public:
|
||||
/// \ru Преобразовать из пользовательского в "системный". \en Convert user attribute to "system" one.
|
||||
virtual MbUserAttribute * ReduceUserAttrib ( const MbExternalAttribute & source );
|
||||
|
||||
/// \ru Преобразовать из "системного" в пользовательский. \en Convert "system" attribute to user one.
|
||||
virtual MbExternalAttribute * AdvanceUserAttrib( const MbUserAttribute & source );
|
||||
|
||||
/// \ru "Разобрать" на составляющие атрибуты. \en Disassemble on attributes.
|
||||
virtual MbFixAttrSet * DisassembleUsetAttrib( const MbExternalAttribute & source );
|
||||
|
||||
/// \ru "Собрать" из составляющих атрибутов. \en Reassemble from attributes.
|
||||
virtual bool ReassembleUsetAttrib( const MbFixAttrSet & source, MbExternalAttribute & targer );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Пользовательский системный атрибут.
|
||||
\en User system attribute. \~
|
||||
\details \ru Пользовательский системный атрибут. \n
|
||||
\en User system attribute. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbUserAttribute : public MbAttribute, public MbSyncItem {
|
||||
typedef std_unique_ptr<membuf> UniqueMembufPtr;
|
||||
protected :
|
||||
MbUserAttribType userType_; ///< \ru Тип пользовательского атрибута. \en Type of user attribute.
|
||||
c3d::string_t prompt_; ///< \ru Строка описания. \en String of description.
|
||||
private:
|
||||
SPtr<MbExternalAttribute> extAttr;
|
||||
mutable UniqueMembufPtr userBuf;
|
||||
|
||||
private: // public: // You must inherit from MbExternalAttribute only!!!
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbUserAttribute( const TCHAR * prompt, const MbUserAttribType & id );
|
||||
|
||||
public:
|
||||
virtual MbeAttributeType AttributeFamily() const; // \ru Дать тип атрибута. \en Get type of an attribute.
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
|
||||
/// \ru Выдать подтип пользовательского атрибута по пользовательскому типу. \en Get subtype of an user attribute by user-defined type.
|
||||
static MbeAttributeType AttributeType( const MbUserAttribType & userType );
|
||||
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & ); // \ru Инициализировать данные по присланным. \en Initialize data by given attribute.
|
||||
|
||||
// \ru Выполнить действия при изменении владельца не связанное с другими действиями \en Perform actions which are not associated with other actions when changing the owner
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner );
|
||||
|
||||
// \ru Выполнить действия при конвертации владельца \en Perform actions when converting the owner
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
|
||||
// \ru Выполнить действия при трансформировании владельца \en Perform actions when transforming the owner
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg );
|
||||
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
|
||||
// \ru Выполнить действия при копировании владельца \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg );
|
||||
|
||||
// \ru Выполнить действия при объединении владельца \en Perform actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
|
||||
// \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner.
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
|
||||
// \ru Выполнить действия при разделении владельца. \en Perform actions when splitting the owner.
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others );
|
||||
|
||||
// \ru Выполнить действия при удалении владельца. \en Perform actions when deleting the owner.
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner );
|
||||
|
||||
/// \ru Выдать подсказку. \en Get a hint.
|
||||
const TCHAR * GetPrompt() const;
|
||||
/// \ru Выдать идентификатор хранимого атрибута. \en Get identifier of stored attribute.
|
||||
void GetUserAttribId( MbUserAttribType & attrId ) const;
|
||||
|
||||
/// \ru Установить пользовательские данные. \en Set user data.
|
||||
void SetUserData( const char * extAttrMemory );
|
||||
/// \ru Установить пользовательские данные. \en Set user data.
|
||||
void SetUserData( const std::vector<char> & extAttrData );
|
||||
/// \ru Получить пользовательские данные. \en Get user data.
|
||||
bool GetUserData( membuf & memBuf ) const;
|
||||
/// \ru Создать пользовательский внесистемный атрибут по пользовательским данным. \en Make a user external attribute using user data.
|
||||
bool MakeExternalAttribute( bool keepExisting );
|
||||
/// \ru Обновить пользовательские данные по внесистемному атрибуту пользователя. \en Update user data using the user external attribute.
|
||||
bool UpdateByExternalAttribute() const;
|
||||
|
||||
/// \ru Выдать пользовательский внесистемный атрибут. \en Get a user external attribute.
|
||||
const MbExternalAttribute * GetExternalAttribute() const { return extAttr; }
|
||||
/// \ru Установить пользовательский внесистемный атрибут. \en Set a user external attribute.
|
||||
bool SetExternalAttribute( MbExternalAttribute * );
|
||||
/// \ru Установить пользовательский внесистемный атрибут (его копию). \en Set a user external attribute (сopy).
|
||||
void SetExternalAttribute( const MbExternalAttribute & );
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
template <typename AttrClass>
|
||||
friend MbUserAttribute * UserAttrDefinition<AttrClass>::ReduceUserAttrib( const MbExternalAttribute & );
|
||||
|
||||
protected:
|
||||
virtual ~MbUserAttribute(); // Use AddRef/Release or smart pointer SPtr<MbAttribute> to destruct it correctly.
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbUserAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbUserAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbUserAttribute )
|
||||
|
||||
class MATH_CLASS MbFixAttrSet;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Пользовательский внесистемный атрибут - базовый класс.
|
||||
\en User external attribute - the base class. \~
|
||||
\details \ru Пользовательский внесистемный атрибут - базовый класс. \n
|
||||
\en User external attribute - the base class. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbExternalAttribute : public MbAttribute
|
||||
{
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbExternalAttribute();
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbExternalAttribute();
|
||||
|
||||
virtual MbeAttributeType AttributeFamily() const; // \ru Дать тип атрибута. \en Get type of an attribute.
|
||||
virtual MbeAttributeType AttributeType() const; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
/// \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbUserAttribType AttrTypeEx() const = 0;
|
||||
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * = NULL ) const = 0; // \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual bool IsSame( const MbAttribute &, double accuracy ) const = 0; // \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
|
||||
virtual bool Init( const MbAttribute & attr ) = 0; // \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
|
||||
// \ru Выполнить действия при изменении владельца, не связанное с другими действиями. \en Perform actions which are not associated with other actions when changing the owner.
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner );
|
||||
// \ru Выполнить действия при конвертации владельца. \en Perform actions when converting the owner.
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при трансформировании владельца. \en Perform actions when transforming the owner.
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg = NULL );
|
||||
// \ru Выполнить действия при объединении владельца. \en Perform actions when merging the owner.
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner.
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other );
|
||||
// \ru Выполнить действия при разделении владельца. \en Perform actions when splitting the owner.
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others );
|
||||
// \ru Выполнить действия при удалении владельца. \en Perform actions when deleting the owner.
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner );
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual size_t SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
protected:
|
||||
static MbFixAttrSet * CreateFixAttrSet( const MbUserAttribType &, c3d::AttrVector & );
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbExternalAttribute )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Фиксированный набор атрибутов
|
||||
\en Fixed set of attributes. \~
|
||||
\details \ru Набор атрибутов, состав которого нельзя изменить, но никто не запрещает
|
||||
менять значение самих атрибутов.
|
||||
\en A set of attributes the structure of which cannot be changed, but it is possible
|
||||
to change values of the attributes. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbFixAttrSet
|
||||
{
|
||||
private:
|
||||
MbUserAttribType userAttrId; ///< \ru Идентификатор соответствующего пользовательского атрибута. \en Identifier of the corresponding external attribute.
|
||||
c3d::AttrVector attributes; ///< \ru Атрибуты. \en Attributes.
|
||||
|
||||
private:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbFixAttrSet( c3d::AttrVector & attrs );
|
||||
public:
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~MbFixAttrSet() { std::for_each( attributes.begin(), attributes.end(), ReleaseItem<MbAttribute> ); }
|
||||
|
||||
public:
|
||||
/// \ru Выдать идентификатор атрибута. \en Get attribute identifier.
|
||||
const MbUserAttribType & GetUserAttrId() const;
|
||||
|
||||
/// \ru Установить атрибуты. \en Set attributes.
|
||||
void SetAttribute ( size_t index, const MbAttribute & attrib );
|
||||
/// \ru Выдать атрибуты. \en Get attributes.
|
||||
const MbAttribute & GetAttribute ( size_t index, const MbAttribute & attrib ) const;
|
||||
|
||||
// \ru Выдать количество атрибутов. \en Get the number of attributes.
|
||||
size_t AttributesCount() const { return attributes.size(); }
|
||||
|
||||
// \ru Доступ хотелось бы ограничить только функцией. \en Access should be constrained only by a function.
|
||||
// static MbFixAttrSet * MbExternalAttribute::CreateFixAttrSet( const MbUserAttribType & attrId, std::vector<MbAttribute*> & attrs );
|
||||
friend class MbExternalAttribute;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbFixAttrSet )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Шаблон явления "Определения" пользовательского атрибута.
|
||||
\en A template of "Definition" phenomenon of user attribute. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
template <typename AttrDefClass>
|
||||
class UserAttrDefinitionInstance : public AttrDefInstance
|
||||
{
|
||||
private:
|
||||
AttrDefClass * attrDef; ///< \ru "Определение" пользовательского атрибута. \en "Definition" of user attribute.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
UserAttrDefinitionInstance( const MbUserAttribType & type );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~UserAttrDefinitionInstance();
|
||||
|
||||
public:
|
||||
// \ru Дать "определение" пользовательского атрибута. \en Get a "definition" of user attribute.
|
||||
virtual IAttrDefinition * GetAttrDefinition();
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru Преобразовать из пользовательского в "системный". \en Convert user attribute to "system" one.
|
||||
// ---
|
||||
template <typename AttrClass>
|
||||
MbUserAttribute * UserAttrDefinition<AttrClass>::ReduceUserAttrib( const MbExternalAttribute & source )
|
||||
{
|
||||
MbUserAttribType attrId( source.AttrTypeEx() );
|
||||
|
||||
MbUserAttribute * resAttr = new MbUserAttribute( _T("AttrClass"), attrId );
|
||||
resAttr->InitActions( source );
|
||||
{
|
||||
const char * charBuf = NULL;
|
||||
size_t memLen = 0;
|
||||
{
|
||||
membuf memBuf;
|
||||
{
|
||||
const AttrClass * attrPtr = static_cast<const AttrClass *>(&source);
|
||||
writer out( memBuf, io::out );
|
||||
if ( out.good() )
|
||||
out << attrPtr;
|
||||
}
|
||||
memBuf.closeBuff(); // before memBuf.getMemLen!!!
|
||||
|
||||
memLen = memBuf.getMemLen();
|
||||
charBuf = new char[memLen];
|
||||
memBuf.toMemory( charBuf, memLen );
|
||||
}
|
||||
resAttr->SetUserData( charBuf );
|
||||
delete [] charBuf;
|
||||
}
|
||||
|
||||
return resAttr;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru Преобразовать из "системного" в пользовательский. \en Convert "system" attribute to user one.
|
||||
// ---
|
||||
template <typename AttrClass>
|
||||
MbExternalAttribute * UserAttrDefinition<AttrClass>::AdvanceUserAttrib( const MbUserAttribute & source )
|
||||
{
|
||||
AttrClass * resAttr = NULL;
|
||||
MbUserAttribType attrId;
|
||||
source.GetUserAttribId( attrId );
|
||||
{
|
||||
membuf memBuf;
|
||||
{
|
||||
bool canRead = true;
|
||||
if ( !source.GetUserData( memBuf ) ) {
|
||||
canRead = false;
|
||||
if ( source.UpdateByExternalAttribute() ) {
|
||||
canRead = source.GetUserData( memBuf );
|
||||
}
|
||||
}
|
||||
if ( canRead ) {
|
||||
reader in( memBuf, io::in );
|
||||
if ( in.good() )
|
||||
in >> resAttr;
|
||||
}
|
||||
}
|
||||
memBuf.closeBuff();
|
||||
}
|
||||
return resAttr;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru "Разобрать" на составляющие атрибуты. \en Disassemble on attributes.
|
||||
// ---
|
||||
template <typename AttrClass>
|
||||
MbFixAttrSet * UserAttrDefinition<AttrClass>::DisassembleUsetAttrib( const MbExternalAttribute & /*source*/ ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru "Собрать" из составляющих атрибутов. \en Reassemble from attributes.
|
||||
// ---
|
||||
template <typename AttrClass>
|
||||
bool UserAttrDefinition<AttrClass>::ReassembleUsetAttrib( const MbFixAttrSet & /*source*/, MbExternalAttribute & /*targer*/ ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Конструктор. \en Constructor.
|
||||
// ---
|
||||
template <typename AttrDefClass>
|
||||
UserAttrDefinitionInstance<AttrDefClass>::UserAttrDefinitionInstance(const MbUserAttribType & type)
|
||||
: AttrDefInstance( type )
|
||||
, attrDef( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Деструктор. \en Destructor.
|
||||
// ---
|
||||
template <typename AttrDefClass>
|
||||
UserAttrDefinitionInstance<AttrDefClass>::~UserAttrDefinitionInstance()
|
||||
{
|
||||
if ( attrDef != NULL )
|
||||
delete attrDef;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Дать "определение" пользовательского атрибута. \en Get a "definition" of user attribute.
|
||||
// ---
|
||||
template <typename AttrDefClass>
|
||||
IAttrDefinition * UserAttrDefinitionInstance<AttrDefClass>::GetAttrDefinition()
|
||||
{
|
||||
if ( attrDef == NULL )
|
||||
attrDef = new AttrDefClass();
|
||||
return attrDef;
|
||||
}
|
||||
|
||||
|
||||
#endif // __ATTR_USER_ATTRIBUT_H
|
||||
@@ -0,0 +1,540 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты объекта.
|
||||
\en Object attributes. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTRIBUTE_H
|
||||
#define __ATTRIBUTE_H
|
||||
|
||||
|
||||
#include <io_tape.h>
|
||||
#include <reference_item.h>
|
||||
#include <math_define.h>
|
||||
#include <mb_property_title.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbVector3D;
|
||||
class MATH_CLASS MbAxis3D;
|
||||
class MATH_CLASS MbMatrix3D;
|
||||
class MATH_CLASS MbProperties;
|
||||
class MATH_CLASS MbAttributeContainer;
|
||||
class MbRegDuplicate;
|
||||
class MbRegTransform;
|
||||
|
||||
|
||||
class MATH_CLASS MbAttribute;
|
||||
namespace c3d // namespace C3D
|
||||
{
|
||||
typedef SPtr<MbAttribute> AttrSPtr;
|
||||
typedef SPtr<const MbAttribute> ConstAttrSPtr;
|
||||
|
||||
typedef std::vector<MbAttribute *> AttrVector;
|
||||
typedef std::vector<const MbAttribute *> ConstAttrVector;
|
||||
|
||||
typedef std::vector<AttrSPtr> AttrSPtrVector;
|
||||
typedef std::vector<ConstAttrSPtr> ConstAttrSPtrVector;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Типы атрибутов.
|
||||
\en Types of attributes. \~
|
||||
\details \ru Типы атрибутов объектов геометрической модели.
|
||||
Атрибуты объектов группируются по семействам.
|
||||
\en Types of geometric model objects attributes.
|
||||
Objects attributes are grouped by families. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
enum MbeAttributeType
|
||||
{
|
||||
at_Undefined = 0, ///< \ru Неопределенный - используется при поиске как "любой". \en Undefined - used as "any" in search. \n
|
||||
|
||||
// \ru Типы простых атрибутов. \en Types of elementary attributes.
|
||||
at_ElementaryAttribute = 101, ///< \ru Простой атрибут. \en Elementary attribute.
|
||||
at_Identifier = 102, ///< \ru Идентификатор. \en Identifier.
|
||||
at_Color = 103, ///< \ru Цвет. \en Color.
|
||||
at_Width = 104, ///< \ru Ширина линий. \en Lines width.
|
||||
at_Style = 105, ///< \ru Стиль линий. \en Lines style.
|
||||
at_Visual = 106, ///< \ru Свойства для OpenGL. \en Properties for OpenGL.
|
||||
at_Selected = 107, ///< \ru Селектированность. \en Selection.
|
||||
at_Visible = 108, ///< \ru Видимость. \en Visibility.
|
||||
at_WireCount = 109, ///< \ru Количество u-линий и v-линий отрисовочной сетки. \en The number of u-mesh and v-mesh drawing lines. \~
|
||||
at_Changed = 110, ///< \ru Изменённость. \en Modification.
|
||||
at_Dencity = 111, ///< \ru Плотность. \en Density.
|
||||
at_NameAttribute = 112, ///< \ru Топологическое имя. \en Topological name.
|
||||
at_UpdateStamp = 113, ///< \ru Метка времени обновления. \en Stamp of update time.
|
||||
at_Embodiment = 114, ///< \ru Признак исполнения (варианта реализации модели). \en Indication of embodiment (variant of model implementation).
|
||||
at_Elasticity = 115, ///< \ru Механические характеристики: модуль Юнга и коэффициент Пуассана. \en Mechanical properties: Young's modulus and Poisson's ratio.
|
||||
at_Strains = 116, ///< \ru Деформации. \en The strains.
|
||||
at_ElementaryLast = 200, /// \ru Простые атрибуты вставлять перед этим значением. \en Elementary attributes should be inserted before this value. \n
|
||||
|
||||
// \ru Типы обобщенных атрибутов. \en Types of common attributes.
|
||||
at_CommonAttribute = 201, ///< \ru Обобщенный атрибут. \en Common attribute.
|
||||
at_BoolAttribute = 202, ///< \ru Булев атрибут. \en Boolean attribute.
|
||||
at_IntAttribute = 203, ///< \ru Целочисленный атрибут. \en Integer attribute.
|
||||
at_DoubleAttribute = 204, ///< \ru Действительный атрибут. \en Double attribute.
|
||||
at_StringAttribute = 205, ///< \ru Строковый атрибут. \en String attribute.
|
||||
at_GeomAttribute = 206, ///< \ru Геометрический атрибут. \en Geometric attribute. \n
|
||||
at_StampRibAttribute = 207, ///< \ru Атрибут ребра жесткости листового тела. \en Attribute of reinforcement rib of sheet solid. \n
|
||||
at_Int64Attribute = 208, ///< \ru Атрибут int64. \en Int64 attribute.
|
||||
at_BinaryAttribute = 209, ///< \ru Бинарный атрибут. \en Binary attribute.
|
||||
|
||||
// \ru Типы связующих атрибутов. \en Types of linking attributes.
|
||||
at_LinkingAttribute = 301, ///< \ru Связующий атрибут. \en Linking attribute.
|
||||
at_AnchorAttribute = 302, ///< \ru Якорь. \en Anchor. \n
|
||||
|
||||
// \ru Типы директивных атрибутов. \en Types of directive attributes.
|
||||
at_DirectiveAttribute = 401, ///< \ru Директивный атрибут. \en Directive attribute.
|
||||
at_KeepUniqueKey = 402, ///< \ru Поддерживать уникальность ключей. \en Support unique keys. \n
|
||||
|
||||
// \ru Типы изделия. \en Types of product attributes.
|
||||
at_ProductAttribute = 501, ///< \ru Атрибут конвертеров \en Converters attribute
|
||||
at_ModelInfo = 502, ///< \ru Сведения о модели в целом. \en Information about model itself.
|
||||
at_PersonOrganizationInfo = 503, ///< \ru Лицо и организация. \en Person and organization information.
|
||||
at_ProductInfo = 504, ///< \ru Сведения об изделии. \en Product info.
|
||||
at_STEPTextDescription = 505, ///< \ru Описание STEP. \en STEP description.
|
||||
at_STEPReferenceHolder = 506, ///< \ru Обратная ссылка. \en Back reference. \n
|
||||
|
||||
// \ru Типы пользовательских атрибутов. \en Types of user attributes.
|
||||
at_UserAttribute = 601, ///< \ru Пользовательский атрибут. \en User attribute.
|
||||
at_UserFirst = 602, ///< \ru Первый пользовательский атрибут. \en First user attribute.
|
||||
at_UserLast = 900, ///< \ru Последний пользовательский атрибут. \en Last user attribute. \n
|
||||
|
||||
// \ru Типы внешних (внесистемных) атрибутов. \en Types of external (off-system) attributes.
|
||||
at_ExternalAttribute = 901, ///< \ru Внешний атрибут. \en External attribute.
|
||||
at_ExternalAttributeImp = 902, ///< \ru Подтип - внешний атрибут \en Subtype - external attribute.
|
||||
|
||||
at_FreeItem = 1000, ///< \ru Тип для прочих объектов. \en Type for the other objects.
|
||||
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Типы контейнеров атрибутов.
|
||||
\en Types of attribute containers. \~
|
||||
\details \ru Типы контейнеров атрибутов наследников контейнера атрибутов.
|
||||
Каждый отдельный атрибут может содержать свой контейнер атрибутов.
|
||||
\en Types of attribute containers which are inheritors of attribute container.
|
||||
Each separate attribute may have its attribute container. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
enum MbeImplicationType
|
||||
{
|
||||
ace_Attribute, ///< \ru Контейнер атрибутов, содержащий другие атрибуты. \en Attribute container which contains other attributes.
|
||||
ace_ModelItem, ///< \ru Контейнер атрибутов объектов геометрической модели. \en Container of geometric model objects attributes.
|
||||
ace_TopItem, ///< \ru Контейнер атрибутов именованных топологических объектов. \en Container of named topological objects attributes.
|
||||
ace_MeshItem, ///< \ru Контейнер атрибутов сеточных примитивов. \en Container of mesh primitives attributes.
|
||||
ace_Model, ///< \ru Контейнер атрибутов геометрической модели. \en Container of geometric model attributes.
|
||||
ace_AttribContainer, ///< \ru Контейнер атрибутов. \en Attribute container.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Атрибуты объекта.
|
||||
\en Object attributes. \~
|
||||
\details \ru Атрибуты содержат информацию, дополняющую описание геометрической формы объекта.
|
||||
Атрибут не является неотъемлемой частью объекта, а является элементом данных, которыми может быть наделен объект.\n
|
||||
Атрибуты являются агентами передачи данных геометрического ядра от одного приложения другому приложению.\n
|
||||
Атрибуты могут быть следующих типов.\n
|
||||
Простой атрибут - атрибут несущий простую, однозначно интерпретируемую, информацию, например, цвет, признак выбора.\n
|
||||
Обобщенный атрибут - атрибут стандартного типа со строковым наименованием,
|
||||
например, имя, целое число, вещественное число, строка, точка, вектор, указатель.\n
|
||||
С помощью таких атрибутов приложения могут обмениваться какой либо специфичной информацией
|
||||
без необходимости разработки дополнительных комплексных атрибутов.\n
|
||||
Комплексный атрибут - атрибут состоящий из предопределенного набора данных,
|
||||
описывающих природу атрибута и его смысловую нагрузку, а так же способ его интерпретации.
|
||||
Такими атрибутами могут описываться некоторые ограничения или простые зависимости а так же аннотационные объекты.\n
|
||||
Директивный атрибут - атрибут определяющий предназначения объекта или действия которые необходимо с ним произвести,
|
||||
например атрибут "вычитание" подразумевает что некое тело предназначено для вычитания из другого тела,
|
||||
и не важно из какого.
|
||||
Связующий атрибут - атрибут предназначенный для связи объекта геометрического ядра с абстрактным контейнером данных,
|
||||
то есть набором данных, формат и смысловая нагрузка которых не может быть описана в рамках других атрибутов.\n
|
||||
\en Attributes contain information supplementing description of object geometric shape.
|
||||
Attribute is not an intrinsic part of the object, but it is an element of data which the object may contain. \n
|
||||
Attributes are geometric kernel agents for transferring data from one application to another. \n
|
||||
The possible types of attributes are the following. \n
|
||||
Elementary attribute - an attribute which reflects simple and clearly interpreted information, for example, color or selection attribute.\n
|
||||
Common attribute - attribute of standard type with string naming,
|
||||
for example: name, integer value, double value, string, point, vector, pointer. \n
|
||||
Applications may communicate any specific information using such attributes
|
||||
without necessity of additional complex attributes developing. \n
|
||||
Complex attribute - an attribute which consists of predefined data set,
|
||||
which describe a nature of attribute, its semantic meaning and a way of its interpretation.
|
||||
Such attributes can describe some of constraints or simple dependences and annotation objects.\n
|
||||
Directive attribute - an attribute defining the purpose of object or actions which should be performed with it,
|
||||
for example, an attribute "subtraction" implies that one solid is purposed for subtraction from another,
|
||||
no matter from what exactly.
|
||||
Linking attribute - an attribute designed for linking of geometric kernel object with abstract container of data,
|
||||
i.e. a set of data, which format and semantic meaning can not be described by other attributes. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbAttribute : public MbRefItem,
|
||||
public TapeBase
|
||||
{
|
||||
public:
|
||||
/**\ru Поведение атрибута при изменении владельца, не связанном с другими описанными действия.
|
||||
\en Behavior of attribute which is not associated with other described actions when changing the owner. \~ */
|
||||
enum OnChangeOwnerAction {
|
||||
chn_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnChangeOwner. \en Behavior defined by the virtual function OnChangeOwner.
|
||||
chn_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
chn_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
chn_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при перерождении объекта в другой объект.
|
||||
\en Behavior of attribute when an object regenerates in other object. \~ */
|
||||
enum OnConvertOwnerAction {
|
||||
cnv_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnConvertOwner. \en Behavior defined by the virtual function OnConvertOwner.
|
||||
cnv_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
cnv_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
cnv_Copy, ///< \ru Скопировать атрибут и прицепить его копию к копии владельца. \en Copy an attribute and attach its copy to an owner copy.
|
||||
cnv_Convert, ///< \ru Конвертировать атрибут и прицепить результат к копии владельца. \en Copy an attribute and attach the result to an owner copy.
|
||||
cnv_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при преобразовании владельца (по матрице).
|
||||
\en Behaviour of attribute when transforming the owner (by the matrix). \~ */
|
||||
enum OnTransformOwnerAction {
|
||||
trn_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnTransformOwner. \en Behavior defined by the virtual function OnTransformOwner.
|
||||
trn_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
trn_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
trn_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при копировании владельца.
|
||||
\en Behaviour of attribute when copying the owner. \~ */
|
||||
enum OnCopyOwnerAction {
|
||||
cpy_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnCopyOwner. \en Behavior defined by the virtual function OnCopyOwner.
|
||||
cpy_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
cpy_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
cpy_Copy, ///< \ru Скопировать атрибут и прицепить его копию к копии владельца. \en Copy an attribute and attach its copy to an owner copy.
|
||||
cpy_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при объединении владельца с другим объектом.
|
||||
\en Behaviour of attribute when merging of the owner with another object. \~ */
|
||||
enum OnMergeOwnerAction {
|
||||
mrg_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnMergeOwner. \en Behavior is defined by the virtual function OnMergeOwner.
|
||||
mrg_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
mrg_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
mrg_KeepAll, ///< \ru Передать атрибут от поглощаемого объекта поглощающему объекту без замещения. \en Transmit attribute from absorbed object to absorbing object without replacing.
|
||||
mrg_KeepRep, ///< \ru Передать атрибут от поглощаемого объекта поглощающему объекту с замещением. \en Transmit attribute from absorbed object to absorbing object with replacing.
|
||||
mrg_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при замещении владельца с другим объектом.
|
||||
\en Behavior of attribute when replacing the owner by another object. \~ */
|
||||
enum OnReplaceOwnerAction {
|
||||
rep_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnReplaceOwner. \en Behavior is defined by the virtual function OnReplaceOwner.
|
||||
rep_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
rep_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
rep_KeepAll, ///< \ru Передать атрибут от замещаемого объекта замещающему объекту без замещения. \en Transmit attribute from replaced object to substitutional object without replacing.
|
||||
rep_KeepRep, ///< \ru Передать атрибут от замещаемого объекта замещающему объекту с замещением. \en Transmit attribute from replaced object to substitutional object with replacing.
|
||||
rep_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при разделении владельца.
|
||||
\en Behavior of attribute when splitting the owner. \~ */
|
||||
enum OnSplitOwnerAction {
|
||||
spl_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnSplitOwner. \en Behavior is defined by the virtual function OnSplitOwner.
|
||||
spl_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
spl_Keep, ///< \ru Сохранить атрибут, т.е. ничего с ним не делать. \en Save attribute, i.e. do not do anything with it.
|
||||
spl_Copy, ///< \ru Размножить(скопировать) атрибут для каждого результата разбиения. \en Duplicate (copy) attribute for each result of splitting.
|
||||
spl_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
/**\ru Поведение атрибута при удалении владельца.
|
||||
\en Behavior of attribute when deleting the owner. \~ */
|
||||
enum OnDeleteOwnerAction {
|
||||
del_Self = 0, ///< \ru Поведение, определяемое виртуальной функцией OnDeleteOwner. \en Behavior defined by the virtual function OnDeleteOwner.
|
||||
del_Free, ///< \ru Освободить атрибут, если это возможно, в противном случае удалить. \en Free attribute if it is possible, otherwise delete it.
|
||||
del_ActCount, ///< \ru Количество элементов в перечислении (добавлять перед данным значением). \en The number of elements in enumeration (add before the given value).
|
||||
};
|
||||
|
||||
private :
|
||||
uint8 forChange; ///< \ru Поведение атрибута при изменении владельца. \en Behavior of attribute when changing the owner.
|
||||
uint8 forConvert; ///< \ru Поведение атрибута при конвертации владельца. \en Behavior of attribute when converting the owner.
|
||||
uint8 forTransform; ///< \ru Поведение атрибута при трансформировании владельца. \en Behavior of attribute when transforming the owner.
|
||||
uint8 forCopy; ///< \ru Поведение атрибута при копировании владельца. \en Behavior of attribute when copying the owner.
|
||||
uint8 forMerge; ///< \ru Поведение атрибута при объединении владельца. \en Behavior of attribute when merging the owner.
|
||||
uint8 forReplace; ///< \ru Поведение атрибута при замене владельца. \en Behavior of attribute when replacing the owner.
|
||||
uint8 forSplit; ///< \ru Поведение атрибута при разделении владельца. \en Behavior of attribute when splitting the owner.
|
||||
uint8 forDelete; ///< \ru Поведение атрибута при удалении владельца. \en Behavior of attribute when deleting the owner.
|
||||
bool freeable; ///< \ru Свободность атрибута. \en Attribute freeness
|
||||
bool copyable; ///< \ru Разрешение копировать атрибут. \en Permission to copy attribute.
|
||||
|
||||
protected :
|
||||
/// \ru Конструктор без параметров для наследников. \en Constructor without parameters for inheritors.
|
||||
MbAttribute();
|
||||
public :
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbAttribute();
|
||||
|
||||
public :
|
||||
/** \ru \name Общие функции атрибутов
|
||||
\en \name Common functions of attributes
|
||||
\{ */
|
||||
/// \ru Выдать регистрационный тип (для копирования, дублирования). \en Get registrational type (for copying, duplication)
|
||||
virtual MbeRefType RefType() const;
|
||||
/// \ru Выдать тип контейнера атрибутов. \en Get attribute container type.
|
||||
virtual MbeImplicationType ImplicationType() const;
|
||||
/// \ru Выдать тип атрибута. \en Get attribute type.
|
||||
virtual MbeAttributeType AttributeFamily() const = 0;
|
||||
/// \ru Выдать подтип атрибута. \en Get subtype of an attribute.
|
||||
virtual MbeAttributeType AttributeType() const = 0;
|
||||
/// \ru Сделать копию элемента. \en Create a copy of the element.
|
||||
virtual MbAttribute & Duplicate( MbRegDuplicate * iReg = NULL ) const = 0;
|
||||
/** \brief \ru Определить, являются ли объекты равными.
|
||||
\en Determine whether objects are equal. \~
|
||||
\details \ru Равными считаются однотипные объекты, все данные которых одинаковы (равны).
|
||||
\en Objects of the same types with similar (equal) data are considered to be equal. \~
|
||||
\param[in] item - \ru Объект для сравнения.
|
||||
\en Objects for comparison. \~
|
||||
\param[in] accuracy - \ru Точность сравнения.
|
||||
\en The accuracy to compare. \~
|
||||
\return \ru Равны ли объекты.
|
||||
\en Whether objects are equal. \~
|
||||
*/
|
||||
virtual bool IsSame( const MbAttribute & item, double accuracy ) const = 0;
|
||||
/// \ru Инициализировать данные по присланным. \en Initialize data.
|
||||
virtual bool Init( const MbAttribute & ) = 0;
|
||||
|
||||
/// \ru Проверить тип атрибута. \en Check an attribute type.
|
||||
bool IsA( MbeAttributeType t ) const { return t == AttributeFamily(); }
|
||||
/** \} */
|
||||
|
||||
/** \ru \name Действия над объектами геометрического ядра, влияющие на состояние атрибутов
|
||||
\en \name Actions with objects of geometric kernel influencing on states of attributes.
|
||||
\{ */
|
||||
/** \brief \ru Выполнить действия при изменении владельца, не связанное с другими действиями.
|
||||
\en Perform actions which are not associated with other actions when changing the owner. \~
|
||||
\details \ru Действия при изменении владельца, не связанное с другими действиями. \n
|
||||
Вызывается после изменения владеющего объекта при условии GetActionForChange() == chn_Self.
|
||||
\en Actions which are not associated with other actions when changing the owner. \n
|
||||
This function is called after changing the owning object in a case when GetActionForChange() == chn_Self. \~ */
|
||||
virtual void OnChangeOwner( const MbAttributeContainer & owner ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при конвертации владельца, \n
|
||||
Вызывается после конвертирования владеющего объекта при условии GetActionForConvert() == cnv_Self. \n
|
||||
В качестве входного параметра передается результат конвертирования объекта.
|
||||
\en Perform actions when converting the owner, \n
|
||||
This function is called after converting the owning object in a case when GetActionForConvert() == cnv_Self. \n
|
||||
The result of object converting is passed as input parameter. \~ */
|
||||
virtual void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при трансформировании владельца, \n
|
||||
Вызывается после трансформирования владеющего объекта при условии GetActionForTransform() == trn_Self.
|
||||
В качестве входного параметра может передаваться регистратор трансформированных объектов.
|
||||
\en Perform actions when transforming the owner, \n
|
||||
This function is called after transforming the owning object in a case when GetActionForTransform() == trn_Self.
|
||||
The registrator of transformed objects may be passed as input parameter. \~ */
|
||||
virtual void OnTransformOwner( const MbAttributeContainer & owner, const MbMatrix3D & matr, MbRegTransform * iReg = NULL ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при перемещении владельца. \n
|
||||
Вызывается после перемещения владеющего объекта при условии GetActionForTransform() == trn_Self.
|
||||
В качестве входного параметра может передаваться регистратор трансформированных объектов.
|
||||
\en Perform actions when moving the owner. \n
|
||||
This function is called after moving the owning object in a case when GetActionForTransform() == trn_Self.
|
||||
The registrator of transformed objects may be passed as input parameter. \~ */
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D & to, MbRegTransform * iReg = NULL ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при вращении владельца. \n
|
||||
Вызывается после вращения владеющего объекта при условии GetActionForTransform() == trn_Self.
|
||||
В качестве входного параметра может передаваться регистратор трансформированных объектов.
|
||||
\en Perform actions when rotating the owner. \n
|
||||
This function is called after rotating the owning object in a case when GetActionForTransform() == trn_Self.
|
||||
The registrator of transformed objects may be passed as input parameter. \~ */
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при копировании владельца. \n
|
||||
Вызывается после копирования владеющего объекта при условии GetActionForCopy() == cpy_Self. \n
|
||||
В качестве входных параметров передаются: копия владеющего объекта и регистратор скопированных объектов.
|
||||
\en Perform actions when copying the owner. \n
|
||||
This function is called after copying the owning object in a case when GetActionForCopy() == cpy_Self. \n
|
||||
The following objects are passed as input parameters: the owning object copy and registrator of copied objects. \~ */
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * iReg = NULL ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при объединении владельца. \n
|
||||
Вызывается перед слиянием владельца при условии GetActionForMerge() == mrg_Self. \n
|
||||
В качестве входного параметра передается объект который будет поглощен.
|
||||
\en Perform actions when merging the owner. \n
|
||||
This function is called before merging the owner in a case when GetActionForMerge() == mrg_Self. \n
|
||||
The object which will be absorbed is passed as input parameter. \~ */
|
||||
virtual void OnMergeOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при замене владельца. \n
|
||||
Вызывается перед выполнением замены владельца при условии GetActionForReplace() == rep_Self. \n
|
||||
В качестве входного параметра передается объект - заместитель.
|
||||
\en Perform actions when replacing the owner. \n
|
||||
This function is called before replacing the owner in a case when GetActionForReplace() == rep_Self. \n
|
||||
The substitutional object is passed as input parameter. \~ */
|
||||
virtual void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при разделении владельца. \n
|
||||
Вызывается после разбиения владеющего объекта при условии GetActionForSplit() == spl_Self. \n
|
||||
В качестве входного параметра передается контейнер результатов разбиения.
|
||||
\en Perform actions when splitting the owner. \n
|
||||
This function is called after splitting the owning object in a case when GetActionForSplit() == spl_Self. \n
|
||||
The container of splitting results is passed as input parameter. \~ */
|
||||
virtual void OnSplitOwner( const MbAttributeContainer & owner, const std::vector<MbAttributeContainer*> & others ) = 0;
|
||||
|
||||
/**\ru Выполнить действия при удалении владельца. \n
|
||||
Вызывается перед удалением объекта при условии GetActionForDelete() == spl_Self.
|
||||
\en Perform actions when deleting the owner. \n
|
||||
This function is called before deleting the owner in a case when GetActionForDelete() == spl_Self. \~ */
|
||||
virtual void OnDeleteOwner( const MbAttributeContainer & owner ) = 0;
|
||||
/** \} */
|
||||
|
||||
/// \ru Выдать поведение атрибута при изменении владельца. \en Get behavior of attribute when changing the owner.
|
||||
OnChangeOwnerAction GetActionForChange () const { return static_cast<OnChangeOwnerAction>(forChange); }
|
||||
/// \ru Выдать поведение атрибута при конвертации владельца. \en Get behavior of attribute when converting the owner.
|
||||
OnConvertOwnerAction GetActionForConvert () const { return static_cast<OnConvertOwnerAction>(forConvert); }
|
||||
/// \ru Выдать поведение атрибута при трансформировании владельца. \en Get behavior of attribute when transforming the owner.
|
||||
OnTransformOwnerAction GetActionForTransform() const { return static_cast<OnTransformOwnerAction>(forTransform); }
|
||||
/// \ru Выдать поведение атрибута при копировании владельца. \en Get behavior of attribute when copying the owner.
|
||||
OnCopyOwnerAction GetActionForCopy () const { return static_cast<OnCopyOwnerAction>(forCopy); }
|
||||
/// \ru Выдать поведение атрибута при объединении владельца. \en Get behavior of attribute when merging the owner.
|
||||
OnMergeOwnerAction GetActionForMerge () const { return static_cast<OnMergeOwnerAction>(forMerge); }
|
||||
/// \ru Выдать поведение атрибута при замене владельца. \en Get behavior of attribute when replacing the owner.
|
||||
OnReplaceOwnerAction GetActionForReplace () const { return static_cast<OnReplaceOwnerAction>(forReplace); }
|
||||
/// \ru Выдать поведение атрибута при разделении владельца. \en Get behavior of attribute when splitting the owner.
|
||||
OnSplitOwnerAction GetActionForSplit () const { return static_cast<OnSplitOwnerAction>(forSplit); }
|
||||
/// \ru Выдать поведение атрибута при удалении владельца. \en Get behavior of attribute when deleting the owner.
|
||||
OnDeleteOwnerAction GetActionForDelete () const { return static_cast<OnDeleteOwnerAction>(forDelete); }
|
||||
|
||||
/// \ru Задать поведение атрибута при изменении владельца. \en Set behavior of attribute when changing the owner.
|
||||
void SetActionForChange ( OnChangeOwnerAction a ) { forChange = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при конвертации владельца. \en Set behavior of attribute when converting the owner.
|
||||
void SetActionForConvert ( OnConvertOwnerAction a ) { forConvert = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при трансформировании владельца. \en Set behavior of attribute when transforming the owner.
|
||||
void SetActionForTransform( OnTransformOwnerAction a ) { forTransform = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при копировании владельца. \en Set behavior of attribute when copying the owner.
|
||||
void SetActionForCopy ( OnCopyOwnerAction a ) { forCopy = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при объедении владельца. \en Set behavior of attribute when merging the owner.
|
||||
void SetActionForMerge ( OnMergeOwnerAction a ) { forMerge = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при замене владельца. \en Set behavior of attribute when replacing the owner.
|
||||
void SetActionForReplace ( OnReplaceOwnerAction a ) { forReplace = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при разбиении владельца. \en Set behavior of attribute when splitting the owner.
|
||||
void SetActionForSplit ( OnSplitOwnerAction a ) { forSplit = (uint8)a; }
|
||||
/// \ru Задать поведение атрибута при удалении владельца. \en Set behavior of attribute when deleting the owner.
|
||||
void SetActionForDelete ( OnDeleteOwnerAction a ) { forDelete = (uint8)a; }
|
||||
|
||||
/// \ru Определить поведение атрибута по другому атрибуту. \en Define behavior of an attribute by another attribute.
|
||||
void InitActions ( const MbAttribute & );
|
||||
|
||||
bool CanBeFree () const { return freeable; }
|
||||
bool CanBeCopied() const { return copyable; }
|
||||
|
||||
void SetCanBeFree ( bool b ) { freeable = b; }
|
||||
void SetCanBeCopied( bool b ) { copyable = b; }
|
||||
|
||||
/// \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void GetProperties( MbProperties & );
|
||||
/// \ru Установить свойства объекта. \en Set properties of object.
|
||||
virtual size_t SetProperties( const MbProperties & );
|
||||
/// \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
virtual MbePrompt GetPropertyName() = 0;
|
||||
|
||||
virtual bool IsFamilyRegistrable() const;
|
||||
|
||||
DECLARE_PERSISTENT_CLASS( MbAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbAttribute )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Объект для свойств.
|
||||
\en Object for properties. \~
|
||||
\details \ru Объект для свойств. \n
|
||||
\en Object for properties. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbAttributeAction : public MbRefItem {
|
||||
private :
|
||||
uint8 & forChange; ///< \ru Поведение атрибута при изменении владельца. \en Behavior of attribute when changing the owner.
|
||||
uint8 & forConvert; ///< \ru Поведение атрибута при конвертации владельца. \en Behavior of attribute when converting the owner.
|
||||
uint8 & forTransform; ///< \ru Поведение атрибута при трансформировании владельца. \en Behavior of attribute when transforming the owner.
|
||||
uint8 & forCopy; ///< \ru Поведение атрибута при копировании владельца. \en Behavior of attribute when copying the owner.
|
||||
uint8 & forMerge; ///< \ru Поведение атрибута при объединении владельца. \en Behavior of attribute when merging the owner.
|
||||
uint8 & forReplace; ///< \ru Поведение атрибута при замене владельца. \en Behavior of attribute when replacing the owner.
|
||||
uint8 & forSplit; ///< \ru Поведение атрибута при разделении владельца. \en Behavior of attribute when splitting the owner.
|
||||
uint8 & forDelete; ///< \ru Поведение атрибута при удалении владельца. \en Behavior of attribute when deleting the owner.
|
||||
bool & freeable; ///< \ru Свободность атрибута. \en Attribute freeness
|
||||
bool & copyable; ///< \ru Разрешение копировать атрибут. \en Permission to copy attribute.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор с параметрами. \en Constructor with parameters.
|
||||
MbAttributeAction( uint8 & cha, uint8 & con, uint8 & tra, uint8 & cop, uint8 & mer, uint8 & rep, uint8 & spl, uint8 & del,
|
||||
bool & fre, bool & cob )
|
||||
: MbRefItem()
|
||||
, forChange( cha )
|
||||
, forConvert( con )
|
||||
, forTransform( tra )
|
||||
, forCopy( cop )
|
||||
, forMerge( mer )
|
||||
, forReplace( rep )
|
||||
, forSplit( spl )
|
||||
, forDelete( del )
|
||||
, freeable( fre )
|
||||
, copyable( cob ) {}
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~MbAttributeAction() {}
|
||||
|
||||
public:
|
||||
/// \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
void GetProperties( MbProperties & );
|
||||
/// \ru Установить свойства объекта. \en Set properties of object.
|
||||
void SetProperties( const MbProperties & );
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbAttributeAction )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Системные строки атрибутов. \en System strings of attributes.
|
||||
// ---
|
||||
namespace c3d // namespace C3D
|
||||
{
|
||||
/// \ru Подсказка для эквидистантной грани c нулевым значением эквидистанты. \en Hint for an offset face with the null value of offset.
|
||||
const c3d::string_t str_ShellFace ( _T( "c3d_ShellFace" ) );
|
||||
/// \ru Подсказка для эквидистантной грани. \en Hint for an offset face.
|
||||
const c3d::string_t str_OffsetFace ( _T( "c3d_OffsetFace" ) );
|
||||
/// \ru Подсказка для вскрываемой грани. \en Hint for an open face.
|
||||
const c3d::string_t str_OpenFace ( _T( "c3d_OpenFace" ) );
|
||||
/// \ru Подсказка для доп.эквидистантного смещения слипшейся грани. \en Hint for an offset of a stuck face.
|
||||
const c3d::string_t str_StuckOffset ( _T( "c3d_StuckOffset" ) );
|
||||
/// \ru Подсказка для удаляемой слипшейся грани. \en Hint for a deleted stuck face.
|
||||
const c3d::string_t str_StuckDelete ( _T( "c3d_StuckDelete" ) );
|
||||
|
||||
/// \ru Подсказка для расшивки граней по ребру. \en Hint for separation neighbour faces by an edge.
|
||||
const c3d::string_t str_UnstitchByEdge( _T( "c3d_UnstitchByEdge" ) );
|
||||
|
||||
/// \ru Подсказка для проверки идентификатора боковой грани. \en Hint for checking flank's identifier.
|
||||
const c3d::string_t str_CheckFlankId ( _T( "c3d_CheckFlankId" ) );
|
||||
/// \ru Подсказка для порядкового номера оболочки. \en Hint for shell sequence number.
|
||||
const c3d::string_t str_ShellSequenceNumber( _T( "c3d_ShellSequenceNumber" ) );
|
||||
|
||||
/// \ru Подсказка для сохраняемого объекта. \en Hint for kept object.
|
||||
const c3d::string_t str_KeptObject ( _T( "c3d_KeptObject" ) );
|
||||
/// \ru Подсказка для удаляемого объекта. \en Hint for deleting object.
|
||||
const c3d::string_t str_DeletingObject( _T( "c3d_DeletingObject" ) );
|
||||
/// \ru Подсказка для временного объекта. \en Hint for temporal object.
|
||||
const c3d::string_t str_TemporalObject( _T( "c3d_TemporalObject" ) );
|
||||
|
||||
/**\ru Для плоской грани, сгибаемой в цилиндр - параметр u, который меньше соответствующего параметра любой точки грани,
|
||||
сгибаемой в конус - угловой параметр луча, выходящего из начала координат плоскости параметров и не пересекающего контуры грани.
|
||||
\en For a planar face bended in cylinder - u-parameter which is less than corresponding parameter of any point on the face,
|
||||
bended in cone - angular parameter of the ray which goes out from the parameters plane origin and does not intersect contours of the face. \~*/
|
||||
const c3d::string_t str_BendMinAnlge ( _T( "BendMinAnlge" ) );
|
||||
/// \ru Для цилиндрической и конической грани параметр u, который меньше соответствующего параметра любой точки грани. \en For a cylindrical and conical face - parameter u which is less than corresponding parameter of any point on the face.
|
||||
const c3d::string_t str_UnbendMinAngle( _T( "UnbendMinAngle" ) );
|
||||
} // namespace C3D
|
||||
|
||||
#endif // __ATTRIBUTE_H
|
||||
@@ -0,0 +1,338 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Контейнер атрибутов.
|
||||
\en An attribute container. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTRIBUTE_CONTAINER_H
|
||||
#define __ATTRIBUTE_CONTAINER_H
|
||||
|
||||
|
||||
#include <attribute.h>
|
||||
#include <mb_enum.h>
|
||||
#include <vector>
|
||||
#include <templ_multimap.h>
|
||||
#include <attr_registry.h>
|
||||
|
||||
|
||||
class MATH_CLASS reader;
|
||||
class MATH_CLASS writer;
|
||||
class MATH_CLASS MbVector3D;
|
||||
class MATH_CLASS MbAxis3D;
|
||||
class MATH_CLASS MbMatrix3D;
|
||||
class MATH_CLASS MbAttribute;
|
||||
class MATH_CLASS MbUserAttribute;
|
||||
class MATH_CLASS MbExternalAttribute;
|
||||
class MATH_CLASS MbProperties;
|
||||
class MbRegDuplicate;
|
||||
class MbRegTransform;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Контейнер атрибутов.
|
||||
\en An attribute container. \~
|
||||
\details \ru Контейнер атрибутов. \n
|
||||
От данного класса наследуются объекты модели геометрического ядра MbItem
|
||||
и топологические объекты с именем MbTopologyItem .\n
|
||||
Наследники данного класса содержат атрибуты.\n
|
||||
Методами данного класса выполняются действия над атрибутами объектов геометрического ядра.\n
|
||||
Атрибут может влиять на состояние атрибута через его владельца,
|
||||
тo есть геометрическое ядро предусматривает возможность передачи атрибутам информации об изменениях
|
||||
их владельцев посредством вызовов предопределенных функций у самого атрибута.\n
|
||||
Кроме передачи самой информации об изменениях происходящих с владельцем,
|
||||
предусмотрена возможность определять поведение атрибута при этих изменениях путем выбора
|
||||
одного из предопределенных типов поведения на каждое изменения владельца.\n
|
||||
Типы действий, влияющих на состояние атрибутов.\n
|
||||
Копирование, например, при создании копии тела. Действие над атрибутом производится после копирования владеющего объекта.\n
|
||||
Разделение, например, разделение грани на две части при вырезании.
|
||||
Действие над атрибутом производится после разбиения владеющего объекта.\n
|
||||
Слияние, например, слияние граней при булевых операциях.
|
||||
Действие над атрибутом производится перед выполнением слияния объектов.
|
||||
Обрабатываются атрибуты всех объектов, участвующих в слиянии.\n
|
||||
Изменение, не связанное с разделением или слиянием.
|
||||
Действие над атрибутом производится после изменения владеющего объекта.\n
|
||||
Преобразование, например, поворот или параллельный перенос.
|
||||
Действие над атрибутом производится после преобразования владеющего объекта.\n
|
||||
Подмена, например замена одной грани тела на другую. Действие над атрибутом производится перед выполнением замены объектов.
|
||||
Обрабатываются атрибуты всех объектов, участвующих в замене.\n
|
||||
Удаление объекта. Действие над атрибутом производится перед удалением объекта.\n
|
||||
\en An attribute container. \n
|
||||
The inheritors of this class are: objects of geometric kernel model of type MbItem
|
||||
and topological objects of type MbTopologyItem.\n
|
||||
Inheritors of this class contain attributes.\n
|
||||
Operations with attributes of geometric kernel objects are performed by methods of this class.\n
|
||||
Attribute can affect attribute state using its owner,
|
||||
i.e. geometric kernel provides an opportunity for transmission to attributes the information about changes
|
||||
of their owners by calling the predefined functions of the attribute.\n
|
||||
In addition to transfer of information about changes occurring with owner
|
||||
provided a possibility to determine the behavior of attribute with these changes by selecting of
|
||||
one of the predefined types of behavior for each changing of the owner.\n
|
||||
Types of actions that affect the states of attributes.\n
|
||||
Copying, for example, when creating a copy of solid. Action on attribute is performed after copying of owning object.\n
|
||||
Splitting. For example, splitting of a face into two parts in cutting.
|
||||
Action on attribute is performed after splitting of owning object.\n
|
||||
Merging. For example, merging of faces in boolean operations.
|
||||
Action on attribute is performed after merging of owning object.\n
|
||||
Attributes of all objects involved in merging are processed.\n
|
||||
Changing which is not associated with splitting or merging.
|
||||
Action on attribute is performed after changing of owning object.\n
|
||||
Transformation. For example, rotation or parallel translation.
|
||||
Action on attribute is performed after transformation of owning object.\n
|
||||
Replacement. For example, replacement of one face of a solid to another. Action on attribute is performed after replacement of objects.
|
||||
Attributes of all objects involved in replacement are processed.\n
|
||||
Deletion of an object. Action on attribute is performed after deletion of an object.\n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbAttributeContainer
|
||||
{
|
||||
typedef MultiMap<int, MbAttribute *> AttrMap_t;
|
||||
|
||||
private:
|
||||
AttrMap_t attributes; ///< \ru Множество атрибутов. \en Set of attributes.
|
||||
|
||||
protected:
|
||||
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
|
||||
MbAttributeContainer( const MbAttributeContainer &, MbRegDuplicate * );
|
||||
public:
|
||||
/// \ru Конструктор без параметров. \en Constructor without parameters.
|
||||
MbAttributeContainer();
|
||||
/// \ru Конструктор по атрибуту. \en Constructor by attribute.
|
||||
MbAttributeContainer( MbAttribute & );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbAttributeContainer();
|
||||
|
||||
public:
|
||||
|
||||
/// \ru Выдать тип контейнера атрибутов. \en Get attribute container type.
|
||||
virtual MbeImplicationType ImplicationType() const { return ace_AttribContainer; }
|
||||
|
||||
/** \ru \name Общие функции над атрибутами
|
||||
\en \name Common functions of attributes
|
||||
\{ */
|
||||
/// \ru Cдублировать атрибуты присланного объекта, свои отпустить. \en Duplicate attributes of a given object, release existing attributes.
|
||||
void AttributesAssign( const MbAttributeContainer & );
|
||||
/// \ru Выдать количество объектов. \en Get the number of objects.
|
||||
size_t AttributesCount() const { return attributes.Count(); }
|
||||
/// \ru Удалить все атрибуты из контейнера. \en Delete all attributes from container.
|
||||
void RemoveAttributes();
|
||||
|
||||
/// \ru Добавить атрибут в контейнер. \en Add attribute in container.
|
||||
MbAttribute * AddAttribute( MbAttribute *, bool checkSame = true );
|
||||
/// \ru Добавить атрибут в контейнер (всегда копирует атрибут). \en Add attribute in container (always copies the attribute).
|
||||
MbAttribute * AddAttribute( const MbAttribute &, bool checkSame = true );
|
||||
/// \ru Выдать атрибуты заданного семейства. \en Get attributes of a given family.
|
||||
void GetAttributes( c3d::AttrVector &, MbeAttributeType aFamily, MbeAttributeType subType ) const;
|
||||
/// \ru Выдать атрибуты заданного типа. \en Get attributes of a given type.
|
||||
void GetAttributes( c3d::AttrVector &, MbeAttributeType aType ) const;
|
||||
/// \ru Выдать атрибуты по строке описания. \en Get attributes using sample of description string.
|
||||
void GetCommonAttributes( c3d::AttrVector &, const c3d::string_t & samplePrompt, MbeAttributeType subType = at_Undefined ) const;
|
||||
/// \ru Выдать строковые атрибуты по строке содержания. \en Get string attributes using sample of contents of the string.
|
||||
void GetStringAttributes( c3d::AttrVector &, const c3d::string_t & sampleContent ) const;
|
||||
|
||||
/// \ru Выдать атрибут заданного типа, если их несколько - то первый попавшийся. \en Get an attribute of a given type, the first one is returned if there are many.
|
||||
//const MbAttribute * GetAttribute( MbeAttributeType subType ) const;
|
||||
/// \ru Удалить атрибут из контейнера. \en Delete an attribute from container.
|
||||
bool RemoveAttribute( const MbAttribute *, bool checkAccuracySame = false, double accuracy = LENGTH_EPSILON );
|
||||
/// \ru Удалить атрибуты заданного типа. \en Delete attributes of a given type.
|
||||
bool RemoveAttributes( MbeAttributeType type, MbeAttributeType subType );
|
||||
|
||||
/// \ru Выдать простой атрибут данного подтипа. \en Get a simple attribute of a given subtype.
|
||||
const MbAttribute * GetSimpleAttribute( MbeAttributeType ) const;
|
||||
/// \ru Выдать простой атрибут данного подтипа. \en Get a simple attribute of a given subtype.
|
||||
MbAttribute * SetSimpleAttribute( MbeAttributeType );
|
||||
/// \ru Установить простой атрибут данного подтипа. \en Set a simple attribute of a given subtype.
|
||||
MbAttribute * SetSimpleAttribute( MbAttribute * simpAttr );
|
||||
/// \ru Установить простой атрибут данного подтипа (всегда копирует атрибут). \en Set a simple attribute of a given subtype (always copies the attribute).
|
||||
MbAttribute * SetSimpleAttribute( const MbAttribute & simpAttr );
|
||||
/// \ru Удалить простой атрибут(один и более) данного подтипа. \en Delete simple attributes (one or more) of a given subtype.
|
||||
void RemoveSimpleAttribute( MbeAttributeType );
|
||||
/// \ru Отдать простой атрибут данного подтипа. \en Detach a simple attribute of a given subtype.
|
||||
MbAttribute * DetachSimpleAttribute( MbeAttributeType );
|
||||
|
||||
/// \ru Выдать пользовательский атрибут данного подтипа. \en Get a user attribute of a given subtype.
|
||||
void GetUserAttributes( std::vector<MbUserAttribute *> & attrs, const MbUserAttribType & type ) const;
|
||||
/// \ru Удалить пользовательский атрибут (один и более) данного подтипа. \en Delete user attributes (one or more) of a given subtype.
|
||||
void RemoveUserAttributes( const MbUserAttribType & type );
|
||||
/// \ru Отдать пользовательский атрибут данного подтипа. \en Detach a user attribute of a given subtype.
|
||||
void DetachUserAttributes( std::vector<MbUserAttribute *> & attrs, const MbUserAttribType & type );
|
||||
|
||||
/// \ru Преобразовать из пользовательского в "системный" \en Convert user attribute to "system" one
|
||||
static MbUserAttribute * ReduceUserAttrib ( const MbExternalAttribute & );
|
||||
/// \ru Преобразовать из "системного" в пользовательский \en Convert "system" attribute to user one
|
||||
static MbExternalAttribute * AdvanceUserAttrib( const MbUserAttribute & );
|
||||
|
||||
/// \ru Выполнить действия при изменении атрибутов. \en Perform actions when changing the attributes.
|
||||
void AttributesChange ();
|
||||
/// \ru Выполнить действия при конвертации атрибутов. \en Perform actions when converting the attributes.
|
||||
void AttributesConvert( MbAttributeContainer & other ) const;
|
||||
/// \ru Выполнить действия при трансформировании атрибутов. \en Perform actions when transforming the attributes.
|
||||
void AttributesTransform( const MbMatrix3D &, MbRegTransform * = NULL );
|
||||
/// \ru Выполнить действия при перемещении атрибутов. \en Perform actions when moving the attributes.
|
||||
void AttributesMove ( const MbVector3D &, MbRegTransform * = NULL );
|
||||
/// \ru Выполнить действия при вращении атрибутов. \en Perform actions when rotating the attributes.
|
||||
void AttributesRotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
/// \ru Выполнить действия при копировании атрибутов. \en Perform actions when copying the attributes.
|
||||
void AttributesCopy ( MbAttributeContainer & other, MbRegDuplicate * = NULL ) const;
|
||||
/// \ru Выполнить действия при объединении атрибутов. \en Perform actions when merging the attributes.
|
||||
void AttributesMerge ( MbAttributeContainer & other );
|
||||
/// \ru Выполнить действия при замене атрибутов. \en Perform actions when replacing the attributes.
|
||||
void AttributesReplace( MbAttributeContainer & other );
|
||||
/// \ru Выполнить действия при разделении атрибутов. \en Perform actions when splitting the attributes.
|
||||
void AttributesSplit ( const std::vector<MbAttributeContainer *> & others );
|
||||
/// \ru Выполнить действия при удалении атрибутов. \en Perform actions when deleting the attributes.
|
||||
void AttributesDelete ();
|
||||
/** \} */
|
||||
|
||||
/** \ru \name Функции простых атрибутов объекта.
|
||||
\en \name Functions of object's simple attributes.
|
||||
\{ */
|
||||
/// \ru Установить плотность объекта. \en Set density of an object.
|
||||
void SetDensity( double );
|
||||
/// \ru Выдать плотность объекта. \en Get density of an object.
|
||||
double GetDensity() const;
|
||||
|
||||
/// \ru Установить визуальные свойства объекта. \en Set visual properties of the object.
|
||||
void SetVisual( float a, float d, float sp, float sh, float t, float e );
|
||||
/** \brief \ru Выдать визуальные свойства объекта.
|
||||
\en Get visual properties of the object. \~
|
||||
\details \ru Выдать визуальные свойства объекта.
|
||||
\en Get visual properties of the object. \~
|
||||
\param[out] a - \ru Коэффициент общего фона (рассеянного освещения)
|
||||
\en Coefficient of backlighting \~
|
||||
\param[out] d - \ru Коэффициент диффузного отражения
|
||||
\en Coefficient of diffuse reflection \~
|
||||
\param[out] s - \ru Коэффициент зеркального отражения
|
||||
\en Coefficient of specular reflection \~
|
||||
\param[out] h - \ru Блеск (показатель степени в законе зеркального отражения)
|
||||
\en Shininess (index according to the law of specular reflection) \~
|
||||
\param[out] t - \ru Коэффициент непрозрачности
|
||||
\en Coefficient of total reflection (opacity coefficient) \~
|
||||
\param[out] e - \ru Коэффициент излучения
|
||||
\en Emissivity coefficient \~
|
||||
\return \ru true если есть такой атрибут \n false в противном случае
|
||||
\en True if there is the attribute MbVisual \n otherwise false. \~
|
||||
*/
|
||||
bool GetVisual( float & a, float & d, float & sp, float & sh, float & t, float & e ) const;
|
||||
|
||||
/// \ru Есть ли у объекта свой цвет. \en .
|
||||
|
||||
/** \brief \ru Есть ли у объекта свой цвет.
|
||||
\en Whether the object is colored. \~
|
||||
\details \ru Есть ли у объекта свой цвет.
|
||||
\en Whether the object is colored. \~
|
||||
\return \ru true если есть такой атрибут \n false в противном случае
|
||||
\en True if there is the attribute MbColor \n otherwise false. \~
|
||||
*/
|
||||
bool IsColored() const { return (GetSimpleAttribute( at_Color ) != NULL); }
|
||||
/// \ru Изменить цвет объекта. \en Change color of the object.
|
||||
void SetColor( uint32 );
|
||||
/// \ru Выдать цвет объекта. \en Get color of an object.
|
||||
uint32 GetColor() const;
|
||||
|
||||
/// \ru Установить толщину линий для отображения объекта. \en Set thickness of lines for object's representation.
|
||||
void SetWidth( int );
|
||||
/// \ru Выдать толщину линий для отображения объекта. \en Get thickness of lines for object's representation.
|
||||
int GetWidth() const;
|
||||
|
||||
/// \ru Установить стиль линий для отображения объекта. \en Set style of lines for object's representation.
|
||||
void SetStyle( int );
|
||||
/// \ru Выдать стиль линий для отображения объекта. \en Get style of lines for object's representation.
|
||||
int GetStyle() const;
|
||||
|
||||
/// \ru Выделить или не выделить объект. \en To allocate or not to allocate an object.
|
||||
void SetSelected( bool s = true );
|
||||
/// \ru Выделен ли объект? \en Is the object selected.
|
||||
bool IsSelected() const;
|
||||
/// \ru Инвертировать выделение объекта. \en Invert object selection.
|
||||
bool ReverseSelected();
|
||||
|
||||
/// \ru Задать: объект изменен или не изменён. \en Set: the object is changed or isn't changed.
|
||||
void SetChanged( bool c = true );
|
||||
/// \ru Изменен ли объект? \en Is the object changed?
|
||||
bool IsChanged() const;
|
||||
|
||||
/// \ru Установить видимость. \en Set visibility.
|
||||
void SetVisible( bool );
|
||||
/// \ru Видимый ли объект? \en Is the object visible?
|
||||
bool IsVisible() const;
|
||||
/// \ru Не видимый ли элемент? \en Is the object invisible?
|
||||
bool IsInvisible() const;
|
||||
/** \} */
|
||||
|
||||
/// \ru Прочитать атрибуты из потока. \en Read attributes from stream.
|
||||
void AttributesRead ( reader & );
|
||||
/// \ru Записать атрибуты в поток. \en Writing attributes to stream.
|
||||
void AttributesWrite( writer & ) const;
|
||||
/// \ru Выдать свойства атрибутов. \en Get properties of attributes.
|
||||
void GetProperties( MbProperties & );
|
||||
/// \ru Установить свойства атрибутов. \en Set properties of attributes.
|
||||
void SetProperties( const MbProperties & );
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbAttributeContainer )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Получить обобщенные атрибуты.
|
||||
\en Get common attributes. \~
|
||||
\details \ru Получить обобщенные атрибуты. \n
|
||||
\en Get common attributes. \n \~
|
||||
\param[in] attrItem - \ru Объект с атрибутами.
|
||||
\en Object with attributes. \~
|
||||
\param[in] attrPrompt - \ru Подсказка атрибута для поиска.
|
||||
\en Attribute prompt. \~
|
||||
\param[out] resAttrs - \ru Найденные атрибуты.
|
||||
\en Found attributes. \~
|
||||
\result \ru Возвращает true, если что-то добавлено.
|
||||
\en Returns 'true' if the something was got. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) GetCommonAttributes( const MbAttributeContainer & attrItem, const c3d::string_t & attrPrompt, c3d::ConstAttrVector & resAttrs );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Установить обобщенные атрибуты в целевой объект из объекта-источника.
|
||||
\en Set common attributes in the destination object from the source object. \~
|
||||
\details \ru Установить обобщенные атрибуты в целевой объект из объекта-источника. \n
|
||||
\en Set common attributes in the destination object from the source object. \n \~
|
||||
\param[in] srcItem - \ru Объект-источник.
|
||||
\en The source object. \~
|
||||
\param[in] attrType - \ru Тип атрибута.
|
||||
\en Attribute type. \~
|
||||
\param[in] attrPrompt - \ru Подсказка атрибута для поиска.
|
||||
\en Attribute prompt. \~
|
||||
\param[out] dstItem - \ru Целевой объект.
|
||||
\en The destination object. \~
|
||||
\param[in,out] bufAttrs - \ru Буферный массив атрибутов.
|
||||
\en Buffer attributes vector. \~
|
||||
\result \ru Возвращает true, если что-то добавлено.
|
||||
\en Returns 'true' if the something was added. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) AddCommonAttributes( const MbAttributeContainer & srcItem, MbeAttributeType attrType, const c3d::string_t & attrPrompt,
|
||||
MbAttributeContainer & dstItem, c3d::AttrVector * bufAttrs = NULL );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить обобщенные атрибуты.
|
||||
\en Delete common attributes. \~
|
||||
\details \ru Удалить обобщенные атрибуты. \n
|
||||
\en Delete common attributes. \n \~
|
||||
\param[in] attrItem - \ru Объект с атрибутами.
|
||||
\en Object with attributes. \~
|
||||
\param[in] attrPrompt - \ru Подсказка атрибута для поиска.
|
||||
\en Attribute prompt. \~
|
||||
\result \ru Возвращает true, если что-то добавлено.
|
||||
\en Returns 'true' if the something was deleted. \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) RemoveCommonAttributes( MbAttributeContainer & attrItem, const c3d::string_t & attrPrompt );
|
||||
|
||||
|
||||
#endif // __ATTRIBUTE_CONTAINER_H
|
||||
@@ -0,0 +1,57 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Расчет пересечений тел посредством аппарата булевой операции.
|
||||
\en Calculation of intersections between solids using the boolean operations. \~
|
||||
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CDET_BOOL_H
|
||||
#define __CDET_BOOL_H
|
||||
|
||||
|
||||
#include <mb_operation_result.h>
|
||||
#include <mb_enum.h>
|
||||
#include <math_define.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbSolid;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Расчет пересечений тел посредством аппарата булевой операции.
|
||||
\en Calculation of intersections between solids using the boolean operations. \~
|
||||
\details \ru Расчет пересечений тел посредством аппарата булевой операции.
|
||||
\en Calculation of intersections between solids using the boolean operations. \~ \n
|
||||
\param[in] solid1 - \ru Первое тело. \en The first solid. \~
|
||||
\param[in] solid2 - \ru Второе тело. \en The second solid. \~
|
||||
\param[out] edges - \ru Ребра пересечения тел. \en Intersection edges. \~
|
||||
\param[out] intersectedFaces - \ru Пары номеров пересекшихся граней. \n
|
||||
- \en The couples of indeses intersected faces of the solids, \n
|
||||
\param[out] touchedFaces - \ru Пары номеров касающихся граней с противоположно направленными нормалями.
|
||||
\en The couples of indeses of contacted faces with oppositely directed normals. \~
|
||||
\param[out] similarFaces - \ru Пары номеров касающихся подобных граней, которые могут быть объединены.
|
||||
\en The couples of indeses of relating to similar faces that can be combined. \~
|
||||
\return \ru Код результата операции. \en Operation result code. \~
|
||||
|
||||
\warning \ru Тела будут изменены операцией! Если требуется сохранить тела без изменений,
|
||||
передавайте копии, сделанные помощью MbSolid::Duplicate().
|
||||
\en The solids will be modified by this operation! To keep the body intact,
|
||||
give the copies made using MbSolid::Duplicate(). \~
|
||||
|
||||
\ingroup Collision_Detection
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) InterferenceSolids( MbSolid & solid1, MbSolid & solid2,
|
||||
std::vector<MbCurveEdge*> * edges,
|
||||
c3d::IndicesPairsVector * intersectedFaces,
|
||||
c3d::IndicesPairsVector * similarFaces,
|
||||
c3d::IndicesPairsVector * touchedFaces );
|
||||
|
||||
|
||||
#endif // __CDET_BOOL_H
|
||||
|
||||
@@ -0,0 +1,390 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Типы данных утилиты обнаружения столкновений.
|
||||
\en Data types of collision detection. \~
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CDET_DATA_H
|
||||
#define __CDET_DATA_H
|
||||
|
||||
#include <templ_sptr.h>
|
||||
#include <mb_cart_point.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <mb_matrix3d.h>
|
||||
#include <set>
|
||||
|
||||
class MbHRepSolid;
|
||||
|
||||
/**
|
||||
\addtogroup Collision_Detection
|
||||
\{
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Объект набора для контроля столкновений. \en Object of the set for collision detection.
|
||||
//---
|
||||
typedef MbHRepSolid * cdet_item;
|
||||
typedef MbResultType cdet_result; ///< \ru Код результата контроля столкновений. \en Result code of collision queries.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Код результата контроля столкновений. \en Codes of collision detection.
|
||||
//---
|
||||
const cdet_result CDET_RESULT_Intersected = rt_Intersect;
|
||||
const cdet_result CDET_RESULT_NoIntersection = rt_NoIntersect;
|
||||
const cdet_result CDET_RESULT_Ok = rt_Success;
|
||||
const cdet_result CDET_RESULT_None = rt_None;
|
||||
const cdet_result CDET_RESULT_Error = rt_Error;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Геометрический объект пользователя. \en User geometric item.
|
||||
//---
|
||||
typedef const void * cdet_app_item;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Constants
|
||||
//---
|
||||
const cdet_item CDET_NULL = NULL; ///< \ru Пустой объект набора для контроля столкновений. \en Empty object of the collision query set.
|
||||
const cdet_app_item CDET_APP_NULL = NULL; ///< \ru "Нулевой" объект модели приложения. \en "Null object" of the client app.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Base class to implement collision query details
|
||||
//---
|
||||
struct cdet_query
|
||||
{
|
||||
enum cback_res ///< Result code of the callback function
|
||||
{
|
||||
CBACK_VOID
|
||||
, CBACK_SUFFICIENT ///< This code means that an app stops collision query for given pair of lamps
|
||||
, CBACK_SKIP ///< Skip testing a given pair of the lumps
|
||||
, CBACK_BREAK ///< Break search of all collisions of the set
|
||||
, CBACK_SEARCH_MORE = CBACK_VOID ///< This code notifies a collision detector to continue working at cases CDET_INTERSECTED, CDET_TOUCHED.
|
||||
};
|
||||
|
||||
enum message ///< Code of notification
|
||||
{
|
||||
CDET_QUERY_STARTED // The collision query is started for the all solids
|
||||
, CDET_STARTED // The collision query is started for the given pair
|
||||
, CDET_FINISHED // Collision detector complete searching a collisions for the given pair of lumps.
|
||||
, CDET_INTERSECTED // The collided pair of objects founded.
|
||||
, CDET_TOUCHED // Touched faces has been founded with no penetration of the solids.
|
||||
};
|
||||
|
||||
struct geom_element ///< Structure representing a collision detection geometry.
|
||||
{
|
||||
cdet_app_item appItem;
|
||||
const MbRefItem * refItem;
|
||||
const MbMatrix3D * wMatrix;
|
||||
geom_element()
|
||||
: appItem( NULL )
|
||||
, refItem( NULL )
|
||||
, wMatrix( &MbMatrix3D::identity ) {}
|
||||
};
|
||||
|
||||
struct cback_data ///< Data structure that notifies an app about collision detection event.
|
||||
{
|
||||
geom_element first, second; ///< Pair of geometric objects
|
||||
cback_data(): first(), second() {}
|
||||
};
|
||||
|
||||
cback_res operator() ( message code, cback_data & cData ) { return func( this, code, cData ); }
|
||||
|
||||
protected:
|
||||
typedef cback_res (*cback_func)( cdet_query *, message, cback_data & );
|
||||
|
||||
cdet_query( cback_func _func ) : func(_func) {}
|
||||
~cdet_query() {}
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( cdet_query );
|
||||
|
||||
private:
|
||||
cback_func func;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
//---
|
||||
struct cdet_query_result: public cdet_query
|
||||
{
|
||||
cdet_result result;
|
||||
|
||||
cdet_query_result()
|
||||
: cdet_query( QueryFunc )
|
||||
, result( CDET_RESULT_NoIntersection )
|
||||
{}
|
||||
|
||||
private:
|
||||
static cback_res QueryFunc( cdet_query * query, message code, cback_data & )
|
||||
{
|
||||
C3D_ASSERT( NULL != query );
|
||||
cdet_query_result * q = static_cast<cdet_query_result*>( query );
|
||||
switch( code )
|
||||
{
|
||||
case CDET_QUERY_STARTED: // The collision query is started for all solids of the set
|
||||
{
|
||||
q->result = CDET_RESULT_NoIntersection;
|
||||
return CBACK_VOID;
|
||||
}
|
||||
case CDET_INTERSECTED: // First intersection is founded.
|
||||
{
|
||||
q->result = CDET_RESULT_Intersected;
|
||||
return CBACK_SUFFICIENT;
|
||||
}
|
||||
case CDET_FINISHED: // A pair of solids is finished.
|
||||
return (q->result == CDET_RESULT_Intersected) ? CBACK_BREAK : CBACK_VOID;
|
||||
|
||||
default:
|
||||
return CBACK_VOID;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// The structure queries first founded collision faces
|
||||
//---
|
||||
struct cdet_first_collided: public cdet_query
|
||||
{
|
||||
SPtr<const MbRefItem> first, second; // collided faces
|
||||
|
||||
cdet_first_collided()
|
||||
: cdet_query( QueryFunc )
|
||||
, first()
|
||||
, second()
|
||||
{}
|
||||
|
||||
private:
|
||||
static cback_res QueryFunc( cdet_query * query, message code, cback_data & cData )
|
||||
{
|
||||
if ( cdet_first_collided * q = static_cast<cdet_first_collided*>(query) )
|
||||
{
|
||||
switch( code )
|
||||
{
|
||||
case CDET_QUERY_STARTED: // The collision query is started for all solids of the set
|
||||
{
|
||||
q->first = q->second = NULL;
|
||||
return CBACK_VOID;
|
||||
}
|
||||
case CDET_FINISHED: // A pair of solids is finished.
|
||||
return (q->first && q->second) ? CBACK_BREAK : CBACK_SEARCH_MORE;
|
||||
|
||||
case CDET_INTERSECTED: // First intersection is founded.
|
||||
{
|
||||
q->first = cData.first.refItem;
|
||||
q->second = cData.second.refItem;
|
||||
return (q->first && q->second) ? CBACK_SUFFICIENT : CBACK_SEARCH_MORE;
|
||||
}
|
||||
default:
|
||||
return CBACK_VOID;
|
||||
}
|
||||
}
|
||||
return CBACK_VOID;
|
||||
}
|
||||
OBVIOUS_PRIVATE_COPY( cdet_first_collided );
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Структура запроса для поиска граней столкновения.
|
||||
\en The structure of the query to find collision faces.
|
||||
*/
|
||||
//---
|
||||
struct cdet_collided_faces: public cdet_query
|
||||
{
|
||||
typedef std::pair<cdet_app_item,const MbRefItem*> item_face; // represents a face of app item
|
||||
typedef std::set<item_face> collided_faces;
|
||||
collided_faces faces;
|
||||
std::map<cdet_app_item,cdet_app_item> groups;
|
||||
cdet_app_item excluded; // a member of excluded group
|
||||
|
||||
public:
|
||||
cdet_collided_faces()
|
||||
: cdet_query( _QueryFunc )
|
||||
, faces()
|
||||
, groups()
|
||||
, excluded( CDET_APP_NULL )
|
||||
{}
|
||||
|
||||
/** \brief \ru Объединить пару геометрических объектов в группу.
|
||||
\en Unite a pair of geometric items to the group.
|
||||
\details \ru Функция объединяет в группу два отдельных объекта или присоединяет
|
||||
первый объект к группе, которой принадлежит второй. Если оба объекта уже
|
||||
принадлежат каждый своей группе, то обе группы сливаются в одну общую.
|
||||
\en The function unites to group two separate objects or the first object
|
||||
attaches to the group, which owns the second. If both objects already
|
||||
belong to each of their group, the two groups merged into a single.
|
||||
*/
|
||||
void Group( cdet_app_item fst, cdet_app_item snd )
|
||||
{
|
||||
fst = _Parent( fst );
|
||||
snd = _Parent( snd );
|
||||
if ( fst < snd )
|
||||
{
|
||||
std::swap( fst, snd );
|
||||
}
|
||||
groups[fst] = snd;
|
||||
}
|
||||
|
||||
/** \brief \ru Исключить из контроля на столкновения тела группы.
|
||||
\en Exclude from the collision control solids of the group.
|
||||
\param[in] member - \ru Любой участник группы, элементы которой исключаются.
|
||||
\en Any member of the group whose elements are excluded. \~
|
||||
*/
|
||||
void ExludeGroup( cdet_app_item member )
|
||||
{
|
||||
if ( excluded == CDET_APP_NULL )
|
||||
excluded = _Parent( member );
|
||||
else
|
||||
Group( excluded, member );
|
||||
}
|
||||
/** \brief \ru Отменить результаты работы функций Group() и ExludeGroup().
|
||||
\en Cancel the results of the functions Group() and ExludeGroup().
|
||||
*/
|
||||
void Reset()
|
||||
{
|
||||
faces.clear();
|
||||
groups.clear();
|
||||
excluded = CDET_APP_NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
static cback_res _QueryFunc( cdet_query * query, message code, cback_data & cData )
|
||||
{
|
||||
if ( cdet_collided_faces * q = static_cast<cdet_collided_faces*>(query) )
|
||||
{
|
||||
switch( code )
|
||||
{
|
||||
case CDET_QUERY_STARTED:
|
||||
{
|
||||
q->faces.clear();
|
||||
return CBACK_VOID;
|
||||
}
|
||||
case CDET_STARTED:
|
||||
{
|
||||
if ( q->_SameGroups(cData.first.appItem,cData.second.appItem) )
|
||||
{
|
||||
return CBACK_SKIP;
|
||||
}
|
||||
return CBACK_VOID;
|
||||
}
|
||||
|
||||
case CDET_FINISHED: // a pair of solids was finished.
|
||||
return CBACK_SEARCH_MORE;
|
||||
|
||||
case CDET_INTERSECTED:
|
||||
{
|
||||
if ( cData.first.refItem )
|
||||
{
|
||||
q->faces.insert( item_face(cData.first.appItem,cData.first.refItem) );
|
||||
}
|
||||
if ( cData.second.refItem )
|
||||
{
|
||||
q->faces.insert( item_face(cData.second.appItem,cData.second.refItem) );
|
||||
}
|
||||
return CBACK_SEARCH_MORE;
|
||||
}
|
||||
default:
|
||||
return CBACK_VOID;
|
||||
}
|
||||
}
|
||||
return CBACK_VOID;
|
||||
}
|
||||
|
||||
cdet_app_item _Parent( cdet_app_item appItem ) const
|
||||
{
|
||||
std::map<cdet_app_item,cdet_app_item>::const_iterator iter = groups.find( appItem );
|
||||
if ( iter == groups.end() || (iter->second == iter->first) )
|
||||
{
|
||||
return appItem;
|
||||
}
|
||||
C3D_ASSERT( iter->second < iter->first );
|
||||
|
||||
return _Parent( iter->second );
|
||||
}
|
||||
|
||||
bool _SameGroups( cdet_app_item fst, cdet_app_item snd ) const
|
||||
{
|
||||
return _Parent( fst ) == _Parent( snd );
|
||||
}
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( cdet_collided_faces );
|
||||
};
|
||||
|
||||
/** \} */ // Collision_Detection
|
||||
|
||||
class TapeBase;
|
||||
class MbFace;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/* \brief \ru Грань столкновения. \en A face of collision. \~
|
||||
*/
|
||||
// ---
|
||||
class MbCollisionFace
|
||||
{
|
||||
const MbFace * mathFace;
|
||||
TapeBase * partFace;
|
||||
|
||||
public:
|
||||
MbCollisionFace( const MbFace &_mathFace ) : mathFace( &_mathFace ), partFace( NULL ) {}
|
||||
|
||||
const MbFace & GetMathFace() const { return *mathFace; }
|
||||
|
||||
// \ru Установка объекта модели. \en Setting an object of model.
|
||||
void SetCollisionFaceObject( TapeBase * _partFace ) { partFace = _partFace; }
|
||||
// \ru Выдача объекта модели. \en Getting an object of model.
|
||||
TapeBase * GetCollisionFaceObject() const { return partFace; }
|
||||
|
||||
MbCollisionFace & operator = ( const MbCollisionFace & other )
|
||||
{
|
||||
mathFace = other.mathFace;
|
||||
partFace = other.partFace; //CppCheck
|
||||
return *this;
|
||||
}
|
||||
bool operator > ( const MbCollisionFace & other ) const { return mathFace > other.mathFace; }
|
||||
bool operator < ( const MbCollisionFace & other ) const { return mathFace < other.mathFace; }
|
||||
bool operator == ( const MbCollisionFace & other ) const { return mathFace == other.mathFace; }
|
||||
bool operator != ( const MbCollisionFace & other ) const { return !(*this == other); }
|
||||
|
||||
private:
|
||||
MbCollisionFace( const MbCollisionFace & ); // not implemented
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Параметры (характеристика) близости двух объектов. \en Parameters (characteristic) of proximity of two objects.
|
||||
// ---
|
||||
class MATH_CLASS MbProximityParameters
|
||||
{
|
||||
MbCollisionFace * theFace1;
|
||||
MbCollisionFace * theFace2;
|
||||
SPtr<const MbFace> plane;
|
||||
|
||||
public:
|
||||
MbCartPoint thePar1, thePar2; // \ru Пара точек близости, заданная в поверхностных координатах граненй. \en The points of the proximity specified in the surface coordinates of the faces.
|
||||
double theDistance; // \ru Расстояние. \en Distance.
|
||||
double upperDist; // \ru Верхняя оценка для поиска минимальной дистанции. \en The upper bound of the minimal distance estimation.
|
||||
|
||||
public:
|
||||
MbProximityParameters();
|
||||
~MbProximityParameters();
|
||||
|
||||
protected:
|
||||
MbProximityParameters( const MbFace & topoFace1
|
||||
, const MbFace & topoFace2
|
||||
, MbCartPoint & par1
|
||||
, MbCartPoint & par2
|
||||
, double dist );
|
||||
|
||||
public:
|
||||
const MbCollisionFace & FaceOne() const { return *theFace1; }
|
||||
const MbCollisionFace & FaceTwo() const { return *theFace2; }
|
||||
|
||||
void SetFacePair( const MbFace &, const MbFace & );
|
||||
|
||||
private:
|
||||
MbProximityParameters( const MbProximityParameters & ); // not implemented
|
||||
MbProximityParameters & operator = ( const MbProximityParameters & ); // not implemented
|
||||
};
|
||||
|
||||
#endif // __CDET_DATA_H
|
||||
|
||||
// eof
|
||||
@@ -0,0 +1,167 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Утилита оценки столкновений и параметров близости тел.
|
||||
\en Utility of collision detection and proximity queries.
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CDET_UTILITY_H
|
||||
#define __CDET_UTILITY_H
|
||||
|
||||
#include <cdet_data.h>
|
||||
|
||||
class MbItem;
|
||||
class MbSolid;
|
||||
class MbAssembly;
|
||||
struct MbLumpAndFaces;
|
||||
class MbCollisionDetector;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Утилита расчета параметров пересечения и близости тел.
|
||||
\en Utility for calculation of intersection and proximity parameters of solids. \~
|
||||
\details \ru Предоставляет функциональность Collision Detection для взаимодействия
|
||||
с приложением САПР.
|
||||
\en Provides facilities of The Collision Detection to interact with the CAD
|
||||
application. \~
|
||||
\attention \ru Для гарантированно правильной работы детектора необходимо, чтобы объект
|
||||
типа MbLumpAndFaces, добавляемый в рассмотрение посредством функции AddSolid, имел
|
||||
правильную матрицу преобразования в мир в настоящем его положении, т.е. с самого начала.
|
||||
\en For the ensure proper functionality of detector it is necessary that
|
||||
an object of type MbLumpAndFaces to be added in consideration by function AddSolid will
|
||||
have a correct matrix of transformation to the world coordinate system in its current
|
||||
state, i.e. from the beginning. \~
|
||||
\ingroup Collision_Detection
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCollisionDetectionUtility
|
||||
{
|
||||
MbCollisionDetector & detector;
|
||||
|
||||
public:
|
||||
MbCollisionDetectionUtility();
|
||||
~MbCollisionDetectionUtility();
|
||||
|
||||
public:
|
||||
/**
|
||||
\brief \ru Добавить твердое тело с заданным положением в набор для контроля столкновений.
|
||||
\en Add a solid with given placement to the collision detection set. \~
|
||||
\return \ru Дескриптор объекта для контроля столкновений. \en Descriptor of object for collision detection. \~
|
||||
*/
|
||||
cdet_item AddItem( const MbSolid & solid, const MbPlacement3D & place, cdet_app_item appItem = CDET_APP_NULL );
|
||||
/**
|
||||
\brief \ru Удалить геометрический объект из набора для контроля столкновений.
|
||||
\en Remove a geometric object from the set of collision detection. \~
|
||||
*/
|
||||
void RemoveItem( cdet_item cdItem );
|
||||
/**
|
||||
\brief \ru Поменять текущее положение геометрического объекта в наборе.
|
||||
\en Change current position of a geometric object. \~
|
||||
*/
|
||||
void Reposition( cdet_item, const MbPlacement3D & );
|
||||
/**
|
||||
\brief \ru Проверить соударения между геометрическими объектами набора.
|
||||
\en Check collisions between geometric objects of the set. \~
|
||||
\return \ru Функция вернет CDET_RESULT_Intersected при обранужении хотя бы одной коллизии.
|
||||
\en The function will return CDET_RESULT_Intersected if it detects at least one collision.
|
||||
|
||||
*/
|
||||
cdet_result CheckCollisions( cdet_query & );
|
||||
|
||||
/**
|
||||
\brief \ru Проверить соударения между геометрическими объектами набора.
|
||||
\en Check collisions between geometric objects of the set. \~
|
||||
\return \ru Функция вернет CDET_RESULT_Intersected при обранужении хотя бы одной коллизии.
|
||||
\en The function will return CDET_RESULT_Intersected if it detects at least one collision.
|
||||
*/
|
||||
cdet_result CheckCollisions();
|
||||
|
||||
/**
|
||||
\brief \ru Выдать дескриптор клиентского приложения по дескриптору контрольного набора столкновений.
|
||||
\en Get an application pointer by descriptor of the collision detection set.
|
||||
*/
|
||||
cdet_app_item AppItem( cdet_item cdItem ) const;
|
||||
|
||||
|
||||
public: // the functions below can be deprecated in future version.
|
||||
/**
|
||||
\brief \ru Добавить модель тела, как набор граней и решеток.
|
||||
\en Add a solid data as a set of faces and the grids. \~
|
||||
\return \ru Индекс добавленной твердотельной модели. \en Index of added solid data. \~
|
||||
*/
|
||||
size_t AddLump( const MbLumpAndFaces & );
|
||||
/**
|
||||
\brief \ru Добавить модель тела, как набор граней и решеток.
|
||||
\en Add a solid data as a set of faces and the grids. \~
|
||||
\return \ru Внутренняя структура данных представляющая добавленную модель. \en Internal data structure representing added solid data. \~
|
||||
*/
|
||||
cdet_item AddSolid( const MbLumpAndFaces & );
|
||||
/// \ru Добавить тело с заданным положением. \en Add a solid with a given placement.
|
||||
cdet_item AddSolid( const MbSolid &, const MbPlacement3D &, cdet_app_item = CDET_APP_NULL );
|
||||
/// \ru Удалить твердотельную модель из детектора столкновений. \en Remove a solid model from a collision detector.
|
||||
void RemoveSolid( cdet_item );
|
||||
/// \ru Выдать количество добавленных твердотельных моделей. \en Get number of added solid models.
|
||||
size_t Count() const;
|
||||
// Use AppItem() insead this
|
||||
cdet_app_item Component( size_t solIdx ) const;
|
||||
/// \ru Номер твердотельной модели, зарегистрированной в детекторе. \en An index of solid model registered in the detector.
|
||||
size_t SolidIndex( cdet_item cItem ) const;
|
||||
/// \ru Вычисление минимального расстояния между объектами (см.функцию SetDistanceComputationObjects(...)) \en Calculation of minimal distance between objects (see the function SetDistanceComputationObjects(...))
|
||||
cdet_result DistanceQuery( MbProximityParameters & minDist ) const;
|
||||
/// \ru Выключить из рассмотрения все модели. \en Exclude all models from consideration.
|
||||
void FlushSolids();
|
||||
/// \ru Выдать иерархическое представление тела (NULL = отсутствие такового в списке). \en Get the hierarchical representation of the solid (NULL means that the solid is not in the list).
|
||||
cdet_item GetHRepSolid ( const MbLumpAndFaces & ) const;
|
||||
/// \ru Задать барьер для отличия касания от пересечения. \en Set the barrier for the difference between the touch and the intersection.
|
||||
void SetTouchTolerance( double lTol );
|
||||
/// \ru Вкл./выкл. приближенного вычисления пересечений тел \en On/off approximated calculation of intersections of solids
|
||||
void SetApproxCollisionQuery( bool ff );
|
||||
/// \ru Вкл./выкл. приближенного вычисления параметров близости - по триангуляции \en On/off approximated calculation of proximity parameters - by triangulation
|
||||
void SetApproxDistanceComputation ( bool ff );
|
||||
/// \ru Назначить объекты для отслеживания между ними расстояния. \en Assign the pair to track the distance between them.
|
||||
void SetDistanceTracking( const MbLumpAndFaces &, const MbLumpAndFaces & );
|
||||
/// \ru Обновить текущее положение тела с индексом solIdx. \en Update current placement of solid with index solIdx.
|
||||
void SetPlacement( size_t solIdx, const MbPlacement3D & );
|
||||
|
||||
// \ru Объявление конструктора копирования и оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration without implementation of the copy-constructor and assignment operator to prevent an assignment by default.
|
||||
OBVIOUS_PRIVATE_COPY( MbCollisionDetectionUtility );
|
||||
|
||||
public:
|
||||
// The func is deprecated. Instead, use CheckCollisions
|
||||
cdet_result InterferenceDetect( void * formalPar = NULL ) const;
|
||||
// The func is deprecated. Use SetDistanceTracking instead.
|
||||
void SetDistanceComputationObjects( const MbLumpAndFaces &, const MbLumpAndFaces & );
|
||||
// For testing purposes
|
||||
bool IsEmpty( cdet_item ) const;
|
||||
// For testing purposes
|
||||
cdet_item NewComponent( cdet_app_item );
|
||||
// For testing purposes
|
||||
//cdet_item Component( cdet_item subItem );
|
||||
// For testing purposes
|
||||
cdet_item AddInstance( cdet_item compItem, cdet_item subItem, const MbPlacement3D & );
|
||||
|
||||
|
||||
private:
|
||||
/*
|
||||
\brief \ru Добавить объект геометрической модели в набор для контроля столкновений.
|
||||
\en Add an object of geometric model to the set of collision detection control. \~
|
||||
\return \ru Объект в наборе для контроля столкновений. \en Object of the set of collision detection. \~
|
||||
*/
|
||||
cdet_item AddItem( const MbItem & );
|
||||
// Set an assembly to detect collisions between its elements
|
||||
void SetAssembly( const MbAssembly & );
|
||||
void UpdateGeometry();
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Default implemention of the call CheckCollisions.
|
||||
//---
|
||||
inline cdet_result MbCollisionDetectionUtility::CheckCollisions()
|
||||
{
|
||||
cdet_query_result defaultQuery;
|
||||
return CheckCollisions( defaultQuery );
|
||||
}
|
||||
|
||||
#endif // __CDET_UTILITY_H
|
||||
|
||||
// eof
|
||||
@@ -0,0 +1,805 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Диагностика оболочек и их составляющих.
|
||||
\en Diagnostics of shells and their components. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CHECK_GEOMETRY_H
|
||||
#define __CHECK_GEOMETRY_H
|
||||
|
||||
#include <templ_rp_array.h>
|
||||
#include <templ_sptr.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <mb_variables.h>
|
||||
#include <topology.h>
|
||||
#include <solid.h>
|
||||
#include <point_frame.h>
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
#include <utility>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Информация о пересечении двух тел.
|
||||
\en Information about two solids intersection. \~
|
||||
\details \ru Информация о пересечении двух тел при диагностике их оболочек. \n
|
||||
\en Information about intersection of two solids during diagnostics of their shells. \n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
struct MATH_CLASS MbIntersectionData {
|
||||
protected:
|
||||
c3d::EdgesSPtrVector edges; ///< \ru Ребра пересечения (владеет по счетчику ссылок). \en Intersection edges (owns by reference counter).
|
||||
c3d::IndicesVector faceIndices1; ///< \ru Номера касающихся граней первого тела. \en The numbers concerning faces of the first solid.
|
||||
c3d::IndicesVector faceIndices2; ///< \ru Номера касающихся граней второго тела. \en The numbers concerning faces of the second solid.
|
||||
|
||||
c3d::SolidSPtr solid; ///< \ru Тело пересечения (владеет по счетчику ссылок). \en Intersection solid (owns by reference counter).
|
||||
|
||||
c3d::PointFrameSPtr pointFrame; ///< \ru Группа точек касания. \en Group of touch points.
|
||||
|
||||
bool isTangentCurve; ///< \ru Пересечения - это линии касания. \en Intersections are tangency lines.
|
||||
bool isSolid; ///< \ru Пересечения образуют тела. \en Intersections form solids.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbIntersectionData();
|
||||
/// \ru Конструктор по ребру. \en Constructor by an edge.
|
||||
MbIntersectionData( const MbCurveEdge & );
|
||||
/// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData( const EdgesVector &, bool isSolidEdges );
|
||||
/// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
template <class EdgesVector, class FaceIndicesVector>
|
||||
MbIntersectionData( const EdgesVector &, const FaceIndicesVector & faceNumbers1, const FaceIndicesVector & faceNumbers2 );
|
||||
/// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData( const EdgesVector &, const c3d::IndicesPairsVector & faceNumbersPairs );
|
||||
/// \ru Конструктор по телу. \en Constructor by a solid.
|
||||
explicit MbIntersectionData( const MbSolid & );
|
||||
/// \ru Конструктор по точкам. \en Constructor by points.
|
||||
explicit MbIntersectionData( const std::vector<MbCartPoint3D> & );
|
||||
/// \ru Конструктор по вершинам и флагу использования этих объектов, а не их копий. \en Constructor by vertices and by flag of use of these objects instead of their copies.
|
||||
explicit MbIntersectionData( const c3d::ConstVerticesVector &, bool same );
|
||||
/// \ru Конструктор по вершинам и флагу использования этих объектов, а не их копий. \en Constructor by vertices and by flag of use of these objects instead of their copies.
|
||||
explicit MbIntersectionData( const c3d::ConstVerticesSPtrVector &, bool same );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~MbIntersectionData();
|
||||
|
||||
public:
|
||||
/// \ru Пересечение - есть тело. \en Intersection is a solid.
|
||||
bool IsSolid() const { return ((solid != NULL) || (isSolid && !edges.empty())); }
|
||||
/// \ru Пересечение касательной областью поверхности. \en Intersection by a tangent region of a surface.
|
||||
bool IsSurface() const { return !isTangentCurve && !edges.empty(); }
|
||||
/// \ru Пересечение вдоль касательной линии. \en Intersection along a tangent line.
|
||||
bool IsCurve() const { return isTangentCurve && !edges.empty(); }
|
||||
/// \ru Пересечение точкой (еще не реализовано). \en Intersection is a point (not implemented yet).
|
||||
bool IsPoint() const { return ((pointFrame != NULL) && (pointFrame->GetVerticesCount() > 0)); }
|
||||
|
||||
/// \ru Установить флаг пересечения вдоль касательной линии. \en Set the flag of intersection along a tangent line.
|
||||
//void SetTangent( bool b ) { isTangentCurve = b; }
|
||||
|
||||
/// \ru Отдать указатель для просмотра тела. \en Get a pointer for viewing the solid.
|
||||
const MbSolid * GetSolid() const { return solid; }
|
||||
/// \ru Отдать указатель для просмотра/модификации тела. \en Get a pointer for viewing/modification of the solid.
|
||||
MbSolid * SetSolid() { return solid; }
|
||||
|
||||
/// \ru Количество кривых пересечения. \en The number of intersection curves.
|
||||
size_t GetCurvesCount() const { return edges.size(); }
|
||||
/// \ru Получить массив кривых пересечения. \en Get the intersection curve array.
|
||||
template <class EdgesVector>
|
||||
void GetCurves( EdgesVector & curves ) const;
|
||||
/// \ru Получить указатель на кривую пересечения по индексу. \en Get a pointer to an intersection curve by the index.
|
||||
const MbCurveEdge * GetCurve( size_t k ) const { return ((k < edges.size()) ? edges[k].get() : NULL); }
|
||||
/// \ru Получить номера касающихся граней первого/второго тела. \en Get numbers concerning faces of the first/second solid.
|
||||
template <class OutputIndicesVector>
|
||||
void GetFaceNumbers( bool first, OutputIndicesVector & ) const;
|
||||
/// \ru Получить номера касающихся граней первого и второго тел. \en Get numbers concerning faces of the first and second solids.
|
||||
template <class OutputIndicesPairsVector>
|
||||
void GetFaceNumbersPairs( OutputIndicesPairsVector & ) const;
|
||||
|
||||
/// \ru Количество точек касания. \en The number of touch points.
|
||||
size_t GetPointsCount() const { return ((pointFrame != NULL) ? pointFrame->GetVerticesCount() : 0); }
|
||||
/// \ru Получить набор точек касания. \en Get a set of touch points.
|
||||
const MbPointFrame * GetPointFrame() const { return pointFrame; }
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbIntersectionData ) // \ru Не реализовано \en Not implemented
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
//---
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges, bool isSolidEgdes )
|
||||
: edges ( )
|
||||
, faceIndices1 ( )
|
||||
, faceIndices2 ( )
|
||||
, solid ( NULL )
|
||||
, pointFrame ( NULL )
|
||||
, isTangentCurve( false )
|
||||
, isSolid ( isSolidEgdes )
|
||||
{
|
||||
size_t addCnt = initEdges.size();
|
||||
if ( addCnt > 0 ) {
|
||||
c3d::EdgeSPtr edge;
|
||||
edges.reserve( addCnt );
|
||||
for ( size_t k = 0; k < addCnt; ++k ) {
|
||||
if ( initEdges[k] != NULL ) {
|
||||
edge = const_cast<MbCurveEdge *>( &(*initEdges[k]) );
|
||||
edges.push_back( edge );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
//---
|
||||
template <class EdgesVector, class FaceIndicesVector>
|
||||
MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges,
|
||||
const FaceIndicesVector & faceInds1,
|
||||
const FaceIndicesVector & faceInds2 )
|
||||
: edges ( )
|
||||
, faceIndices1 ( )
|
||||
, faceIndices2 ( )
|
||||
, solid ( NULL )
|
||||
, pointFrame ( NULL )
|
||||
, isTangentCurve( false )
|
||||
, isSolid ( false )
|
||||
{
|
||||
size_t edgesCnt = initEdges.size();
|
||||
|
||||
if ( edgesCnt > 0 ) {
|
||||
c3d::EdgeSPtr edge;
|
||||
edges.reserve( edgesCnt );
|
||||
for ( size_t k = 0; k < edgesCnt; ++k ) {
|
||||
if ( initEdges[k] != NULL ) {
|
||||
edge = const_cast<MbCurveEdge *>(&(*initEdges[k]));
|
||||
edges.push_back( edge );
|
||||
}
|
||||
}
|
||||
std::copy( faceInds1.begin(), faceInds1.end(), std::back_inserter( faceIndices1 ) );
|
||||
std::copy( faceInds2.begin(), faceInds2.end(), std::back_inserter( faceIndices2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
//---
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges,
|
||||
const c3d::IndicesPairsVector & faceIndicesPairs )
|
||||
: edges ( )
|
||||
, faceIndices1 ( )
|
||||
, faceIndices2 ( )
|
||||
, solid ( NULL )
|
||||
, pointFrame ( NULL )
|
||||
, isTangentCurve( false )
|
||||
, isSolid ( false )
|
||||
{
|
||||
size_t edgesCnt = initEdges.size();
|
||||
|
||||
if ( edgesCnt > 0 ) {
|
||||
c3d::EdgeSPtr edge;
|
||||
edges.reserve( edgesCnt );
|
||||
size_t k;
|
||||
for ( k = 0; k < edgesCnt; ++k ) {
|
||||
if ( initEdges[k] != NULL ) {
|
||||
edge = const_cast<MbCurveEdge *>(&(*initEdges[k]));
|
||||
edges.push_back( edge );
|
||||
}
|
||||
}
|
||||
size_t facePairsCnt = faceIndicesPairs.size();
|
||||
faceIndices1.reserve( facePairsCnt );
|
||||
faceIndices2.reserve( facePairsCnt );
|
||||
for ( k = 0; k < facePairsCnt; ++k ) {
|
||||
faceIndices1.push_back( faceIndicesPairs[k].first );
|
||||
faceIndices2.push_back( faceIndicesPairs[k].second );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Получить массив кривых пересечения. \en Get the intersection curve array.
|
||||
//---
|
||||
template <class EdgesVector>
|
||||
void MbIntersectionData::GetCurves( EdgesVector & dstEdges ) const
|
||||
{
|
||||
size_t addCnt = edges.size();
|
||||
c3d::EdgeSPtr edge;
|
||||
dstEdges.reserve( dstEdges.size() + addCnt );
|
||||
for ( size_t k = 0; k < addCnt; ++k ) {
|
||||
edge = const_cast<MbCurveEdge *>( &(*edges[k]) );
|
||||
dstEdges.push_back( edge );
|
||||
::DetachItem( edge );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Получить номера касающихся граней первого/второго тела. \en Get numbers concerning faces of the first/second solid.
|
||||
//---
|
||||
template <class OutputIndicesVector>
|
||||
void MbIntersectionData::GetFaceNumbers( bool first, OutputIndicesVector & outputIndices ) const
|
||||
{
|
||||
const c3d::IndicesVector & faceIndices = first ? faceIndices1 : faceIndices2;
|
||||
size_t addCnt = faceIndices.size();
|
||||
if ( addCnt > 0 ) {
|
||||
outputIndices.reserve( outputIndices.size() + addCnt );
|
||||
for ( size_t k = 0; k < addCnt; ++k ) {
|
||||
outputIndices.push_back( faceIndices[k] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Получить номера касающихся граней первого и второго тел. \en Get numbers concerning faces of the first and second solids.
|
||||
//---
|
||||
template <class OutputIndicesPairsVector>
|
||||
void MbIntersectionData::GetFaceNumbersPairs( OutputIndicesPairsVector & outputIndicesPairs ) const
|
||||
{
|
||||
size_t addCnt = std_min( faceIndices1.size(), faceIndices2.size() );
|
||||
if ( addCnt > 0 ) {
|
||||
outputIndicesPairs.reserve( outputIndicesPairs.size() + addCnt );
|
||||
for ( size_t k = 0; k < addCnt; ++k ) {
|
||||
outputIndicesPairs.push_back( std::make_pair( faceIndices1[k], faceIndices2[k] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка вырожденности кривой в трехмерном пространстве.
|
||||
\en Check for the curve degeneration in three-dimensional space. \~
|
||||
\details \ru Проверка вырожденности кривой в трехмерном пространстве. \n
|
||||
\en Check for the curve degeneration in three-dimensional space. \n \~
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en Curve. \~
|
||||
\param[in] eps - \ru Неразличимая метрическая область, критерий вырождения кривой.
|
||||
\en Indistinguishable metric domain, curve degeneration criterion. \~
|
||||
\return \ru Возвращает состояние вырожденности кривой.
|
||||
\en Returns the state of the curve degeneration. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) IsDegeneratedCurve( const MbCurve3D & curve, double eps );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru Проверка на полное совпадение двух кривых пересечения поверхностей c метрической точностью lenEps \en Check for complete coincidence of two intersection curves of surfaces with metric tolerance lenEps
|
||||
//---
|
||||
bool IsCoincidentCurves( const MbSurfaceIntersectionCurve & intCurve1,
|
||||
const MbSurfaceIntersectionCurve & intCurve2,
|
||||
double lenEps );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка оболочки тела на замкнутость.
|
||||
\en Check of solid's shell for closedness. \~
|
||||
\details \ru Проверка оболочки тела на замкнутость. \n
|
||||
\en Check of solid's shell for closedness. \n \~
|
||||
\param[in] shell - \ru Оболочка.
|
||||
\en A shell. \~
|
||||
\param[in] checkChangedOnly - \ru Проверять только измененные грани оболочки.
|
||||
\en Only modified faces of a shell are to be checked. \~
|
||||
\return \ru Возвращает состояние замкнутости оболочки.
|
||||
\en Returns the state of shell closedness. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckShellClosure( const MbFaceShell & shell, bool checkChangedOnly = false );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка оболочки тела на замкнутость.
|
||||
\en Check of solid's shell for closedness. \~
|
||||
\details \ru Проверка оболочки тела на замкнутость. \n
|
||||
\en Check of solid's shell for closedness. \n \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckSolidClosure( const MbSolid & solid );
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// \ru Функции для проверки элементов оболочки \en Functions for checking shell's elements
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Поиск краевых ребер замкнутой оболочки.
|
||||
\en Search for the boundary edges of a closed shell. \~
|
||||
\details \ru Поиск краевых ребер замкнутой оболочки. \n
|
||||
Краевое ребер - это ребро у которого нет ссылки на одну из смежных граней. \n
|
||||
Наличие краевых ребер замкнутой оболочки может приводит к отказу операций над оболочкой,
|
||||
если операцией будет затронута часть оболочки с краевыми ребрами. \n
|
||||
Наличие одиночных краевых ребер практически никак не влияет на правильность расчета МЦХ.
|
||||
Множественные краевые ребра, особенно в виде связных цепочек, являются серьезным дефектом замкнутой оболочки. \n
|
||||
\en Search for the boundary edges of a closed shell. \n
|
||||
Boundary edge is an edge that has no reference to one of the adjacent faces. \n
|
||||
The presence of boundary edges of a closed shell may lead to failure of operations on the shell,
|
||||
if the operation affects a part of the shell with such edges. \n
|
||||
The presence of single boundary edges has practically no effect on the correctness of the MIP calculation. \n
|
||||
Multiple boundary edges, especially in the form of related chains, is a serious defect of the closed shell. \n \~
|
||||
\param[in] allEdges - \ru Множество ребер оболочки.
|
||||
\en Set of edges of a shell. \~
|
||||
\param[in] boundaryEdges - \ru Множество найденных краевых ребер.
|
||||
\en Set of found boundary edges. \~
|
||||
\return \ru Возвращает true, если найдено хотя бы одно краевое ребро.
|
||||
\en Returns true if at least one boundary edges is found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
template <class Edges>
|
||||
bool CheckBoundaryEdges( const Edges & allEdges, Edges * boundaryEdges )
|
||||
{
|
||||
bool isBoundary = false;
|
||||
C3D_ASSERT( boundaryEdges != &allEdges );
|
||||
|
||||
if ( boundaryEdges != &allEdges ) {
|
||||
for ( size_t i = 0, cnt = allEdges.size(); i < cnt; ++i ) {
|
||||
if ( allEdges[i] != NULL && allEdges[i]->IsBoundaryFace( METRIC_PRECISION ) ) {
|
||||
isBoundary = true;
|
||||
if ( boundaryEdges != NULL )
|
||||
boundaryEdges->push_back( allEdges[i] );
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isBoundary;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Поиск некорректных ребер.
|
||||
\en Search of incorrect edges. \~
|
||||
\details \ru Поиск некорректных ребер. Не ищет краевые ребра замкнутой оболочки. \n
|
||||
Для поиска краевых ребер используйте функцию CheckBoundaryEdges. \n
|
||||
Функция проверяет следующие варианты некорректности ребер :
|
||||
1. Ребро с типом граница (cbt_Boundary) должно указывать только на одну грань \n
|
||||
2. Поверхности в кривой пересечения ребра должны быть такие же как и поверхности в смежных гранях ребра \n
|
||||
3. Граничные точки поверхностных кривых в кривой пересечения ребра должны совпадать с точностью не хуже 1e-6 или толерантности в вершинах ребра \n
|
||||
4. Опорные точки сплайнов поверхностных кривых в уточняемой кривой пересечения (cbt_Specific) должны совпадать в пространстве c точностью не хуже 1e-6 \n
|
||||
Наличие некорректных ребер является серьезным дефектом оболочки. \n
|
||||
\en Search of incorrect edges. Does not look for the boundary edges of a closed shell. \n
|
||||
Use function CheckBoundaryEdges for searching for boundary edges. \n
|
||||
The function checks the next parameters of an edge as signs of its incorrectness :
|
||||
1. An edge with the border type cbt_Boundary must point to only one face. \n
|
||||
2. The surfaces of the intersection curve of the edge have to be the same as the surfaces in the adjacent faces of the edge. \n
|
||||
3. The boundary points of the surface curves in the curve of intersection of the edge must coincide with an accuracy not worse than 1e-6 or tolerance at the vertices of the edge. \n
|
||||
4. The reference points of the splines of the surface curves in the intersection curve with the border type cbt_Specific must coincide in space with an accuracy not worse than 1e-6. \n
|
||||
The presence of incorrect edges is a serious defect of the shell. \n \~
|
||||
\param[in] allEdges - \ru Множество ребер оболочки.
|
||||
\en Set of edges of a shell. \~
|
||||
\param[in] badEdges - \ru Множество найденных некорректных ребер.
|
||||
\en Set of found incorrect edges. \~
|
||||
\return \ru Возвращает true, если найдено хотя бы одно некорректное ребро.
|
||||
\en Returns true if at least one incorrect edge is found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) CheckBadEdges( const RPArray<MbCurveEdge> & allEdges,
|
||||
RPArray<MbCurveEdge> * badEdges );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Поиск неточных вершин.
|
||||
\en Search for inexact vertices. \~
|
||||
\details \ru Поиск неточных вершин оболочки. \n
|
||||
Наличие неточных вершин не является серьезным дефектом оболочки.
|
||||
В большинстве случаев никак не влияет на работу операций с оболочкой.
|
||||
Не влияет на расчет МЦХ. \n
|
||||
\en Search for inexact vertices of a shell. \n
|
||||
The presence of inaccurate vertices is not a serious shell defect.
|
||||
In most cases, does not affect on the result of operations with this shell.
|
||||
Does not affect the calculation of the MIP. \n \~
|
||||
\param[in] vertArr - \ru Множество вершин оболочки.
|
||||
\en Set of shell's vertices. \~
|
||||
\param[in] mAcc - \ru Порог отбора неточных вершин.
|
||||
\en Accuracy of inexact vertices filtration. \~
|
||||
\param[in] inexactVerts - \ru Множество для неточных вершин.
|
||||
\en Set of inexact vertices. \~
|
||||
\return \ru Возвращает true, если найдена хотя бы одна неточная вершина.
|
||||
\en Returns true if at least one inexact vertex is found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
template <class Vertices>
|
||||
bool CheckInexactVertices( const Vertices & vertArr, double mAcc, Vertices * inexactVerts )
|
||||
{
|
||||
bool isInexactVertex = false;
|
||||
C3D_ASSERT( inexactVerts != &vertArr );
|
||||
|
||||
if ( inexactVerts != &vertArr ) {
|
||||
for ( size_t i = 0, icnt = vertArr.size(); i < icnt; ++i ) {
|
||||
MbVertex * v = vertArr[i];
|
||||
if ( v != NULL && v->GetTolerance() > mAcc ) {
|
||||
isInexactVertex = true;
|
||||
if ( inexactVerts != NULL )
|
||||
inexactVerts->push_back( v );
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isInexactVertex;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Является ли кривая пересечения ребра неточной.
|
||||
\en Is the curve of intersection edges inaccurate. \~
|
||||
\details \ru Является ли кривая пересечения ребра неточной (оценочно). \n
|
||||
Наличие неточных ребер (кривых пересечения) не является серьезным дефектом оболочки.
|
||||
В большинстве случаев никак не влияет на работу операций с оболочкой.
|
||||
Незначительно влияет на расчет МЦХ. \n
|
||||
\en Is the curve of intersection edges inaccurate (estimated). \n
|
||||
The presence of inaccurate edges is not a serious shell defect.
|
||||
In most cases, does not affect on the result of operations with this shell.
|
||||
Can slightly affect the calculation of the MIP. \n \~
|
||||
\param[in] edge - \ru Ребро оболочки.
|
||||
\en The edge of the shell. \~
|
||||
\param[in] mMaxAcc - \ru Порог отбора неточного ребра.
|
||||
\en Accuracy selection inaccurate ribs. \~
|
||||
\return \ru Возвращает true, если ребро неточное.
|
||||
\en Returns true, if the edge is inaccurate. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) IsInexactEdge( const MbCurveEdge & edge, double mMaxAcc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Поиск неточных ребер оценочно.
|
||||
\en Approximate search of inexact edges. \~
|
||||
\details \ru Поиск неточных ребер оболочки оценочно. \n
|
||||
Наличие неточных ребер (кривых пересечения) не является серьезным дефектом оболочки.
|
||||
В большинстве случаев никак не влияет на работу операций с оболочкой.
|
||||
Незначительно влияет на расчет МЦХ. \n
|
||||
\en Approximate search of inexact edges of a shell. \n
|
||||
The presence of inaccurate edges is not a serious shell defect.
|
||||
In most cases, does not affect on the result of operations with this shell.
|
||||
Can slightly affect the calculation of the MIP. \n \~
|
||||
\param[in] allEdges - \ru Множество ребер оболочки.
|
||||
\en Set of edges of a shell. \~
|
||||
\param[in] mAcc - \ru Порог отбора неточных ребер.
|
||||
\en Accuracy of inexact edges filtration. \~
|
||||
\param[in] inexactEdges - \ru Множество найденных неточных ребер.
|
||||
\en Set of found inexact edges. \~
|
||||
\return \ru Возвращает true, если найдено хотя бы одно неточное ребро.
|
||||
\en Returns true if at least one inexact edge is found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
template <class Edges>
|
||||
bool CheckInexactEdges( const Edges & allEdges, double mAcc, Edges * inexactEdges )
|
||||
{
|
||||
bool isInexactEdge = false;
|
||||
|
||||
for ( size_t i = 0, icnt = allEdges.size(); i < icnt; ++i ) {
|
||||
if ( allEdges[i] != NULL) {
|
||||
bool isSpaceNear = !::IsInexactEdge( *allEdges[i], mAcc );
|
||||
|
||||
if ( !isSpaceNear ) {
|
||||
isInexactEdge = true;
|
||||
if ( inexactEdges != NULL )
|
||||
inexactEdges->push_back( allEdges[i] );
|
||||
else
|
||||
break;
|
||||
}
|
||||
else if ( !allEdges[i]->IsClosed() ) {
|
||||
const MbVertex & v1 = allEdges[i]->GetBegVertex();
|
||||
const MbVertex & v2 = allEdges[i]->GetEndVertex();
|
||||
if ( &v1 == &v2 ) {
|
||||
double mTol = v1.GetTolerance();
|
||||
double mLen = allEdges[i]->GetLengthEvaluation();
|
||||
if ( mLen > METRIC_PRECISION && mLen > mTol + METRIC_PRECISION ) {
|
||||
isInexactEdge = true;
|
||||
if ( inexactEdges != NULL )
|
||||
inexactEdges->push_back( allEdges[i] );
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isInexactEdge;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка подложек и указаний на грани.
|
||||
\en Check of substrates and pointers to faces. \~
|
||||
\details \ru Проверка подложек и указаний на грани оболочки. \n
|
||||
Наличие общих подложек (базовые поверхности в ограниченных кривыми поверхностях)
|
||||
и неверных ссылок на грани в ребрах является серьезным дефектом оболочки. \n
|
||||
\en Check of substrates and pointers to faces of a shell. \n
|
||||
The presence of common substrates (base surfaces in bounded curved surfaces)
|
||||
and invalid references to faces in edges is a serious shell defect. \n \~
|
||||
\param[in] shell - \ru Проверяемая оболочка.
|
||||
\en A shell to check. \~
|
||||
\param[out] areIdenticalBaseSurfaces - \ru Наличие общих подложек.
|
||||
\en Whether there are common substrates. \~
|
||||
\param[out] areBadFacePointers - \ru Наличие неверных указателей на соседние грани.
|
||||
\en Whether there are invalid pointers to neighboring faces. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CheckBadFaces( const MbFaceShell & shell,
|
||||
bool & areIdenticalBaseSurfaces,
|
||||
bool & areBadFacePointers );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка взаимного расположения циклов грани.
|
||||
\en Check interposition of face loops. \~
|
||||
\details \ru Проверка взаимного расположения циклов грани.
|
||||
Функция проверять корректность ориентации циклов грани.
|
||||
Неправильная ориентация циклов граней является серьезным дефектом оболочки.
|
||||
\en Check interposition of face loops. \n
|
||||
The function is to check the correctness of the orientation of the face loops (chains of oriented edges).
|
||||
Incorrect orientation of face's loops is a serious defect in the shell. \n \~
|
||||
\param[in] face - \ru Грань.
|
||||
\en Face. \~
|
||||
\return \ru Возвращает true, если расположение и ориентация циклов корректны.
|
||||
\en Returns true if interposition of loops and their orientations are correct. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckLoopsInterposition( const MbFace & face );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка связности ребер цикла.
|
||||
\en Check for connectivity of loop edges. \~
|
||||
\details \ru Проверка связности ребер цикла грани.
|
||||
Возвращает максимальные метрическую и параметрическую (опционально) погрешности построения цикла. \n
|
||||
Наличие неточных стыковок в циклах грани не обязательно является серьезным дефектом оболочки. \n
|
||||
\en Check for connectivity of loop edges.
|
||||
Returns the maximal metric and parametric (optionally) tolerances of the loop construction. \n
|
||||
The presence of inaccurate connection in face loops (chains of oriented edges) is not necessarily a serious shell defect. \n \~
|
||||
\param[in] face - \ru Грань, содержащая проверяемый цикл.
|
||||
\en Face containing the loop under test. \~
|
||||
\param[in] loop - \ru Цикл грани.
|
||||
\en Face loop. \~
|
||||
\param[out] lengthTolerance - \ru Максимальное метрическое значение разрыва между ребрами.
|
||||
\en The maximal metric value of a gap between edges. \~
|
||||
\param[out] paramTolerance - \ru Максимальное параметрическое значение разрыва между ребрами.
|
||||
\en The maximal parametric value of a gap between edges. \~
|
||||
\param[out] badLocs - \ru Пары номеров ориентированных ребер с плохой связностью.
|
||||
\en Edges pairs with bad connectivity. \~
|
||||
\return \ru Возвращает true, если связность ребер не нарушена.
|
||||
\en Returns true if the connectivity is good. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckLoopConnection( const MbFace & face, const MbLoop & loop,
|
||||
double & lengthTolerance, double & paramTolerance,
|
||||
c3d::IndicesPairsVector & badLocs );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка связности ребер цикла.
|
||||
\en Check for connectivity of a loop edges. \~
|
||||
\details \ru Проверка связности ребер цикла грани.
|
||||
Возвращает максимальные метрическую и параметрическую (опционально) погрешности построения цикла. \n
|
||||
Наличие неточных стыковок в циклах грани не обязательно является серьезным дефектом оболочки. \n
|
||||
\en Check for connectivity of a loop edges.
|
||||
Returns the maximal metric and parametric (optionally) tolerances of the loop construction. \n
|
||||
The presence of inaccurate connection in face loops (chains of oriented edges) is not necessarily a serious shell defect. \n \~
|
||||
\param[in] face - \ru Грань, содержащая проверяемый цикл.
|
||||
\en Face containing the loop under test. \~
|
||||
\param[in] loop - \ru Цикл грани.
|
||||
\en Face loop. \~
|
||||
\param[out] lengthTolerance - \ru Максимальное метрическое значение разрыва между ребрами.
|
||||
\en The maximal metric value of a gap between edges. \~
|
||||
\param[out] paramTolerance - \ru Максимальное параметрическое значение разрыва между ребрами.
|
||||
\en The maximal parametric value of a gap between edges. \~
|
||||
\param[out] badConnectedEdges - \ru Ребра с плохой связностью.
|
||||
\en Edges with bad connectivity. \~
|
||||
\param[out] badVertexEdges - \ru Ребра с неправильными вершинами.
|
||||
\en Edges with incorrect vertices. \~
|
||||
\return \ru Возвращает true, если связность ребер не нарушена.
|
||||
\en Returns true if the connectivity is good. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckLoopConnection( const MbFace & face, const MbLoop & loop,
|
||||
double & lengthTolerance, double * paramTolerance,
|
||||
RPArray<const MbOrientedEdge> & badConnectedEdges,
|
||||
RPArray<const MbCurveEdge> & badVertexEdges );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка связности ребер цикла.
|
||||
\en Check for connectivity of a loop edges. \~
|
||||
\details \ru Проверка связности ребер цикла грани.
|
||||
Возвращает максимальные метрическую и параметрическую (опционально) погрешности построения цикла. \n
|
||||
Наличие неточных стыковок в циклах грани не обязательно является серьезным дефектом оболочки. \n
|
||||
\en Check for connectivity of a loop edges.
|
||||
Returns the maximal metric and parametric (optionally) tolerances of the loop construction. \n
|
||||
The presence of inaccurate connection in face loops (chains of oriented edges) is not necessarily a serious shell defect. \n \~
|
||||
\param[in] face - \ru Грань, содержащая проверяемый цикл.
|
||||
\en Face containing the loop under test. \~
|
||||
\param[in] loop - \ru Цикл грани.
|
||||
\en Face loop. \~
|
||||
\param[out] lengthTolerance - \ru Максимальное метрическое значение разрыва между ребрами.
|
||||
\en The maximal metric value of a gap between edges. \~
|
||||
\param[out] paramTolerance - \ru Максимальное параметрическое значение разрыва между ребрами.
|
||||
\en The maximal parametric value of a gap between edges. \~
|
||||
\param[out] badConnectedEdges - \ru Ребра с плохой связностью.
|
||||
\en Edges with bad connectivity. \~
|
||||
\return \ru Возвращает true, если связность ребер не нарушена.
|
||||
\en Returns true if the connectivity is good. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckLoopConnection( const MbFace & face, const MbLoop & loop,
|
||||
double & lengthTolerance, double * paramTolerance,
|
||||
RPArray<const MbOrientedEdge> & badConnectedEdges );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка связности ребер цикла.
|
||||
\en Check for connectivity of a loop edges. \~
|
||||
\details \ru Проверка связности ребер цикла грани.
|
||||
Возвращает максимальные метрическую и параметрическую (опционально) погрешности построения цикла. \n
|
||||
Наличие неточных стыковок в циклах грани не обязательно является серьезным дефектом оболочки. \n
|
||||
\en Check for connectivity of a loop edges.
|
||||
Returns the maximal metric and parametric (optionally) tolerances of the loop construction. \n
|
||||
The presence of inaccurate connection in face loops (chains of oriented edges) is not necessarily a serious shell defect. \n \~
|
||||
\param[in] face - \ru Грань, содержащая проверяемый цикл.
|
||||
\en Face containing the loop under test. \~
|
||||
\param[in] loop - \ru Цикл грани.
|
||||
\en Face loop. \~
|
||||
\param[out] lengthTolerance - \ru Максимальное метрическое значение разрыва между ребрами.
|
||||
\en The maximal metric value of a gap between edges. \~
|
||||
\param[out] paramTolerance - \ru Максимальное параметрическое значение разрыва между ребрами.
|
||||
\en The maximal parametric value of a gap between edges. \~
|
||||
\return \ru Возвращает true, если связность ребер не нарушена.
|
||||
\en Returns true if the connectivity is good. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckLoopConnection( const MbFace & face, const MbLoop & loop,
|
||||
double & lengthTolerance, double * paramTolerance );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти циклы грани с самопересечениями.
|
||||
\en Find face loops with self-intersections. \~
|
||||
\details \ru Найти циклы грани с самопересечениями.
|
||||
Возвращает найденные циклы с самопересечениям. \n
|
||||
Наличие самопересечений в циклах граней является серьезным дефектом оболочки. \n
|
||||
\en Find face loops with self-intersections.
|
||||
Returns the found loops with self-intersections. \n
|
||||
The presence of self-intersections in face loops is a serious shell defect. \n \~
|
||||
\param[in] face - \ru Грань, содержащая проверяемые циклы.
|
||||
\en Face containing loops under test. \~
|
||||
\param[in] nameMaker - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] checkInsideEdges - \ru Искать самопересечения внутри области определения двумерных кривых ребер.
|
||||
\en Find edges with self-intersections inside. \~
|
||||
\param[out] loopPnts - \ru Точки самопересечения c номерами циклов.
|
||||
\en Points of self-intersecting loops and the numbers of loops. \~
|
||||
\return \ru Возвращает true, если найдены самопересечения циклов.
|
||||
\en Returns true if the self-intersection has been found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) FindLoopsSelfIntersections( const MbFace & face, const MbSNameMaker & nameMaker, bool checkInsideEdges,
|
||||
std::vector< std::pair<c3d::IndicesPair, MbCartPoint3D> > * loopPnts );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Проверка связности граней faces.
|
||||
\en Check for connectivity of faces 'faces'. \~
|
||||
\details \ru Проверка топологической связности граней faces. \n
|
||||
\en Check for topological connectivity of faces 'faces'. \n \~
|
||||
\param[in] faces - \ru Проверяемый набор граней.
|
||||
\en Set of faces under check. \~
|
||||
\return \ru Возвращает true, все грани топологически связаны.
|
||||
\en Returns true if all the faces are topologically connected. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) CheckFacesConnection( const RPArray<MbFace> & faces );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти в исходной оболочке "родительские" грани производной оболочки.
|
||||
\en Find "parent" faces of a derived shell in the initial shell. \~
|
||||
\details \ru Найти в исходной оболочке "родительские" грани производной оболочки геометрическим поиском подобных граней с наложением. \n
|
||||
Флаг sameNormals установить false, если исходная оболочка участвовала в булевом вычитании тел вторым операндом. \n
|
||||
\en Find "parent" faces of a derived shell in the initial shell by geometric search of similar faces with overlapping. \n
|
||||
Flag sameNormals is to be set to false if the initial shell was involved in the boolean subtraction of solids as a second operand. \n \~
|
||||
\param[in] srcShell - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] dstShell - \ru Производная оболочка.
|
||||
\en The derived shell. \~
|
||||
\param[in] sameNormals - \ru Искать с одинаковым (true) или противоположным (false) направлением нормалей.
|
||||
\en Search with the same (true) or the opposite (false) direction of normals. \~
|
||||
\param[out] simPairs - \ru Множество соответствий - номеров граней в исходной и производной оболочках.
|
||||
\en Set of correspondences - indices of faces in the initial and the derived shells. \~
|
||||
\return \ru Возвращает true, все найдено хоть одно соответствие.
|
||||
\en Returns true if at least one correspondence is found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) FindOverlappingSimilarFaces( const MbFaceShell & srcShell,
|
||||
const MbFaceShell & dstShell,
|
||||
bool sameNormals,
|
||||
c3d::IndicesPairsVector & simPairs );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти на каких гранях исходной оболочки базируются ребра производной оболочки.
|
||||
\en Find faces edges of the derived shell are based on. \~
|
||||
\details \ru Найти на каких гранях исходной оболочки базируются ребра производной оболочки геометрическим поиском.
|
||||
Поиск соответствия проводится по поверхностям из граней, на которые ссылается ребро, а не по поверхностям в кривой пересечения ребра.
|
||||
Флаг sameNormals установить false, если исходная оболочка участвовала в булевом вычитании тел вторым операндом. \n
|
||||
\en Determine on which faces of the initial shell edges of the derived shell are based on by the geometric search.
|
||||
Search of the correspondence is performed by surfaces from faces the edge refers to, but not by surfaces from the intersection curve of the edge.
|
||||
Flag sameNormals is to be set to false if the initial shell was involved in the boolean subtraction of solids as a second operand. \n \~
|
||||
\param[in] edges - \ru Ребра производной оболочки.
|
||||
\en Edges of an arbitrary shell. \~
|
||||
\param[in] shell - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameNormals - \ru Искать с одинаковым (true) или противоположным (false) направлением нормалей.
|
||||
\en Search with the same (true) or the opposite (false) direction of normals. \~
|
||||
\param[out] efPairs - \ru Множество соответствий - номеров ребер во входном массиве и номеров граней в исходной оболочке.
|
||||
\en Set of correspondence - indices of edges in the input array and numbers of faces in the input shell. \~
|
||||
\return \ru Возвращает true, все найдено хоть одно соответствие.
|
||||
\en Returns true if at least one correspondence is found. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (bool) FindFacesEdgesCarriers( const c3d::ConstEdgesVector & edges,
|
||||
const MbFaceShell & shell,
|
||||
bool sameNormals,
|
||||
c3d::IndicesPairsVector & efPairs );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Починить некорректное ребро оболочки.
|
||||
\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] updateFacesBounds - \ru Обновить границы поверхностей в гранях ребра.
|
||||
\en Update surface bounds of edge faces. \~
|
||||
\return \ru Возвращает true, если была выполнена модификация ребра.
|
||||
\en Returns true if edge modification was performed. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC( bool ) RepairEdge( MbCurveEdge & edge, bool updateFacesBounds );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Починить некорректные ребра оболочки.
|
||||
\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] updateFacesBounds - \ru Обновить границы поверхностей в гранях ребра.
|
||||
\en Update surface bounds of edge faces. \~
|
||||
\return \ru Возвращает true, если была выполнена модификация ребра.
|
||||
\en Returns true if edge modification was performed. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC( bool ) RepairEdges( MbFaceShell & shell, bool updateFacesBounds = true );
|
||||
|
||||
|
||||
#endif // __CHECK_GEOMETRY_H
|
||||
@@ -0,0 +1,337 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Коллекция элементов.
|
||||
\en Collection of elements . \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COLLECTION_H
|
||||
#define __COLLECTION_H
|
||||
|
||||
|
||||
#include <mb_cart_point3d.h>
|
||||
#include <mb_cube.h>
|
||||
#include <mesh_triangle.h>
|
||||
#include <model_item.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbMesh;
|
||||
class MATH_CLASS MbGrid;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Коллекция элементов.
|
||||
\en Collection of elements. \~
|
||||
\details \ru Коллекция элементов - это объект геометрической модели, наследник MbItem, являющийся
|
||||
множеством элементов в трехмерном пространстве. \n
|
||||
\en The collection of 3D elements is an object of geometric model (subclass MbItem) which is
|
||||
the set of elements in 3D space. \n \~
|
||||
\ingroup Model_Items
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCollection : public MbItem {
|
||||
public:
|
||||
/** \brief \ru Типы коллекций 3D объектов.
|
||||
\en Types of 3D object collection. \~
|
||||
*/
|
||||
enum CollectionType {
|
||||
coll_PointCloud = 0, ///< \ru Облако точек. \en The point cloud.
|
||||
coll_Tessellation = 1, ///< \ru Триангуляция. \en The tessellation.
|
||||
coll_Elements = 2, ///< \ru Набор элементов. \en Set of elements.
|
||||
coll_Segmentation = 3, ///< \ru Сегментированная полигональная сетка. \en Segmented polygonal mesh.
|
||||
};
|
||||
|
||||
private:
|
||||
CollectionType type; ///< \ru Тип коллекции 3D объектов. \en Type of 3D object collection.
|
||||
uint32 xSize; ///< \ru Количество объектов вдоль первой координаты. \en The number of objects along the first coordinate.
|
||||
uint32 ySize; ///< \ru Количество объектов вдоль второй координаты. \en The number of objects along the second coordinate.
|
||||
uint32 zSize; ///< \ru Количество объектов вдоль третьей координаты. \en The number of objects along the third coordinate.
|
||||
std::vector<MbCartPoint3D> points; ///< \ru Множество точек. \en Set of points.
|
||||
std::vector<MbVector3D> normals; ///< \ru Множество нормалей в точках согласовано с множеством точек. \en Set of normals at control points is synchronized with the set of points.
|
||||
std::vector<double> escorts; ///< \ru Множество значений для дополнительной информации в точках. \en The set of values for additional information of points.
|
||||
std::vector<MbTriangle> triangles; ///< \ru Индексное множество треугольных пластин содержит номера элементов множества points и normals. \en Set of triangular plates contains numbers of elements of 'points' and 'normals' sets.
|
||||
std::vector<MbQuadrangle> quadrangles; ///< \ru Индексное множество четырёхугольных пластин содержит номера элементов множества params и/или множеств points и normals. \en Set of quadrangular plates contains numbers of elements of 'params' set and/or of 'points' and 'normals' sets.
|
||||
std::vector<MbElement> elements; ///< \ru Индексное множество объемных элементов содержит номера элементов множества points. \en Set of volume elements contains numbers of vertices of 'points' sets.
|
||||
std::vector<MbGridSegment> segments; ///< \ru Множество сегментов полигональной сетки. \en Set of segments of mesh.
|
||||
|
||||
/** \brief \ru Габаритный куб объекта.
|
||||
\en Bounding box of object. \~
|
||||
\details \ru Габаритный куб объекта рассчитывается только при запросе габарита объекта. Габаритный куб в конструкторе объекта и после модификации объекта принимает неопределенное значение.
|
||||
\en Bounding box of object is calculated only at the request. Bounding box of object is undefined after object constructor and after object modifications \n \~
|
||||
*/
|
||||
mutable MbCube cube;
|
||||
private:
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en The copy constructor without implementation prevents from copying by default.
|
||||
MbCollection( const MbCollection & init );
|
||||
|
||||
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
|
||||
explicit MbCollection( const MbCollection &, MbRegDuplicate * );
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbCollection();
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbCollection( const MbMesh & mesh );
|
||||
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbCollection();
|
||||
|
||||
public:
|
||||
VISITING_CLASS( MbCollection );
|
||||
|
||||
// \ru Общие функции геометрического объекта \en Common functions of a geometric object
|
||||
virtual MbeSpaceType IsA() const; // \ru Тип объекта. \en A type of an object.
|
||||
virtual MbeSpaceType Type() const; // \ru Групповой тип объекта. \en Group type of object.
|
||||
virtual MbSpaceItem & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Создать копию. \en Create a copy.
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвинуть вдоль вектора. \en Translate along a vector.
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси. \en Rotate about an axis.
|
||||
virtual bool IsSame ( const MbSpaceItem & init, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными? \en Are the objects equal?
|
||||
virtual bool SetEqual ( const MbSpaceItem & init ); // \ru Сделать объекты равным. \en Make the objects equal.
|
||||
virtual double DistanceToPoint ( const MbCartPoint3D & ) const; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point.
|
||||
virtual void AddYourGabaritTo( MbCube & r ) const; // \ru Добавь свой габарит в куб. \en Add bounding box into a cube.
|
||||
virtual void CalculateLocalGabarit( const MbMatrix3D & into, MbCube & cube ) const; // \ru Рассчитать габарит в локальной системы координат. \en Calculate bounding box in the local coordinate system.
|
||||
virtual void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh.
|
||||
|
||||
virtual MbProperty & CreateProperty( MbePrompt n ) const; // \ru Создать собственное свойство. \en Create a custom property.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
|
||||
// \ru Создать полигональный объект - упрощенную копию данного объекта. \en Create a polygonal object - a simplified copy of the given object.
|
||||
virtual MbItem * CreateMesh( const MbStepData & stepData, const MbFormNote & note, MbRegDuplicate * iReg ) const;
|
||||
// \ru Создать полигональный объект - упрощенную копию данного объекта. \en Create a polygonal object - a simplified copy of the given object.
|
||||
MbGrid * CreateGrid() const;
|
||||
|
||||
// \ru Создать сетки из четырехугольных пластин наружных стенок элементов. \en Create grids by quadrangular plates of the outside walls of elements.
|
||||
void CreateGridsByElements( RPArray<MbGrid> & grids_ ) const;
|
||||
|
||||
// \ru Создать угловые точки и элементы. \en Create corner points and elements.
|
||||
void CreateCornerPointsAndElements( SArray<MbFloatPoint3D> & points0, SArray<MbElement> & elements0 ) const;
|
||||
|
||||
// \ru Создать сетки из по результатам сегментации. \en Create grids by segmentation results.
|
||||
void CreateGridsBySegments( RPArray<MbGrid> & grids_ ) const;
|
||||
|
||||
/** \ru \name Общие функции коллекции.
|
||||
\en \name Common functions of a collection.
|
||||
\{ */
|
||||
|
||||
/// \ru Выдать количество точек. \en Get count of points.
|
||||
size_t PointsCount() const { return points.size(); }
|
||||
/// \ru Выдать количество нормалей. \en Get the number of normals.
|
||||
size_t NormalsCount() const { return normals.size(); }
|
||||
/// \ru Выдать количество значений. \en Get count of values.
|
||||
size_t EscortsCount() const { return escorts.size(); }
|
||||
/// \ru Выдать количество треугольников. \en Get the number of triangles.
|
||||
size_t TrianglesCount() const { return triangles.size(); }
|
||||
/// \ru Выдать количество четырехугольников. \en Get the number of quadrangles.
|
||||
size_t QuadranglesCount() const { return quadrangles.size(); }
|
||||
/// \ru Выдать количество объемных элементов. \en Get the number of elements of volume.
|
||||
size_t ElementsCount() const { return elements.size(); }
|
||||
/// \ru Выдать количество сегментов. \en Get the number of segments of mesh.
|
||||
size_t SegmentsCount() const { return segments.size(); }
|
||||
/// \ru Выдать количество триангуляций. \en Get the number of triangulations.
|
||||
//size_t GridsCount() const { return grids.size(); }
|
||||
ptrdiff_t PointsMaxIndex() const { ptrdiff_t c = points.size(); return ( c - 1 ); }
|
||||
/// \ru Выдать количество нормалей минус 1 (максимальный индекс). \en Get the number of normals minus one (maximal index).
|
||||
ptrdiff_t NormalsMaxIndex() const { ptrdiff_t c = normals.size(); return ( c - 1 ); }
|
||||
|
||||
/// \ru Добавить в коллекцию точку и нормаль в точке. \en Add a point and normal at the point to collection.
|
||||
void AddPoint ( const MbCartPoint3D & p3D, const MbVector3D & n3D ) { points.push_back(p3D); normals.push_back(n3D); cube.SetEmpty(); }
|
||||
/// \ru Добавить в коллекцию точку. \en Add a point to collection.
|
||||
void AddPoint ( const MbCartPoint3D & p3D ) { points.push_back(p3D); cube.SetEmpty(); }
|
||||
/// \ru Добавить в коллекцию нормаль. \en Add a normal to collection.
|
||||
void AddNormal( const MbVector3D & n3D ) { normals.push_back(n3D) ; }
|
||||
/// \ru Добавить в коллекцию точки. \en Add points to collection.
|
||||
void AddPoints ( const std::vector<MbCartPoint3D> & pnts ) { points.insert(points.end(), pnts.begin(), pnts.end()); cube.SetEmpty(); }
|
||||
/// \ru Добавить в коллекцию нормали. \en Add normals to collection.
|
||||
void AddNormals( const SArray<MbFloatVector3D> & nrms ) { normals.insert(normals.end(), nrms.begin(), nrms.end()); cube.SetEmpty(); }
|
||||
/// \ru Добавить в коллекцию данных. \en Add scores to collection.
|
||||
void AddEscorts( const std::vector<double> & scores ) { escorts.insert(escorts.end(), scores.begin(), scores.end()); }
|
||||
|
||||
/// \ru Добавить треугольник. \en Add a triangle.
|
||||
void AddTriangle ( const MbTriangle & triangle ) { triangles.push_back( triangle ); }
|
||||
/// \ru Добавить треугольник с заданными номерами вершин. \en Add a triangle by the given indices of vertices
|
||||
void AddTriangle ( uint j0, uint j1, uint j2, bool o ) { MbTriangle t(j0,j1,j2,o); triangles.push_back( t ); }
|
||||
/// \ru Добавить четырёхугольник. \en Add a quadrangle.
|
||||
void AddQuadrangle( const MbQuadrangle & quadrangle ) { quadrangles.push_back( quadrangle ); }
|
||||
/// \ru Добавить четырёхугольник с заданными номерами вершин. \en Add a quadrangle by the given indices of vertices.
|
||||
void AddQuadrangle( uint j0, uint j1, uint j2, uint j3, bool o ) { MbQuadrangle t(j0,j1,j2,j3,o); quadrangles.push_back( t ); }
|
||||
/// \ru Добавить объемный элемент. \en Add an element.
|
||||
void AddElement( const MbElement & element ) { elements.push_back(element); }
|
||||
/// \ru Добавить объемный элемент. \en Add an element.
|
||||
void AddElement( uint j0, uint j1, uint j2, uint j3, uint j4, uint j5, uint j6, uint j7 ) {
|
||||
MbElement t( j0,j1,j2,j3,j4,j5,j6,j7 ); elements.push_back( t ); }
|
||||
void AddSegment( const MbGridSegment & segment ) { segments.push_back( segment ); }
|
||||
void AddSegment( const std::vector<size_t> & initFaces ) { MbGridSegment seg( initFaces ); segments.push_back( seg ); }
|
||||
/// \ru Добавить полигон. \en Add a polygon.
|
||||
//void AddGrid( MbExactGrid & grd ) { grids.push_back( &grd ); }
|
||||
|
||||
/// \ru Выдать индексы точек в массиве points для i-го треугольника (связанного или несвязанного). \en Get indices of points in 'points' array for i-th triangle (adjacent or non-adjacent).
|
||||
bool GetTrianglePointIndex ( size_t i, uint & ind0, uint & ind1, uint & ind2 ) const;
|
||||
/// \ru Выдать индексы точек в массиве points для i-го четырехугольника (связанного или несвязанного). \en Get indices of points in 'points' array for i-th quadrangle (adjacent or non-adjacent).
|
||||
bool GetQuadranglePointIndex( size_t i, uint & ind0, uint & ind1, uint & ind2, uint & ind3 ) const;
|
||||
/// \ru Выдать для треугольника с номером i в общей нумерации (с полосами) точки вершин. \en Get points of vertices for i-th triangle in general numbering (with strips).
|
||||
bool GetTrianglePoints ( size_t i, MbCartPoint3D &p0, MbCartPoint3D &p1, MbCartPoint3D &p2 ) const;
|
||||
/// \ru Выдать для треугольника с номером i в общей нумерации (с полосами) нормали в вершинах. \en Get normals at vertices for i-th triangle in general numbering (with strips).
|
||||
bool GetTriangleNormals ( size_t i, MbVector3D &n0, MbVector3D &n1, MbVector3D &n2 ) const;
|
||||
|
||||
/// \ru Выдать для четырёхугольника с номером i в общей нумерации (с полосами) точки вершин. \en Get points of vertices for i-th quadrangle in general numbering (with strips).
|
||||
bool GetQuadranglePoints ( size_t i, MbCartPoint3D &p0, MbCartPoint3D &p1, MbCartPoint3D &p2, MbCartPoint3D &p3 ) const;
|
||||
/// \ru Выдать для четырёхугольника с номером i в общей нумерации (с полосами) нормали в вершинах. \en Get normals at vertices for i-th quadrangle in general numbering (with strips).
|
||||
bool GetQuadrangleNormals( size_t i, MbVector3D &n0, MbVector3D &n1, MbVector3D &n2, MbVector3D &n3 ) const;
|
||||
|
||||
/// \ru Удалить точки. \en Delete points.
|
||||
void PointsRemove() { points.clear();
|
||||
#ifdef STANDARD_C11
|
||||
points.shrink_to_fit();
|
||||
#endif
|
||||
cube.SetEmpty(); }
|
||||
/// \ru Удалить точку с заданным номером. \en Delete point by the given index.
|
||||
void PointRemove ( size_t i ) { if ( i < points.size() ) points.erase( points.begin() + i ); cube.SetEmpty(); }
|
||||
/// \ru Удалить нормаль с заданным номером. \en Delete normal by the given index.
|
||||
void NormalRemove( size_t i ) { if ( i < normals.size() ) normals.erase( normals.begin() + i ); }
|
||||
|
||||
/// \ru Установить тип объекта. \en Set type.
|
||||
void SetType( CollectionType t ) { type = t; }
|
||||
/// \ru Выдать тип объекта. \en Get type.
|
||||
CollectionType GetType() const { return type; }
|
||||
/// \ru Установить количество объектов вдоль первой координаты. \en Set the number of objects along the first coordinate.
|
||||
void SetXSize( uint32 n ) { xSize = n; }
|
||||
/// \ru Установить количество объектов вдоль второй координаты. \en Set the number of objects along the cecond coordinate.
|
||||
void SetYSize( uint32 n ) { ySize = n; }
|
||||
/// \ru Установить количество объектов вдоль третьей координаты. \en Set the number of objects along the third coordinate.
|
||||
void SetZSize( uint32 n ) { zSize = n; }
|
||||
/// \ru Выдать количество объектов вдоль первой координаты. \en Get the number of objects along the first coordinate.
|
||||
uint32 GetXSize() const { return xSize; }
|
||||
/// \ru Выдать количество объектов вдоль второй координаты. \en Get the number of objects along the cecond coordinate.
|
||||
uint32 GetYSize() const { return ySize; }
|
||||
/// \ru Выдать количество объектов вдоль третьей координаты. \en Get the number of objects along the third coordinate.
|
||||
uint32 GetZSize() const { return zSize; }
|
||||
|
||||
/// \ru Выдать точку по её номеру. \en Get point by its index.
|
||||
void GetPoint ( size_t i, MbCartPoint3D & p ) const { p = points[i]; }
|
||||
/// \ru Выдать множество точек. \en Get set of points.
|
||||
const std::vector<MbCartPoint3D> & GetPoints ( ) const { return points; }
|
||||
/// \ru Выдать нормаль по её номеру. \en Get normal by its index.
|
||||
void GetNormal( size_t i, MbVector3D & n ) const { n = normals[i]; }
|
||||
/// \ru Выдать множество нормалей. \en Get set of normals.
|
||||
const std::vector<MbVector3D> & GetNormals( ) const { return normals; }
|
||||
/// \ru Выдать точку по её номеру. \en Get point by its index.
|
||||
double GetEscort( size_t i ) const { return escorts[i]; }
|
||||
/// \ru Выдать элемент по его номеру. \en Get element by its index.
|
||||
void GetElement( size_t i, MbElement & elem ) const { elem = elements[i]; }
|
||||
/// \ru Выдать индексы точек в массиве points для i-го объемного элемента. \en Get indices of points in 'points' array for i-th element.
|
||||
bool GetElementIndex( size_t i, uint & ind0, uint & ind1, uint & ind2, uint & ind3, uint & ind4, uint & ind5, uint & ind6, uint & ind7 ) const;
|
||||
/// \ru Выдать для элемента с номером i точки вершин. \en Get points of vertices for i-th element.
|
||||
bool GetElementPoints ( size_t i, MbCartPoint3D &p0, MbCartPoint3D &p1, MbCartPoint3D &p2, MbCartPoint3D &p3,
|
||||
MbCartPoint3D &p4, MbCartPoint3D &p5, MbCartPoint3D &p6, MbCartPoint3D &p7 ) const;
|
||||
/// \ru Выдать сегмент по его номеру. \en Get segment by its index.
|
||||
void GetSegment( size_t i, MbGridSegment & seg ) const { seg = segments[i]; }
|
||||
/// \ru Выдать точку с заданным номером. \en Get point by the given index.
|
||||
const MbCartPoint3D & GetPoint ( size_t i ) const { return points[i]; }
|
||||
/// \ru Выдать нормаль с заданным номером. \en Get normal by the given index.
|
||||
const MbVector3D & GetNormal( size_t i ) const { return ( (normals.size() == 1) ? normals[0] : normals[i] ); }
|
||||
/// \ru Выдать треугольник с номером i. \en Get i-th triangle.
|
||||
const MbTriangle & GetTriangle ( size_t i ) const { return triangles[i]; }
|
||||
/// \ru Выдать четырёхугольник с номером i. \en Get i-th quadrangle.
|
||||
const MbQuadrangle & GetQuadrangle( size_t i ) const { return quadrangles[i]; }
|
||||
/// \ru Выдать четырёхугольник с номером i. \en Get i-th quadrangle.
|
||||
const MbElement & GetElement ( size_t i ) const { return elements[i]; }
|
||||
/// \ru Выдать сегмент по его номеру. \en Get segment by its index.
|
||||
const MbGridSegment & GetSegment( size_t i ) const { return segments[i]; }
|
||||
/// \ru Выдать полигон с номером i. \en Get i-th polygon.
|
||||
//const MbExactGrid & GetGrid ( size_t i ) const { return *grids[i]; }
|
||||
|
||||
/// \ru Удалить все xтреугольники. \en Delete all triangles.
|
||||
void TrianglesDelete() { triangles.clear(); }
|
||||
/// \ru Удалить все четырехугольники. \en Delete all quadrangles.
|
||||
void QuadranglesDelete() { quadrangles.clear(); }
|
||||
/// \ru Удалить все объемные элементы. \en Delete all elements.
|
||||
void ElementsDelete() { elements.clear(); }
|
||||
/// \ru Удалить все сегменты. \en Delete all segments.
|
||||
void SegmentsDelete() { segments.clear(); }
|
||||
/// \ru Удалить все nhbfyuekzwbb. \en Delete all triangulations.
|
||||
//void GridsDelete();
|
||||
|
||||
/// \ru Зарезервировать память для контейнеров. \en Reserve memory for some containers.
|
||||
void ReservePointsNormals( size_t n ) { points.reserve( points.size() + n ); normals.reserve( normals.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера точек. \en Reserve memory for container of points.
|
||||
void PointsReserve ( size_t n ) { points.reserve( points.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера нормалей. \en Reserve memory for container of normals.
|
||||
void NormalsReserve ( size_t n ) { normals.reserve( normals.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера параметров. \en Reserve memory for container of elements.
|
||||
/// \ru Зарезервировать память для контейнера параметров. \en Reserve memory for container of elements.
|
||||
void EscordsReserve ( size_t n ) { escorts.reserve( escorts.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера треугольников. \en Reserve memory for container of triangles.
|
||||
void TrianglesReserve ( size_t n ) { triangles.reserve( triangles.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера четырехугольников. \en Reserve memory for container of quadrangles.
|
||||
void QuadranglesReserve( size_t n ) { quadrangles.reserve( quadrangles.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера элементов. \en Reserve memory for container of elements.
|
||||
void ElementsReserve ( size_t n ) { elements.reserve( elements.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера сегментов. \en Reserve memory for container of segments.
|
||||
void SegmentsReserve ( size_t n ) { segments.reserve( segments.size() + n ); }
|
||||
/// \ru Зарезервировать память для контейнера полигонов. \en Reserve memory for container of grids.
|
||||
//void GridReserve ( size_t n ) { grids.reserve( grids.size() + n ); }
|
||||
|
||||
/// \ru Удалить всю триангуляцию без освобождения памяти, занятую контейнерами. \en Delete all triangulation without freeing the memory occupied by containers.
|
||||
void Flush() { points.clear(); normals.clear(); escorts.clear();
|
||||
triangles.clear(); quadrangles.clear(); elements.clear(); segments.clear(); //grids.clear();
|
||||
cube.SetEmpty(); }
|
||||
/// \ru Удалить всю триангуляцию и освободить память. \en Delete all triangulation and free the memory.
|
||||
void HardFlush() { points.clear(); normals.clear(); escorts.clear();
|
||||
triangles.clear(); quadrangles.clear(); elements.clear(); segments.clear(); //grids.clear();
|
||||
#ifdef STANDARD_C11
|
||||
points.shrink_to_fit(); normals.shrink_to_fit(); escorts.shrink_to_fit();
|
||||
triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); elements.shrink_to_fit(); segments.shrink_to_fit(); //grids.shrink_to_fit();
|
||||
#endif
|
||||
cube.SetEmpty(); }
|
||||
/// \ru Освободить лишнюю память. \en Free the unnecessary memory.
|
||||
void Adjust() {
|
||||
#ifdef STANDARD_C11
|
||||
points.shrink_to_fit(); normals.shrink_to_fit(); escorts.shrink_to_fit();
|
||||
triangles.shrink_to_fit(); quadrangles.shrink_to_fit(); elements.shrink_to_fit(); segments.shrink_to_fit(); //grids.shrink_to_fit();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// \ru Инициализировать объект. \en Initialize object.
|
||||
void Init( const MbCollection & init );
|
||||
/// \ru Инициализировать объект. \en Initialize object.
|
||||
void Init( const MbGrid & init );
|
||||
/// \ru Инициализировать объект. \en Initialize object.
|
||||
void Init( const MbMesh & init );
|
||||
|
||||
// \ru Выдать контейнер треугольников. \en Get the container of triangles.
|
||||
template <class TrianglesVector>
|
||||
void GetTriangles( TrianglesVector & tVector ) const {
|
||||
tVector.reserve( tVector.size() + triangles.size() );
|
||||
for ( size_t i = 0, iCount = triangles.size(); i < iCount; i++ )
|
||||
tVector.push_back( triangles[i] );
|
||||
}
|
||||
// \ru Выдать контейнер четырёхугольников. \en Get the container of quadrangles.
|
||||
template <class QuadranglesVector>
|
||||
void GetQuadrangles( QuadranglesVector & qVector ) const {
|
||||
qVector.reserve( qVector.size() + quadrangles.size() );
|
||||
for ( size_t i = 0, iCount = quadrangles.size(); i < iCount; i++ )
|
||||
qVector.push_back( quadrangles[i] );
|
||||
}
|
||||
|
||||
/// \ru Преобразовать четырёхугольники в треугольники. \en Convert quadrangles to triangles.
|
||||
void ConvertQuadranglesToTriangles();
|
||||
/// \ru Преобразовать все объекты в треугольники и уравнять число точек и нормалей. \en Convert all objects to triangles and equalize count of points and count of normals.
|
||||
void ConvertAllToTriangles();
|
||||
/// \ru Удалить дублирующие с заданной точностью друг друга точки. \en Remove redundant points with a given tolerance (duplicates).
|
||||
bool RemoveRedundantPoints( bool deleteNormals, double epsilon = LENGTH_EPSILON );
|
||||
|
||||
/** \} */
|
||||
private:
|
||||
/// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbCollection & operator = ( const MbCollection & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCollection )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCollection )
|
||||
|
||||
#endif // __COLLECTION_H
|
||||
@@ -0,0 +1,59 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Модуль: COMANAGER
|
||||
\en Module: COMANAGER. \~
|
||||
\details \ru Цель: Менеджер геометрических ограничений для MbModel
|
||||
\en Target: Geometric constraints manager for MbModel \~
|
||||
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COMANAGER_H
|
||||
#define __COMANAGER_H
|
||||
//
|
||||
#include <templ_sptr.h>
|
||||
#include <reference_item.h>
|
||||
// constraints
|
||||
#include "gce_api.h"
|
||||
|
||||
|
||||
|
||||
class GcFormerImpl;
|
||||
class MbConstraint;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \ru Менеджер для взаимодействия с решателем \en Manager of interactions with the solver
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MATH_CLASS ConstraintManager2D
|
||||
{
|
||||
GCE_system m_gcSolver;
|
||||
GcFormerImpl & m_gcFormer;
|
||||
|
||||
public:
|
||||
ConstraintManager2D();
|
||||
~ConstraintManager2D();
|
||||
|
||||
public:
|
||||
/// \ru Добавить ограничение в решатель \en Add a constraint to the solver
|
||||
bool AddConstraint( const MbConstraint & );
|
||||
/// \ru Рассчитать систему ограничений \en Compute a system of constraints
|
||||
bool Evaluate();
|
||||
/// \ru Применить решение \en Apply the solution
|
||||
void ApplySolution();
|
||||
/// \ru Очистить весь контекст решателя \en Clear the whole context of the solver
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
ConstraintManager2D( const ConstraintManager2D & );
|
||||
ConstraintManager2D & operator = ( const ConstraintManager2D & );
|
||||
};
|
||||
|
||||
#endif // __COMANAGER_H
|
||||
|
||||
|
||||
// eof
|
||||
@@ -0,0 +1,229 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Геометрическое ограничение.
|
||||
\en Geometric constraint. \~
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONSTRAINT_H
|
||||
#define __CONSTRAINT_H
|
||||
|
||||
#include <templ_sptr.h>
|
||||
#include <reference_item.h>
|
||||
#include <assembly.h>
|
||||
#include <mesh.h>
|
||||
#include <vector>
|
||||
|
||||
struct CNodeIterator;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Аргумент геометрического ограничения.
|
||||
\en An argument of geometric constraint. \~
|
||||
\details \ru Аргумент ограничений со связанным элементом, указателем на геометрический
|
||||
объект, содержащий элемент, и указателем на сборку, содержащую объект.
|
||||
\en An argument of constraints with connected element, the geometric object
|
||||
containing the element, and the assembly containing the object.\~
|
||||
\ingroup Model_Items
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS MtGeomArgument
|
||||
{
|
||||
private:
|
||||
SPtr<const MbRefItem> propItem; ///< \ru Элемент объекта, непосредственно выбранный для связи. \en The element of geom object which constraints are connected to.
|
||||
SimpleName propName; ///< \ru Имя связываемого элемента. \en Name of a connected element.
|
||||
uint32 hash; ///< \ru Имя объекта сборки или подсборки, содержащего объект связи с ограничением. \en Hash code of the path from the root to the item.
|
||||
SPtr<const MbItem> item; ///< \ru Объект сборки или подсборки, содержащий объект связи с ограничением. \en Assembly object that hosts geom entity connected to constraint.
|
||||
const MbAssembly * root; ///< \ru Сборка, содержащая объект с ограничением. \en The assembly that hosts geom object with entity connected to constraint.
|
||||
|
||||
public:
|
||||
static const MtGeomArgument null; ///< \ru Пустой аргумент. \en An empty argument.
|
||||
|
||||
public:
|
||||
MtGeomArgument( const MbRefItem * p, const MbItem * h );
|
||||
MtGeomArgument( const MtGeomArgument & );
|
||||
MtGeomArgument() : propItem( NULL ), propName( UNDEFINED_SNAME )
|
||||
, hash( UNDEFINED_SNAME ), item( NULL ), root( NULL ) {}
|
||||
|
||||
public:
|
||||
/** \brief \ru Получить непосредственный объект сборки, содержащий ссылочный объект.
|
||||
\en Get immediate object of the assembly containing the reference object.
|
||||
\param trans - \ru Матрица ссылочного объекта в системе координат непосредственного объекта сборки.
|
||||
- \en Matrix from the reference object to the sub-item of the assembly. \~
|
||||
*/
|
||||
const MbItem * SubItemOf( const MbAssembly *, MbMatrix3D & trans ) const;
|
||||
/// \ru Объект геометрической модели, владеющий аргументом. \en Geometry model object which is a host of an argument.
|
||||
const MbItem * HostItem() const { return item; }
|
||||
/// \ru Аргумент ограничения, заданный в ЛСК хозяина. \en Geometric constraint argument given in the host's LCS.
|
||||
const MbRefItem * PropItem() const { return propItem; }
|
||||
/// \ru Выдать значение геометрии аргумента, заданное в ЛСК хозяина. \en Get geometric value of argument given in the host LCS.
|
||||
MtGeomVariant PropGeom() const;
|
||||
/// \ru Выдать хэш-имя объекта. \en Get a hash name of the object.
|
||||
SimpleName PropName() const;
|
||||
/// \ru Равны ли объекты? \en Are objects equal? \~
|
||||
bool IsSame( const MtGeomArgument & r ) const {
|
||||
return ( (propItem == r.propItem) && (propName == r.propName) && (item == r.item) && (hash == r.hash) );
|
||||
}
|
||||
/// \ru Равны ли ссылкпи на объект модели? \en Are the references to the model object equal? \~
|
||||
bool IsSameItemReference( const MtGeomArgument & r ) const { // MtItemReference
|
||||
return ( (hash == r.hash) && (item == r.item) && (root == r.root) );
|
||||
}
|
||||
/// \ru Оператор равенства объектов. \en Objects equality operator. \~
|
||||
bool operator == ( const MtGeomArgument & ) const;
|
||||
/// \ru Оператор копирования. \en Copy operator. \~
|
||||
MtGeomArgument & operator = ( const MtGeomArgument & );
|
||||
|
||||
KNOWN_OBJECTS_RW_REF_OPERATORS( MtGeomArgument ) // Serializing into a file format
|
||||
}; // MtGeomArgument
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Геометрическое ограничение.
|
||||
\en Geometric constraint. \~
|
||||
\details \ru Этот класс представляет все виды ограничений, включая геометрические и
|
||||
размерные отношения между объектами модели.
|
||||
\en This class represents all kinds of constraints of assembly, including
|
||||
geometrical and dimensional relationships between the model objects. \~
|
||||
\ingroup Model_Items
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS MtGeomConstraint
|
||||
{
|
||||
private:
|
||||
const ItConstraintItem * m_cItem; ///< \ru Указатель на реализацию геометрического ограничения. \en Pointer to geometric constraint implementation. \~
|
||||
std::vector<MtGeomArgument> m_arguments; ///< \ru Аргументы геометрического ограничения. \en The arguments of geometric constraint. \~
|
||||
SPtr<const MbItem> m_mesh; ///< \ru Объект для демонстрации геометрического ограничения. \en The draw object of geometric constraint. \~
|
||||
|
||||
public:
|
||||
MtGeomConstraint( const MtGeomConstraint & );
|
||||
~MtGeomConstraint();
|
||||
|
||||
public:
|
||||
/// \ru Возвращает true, если ограничение не действительно. \en Return true if the constraint is invalid.
|
||||
bool IsNull() const { return m_cItem == NULL; }
|
||||
/// \ru Тип сопряжения (геометрического ограничения). \en Type of geometric constraint.
|
||||
MtMateType ConstraintType() const;
|
||||
/// \ru Текущее значение размера. \en Current value of the dimension.
|
||||
double DimValue() const;
|
||||
/// \ru Создать полигональный объект для отображения геометрических ограничений. \en Create a polygonal object for visualization.
|
||||
bool CreateMesh( const MbAssembly & assem, const MbStepData & stepData, const MbFormNote & note, double meshUnit, uint32 color );
|
||||
/// \ru Выдать указатель на объект для демонстрации геометрического ограничения. \en Get a pointer to draw object of geometric constraint.
|
||||
const MbItem * GetMesh() const { return m_mesh.get(); }
|
||||
|
||||
// \ru Объявление оператора присваивания. \en Declaration of the assignment operator.
|
||||
MtGeomConstraint & operator = (const MtGeomConstraint & arg );
|
||||
|
||||
protected:
|
||||
friend class MbConstraintSystem;
|
||||
friend class MtConstraintIter;
|
||||
/// \ru Выдать указатель на реализацию геометрического ограничения. \en Get a pointer to geometric constraint implementation. \~
|
||||
const ItConstraintItem * ConstraintItem() const { return m_cItem; }
|
||||
|
||||
MtGeomConstraint( const ItConstraintItem * cItem, const MtGeomArgument & a1, const MtGeomArgument & a2 );
|
||||
MtGeomConstraint( const MbConstraintSystem &, const ItConstraintItem * cItem );
|
||||
}; // MtGeomConstraint
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Итератор обходящий ограничения сборки. \en Iterator traversing assembly constraints.
|
||||
//---
|
||||
class MATH_CLASS MtConstraintIter
|
||||
{
|
||||
private:
|
||||
CNodeIterator * m_cIter;
|
||||
const MbConstraintSystem * m_gcSystem;
|
||||
|
||||
public:
|
||||
MtConstraintIter();
|
||||
MtConstraintIter( const MtConstraintIter & );
|
||||
MtConstraintIter & operator = ( const MtConstraintIter & );
|
||||
~MtConstraintIter();
|
||||
|
||||
public:
|
||||
MtGeomConstraint Get() const;
|
||||
MtConstraintIter & Set( const MbConstraintSystem *, CNodeIterator & );
|
||||
const MtConstraintIter & Next();
|
||||
bool EqualTo( const MtConstraintIter & ) const;
|
||||
|
||||
public:
|
||||
//operator CNodeIterator& () { return *impl; }
|
||||
MtGeomConstraint operator*() const { return Get(); }
|
||||
// prefix operator
|
||||
const MtConstraintIter & operator++() { return Next(); }
|
||||
bool operator ==( const MtConstraintIter & iter ) const { return EqualTo( iter ); }
|
||||
bool operator !=( const MtConstraintIter & iter ) const { return !EqualTo( iter ); }
|
||||
|
||||
}; // MtConstraintIter
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Обработчик события, связанные с решением сборки. \en The event handles related to solving the assembly.
|
||||
//---
|
||||
struct MATH_CLASS ItAssemblyReactor
|
||||
{
|
||||
public:
|
||||
/// \ru Захватить сборкой объект для дальнейшей работы. \en Capture the reactor instance by the assembly for further work.
|
||||
virtual void Capture( const MbAssembly * ) = 0;
|
||||
/// \ru Отпустить сборкой объект, прекратить работать с ним. \en Release this instance by the assembly, stop working with it.
|
||||
virtual void Release() = 0;
|
||||
/// \ru Геометрический решатель не пытался удовлетворить ограничение. \en This called when geometric solver failed to try for constraint satisfaction.
|
||||
virtual void EvaluationFailed( const MbAssembly * ) const {}
|
||||
/// \ru Геометрический решатель нашел новую позицию под-объекта сборки. \en The geometric solver found a new position of a constrained sub-object belonging the assembly.
|
||||
virtual void PositionChanged( const MbAssembly *, const MbItem * /*subItem*/ ) const {}
|
||||
|
||||
protected:
|
||||
~ItAssemblyReactor() {}
|
||||
}; // ItAssemblyReactor
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс для системы ограничения импорта сборки из приложения.
|
||||
\en The user defined interface for import constraint system of an assembly from CAD application.
|
||||
*/
|
||||
//---
|
||||
struct MATH_CLASS ItAssemblyImportData
|
||||
{
|
||||
protected:
|
||||
~ItAssemblyImportData() {}
|
||||
|
||||
public:
|
||||
/// \ru Импорт системы ограничений сборки. \en Import a constraint system of the assembly.
|
||||
virtual bool ImportCSystem( const MbAssembly &, GCM_system & ) const = 0;
|
||||
/// \ru Получить дескриптор элемента сборки в системе ограничений. \en Get a descriptor of assembly sub-item which used in the constraint system.
|
||||
virtual MtGeomId GeomId( const MbAssembly &, const MbItem * ) const = 0;
|
||||
/// \ru Получить объект модели, являющийся аргументом геометрического ограничения. \en Get the model object that is the argument of the geometric constraint.
|
||||
virtual MtGeomArgument GeomSubItem( const MtArgument & ) const { return MtGeomArgument(); }
|
||||
/// \ru Получить объект модели, являющийся аргументом геометрического ограничения. \en Get the model object that is the argument of the geometric constraint.
|
||||
virtual MtGeomArgument GeomSubItem( MtGeomId ) const { return MtGeomArgument(); }
|
||||
}; //ItAssemblyImportData
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Оператор равенства объектов. \en Objects equality operator. \~
|
||||
//---
|
||||
inline bool MtGeomArgument::operator == ( const MtGeomArgument & r ) const
|
||||
{
|
||||
if ( propItem != r.propItem )
|
||||
return false;
|
||||
if ( propName != r.propName )
|
||||
return false;
|
||||
if ( (item == r.item) && (hash == r.hash) )
|
||||
return true;
|
||||
if ( (hash == r.hash) && (root == r.root) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Оператор копирования. \en Copy operator. \~
|
||||
//---
|
||||
inline MtGeomArgument & MtGeomArgument::operator = ( const MtGeomArgument & arg )
|
||||
{
|
||||
propItem = arg.propItem;
|
||||
propName = arg.propName;
|
||||
hash = arg.hash;
|
||||
item = arg.item;
|
||||
root = arg.root;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // __CONSTRAINT_H
|
||||
@@ -0,0 +1,255 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Двухмерные геометрические ограничения для объектов C3D-модели
|
||||
\en 2D-constraints between geometric objects of C3D-model.
|
||||
\~
|
||||
\attention \ru Данный файл содержит типы данных и вызовы, предназначенные для тестирования
|
||||
и отладки, поэтому могут быть изменены или удалены из API C3D Kernel без
|
||||
предупреждения. Для применения функциональности решателя двухмерных ограничений
|
||||
рекомендуется реализация собственного модуля встраивания в приложение на
|
||||
основе интерфейсов gce_api.h и gce_types.h.
|
||||
|
||||
\en This file contains data types and calls for testing and debugging, so they
|
||||
can be modified or removed from the C3D Kernel API without notice. To use
|
||||
the 2D constraint solver, it is recommended to implement a custom embedding module
|
||||
based on th interfaces gce_api.h and gce_types.h.
|
||||
\~
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONSTRAINT_ITEM_H
|
||||
#define __CONSTRAINT_ITEM_H
|
||||
|
||||
|
||||
#include <templ_sptr.h>
|
||||
#include <reference_item.h>
|
||||
#include <gce_types.h>
|
||||
#include <mt_ref_item.h>
|
||||
#include <io_tape.h>
|
||||
#include <mb_cart_point.h>
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Кодировка геометрического примитива \en Geometric primitive encoding
|
||||
//---
|
||||
struct GeomCode
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
// \ru Словарь примитивов плоскости (соответствует словарю решателя; типы геометрических подмножеств плоскости) \en Plane primitive dictionary (corresponds to the solver dictionary; types of geometric subsets of plane)
|
||||
NULL_GEOM, ///< \ru пустое геометрическое множество \en empty geometric set
|
||||
POINT, ///< \ru Точка: элемент плоскости \en Point: element of the plane
|
||||
PROPER_POINT = POINT, ///< \ru Контрольная точка по индексу \en Control point by index
|
||||
LINE, ///< \ru Прямая \en Line
|
||||
CIRCLE,
|
||||
ELLIPSE,
|
||||
SPLINE,
|
||||
PARAMETRIC, ///< \ru Неподвижная параметрическая кривая \en Fixed parametric curve
|
||||
|
||||
// \ru Дифференциация подтипов точки \en Differentiation of subtypes of the point
|
||||
FIRST_END, ///< \ru Начальная точка кривой \en Start point of a curve
|
||||
SECOND_END, ///< \ru Конечная точка кривой \en End point of a curve
|
||||
MIDDLE_POINT, ///< \ru Средняя точка кривой \en Middle point of a curve
|
||||
CENTRE_POINT, ///< \ru Центральная точка эллипса \en Central point of an ellipse
|
||||
SPLINE_POINT, ///< \ru Контрольная точка сплайна по индексу \en Control point of a spline by index
|
||||
Q1_POINT, ///< \ru Квадрантная точка на 3 ч \en Quadrant point at 3 o'clock
|
||||
Q2_POINT, ///< \ru Квадрантная точка на 12 ч \en Quadrant point at 12 o'clock
|
||||
Q3_POINT, ///< \ru Квадрантная точка на 9 ч \en Quadrant point at 9 o'clock
|
||||
Q4_POINT, ///< \ru Квадрантная точка на 6 ч \en Quadrant point at 6 o'clock
|
||||
|
||||
// \ru Размеры \en Sizes
|
||||
/*
|
||||
LINEAR_DIM,
|
||||
ANGULAR_DIM,
|
||||
*/
|
||||
};
|
||||
Type type; ///< \ru Тип геометрии объекта модели (из словаря типов, поддерживаемых решателем) \en Type of geometry of a model object (from dictionary of types supported by the solver)
|
||||
size_t index; ///< \ru Номер примитива для данного объекта модели (кодируется в индивидуальных адаптерах) \en Number of a primitive for a given object of the model (encoded in individual adapters)
|
||||
|
||||
GeomCode( GeomCode::Type t ) : type(t),index(0) {}
|
||||
bool operator != ( const GeomCode & g ) const { return type != g.type || index != g.index; }
|
||||
GeomCode & operator = ( const Type & gType ) { type = gType; index = 0; return *this; }
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \ru Аргумент ограничения (или геометрический примитив решателя) \en Argument of constraint (or geometric primitive of the solver)
|
||||
/**\ru Этот тип:
|
||||
1) Кодирует информацию о геометрии, которая является аргументом для ограничений;
|
||||
2) соответствует одному из примитивных типов словаря решателя
|
||||
|
||||
Словарь примитивов решателя: точка, прямая, окружность, эллипс, сплайн.
|
||||
\en This type:
|
||||
1) Encodes the information about the geometry which is the argument for constraints;
|
||||
2) Corresponds to one of primitive types of the solver dictionary
|
||||
|
||||
The solver primitives dictionary: point, line, circle, ellipse, spline. \~
|
||||
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MATH_CLASS GcArgument {
|
||||
public:
|
||||
typedef MbRefItem * ParObject; ///< \ru Ассоциированный тип: владелец примитива, которого он содержит, как свою составную часть \en Associated type: primitives owner which contain the primitive as a component
|
||||
|
||||
public:
|
||||
GeomCode m_geom; ///< \ru Тип геометрии объекта модели (из словаря типов, поддерживаемых решателем) \en Type of geometry of a model object (from dictionary of types supported by the solver)
|
||||
c3d::RefItemSPtr m_item; ///< \ru Объект модели \en The model object
|
||||
|
||||
public:
|
||||
GcArgument() : m_geom(GeomCode::NULL_GEOM), m_item() {}
|
||||
GcArgument( GeomCode type, MbRefItem & item ) : m_geom(type), m_item(&item) {}
|
||||
GcArgument( const GcArgument & ag ) : m_geom(ag.m_geom), m_item(ag.m_item) {}
|
||||
GcArgument & operator = ( const GcArgument & g ) { m_geom = g.m_geom; m_item = g.m_item; return *this; }
|
||||
bool operator != ( const GcArgument & g ) const { return m_item.get() != g.m_item.get() && m_geom != g.m_geom; }
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
//---
|
||||
inline GcArgument::ParObject Owner( GcArgument & g ) { return g.m_item; }
|
||||
inline GcArgument::ParObject Owner( const GcArgument & g ) { return g.m_item; }
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Параметры размерного ограничения \en Parameters of size constraint
|
||||
//---
|
||||
struct DimParameters
|
||||
{
|
||||
double dimValue;
|
||||
double dirAngle; ///< \ru Угол для направленного размера \en Angle for a directed size
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \ru Элементарное ограничение \en Elementary constraint
|
||||
/**\ru Элементарное ограничение соответствует типам ограничений из словаря решателя и не более того.
|
||||
Ограничения более сложных типов описываются набором классов MbConstraint.
|
||||
\en Elementary constraint corresponds to the types of constraints from the dictionary of the solver and nothing more.
|
||||
Constraints of more complex types are described by a set of classes MbConstraint. \~
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MATH_CLASS MbConstraint
|
||||
{
|
||||
public:
|
||||
typedef GcArgument Argument; ///< \ru Тип аргумента ограничения \en Type of argument of the constraint
|
||||
typedef std::vector<Argument> arg_list;
|
||||
typedef arg_list::const_iterator arg_iter;
|
||||
typedef std::pair<arg_iter,arg_iter> arg_iter_pair;
|
||||
static const Argument null_arg;
|
||||
|
||||
private:
|
||||
constraint_type m_type; ///< \ru Тип ограничения из словаря решателя \en Type of the argument of the solver dictionary
|
||||
arg_list m_args; ///< \ru Аргументы ограничения (примитивы из словаря решателя) \en Arguments of the constraint (primitives from the solver dictionary)
|
||||
DimParameters m_pars; ///< \ru Параметры размера (можно считать тоже аргументом, но представлен другим типом) \en Parameters of size (it can be considered as an argument but it is represented by another type)
|
||||
|
||||
public:
|
||||
MbConstraint( constraint_type, const Argument &, const Argument & ); // \ru Бинарное ограничение \en Binary constraint
|
||||
MbConstraint( const MbConstraint & );
|
||||
|
||||
public:
|
||||
const Argument & GetGeom( size_t nb ) const { --nb; return nb < m_args.size() ? m_args[nb] : null_arg; }
|
||||
constraint_type Type() const { return m_type; }
|
||||
arg_iter_pair Arguments() const { return arg_iter_pair( m_args.begin(), m_args.end() ); }
|
||||
|
||||
/*
|
||||
bool operator < ( const MbConstraint & c ) const;
|
||||
bool operator == ( const MbConstraint & c ) const;
|
||||
*/
|
||||
|
||||
public:
|
||||
MbConstraint & operator = ( const MbConstraint & );
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Формирователь модели в решателе \en Generator of a model in the solver
|
||||
//---
|
||||
/* struct GcFormer
|
||||
{
|
||||
// \ru Геометрические объекты \en Geometric objects
|
||||
virtual bool Point( const GcArgument & ) = 0;
|
||||
virtual bool Line( const GcArgument & ) = 0;
|
||||
virtual bool LineSeg( const GcArgument &, const GcArgument & ) = 0;
|
||||
virtual bool Circle( const MbRefItem &, const MbCartPoint &, double ) = 0;
|
||||
virtual bool Circle( const GcArgument & ) = 0;
|
||||
|
||||
// \ru Геометрические ограничения \en Geometric constraints
|
||||
virtual bool Coincidence( const GcArgument &, const GcArgument & ) = 0;
|
||||
virtual bool Incidence( const GcArgument &, const GcArgument & ) = 0;
|
||||
virtual bool Vertical( const GcArgument &, const GcArgument & ) = 0;
|
||||
virtual bool Horizontal( const GcArgument &, const GcArgument & ) = 0;
|
||||
|
||||
// \ru Размерные ограничения \en Dimensional constraints
|
||||
virtual bool LinearDimension( const MbConstraint & ) = 0;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \ru Ограничение модели \en Model constraints
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MbConstraintItem: public TapeBase
|
||||
, public MtRefItem
|
||||
{
|
||||
MbConstraint m_arg;
|
||||
|
||||
public:
|
||||
MbConstraintItem();
|
||||
MbConstraintItem( const MbConstraint & c ) : MtRefItem(), m_arg(c) {}
|
||||
constraint_type GceType() const { return m_arg.Type(); }
|
||||
const MbConstraint & GceConstraint() const { return m_arg; }
|
||||
|
||||
virtual ClassDescriptor GetClassDescriptor( const VersionContainer & ) const
|
||||
{
|
||||
C3D_ASSERT_UNCONDITIONAL( false ); // Неполная реализация класса
|
||||
return ClassDescriptor( ::pureName(typeid(*this).name()), Math::MathID() );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \ru Размерное ограничение \en Dimensional constraint
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MbDimensional: public MbConstraintItem
|
||||
{
|
||||
MbCartPoint legendPos; ///< \ru Положение размерной надписи в ЛСК размера \en Position of a dimension legend in LCS of the dimension
|
||||
|
||||
private:
|
||||
/// \ru Выдать ЛСК размера \en Get LCS of the dimension
|
||||
virtual void GetPlacement( MbPlacement & ) const;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \ru Система геометрических ограничений \en Geometric constraints system
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MATH_CLASS MbConstraintSystem2D
|
||||
{
|
||||
typedef SPtr<MbConstraintItem> ConstraintPtr;
|
||||
std::vector<ConstraintPtr> myConstraints;
|
||||
|
||||
public:
|
||||
MbConstraintSystem2D();
|
||||
~MbConstraintSystem2D();
|
||||
|
||||
public:
|
||||
void AddConstraint( SPtr<MbConstraintItem> );
|
||||
};
|
||||
|
||||
|
||||
#endif // __CONSTRAINT_ITEM_H
|
||||
|
||||
|
||||
// eof
|
||||
@@ -0,0 +1,72 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Нахождение пересечений двух областей.
|
||||
\en Calculation of intersection of two regions. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONTOUR_COMBINE_H
|
||||
#define __CONTOUR_COMBINE_H
|
||||
|
||||
#include <templ_p_array.h>
|
||||
#include <cur_contour.h>
|
||||
|
||||
class MATH_CLASS MbCurve;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Результат пересечения кривых.
|
||||
\en The curves intersection result. \~
|
||||
\details \ru Результат пересечения двух областей кривых.
|
||||
\en The result of two curves' regions intersection. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
enum MbeIntLoopsResult {
|
||||
ilr_error = -1, ///< \ru Ошибка! Кривые не замкнуты или имеют самопересечения. \en Error! Curves are not closed or have self-intersections.
|
||||
ilr_notIntersect = 0, ///< \ru Области под кривыми не пересекаются (массив кривых пересечения пуст). \en Regions of curves don't have intersections (intersection curve array is empty).
|
||||
ilr_firstCurve = 1, ///< \ru Пересечением областей является первая кривая (массив кривых пересечения пуст). \en The intersection of regions is the first curve (intersection curve array is empty).
|
||||
ilr_secondCurve = 2, ///< \ru Пересечением областей является вторая кривая (массив кривых пересечения пуст). \en The intersection of regions is the second curve (intersection curve array is empty).
|
||||
ilr_success = 3, ///< \ru Произвольное пересечение (одна и более кривых в массиве кривых пересечения). \en An arbitrary intersection (one or more curves in intersection curve array).
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
/** \brief \ru Найти пересечение двух кривых.
|
||||
\en Calculate two curves intersection. \~
|
||||
\details \ru Найти пересечение областей двух замкнутых кривых.
|
||||
\en Calculate two closed curves' regions intersection. \~
|
||||
\param[in] iCheck - \ru Признак проверки кривых на касание вершин.
|
||||
\en Attribute of check of curves for vertices tangency. \~
|
||||
\param[in] loop1 - \ru Первая замкнутая кривая.
|
||||
\en The first closed curve. \~
|
||||
\param[in] bOrient1 - \ru Ориентация первой замкнутой кривой:\n
|
||||
true - ее областью считаем внутренность,\n
|
||||
false - внешность.
|
||||
\en The first closed curve orientation:\n
|
||||
true - interior is considered to be the curve's region,\n
|
||||
false - exterior is the curve's region. \~
|
||||
\param[in] loop2 - \ru Вторая замкнутая кривая.
|
||||
\en The second closed curve. \~
|
||||
\param[in] bOrient2 - \ru Ориентация второй замкнутой кривой:\n
|
||||
true - ее областью считаем внутренность,\n
|
||||
false - внешность.
|
||||
\en The second closed curve orientation:\n
|
||||
true - interior is considered to be the curve's region,\n
|
||||
false - exterior is the curve's region. \~
|
||||
\param[out] intLoops - \ru Массив кривых пересечения.
|
||||
\en Intersection curve array. \~
|
||||
\attention \ru Устаревшая функция.
|
||||
\en An obsolete function. \~
|
||||
\return \ru Код результата пересечения.
|
||||
\en Intersection result code. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
DEPRECATE_DECLARE MATH_FUNC ( MbeIntLoopsResult ) BooleanIntLoops( const MbCurve & loop1, bool bOrient1,
|
||||
const MbCurve & loop2, bool bOrient2,
|
||||
RPArray<MbCurve> & intLoops );
|
||||
|
||||
#endif // __CONTOUR_COMBINE_H
|
||||
@@ -0,0 +1,910 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение контуров.
|
||||
\en Contours construction. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONTOUR_GRAPH_H
|
||||
#define __CONTOUR_GRAPH_H
|
||||
|
||||
|
||||
#include <templ_p_array.h>
|
||||
#include <cur_contour.h>
|
||||
|
||||
|
||||
class MATH_CLASS MpEdge;
|
||||
class MATH_CLASS ProgressBarWrapper;
|
||||
class IProgressIndicator;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Вершина.
|
||||
\en Vertex. \~
|
||||
\details \ru Вершина цикла. Соединяет два ребра цикла - предыдущее и следующее.\n
|
||||
\en Vertex of a loop. Connects two edges of a loop - the previous and the next one.\n \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MpVertex : public TapeBase {
|
||||
private:
|
||||
MbCartPoint point; ///< \ru Точка. \en A point.
|
||||
MpEdge * begEdge; ///< \ru Предыдущее ребро. \en The previous edge.
|
||||
MpEdge * endEdge; ///< \ru Последующее ребро. \en The next edge.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по точке. \en Constructor by point.
|
||||
MpVertex( const MbCartPoint & initP )
|
||||
: point( initP )
|
||||
, begEdge( NULL )
|
||||
, endEdge( NULL )
|
||||
{}
|
||||
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MpVertex();
|
||||
|
||||
/**\ru \name Операции с вершиной.
|
||||
\en \name Operations on vertex.
|
||||
\{ */
|
||||
|
||||
/// \ru Выдать декартову точку вершины. \en Get the Cartesian point of a vertex.
|
||||
const MbCartPoint & GetCartPoint() const { return point; }
|
||||
/// \ru Выдать декартову точку вершины. \en Get the Cartesian point of a vertex.
|
||||
void GetCartPoint( MbCartPoint & cp ) const { cp = point; }
|
||||
/// \ru Установить декартову точку вершины. \en Set the Cartesian point of a vertex.
|
||||
void SetCartPoint( MbCartPoint & cp ) { point = cp; }
|
||||
/** \} */
|
||||
/**\ru \name Операции с указателями на ребра.
|
||||
\en \name Operations on pointers to edges.
|
||||
\{ */
|
||||
/// \ru Изменить предыдущее ребро. \en Change the previous edge.
|
||||
void SetBegEdge( MpEdge * edge ) { begEdge = edge; }
|
||||
/// \ru Изменить последующее ребро. \en Change the next edge.
|
||||
void SetEndEdge( MpEdge * edge ) { endEdge = edge; }
|
||||
/// \ru Предыдущее ребро. \en The previous edge.
|
||||
MpEdge * GetBegEdge() const { return begEdge; }
|
||||
/// \ru Последующее ребро. \en The next edge.
|
||||
MpEdge * GetEndEdge() const { return endEdge; }
|
||||
/** \} */
|
||||
/**\ru \name Операции преобразования.
|
||||
\en \name Transformation operations.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Преобразовать.
|
||||
\en Transform. \~
|
||||
\details \ru Преобразовать в соответствии с матрицей.\n
|
||||
\en Transform according to the matrix.\n \~
|
||||
\param[in] matr - \ru Матрица трансформации.
|
||||
\en Transformation matrix. \~
|
||||
*/
|
||||
void Transform( const MbMatrix & matr );
|
||||
|
||||
/** \brief \ru Переместить.
|
||||
\en Move. \~
|
||||
\details \ru Переместить на вектор.\n
|
||||
\en Move by a vector.\n \~
|
||||
\param[in] to - \ru Вектор перемещения.
|
||||
\en Movement vector. \~
|
||||
*/
|
||||
void Move( const MbVector & to );
|
||||
|
||||
/** \brief \ru Повернуть.
|
||||
\en Rotate. \~
|
||||
\details \ru Повернуть на угол вокруг точки.\n
|
||||
\en Rotate at angle around a point.\n \~
|
||||
\param[in] pnt - \ru Точка - центр поворота.
|
||||
\en A point is a rotation center. \~
|
||||
\param[in] angle - \ru Двумерный нормализованный вектор, задающий угол вращения.
|
||||
\en A two-dimensional normalized vector determining the rotation angle. \~
|
||||
*/
|
||||
void Rotate( const MbCartPoint & pnt, const MbDirection & angle );
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
MpVertex( const MpVertex & ); // \ru Не реализовано \en Not implemented
|
||||
void operator = ( const MpVertex & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL ( MpVertex )
|
||||
}; // MpVertex
|
||||
|
||||
IMPL_PERSISTENT_OPS( MpVertex )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Ребро.
|
||||
\en Edge. \~
|
||||
\details \ru Ребро цикла.\n
|
||||
\en A loop edge.\n \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MpEdge : public TapeBase {
|
||||
public :
|
||||
const MbCurve * baseCurve; ///< \ru Базовая кривая. \en The base curve.
|
||||
ptrdiff_t name; ///< \ru Имя базовой кривой. \en The base curve name.
|
||||
double tBeg; ///< \ru Параметр начала ребра. \en The edge start parameter.
|
||||
double tEnd; ///< \ru Параметр конца ребра. \en The edge end parameter.
|
||||
bool sense; ///< \ru Признак совпадения направления с кривой. \en Flag of coincidence of direction with the curve.
|
||||
uint type; ///< \ru Тип кривой. \en Curve type.
|
||||
MpVertex * begVertex; ///< \ru Вершина-начало. \en The start vertex.
|
||||
MpVertex * endVertex; ///< \ru Вершина-конец. \en The end vertex.
|
||||
|
||||
public:
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по кривой.\n
|
||||
\en Constructor by curve.\n \~
|
||||
\param[in] c - \ru Базовая кривая.
|
||||
\en Base curve. \~
|
||||
\param[in] t1 - \ru Начальный параметр ребра.
|
||||
\en The edge start parameter. \~
|
||||
\param[in] t2 - \ru Конечный параметр ребра.
|
||||
\en The edge end parameter. \~
|
||||
\param[in] s - \ru Признак совпадения направления с кривой.
|
||||
\en Flag of coincidence of direction and the curve. \~
|
||||
*/
|
||||
MpEdge( const MbCurve * c, double t1, double t2, bool s );
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по кривой.\n
|
||||
\en Constructor by curve.\n \~
|
||||
\param[in] c - \ru Базовая кривая.
|
||||
\en Base curve. \~
|
||||
\param[in] s - \ru Признак совпадения направления с кривой.
|
||||
\en Flag of coincidence of direction and the curve. \~
|
||||
*/
|
||||
MpEdge( const MbCurve * c, bool s );
|
||||
|
||||
/// \ru Копирующий конструктор. \en Copy-constructor.
|
||||
MpEdge( const MpEdge & );
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор ребра с нулевой базовой кривой.\n
|
||||
\en Constructor of edge with null base curve.\n \~
|
||||
\param[in] t1 - \ru Начальный параметр ребра.
|
||||
\en The edge start parameter. \~
|
||||
\param[in] t2 - \ru Конечный параметр ребра.
|
||||
\en The edge end parameter. \~
|
||||
\param[in] s - \ru Признак совпадения направления с кривой.
|
||||
\en Flag of coincidence of direction and the curve. \~
|
||||
\param[in] n - \ru Имя базовой кривой.
|
||||
\en The base curve name. \~
|
||||
\param[in] t - \ru Тип кривой.
|
||||
\en A curve type. \~
|
||||
*/
|
||||
MpEdge( double t1, double t2, bool s, ptrdiff_t n, uint t );
|
||||
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MpEdge();
|
||||
|
||||
/**\ru \name Функции доступа к данным.
|
||||
\en \name Functions for access to data.
|
||||
\{ */
|
||||
/// \ru Выдать кривую, по которой проходит ребро. \en Get the curve the edge passes through.
|
||||
const MbCurve * GetCurve() const { return baseCurve; }
|
||||
/// \ru Имя базовой кривой. \en The base curve name.
|
||||
ptrdiff_t GetName() const { return name; }
|
||||
/// \ru Выдать направление по отношению к кривой. \en Get the direction relative to the curve.
|
||||
bool GetSense() const { return sense; }
|
||||
/// \ru Выдать вершину-начало. \en Get the start vertex.
|
||||
MpVertex * GetBegVertex() const { return begVertex; }
|
||||
/// \ru Выдать вершину-конец. \en Get the end vertex.
|
||||
MpVertex * GetEndVertex() const { return endVertex; }
|
||||
/// \ru Начальный параметр. \en Get the start parameter.
|
||||
double GetTBeg() const { return tBeg; }
|
||||
/// \ru Конечный параметр. \en End parameter.
|
||||
double GetTEnd() const { return tEnd; }
|
||||
|
||||
/// \ru Выдать декартову точку вершины-начала. \en Get the Cartesian point of the start vertex.
|
||||
void GetBegPoint( MbCartPoint & cp ) const;
|
||||
/// \ru Выдать декартову точку вершины-конца. \en Get the Cartesian point of the end vertex.
|
||||
void GetEndPoint( MbCartPoint & cp ) const;
|
||||
/// \ru Выдать касательный вектор в начальной вершине. \en Get the tangent vector at the start point.
|
||||
void GetBegTangent( MbDirection & tan ) const;
|
||||
/// \ru Выдать касательный вектор в конечной вершине. \en Get the tangent vector at the end vertex.
|
||||
void GetEndTangent( MbDirection & tan ) const;
|
||||
/// \ru Выдать кривизну в начальной вершине. \en Get the curvature at the start point.
|
||||
double GetBegCurvature() const;
|
||||
/// \ru Выдать кривизну в конечной вершине. \en Get the curvature at the end point.
|
||||
double GetEndCurvature() const;
|
||||
/** \} */
|
||||
/**\ru \name Функции изменения данных.
|
||||
\en \name Functions for changing data.
|
||||
\{ */
|
||||
/// \ru Установить имя базовой кривой. \en Set name of the base curve.
|
||||
void SetName( ptrdiff_t n ) { name = n; }
|
||||
/// \ru Установить направление по отношению к кривой. \en Set the direction relative to the curve.
|
||||
void SetSense( bool s ) { sense = s; }
|
||||
/// \ru Установить вершину-начало. \en Set the start vertex.
|
||||
void SetBegVertex( MpVertex * vert ) { begVertex = vert; }
|
||||
/// \ru Установить вершину-конец. \en Set the end vertex.
|
||||
void SetEndVertex( MpVertex * vert ) { endVertex = vert; }
|
||||
/// \ru Установить начальный параметр. \en Set the start parameter.
|
||||
void SetTBeg( double t ) { tBeg = t; }
|
||||
/// \ru Установить конечный параметр. \en Set the end parameter.
|
||||
void SetTEnd( double t ) { tEnd = t; }
|
||||
|
||||
/// \ru Изменить ориентацию. \en Change the orientation.
|
||||
void Reverse();
|
||||
/// \ru Создать кривую. \en Create a curve.
|
||||
MbCurve * MakeCurve() const;
|
||||
/** \} */
|
||||
/**\ru \name Операции преобразования.
|
||||
\en \name Transformation operations.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Преобразовать.
|
||||
\en Transform. \~
|
||||
\details \ru Преобразовать в соответствии с матрицей.\n
|
||||
\en Transform according to the matrix.\n \~
|
||||
\param[in] matr - \ru Матрица трансформации.
|
||||
\en Transformation matrix. \~
|
||||
*/
|
||||
void Transform( const MbMatrix & matr );
|
||||
|
||||
/** \brief \ru Переместить.
|
||||
\en Move. \~
|
||||
\details \ru Переместить на вектор.\n
|
||||
\en Move by a vector.\n \~
|
||||
\param[in] to - \ru Вектор перемещения.
|
||||
\en Movement vector. \~
|
||||
*/
|
||||
void Move( const MbVector & to );
|
||||
|
||||
/** \brief \ru Повернуть.
|
||||
\en Rotate. \~
|
||||
\details \ru Повернуть на угол вокруг точки.\n
|
||||
\en Rotate at angle around a point.\n \~
|
||||
\param[in] pnt - \ru Точка - центр поворота.
|
||||
\en A point is a rotation center. \~
|
||||
\param[in] angle - \ru Двумерный нормализованный вектор, задающий угол вращения.
|
||||
\en A two-dimensional normalized vector determining the rotation angle. \~
|
||||
*/
|
||||
void Rotate( const MbCartPoint & pnt, const MbDirection & angle );
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
void operator = ( const MpEdge & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL ( MpEdge )
|
||||
}; // MpEdge
|
||||
|
||||
IMPL_PERSISTENT_OPS( MpEdge )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Цикл.
|
||||
\en Loop. \~
|
||||
\details \ru Цикл. Набор ребер.\n
|
||||
\en Loop. Set of edges.\n \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MpLoop : public TapeBase {
|
||||
public :
|
||||
PArray<MpEdge> edgeList; ///< \ru Список ребер. \en List of edges.
|
||||
bool orientation; ///< \ru Ориентация цикла. \en Loop orientation.
|
||||
int mode; ///< \ru Направление построения. \en Construction direction.
|
||||
|
||||
public:
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по ребру и направлению построения.\n
|
||||
\en Constructor by edge and the direction of construction.\n \~
|
||||
\param[in] initEdge - \ru Ребро.
|
||||
\en Edge. \~
|
||||
\param[in] m - \ru Направление построения цикла:
|
||||
если m > 0 - цикл строится против часовой стрелки,
|
||||
если m < 0 - по часовой стрелке.
|
||||
\en Direction of loop construction:
|
||||
if m > 0 - the loop is constructed counterclockwise,
|
||||
if m < 0 - clockwise. \~
|
||||
*/
|
||||
MpLoop( MpEdge * initEdge, int m );
|
||||
|
||||
/// \ru Копирующий конструктор. \en Copy-constructor.
|
||||
MpLoop( const MpLoop & );
|
||||
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MpLoop();
|
||||
|
||||
/**\ru \name Функции доступа к данным.
|
||||
\en \name Functions for access to data.
|
||||
\{ */
|
||||
|
||||
/// \ru Количество ребер. \en Count of edges.
|
||||
ptrdiff_t GetEdgesCount() const { return edgeList.Count(); }
|
||||
|
||||
/** \brief \ru Ребро по индексу.
|
||||
\en Edge by index. \~
|
||||
\details \ru Ребро по его индексу. Без проверки корректности индекса.\n
|
||||
\en Edge by its index. Without check for index correctness.\n \~
|
||||
\param[in] index - \ru Индекс ребра.
|
||||
\en An edge index. \~
|
||||
*/
|
||||
MpEdge * GetEdge( ptrdiff_t index ) const { return edgeList[index]; }
|
||||
/// \ru Выдать последнее ребро. \en Get the last edge.
|
||||
MpEdge * GetEdge() const;
|
||||
|
||||
/// \ru Дать ориентацию. \en Get the orientation.
|
||||
bool GetOrientation() const { return orientation; }
|
||||
/// \ru Направление построения. \en Construction direction.
|
||||
int GetMode() const { return mode; }
|
||||
/// \ru Выдать массив вершин. \en Get vertex array.
|
||||
void GetVerticesArray( RPArray<MpVertex> & vertices ) const;
|
||||
/// \ru Выдать массив кривых. \en Get curve array.
|
||||
void GetCurvesArray ( RPArray<const MbCurve> & curves ) const;
|
||||
/// \ru Выдать массив кривых. \en Get curve array.
|
||||
void SetCurvesArray ( RPArray<MbCurve> & curves );
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Функции изменения данных.
|
||||
\en \name Functions for changing data.
|
||||
\{ */
|
||||
|
||||
/// \ru Добавить ребро. \en Add an edge.
|
||||
void AddEdge( MpEdge * edge ) { edgeList.Add(edge); }
|
||||
/// \ru Удалить последнее ребро. \en Delete the last edge.
|
||||
void DeleteEdge();
|
||||
|
||||
/** \brief \ru Удалить ребро по индексу.
|
||||
\en Delete an edge by index. \~
|
||||
\details \ru Удалить ребро по его индексу. Без проверки корректности индекса.\n
|
||||
\en Delete an edge by its index. Without check for index correctness.\n \~
|
||||
\param[in] index - \ru Индекс ребра.
|
||||
\en An edge index. \~
|
||||
*/
|
||||
void DeleteEdge( ptrdiff_t index ) { edgeList.RemoveInd(index); }
|
||||
|
||||
/// \ru Установить ориентацию. \en Set the orientation.
|
||||
void SetOrientation( bool s ) { orientation = s; }
|
||||
|
||||
/** \brief \ru Установить направление обхода.
|
||||
\en Set the traverse direction. \~
|
||||
\details \ru Установить направление обхода цикла.\n
|
||||
\en Set the direction of traversal of the loop.\n \~
|
||||
\param[in] m - \ru Направление обхода.\n
|
||||
Имеет значение знак числа m:\n
|
||||
если m > 0, то обход против часовой стрелки,\n
|
||||
если m < 0, то по часовой стрелки.
|
||||
\en The traversal direction.\n
|
||||
Has a value of sign of number m:\n
|
||||
if m > 0, then traversal is counterclockwise,\n
|
||||
if m < 0, then it is clockwise. \~
|
||||
*/
|
||||
void SetMode( int m ) { mode=m; }
|
||||
|
||||
/// \ru Изменить ориентацию ребра. \en Change the edge orientation.
|
||||
void Reverse() { orientation = !orientation; }
|
||||
/// \ru Построить вершины. \en Construct vertices.
|
||||
void CreateVertices();
|
||||
/// \ru Создать контур по циклу. \en Create a contour by the loop.
|
||||
MbContour * MakeContour() const;
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Операции преобразования.
|
||||
\en \name Transformation operations.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Преобразование.
|
||||
\en Transformation. \~
|
||||
\details \ru Преобразование в соответствии с матрицей.\n
|
||||
\en Transform according to matrix.\n \~
|
||||
\param[in] matr - \ru Матрица трансформации.
|
||||
\en Transformation matrix. \~
|
||||
*/
|
||||
void Transform( const MbMatrix & matr );
|
||||
|
||||
/** \brief \ru Переместить.
|
||||
\en Move. \~
|
||||
\details \ru Переместить на вектор.\n
|
||||
\en Move by a vector.\n \~
|
||||
\param[in] to - \ru Вектор перемещения.
|
||||
\en Movement vector. \~
|
||||
*/
|
||||
void Move( const MbVector & to );
|
||||
|
||||
/** \brief \ru Повернуть.
|
||||
\en Rotate. \~
|
||||
\details \ru Повернуть на угол вокруг точки.\n
|
||||
\en Rotate at angle around a point.\n \~
|
||||
\param[in] pnt - \ru Точка - центр поворота.
|
||||
\en A point is a rotation center. \~
|
||||
\param[in] angle - \ru Двумерный нормализованный вектор, задающий угол вращения.
|
||||
\en A two-dimensional normalized vector determining the rotation angle. \~
|
||||
*/
|
||||
void Rotate( const MbCartPoint & pnt, const MbDirection & angle );
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
void operator = ( const MpLoop & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL ( MpLoop )
|
||||
}; // Loop
|
||||
|
||||
IMPL_PERSISTENT_OPS( MpLoop )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Граф построения контуров.
|
||||
\en Contours construction graph. \~
|
||||
\details \ru Граф построения контуров.\n
|
||||
Содержит список границ - циклов.
|
||||
\en Contours construction graph.\n
|
||||
Contains list of boundaries - loops. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MpGraph : public TapeBase {
|
||||
public :
|
||||
PArray<MpLoop> loops; ///< \ru Список границ. \en List of boundaries.
|
||||
int mode; ///< \ru Направление обхода. \en Traversal direction.
|
||||
ptrdiff_t nameCount; ///< \ru Количество имен ребер. \en Edge names count.
|
||||
PArray<MpEdge> unusedEdges; ///< \ru Список ребер. \en List of edges.
|
||||
|
||||
private:
|
||||
VERSION version; ///< \ru Версия чтения. // BUG_57224 \en Read version. // BUG_57224
|
||||
|
||||
public:
|
||||
MpGraph(); ///< \ru Конструктор. \en Constructor.
|
||||
MpGraph( MpLoop * init ); ///< \ru Конструктор по циклу. \en Constructor by loop.
|
||||
MpGraph( RPArray<MpLoop> & init ); ///< \ru Конструктор по набору циклов. \en Constructor by a set of loops.
|
||||
MpGraph( const MpGraph & ); ///< \ru Копирующий конструктор. \en Copy-constructor.
|
||||
virtual ~MpGraph(); ///< \ru Деструктор. \en Destructor.
|
||||
|
||||
/**\ru \name Функции доступа к данным.
|
||||
\en \name Functions for access to data.
|
||||
\{ */
|
||||
|
||||
/// \ru Количество границ. \en Count of boundaries.
|
||||
size_t GetLoopsCount() const { return loops.Count(); }
|
||||
|
||||
/** \brief \ru Цикл по индексу.
|
||||
\en Loop by index. \~
|
||||
\details \ru Цикл по индексу без проверки индекса.\n
|
||||
\en Loop by index without check of index.\n \~
|
||||
\param[in] index - \ru Индекс цикла.
|
||||
\en The loop index. \~
|
||||
*/
|
||||
MpLoop * GetLoop( size_t index ) const { return loops[index]; }
|
||||
|
||||
/// \ru Направление обхода. \en Traversal direction.
|
||||
int GetMode() const { return mode; }
|
||||
|
||||
/** \brief \ru Выдать точку.
|
||||
\en Get the point. \~
|
||||
\details \ru Выдать точку для сборки графа.\n
|
||||
\en Get the point for graph building.\n \~
|
||||
\param[in] curveList - \ru Набор кривых (без совпадений) для создания графа.
|
||||
\en A set of curves (without coincidences) for creating the graph. \~
|
||||
\param[in] cross - \ru Набор точек пересечения кривых из curveList.
|
||||
\en Set of intersection points of curves from curveList. \~
|
||||
\param[out] p - \ru Результат - двумерная точка.
|
||||
\en The result is a two-dimensional point. \~
|
||||
*/
|
||||
bool GetPointIn( const RPArray<MbCurve> & curveList, SArray<MbCrossPoint> & cross, MbCartPoint & p,
|
||||
double epsilon = Math::LengthEps*c3d::METRIC_DELTA ) const;
|
||||
|
||||
/** \brief \ru Выдать использованные кривые.
|
||||
\en Get used curves. \~
|
||||
\details \ru Выдать использованные кривые и переименовать в соответствии с последними.\n
|
||||
\en Get used curves and rename in compliance with the last ones.\n \~
|
||||
\param[in] curveList - \ru Набор кривых.
|
||||
\en Set of curves. \~
|
||||
\param[out] usedCurves - \ru Результат - использованные кривые.
|
||||
\en The result are the used curves. \~
|
||||
*/
|
||||
void GetUsedCurves( const RPArray<MbCurve> & curveList, RPArray<MbCurve> & usedCurves );
|
||||
|
||||
/** \brief \ru Ориентация цикла по индексу.
|
||||
\en The orientation of a loop by its index. \~
|
||||
\details \ru Ориентация цикла по индексу без проверки индекса.\n
|
||||
\en The orientation of loop by its index without check of index.\n \~
|
||||
\param[in] i - \ru Индекс цикла.
|
||||
\en The loop index. \~
|
||||
\return \ru Ориентацию цикла.
|
||||
\en The loop orientation. \~
|
||||
*/
|
||||
bool GetLoopOrientation( size_t i ) const { return loops[i]->orientation; }
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Функции изменения данных.
|
||||
\en \name Functions for changing data.
|
||||
\{ */
|
||||
|
||||
/// \ru Добавить новую границу грани. \en Add a new boundary of the face.
|
||||
void AddLoop( MpLoop * newLoop );
|
||||
/// \ru Добавить новую границу грани в начало списка границ. \en Add a new boundary of the face to the beginning of face list.
|
||||
void InsertLoop( MpLoop * newLoop );
|
||||
/// \ru Установить направление обхода. \en Set the traverse direction.
|
||||
void SetMode( int m ) { mode = m; }
|
||||
/// \ru Выдать контуры циклов. \en Get loops' contours.
|
||||
void MakeContours( RPArray<MbContour> & contours ) const;
|
||||
|
||||
/** \brief \ru Запомнить неиспользованные ребра.
|
||||
\en Store unused edges. \~
|
||||
\details \ru Запомнить неиспользованные ребра, установив им имена.\n
|
||||
\en Store unused edges giving names for them.\n \~
|
||||
\param[in] curveList - \ru Список неиспользованных кривых для установки имен.
|
||||
\en The list of unused curves for setting the names. \~
|
||||
\param[in] g - \ru Граф для поиска неиспользованных ребер.\n
|
||||
Если в нем или в его массиве неиспользованных ребер
|
||||
нашлось ребро с только что установленным именем,
|
||||
то оно запоминается в массиве неиспользованных ребер unusedEdges.\n
|
||||
\en Graph for searching unused edges.\n
|
||||
If there is an edge with a name just specified
|
||||
in the graph or its array of unused edges,
|
||||
then it is stored in the array of unused edges unusedEdges.\n \~
|
||||
*/
|
||||
void SetAllName( const RPArray<MbCurve> & curveList, MpGraph * g );
|
||||
|
||||
/** \brief \ru Дать имена ребрам.
|
||||
\en Give names to edges. \~
|
||||
\details \ru Дать имена ребрам по списку кривых.\n
|
||||
\en Give names to edges by the list of curves.\n \~
|
||||
\param[in] curveList - \ru Список кривых для именования.
|
||||
\en The list of curves for naming. \~
|
||||
*/
|
||||
void SetEdgeName( const RPArray<MbCurve> & curveList );
|
||||
|
||||
/** \brief \ru Определить ориентацию контуров.
|
||||
\en Determine the contours' orientation. \~
|
||||
\details \ru Определить ориентацию контуров по их вложенности.\n
|
||||
\en Determine the contours' orientation by its inclusion.\n \~
|
||||
\param[in] contourArray - \ru Список контуров, по которым строился граф.
|
||||
\en List of contours the graph is built for. \~
|
||||
*/
|
||||
void SetLoopsOrientation( const RPArray<MbContour> & contourArray );
|
||||
|
||||
/** \brief \ru Перевести параметры ребер в параметры кривых.
|
||||
\en Convert edges' parameters to curves' parameters. \~
|
||||
\details \ru Перевести параметры ребер в параметры кривых,
|
||||
если кривые ребер нашлись в списках.\n
|
||||
\en Convert parameters of edges to parameters of curves
|
||||
if edges' curves are found in lists.\n \~
|
||||
\param[in] unchangeCurve - \ru Список имен кривых для изменения.
|
||||
\en List of curves' names for modification. \~
|
||||
\param[in] changeCurve - \ru Список имен кривых для изменения.
|
||||
\en List of curves' names for modification. \~
|
||||
\param[in] curveList - \ru Список кривых для изменения параметризации.
|
||||
\en List of curves for modification of parametrization. \~
|
||||
\warning \ru Для внутреннего использования.
|
||||
\en For internal use only. \~
|
||||
*/
|
||||
// \ru Изменяется параметризация только у отрезков. \en Parametrization can be modified for line segments only.
|
||||
// \ru Специально для исправления ошибки BUG_57224 \en Especially to fix BUG_57224
|
||||
void ConvertEdgesParams( const SArray<ptrdiff_t> & unchangeCurve, const SArray<ptrdiff_t> & changeCurve,
|
||||
const RPArray<MbCurve> & curveList ) const;
|
||||
|
||||
/** \} */
|
||||
/**\ru \name Операции преобразования.
|
||||
\en \name Transformation operations.
|
||||
\{ */
|
||||
|
||||
/** \brief \ru Преобразование.
|
||||
\en Transformation. \~
|
||||
\details \ru Преобразование в соответствии с матрицей.\n
|
||||
\en Transformation according to the matrix.\n \~
|
||||
\param[in] matr - \ru Матрица трансформации.
|
||||
\en Transformation matrix. \~
|
||||
*/
|
||||
void Transform( const MbMatrix & matr );
|
||||
|
||||
/** \brief \ru Переместить.
|
||||
\en Move. \~
|
||||
\details \ru Переместить на вектор.\n
|
||||
\en Move by a vector.\n \~
|
||||
\param[in] to - \ru Вектор перемещения.
|
||||
\en Movement vector. \~
|
||||
*/
|
||||
void Move( const MbVector & to );
|
||||
|
||||
/** \brief \ru Повернуть.
|
||||
\en Rotate. \~
|
||||
\details \ru Повернуть на угол вокруг точки.\n
|
||||
\en Rotate at angle around a point.\n \~
|
||||
\param[in] pnt - \ru Точка - центр поворота.
|
||||
\en A point is a rotation center. \~
|
||||
\param[in] angle - \ru Двумерный нормализованный вектор, задающий угол вращения.
|
||||
\en A two-dimensional normalized vector determining the rotation angle. \~
|
||||
*/
|
||||
void Rotate( const MbCartPoint & pnt, const MbDirection & angle );
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
|
||||
/** \brief \ru Направление обхода цикла.
|
||||
\en Loop traversal direction. \~
|
||||
\details \ru Направление обхода цикла, которому принадлежит вершина.\n
|
||||
\en Traversal direction of the loop the vertex belongs to.\n \~
|
||||
\param[in] vert - \ru Вершина для поиска цикла.
|
||||
\en The vertex for searching the loop. \~
|
||||
\return \ru Направление обхода.\n
|
||||
Важен знак числа:\n
|
||||
если > 0 - против часовой стрелки,\n
|
||||
если < 0 - по часовой стрелке.
|
||||
\en The traversal direction.\n
|
||||
Sign of the number is significant:\n
|
||||
if > 0 - counterclockwise,\n
|
||||
if < 0 - clockwise. \~
|
||||
*/
|
||||
int GetLoopMode( MpVertex * vert ) const;
|
||||
|
||||
/** \brief \ru Выдать массив вершин.
|
||||
\en Get vertex array. \~
|
||||
\details \ru Выдать массив вершин всех циклов графа.\n
|
||||
\en Get vertex array of all the loops of the graph.\n \~
|
||||
\param[out] vertices - \ru Результат - массив вершин.
|
||||
\en The result is a vertex array. \~
|
||||
*/
|
||||
void GetVerticesArray( RPArray<MpVertex> & vertices ) const;
|
||||
|
||||
/// \ru Количество имен ребер. \en The count of edges' names.
|
||||
ptrdiff_t GetNameCount() const { return nameCount; }
|
||||
|
||||
/** \brief \ru Выдать имена ребер.
|
||||
\en Get edges' names. \~
|
||||
\details \ru Выдать имена ребер всех циклов графа.\n
|
||||
Имена складываются в массив без повторений, сортированные по возрастанию.
|
||||
\en Get names of edges of all the loops of the graph.\n
|
||||
Names are put to the array without duplications, sorted in the ascending order. \~
|
||||
\param[out] curveName - \ru Результат - массив имен.
|
||||
\en The result is the array of names. \~
|
||||
*/
|
||||
void GetEdgeName( SArray<ptrdiff_t> & curveName ) const;
|
||||
|
||||
/** \brief \ru Ориентация ребра.
|
||||
\en Edge orientation. \~
|
||||
\details \ru Ориентация ребра по его имени с учетом направления цикла.\n
|
||||
\en Edge orientation by its name subject to the loop direction.\n \~
|
||||
\param[in] n0 - \ru Имя ребра.
|
||||
\en The edge name. \~
|
||||
\param[out] s - \ru Ориентация ребра.
|
||||
\en Edge orientation. \~
|
||||
\return \ru true, если нашли нужное ребро.
|
||||
\en True if the required edge is found. \~
|
||||
*/
|
||||
bool GetCurveData( ptrdiff_t n0, int & s ) const;
|
||||
|
||||
/** \brief \ru Ориентация ребра.
|
||||
\en Edge orientation. \~
|
||||
\details \ru Ориентация ребра по его имени без учета направления цикла.\n
|
||||
\en Edge orientation by its name without taking the loop direction into account.\n \~
|
||||
\param[in] n0 - \ru Имя ребра.
|
||||
\en The edge name. \~
|
||||
\param[out] s - \ru Ориентация ребра.
|
||||
\en Edge orientation. \~
|
||||
\return \ru true, если нашли нужное ребро.
|
||||
\en True if the required edge is found. \~
|
||||
*/
|
||||
bool GetOldData ( ptrdiff_t n0, int & s ) const;
|
||||
|
||||
/** \brief \ru Выдать точку.
|
||||
\en Get the point. \~
|
||||
\details \ru Выдать точку для сборки графа.\n
|
||||
\en Get the point for graph building.\n \~
|
||||
\param[in] vertex - \ru Начальная вершина ребра, которому соответствует кривая curve.
|
||||
\en The start vertex of the edge the curve 'curve' corresponds to. \~
|
||||
\param[in] curve - \ru Кривая для расчета точки.
|
||||
\en The curve for point calculation. \~
|
||||
\param[in] t - \ru Параметр на кривой.
|
||||
\en A parameter on the curve. \~
|
||||
\param[out] p - \ru Результат - двумерная точка.
|
||||
\en The result is a two-dimensional point. \~
|
||||
*/
|
||||
void GetPoint( MpVertex * vertex, MbCurve * curve, double t, MbCartPoint & p ) const;
|
||||
|
||||
void CurvesSort( const RPArray<MbCurve> & curveList, SArray<ptrdiff_t> & unchangeCurve, SArray<ptrdiff_t> & changeCurve ) const;
|
||||
|
||||
private:
|
||||
void operator = ( const MpGraph & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL ( MpGraph )
|
||||
}; // MpGraph
|
||||
|
||||
IMPL_PERSISTENT_OPS( MpGraph )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить вершину.
|
||||
\en Delete a vertex. \~
|
||||
\details \ru Удалить вершину и обнулить указатель.\n
|
||||
\en Delete a vertex and set the pointer to null.\n \~
|
||||
\param[in, out] vertex - \ru Вершина для удаления.
|
||||
\en A vertex to delete. \~
|
||||
*/ // ---
|
||||
inline void DeleteVertex( MpVertex *& vertex ) {
|
||||
delete vertex;
|
||||
vertex = NULL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить ребро.
|
||||
\en Delete an edge. \~
|
||||
\details \ru Удалить ребро и обнулить указатель.\n
|
||||
\en Delete an edge and set the pointer to null.\n \~
|
||||
\param[in, out] edge - \ru Ребро для удаления.
|
||||
\en An edge to delete. \~
|
||||
*/ // ---
|
||||
inline void DeleteEdge( MpEdge *& edge ) {
|
||||
delete edge;
|
||||
edge = NULL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить цикл.
|
||||
\en Delete a loop. \~
|
||||
\details \ru Удалить цикл и обнулить указатель.\n
|
||||
\en Delete a loop and set the pointer to null.\n \~
|
||||
\param[in, out] loop - \ru Цикл для удаления.
|
||||
\en A loop to delete. \~
|
||||
*/ // ---
|
||||
inline void DeleteLoop( MpLoop *& loop ) {
|
||||
delete loop;
|
||||
loop = NULL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удалить граф.
|
||||
\en Delete a graph. \~
|
||||
\details \ru Удалить граф и обнулить указатель.\n
|
||||
\en Delete a graph and set the pointer to null.\n \~
|
||||
\param[in, out] graph - \ru Граф для удаления.
|
||||
\en A graph to delete. \~
|
||||
*/ // ---
|
||||
inline void DeleteGraph( MpGraph *& graph ) {
|
||||
delete graph;
|
||||
graph = NULL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Устранить разрывы в контуре.
|
||||
\en Remove contour gaps. \~
|
||||
\details \ru Устранить разрывы в контуре.
|
||||
\en Remove contour gaps. \~
|
||||
\param[in] contour - \ru Контур.
|
||||
\en A contour. \~
|
||||
\param[in] accuracy - \ru Ограничение по размеру разрыва (для вставки сегмента и поиска пересечения соседей.
|
||||
\en Upper gap size. \~
|
||||
\param[in] canInsert - \ru Можно ли вставлять сегменты.
|
||||
\en Allow insert segments. \~
|
||||
\param[in] canReplace - \ru Можно ли заменять сегменты.
|
||||
\en Allow replace segments. \~
|
||||
\return \ru true, если контур изменился.
|
||||
\en true, if something have changed. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) RemoveContourGaps( MbContour & contour, // контур
|
||||
double accuracy, // размер разрывов
|
||||
bool canInsert, // разрешение на вставку сегментов
|
||||
bool canReplace ); // разрешение на подмену сегментов
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить контуры вокруг заданной точки.
|
||||
\en Create contours around the given point. \~
|
||||
\details \ru Построить контуры вокруг заданной точки.
|
||||
Строится один внешний и несколько внутренних контуров с одним уровнем вложенности.
|
||||
На вход не должны приходить составные кривые (контуры и ломаные).
|
||||
\en Create contours around the given point.
|
||||
One outer and several inner loops are constructed with single nesting level.
|
||||
Do not send composite curves (contours and polygons). Lay them on the components. \~
|
||||
\param[in] curveList - \ru Список кривых для построения.
|
||||
\en List of curves for construction. \~
|
||||
\param[in] p - \ru Точка, вокруг которой строятся контуры.
|
||||
\en A point the contours are constructed around. \~
|
||||
\param[out] usedCurves - \ru Использованные кривые.
|
||||
\en Used curves. \~
|
||||
\param[out] contourArray - \ru Результат построения - набор контуров.
|
||||
\en The result of construction is a set of contours. \~
|
||||
\param[in] accuracy - \ru Погрешность определения пересечения и близости кривых.
|
||||
\en The accuracy of determining the intersection of curves and proximity. \~
|
||||
\param[in] strict - \ru Если false, сборка производится с загрубленной точностью.
|
||||
\en If false, the construction is performed roughly. \~
|
||||
\param[in] version - \ru Версия построения. Последняя версия Math::DefaultMathVersion().
|
||||
\en The version of construction. The last version Math::DefaultMathVersion(). \~
|
||||
\param[in] progInd - \ru Индикатора прогресса выполнения.
|
||||
\en Execution progress indicator. \~
|
||||
\return \ru Граф построения контуров.
|
||||
\en Contours construction graph. \~
|
||||
\warning \ru При использовании функций EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor
|
||||
состояние флага strict и версия version должно использоваться одно в одном процессе обработки.
|
||||
\en While using functions EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor,
|
||||
a single state of 'strict' flag and version must be used in one treatment process. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MpGraph *) EncloseContoursBuilder( const RPArray<MbCurve> & curveList,
|
||||
const MbCartPoint & p,
|
||||
PArray<MbCurve> & usedCurves,
|
||||
PArray<MbContour> & contourArray,
|
||||
double accuracy,
|
||||
bool strict,
|
||||
VERSION version,
|
||||
IProgressIndicator * progInd = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить объемлющие контуры на основе заданных кривых.
|
||||
\en Construct enclosing contours on the basis of the given curves. \~
|
||||
\details \ru Построить объемлющие контуры на основе заданных кривых.
|
||||
Строятся внешние и внутренние контуры с произвольным уровнем вложенности.
|
||||
На вход не должны приходить составные кривые (контуры и ломаные).
|
||||
\en Construct enclosing contours on the basis of the given curves.
|
||||
Outer and inner loops are constructed with an arbitrary level of inclusion.
|
||||
Do not send composite curves (contours and polygons). Lay them on the components. \~
|
||||
\param[in] curveList - \ru Список кривых для построения.
|
||||
\en List of curves for construction. \~
|
||||
\param[out] contourArray - \ru Результат построения - набор контуров.
|
||||
\en The result of construction is a set of contours. \~
|
||||
\param[in] accuracy - \ru Погрешность определения пересечения и близости кривых.
|
||||
\en The accuracy of determining the intersection of curves and proximity. \~
|
||||
\param[in] strict - \ru Если false, сборка производится с загрубленной точностью.
|
||||
\en If false, the construction is performed roughly. \~
|
||||
\param[in] version - \ru Версия построения. Последняя версия Math::DefaultMathVersion().
|
||||
\en The version of construction. The last version Math::DefaultMathVersion(). \~
|
||||
\param[in] progInd - \ru Индикатора прогресса выполнения.
|
||||
\en Execution progress indicator. \~
|
||||
\return \ru Граф построения контуров.
|
||||
\en Contours construction graph. \~
|
||||
\warning \ru При использовании функций EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor
|
||||
состояние флага strict и версия version должно использоваться одно в одном процессе обработки.
|
||||
\en While using functions EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor,
|
||||
a single state of 'strict' flag and version must be used in one treatment process. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MpGraph *) OuterContoursBuilder( const RPArray<MbCurve> & curveList,
|
||||
PArray<MbContour> & contourArray,
|
||||
double accuracy,
|
||||
bool strict,
|
||||
VERSION version,
|
||||
IProgressIndicator * progInd = NULL );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Перестроить контуры, построенные ранее вокруг точки.
|
||||
\en Reconstruct contours constructed around the point before. \~
|
||||
\details \ru Перестроить контуры, построенные ранее вокруг точки.
|
||||
Функция перестраивает граф, построенный функцией EncloseContoursBuilder.
|
||||
\en Reconstruct contours constructed around the point before.
|
||||
The function reconstructs the graph constructed by EncloseContoursBuilder function. \~
|
||||
\param[in] curveList - \ru Список кривых для построения.
|
||||
\en List of curves for construction. \~
|
||||
\param[in] graph - \ru Граф для перестроения.
|
||||
\en A graph to reconstruct. \~
|
||||
\param[out] contourArray - \ru Результат построения - набор контуров.
|
||||
\en The result of construction is a set of contours. \~
|
||||
\param[in] accuracy - \ru Погрешность определения пересечения и близости кривых.
|
||||
\en The accuracy of determining the intersection of curves and proximity. \~
|
||||
\param[in] strict - \ru Если false, сборка производится с загрубленной точностью.
|
||||
\en If false, the construction is performed roughly. \~
|
||||
\param[in] version - \ru Версия построения. Последняя версия Math::DefaultMathVersion().
|
||||
\en The version of construction. The last version Math::DefaultMathVersion(). \~
|
||||
\param[in] progInd - \ru Индикатора прогресса выполнения.
|
||||
\en Execution progress indicator. \~
|
||||
\return \ru Граф построения контуров.
|
||||
\en Contours construction graph. \~
|
||||
\warning \ru При использовании функций EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor
|
||||
состояние флага strict и версия version должно использоваться одно в одном процессе обработки.
|
||||
\en While using functions EncloseContoursBuilder, OuterContoursBuilder, ContoursReconstructor,
|
||||
a single state of 'strict' flag and version must be used in one treatment process. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MpGraph *) ContoursReconstructor( const RPArray<MbCurve> & curveList,
|
||||
MpGraph * graph,
|
||||
PArray<MbContour> & contourArray,
|
||||
double accuracy,
|
||||
bool strict,
|
||||
VERSION version,
|
||||
IProgressIndicator * progInd = NULL );
|
||||
|
||||
|
||||
#endif // __CONTOUR_GRAPH_H
|
||||
@@ -0,0 +1,845 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Объекты, используемые при импорте и экспорте аннотации и размеров.
|
||||
\en Objects used for import and export of annotation and dimensions \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_ANNOTATION_ITEM_H
|
||||
#define __CONV_ANNOTATION_ITEM_H
|
||||
|
||||
|
||||
#include <templ_dptr.h>
|
||||
#include <model_item.h>
|
||||
#include <mb_placement.h>
|
||||
#include <cur_line_segment3d.h>
|
||||
#include <cur_arc3d.h>
|
||||
#include <cur_polyline3d.h>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип элемента аннотации.
|
||||
\en Type of annotation element. \~
|
||||
*/
|
||||
// ---
|
||||
enum Mae_AnnotationType {
|
||||
nt_AnnotationItem, ///< \ru Аннотация без объектов привязки. \en Annotation without binding objects.
|
||||
nt_Dimension, ///< \ru Размер. \en Dimension
|
||||
nt_LinearDimension, ///< \ru Линейный размер. \en Linear dimension.
|
||||
nt_DiameterDimension, ///< \ru Диаметральный размер. \en Diameter dimension.
|
||||
nt_RadialDimension, ///< \ru Радиальный размер. \en Radial dimension.
|
||||
nt_AngularDimension, ///< \ru Угловой размер. \en Angular dimension.
|
||||
nt_Callout, ///< \ru Выноска. \en Callout.
|
||||
nt_Marking, ///< \ru Обозначение. \en Marking.
|
||||
nt_Datum, ///< \ru База. \en Datum.
|
||||
nt_Note, ///< \ru Примечание. \en Note.
|
||||
nt_Centreline, ///< \ru Осевая линия. \en Centreline.
|
||||
nt_FeatureControlFrame, ///< \ru Рамка управления характеристиками. \en Feature Control Frame.
|
||||
nt_ReferencePoint, ///< \ru Точка отсчета. \en Reference Point.
|
||||
nt_SurfaceRoughness, ///< \ru Шероховатость поверхности. \en Surface roughness.
|
||||
nt_ShapeTolerance ///< \ru Допуск формы.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип текстового объекта.
|
||||
\en Type of a text object. \~
|
||||
*/
|
||||
// ---
|
||||
enum MaeTextType {
|
||||
xt_CompositeText, ///< \ru Набор текстовых блоков. \en Set of text blocks.
|
||||
xt_TextLiteral, ///< \ru Текст с указанием ЛСК, шрифта, выравнивания. \en Text with specification of LCS, font, alignment.
|
||||
xt_TextLiteralExtent, ///< \ru Текст с указанием ЛСК, шрифта, выравнивания, геометрического размера. \en Text with specification of LCS, font, alignment, geometric dimension.
|
||||
xt_SpecificSymbol ///< \ru Спецсимвол. \en Specific symbol.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тэг, определяющий назначение текстового блока.
|
||||
\en Purpose tag of a text object. \~
|
||||
*/
|
||||
// ---
|
||||
enum MaeTextFormatTag {
|
||||
xft_Enumeration, ///< \ru Перечисление. \en Enumeration.
|
||||
xft_Paragraph, ///< \ru Параграф. \en Paragraph.
|
||||
// Тэги в следующей группе являются взаимосиключающими. Tags of the next group are mutually exclusive.
|
||||
xft_Ground, ///< \ru Положение текста на базовом уровне. \en Ground level text position.
|
||||
xft_Upper, ///< \ru Верхний индекс или числитель. \en Upper index or numerator.
|
||||
xft_Lower, ///< \ru Нижний индекс или знаменатель. \en Lower index or denominator.
|
||||
// Следующая группа тэгов уточняет смысл тэгов предыдущей группы. Next group of tags gives the exact meaning to the tags frem the previosu group.
|
||||
xft_Fraction, ///< \ru Дробь. \en Fraction.
|
||||
xft_Index, ///< \ru Наличие индекс. \en Indexed item.
|
||||
xft_OverUnder, ///< \ru Наличие надстрочного и подстрочного текста. \en Overline and underline text present.
|
||||
|
||||
xft_Undefined, ///< \ru Неопределённое значение тэга, не назначается. \en Undefined can be never assigned to items.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Направление текста.
|
||||
\en Text direction. \~
|
||||
*/
|
||||
// ---
|
||||
enum eTextPath {
|
||||
txp_Left, ///< \ru Налево. \en To the left.
|
||||
txp_Right,///< \ru Направо. \en To the right.
|
||||
txp_Up, ///< \ru Вверх. \en Upward.
|
||||
txp_Down ///< \ru Вниз. \en Downward.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Спецсимволы.
|
||||
\en Special symbols. \~
|
||||
*/
|
||||
enum MbeDefinedDimensionSymbol {
|
||||
dds_ArcLength, ///< \ru Длина дуги. \en The arc length.
|
||||
dds_ConicalTaper, ///< \ru Конусность. \en Conicity.
|
||||
dds_Counterbore, ///< \ru Зенковка. \en Counterbore.
|
||||
dds_Countersink, ///< \ru Циковка. \en Countersink.
|
||||
dds_Depth, ///< \ru Глубина. \en Depth.
|
||||
dds_Diameter, ///< \ru Диаметр. \en Diameter.
|
||||
dds_PlusMinus, ///< \ru Одинаковая двусторонняя погрешность. \en Equal double-sided tolerance.
|
||||
dds_Radius, ///< \ru Радиус. \en Radius.
|
||||
dds_Slope, ///< \ru Склон. \en Slope.
|
||||
dds_SphericalDiameter, ///< \ru Сферический диаметр. \en Spherical diameter.
|
||||
dds_SphericalRadius, ///< \ru Сферический радиус. \en Spherical radius.
|
||||
dds_Square, ///< \ru Квадрат. \en Square.
|
||||
dds_MetricThread, ///< \ru Метрическая резьба (при экспорте в STEP преобразуется в букву M). \en Metric thread ( in STEP it corresponds M letter ).
|
||||
|
||||
dds_SurfaceCondition, ///< \ru Шереховатость поверхности в нотации STEP (ISO 10303). \en Surface condition in STEP (ISO 10303) codes.
|
||||
dds_SurfaceCondition_010,
|
||||
dds_SurfaceCondition_020,
|
||||
dds_SurfaceCondition_030,
|
||||
dds_SurfaceCondition_040,
|
||||
dds_SurfaceCondition_050,
|
||||
dds_SurfaceCondition_060,
|
||||
dds_SurfaceCondition_070,
|
||||
|
||||
dds_SurfaceCondition_001,
|
||||
dds_SurfaceCondition_011,
|
||||
dds_SurfaceCondition_021,
|
||||
dds_SurfaceCondition_031,
|
||||
dds_SurfaceCondition_041,
|
||||
dds_SurfaceCondition_051,
|
||||
dds_SurfaceCondition_061,
|
||||
dds_SurfaceCondition_071,
|
||||
|
||||
dds_SurfaceCondition_100,
|
||||
dds_SurfaceCondition_110,
|
||||
dds_SurfaceCondition_120,
|
||||
dds_SurfaceCondition_130,
|
||||
dds_SurfaceCondition_140,
|
||||
dds_SurfaceCondition_150,
|
||||
dds_SurfaceCondition_160,
|
||||
dds_SurfaceCondition_170,
|
||||
|
||||
dds_SurfaceCondition_101,
|
||||
dds_SurfaceCondition_111,
|
||||
dds_SurfaceCondition_121,
|
||||
dds_SurfaceCondition_131,
|
||||
dds_SurfaceCondition_141,
|
||||
dds_SurfaceCondition_151,
|
||||
dds_SurfaceCondition_161,
|
||||
dds_SurfaceCondition_171,
|
||||
|
||||
dds_SurfaceCondition_200,
|
||||
dds_SurfaceCondition_210,
|
||||
dds_SurfaceCondition_220,
|
||||
dds_SurfaceCondition_230,
|
||||
dds_SurfaceCondition_240,
|
||||
dds_SurfaceCondition_250,
|
||||
dds_SurfaceCondition_260,
|
||||
dds_SurfaceCondition_270,
|
||||
|
||||
dds_SurfaceCondition_201,
|
||||
dds_SurfaceCondition_211,
|
||||
dds_SurfaceCondition_221,
|
||||
dds_SurfaceCondition_231,
|
||||
dds_SurfaceCondition_241,
|
||||
dds_SurfaceCondition_251,
|
||||
dds_SurfaceCondition_261,
|
||||
dds_SurfaceCondition_271,
|
||||
|
||||
dds_Angularity, ///< \ru Допуск наклона. \en Angularity.
|
||||
dds_CircularRunout, ///< \ru Допуск биения. \en Circular runout.
|
||||
dds_Circularity, ///< \ru Допуск круглости. \en Circularity.
|
||||
dds_Concentricity, ///< \ru Допуск соосности. \en Concentricity.
|
||||
dds_Cylindricity, ///< \ru Допуск цилиндричности. \en Cylindricity.
|
||||
dds_DiameterTol, ///< \ru Допуск диаметра. \en Diameter.
|
||||
dds_Flatness, ///< \ru Допуск плоскостности. \en Flatness.
|
||||
dds_LeastMaterialCondition, ///< \ru Требование минимума материала. \en Least material condition.
|
||||
dds_MaximumMaterialCondition, ///< \ru Требование максимума материала. \en Maximum material condition.
|
||||
dds_Parallelism, ///< \ru Допуск параллельности. \en Parallelism.
|
||||
dds_Perpendicularity, ///< \ru Допуск перпендикулярности. \en Perpendicularity.
|
||||
dds_Position, ///< \ru Позиционный допуск. \en Position.
|
||||
dds_LineProfile, ///< \ru Допуск формы заданного профиля. \en Line profile.
|
||||
dds_SurfaceProfile, ///< \ru Допуск формы заданной поверхности. \en Surface profile.
|
||||
dds_ProjectedToleranceZone, ///< \ru Выступающее поле допуска. \en ProejectedToleranceZone.
|
||||
dds_RegardlessOfFeatureSize, ///< \ru . \en .
|
||||
dds_Straightness, ///< \ru Допуск прямолинейности. \en Straightness.
|
||||
dds_Symmetry, ///< \ru Допуск симметричности. \en .Symmetry
|
||||
dds_TotlaRunout, ///< \ru Допуск полного радиального (либо торцевого) биения. \en TotlaRunout.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип законцовки.
|
||||
\en Type of tip. \~
|
||||
*/
|
||||
enum MbeDefinedTerminatorSymbol {
|
||||
dts_BlankedArrow, ///< \ru Незакрашенная стрелка. \en Blank arrow.
|
||||
dts_BlankedBox, ///< \ru Незакрашенный квадрат. \en Blank square.
|
||||
dts_BlankedDot, ///< \ru Незакрашенная точка. \en Blank point.
|
||||
dts_DimensionOrigin, ///< \ru Базовsq объект. \en Base object.
|
||||
dts_FilledArrow, ///< \ru Закрашенная стрелка. \en Filled arrow.
|
||||
dts_FilledBox, ///< \ru Закрашенный квадрат. \en Filled square.
|
||||
dts_FilledDot, ///< \ru Закрашенная точка. \en Filled point.
|
||||
dts_IntegralSymbol, ///< \ru Знак интеграла. \en Integral symbol.
|
||||
dts_OpenArrow, ///< \ru Открытая стрелка. \en Open arrow.
|
||||
dts_Slash, ///< \ru Косая черта. \en Slash.
|
||||
dts_UnfilledArrow ///< \ru Стрелка без заполнения. \en Unfilled arrow.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип кривой с терминаторами.
|
||||
\en Type of curve with terminators. \~
|
||||
*/
|
||||
enum MbeDecoratedCurveRole {
|
||||
dcr_ProjectionCurve, ///< \ru Проекционная кривая размера. \en Projection curve of dimension.
|
||||
dcr_DimensionCurve, ///< \ru Размерная кривая. \en Dimension curve.
|
||||
dcr_LeaderCurve, ///< \ru Линия выноски. \en Leader curve.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Текстовый объект.
|
||||
\en Text object. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaTextItem : public MbRefItem {
|
||||
protected:
|
||||
bool visibility; // \ru Признак видимости. \en Visibility.
|
||||
std::set<MaeTextFormatTag> purposeTags; // \ru Тэги форматирования. \en Gormat tags.
|
||||
public:
|
||||
|
||||
MaTextItem(); ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
|
||||
void SetVisibility( bool v ); ///< \ru Задать видимость; \en Set visibility.
|
||||
bool IsVisible() const; ///< \ru Получить видимость; \en Get visibility.
|
||||
|
||||
bool IsTag( MaeTextFormatTag tag ) const; ///< \ru Установлен ли тэг. \en Is a tag set.
|
||||
bool GetTagIfUnique( MaeTextFormatTag& tag ) const; ///< \ru получить тэг, если он единственный. \en Get the tag provided it id qnique.
|
||||
void SetTag( MaeTextFormatTag tag ); ///< \ru Установить тэг. \en Set a tag.
|
||||
void ResetTag( MaeTextFormatTag tag ); ///< \ru Сбросить тэг. \en reset a tag.
|
||||
bool TagUniqueOrUndefined() const; ///< \ru Назначено ли менее 2 тэгов. \en If less than two tags assinged.
|
||||
bool NoTag() const; ///< \ru Отсутствуют ли тэги. \en If threre are no tags.
|
||||
|
||||
virtual MaeTextType IsA() const = 0;
|
||||
virtual SPtr<MaTextItem> Duplicate() const = 0;
|
||||
virtual ~MaTextItem(); ///< \ru Деструктор. \en Destructor.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaTextItem )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Набор текстовых блоков.
|
||||
\en Set of text blocks. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaCompositeText : public MaTextItem {
|
||||
std::vector< SPtr<MaTextItem> > items; ///< \ru Текстовый блок. \en The text block.
|
||||
|
||||
public:
|
||||
|
||||
MaCompositeText(); ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
|
||||
std::vector< SPtr<MaTextItem> > GetItems() const; ///< \ru Получить элементы. \en Get elements.
|
||||
void SetItems( const std::vector< SPtr<MaTextItem> >& it ); ///< \ru Задать элементы. \en Set elements.
|
||||
void AddItem( MaTextItem* item ); ///< \ru Добавить элемент \en Add an element.
|
||||
size_t ItemsSize() const; ///< \ru Получить число элементов \en Get count of elements.
|
||||
MaTextItem* GetItem( size_t idx ); ///< \ru Получить элемент. \en Get element.
|
||||
const MaTextItem* GetItem( size_t idx ) const; ///< \ru Получить элемент. \en Get element.
|
||||
|
||||
virtual MaeTextType IsA() const; ///< \ru Выдать тип элемента. \en Get element type.
|
||||
virtual SPtr<MaTextItem> Duplicate() const;
|
||||
|
||||
/** \brief \ru Вставить объект перед всеми вхождениями указанного.
|
||||
\en Insert an object before all instances of the specified one. \~
|
||||
*/
|
||||
void InsertBefore( const SPtr<MaTextItem>& itemToInsert, const SPtr<const MaTextItem>& beforeThis );
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaCompositeText )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Текст с указанием ЛСК, шрифта, выравнивания.
|
||||
\en Text with specification of LCS, font, align. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaTextLiteral : public MaTextItem {
|
||||
protected:
|
||||
std::string text; ///< \ru Текст. \en A text.
|
||||
MbPlacement location; ///< \ru Положение в аннотационной плоскости \en Position in annotation plane
|
||||
std::string alignment; ///< \ru Выравнивание. \en Alignment.
|
||||
eTextPath path; ///< \ru Направление текста. \en Text direction.
|
||||
std::string font; ///< \ru Шрифт текста. \en Text font.
|
||||
bool isFontExternal; ///< \ru Является ли шрифт нестандартным. \en Is font non-standard.
|
||||
|
||||
public:
|
||||
|
||||
MaTextLiteral(); ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
|
||||
MbPlacement & SetLocation(); ///< \ru Получить положение с возможностью модификации. \en Get position with possibility of modification.
|
||||
const MbPlacement & GetLocation() const; ///< \ru Получить положение. \en Get position.
|
||||
eTextPath & SetPath(); ///< \ru Получить направление с возможностью модификации. \en Get direction with possibility of modification.
|
||||
eTextPath GetPath() const; ///< \ru Получить направление. \en Get direction.
|
||||
void SetFontExternal( bool value ); ///< \ru Задать признак нестандартного шрифта. \en Set the flag of external font.
|
||||
bool GetFontExternal() const; ///< \ru Получить признак нестандартного шрифта. \en Get the flag of external font.
|
||||
|
||||
void SetText( const std::string& ); ///< \ru Получить текст. \en Get text.
|
||||
void GetText( std::string& ) const; ///< \ru Задать текст. \en Set text.
|
||||
void SetAlignment( const std::string& ); ///< \ru Получить выравнивание. \en Get alignment.
|
||||
void GetAlignment( std::string& ) const; ///< \ru Задать выравнивание. \en Set alignment.
|
||||
void SetFont( const std::string& ); ///< \ru Получить шрифт. \en Get font.
|
||||
void GetFont( std::string& ) const; ///< \ru Задать шрифт. \en Set font.
|
||||
|
||||
virtual MaeTextType IsA() const;
|
||||
virtual SPtr<MaTextItem> Duplicate() const;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaTextLiteral )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Текст с указанием ЛСК, шрифта, выравнивания, размера.
|
||||
\en Text with specification of LCS, font, alignment, size. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaTextLiteralExtent : public MaTextLiteral {
|
||||
double sizeX, sizeY; ///< \ru Размеры по x и у. \en Size by x and size by y.
|
||||
public:
|
||||
|
||||
MaTextLiteralExtent(); ///< \ru Конструктор по умолчанию. \en Default constructor.
|
||||
|
||||
double & SetSizeX(); ///< \ru Получить размер по x. \en Get size by x with possibility of modification.
|
||||
double & SetSizeY(); ///< \ru Получить размер по y. \en Get size by y with possibility of modification.
|
||||
double GetSizeX() const; ///< \ru Получить размер по x. \en Get size by x.
|
||||
double GetSizeY() const; ///< \ru Получить размер по y. \en Get size by y.
|
||||
|
||||
virtual MaeTextType IsA() const;
|
||||
virtual SPtr<MaTextItem> Duplicate() const;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaTextLiteralExtent )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Спецсимвол.
|
||||
\en Specific symbol. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaSpecificSymbol : public MaTextItem {
|
||||
MbPlacement location; ///< \ru Положение в аннотационной плоскости \en Position in annotation plane.
|
||||
double sizeX; ///< \ru Размер по X. \en Size by x.
|
||||
double sizeY; ///< \ru Размер по Y. \en Size by Y.
|
||||
MbeDefinedDimensionSymbol preDefinedSym; ///< \ru Код предопределённого символа. \en The predefined symbol code.
|
||||
public:
|
||||
|
||||
MaSpecificSymbol( MbeDefinedDimensionSymbol symbol, double szX, double szY );
|
||||
|
||||
MbeDefinedDimensionSymbol GetSymbol() const; ///< \ru Получить код предопределённого символа. \en Get the predefined symbol code.
|
||||
bool IsSymbolDimension() const; ///< \ru Является ли символ размерным. \en Is symbol dimension.
|
||||
bool IsSymbolSurfaceCondition() const; ///< \ru Является ли символ обозначением шероховатости. \en Is symbol surface condition.
|
||||
bool IsSymbolShapeTolerance() const; ///< \ru Является ли символ допуском формы. \en Is symbol shape tolerance.
|
||||
MbPlacement& SetLocation(); ///< \ru Получить положение с возможностью модификации. \en Get position with possibility of modification.
|
||||
const MbPlacement& GetLocation() const; ///< \ru Получить положение. \en Get position.
|
||||
double GetSizeX() const; ///< \ru Получить размер по x. \en Get size by x.
|
||||
double GetSizeY() const; ///< \ru Получить размер по y. \en Get size by y.
|
||||
void GetSize( double& x, double& y ) const; ///< \ru Получить размеры. \en Get sizes.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaSpecificSymbol )
|
||||
|
||||
virtual MaeTextType IsA() const;
|
||||
virtual SPtr<MaTextItem> Duplicate() const;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Описание законцовочного символа.
|
||||
\en Description of the terminator symbol. \~
|
||||
*/
|
||||
struct MaTerminatorSymbol {
|
||||
MbeDefinedTerminatorSymbol type; ///< \ru Тип символа \en Symbol type
|
||||
double parameter; ///< \ru Значенеи параметра на размерной кривой. Если не указан, должен быть равен UNDEFINED_DBL. \en Parameter value on the dimensional curve. If not known, must be equal UNDEFINED_DBL.
|
||||
double sizeX; ///< \ru Размер по x. \en Size by x.
|
||||
double sizeY; ///< \ru Размер по у. \en Size by y.
|
||||
/// \ru Признак сонаправленности с касательной к кривой в точке размещения. В случае неопределённого значения параметра - признак направленности внутрь.
|
||||
/// \en Flag of the same direction with the tangent to the curve at the location point. In case parameter id undefined it shows if the arrow's direction is inner.
|
||||
bool sameDirection;
|
||||
|
||||
MbCartPoint3D location; ///< \ru Положение в пространстве. \en Location in space.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Кривая с терминаторами.
|
||||
\en Curve and terminators. \~
|
||||
*/
|
||||
class CONV_CLASS MaDecoratedCurve : public MbRefItem {
|
||||
c3d::SpaceCurveSPtr curve;
|
||||
std::vector< MaTerminatorSymbol > terminators;
|
||||
MbeDecoratedCurveRole curveType;
|
||||
public:
|
||||
MaDecoratedCurve( MbeDecoratedCurveRole crvType ); ///< \ru Конструктор. \en Constructor.
|
||||
MaDecoratedCurve( const MaDecoratedCurve& ); ///< \ru Конструктор копирования. \en Copy constructor.
|
||||
const MaDecoratedCurve& operator= ( const MaDecoratedCurve& ); ///< \ru Оператор присваивания. \en Assignment operator.
|
||||
|
||||
c3d::SpaceCurveSPtr GetCurve() const; ///< \ru Получить кривую. \en Get curve.
|
||||
bool CurveEmpty() const; ///< \ru Пуста ли кривая. \en If curve is empty.
|
||||
void SetCurve( MbCurve3D* crv ); ///< \ru Задать кривую. \en Set curve.
|
||||
size_t TerminatorsCount() const; ///< \ru Получить число законцовок. \en Set number of terminators.
|
||||
bool TerminatorInfo( size_t terminatorIndex, MaTerminatorSymbol& term ) const; ///< \ru Получить законцовку с указанным индексом. \en Get terminator.
|
||||
void AddTerminator( const MaTerminatorSymbol& term ); ///< \ru Добавить законцовку. \en Add terminator.
|
||||
|
||||
bool IsA( MbeDecoratedCurveRole ) const; ///< \ru Проверка типа кривой. \en Check curve type.
|
||||
|
||||
void DuplicateCurve( const MbMatrix3D& transform ); ///< \ru Заменить кривую на преобразованный по матрице дубликат. \en Replace curve by transformed replica.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Объект аннотации.
|
||||
\en Annotation object. \~
|
||||
*/
|
||||
class CONV_CLASS MaAnnotationItem : public MbRefItem {
|
||||
protected:
|
||||
MbPlacement3D location; ///< \ru Локальная система координат (ЛСК), в плоскости XY которой расположены объекты аннотации. \en Local coordinate system (LCS) the annotation objects are located in XY plane of.
|
||||
std::vector< const MbItem* > annotationGeometry; ///< \ru Геометрические объекты аннотации. \en Geometric objects of annotation.
|
||||
std::vector< SPtr<const MaTextItem> > annotationText; ///< \ru Текстовые аннотационные объекты. \en Text annotation objects.
|
||||
std::string name; ///< \ru Имя. \en Name.
|
||||
bool visible; ///< \ru Видим ли объект. \en If object is vivible.
|
||||
// \ru Аналогичным образом реализовать и символьное представление \en Implement symbolic representation similarly.
|
||||
public:
|
||||
/// \ru Конструктор по плоскости аннотации. \en Constructor by annotation plane.
|
||||
MaAnnotationItem( const MbPlacement3D& loc );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MaAnnotationItem();
|
||||
|
||||
public:
|
||||
/// \ru Получить тип объекта. \en Get the object type.
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
/// \ru Получить групповой тип объекта. \en Get the group type of the object.
|
||||
virtual Mae_AnnotationType Type() const;
|
||||
|
||||
/// \ru Пусто ли визуальное представление. \en Whether the visual representation is empty.
|
||||
virtual bool VisualItemsEmpty() const;
|
||||
|
||||
/// \ru Отсутствуют ли геометрические элементы. \en Whether there are no geometric items.
|
||||
bool GeometryEmpty() const;
|
||||
|
||||
/// \ru Отсутствуют ли текстовые элементы. \en Whether there are no text items.
|
||||
bool TextEmpty() const;
|
||||
|
||||
/// \ru Добавить геометрический визуальный аннотационный элемент. \en Add the geometric visual annotation element of the kernel.
|
||||
void AddGeometricAnnotationElement( const MbItem& );
|
||||
|
||||
/// \ru Задать аннотационные объекты ядра. \en Set the annotation objects of the kernel.
|
||||
template< typename In >
|
||||
void SetAnnotationGeometry( In first, In last );
|
||||
/// \ru Выдать аннотационные объекты ядра. У приёмника должен быть определён метод push_back. \en Get the annotation objects of the kernel. Method push_back should be defined for the receiver.
|
||||
template< typename Out >
|
||||
void GetAnnotationGeometry( Out dest ) const;
|
||||
|
||||
/// \ru Получить текстовые аннотационные объекты. \en Get the text annotation object.
|
||||
template< typename In >
|
||||
void SetAnnotationText( In first, In last );
|
||||
/// \ru Выдать текстовые аннотационные объекты. У приёмника должен быть определён метод push_back. \en Get text annotation objects. Method push_back should be defined for the receiver.
|
||||
template< typename Out >
|
||||
void GetAnnotationText( Out dest ) const;
|
||||
|
||||
/// \ru Добавить плоские геометрические объекты, преобразуя их в пространственные, используя текущую ЛСК. \en Add planar objects to geometric objects using current location.
|
||||
void AddPlaneItems( const std::vector<SPtr<MbPlaneItem> >& );
|
||||
|
||||
/// \ru Задать ЛСК. \en Specify LCS.
|
||||
void SetLocation( const MbPlacement3D & loc );
|
||||
/// \ru Получить ЛСК. \en Get LCS.
|
||||
MbPlacement3D GetLocation() const;
|
||||
|
||||
/// \ru Задать имя. \en Specify name.
|
||||
void SetName( const std::string & nm );
|
||||
|
||||
/// \ru Задать имя. \en Specify name.
|
||||
void GetName( std::string & nm ) const;
|
||||
|
||||
/// \ru Задать видимость. \en Set visibility.
|
||||
void SetVisibility( bool v );
|
||||
/// \ru Видим ли объект. \en Is object vivible.
|
||||
bool IsVisible() const;
|
||||
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D & );
|
||||
|
||||
/// \ru Инициализировать все поля за исключением ЛСК данными присланного. \en Init all fields except for location according to the specified item.
|
||||
void InitExceplLocation( const MaAnnotationItem & init );
|
||||
|
||||
protected:
|
||||
|
||||
/// \ru Заменить геометрические элементы трансформированными копиями. \en Replace all geometric items by transformed copies.
|
||||
virtual void DuplicateTransformDeometry( const MbMatrix3D & );
|
||||
};
|
||||
|
||||
|
||||
typedef SPtr<MaAnnotationItem> AnnotationSPtr;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Размер - родоначальник классов для размеров различных типов.
|
||||
\en Dimension is the parent of all classes for dimensions of different types. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaDimension : public MaAnnotationItem {
|
||||
double value; ///< \ru Значение размера. \en A value of dimension.
|
||||
double valuePlus; ///< \ru Отклонение размера в сторону увеличения. \en Deviation (increase) of size.
|
||||
double valueMinus; ///< \ru Отклонение размера в сторону уменьшения. \en Deviation (decrease) of size.
|
||||
bool isRangeSet; ///< \ru Если false, то задан только диапазон изменения, иначе можно вычислить погрешности в обе стороны. \en If it equals false, then only the range of changing is specified, else the tolerances in both directions can be computed.
|
||||
bool isValueDefined; ///< \ru Задан ли номинал. \en Whether the nominal is given.
|
||||
protected:
|
||||
MaDecoratedCurve dimensionCurve;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaDimension )
|
||||
protected:
|
||||
MaDimension( const MbPlacement3D& loc, MbCurve3D* dimCurve );
|
||||
MaDimension( const MbPlacement3D& loc, const MaDecoratedCurve& dimCurve );
|
||||
public:
|
||||
/// \ru Получить тип объекта. \en Get the object type.
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
/// \ru Получить групповой тип объекта. \en Get the group type of the object.
|
||||
virtual Mae_AnnotationType Type() const;
|
||||
|
||||
/// \ru Получить размерную кривую. \en Get the dimensional curve.
|
||||
MbCurve3D* GetDimensionCurve();
|
||||
|
||||
/// \ru Задать номинал. \en Set a value.
|
||||
void SetValue( double v );
|
||||
/// \ru Задать диапазон и значение. \en Set a range and a value.
|
||||
void SetRange( double v, double vPlus, double vMinus );
|
||||
/// \ru Задать диапазон. \en Set range.
|
||||
void SetRange( double vPlus, double vMinus );
|
||||
/// \ru Получить номинал. \en Get value.
|
||||
bool GetValue( double& v );
|
||||
/// \ru Получить границы диапазона и значение, если они заданы. \en Get bounds of range and a value if they are specified.
|
||||
bool GetRange( double& v, double& vPlus, double& vMinus ) const;
|
||||
/// \ru Получить границы диапазона, если они заданы. \en Get bounds of the range if they are specified.
|
||||
bool GetRange( double& vPlus, double& vMinus ) const;
|
||||
/// \ru Заданы ли границы диапазона. \en Whether the bounds of range are specified.
|
||||
bool IsRangeDefined() const;
|
||||
/// \ru Задано ли значение. \en Whether the value is specified.
|
||||
bool IsValueDefined() const;
|
||||
/** \brief \ru Добавить законцовочный символ.
|
||||
\en Add a terminator. \~
|
||||
\param [in] init - \ru Параметры задаваемого символа.
|
||||
\en Parameters of specified symbol. \~
|
||||
\return \ru - true, если задана размерная кривая и хотя бы один из законцовочных символов не был задан.
|
||||
\en - true, if a dimensional curve is specified and at least one of terminators has not been specified. \~
|
||||
*/
|
||||
bool AddTerminator( const MaTerminatorSymbol& init );
|
||||
/// \ru Получить первый законцовочный символ. \en Get the first terminator.
|
||||
bool GetFirstTerminator( MaTerminatorSymbol& first );
|
||||
/// \ru Получить второй законцовочный символ. \en Get the second terminator.
|
||||
bool GetSecondTerminator( MaTerminatorSymbol& second );
|
||||
|
||||
void InitValueTerminators( const MaDimension& init );
|
||||
protected:
|
||||
/// \ru Заменить геометрические элементы трансформированными копиями. \en Replace all geometric items by transformed copies.
|
||||
virtual void DuplicateTransformDeometry( const MbMatrix3D & );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Линейный размер.
|
||||
\en Linear dimension. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaLinearDimension : public MaDimension {
|
||||
private:
|
||||
SPtr<const MbRefItem> bindBase; ///< \ru Первый объект привязки. \en The first binding object.
|
||||
SPtr<const MbRefItem> bindTarget; ///< \ru Второй объект привязки. \en The second binding object.
|
||||
MaDecoratedCurve projectionBase; ///< \ru Проекционная кривая к первому объекту привязки в смысле STEP. \en Projection curve to the first binding object in sense of STEP.
|
||||
MaDecoratedCurve projectionTarget; ///< \ru Проекционная кривая ко второму объекту привязки в смысле STEP. \en Projection curve to the second binding object in sense of STEP.
|
||||
SPtr<MbCurve3D> path; ///< \ru Кривая, вдоль которой проводится измерение. Если не задана, то размер есть кратчайший. \en A curve along which the measurement is performed. If not specified, then the size is shortest.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaLinearDimension )
|
||||
public:
|
||||
MaLinearDimension ( const MbRefItem* base, const MbRefItem* target,
|
||||
MbLineSegment3D* projBase, MbLineSegment3D* projTarget,
|
||||
MbLineSegment3D* dimensionCurve, const MbPlacement3D& loc );
|
||||
|
||||
MaLinearDimension ( const MbRefItem* base, const MbRefItem* target,
|
||||
MbLineSegment3D* projBase, MbLineSegment3D* projTarget,
|
||||
const MaDecoratedCurve dimensionCurve, const MbPlacement3D& loc );
|
||||
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
|
||||
virtual bool VisualItemsEmpty() const;
|
||||
|
||||
/// \ru Получить базовый объект привязки. \en Get the base binding object.
|
||||
const MbRefItem * GetBindBase();
|
||||
/// \ru Получить второй объект привязки. \en Get the second binding object.
|
||||
const MbRefItem * GetBindTarget();
|
||||
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D* GetProjectionBase();
|
||||
/// \ru Получить проекционную кривую ко второму объекту привязки. \en Get the projection curve to the second binding object.
|
||||
MbLineSegment3D* GetProjectionTarget();
|
||||
|
||||
/// \ru Задать кривую, вдоль которой провдится измерение. \en Set the curve the measurement is performed along.
|
||||
void SetPath( MbCurve3D* inPath );
|
||||
/// \ru Получить кривую, вдоль которой провдится измерение. \en Get the curve the measurement is performed along.
|
||||
MbCurve3D* GetPath();
|
||||
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D& );
|
||||
|
||||
protected:
|
||||
// Заменить геометрические элементы трансформированными копиями.
|
||||
virtual void DuplicateTransformDeometry( const MbMatrix3D & );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Угловой размер.
|
||||
\en Angular dimension. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaAngularDimension : public MaDimension {
|
||||
private:
|
||||
SPtr<const MbRefItem> bindBase; ///< \ru Первый объект привязки. \en The first binding object.
|
||||
SPtr<const MbRefItem> bindTarget; ///< \ru Второй объект привязки. \en The second binding object.
|
||||
MaDecoratedCurve projectionBase; ///< \ru Проекционная кривая к первому объекту привязки в смысле STEP. \en Projection curve to the first binding object in sense of STEP.
|
||||
MaDecoratedCurve projectionTarget; ///< \ru Проекционная кривая ко второму объекту привязки в смысле STEP. \en Projection curve to the second binding object in sense of STEP.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaAngularDimension )
|
||||
public:
|
||||
MaAngularDimension( const MbRefItem* base, const MbRefItem* target,
|
||||
MbLineSegment3D* projBase, MbLineSegment3D* projTarget,
|
||||
MbArc3D* dimensionCurve, const MbPlacement3D& loc );
|
||||
|
||||
MaAngularDimension( const MbRefItem* base, const MbRefItem* target,
|
||||
MbLineSegment3D* projBase, MbLineSegment3D* projTarget,
|
||||
const MaDecoratedCurve&, const MbPlacement3D& loc );
|
||||
|
||||
virtual Mae_AnnotationType IsA() const ;
|
||||
|
||||
virtual bool VisualItemsEmpty() const;
|
||||
|
||||
/// \ru Получить базовый объект привязки. \en Get the base binding object.
|
||||
const MbRefItem * GetBindBase();
|
||||
/// \ru Получить второй объект привязки. \en Get the second binding object.
|
||||
const MbRefItem * GetBindTarget();
|
||||
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D * GetProjectionBase();
|
||||
/// \ru Получить проекционную кривую ко второму объекту привязки. \en Get the projection curve to the second binding object.
|
||||
MbLineSegment3D * GetProjectionTarget();
|
||||
/// \ru Если заданы проекционные кривые и если они не параллельны, получить точку пересечения или скрещивания. Метод работает и за пределеми параметрической области. \en If the projection curves are specified and if they are not parallel, get the point of intersection or crossing. The method works outside the bounds of a parametric region too.
|
||||
bool NearestBetweenProjections( MbCartPoint3D& pnt );
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D& );
|
||||
|
||||
protected:
|
||||
// Заменить геометрические элементы трансформированными копиями.
|
||||
virtual void DuplicateTransformDeometry( const MbMatrix3D & );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Радиальный размер.
|
||||
\en Radial dimension. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaRadialDimension : public MaDimension {
|
||||
private:
|
||||
SPtr<const MbRefItem> bindBase; ///< \ru Объект привязки. \en Binding object.
|
||||
MaDecoratedCurve projectionBase; ///< \ru Проекционная кривая к объекту привязки в смысле STEP. \en Projection curve to the binding object in sense of STEP.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaRadialDimension )
|
||||
public:
|
||||
MaRadialDimension( const MbRefItem* base, MbLineSegment3D* projBase,
|
||||
MbLineSegment3D* dimensionCurve, const MbPlacement3D& loc );
|
||||
|
||||
MaRadialDimension( const MbRefItem* base, MbLineSegment3D* projBase,
|
||||
const MaDecoratedCurve& dimensionCurve, const MbPlacement3D& loc );
|
||||
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
|
||||
virtual bool VisualItemsEmpty() const;
|
||||
|
||||
/// \ru Получить базовый объект привязки. \en Get the base binding object.
|
||||
const MbRefItem * GetBindBase();
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D * GetProjectionBase();
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D& );
|
||||
|
||||
protected:
|
||||
// Заменить геометрические элементы трансформированными копиями.
|
||||
virtual void DuplicateTransformDeometry( const MbMatrix3D & );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Диаметральный размер.
|
||||
\en Diameter dimension. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaDiameterDimension : public MaDimension {
|
||||
private:
|
||||
SPtr<const MbRefItem> bindBase; ///< \ru Объект привязки. \en Binding object.
|
||||
MaDecoratedCurve projectionBase; ///< \ru Первая проекционная кривая к объекту привязки в смысле STEP. \en The first projection curve to binding object in sense of STEP.
|
||||
MaDecoratedCurve projectionTarget; ///< \ru Вторая проекционная кривая к объекту привязки в смысле STEP. \en The second projection curve to binding object in sense of STEP.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaDiameterDimension )
|
||||
public:
|
||||
MaDiameterDimension( const MbRefItem* base, MbLineSegment3D* projBase,
|
||||
MbLineSegment3D* projTarget, MbLineSegment3D* dimCurve,
|
||||
const MbPlacement3D& loc );
|
||||
|
||||
MaDiameterDimension( const MbRefItem* base, MbLineSegment3D* projBase,
|
||||
MbLineSegment3D* projTarget, const MaDecoratedCurve& dimCurve,
|
||||
const MbPlacement3D& loc );
|
||||
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
|
||||
virtual bool VisualItemsEmpty() const;
|
||||
|
||||
/// \ru Получить базовый объект привязки. \en Get the base binding object.
|
||||
const MbRefItem * GetBindBase();
|
||||
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D * GetProjectionBase();
|
||||
/// \ru Получить вторую проекционную кривую к объекту привязки. \en Get the first projection curve to the binding object.
|
||||
MbLineSegment3D * GetProjectionTarget();
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D& );
|
||||
|
||||
protected:
|
||||
// Заменить геометрические элементы трансформированными копиями.
|
||||
virtual void DuplicateTransformDeometry( const MbMatrix3D & );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Выносной элемент - родоначальник классов для обозначений различных типов.
|
||||
\en Callout is the parent of all classes for callouts of different types. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaCallout : public MaAnnotationItem {
|
||||
Mae_AnnotationType whatIs; ///< \ru Подтип объекта. \en Object subtype.
|
||||
std::vector<MaDecoratedCurve> leaderLines; ///< \ru Линии выноски. \en Leader lines.
|
||||
public:
|
||||
/// \ru Получить тип объекта. \en Get the object type.
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
/// \ru Получить групповой тип объекта. \en Get the group type of the object.
|
||||
virtual Mae_AnnotationType Type() const;
|
||||
/// \ru Создать объект заданного типа объекта. \en Create object of specified type.
|
||||
static MaCallout* Create( const MbPlacement3D& location, Mae_AnnotationType subtype );
|
||||
|
||||
void AddLeaderLine( const MaDecoratedCurve& leader ); ///< \ru Добавить линию выноски. \en Add leader line.
|
||||
void AddLeaderLines( const std::vector<MaDecoratedCurve>& leaders ); ///< \ru Добавить линию выноски. \en Add leader line.
|
||||
size_t LeaderLinesCount() const; ///< \ru Получить число линий выноски. \en Get number of leader lines.
|
||||
bool LeaderLineInfo( size_t index, MaDecoratedCurve& callout ) const; ///< \ru Получить линию выноски с указанным индексом. \en Get of leader lines at specified index.
|
||||
private:
|
||||
MaCallout( const MbPlacement3D& location, Mae_AnnotationType subtype ); ///< \ru Конструктор. \en Constructor.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY(MaCallout)
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Шероховатость поверхности.
|
||||
\en Surface condition. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaSurfaceCondition : public MaAnnotationItem {
|
||||
SPtr< const MbRefItem > baseObject;
|
||||
double value;
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MaSurfaceCondition( const MbPlacement3D& location );
|
||||
|
||||
/// \ru Получить тип объекта. \en Get the object type.
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
/// \ru Получить групповой тип объекта. \en Get the group type of the object.
|
||||
virtual Mae_AnnotationType Type() const;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MaSurfaceCondition )
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Допуск формы.
|
||||
\en Shape tolerance. \~
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS MaShapeTolerance : public MaAnnotationItem {
|
||||
SPtr< const MbRefItem > baseObject;
|
||||
double value;
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MaShapeTolerance( const MbPlacement3D& location );
|
||||
|
||||
/// \ru Получить тип объекта. \en Get the object type.
|
||||
virtual Mae_AnnotationType IsA() const;
|
||||
/// \ru Получить групповой тип объекта. \en Get the group type of the object.
|
||||
virtual Mae_AnnotationType Type() const;
|
||||
|
||||
OBVIOUS_PRIVATE_COPY(MaShapeTolerance)
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Задать геометрические объекты аннотации \en Set geometric objects of annotation.
|
||||
// ---
|
||||
template< typename In >
|
||||
void MaAnnotationItem::SetAnnotationGeometry( In first, In last ) {
|
||||
std::for_each( annotationGeometry.begin(), annotationGeometry.end(), ReleaseItem<const MbItem> );
|
||||
annotationGeometry.assign( first, last );
|
||||
std::for_each( annotationGeometry.begin(), annotationGeometry.end(), AddRefItem<const MbItem> );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Получить геометрические объекты аннотации \en Get geometric objects of annotation.
|
||||
// ---
|
||||
template< typename Out >
|
||||
void MaAnnotationItem::GetAnnotationGeometry( Out dest ) const {
|
||||
std::copy( annotationGeometry.begin(), annotationGeometry.end(), dest );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Задать текстовые объекты аннотации \en Set text objects of annotation.
|
||||
// ---
|
||||
template< typename In >
|
||||
void MaAnnotationItem::SetAnnotationText( In first, In last ) {
|
||||
annotationText.assign( first, last );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Получить текстовые объекты аннотации \en Get text objects of annotation
|
||||
// ---
|
||||
template< typename Out >
|
||||
void MaAnnotationItem::GetAnnotationText( Out dest ) const {
|
||||
std::copy( annotationText.begin(), annotationText.end(), dest );
|
||||
}
|
||||
|
||||
|
||||
#endif // __CONV_ANNOTATION_ITEM_H
|
||||
@@ -0,0 +1,374 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Перечисления, используемые при импорте и экспорте.
|
||||
\en Enumerations for import/export operations.\~
|
||||
\details \ru Определены перечисления, определяющие результат конвертирования,
|
||||
разрешение на чтение и запись различных объектов и передаваемых черезх конвертер строк.
|
||||
\en Converting result, objects and properties filters, special strings
|
||||
of enumerations are defined.\~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_ERROR_RESULT_H
|
||||
#define __CONV_ERROR_RESULT_H
|
||||
|
||||
|
||||
#include <mb_enum.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Константы единиц измерения.
|
||||
\en Length units constants.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
/// \ru Миллиметры. \en Millimeters.
|
||||
#define LENGTH_UNIT_MM 1.0
|
||||
/// \ru Сантиметры. \en Centimeters.
|
||||
#define LENGTH_UNIT_CM 10.0
|
||||
/// \ru Дециметры. \en Decimeters.
|
||||
#define LENGTH_UNIT_DM 100.0
|
||||
/// \ru Метры. \en Meters.
|
||||
#define LENGTH_UNIT_METER 1000.0
|
||||
/// \ru Дюймы. \en Inches.
|
||||
#define LENGTH_UNIT_INCH 25.4
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Прикладной протокол.
|
||||
\en Applied protocol.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeImpExpFormat {
|
||||
ief_STEP203, ///< \ru STEP прикладной протокол 203 ( Проектирование с управляемой конфигурацией ). \en STEP applied protocol STEP 203 (Configuration controlled design).
|
||||
ief_STEP214, ///< \ru STEP прикладной протокол 214 ( Проектирование автомобилей ). \en STEP applied protocol STEP 214 (Automotive design).
|
||||
ief_STEP242, ///< \ru STEP прикладной протокол 242 ( Проектирование автомобилей ). \en STEP applied protocol STEP 242 (Automotive design).
|
||||
};
|
||||
|
||||
|
||||
#define EXPORT_DEFAULT -1 ///< \ru По умолчанию для заданного формата. \en Default for specified format.
|
||||
#define EXPORT_STEP_203 203 ///< \ru STEP прикладной протокол 203 ( Проектирование с управляемой конфигурацией ). \en STEP applied protocol STEP 203 (Configuration controlled design).
|
||||
#define EXPORT_STEP_214 214 ///< \ru STEP прикладной протокол 214 ( Проектирование автомобилей ). \en STEP applied protocol STEP 214 (Automotive design).
|
||||
#define EXPORT_STEP_242 242 ///< \ru STEP прикладной протокол 242. \en STEP applied protocol STEP 242.
|
||||
#define EXPORT_ACIS_4 4 ///< \ru ACIS версия 4.0. \en ACIS version 4.0.
|
||||
#define EXPORT_ACIS_7 7 ///< \ru ACIS версия 7.0 (по умолчанию). \en ACIS version 7.0 (default).
|
||||
#define EXPORT_ACIS_10 10 ///< \ru ACIS версия 10.0. \en ACIS version 10.0.
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Обменный формат модели.
|
||||
\en Model exchange format.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeModelExchangeFormat {
|
||||
mxf_autodetect, ///< \ru Интерпретировать содержимое по расширению файла. \en File extension defines format.
|
||||
mxf_ACIS, ///< \ru Интерпретировать содержимое как ACIS (.sat). \en Read data from buffer as ACIS (.sat).
|
||||
mxf_IGES, ///< \ru Интерпретировать содержимое как IGES (.igs или .iges). \en Read data from buffer as IGES (.igs or .iges).
|
||||
mxf_JT, ///< \ru Интерпретировать содержимое как JT (.jt). \en Read data from buffer as JT (.jt).
|
||||
mxf_Parasolid, ///< \ru Интерпретировать содержимое как Parasolid (.x_t, .x_b, .xmt_txt, .xmp_txt, .xmt_bin или .xmp_bin ). \en Read data from buffer as Parasolid (.x_t, .x_b, .xmt_txt, .xmp_txt, .xmt_bin or .xmp_bin ).
|
||||
mxf_STEP, ///< \ru Интерпретировать содержимое как STEP (.stp или .step). \en Read data from buffer as STEP (.stp or .step).
|
||||
mxf_STL, ///< \ru Интерпретировать содержимое как STL (.stl). \en Read data from buffer as STL (.stl).
|
||||
mxf_VRML, ///< \ru Интерпретировать содержимое как VRML (.wrl). \en Read data from buffer as VRML (.wrl).
|
||||
mxf_GRDECL, ///< \ru Интерпретировать содержимое как GRDECL (.grdecl). \en Read data from buffer as GRDECL (.grdecl).
|
||||
mxf_ASCIIPoint, ///< \ru Интерпретировать содержимое как облако точек в ASCII (.txt, .asc или .xyz). \en Read data from buffer as ASCII point cloud (.txt, .asc or .xyz).
|
||||
mxf_C3D, ///< \ru Интерпретировать содержимое как C3D (.c3d). \en Read data from buffer as C3D (.c3d).
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Результат конвертирования.
|
||||
\en Result of converting operation.
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeConvResType {
|
||||
cnv_Success = 0, ///< \ru Успешное завершение. \en Success.
|
||||
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.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Индексы, управляющие разрешением на чтение или запись объектов.
|
||||
\en Indeces, which filter imported/exported objects or properties.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeIOPermiss {
|
||||
iop_rSolid = 0, ///< \ru Разрешение на чтение твёрдых тел. \en Import solid solids.
|
||||
iop_wSolid, ///< \ru Разрешение на запись твёрдых тел. \en Export solid solids.
|
||||
iop_rSurface, ///< \ru Разрешение на чтение поверхностей. \en Import surfaces.
|
||||
iop_wSurface, ///< \ru Разрешение на запись поверхностей. \en Export surfaces.
|
||||
iop_rCurve, ///< \ru Разрешение на чтение кривых. \en Import curves.
|
||||
iop_wCurve, ///< \ru Разрешение на запись кривых. \en Export curves.
|
||||
iop_rDrafts, ///< \ru Разрешение на чтение эскизов (не применяется). \en Import drafts (ignored).
|
||||
iop_wDrafts, ///< \ru Разрешение на запись эскизов. \en Export drafts.
|
||||
iop_rInvisible, ///< \ru Разрешение на чтение невидимых объектов (не применяется). \en Import invisible objects (not applied).
|
||||
iop_wInvisible, ///< \ru Разрешение на запись невидимых объектов. \en Export invisible objects.
|
||||
iop_rPoint, ///< \ru Разрешение на чтение точек. \en Import points.
|
||||
iop_wPoint, ///< \ru Разрешение на запись точек. \en Export points.
|
||||
iop_rDocInfo, ///< \ru Разрешение на чтение информации о документе (автор, организация, комментарии). \en Import components info ( author, organization, description ).
|
||||
iop_wDocInfo, ///< \ru Разрешение на запись информации о документе (автор, организация, комментарии). \en Export components info ( author, organization, description ).
|
||||
iop_rTextDescription, ///< \ru Разрешение на чтение технических требований. \en Import technical requirements.
|
||||
iop_wTextDescription, ///< \ru Разрешение на запись технических требований. \en Export technical requirements.
|
||||
iop_rDimensions, ///< \ru Разрешение на чтение размеров. \en Import dimensions.
|
||||
iop_wDimensions, ///< \ru Разрешение на запись размеров. \en Export dimensions.
|
||||
iop_rAttributes, ///< \ru Разрешение на чтение атрибутов. \en Import attributes.
|
||||
iop_wAttributes, ///< \ru Разрешение на запись атрибутов. \en Export attributes.
|
||||
iop_rBRep, ///< \ru Разрешение на чтение форм изделий в граничном представлении (только в JT). \en Import shapes in boundary representation (JT only).
|
||||
iop_wBRep, ///< \ru Разрешение на запись форм изделий в граничном представлении (только в JT). \en Export shapes in boundary representation (JT only).
|
||||
iop_rPolygonal, ///< \ru Разрешение на чтение полигональных форм изделий. \en Import polygonal shapes.
|
||||
iop_wPolygonal, ///< \ru Разрешение на запись полигональных форм изделий. \en Export polygonal shapes.
|
||||
iop_rLOD0, ///< \ru Разрешение на чтение полигональных форм изделий уровня детализации 0. \en Import polygonal shapes of the 0-th LOD.
|
||||
iop_wLOD0, ///< \ru Разрешение на запись полигональных форм изделий уровня детализации 0. \en Export polygonal shapes of the 0-th LOD.
|
||||
iop_rAssociated, ///< \ru Разрешение на чтение ассоциированной геометрии (резьбы и др). \en Import associated geometry (threads etc).
|
||||
iop_wAssociated, ///< \ru Разрешение на запись ассоциированной геометрии (резьбы и др). \en Export associated geometry (threads etc).
|
||||
iop_rDensity, ///< \ru Разрешение на чтение единиц плотности. \en Import density units.
|
||||
iop_wDensity, ///< \ru Разрешение на запись единиц плотности. \en Export density units.
|
||||
iop_rStyle, ///< \ru Разрешение на чтение элементов оформления (цвет, начертание, и т.п.). \en Import appearance.
|
||||
iop_wStyle, ///< \ru Разрешение на запись элементов оформления (цвет, начертание, и т.п.). \en Export appearance.
|
||||
iop_END
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Индексы строк, передаваемых через конвертер.
|
||||
\en Indeхes of strings, transmitted through converter.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeConverterStrings {
|
||||
cvs_BEGIN = 0, ///< \ru Для удобства перебора. \en For lookup only.
|
||||
cvs_STEPAuthor, ///< \ru Автор для конвертера STEP. \en Author of the document, in STEP.
|
||||
cvs_STEPOrganization, ///< \ru Организация для конвертера STEP. \en The organization, the author is related with, in STEP.
|
||||
cvs_STEPComment, ///< \ru Комментарий файла формата STEP. \en Annotation, in STEP.
|
||||
cvs_END ///< \ru Для удобства перебора. \en For lookup only.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Ключи строк, соответствующих названию специальных атрибутов.
|
||||
\en Keys of the strings, which mark special attributes.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum ePromtAttributeKey {
|
||||
pac_GConverterInternalIsDummy, ///< \ru Является ли элемент пустышкой.\~
|
||||
pac_GeneralIsAssembly, ///< \ru Является ли элемент сборкой. \en Is item assembly.\~
|
||||
pac_GeneralFileName, ///< \ru Имя файла. \en File name.\~
|
||||
pac_STEPHeader, ///< \ru Заголовок STEP. \en STEP header.\~
|
||||
pac_STEPProduct, ///< \ru Изделие STEP. \en STEP product.\~
|
||||
pac_STEPPersonOrganization, ///< \ru Лицо и организация STEP. \en STEP person and organization.\~
|
||||
pac_STEPAssignedRole ///< \ru Назначенная роль STEP. \en The role, assigned to the person.\~
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Представление текста при экспорте.
|
||||
\en Representation of exported text.\~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
// ---
|
||||
enum eTextForm {
|
||||
exf_TextOnly, ///< \ru Только текст. \en Text only.
|
||||
exf_GeometryOnly, ///< \ru Только геометрия. \en Geometry only.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип сообщения об ошибке при выводе в лог.
|
||||
\en Type of a log message.\~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
// ---
|
||||
enum eMsgType {
|
||||
emt_ErrorNoId,///< \ru Ошибка формата. Значение id игнорируется, выводится только текст. \en Error not related with a certain record. The id field is ignored.
|
||||
emt_TextOnly, ///< \ru Значение id игнорируется, выводится только текст. \en Used to type message only. The id field is ignored.
|
||||
emt_Info, ///< \ru Рабочая информация. \en Info.
|
||||
emt_Warning, ///< \ru Предупреждение. \en Warning.
|
||||
emt_Error ///< \ru Ошибка формата или неустранимая ошибка преобразования. \en Format mismatch or fatal converting error.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Код подробного сообщения об ошибке при выводе в лог.
|
||||
\en The key of a detailed log message.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum eMsgDetail {
|
||||
emd_Title, ///< \ru Заголовок файла. \en File header.
|
||||
emd_HEADError, ///< \ru Тип сообщения - ошибка. \en Error.
|
||||
emd_HEADWarinig, ///< \ru Тип сообщения - Предупреждение. \en Warning.
|
||||
emd_HEADInfo, ///< \ru Тип сообщения - Информация. \en Info.
|
||||
emd_HEADDefaultMsg, ///< \ru Тип сообщения - Сообщение. \en Message.
|
||||
|
||||
emd_STOPFileOpenError, ///< \ru Ошибка открытия файла. \en Cannot open file.
|
||||
emd_STOPFileOpenErrorOrEmpty, ///< \ru Ошибка открытия файла или файл пуст. \en Cannot open file or file is empty.
|
||||
emd_STOPHeaderReadError, ///< \ru Не удалось прочитать заголовок файла. \en Cannot read file header.
|
||||
emd_STOPNoOrBadData, ///< \ru Файл не содержит данных или их не удалось распознать. \en File body does not exist or incorrect.
|
||||
emd_STOPIncorrectStructure, ///< \ru Неверная структура файла. \en Incorrect file structure.
|
||||
emd_STOPAddressConflict, ///< \ru Данный адрес имеют два различных объекта. \en Two or more entities have the same id.
|
||||
|
||||
emd_ErrorNoRootObject, ///< \ru Не найден корневой объект. \en Root object not found.
|
||||
emd_ErrorSyntaxIncorrectFormFloat, ///< \ru Невозможно прочитать действительную константу. \en Error reading floating-point number.
|
||||
emd_ErrorEmptyLoop, ///< \ru Цикл грани пуст. \en Face has an empty loop.
|
||||
emd_ErrorEmptyQueriesList, ///< \ru Список запросов пуст. \en
|
||||
emd_ErrorEmptyObjectsList, ///< \ru Список объектов пуст. \en List of objects is empty.
|
||||
emd_ErrorEmptyGeomObjectsList, ///< \ru Список геометрических объектов пуст. \en List of geometric objects is empty.
|
||||
emd_ErrorEmptyShellsList, ///< \ru Список оболочек пуст. \en List of shells is empty.
|
||||
emd_ErrorEmptyListOfWrieframes, ///< \ru Список каркасов пуст. \en List of frames is empty.
|
||||
emd_ErrorEmptyCurveCompositesList, ///< \ru Список компонент составной кривой пуст. \en Composite curve has an empty list of composites.
|
||||
emd_ErrorEmptyBoundCurvesList, ///< \ru Список граничных кривых пуст. \en List of boundary curves is empty.
|
||||
emd_ErrorEmptyEdgeList, ///< \ru Список рёбер пуст. \en List of edges is empty.
|
||||
emd_ErrorEmptyFacesList, ///< \ru Список граней пуст. \en List of faces is empty.
|
||||
emd_ErrorEmptyReferencesList, ///< \ru Список ссылок пуст. \en List of references is empty.
|
||||
emd_ErrorEmptyOrMore2ReferencesList,///< \ru Список ссылок пуст или содержит более 2 элементов. \en List of references is empty or contains more than 2 items.
|
||||
emd_ErrorUndefinedFaceSurfaceRef, ///< \ru Ссылка на базовую поверхность грани не определена. \en Invalid reference to base surface.
|
||||
emd_ErrorUndefinedBaseCurveRef, ///< \ru Ссылка на базовую кривую не определена. \en Invalid reference to base curve.
|
||||
emd_ErrorRadiusTooCloseToZero, ///< \ru Радиус слишком мал. \en Too small radius.
|
||||
emd_ErrorRadiusValueNegative, ///< \ru Отрицательное значение радиуса. \en Negative value of radius.
|
||||
emd_ErrorEllipseAxisTooCloseToZero, ///< \ru Длина полуоси эллипса слишком мала. \en Ellipse axis is too short.
|
||||
emd_ErrorEllipseAxisNegative, ///< \ru Отрицательная длина полуоси эллипса. \en Ellipse axis length is negative.
|
||||
emd_ErrorNegativeDegree, ///< \ru Отрицательный порядок сплайна. \en Negative spline order.
|
||||
emd_ErrorNegativeUDegree, ///< \ru Отрицательный порядок сплайновой поверхности по U. \en Spline surface order along U is negative.
|
||||
emd_ErrorNegativeVDegree, ///< \ru Отрицательный порядок сплайновой поверхности по V. \en Spline surface order along V is negative.
|
||||
emd_ErrorDegreeFixImpossible, ///< \ru Невозможно исправить порядок сплайна. \en Cannot fix spline order.
|
||||
emd_ErrorPolylinePointListLess2, ///< \ru Список точек ломаной содержит менее 2 элементов. \en Polyline contains less then 2 points.
|
||||
emd_ErrorPointListLess2, ///< \ru Список точек содержит менее 2 элементов. \en List of points contains less then 2 points.
|
||||
emd_ErrorKnotsListLess2, ///< \ru Список узлов содержит менее 2 элементов. \en List of knots contains less then 2 values.
|
||||
emd_ErrorWeightsListLess2, ///< \ru Список весов содержит менее 2 элементов. \en List of weights contains less then 2 values.
|
||||
emd_ErrorUPointListLess2, ///< \ru Список точек по U содержит менее 2 элементов. \en List of points along U contains less then 2 points.
|
||||
emd_ErrorUKnotsListLess2, ///< \ru Список узлов по U содержит менее 2 элементов. \en List of knots along U contains less then 2 values.
|
||||
emd_ErrorUWeightsListLess2, ///< \ru Список весов по U содержит менее 2 элементов. \en List of weights along U contains less then 2 values.
|
||||
emd_ErrorVPointListLess2, ///< \ru Список точек по V содержит менее 2 элементов. \en List of points along V contains less then 2 points.
|
||||
emd_ErrorVKnotsListLess2, ///< \ru Список узлов по V содержит менее 2 элементов. \en List of knots along V contains less then 2 values.
|
||||
emd_ErrorVWeightsListLess2, ///< \ru Список весов по V содержит менее 2 элементов. \en List of weights along V contains less then 2 values.
|
||||
emd_ErrorListsSizeMismatch, ///< \ru Размеры списков не согласуются. \en Lists size mismatch.
|
||||
emd_ErrorKnotsWeightsListsOrderMismatch, ///< \ru Размеры списков узлов и весов не согласуются с порядком сплайна. \en Sizes of knots and weights lists do not agree with the spline order.
|
||||
emd_ErrorKnotsWeightsListsSizeMismatch, ///< \ru Размеры списков узлов и весов не согласуются. \en Size of knots list does not agree with the size of the list of weights.
|
||||
emd_ErrorUKnotsWeightsListsSizeMismatch, ///< \ru Размеры списков узлов и весов по U не согласуются. \en Sizes of knots and weights lists along U do not agree.
|
||||
emd_ErrorVKnotsWeightsListsSizeMismatch, ///< \ru Размеры списков узлов и весов по V не согласуются. \en Sizes of knots and weights lists along V do not agree.
|
||||
emd_ErrorSplineCurveNotCreatedUndefinedKnotsVector, ///< \ru Сплайновая кривая не создана - не определёны узлы. \en Cannot create spline, because knots are not defined.
|
||||
emd_ErrorSplineSurfaceNotCreatedUndefinedKnotsVectors, ///< \ru Сплайновая поверхность не создана - не определёны узлы. \en Cannot create spline surface, because knots are not defined.
|
||||
emd_ErrorInCorrectSplineSurfaceData, ///< \ru Неверно заданы параметры NURBS поверхности. \en Spline surface parameters are not valid.
|
||||
|
||||
emd_WarningNoSectionTerminator, ///< \ru Маркер завершения раздела не обнаружен. \en Section terminator not found.
|
||||
emd_WarningSyntaxMultipleDotInFloat, ///< \ru Повторяющаяся точка в действительном числе. \en Too many dots in a floating-point number.
|
||||
emd_WarningSyntaxMultipleEInFloat, ///< \ru Повторяющаяся E в действительном числе. \en Too many E signs in a floating-point number.
|
||||
emd_WarningLoopNotClosed, ///< \ru Цикл не замкнут. \en Loop is not closed.
|
||||
emd_WarningContourNotClosed, ///< \ru Контур не замкнут. \en contour is not closed.
|
||||
emd_WarningUndefinedRef, ///< \ru Ссылка не определена. \en Invalid reference.
|
||||
emd_WarningToroidalSurfaceDegenerated, ///< \ru Тороидальная поверхность вырождена. \en Toroidal surface is degenerate.
|
||||
emd_WarningUndefinedBasisCurve, ///< \ru Не определена базовая кривая. \en Base curve not defined.
|
||||
emd_WarningUndefinedSweptCurve, ///< \ru Не определена образующая кривая. \en Generatrix curve is not defined.
|
||||
emd_WarningUndefinedExtrusionDirection, ///< \ru Не определено направление выдавливания. \en Extrusion direction is not defined.
|
||||
emd_WarningUndefinedAxis, ///< \ru Не определена ось. \en Axis is not defined.
|
||||
emd_WarningUndefinedAxisOfRevolution, ///< \ru Не определена ось вращения. \en Rotation axis is not defined.
|
||||
emd_WarningUndefinedBasisSurface, ///< \ru Не определена базовая поверхность. \en Base surface is not defined.
|
||||
emd_WarningUndefinedRepresentation, ///< \ru Не определено представление. \en Representation is not defined.
|
||||
emd_WarningUndefinedTransformationOperator, ///< \ru Не определён оператор преобразования. \en Transformation is not defined.
|
||||
emd_WarningUndefinedObjectTransformBy, ///< \ru Не определён объект, по которому ведётся преобразование. \en Basic object of transformation is not defined.
|
||||
emd_WarningUndefinedObjectToTransform, ///< \ru Не определён преобразуемый объект. \en No object to transform is defined.
|
||||
emd_WarningUndefinedCurve, ///< \ru Не определена кривая. \en Curve is not defined.
|
||||
emd_WarningUndefinedCompositeSegment, ///< \ru Не определён сегмент составной кривой. \en Composite curve segment is not defined.
|
||||
emd_WarningUndefinedDirection, ///< \ru Не определено направление. \en Direction is not defined.
|
||||
emd_WarningUndefinedAxisDirection, ///< \ru Не определено направление оси. \en Axis direction is not defined.
|
||||
emd_WarningDegeneratedItemWasSkipped, ///< \ru Проигнорирован (пропущен) вырожденный объект. \en Degenerate object was missed.
|
||||
emd_WarningFloatParceFailureDefaultUsed, ///< \ru Ошибка разпознавания числа с плавающей точкой, подставлено значение по умолчанию. \en Floating point value couldn't be parced; default value was used.
|
||||
emd_WarningIncorrectFaceWasNotAddedToShell, ///< \ru Некорректная грань не была добавлена в оболочку. \en Incorrect face was not added to shell.
|
||||
emd_WarningBoundsNotConnectedWithSeams, ///< \ru Границы замкнутой грани не стыкуются со швами. \en Bounds of periodic face not connected with seams.
|
||||
|
||||
emd_MessageWeightsFilled, ///< \ru Веса заданы. \en Weights are set.
|
||||
|
||||
emd_ErrorSTEPEdgeCurveFlagTSingleRedefinition, ///< \ru При создании ребра в конвертере STEP дважды указана грань с флагом .T.. \en Double .T. face inclusion in STEP.
|
||||
emd_ErrorSTEPEdgeCurveFlagFSingleRedefinition, ///< \ru При создании ребра в конвертере STEP дважды указана грань с флагом .F.. \en Double .F. face inclusion in STEP.
|
||||
emd_ErrorSTEPEdgeCurveFlagTMultipleRedefinition, ///< \ru При создании ребра в конвертере STEP более чем дважды указана грань с флагом .T.. \en Multiple .T. face inclusion in STEP.
|
||||
emd_ErrorSTEPEdgeCurveFlagFMultipleRedefinition, ///< \ru При создании ребра в конвертере STEP более чем дважды указана грань с флагом .F.. \en Multiple .F. face inclusion in STEP.
|
||||
emd_ErrorSTEPUndefinedFaceGeometry, ///< \ru Не определена геометрия грани в конвертере STEP. \en Face geometry is not defined in STEP.
|
||||
emd_ErrorSTEPSyntaxMultipleDotInEnum, ///< \ru Синтаксическая ошибка в файле формата STEP - в перечислении символ "." встречается более 1 раза подряд. \en Too many dots in a enumeration record in STEP.
|
||||
emd_WarningSTEPPointCorrection, ///< \ru Скорректированы координаты точки. \en Point location corrected. ( by BUG_73871 )
|
||||
emd_WarningSTEPEdgeCurveByVertices, ///< \ru Кривая ребра скорректирована с учётом координат вершин. \en Edge curve corrected in accordance with vertices. ( by BUG_73871 )
|
||||
emd_MessageSTEPFlagChangedToF, ///< \ru Произведена замена флага на .F.. \en Flag was set as .F. in STEP.
|
||||
emd_MessageSTEPFlagChangedToT, ///< \ru Произведена замена флага на .T.. \en Flag was set as .T. in STEP.
|
||||
|
||||
emd_WarningACISUnsupportedInterpoleCurveType, ///< \ru Данный подтип ACIS интерполяционной кривой не поддерживается. \en Interpolation curve type is not supported by SAT converter.
|
||||
emd_WarningACISUnsupportedParametricCurveType, ///< \ru Данный подтип ACIS параметрической кривой не поддерживается. \en Parametric curve type is not supported by SAT converter.
|
||||
emd_ErrorACISUnsupportedVersion, ///< \ru Данная версия ACIS NT не поддерживается. \en Th version of file is not supported by SAT converter.
|
||||
emd_WarningACISCannotImportEntityId, ///< \ru Не удалось импортировать объект с данным Id. \en Cannot import this object by SAT converter.
|
||||
emd_WarningACISIncorrectIntAttribute, ///< \ru Некорректный целочисленный атрибут. \en Incorrect integer attribute.
|
||||
|
||||
emd_ErrorIGESIncorrectExternalReference, ///< \ru Неверное имя внешней ссылки. \en Invalid external reference in IGES.
|
||||
|
||||
emd_ErrorSTLTooManyTrianglesForBinary, ///< \ru Триангуляция исходной модели содержит больше треугольников, чем допустимо стандартом ( не выражается 32-битным беззнаковым числом ) ( by BUG_71422 ). \en Too many triangles (not represented by unsigned 32-bit number) for export to binary STL.
|
||||
|
||||
emd_ErrorXTUnsupportedVersion, ///< \ru Данная версия X_T не поддерживается. \en Th version of file is not supported by X_T converter.
|
||||
|
||||
emd_ErrorJTUnsupportedVersion ///< \ru Данная версия JT не поддерживается. \en Th version of file is not supported by JT converter.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Идентификаторы сообщений индикатора прогресса выполнения конвертации данных.
|
||||
\en Identifiers of the execution progress indicator messages converters data exchange \~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
//---
|
||||
enum MbeProgBarId_Converters {
|
||||
pbarId_Cnv_Beg = pbarId_PointsSurface_End + 1,
|
||||
|
||||
pbarId_Cnv_Parse_Data, // \ru Синтаксический анализ... \en Syntactic analysis...
|
||||
pbarId_Cnv_Create_Objects, // \ru Создание объектов... \en Creation of objects...
|
||||
pbarId_Cnv_Process_Surfaces, // \ru Обработка поверхностей... \en Surfaces processing...
|
||||
pbarId_Cnv_Process_Annotation,// \ru Обработка аннотации... \en Annotation processing...
|
||||
pbarId_Cnv_Create_Model, // \ru Создание модели... \en Creation of model...
|
||||
pbarId_Cnv_Write_Model, // \ru Запись модели... \en Writing of model...
|
||||
|
||||
pbarId_Cnv_End,
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Идентификаторы сообщений индикатора прогресса выполнения триангуляции при выполнении конвертации данных.
|
||||
\en Identifiers of the execution progress indicator messages triangulation. \~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
//---
|
||||
enum MbeProgBarId_Triangulation {
|
||||
pbarId_Triangulation_Beg = pbarId_Cnv_End + 1,
|
||||
|
||||
pbarId_Calc_Triangulation, // \ru Расчет триангуляции \en Calculating of triangulation
|
||||
|
||||
pbarId_Triangulation_End,
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Идентификаторы сообщений индикатора прогресса выполнения расчёта
|
||||
масс-инерционные характеристики детали или сборки при выполнении конвертации данных.
|
||||
\en Identifiers of the execution progress indicator messages of mass-inertial properties of assembly or a detail. \~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
//---
|
||||
enum MbeProgBarId_MassInertiaProperties {
|
||||
pbarId_MassInertiaProperties_Beg = pbarId_Triangulation_End + 1,
|
||||
|
||||
pbarId_Calc_MassInertiaProperties, // \ru Расчет масс-инерционных характеристик \en Mass-inertial properties calculation
|
||||
|
||||
pbarId_MassInertiaProperties_End,
|
||||
};
|
||||
|
||||
|
||||
#endif // __CONV_ERROR_RESULT_H
|
||||
@@ -0,0 +1,901 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Интерфейсы конвертера.
|
||||
\en Interfaces of the converter. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_I_CONVERTER_H
|
||||
#define __CONV_I_CONVERTER_H
|
||||
|
||||
|
||||
#include <math_define.h>
|
||||
#include <tool_cstring.h>
|
||||
#include <conv_error_result.h>
|
||||
#include <mb_data.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class IProgressIndicator;
|
||||
struct IScaleRequestor;
|
||||
class ItModelDocument;
|
||||
class MATH_CLASS MbRefItem;
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbModel;
|
||||
|
||||
|
||||
/**
|
||||
\addtogroup Exchange_Interface
|
||||
\{
|
||||
*/
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс свойств конвертера.
|
||||
\en Interface of converter's properties. \~
|
||||
\details \ru Интерфейс свойств конвертера реализует выдачу имени документа и других сведений о нём, таких как автор,
|
||||
и управление режимами работы - сшивкой поверхностей с возможностью создания твёрдых
|
||||
тел, фильтрацией объектов, формирование журнала трансляции.
|
||||
\en Interface of converter's properties realizes getting the document's name and other information about it, such as the author,
|
||||
and management of modes of operations - stitching of surfaces with possibility of solids creation,
|
||||
objects filtration, generation of translation journal. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
class IConvertorProperty3D {
|
||||
public :
|
||||
virtual ~IConvertorProperty3D() {}
|
||||
|
||||
public:
|
||||
/// \ru Получить имя документа. \en Get document's name.
|
||||
virtual const std::string GetDocumentName () const = 0; //{ return std::string( GetDocName().get_str() ); };
|
||||
/// \ru Получить имя файла для конвертирования. \en Get file name for converting.
|
||||
virtual const c3d::path_string FullFilePath () const = 0 ;//{ return c3d::path_string( GetFileName().c_str() ); };
|
||||
/// \ru Является ли файл текстовым. \en Whether the file is a text file.
|
||||
virtual bool IsFileAscii () const = 0;
|
||||
/// \ru Получить версию формата при экспорте. \en Get the version of format for export.
|
||||
virtual long int GetFormatVersion () const { return EXPORT_DEFAULT; };
|
||||
/// \ru Задать формат для экспорта \en Set format for export
|
||||
DEPRECATE_DECLARE virtual MbeImpExpFormat GetFormat () const { return ief_STEP203; }
|
||||
/// \ru Следует ли экспортировать только поверхности ( введено для работы конвертера IGES ). \en Whether to export only surfaces (introduced for work with converter IGES ).
|
||||
virtual bool IsOutOnlySurfaces() const = 0;
|
||||
/// \ru Является ли экспортируемый документ сборкой. \en Whether the document for export is an assembly.
|
||||
virtual bool IsAssembling () const = 0;
|
||||
/// \ru Получить значение разрешения на импорт экспорт объектов определенного типа. \en Get the value of permission for import-export of objects of a certain type.
|
||||
virtual bool GetIoPermission( MbeIOPermiss nPermission ) const = 0;
|
||||
/// \ru Получить значения разрешений на импорт экспорт объектов определенных типов. \en Get values of permission for import-export of objects of certain types.
|
||||
virtual void GetIoPermissions( std::vector<bool>& ioPermissions ) const = 0;
|
||||
/// \ru Установить разрешение на импорт экспорт объектов определенного типа. \en Set permission for import-export of objects of a certain type.
|
||||
virtual void SetIoPermission( MbeIOPermiss nPermission, bool set ) = 0;
|
||||
/// \ru Получить значение специфичной строки для конвертера. \en Get the value of a certain string for the converter.
|
||||
virtual bool GetPropertyString ( MbeConverterStrings nString, std::string & propertyString ) const = 0;
|
||||
/// \ru Установить значение специфичной строки для конвертера. \en Set the value of a certain string for the converter.
|
||||
virtual void SetPropertyString ( MbeConverterStrings nString, const std::string & propertyString ) = 0;
|
||||
/// \ru Представление текста в аннотационных объектах. \en Text representation in annotation objects.
|
||||
virtual eTextForm GetAnnotationTextRepresentation () const { return exf_TextOnly; }
|
||||
/// \ru Следует ли компоненты экспортировать в разные файлы (если позволяет формат). \en Export components into separate files ( if provided in format).
|
||||
virtual bool ExportComponentsSeparately() const { return false; }
|
||||
/// \ru Получить ЛСК, относительно которой позиционирована модель. \en Get the location, the model is placed in.
|
||||
virtual MbPlacement3D GetOriginLocation() const = 0;
|
||||
/// \ru Заменять ли принудительно СК компонент на правые. \en Replace components' placements to right-oriented.
|
||||
virtual bool ReplaceLocationsToRight() const = 0;
|
||||
/** \brief \ru Сшивать ли поверхности автоматически.
|
||||
\en If surfaces should be stitched automatically. \~
|
||||
\return \ru true - Сшивать поверхности автоматически, false - Спросить пользователя, сшивать ли поверхности.
|
||||
\en true - Stitch surfaces automatically, false - Ask user first time. \~
|
||||
\param[out] stitchPrecision - \ru Точность сшивки.
|
||||
\en Stitch precision. \~
|
||||
*/
|
||||
virtual bool EnableAutoStitch( double& /*stitchPrecision*/ ) const = 0;
|
||||
|
||||
/** \brief \ru Получить множитель единиц длины по отношению к миллиметру.
|
||||
\en Get the factor of the length units to millimeters. \~
|
||||
\details \ru При импорте, если единицы измерения не заданы явно с помощью средств, предоставляемых обменным форматом,
|
||||
все размеры (координаты точек, радиусы) умножаются на возвращаемое значение. При экспорте либо с помощью
|
||||
средств, предоставляемых обменным форматом, задаются единицы измерения, либо все размеры модели (координаты
|
||||
точек, радиусы) умножаются на возвращаемое значение.
|
||||
\en During the import all spatial objects (coordinate values, radiuses) are multiplied by the returned value,
|
||||
unless the scale factor comes from the exchange file. During the export the exchange format facilities are
|
||||
used to specify the length units or all spatial objects (coordinate values, radiuses) are multiplied by the
|
||||
returned value. \~
|
||||
*/
|
||||
virtual double LengthUnitsFactor() const { return LENGTH_UNIT_MM; }
|
||||
|
||||
|
||||
/** \brief \ru Получить дополнительный множитель единиц длины по отношению к миллиметру в модели приложения.
|
||||
\en Get addifional factor of the length units to millimeters in the application model. \~
|
||||
\details \ru При импорте из всех форматов за исключением JT, если единицы измерения, в том числе и заданные
|
||||
явно с помощью средств, предоставляемых обменным форматом, все размеры (координаты точек, радиусы) умножаются
|
||||
на возвращаемое значение. При экспорте либо с помощью средств, предоставляемых обменным форматом, задаются
|
||||
единицы измерения, либо все размеры модели (координаты точек, радиусы) умножаются на возвращаемое значение.
|
||||
\en During the import from all formats except for JT all spatial objects (coordinate values, radiuses) are
|
||||
multiplied by the returned value, even if the scale factor comes from the exchange file. During the export the
|
||||
exchange format facilities are used to specify the length units or all spatial objects (coordinate values,
|
||||
radiuses) are multiplied by the returned value. \~
|
||||
*/
|
||||
virtual double AppLengthUnitsFactor() const { return LENGTH_UNIT_MM; }
|
||||
|
||||
/** \brief \ru Сделать запись в журнал конвертирования.
|
||||
\en Make a record in the converter report. \~
|
||||
\param[in] id - \ru Идентификатор элемента внутри файла стороннего формата.
|
||||
\en Identifier of an element inside the file of a foreign format. \~
|
||||
\param[in] msgType - \ru Тип сообщения.
|
||||
\en Message type. \~
|
||||
\param[in] msgText - \ru Код сообщения.
|
||||
\en Message code. \~
|
||||
*/
|
||||
virtual void LogReport( ptrdiff_t id, eMsgType msgType, eMsgDetail msgText ) = 0;
|
||||
|
||||
// /** \brief \ru Следует ли показывать сообщения и диалоги пользователю. \en Whether to show messages and dialog to the user. \~
|
||||
// \details \ru Обеспечивает работу через API. \en Provide possibility for work via API. \~
|
||||
// \return \ru true - обычная работа, false - через API. \en true - ordinary work, false - via API. \~
|
||||
// */
|
||||
virtual bool CanShowMessages() const = 0;
|
||||
/// \ru Дать данные вычисления триангуляции (для конвертера JT, STL и VRML). \en Get data for step calculation during triangulation (for JT, STL, VRML only).
|
||||
virtual MbStepData TesselationParameters() const { return MbStepData(); }
|
||||
/// \ru Дать данные вычисления триангуляции уровня детализации (для конвертера JT). \en Get data for step calculation during triangulation of LOD0 (for JTonly).
|
||||
virtual MbStepData LOD0TesselationParameters() const { return TesselationParameters(); }
|
||||
/// \ru Флаг сохранения совпадающих точек швов. (для конвертера STL и VRML). \en Whether to keep coincident points of seams (for STL, VRML only).
|
||||
virtual bool DualSeams() const { return true; }
|
||||
/// \ru Флаг сохранения совпадающих точек швов. (для конвертера STL и VRML). \en Whether to keep coincident points of seams (for STL, VRML only).
|
||||
virtual void DualSeams( bool ) {}
|
||||
/// \ru Проводить ли аудит траснляции. \en Whether to audit the translation.
|
||||
virtual bool TotalAudit() { return false; }
|
||||
|
||||
/// \ru Выполнять ли слияние подобных граней. \en Whether to join similar faces.
|
||||
virtual bool JoinSimilarFaces() const { return true; }
|
||||
/// \ru Добавлять ли удаленные грани в качестве оболочек. \en Whether to add removed faces as shells.
|
||||
virtual bool AddRemovedFacesAsShells() const { return false; }
|
||||
}; // IConvertorProperty3D
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс конвертера.
|
||||
\en Converter's interface. \~
|
||||
\details \ru Интерфейс конвертера реализует методы экспорта модели в файлы обменных форматов
|
||||
и импорта из них.
|
||||
\en Converter's interface implements methods of export of the model to files of exchange formats
|
||||
and import from them. \~
|
||||
*/
|
||||
class IConvertor3D {
|
||||
public:
|
||||
virtual ~IConvertor3D() {}
|
||||
|
||||
public:
|
||||
/** \brief \ru Прочитать файл формата SAT.
|
||||
\en Read a file of SAT format. \~
|
||||
\details \ru Прочитать файл формата SAT или указанный поток.
|
||||
Если задан поток, то запись производится в присланный поток.
|
||||
Если поток не задан (нулевой), то открывается поток для файла, заданного в свойствах конвертера. \n
|
||||
\en Read a file of SAT format or a specified stream.
|
||||
If a stream is specified, then the record is performed to the given stream.
|
||||
If a stream is not specified (null), then a stream is being opened for file specified in the properties of the converter. \n \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] stream - \ru Поток, из которого производится чтение (может быть NULL).
|
||||
\en Stream from which reading is performed (can be NULL). \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса (может быть NULL).
|
||||
\en The process progress indicator (can be NULL). \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей.
|
||||
\en Dialog of request for stitching the surfaces. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ACIS_Exchange
|
||||
*/
|
||||
virtual MbeConvResType SATRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, std::iostream * stream, IProgressIndicator * indicator, MbRefItem * qeuryStitch ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата SAT.
|
||||
\en Write file of SAT format. \~
|
||||
\details \ru Записать файл формата SAT или указанный поток.
|
||||
Если задан поток, то запись производится в присланный поток.
|
||||
Если поток не задан (нулевой), то открывается поток для файла, заданного в свойствах конвертера. \n
|
||||
\en Write file of SAT format or the specified stream.
|
||||
If a stream is specified, then the record is performed to the given stream.
|
||||
If a stream is not specified (null), then a stream is being opened for file specified in the properties of the converter. \n \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] stream - \ru Поток, в который производится запись (может быть NULL).
|
||||
\en Stream in which the record is performed (can be NULL). \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса (может быть NULL).
|
||||
\en The process progress indicator (can be NULL). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ACIS_Exchange
|
||||
*/
|
||||
virtual MbeConvResType SATWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, std::iostream * stream, IProgressIndicator * indicator ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата SAT.
|
||||
\en Read a file of SAT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей.
|
||||
\en Dialog of request for stitching the surfaces. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ACIS_Exchange
|
||||
*/
|
||||
virtual MbeConvResType SATRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата SAT.
|
||||
\en Write file of SAT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ACIS_Exchange
|
||||
*/
|
||||
virtual MbeConvResType SATWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата IGES.
|
||||
\en Read a file of IGES format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей.
|
||||
\en Dialog of request for stitching the surfaces. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
virtual MbeConvResType IGSRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата IGES.
|
||||
\en Write a file of IGES format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
virtual MbeConvResType IGSWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата JT.
|
||||
\en Read a file of JT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей.
|
||||
\en Dialog of request for stitching the surfaces. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
virtual MbeConvResType JTRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата JT.
|
||||
\en Write a file of JT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
virtual MbeConvResType JTWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата Parasolid.
|
||||
\en Read a file of Parasolid format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей.
|
||||
\en Dialog of request for stitching the surfaces. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Parasolid_Exchange
|
||||
*/
|
||||
virtual MbeConvResType XTRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата Parasolid.
|
||||
\en Write a file of Parasolid format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей.
|
||||
\en Dialog of request for stitching the surfaces. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Parasolid_Exchange
|
||||
*/
|
||||
virtual MbeConvResType XTWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата STEP.
|
||||
\en Read a file of STEP format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STEP_Exchange
|
||||
*/
|
||||
virtual MbeConvResType STEPRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата STEP.
|
||||
\en Write a file of STEP format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STEP_Exchange
|
||||
*/
|
||||
virtual MbeConvResType STEPWrite( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата STL.
|
||||
\en Read a file of STL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STL_Exchange
|
||||
*/
|
||||
virtual MbeConvResType STLRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата STL.
|
||||
\en Write a file of STL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STL_Exchange
|
||||
*/
|
||||
virtual MbeConvResType STLWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата VRML.
|
||||
\en Read a file of VRML format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup VRML_Exchange
|
||||
*/
|
||||
virtual MbeConvResType VRMLRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата VRML.
|
||||
\en Write a file of VRML format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\param[in] devSag - \ru Угловой шаг для расчёта триангуляционной сетки.
|
||||
\en Deviate sag requiref for grid calculateion. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup VRML_Exchange
|
||||
*/
|
||||
virtual MbeConvResType VRMLWrite( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл формата GRDECL.
|
||||
\en Read a file of GRDECL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup VRML_Exchange
|
||||
*/
|
||||
virtual MbeConvResType GRDECLRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл формата GRDECL.
|
||||
\en Write a file of GRDECL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STL_Exchange
|
||||
*/
|
||||
virtual MbeConvResType GRDECLWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл с облаком точек в формате ASCII.
|
||||
\en Read a file of ASCII Point Cloud format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ASCII_Exchange
|
||||
*/
|
||||
virtual MbeConvResType ASCIIPointCloudRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
/** \brief \ru Записать файл с облаком точек в формате ASCII..
|
||||
\en Write a point cloud file of ASCII format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\param[in] qeuryStitch - \ru Диалог запроса на сшивку поверхностей (не используется).
|
||||
\en Dialog of request for stitching the surfaces (not used). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ASCII_Exchange
|
||||
*/
|
||||
virtual MbeConvResType ASCIIPointCloudWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
}; // IConvertor3D
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Получить интерфейс конвертера.
|
||||
\en Get the converter interface. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC (IConvertor3D *) GetConvertor3D();
|
||||
|
||||
|
||||
|
||||
/** \brief \ru Прочитать файл формата SAT.
|
||||
\en Read a file of SAT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ACIS_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) SATRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator );
|
||||
|
||||
/** \brief \ru Записать файл формата SAT.
|
||||
\en Write file of SAT format. \~
|
||||
\details \ru Записать файл формата SAT или указанный поток.
|
||||
Если задан поток, то запись производится в присланный поток.
|
||||
Если поток не задан (нулевой), то открывается поток для файла, заданного в свойствах конвертера. \n
|
||||
\en Write file of SAT format or the specified stream.
|
||||
If a stream is specified, then the record is performed to the given stream.
|
||||
If a stream is not specified (null), then a stream is being opened for file specified in the properties of the converter. \n \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса (может быть NULL).
|
||||
\en The process progress indicator (can be NULL). \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ACIS_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) SATWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator );
|
||||
/** \brief \ru Прочитать файл формата IGES.
|
||||
\en Read a file of IGES format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) IGSRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата IGES.
|
||||
\en Write a file of IGES format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) IGSWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл формата JT.
|
||||
\en Read a file of JT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) JTRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата JT.
|
||||
\en Write a file of JT format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup IGES_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) JTWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл формата Parasolid.
|
||||
\en Read a file of Parasolid format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~\~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Parasolid_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) XTRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата Parasolid.
|
||||
\en Write a file of Parasolid format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Parasolid_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) XTWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл формата STEP.
|
||||
\en Read a file of STEP format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STEP_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) STEPRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата STEP.
|
||||
\en Write a file of STEP format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STEP_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) STEPWrite( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл формата STL.
|
||||
\en Read a file of STL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STL_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) STLRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата STL.
|
||||
\en Write a file of STL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STL_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) STLWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл формата VRML.
|
||||
\en Read a file of VRML format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup VRML_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) VRMLRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл формата GRDECL.
|
||||
\en Read a file of GRDECL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup VRML_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) GRDECLRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата GRDECL.
|
||||
\en Write a file of GRDECL format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup STL_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) GRDECLWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Записать файл формата VRML.
|
||||
\en Write a file of VRML format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup VRML_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) VRMLWrite( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
|
||||
/** \brief \ru Прочитать файл с облаком точек в формате ASCII.
|
||||
\en Read a file of ASCII Point Cloud format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ASCII_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) ASCIIPointCloudRead ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
|
||||
/** \brief \ru Записать файл с облаком точек в формате ASCII..
|
||||
\en Write a point cloud file of ASCII format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ASCII_Exchange
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType ) ASCIIPointCloudWrite( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0 );
|
||||
|
||||
|
||||
namespace c3d {
|
||||
|
||||
/** \brief \ru Прочитать файл обменного формата в модель.
|
||||
\en Read a file of an exchange format into model. \~
|
||||
\details \ru Если свойства конвертера заданы, аргумент fileName игнорируется, а имя файла берётся из свойств конвертера.
|
||||
В противном случае импорт идёт с умолчательными параметрами, соответствующими реализации ConvConvertorProperty3D. \~
|
||||
\en The fileName argument is not used if converter properties are defined obviously, file path comes from the FullFilePath
|
||||
method. Otherwise default parameters corresponding ConvConvertorProperty3D implementation are used for import.
|
||||
\param[out] model - \ru Модель.
|
||||
\en The model. \~
|
||||
\param[in] filePath - \ru Путь файла.
|
||||
\en File path. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType) ImportFromFile( MbModel & model,
|
||||
const path_string & fileName,
|
||||
IConvertorProperty3D * prop = 0,
|
||||
IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Прочитать файл обменного формата в модель.
|
||||
\en Read a file of an exchange format into model. \~
|
||||
\details \ru Если свойства конвертера заданы, аргумент fileName игнорируется, а имя файла берётся из свойств конвертера.
|
||||
В противном случае импорт идёт с умолчательными параметрами, соответствующими реализации ConvConvertorProperty3D. \~
|
||||
\en The fileName argument is not used if converter properties are defined obviously, file path comes from the FullFilePath
|
||||
method. Otherwise default parameters corresponding ConvConvertorProperty3D implementation are used for import.
|
||||
\param[out] mDoc - \ru Модельный документ.
|
||||
\en The model. \~
|
||||
\param[in] filePath - \ru Путь файла.
|
||||
\en File path. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType) ImportFromFile( ItModelDocument & mDoc,
|
||||
const path_string & filePath,
|
||||
IConvertorProperty3D * prop,
|
||||
IProgressIndicator * indicator );
|
||||
|
||||
/** \brief \ru Записать модель в файл обменного формата.
|
||||
\en Write the model into an exchange format file. \~
|
||||
\details \ru Если свойства конвертера заданы, аргумент fileName игнорируется, а имя файла берётся из свойств конвертера.
|
||||
В противном случае экспорт идёт с умолчательными параметрами, соответствующими реализации ConvConvertorProperty3D. \~
|
||||
\en The fileName argument is not used if converter properties are defined obviously, file path comes from the FullFilePath
|
||||
method. Otherwise default parameters corresponding ConvConvertorProperty3D implementation are used for export.
|
||||
\param[out] model - \ru Модель.
|
||||
\en The model. \~
|
||||
\param[in] filePath - \ru Путь файла.
|
||||
\en File path. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType) ExportIntoFile( MbModel & model,
|
||||
const path_string & filePath,
|
||||
IConvertorProperty3D * prop = 0,
|
||||
IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Импортировать данные из буфера в модель.
|
||||
\en Import data from buffer into model. \~
|
||||
\param[out] model - \ru Модель.
|
||||
\en The model. \~
|
||||
\param[in] data - \ru Буфер.
|
||||
\en Buffer. \~
|
||||
\param[in] length - \ru Размер буфера.
|
||||
\en Buffer size. \~
|
||||
\param[in] modelFormat - \ru Формат модели.
|
||||
\en Model format. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType) ImportFromBuffer( MbModel & model,
|
||||
const char * data,
|
||||
size_t length,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
IConvertorProperty3D * prop = 0,
|
||||
IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Экспортировать модель в буфер.
|
||||
\en Export model into buffer. \~
|
||||
\param[in] model - \ru Модель.
|
||||
\en The model. \~
|
||||
\param[in] modelFormat - \ru Формат модели.
|
||||
\en Model format. \~
|
||||
\param[out] data - \ru Буфер.
|
||||
\en Buffer. \~
|
||||
\param[out] length - \ru Размер буфера.
|
||||
\en Buffer size. \~
|
||||
\param[in] prop - \ru Реализация интерфейса свойств конвертера.
|
||||
\en Implementation of converter's properties interface. \~
|
||||
\param[in] indicator - \ru Индикатор хода процесса.
|
||||
\en The process progress indicator. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC (MbeConvResType) ExportIntoBuffer( MbModel & model,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
char *& data,
|
||||
size_t & length,
|
||||
IConvertorProperty3D * prop = 0,
|
||||
IProgressIndicator * indicator = 0 );
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
|
||||
|
||||
#endif // __CONV_I_CONVERTER_H
|
||||
@@ -0,0 +1,712 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Интерфейсы, используемые при импорте и экспорте.
|
||||
\en Interfaces used for import and export. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_MODEL_PROPERTIES_H
|
||||
#define __CONV_MODEL_PROPERTIES_H
|
||||
|
||||
|
||||
#include <model_item.h>
|
||||
#include <attribute.h>
|
||||
#include <conv_error_result.h>
|
||||
#include <conv_annotation_item.h>
|
||||
#include <conv_i_converter.h>
|
||||
#include <mb_enum.h>
|
||||
#include <templ_ifc_array.h>
|
||||
#include <alg_indicator.h>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
class MATH_CLASS MbPlacement3D;
|
||||
class MATH_CLASS MbItem;
|
||||
class MATH_CLASS MbName;
|
||||
class ItModelAssembly;
|
||||
class ItModelPart;
|
||||
|
||||
|
||||
/** \brief \ru Контейнер объектов аннотации.
|
||||
\en Container of annotation objects. \~
|
||||
\ingroup Exchange_Base
|
||||
*/
|
||||
typedef std::vector<AnnotationSPtr> vector_of_annotation;
|
||||
|
||||
|
||||
/** \brief \ru Ассоциация наборов аннотационных объектов элементам со счётчиком ссылок.
|
||||
\en Association of sets of annotation objects with elements with reference counter. \~
|
||||
\ingroup Exchange_Base
|
||||
*/
|
||||
typedef std::map< SPtr<const MbItem>, vector_of_annotation > map_of_visual_items;
|
||||
|
||||
|
||||
/** \brief \ru Контейнер текстовых блоков.
|
||||
\en Container of text blocks. \~
|
||||
\ingroup Exchange_Base
|
||||
*/
|
||||
typedef std::vector< SPtr<MaTextItem> > vector_of_text;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Типы линий, передаваемых через конвертер.
|
||||
\en Types of lines passed via converter. \~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeLineFontPattern {
|
||||
lfp_BEGIN = 0, ///< \ru Для удобства перебора. \en For the convenient search.
|
||||
lfp_STEPcontinuous, ///< \ru Непрерывная в конвертерах STEP и IGES. \en Continuous line in STEP and IGES (Solid) converters.
|
||||
lfp_STEPchain, ///< \ru Штрих-пунктирная в конвертерах STEP и IGES. \en Chain line( dash-dotted) in STEP and IGES converters.
|
||||
lfp_STEPchainDoubleDash, ///< \ru Штриховая с двумя пунктирами в конвертерах STEP и IGES. \en Dash-double-dot line in STEP and IGES (Phantom) converter.
|
||||
lfp_STEPdashed, ///< \ru Штриховая в конвертерах STEP и IGES. \en Dash line in STEP and IGES converters.
|
||||
lfp_STEPdotted, ///< \ru Пунктирная в конвертерах STEP и IGES. \en Dotted line in STEP and IGES converters.
|
||||
lfp_END ///< \ru Для удобства перебора. \en For search
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Отображение точек, передаваемых через конвертер.
|
||||
\en Representation of points passed via converter. \~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeDotMarkerSymbol {
|
||||
dms_BEGIN = 0, ///< \ru Для удобства перебора. \en For the convenient search.
|
||||
dms_STEPdot, ///< \ru Точка. \en A point.
|
||||
dms_STEPx, ///< \ru Косой крест. \en x - cross.
|
||||
dms_STEPplus, ///< \ru Прямой крест. \en Plus.
|
||||
dms_STEPasterisk, ///< \ru Звёздочка. \en Asterisk.
|
||||
dms_STEPring, ///< \ru Кольцо. \en Ring.
|
||||
dms_STEPsquare, ///< \ru Квадрат. \en Square.
|
||||
dms_STEPtriangle, ///< \ru Треугольник. \en Triangle.
|
||||
dms_END ///< \ru Для удобства перебора. \en For the convenient search.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип объектов, которые необходимо выдать для экспорта или добавить при импорте.
|
||||
\en Type of objects to be returned for export or to be added while importing. \~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
enum MbeGettingItemType {
|
||||
git_Item = 0, ///< \ru Получить элементы всех типов. \en Get items of all types.
|
||||
git_Solid, ///< \ru Получить тела. \en Get solids.
|
||||
git_Surface, ///< \ru Получить поверхности. \en Get surfaces.
|
||||
git_WireFrame, ///< \ru Получить проволочные каркасы. \en Get wire frames.
|
||||
git_PlaneInstance, ///< \ru Получить вставки плоских объектов (эскизы). \en Get plane instances (drafts).
|
||||
git_PointFrame, ///< \ru Получить точечные каркасы. \en Get point frames.
|
||||
git_AssociatedGeometry ///< \ru Получить ассоциированные геометрические объекты (резьбы). \en Get associated geometry objects (threads).
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс свойств вставки, подсборки или детали.
|
||||
\en Interface of properties of an instance, a subassembly or a part. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class ItModelInstanceProperties : public MbRefItem
|
||||
{
|
||||
public:
|
||||
|
||||
/// \ru Атрибуты. \en Attributes.
|
||||
|
||||
/// \ru Задать атрибуты. \en Set attributes.
|
||||
virtual bool SetAttributes( const c3d::AttrSPtrVector& /*attributes*/ ) = 0;
|
||||
|
||||
/// \ru Получить атрибуты. \en Get attributes.
|
||||
virtual c3d::AttrSPtrVector GetAttributes( ) const = 0;// { return c3d::AttrSPtrVector(); }
|
||||
|
||||
|
||||
/// \ru Технические требования. \en Technical requirements.
|
||||
|
||||
/// \ru Получить технические требования. \en Get technical requirements.
|
||||
virtual void GetRequirements( vector_of_annotation &, eTextForm ) const = 0;
|
||||
|
||||
/// \ru Задать технические требования. \en Set technical requirements.
|
||||
virtual void SetRequirements( const vector_of_annotation & ) = 0;
|
||||
|
||||
/// \ru Наименование. \en Name.
|
||||
|
||||
/// \ru Задать имя документа. \en Set document's name.
|
||||
DEPRECATE_DECLARE virtual bool SetName( const std::string& /*name*/ ) { return false; };
|
||||
/// \ru Получить имя документа. \en Get document's name.
|
||||
DEPRECATE_DECLARE virtual std::string Name() const { return std::string(); };
|
||||
|
||||
/// \ru Обозначение. \en Marking.
|
||||
|
||||
/// \ru Задать обозначение документа. \en Set document marking.
|
||||
DEPRECATE_DECLARE virtual bool SetMarking( const std::string& /*name*/ ) { return false; };
|
||||
/// \ru Получить обозначение документа. \en Get document marking.
|
||||
DEPRECATE_DECLARE virtual std::string Marking() const { return std::string(); };
|
||||
|
||||
/// \ru Автор. \en Author.
|
||||
|
||||
/// \ru Задать имя автора. \en Set author's name.
|
||||
DEPRECATE_DECLARE virtual bool SetAuthor( const std::string& /*name*/ ) { return false; };
|
||||
/// \ru Получить имя автора. \en Get author's name.
|
||||
DEPRECATE_DECLARE virtual std::string Author() const { return std::string(); };
|
||||
|
||||
/// \ru Организация. \en Organization.
|
||||
|
||||
/// \ru Задать имя автора. \en Set author's name.
|
||||
DEPRECATE_DECLARE virtual bool SetOrganization( const std::string& /*name*/ ) { return false; };
|
||||
/// \ru Получить имя автора. \en Get author's name.
|
||||
DEPRECATE_DECLARE virtual std::string Organization() const { return std::string(); };
|
||||
|
||||
/// \ru Комментарий. \en Comment.
|
||||
|
||||
/// \ru Задать комментарии. \en Set the comments.
|
||||
DEPRECATE_DECLARE virtual bool SetComments( const std::vector< std::string > & /*comments*/ ) { return false; };
|
||||
/// \ru Получить следующий комментарий. \en Get the next comment.
|
||||
DEPRECATE_DECLARE virtual std::vector< std::string > GetComments( ) const { return std::vector< std::string >(); };
|
||||
|
||||
/// \ru Цвет сборки, детали или вставки. \en Color of an assembly, a part or an instance.
|
||||
|
||||
/// \ru Задать цветовые свойства. \en Set color properties.
|
||||
DEPRECATE_DECLARE virtual bool SetColor( const MbAttributeContainer & ) { return false; };
|
||||
/// \ru Получить цветовые свойства. \en Get color properties.
|
||||
DEPRECATE_DECLARE virtual bool GetColor( MbAttributeContainer & ) const { return false; };
|
||||
|
||||
/// \ru Цвет тела. \en Solid color.
|
||||
|
||||
/// \ru Задать цветовые свойства оболочки. \en Set color properties of a shell.
|
||||
DEPRECATE_DECLARE virtual bool SetColor( const MbAttributeContainer &, size_t ) { return false; };
|
||||
|
||||
/// \ru Цвет грани. \en Face color.
|
||||
|
||||
/// \ru Задать цветовые свойства грани \en Set color properties of a face.
|
||||
DEPRECATE_DECLARE virtual bool SetColor( const MbAttributeContainer &, const MbName & ) { return false; };
|
||||
/// \ru Получить цветовые свойства грани. \en Get color properties of a face.
|
||||
DEPRECATE_DECLARE virtual bool GetColor( MbAttributeContainer &, const MbName & ) const { return false; };
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс вставки компоненты.
|
||||
\en Interface of the component instance. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class ItModelInstance : public ItModelInstanceProperties
|
||||
{
|
||||
public:
|
||||
// \ru Выдать идентификатор сборки или детали \en Get identifier of an assembly or a part
|
||||
virtual void * GetId() = 0;
|
||||
/// \ru Выдать расположение этой вставки в координатах родителя. \en Get the placement of this instance in parent's coordinates.
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const = 0;
|
||||
/// \ru Это сборка? \en Is it an assembly?
|
||||
virtual bool IsAssembly() const = 0;
|
||||
/// \ru Это ни сборка, ни деталь? \en Is it neither an assembly nor a part?
|
||||
virtual bool IsEmpty() const = 0;
|
||||
|
||||
/** \brief \ru Создать пустую сборку при импорте и увеличить счётчик ссылок на 1.
|
||||
\en Create an empty assembly while importing and increase the reference counter by 1. \~
|
||||
\param[in] place - \ru ЛСК сборки в родительской модели.
|
||||
\en LCS of the assembly in the parent's model. \~
|
||||
\param[in] fileName - \ru Имя сборки.
|
||||
\en Assembly name. \~
|
||||
\return \ru Экземпляр сборки, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of an assembly if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelAssembly> CreateAssembly( const MbPlacement3D &place, const std::vector< SPtr<MbItem> > & componentItems, const c3d::string_t& fileName ) = 0;
|
||||
|
||||
/** \brief \ru Создать деталь при импорте.
|
||||
\en Create a part while importing. \~
|
||||
\details \ru Увеличить счётчик ссылок детали на 1.
|
||||
\en Increase the reference counter of a part by 1. \~
|
||||
\param[in] place - \ru ЛСК детали.
|
||||
\en LCS of a part. \~
|
||||
\param[in] solids - \ru Тела, включаемые в деталь.
|
||||
\en Solids included in the part. \~
|
||||
\param[in] fileName - \ru Название детали.
|
||||
\en Solid's name. \~
|
||||
\return \ru Экземпляр детали, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of the part if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelPart> CreatePart( const MbPlacement3D &place, const std::vector< SPtr<MbItem> > & componentItems, const c3d::string_t& fileName ) = 0;
|
||||
|
||||
/** \brief \ru Получить сборку для экспорта.
|
||||
\en Get an assembly for export. \~
|
||||
\return \ru Экземпляр сборки, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of an assembly if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelAssembly> GetInstanceAssembly( ) = 0;
|
||||
|
||||
|
||||
/** \brief \ru Получить деталь для экспорта.
|
||||
\en Get the detail for export. \~
|
||||
\return \ru Экземпляр детали, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of the part if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelPart> GetInstancePart( ) = 0;
|
||||
|
||||
/** \brief \ru Создать подсборку при импорте, и её вставку.
|
||||
\en Create a subassembly and its instance while importing. \~
|
||||
\param[in] place - \ru ЛСК сборки в родительской модели.
|
||||
\en LCS of the assembly in the parent's model. \~
|
||||
\param[in] existing - \ru Сборка, подлежащая вставке.
|
||||
\en An assembly to insert. \~
|
||||
\return \ru true, если операция прошла успешно, false в противном случае.
|
||||
\en true if the operation succeeded, false - otherwise. \~
|
||||
*/
|
||||
virtual bool SetAssembly( const MbPlacement3D & place, const ItModelAssembly * existing ) = 0;
|
||||
|
||||
/** \brief \ru Создать деталь при импорте, и её вставку.
|
||||
\en Create a part while importing and its instance. \~
|
||||
\param[in] place - \ru ЛСК детали в родительской модели.
|
||||
\en LCS of a part in the parent's model. \~
|
||||
\param[in] existing - \ru Деталь, подлежащая вставке.
|
||||
\en Detail to insert. \~
|
||||
\return \ru true, если операция прошла успешно, false в противном случае.
|
||||
\en true if the operation succeeded, false - otherwise. \~
|
||||
*/
|
||||
virtual bool SetPart( const MbPlacement3D & place, const ItModelPart * existing ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс сборки.
|
||||
\en Interface of the assembly. \~
|
||||
\details \ru Экземпляр должен порождаться в методах CreateAssembly реализаций
|
||||
интерфейсов ItModelDocument и ItModelAInstance. Собственные элементы детали
|
||||
должны передаваться как параметры конструктора. \~ \en The object should be
|
||||
created in the CreateAssembly method of the implementations of the
|
||||
ItModelDocument and ItModelInstance interfaces. Own Items of the detail should
|
||||
be arguments of the constructor.
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class ItModelAssembly : public ItModelInstanceProperties
|
||||
{
|
||||
public:
|
||||
/** \brief \ru Получить имя файла сборки без пути и расширения для экспорта.
|
||||
\en Get the file name of an assembly without the path and the extension for export. \~
|
||||
\return \ru Имя файла сборки.
|
||||
\en An assembly file name. \~
|
||||
*/
|
||||
virtual c3d::path_string PureFileName() const = 0;
|
||||
|
||||
/** \brief \ru Получить пустой интерфейс вставки для создания подсборки или детали при импорте.
|
||||
\en Get an empty interface of the insertion for creation of subassembly or a part while importing. \~
|
||||
\details \ru Увеличить счётчик ссылок на 1.
|
||||
\en Increase the reference counter by 1. \~
|
||||
\return \ru Интерфейс вставки, если операция прошла успешно или NULL в противном случае.
|
||||
\en Interface of the instance if the operation succeeded and NULL otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelInstance> PrepareInstance() = 0;
|
||||
|
||||
/** \brief \ru Получить интерфейс следующей вставки для создания подсборки или детали при экспорте.
|
||||
\en Get the interface of the next insertion for creation of a subassembly or a part while exporting. \~
|
||||
\return \ru Интерфейс вставки, если операция прошла успешно или NULL в противном случае.
|
||||
\en Interface of the insertion if the operation succeeded and NULL otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelInstance> NextInstance( bool includeInvisible ) = 0;
|
||||
|
||||
/// \ru Выдать ЛСК, общую для элементов компонента. \en Get the placement, which all the items of the component use for transformation.
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const { return false; };
|
||||
|
||||
/** \brief \ru Получить объекты из корня сборки при экспорте.
|
||||
\en Get objects from the assembly root while exporting. \~
|
||||
\param[out] items - \ru Наполняемый массив (состоит из объектов классов MbSolid, MbCurve3D, MbCartPoint3D).
|
||||
\en Array to fill (consist of objects of classes MbSolid, MbCurve3D, MbCartPoint3D). \~
|
||||
\param[in] includeInvisible - \ru Если true, то выдаются все тела, включая невидимые, если false - только видимые.
|
||||
\en If true, then all the solids are returned, including invisible ones, if false - only visible ones. \~
|
||||
*/
|
||||
virtual void GetItems( std::vector< SPtr<MbItem> > & items, MbeGettingItemType itemType, bool includeInvisible ) const = 0;
|
||||
|
||||
/** \brief \ru Добавить объекты в корень сборки при импорте.
|
||||
\en Add objects to the assembly root while importing. \~
|
||||
\param[in] items - \ru Объекты, добавляемые в модель (тела, кривые и точки).
|
||||
\en Objects to add to the model (solids, curves and points). \~
|
||||
*/
|
||||
virtual void AddItems( const std::vector< SPtr<MbItem> > & items ) = 0;
|
||||
|
||||
/** \brief \ru Получить элементы аннотации из сборки.
|
||||
\en Get elements of annotation from the assembly. \~
|
||||
\param[in] eTextForm - \ru Форма представления текста.
|
||||
\en Text representation form. \~
|
||||
\param[in] includeInvisible - \ru Если true, то выдаются все объекты аннотации, включая невидимые, если false - только видимые.
|
||||
\en If true, all the annotation objects are returned, including invisible ones, if false - only visible ones. \~
|
||||
\return \ru Контейнер объектов аннотации.
|
||||
\en Vector of annotation objects. \~
|
||||
*/
|
||||
virtual vector_of_annotation GetAnnotationItems( eTextForm, bool ) const { return vector_of_annotation(); }; // Реализация будет удалена после того, как она будет осуществлена на стороне 3D
|
||||
virtual vector_of_annotation GetAnnotationItems( eTextForm ) const { return vector_of_annotation(); }; // Будет удалена после её реализации на стороне 3D
|
||||
|
||||
/** \brief \ru Задать элементы аннотации в сборке.
|
||||
\en Set elements of annotation in the assembly. \~
|
||||
\param[in] sourceDim - \ru Элементы аннотации
|
||||
\en Elements of annotation. \~
|
||||
*/
|
||||
virtual void SetAnnotationItems( const vector_of_annotation & ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс детали.
|
||||
\en Interface of a part. \~
|
||||
\details \ru Экземпляр должен порождаться в методах CreatePart реализаций
|
||||
интерфейсов ItModelDocument и ItModelAInstance. Собственные элементы детали
|
||||
должны передаваться как параметры конструктора. \~ \en The object should be
|
||||
created in the CreatePart method of the implementations of the
|
||||
ItModelDocument and ItModelInstance interfaces. Own Items of the detail should
|
||||
be arguments of the constructor.
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class ItModelPart : public ItModelInstanceProperties
|
||||
{
|
||||
public:
|
||||
/** \brief \ru Получить имя файла детали без пути и расширения для экспорта.
|
||||
\en Get the file name of a part without the path and extension for export. \~
|
||||
\return \ru Имя файла детали.
|
||||
\en A part file name. \~
|
||||
*/
|
||||
virtual c3d::path_string PureFileName() const = 0;
|
||||
|
||||
/** \brief \ru Получить пустой интерфейс вставки для создания подсборки или детали при импорте.
|
||||
\en Get an empty interface of the insertion for creation of subassembly or a part while importing. \~
|
||||
\details \ru Увеличить счётчик ссылок на 1.
|
||||
\en Increase the reference counter by 1. \~
|
||||
\return \ru Интерфейс вставки, если операция прошла успешно или NULL в противном случае.
|
||||
\en Interface of the instance if the operation succeeded and NULL otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelInstance> PrepareInstance() = 0;
|
||||
|
||||
/** \brief \ru Получить интерфейс следующей вставки для создания подсборки или детали при экспорте.
|
||||
\en Get the interface of the next insertion for creation of a subassembly or a part while exporting. \~
|
||||
\return \ru Интерфейс вставки, если операция прошла успешно или NULL в противном случае.
|
||||
\en Interface of the insertion if the operation succeeded and NULL otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelInstance> NextInstance( bool includeInvisible ) = 0;
|
||||
|
||||
/// \ru Выдать ЛСК, общую для элементов компонента. \en Get the placement, which all the items of the component use for transformation.
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const { return false; };
|
||||
|
||||
/** \brief \ru Получить объекты из детали при экспорте.
|
||||
\en Get objects from the part while exporting. \~
|
||||
\param[out] items - \ru Наполняемый массив (состоит из объектов классов MbSolid, MbWireFrame, MbPointFrame).
|
||||
\en Array to fill (consists of objects of classes MbSolid, MbWireFrame, MbPointFrame). \~
|
||||
\param[in] itemType - \ru Тип объектов, которыми нужно наполнить массив.
|
||||
\en Type of objects the array should be filled with. \~
|
||||
\param[in] includeInvisible - \ru Если true, то выдаются все тела, включая невидимые, если false - только видимые.
|
||||
\en If true, all the solids are returned, including invisible ones, if false - only visible ones. \~
|
||||
*/
|
||||
virtual void GetItems( std::vector< SPtr<MbItem> > & items, MbeGettingItemType itemType, bool includeInvisible ) const = 0;
|
||||
|
||||
/** \brief \ru Добавить объекты в деталь при импорте.
|
||||
\en Add objects to a part while importing. \~
|
||||
\param[in] items - \ru Объекты, добавляемые в модель (кривые и точки).
|
||||
\en Objects to be added to the model (curves and points). \~
|
||||
*/
|
||||
virtual void AddItems( const std::vector< SPtr<MbItem> > & items ) = 0;
|
||||
|
||||
/** \brief \ru Получить элементы аннотации из детали.
|
||||
\en Get elements of annotation from the detail. \~
|
||||
\param[in] eTextForm - \ru Форма представления текста.
|
||||
\en Text representation form. \~
|
||||
\param[in] includeInvisible - \ru Если true, то выдаются все объекты аннотации, включая невидимые, если false - только видимые.
|
||||
\en If true, all the annotation objects are returned, including invisible ones, if false - only visible ones. \~
|
||||
\return \ru Контейнер объектов аннотации.
|
||||
\en Vector of annotation objects. \~
|
||||
*/
|
||||
virtual vector_of_annotation GetAnnotationItems( eTextForm, bool ) const { return vector_of_annotation(); }; // Реализация будет удалена после того, как она будет осуществлена на стороне 3D
|
||||
virtual vector_of_annotation GetAnnotationItems( eTextForm ) const { return vector_of_annotation(); }; // Будет удалена после её реализации на стороне 3D
|
||||
|
||||
|
||||
/** \brief \ru Задать элементы аннотации в детали.
|
||||
\en Set elements of annotation in the part. \~
|
||||
\param[in] sourceDim - \ru Элементы аннотации
|
||||
\en Elements of annotation. \~
|
||||
*/
|
||||
virtual void SetAnnotationItems( const vector_of_annotation & ) = 0;
|
||||
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Интерфейс документа модели сборки или детали.
|
||||
\en Interface of document of an assembly model or a part model. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class ItModelDocument : public MbRefItem
|
||||
{
|
||||
public:
|
||||
/// \ru Это сборка? \en Is it an assembly?
|
||||
virtual bool IsAssembly() const = 0;
|
||||
/// \ru Это ни сборка, ни деталь? \en Is it neither an assembly nor a part?
|
||||
virtual bool IsEmpty() const = 0;
|
||||
|
||||
/** \brief \ru Прообраз новой интерфейсной функции - задать модель ЛСК, относительно которой позиционируется модель.
|
||||
\en Prototype of a new interface function - get the placement the model is defined in. \~
|
||||
*/
|
||||
//virtual MbPlacement3D GetOriginLocation() const = 0;
|
||||
|
||||
/** \brief \ru Прообраз новой интерфейсной функции - задать модель для наполнения.
|
||||
\en Prototype of a new interface function - set a model to fill. \~
|
||||
*/
|
||||
virtual void SetContent( MbItem* /*content*/) = 0;
|
||||
|
||||
/** \brief \ru Прообраз новой интерфейсной функции - получить наполнение.
|
||||
\en Prototype of a new interface function - get the filling. \~
|
||||
*/
|
||||
virtual MbItem * GetContent() /*{ return NULL; }*/ = 0;
|
||||
|
||||
/** \brief \ru Создать документ с новой сборкой при импорте.
|
||||
\en Create a document with a new assembly while importing. \~
|
||||
\details \ru Увеличить счётчик ссылок результирующего документа на 1.
|
||||
\en Increase the reference counter of the resultant document by 1. \~
|
||||
\param[in] fileName - \ru Имя сборки.
|
||||
\en Assembly name. \~
|
||||
\param[in] solids - \ru Тела, добавляемые в сборку.
|
||||
\en Solids to add into the assembly. \~
|
||||
\return \ru Экземпляр сборки, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of an assembly if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelAssembly> CreateAssembly( const std::vector< SPtr<MbItem> > & componentItems, const c3d::string_t& fileName ) = 0;
|
||||
|
||||
|
||||
/** \brief \ru Создать документ с новой деталью при импорте.
|
||||
\en Create a document with a new part while importing. \~
|
||||
\details \ru Увеличить счётчик ссылок результирующего документа на 1.
|
||||
\en Increase the reference counter of the resultant document by 1. \~
|
||||
\param[in] solids - \ru Тела, добавляемые в деталь.
|
||||
\en Solids to add into a part. \~
|
||||
\param[in] fileName - \ru Имя детали.
|
||||
\en A part name. \~
|
||||
\return \ru Экземпляр детали, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of the part if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelPart> CreatePart( const std::vector< SPtr<MbItem> > & componentItems, const c3d::string_t& fileName ) = 0;
|
||||
|
||||
/** \brief \ru Получить сборку для экспорта.
|
||||
\en Get an assembly for export. \~
|
||||
\details \ru Увеличить счётчик ссылок результирующей сборки на 1.
|
||||
\en Increase the reference counter of the resultant assembly by 1. \~
|
||||
\return \ru Экземпляр сборки, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of an assembly if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelAssembly> GetInstanceAssembly( ) = 0;
|
||||
|
||||
|
||||
/** \brief \ru Получить деталь для экспорта.
|
||||
\en Get the detail for export. \~
|
||||
\details \ru Увеличить счётчик ссылок результирующей детали на 1.
|
||||
\en Increase the reference counter of the resultant part by 1. \~
|
||||
\return \ru Экземпляр детали, если операция прошла успешно, NULL в противном случае.
|
||||
\en Instance of the part if the operation succeeded, NULL - otherwise. \~
|
||||
*/
|
||||
virtual SPtr<ItModelPart> GetInstancePart( ) = 0;
|
||||
|
||||
/** \brief \ru Завершить импорт и сохранить документ.
|
||||
\en Complete the import and save the document. \~
|
||||
\return \ru true, если операция прошла успешно, false в противном случае.
|
||||
\en true if the operation succeeded, false - otherwise. \~
|
||||
\param[in] \ru indicator Объект для отображения хода процесса.
|
||||
\en indicator An object indicating a process progress. \~
|
||||
*/
|
||||
virtual bool FinishImport( IProgressIndicator * indicator ) = 0;
|
||||
|
||||
/** \brief \ru Получить элементы аннотации, соответствующие элементам геометрической модели.
|
||||
\en Get elements of annotation, corresponding items of geometric model. \~
|
||||
\param[in] eTextForm - \ru Форма представления текста.
|
||||
\en Text representation form. \~
|
||||
\return \ru Контейнер объектов аннотации.
|
||||
\en Vector of annotation objects. \~
|
||||
*/
|
||||
virtual map_of_visual_items GetAnnotationItems( eTextForm ) const = 0;
|
||||
|
||||
/// \ru Задать размеры. \en Set sizes.
|
||||
virtual void SetAnnotationItems( const map_of_visual_items& ) = 0;
|
||||
|
||||
/// \ru Открыть документ. \en Open a document.
|
||||
virtual void OpenDocument() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Реализация документа модели, формирующая регулярную структуру.
|
||||
\en Implementation of model document which has regular structure. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS C3dModelDocument: public ItModelDocument {
|
||||
|
||||
SPtr<ItModelPart> part; ///< \ru Представление в виде детали. \en Representation as detail.
|
||||
SPtr<ItModelAssembly> assembly; ///< \ru Представление в виде сборки. \en Representation as assembly.
|
||||
map_of_visual_items visualItems; ///< \ru Элементы аннотации. \en Annotation items.
|
||||
c3d::ItemSPtr rawContent;
|
||||
public:
|
||||
|
||||
virtual ~C3dModelDocument(); ///< \ru Деструктор. \en Descructor.
|
||||
|
||||
// Является ли сборкой.
|
||||
virtual bool IsAssembly() const;
|
||||
// Пуст ли.
|
||||
virtual bool IsEmpty() const;
|
||||
// Задать модель напрямую.
|
||||
virtual void SetContent( MbItem* /*content*/);
|
||||
// Выдать модель напрямую.
|
||||
virtual MbItem * GetContent();
|
||||
// Создать сборку.
|
||||
virtual SPtr<ItModelAssembly> CreateAssembly( const std::vector< SPtr<MbItem> > & componentItems, const c3d::string_t& fileName );
|
||||
// Создать деталь.
|
||||
virtual SPtr<ItModelPart> CreatePart( const std::vector< SPtr<MbItem> > & componentItems, const c3d::string_t& fileName );
|
||||
// Выдать сборку.
|
||||
virtual SPtr<ItModelAssembly> GetInstanceAssembly( );
|
||||
// Выдать деталь.
|
||||
virtual SPtr<ItModelPart> GetInstancePart( );
|
||||
// Завершить импорт.
|
||||
virtual bool FinishImport( IProgressIndicator * );
|
||||
// Выдать элементы аннотации.
|
||||
virtual map_of_visual_items GetAnnotationItems( eTextForm ) const;
|
||||
// Задать элементы аннотации.
|
||||
virtual void SetAnnotationItems( const map_of_visual_items& vi );
|
||||
// Открыть документ.
|
||||
virtual void OpenDocument();
|
||||
|
||||
/// \ru Зарегистрировать элемент аннотации. \en Register annotation object.
|
||||
void RegisterAnnotation( c3d::ItemSPtr component, const vector_of_annotation& annotation, const vector_of_annotation& requirements );
|
||||
};
|
||||
|
||||
|
||||
typedef C3dModelDocument RegularModelDocument;
|
||||
typedef C3dModelDocument ConvModelDocument;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Упрощенная реализация интерфейса свойств конвертера.
|
||||
\en Simple implementation of converter's properties. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
class CONV_CLASS ConvConvertorProperty3D : public IConvertorProperty3D {
|
||||
public:
|
||||
std::string docName; ///< \ru Имя документа. \en Document name.
|
||||
c3d::path_string fileName; ///< \ru Имя файла. \en File name.
|
||||
bool fileASCII; ///< \ru Экспортировать ли в текстовый файл (если формат поддерживает двоичный). \en Export to text file (if format supports binary one).
|
||||
long int formatVersion; /// \ru Версия формата при экспорте. \en The version of format for export.
|
||||
bool exportIGESTopology; ///< \ru Экспортировать ли топологию в IGES. \en Export topology items into IGES.
|
||||
std::vector<bool> ioPermissions; ///< \ru Фильтр объектов по типам. \en Type objects filter.
|
||||
std::map<MbeConverterStrings, std::string> propertyStrings; ///< \ru Особые значения сведений о документе. \en Specific values of documents properties.
|
||||
eTextForm annotTextReprSTEP; ///< \ru Представление текста элементов аннотации. \en Text representation in annotation items.
|
||||
MbPlacement3D originLocation; ///< \ru ЛСК документа. \en Own placement of the document.
|
||||
bool replaceLocationsToRight; ///< \ru Следует ли принудительно преобразовывать ЛСК объектов к правым (для форматов, допускающих левые). \en Force replacement of locations to right ones.
|
||||
bool enableAutostitch; ///< \ru Сшивать ли поверхности автоматически. \en Automatically stitch surfaces into shells.
|
||||
double autostitchPrecision; ///< \ru Точность сшивки. \en Stitch precision.
|
||||
bool showMessages; ///< \ru Отображать ли сообщения. \en Invoke messages show.
|
||||
MbStepData tesseleationStepData; ///< \ru Параметры триангуляции при экспорте в STL и VRML. \en Tessellation parameters for export into STL and VRML.
|
||||
MbStepData LOD0StepData; ///< \ru Параметры триангуляции при экспорте в JT. \en Tessellation parameters for export into JT.
|
||||
bool dualSeams; ///< \ru Признак сдваивания швов при экспорте в STL и VRML. \en Make dual seams when export into STL and VRML.
|
||||
bool joinSimilarFaces; ///< \ru Выполнять ли слияние подобных граней. \en Whether to join similar faces.
|
||||
bool addRemovedFacesAsShells; ///< \ru Добавлять ли удаленные грани в качестве отдельных оболочек. \en Whether to add removed faces as shells.
|
||||
double lengthUnitsFactor; ///< \ru Единицы длины модели. \en Length units of the model.
|
||||
double appUnitsFactor; ///< \ru Единицы длины модели пользовательского приложения. \en Length units of the model used in user application.
|
||||
bool auditEnabled;
|
||||
|
||||
/// \ru Сведения о сообщениях конвертера. \en Converter message data.
|
||||
struct LogRecord {
|
||||
ptrdiff_t id; ///< \ru Идентификатор записи. \en Record id.
|
||||
eMsgType msgType; ///< \ru Тип сообщения. \en Message type.
|
||||
eMsgDetail msgText; ///< \ru Код сообщения. \en Message code.
|
||||
};
|
||||
|
||||
std::vector< LogRecord > logRecords; ///< \ru Сообщения конвертера. \en Converter messages.
|
||||
|
||||
public:
|
||||
|
||||
ConvConvertorProperty3D(); ///< \ru Конструктор. \en Constructor.
|
||||
|
||||
/// \ru Получить имя документа. \en Get document's name.
|
||||
virtual const std::string GetDocumentName () const { return docName; };
|
||||
/// \ru Получить имя файла для конвертирования. \en Get file name for converting.
|
||||
virtual const c3d::path_string FullFilePath () const { return fileName; };
|
||||
/// \ru Является ли файл текстовым. \en Whether the file is a text file.
|
||||
virtual bool IsFileAscii () const;
|
||||
/// \ru Получить версию формата при экспорте. \en Get the version of format for export.
|
||||
virtual long int GetFormatVersion () const;
|
||||
/// \ru Следует ли экспортировать только поверхности ( введено для работы конвертера IGES ). \en Whether to export only surfaces (introduced for work with converter IGES ).
|
||||
virtual bool IsOutOnlySurfaces() const;
|
||||
/// \ru Является ли экспортируемый документ сборкой. \en Whether the document for export is an assembly.
|
||||
virtual bool IsAssembling () const { return true; };
|
||||
/// \ru Получить значение разрешения на импорт экспорт объектов определенного типа. \en Get the value of permission for import-export of objects of a certain type.
|
||||
virtual bool GetIoPermission( MbeIOPermiss nPermission ) const;
|
||||
/// \ru Получить значения разрешений на импорт экспорт объектов определенных типов. \en Get values of permission for import-export of objects of certain types.
|
||||
virtual void GetIoPermissions( std::vector<bool>& ioPermissions ) const;
|
||||
/// \ru Установить разрешение на импорт экспорт объектов определенного типа. \en Set permission for import-export of objects of a certain type.
|
||||
virtual void SetIoPermission( MbeIOPermiss nPermission, bool isSet );
|
||||
/// \ru Получить значение специфичной строки для конвертера. \en Get the value of a certain string for the converter.
|
||||
virtual bool GetPropertyString ( MbeConverterStrings nString, std::string & propertyString ) const;
|
||||
/// \ru Установить значение специфичной строки для конвертера. \en Set the value of a certain string for the converter.
|
||||
virtual void SetPropertyString ( MbeConverterStrings nString, const std::string & propertyString );
|
||||
/// \ru Представление текста в аннотационных объектах. \en Text representation in annotation objects.
|
||||
virtual eTextForm GetAnnotationTextRepresentation () const;
|
||||
/// \ru Следует ли компоненты экспортировать в разные файлы (если позволяет формат). \en Export components into separate files ( if provided in format).
|
||||
virtual bool ExportComponentsSeparately() const;
|
||||
/// \ru Получить ЛСК, относительно которой позиционирована модель. \en Get the location, the model is placed in.
|
||||
virtual MbPlacement3D GetOriginLocation() const;
|
||||
/// \ru Заменять ли принудительно СК компонент на правые. \en Replace components' placements to right-oriented.
|
||||
virtual bool ReplaceLocationsToRight() const;
|
||||
/** \brief \ru Сшивать ли поверхности автоматически.
|
||||
\en If surfaces should be stitched automatically. \~
|
||||
\return \ru true - Сшивать поверхности автоматически, false - Спросить пользователя, сшивать ли поверхности.
|
||||
\en true - Stitch surfaces automatically, false - Ask user first time. \~
|
||||
\param[out] stitchPrecision - \ru Точность сшивки.
|
||||
\en Stitch precision. \~
|
||||
*/ virtual bool EnableAutoStitch( double& /*stitchPrecision*/ ) const;
|
||||
|
||||
/// \ru Получить множитель единиц длины по отношению к миллиметру. \en Get the factor of the length units to millimeters.
|
||||
virtual double LengthUnitsFactor() const;
|
||||
|
||||
/** \brief \ru Получить множитель единиц длины по отношению к миллиметру в модели приложения.
|
||||
\en Get the factor of the length units to millimeters in the application model. \~
|
||||
*/
|
||||
virtual double AppLengthUnitsFactor() const;
|
||||
|
||||
/** \brief \ru Сделать запись в журнал конвертирования.
|
||||
\en Make a record in the converter report. \~
|
||||
\param[in] id - \ru Идентификатор элемента внутри файла стороннего формата.
|
||||
\en Identifier of an element inside the file of a foreign format. \~
|
||||
\param[in] msgType - \ru Тип сообщения.
|
||||
\en Message type. \~
|
||||
\param[in] msgText - \ru Код сообщения.
|
||||
\en Message code. \~
|
||||
*/
|
||||
virtual void LogReport( ptrdiff_t id, eMsgType msgType, eMsgDetail msgText );
|
||||
|
||||
// /** \brief \ru Следует ли показывать сообщения и диалоги пользователю. \en Whether to show messages and dialog to the user. \~
|
||||
// \details \ru Обеспечивает работу через API. \en Provide possibility for work via API. \~
|
||||
// \return \ru true - обычная работа, false - через API. \en true - ordinary work, false - via API. \~
|
||||
// */
|
||||
virtual bool CanShowMessages() const;
|
||||
|
||||
/// \ru Дать данные вычисления триангуляции (для конвертера STL и VRML). \en Get data for step calculation during triangulation (for STL, VRML only).
|
||||
virtual MbStepData TesselationParameters() const;
|
||||
/// \ru Дать данные вычисления триангуляции уровня детализации (для конвертера JT). \en Get data for step calculation during triangulation of LOD0 (for JTonly).
|
||||
virtual MbStepData LOD0TesselationParameters() const;
|
||||
/// \ru Получить флаг сохранения совпадающих точек швов. (для конвертера STL и VRML). \en Whether to keep coincident points of seams (for STL, VRML only).
|
||||
virtual bool DualSeams() const;
|
||||
/// \ru Задать флаг сохранения совпадающих точек швов. (для конвертера STL и VRML). \en Whether to keep coincident points of seams (for STL, VRML only).
|
||||
virtual void DualSeams( bool );
|
||||
/// \ru Проводить ли аудит траснляции. \en Whether to audit the translation.
|
||||
virtual bool TotalAudit();
|
||||
/// \ru Выполнять ли слияние подобных граней. \en Whether to join similar faces.
|
||||
virtual bool JoinSimilarFaces() const { return joinSimilarFaces; }
|
||||
/// \ru Добавлять ли удаленные грани в качестве оболочек. \en Whether to add removed faces as shells.
|
||||
virtual bool AddRemovedFacesAsShells() const { return addRemovedFacesAsShells; }
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( ConvConvertorProperty3D )
|
||||
|
||||
}; // IConvertorProperty3D
|
||||
|
||||
|
||||
|
||||
#endif // __CONV_MODEL_PROPERTIES_H
|
||||
@@ -0,0 +1,35 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Интерфейс запроса масштаба. Интерфейс запроса сшивки.
|
||||
\en Interface of scale request. Interface of stitching request. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_REQUESTOR_H
|
||||
#define __CONV_REQUESTOR_H
|
||||
|
||||
|
||||
#include <reference_item.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru Интерфейс запроса масштаба. \en Interface of scale request.
|
||||
// ---
|
||||
struct IScaleRequestor : public MbRefItem
|
||||
{
|
||||
virtual double ScaleRequest() = 0;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru Интерфейс запроса сшивки. \en Interface of stitching request.
|
||||
// ---
|
||||
struct IStitchRequestor : public MbRefItem
|
||||
{
|
||||
virtual bool StitchRequest() = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // __CONV_REQUESTOR_H
|
||||
@@ -0,0 +1,153 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Поставщик атрибутов для топологических объектов.
|
||||
\en Topological objects attributes provider. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_ATTRIBURE_PROVIDER_H
|
||||
#define __CR_ATTRIBURE_PROVIDER_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <attribute.h>
|
||||
#include <name_item.h>
|
||||
#include <topology_faceset.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbNamedAttributeContainer;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Поставщик атрибутов для топологических объектов.
|
||||
\en Topological objects attributes provider. \~
|
||||
\details \ru Поставщик атрибутов для топологических объектов создаёт атрибуты для журнала построений. \n
|
||||
\en Topological objects attributes provider creates attributes for history tree. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
class MATH_CLASS MbAttributeProvider : public MbCreator
|
||||
{
|
||||
private:
|
||||
struct NamedAttrCondDuplicator
|
||||
{
|
||||
public:
|
||||
MbAttributeProvider & target_;
|
||||
NamedAttrCondDuplicator( MbAttributeProvider & target ) : target_(target) {}
|
||||
void operator () ( MbNamedAttributeContainer * source );
|
||||
private:
|
||||
void operator = ( const NamedAttrCondDuplicator & );
|
||||
};
|
||||
|
||||
struct NamedAttrCondComparer
|
||||
{
|
||||
public:
|
||||
MbName target_;
|
||||
NamedAttrCondComparer( const MbName & target ) : target_(target) {}
|
||||
bool operator () ( MbNamedAttributeContainer * source );
|
||||
private:
|
||||
void operator = ( const NamedAttrCondComparer & );
|
||||
};
|
||||
|
||||
struct NamedAttrCondSetter
|
||||
{
|
||||
public:
|
||||
MbFaceShell & target_;
|
||||
NamedAttrCondSetter( MbFaceShell & target ) : target_(target) {}
|
||||
void operator () ( MbNamedAttributeContainer * source );
|
||||
private:
|
||||
void operator = ( const NamedAttrCondSetter & );
|
||||
};
|
||||
|
||||
typedef std::vector<MbNamedAttributeContainer *>::iterator ContIter;
|
||||
|
||||
private:
|
||||
std::vector<MbNamedAttributeContainer *> attrConts; // \ru Передаваемые атрибуты \en Attributes to pass
|
||||
|
||||
public:
|
||||
MbAttributeProvider( const MbSNameMaker & n );
|
||||
~MbAttributeProvider();
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Выдать тип элемента. \en Get an element type.
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix.
|
||||
virtual void Move( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвинуть вдоль вектора. \en Move along a vector.
|
||||
virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси. \en Rotate about an axis.
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Определить, являются ли объекты подобными. \en Determine whether the objects are similar.
|
||||
virtual bool SetEqual( const MbCreator & ); // \ru Сделать равным. \en Make equal.
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию. \en Create a copy.
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction.
|
||||
|
||||
// \ru Добавить отдельный атрибут (забрать во владение) \en Add a separate attribute.
|
||||
void AddAttribute( const MbName & name, MbAttribute * attr );
|
||||
// \ru Добавить контейнер атрибутов (забрать во владение) \en Add an attribute container.
|
||||
void AddNamedCont( MbNamedAttributeContainer * attr );
|
||||
// \ru Добавить контейнер атрибутов (сделать себе копию) \en Add an attribute container (make a copy).
|
||||
void AddNamedCont( MbNamedAttributeContainer & attr );
|
||||
|
||||
protected:
|
||||
MbAttributeProvider( const MbAttributeProvider & );
|
||||
void operator = ( const MbAttributeProvider & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbAttributeProvider )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbAttributeProvider )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Контейнер атрибутов.
|
||||
\en Attribute container. \~
|
||||
\details \ru Контейнер атрибутов для одного топологического объекта. \n
|
||||
\en An attribute container for a topological object. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbNamedAttributeContainer
|
||||
{
|
||||
typedef c3d::AttrVector::iterator AttrIter;
|
||||
|
||||
private:
|
||||
MbName target; // \ru Имя топологического объекта, которому будут отданы хранимые атрибуты. \en Name of the topological object the stored attributes will be passed to.
|
||||
c3d::AttrVector attributes; // \ru Передаваемые атрибуты. \en Attributes to pass.
|
||||
|
||||
public:
|
||||
MbNamedAttributeContainer( const MbName & );
|
||||
virtual ~MbNamedAttributeContainer();
|
||||
|
||||
public:
|
||||
/// \ru Записать полученные атрибуты. \en Save the received attributes.
|
||||
void ReceiveAttributes ( c3d::AttrVector & attrs );
|
||||
/// \ru Скопировать атрибуты. \en Copy attributes.
|
||||
void DuplicateAttributes( c3d::AttrVector & attrs, MbRegDuplicate * iReg = NULL ) const;
|
||||
/// \ru Дать количество атрибутов. \en Get the attributes count.
|
||||
size_t AttributesCount() const { return attributes.size(); }
|
||||
/// \ru Добавить атрибут. \en Add an attribute.
|
||||
void AddAttribute( MbAttribute & ) ;
|
||||
const MbAttribute * _GetAttribute( size_t k ) const { return attributes[k]; }
|
||||
|
||||
public:
|
||||
/// \ru Дать имя топологического объекта. \en Get the topological object name.
|
||||
const MbName & GetName() const { return target; }
|
||||
|
||||
/// \ru Читать из потока. \en Read from stream.
|
||||
void ReadAttrCont ( reader & );
|
||||
/// \ru Записать в поток. \en Write to stream.
|
||||
void WriteAttrCont( writer & ) const;
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Установить свойства объекта. \en Set properties of the object.
|
||||
|
||||
protected:
|
||||
MbNamedAttributeContainer( const MbNamedAttributeContainer & );
|
||||
void operator = ( const MbNamedAttributeContainer & ); // \ru Не реализовано \en Not implemented
|
||||
};
|
||||
|
||||
|
||||
#endif // __CR_ATTRIBURE_PROVIDER_H
|
||||
@@ -0,0 +1,172 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель булевой операции.
|
||||
\en Boolean operation constructor.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_BOOLEAN_SOLID_H
|
||||
#define __CR_BOOLEAN_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbSolid;
|
||||
struct MATH_CLASS MbBooleanFlags;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель булевой операции.
|
||||
\en Boolean operation constructor. \~
|
||||
\details \ru Строитель булевой операции выполняет операции объединения, пересечения и вычитания множеств точек двух тел. \n.
|
||||
\en The Boolean operation constructor performs union, intersection and subtraction operations for sets of points of two solids. \n. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbBooleanSolid : public MbCreator {
|
||||
protected :
|
||||
RPArray<MbCreator> creators; ///< \ru Журнал построения: 0<=i<countOne - оболочки первого тела-операнда; countOne<=i<creators.Count() - оболочки второго тела-операнда. \en History tree: 0<=i<countOne - shells of the first operand-solid; countOne<=i<creators.Count() - shells of the second operand-solid.
|
||||
size_t sharedCount; ///< \ru Количество общих строителей обоих тел. \en The number of the common creators of both solids..
|
||||
size_t firstCount; ///< \ru Количество строителей первого тела. \en The number of first-solid creators.
|
||||
OperationType operation; ///< \ru Тип булевой операции над оболочками. \en Type of Boolean operation on shells.
|
||||
bool mergeFaces; ///< \ru Сливать подобные грани (true). \en Whether to merge similar faces (true).
|
||||
bool mergeEdges; ///< \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
|
||||
bool closed; ///< \ru Замкнутость оболочек операндов. \en Closedness of operands' shells.
|
||||
bool allowNonIntersecting; ///< \ru Выдавать конечную оболочку, если нет пересечений. \en Allow a final result if there is no intersection.
|
||||
double buildSag; ///< \ru Угловое отклонение при движении по кривым и поверхностям. \en Angular deviation while moving along curves and surfaces.
|
||||
|
||||
public:
|
||||
MbBooleanSolid( const MbCreator & solid2,
|
||||
bool sameCreators2,
|
||||
OperationType operType,
|
||||
const MbBooleanFlags & booleanFlags,
|
||||
const MbSNameMaker & n );
|
||||
|
||||
MbBooleanSolid( const RPArray<MbCreator> & solid2,
|
||||
bool sameCreators2,
|
||||
OperationType operType,
|
||||
const MbBooleanFlags & booleanFlags,
|
||||
const MbSNameMaker & n );
|
||||
|
||||
MbBooleanSolid( const RPArray<MbCreator> & solids12,
|
||||
size_t firstCount,
|
||||
bool sameCreators1,
|
||||
bool sameCreators2,
|
||||
OperationType operType,
|
||||
const MbBooleanFlags & booleanFlags,
|
||||
const MbSNameMaker & n );
|
||||
private :
|
||||
MbBooleanSolid( const MbBooleanSolid & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbBooleanSolid( const MbBooleanSolid & init );
|
||||
public :
|
||||
virtual ~MbBooleanSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element.
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * ireg = NULL ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix.
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * ireg = NULL ); // \ru Сдвиг. \en Translation.
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * ireg = NULL ); // \ru Повернуть вокруг оси. \en Rotate around an axis.
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property.
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object.
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты. \en Get the base objects.
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual size_t GetCreatorsCount ( MbeCreatorType ) const; // \ru Посчитать внутренние построители по типу. \en Count internal creators by type.
|
||||
virtual bool GetInternalCreators( MbeCreatorType, c3d::ConstCreatorsSPtrVector & ) const; // \ru Получить внутренние построители по типу. \en Get internal creators by type.
|
||||
virtual bool SetInternalCreators( MbeCreatorType, c3d::CreatorsSPtrVector & ); // \ru Получить внутренние построители по типу. \en Get internal creators by type.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными. \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal.
|
||||
|
||||
// \ru Общие функции твердого тела. \en Common functions of solid.
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
virtual void SetYourVersion( VERSION version, bool forAll );
|
||||
|
||||
public:
|
||||
/// \ru Тип булевой операции над телами. \en Type of Boolean operation on solids.
|
||||
OperationType GetOperationType() const { return operation; }
|
||||
/// \ru Угловое отклонение при движении по кривым и поверхностям. \en Angular deviation while moving along curves and surfaces.
|
||||
double GetBuildSag() const { return buildSag; }
|
||||
|
||||
/// \ru Количество общих строителей тел. \en The number of common creators.
|
||||
size_t GetSharedCount() const { return sharedCount; }
|
||||
/// \ru Количество строителей первого тела. \en The number of first-solid creators.
|
||||
size_t GetFirstCount() const { return firstCount; }
|
||||
/// \ru Общее количество строителей. \en Total count of creators.
|
||||
size_t GetCreatorsCount() const { return creators.size(); }
|
||||
/// \ru Дать строитель. \en Get the creator.
|
||||
const MbCreator * GetCreator( size_t k ) const { return ( (k < creators.size()) ? creators[k] : NULL ); }
|
||||
/// \ru Удалить из журнала строители первого тела. \en Delete first-solid creators from the history tree.
|
||||
bool DeleteFirstCreators();
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbBooleanSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBooleanSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBooleanSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку булевой операции.
|
||||
\en Create the shell of Boolean operation. \~
|
||||
\details \ru Для указанных оболочек построить оболочку как результат булевой операции над оболочками тел.
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en Create a shell as a result of Boolean operation on the given shells of solids.
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] shell1 - \ru Набор граней первого тела.
|
||||
\en The set of faces of the first solid. \~
|
||||
\param[in] sameShell1 - \ru Способ копирования граней первого тела.
|
||||
\en Method of copying the faces of the first solid. \~
|
||||
\param[in] shell2 - \ru Набор граней второго тела.
|
||||
\en The second solid face set. \~
|
||||
\param[in] sameShell2 - \ru Способ копирования граней второго тела.
|
||||
\en Method of copying the faces of the second solid. \~
|
||||
\param[in] creators - \ru Набор строителей первого и второго набора граней.
|
||||
\en The set of creators of the first and the second face sets. \~
|
||||
\param[in] sharedCount - \ru Количество общих строителей обоих наборов граней.
|
||||
\en The number of shared creators of the both face sets. \~
|
||||
\param[in] firstCount - \ru Количество строителей первого набора граней.
|
||||
\en The number of creators of the first face set. \~
|
||||
\param[in] oType - \ru Тип булевой операции.
|
||||
\en A Boolean operation type. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] flags - \ru Управляющие флаги булевой операции.
|
||||
\en Control flags of the Boolean operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBoolean( MbFaceShell * shell1,
|
||||
MbeCopyMode sameShell1,
|
||||
MbFaceShell * shell2,
|
||||
MbeCopyMode sameShell2,
|
||||
const RPArray<MbCreator> & creators,
|
||||
size_t & sharedCount,
|
||||
size_t & firstCount,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const MbBooleanFlags & flags,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_BOOLEAN_SOLID_H
|
||||
@@ -0,0 +1,99 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель тела с фасками рёбер.
|
||||
\en Constructor of solid with edges' chamfers.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_CHAMFER_SOLID_H
|
||||
#define __CR_CHAMFER_SOLID_H
|
||||
|
||||
|
||||
#include <cr_smooth_solid.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель тела с фасками рёбер.
|
||||
\en Constructor of solid with edges' chamfers. \~
|
||||
\details \ru Строитель тела с фасками рёбер, выполняющий замену указанных рёбер линейчатыми гранями,
|
||||
стыкующимися со смежными гранями обрабатываемых ребер.
|
||||
\en Constructor of solid with edges' chamfers performing the replacement of the specified edges by ruled faces
|
||||
connected with the adjacent faces of the edges being processed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbChamferSolid : public MbSmoothSolid {
|
||||
public :
|
||||
|
||||
public :
|
||||
MbChamferSolid( SArray<MbEdgeFacesIndexes> & _indexes,
|
||||
const SmoothValues & params, const MbSNameMaker & n );
|
||||
private :
|
||||
MbChamferSolid( const MbChamferSolid & init, MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbChamferSolid( const MbChamferSolid & init );
|
||||
public :
|
||||
virtual ~MbChamferSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual void GetProperties( MbProperties &properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties &properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual( const MbCreator &init ); // \ru Сделать равным \en Make equal
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
private :
|
||||
virtual void ReadDistances ( reader &in );
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbChamferSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbChamferSolid )
|
||||
}; // MbChamferSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbChamferSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку с фасками ребeр.
|
||||
\en Create a shell with edges' chamfers. \~
|
||||
\details \ru Для указанной оболочки построить оболочку, в которой выполнены фаски указанных рёбер.\n
|
||||
\en For the given shell create a shell with chamfers of the specified edges.\n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней исходной оболочки.
|
||||
\en Method of copying the source shell faces. \~
|
||||
\param[in] initCurves - \ru Обрабатываемые рёбра исходной оболочки.
|
||||
\en The source shell edges to be processed. \~
|
||||
\param[in] parameters - \ru Правметры обработки рёбер.
|
||||
\en Parameters of edges processing. \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateChamfer( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbCurveEdge> & initCurves,
|
||||
const SmoothValues & parameters,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_CHAMFER_SOLID_H
|
||||
@@ -0,0 +1,182 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель кривой сопряжения двух кривых.
|
||||
\en Constructor of curve connecting two curves.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_CONNECTING_CURVE_H
|
||||
#define __CR_CONNECTING_CURVE_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCartPoint;
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbElementarySurface;
|
||||
class MATH_CLASS MbEdge;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель кривой сопряжения двух кривых.
|
||||
\en Constructor of curve connecting two curves. \~
|
||||
\details \ru Строитель кривой сопряжения двух кривых.\n
|
||||
\en Constructor of curve connecting two curves.\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbConnectingCurveCreator : public MbCreator {
|
||||
private:
|
||||
MbCurve3D * curve1; ///< \ru Первая скругляемая кривая \en The first curve to connect
|
||||
MbCurve3D * curve2; ///< \ru Вторая скругляемая кривая \en The second curve to connect
|
||||
double init1; ///< \ru Исходное приближение параметра первой скругляемой кривой (для ft_Fillet и ft_OnSurface) \en The initial approximation of parameter of the first curve to be connected (for ft_Fillet and ft_OnSurface)
|
||||
double init2; ///< \ru Исходное приближение параметра второй скругляемой кривой (для ft_Fillet и ft_OnSurface) \en The initial approximation of parameter of the second curve to be connected (for ft_Fillet and ft_OnSurface)
|
||||
double param1; ///< \ru Параметр точки стыковки первой скругляемой кривой (кроме ft_Double) \en Connection point parameter of the first curve (except ft_Double)
|
||||
double param2; ///< \ru Параметр точки стыковки второй скругляемой кривой (кроме ft_Double) \en Connection point parameter of the second curve (except ft_Double)
|
||||
double radius1; ///< \ru Исходное приближение радиуса (кроме ft_Bridge, для ft_Double - радиус скругления первого участка, для ft_Spline - tension) \en The initial approximation of radius (except ft_Bridge, for ft_Double - the first segment fillet radius, for ft_Spline - tension)
|
||||
double radius2; ///< \ru Результат расчета радиуса (кроме ft_Bridge, для ft_Double - радиус скругления второго участка, для ft_Spline - tension) \en The radius calculation result (except ft_Bridge, for ft_Double - the second segment fillet radius, for ft_Spline - tension)
|
||||
bool sense1; ///< \ru Совпадение направления кривой скругления и первой кривой (кроме ft_Spline, для ft_Double - начало/конец кривой) \en Coincidence of the connecting curve direction and the first curve (except ft_Spline, for ft_Double - start/end point of the curve)
|
||||
bool sense2; ///< \ru Совпадение направления кривой скругления и второй кривой (кроме ft_Spline, для ft_Double - начало/конец кривой) \en Coincidence of the connecting curve direction and the second curve (except ft_Spline, for ft_Double - start/end point of the curve)
|
||||
MbeMatingType mating1; ///< \ru Тип сопряжения с первой кривой (для ft_Spline) \en Type of mating with the first curve (for ft_Spline)
|
||||
MbeMatingType mating2; ///< \ru Тип сопряжения со второй кривой (для ft_Spline) \en Type of mating with the second curve (for ft_Spline)
|
||||
MbeConnectingType type; ///< \ru Тип скругления (обычное или на поверхности) \en Connection type (ordinary or on a surface)
|
||||
|
||||
protected:
|
||||
MbConnectingCurveCreator( const MbConnectingCurveCreator & , MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
MbConnectingCurveCreator( const MbConnectingCurveCreator & ); // \ru Не реализовано \en Not implemented
|
||||
MbConnectingCurveCreator(); // \ru Не реализовано \en Not implemented
|
||||
|
||||
public:
|
||||
MbConnectingCurveCreator( const MbSNameMaker & n,
|
||||
const MbCurve3D & c1, double t1, double p1, double r1, bool s1, MbeMatingType m1,
|
||||
const MbCurve3D & c2, double t2, double p2, double r2, bool s2, MbeMatingType m2, MbeConnectingType t );
|
||||
|
||||
public :
|
||||
virtual ~MbConnectingCurveCreator();
|
||||
|
||||
// \ru Общие функции строителя \en The common functions of the creator
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * iReg = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
// \ru Построить кривую по журналу построения \en Create a curve from the history tree
|
||||
virtual bool CreateSpaceCurve( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
|
||||
void operator = ( const MbConnectingCurveCreator & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbConnectingCurveCreator )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbConnectingCurveCreator )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создание строителя скругления двух кривых.
|
||||
\en Create two curves fillet constructor. \~
|
||||
\details \ru Создание строителя скругления двух кривых.\n
|
||||
\en Create two curves fillet constructor.\n \~
|
||||
\param[in] curve1 - \ru Кривая 1.
|
||||
\en Curve 1. \~
|
||||
\param[in] curve2 - \ru Кривая 2.
|
||||
\en Curve 2. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateFilletEdge( const MbCurve3D & curve1, double & t1,
|
||||
const MbCurve3D & curve2, double & t2,
|
||||
double & radius, bool sense,
|
||||
MbeConnectingType type,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
bool & unchanged, // \ru Для ft_Fillet и ft_OnSurface \en For ft_Fillet and ft_OnSurface
|
||||
MbElementarySurface *& surface, // \ru Для ft_Fillet и ft_OnSurface \en For ft_Fillet and ft_OnSurface
|
||||
MbEdge *& edge );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создание строителя сопряжения двух кривых сплайном.
|
||||
\en Create constructor of two curves connection by a spline. \~
|
||||
\details \ru Создание строителя сопряжения двух кривых сплайном.\n
|
||||
\en Create constructor of two curves connection by a spline.\n \~
|
||||
\param[in] curve1 - \ru Кривая 1.
|
||||
\en Curve 1. \~
|
||||
\param[in] curve2 - \ru Кривая 2.
|
||||
\en Curve 2. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSplineEdge( const MbCurve3D & curve1, double t1, MbeMatingType mating1,
|
||||
const MbCurve3D & curve2, double t2, MbeMatingType mating2,
|
||||
double tension1, double tension2,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbEdge *& edge );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создание строителя сопряжения концов двух кривых составной кривой плавного соединения.
|
||||
\en Create a constructor of conjugation of two curves end points by a composite curve of smooth connection. \~
|
||||
\details \ru Создание строителя сопряжения концов двух кривых составной кривой плавного соединения.\n
|
||||
\en Create a constructor of conjugation of two curves end points by a composite curve of smooth connection.\n \~
|
||||
\param[in] curve1 - \ru Кривая 1.
|
||||
\en Curve 1. \~
|
||||
\param[in] curve2 - \ru Кривая 2.
|
||||
\en Curve 2. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateConnectingEdge( const MbCurve3D & curve1, bool isBegin1, double radius1,
|
||||
const MbCurve3D & curve2, bool isBegin2, double radius2,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbEdge *& edge );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Cоздание строителя сопряжения двух кривых кубическим сплайном Эрмита (кривой-мостиком).
|
||||
\en Create a constructor of two curves conjugation by a cubic Hermite spline (transition curve). \~
|
||||
\details \ru Cоздание строителя сопряжения двух кривых кубическим сплайном Эрмита (кривой-мостиком).\n
|
||||
\en Create a constructor of two curves conjugation by a cubic Hermite spline (transition curve).\n \~
|
||||
\param[in] curve1 - \ru Кривая 1.
|
||||
\en Curve 1. \~
|
||||
\param[in] curve2 - \ru Кривая 2.
|
||||
\en Curve 2. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBridgeEdge( const MbCurve3D & curve1, double t1, bool sense1,
|
||||
const MbCurve3D & curve2, double t2, bool sense2,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbEdge *& edge );
|
||||
|
||||
|
||||
#endif // __CR_CONNECTING_CURVE_H
|
||||
@@ -0,0 +1,141 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель разрезанного тела.
|
||||
\en Cut solid constructor.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_CUTTING_SOLID_H
|
||||
#define __CR_CUTTING_SOLID_H
|
||||
|
||||
#include <creator.h>
|
||||
#include <mb_placement3d.h>
|
||||
#include <op_boolean_flags.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbSurface;
|
||||
class MATH_CLASS MbContour;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель разрезанного тела.
|
||||
\en Cut solid constructor. \~
|
||||
\details \ru Строитель тела, разрезанного поверхностью или набором граней, полученного выдавливанием плоского контура.\n
|
||||
\en Constructor of a solid cut by a surface or a set of faces obtained by extrusion of a planar contour.\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCuttingSolid : public MbCreator {
|
||||
private:
|
||||
typedef MbShellCuttingParams::ProlongState CuttingProlongState;
|
||||
protected :
|
||||
// Surface
|
||||
c3d::SurfaceSPtr surface; ///< \ru Режущая поверхность. \en Cutting surface.
|
||||
// Sketch contour
|
||||
c3d::PlaneContourSPtr contour; ///< \ru Режущий контур (вместо поверхности). \en Cutting contour (instead of surface).
|
||||
MbPlacement3D place; ///< \ru Местная система координат контура. \en Local coordinate system of the contour.
|
||||
MbVector3D direction; ///< \ru Направление и длина выдавливания контура. \en Direction and distance of the contour extrusion.
|
||||
// Solid
|
||||
c3d::CreatorsSPtrVector creators; ///< \ru Строители оболочки. \en Shell creators.
|
||||
|
||||
ThreeStates part; ///< \ru Оставляемая часть (если part больше 0, то оставляем часть тела со стороны нормали поверхности). \en A part to be kept (if part is bigger than 0, then keep a part of solid from the side of surface normal).
|
||||
CuttingProlongState prolongState; ///< \ru Тип продления режущей поверхности. \en Prolongation type of cutter surface.
|
||||
|
||||
bool closed; ///< \ru Замкнутоcть оболочки разрезаемого объекта. \en Closedness of the shell of the object being cut.
|
||||
bool mergeFaces; ///< \ru Сливать подобные грани (true). \en Whether to merge similar faces (true).
|
||||
bool mergeEdges; ///< \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
|
||||
double buildSag; ///< \ru Угловое отклонение при движении по кривым и поверхностям. \en Angular deviation while moving along curves and surfaces.
|
||||
|
||||
public :
|
||||
MbCuttingSolid( const MbShellCuttingParams & cuttingParams, bool sameCutterObject );
|
||||
DEPRECATE_DECLARE
|
||||
MbCuttingSolid( const MbSurface & surface, bool sameSurface, int part,
|
||||
bool closed, const MbMergingFlags & flags, const MbSNameMaker & n );
|
||||
DEPRECATE_DECLARE
|
||||
MbCuttingSolid( const MbPlacement3D & place, const MbContour & contour, const MbVector3D & direction, int part,
|
||||
bool closed, const MbMergingFlags & flags, const MbSNameMaker & n );
|
||||
private :
|
||||
MbCuttingSolid( const MbCuttingSolid &, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbCuttingSolid( const MbCuttingSolid & );
|
||||
public :
|
||||
virtual ~MbCuttingSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the base objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar ( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Оставляемая часть (если part больше 0, то оставляем часть тела со стороны нормали поверхности). \en A part to be kept (if part is bigger than 0, then keep a part of solid from the side of surface normal).
|
||||
ThreeStates GetPart() const { return part; }
|
||||
void SetPart( ThreeStates p ) { part = p; }
|
||||
void SetOppositePart() { if ( part == ts_negative )
|
||||
part = ts_positive;
|
||||
else if ( part == ts_positive )
|
||||
part = ts_negative; }
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbCuttingSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCuttingSolid )
|
||||
}; // MbCuttingSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCuttingSolid )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Отрезать от оболочки некоторую её часть.
|
||||
\en Cut a part of the shell. \~
|
||||
\details \ru Для указанной оболочки построить оболочку без части граней, отрезанных от неё :
|
||||
(1) указанной поверхностью, (2) набором граней, полученной выдавливанием плоского контура, (3) оболочкой. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a given shell create a shell without a part of faces cut from it by :
|
||||
(1) the given surface, (2) a set of faces obtained by extrusion of a planar contour, (3) the given shell. \n
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней исходной оболочки.
|
||||
\en Method of copying the source shell faces. \~
|
||||
\param[in] cuttingParams - \ru Параметры операции.
|
||||
\en Operation parameters. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell1 - \ru Построенный первый набор граней.
|
||||
\en Constructed first set of faces. \~
|
||||
\param[out] shell2 - \ru Построенный второй набор граней.
|
||||
\en Constructed second set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCuttingSolid *) CreatePart( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbShellCuttingParams & cuttingParams,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell1,
|
||||
MbFaceShell *& shell2 );
|
||||
|
||||
#endif // __CR_CUTTING_SOLID_H
|
||||
@@ -0,0 +1,134 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Разделение набора граней на связные части.
|
||||
\en Subdivision of face set into connected parts. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_DETACH_SOLID_H
|
||||
#define __CR_DETACH_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель, разделяющий набор граней на связные части.
|
||||
\en Constructor subdividing a set of faces into connected parts. \~
|
||||
\details \ru Строитель, разделяющий набор граней на связные части в виде оболочек и
|
||||
сортирующий отдельные оболочки по убыванию диагоналей габаритных кубов частей. \n
|
||||
\en Constructor subdividing a set of faces into connected parts in form of shells and
|
||||
sorting separate shells by decreasing of the parts's bounding boxes diagonals. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbDetachSolid : public MbCreator {
|
||||
protected :
|
||||
ptrdiff_t part; ///< \ru Номер оболочки, выделенной из общего набора граней. \en Number of a shell extracted from the common set of faces.
|
||||
bool sort; ///< \ru Сортированы ли оболочки по габаритам. \en Whether the shells are sorted by sizes.
|
||||
|
||||
public :
|
||||
MbDetachSolid( ptrdiff_t p, bool s, const MbSNameMaker & n );
|
||||
private :
|
||||
MbDetachSolid( const MbDetachSolid & init, MbRegDuplicate *ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbDetachSolid( const MbDetachSolid & init );
|
||||
public :
|
||||
virtual ~MbDetachSolid();
|
||||
|
||||
/** \ru \name Общие функции математического объекта.
|
||||
\en \name Common functions of the mathematical object.
|
||||
\{ */
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \brief \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными? \en Whether the objects are similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным. \en Make equal.
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
/** \} */
|
||||
/** \ru \name Функции строителя, разделяющие отдельные части оболочки.
|
||||
\en \name Functions of the creator subdividing separate parts of the shell.
|
||||
\{ */
|
||||
/// \ru Дать номер части, выделенной из общей оболочки. \en Get number of the part extracted from the common shell.
|
||||
ptrdiff_t GetPartNumber() const { return part; }
|
||||
/// \ru Установить номер части, выделенной из общей оболочки. \en Set number of the part extracted from the common shell.
|
||||
void SetPartNumber( ptrdiff_t p ) { part = p; }
|
||||
/// \ru Сортированы ли части по габаритам (диагоналям). \en Whether the parts are sorted by bounding boxes (diagonals).
|
||||
bool IsSort() const { return sort; }
|
||||
/** \} */
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbDetachSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbDetachSolid )
|
||||
}; // MbDetachSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbDetachSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разделить несвязанные части набора граней на связанные наборы граней.
|
||||
\en Divide disconnected parts of a face set into connected sets of faces. \~
|
||||
\details \ru Разделить несвязанные части набора граней на связанные наборы граней - оболочки.
|
||||
Одна связная оболочка (если sort=true, то наибольшая по диагонали габаритного куба) остаётся в исходном наборе граней solid.
|
||||
Отделенные наборы граней складываются в контейнер partSolid.
|
||||
\en Divide disconnected parts of a face set into connected sets of faces - shells.
|
||||
One connected shell (if sort=true, then it is the greatest by the bounding box diagonal) remains in the initial set of faces 'solid'.
|
||||
Separated face sets are put into container partSolid. \~
|
||||
\param[in, out] solid - \ru Исходный набор граней, на выходе - одна из связных оболочек.
|
||||
\en Initial face set, in output - one of the connected shells. \~
|
||||
\param[out] partSolid - \ru Набор всех связных частей кроме одной.
|
||||
\en Set of all connected parts except one. \~
|
||||
\param[in] sort - \ru Если true, то в partSolid сортировать оболочки по убыванию диагоналей габаритного куба.
|
||||
\en If true, then the shells should be sorted in partSolid by decreasing the bounding box diagonals. \~
|
||||
\result \ru Количество оболочек в контейнере partSolid.
|
||||
\en Number of shells in container partSolid. \~
|
||||
\ingroup Solid_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (size_t) MakeDetachShells( MbFaceShell & solid,
|
||||
RPArray<MbFaceShell> & partSolid,
|
||||
bool sort );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разделить несвязанные части набора граней на связанные наборы граней.
|
||||
\en Divide disconnected parts of a face set into connected sets of faces. \~
|
||||
\details \ru Разделить несвязанные части набора граней на связанные наборы граней - оболочки.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Divide disconnected parts of a face set into connected sets of faces - shells.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in, out] solid - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[out] partSolid - \ru Набор всех связных частей - оболочек.
|
||||
\en Set of all the connected parts - shells. \~
|
||||
\param[in] sort - \ru Если true, то в partSolid сортировать оболочки по убыванию диагоналей габаритного куба.
|
||||
\en If true, then the shells should be sorted in partSolid by decreasing the bounding box diagonals. \~
|
||||
\param[in] n - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Solid_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateDetach( MbFaceShell & solid,
|
||||
RPArray<MbFaceShell> & partSolid,
|
||||
bool sort,
|
||||
const MbSNameMaker & n,
|
||||
MbResultType & res );
|
||||
|
||||
|
||||
#endif // __CR_DETACH_SOLID_H
|
||||
@@ -0,0 +1,156 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки с уклонёнными гранями.
|
||||
\en Constructor of a shell with drafted faces.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_DRAFT_SOLID_H
|
||||
#define __CR_DRAFT_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки с уклонёнными гранями.
|
||||
\en Constructor of a shell with drafted faces. \~
|
||||
\details \ru Строитель оболочки с уклонёнными гранями для создания литейных уклонов.\n
|
||||
\en Constructor of a shell with drafted faces for pattern drafts creation. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbDraftSolid: public MbCreator {
|
||||
protected:
|
||||
double angle; ///< \ru Угол уклона. \en Draft angle.
|
||||
c3d::ItemIndices faceIndices; ///< \ru Номера множества уклоняемых граней. \en Indices of faces to draft.
|
||||
MbeFacePropagation fp; ///< \ru Признак захвата граней ( face propagation ). \en Flag of face propagation.
|
||||
// \ru Атрибуты, определяющие направление тяги (pull direction) и нейтральную изолинию уклона. \en Attributes determining the pull direction and the neutral isoline of the draft.
|
||||
MbPlacement3D * np; ///< \ru Нейтральная плоскость ( neutral plane ) ( не обязателен ). \en Neutral plane (optional).
|
||||
ptrdiff_t edgeNb; ///< \ru Номер прямолинейного ребра, направляющего уклон ( не обязателен ). \en The index of straight edge specifying the draft (optional).
|
||||
SArray<ptrdiff_t> * pl; ///< \ru Линии разъема (ребра) ( parting line ) ( не обязателен ). \en Parting lines (of edge) (optional).
|
||||
bool reverse; ///< \ru Обратное направление тяги. \en Reverse pull direction.
|
||||
bool step; ///< \ru Ступенчатый способ уклона. \en Stepwise method of draft.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор уклона по известной нейтральной плоскости. \en Constructor of drafting by the given neutral plane.
|
||||
MbDraftSolid( const MbPlacement3D & nPlace, // нейтральная плоскость ( neutral plane )
|
||||
double ang, // угол уклона
|
||||
const std::vector<MbItemIndex> & faceInds, // номера множества уклоняемых граней
|
||||
MbeFacePropagation faceProp, // признак захвата граней
|
||||
bool rev, // обратное направление тяги
|
||||
const MbSNameMaker & n )
|
||||
: MbCreator ( n )
|
||||
, angle ( ang )
|
||||
, faceIndices( faceInds )
|
||||
, fp ( faceProp )
|
||||
, np ( new MbPlacement3D( nPlace ) )
|
||||
, edgeNb ( -1 )
|
||||
, pl ( NULL )
|
||||
, reverse ( rev )
|
||||
, step ( false )
|
||||
{
|
||||
}
|
||||
// \ru Конструктор уклона по линии разъема \en Constructor of drafting by the parting line
|
||||
MbDraftSolid( double ang, // угол уклона
|
||||
const MbPlacement3D * nPlace, // нейтральная плоскость ( neutral plane )
|
||||
ptrdiff_t edgeInd, // номер прямолинейного ребра - направляющего уклон ( не обязателен )
|
||||
MbeFacePropagation faceProp, // признак захвата граней
|
||||
const SArray<ptrdiff_t> & partLines, // линии разъема (ребра) (parting line) (не обязателен)
|
||||
bool rev, // обратное направление тяги
|
||||
bool st, // ступенчатый способ уклона
|
||||
const MbSNameMaker & n )
|
||||
: MbCreator ( n )
|
||||
, angle ( ang )
|
||||
, faceIndices( )
|
||||
, fp ( faceProp )
|
||||
, np ( nPlace ? new MbPlacement3D( *nPlace ) : NULL )
|
||||
, edgeNb ( edgeInd )
|
||||
, pl ( new SArray<ptrdiff_t>( partLines ) )
|
||||
, reverse ( rev )
|
||||
, step ( st )
|
||||
{
|
||||
}
|
||||
private :
|
||||
MbDraftSolid( const MbDraftSolid &, MbRegDuplicate * ); // \ru Конструктор копирования \en Copy-constructor
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbDraftSolid( const MbDraftSolid & );
|
||||
public :
|
||||
virtual ~MbDraftSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const;
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * = NULL ); // \ru Построение \en Construction
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbDraftSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbDraftSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbDraftSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку с уклоном граней.
|
||||
\en Create a shell with drafted faces. \~
|
||||
\details \ru Для исходной оболочки построить оболочку с уклоном граней от нейтральной изоплоскости для создания литейных уклонов. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en For the source shell create a shell with faces drafted from the neutral isoplane for pattern tapers creation. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the source shell. \~
|
||||
\param[in] np - \ru Локальная система координат, плоскость XY которой является нейтральной плоскостью ( neutral plane ).
|
||||
\en The local coordinate system XY plane of which is a neutral plane. \~
|
||||
\param[in] angle - \ru Угол уклона.
|
||||
\en Draft angle. \~
|
||||
\param[in] faces - \ru Уклоняемые грани.
|
||||
\en The faces to draft. \~
|
||||
\param[in] fp - \ru Признак захвата граней ( face propagation ).
|
||||
\en Flag of face propagation. \~
|
||||
\param[in] reverse - \ru Флаг для обратного направления тяги.
|
||||
\en Flag for reverse pull direction. \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateDraft( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & np,
|
||||
double angle,
|
||||
const RPArray<MbFace> & faces,
|
||||
MbeFacePropagation fp,
|
||||
bool reverse,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_DRAFT_SOLID_H
|
||||
@@ -0,0 +1,103 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель размноженого набора граней.
|
||||
\en Constructor of duplication face sets . \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CR_ELEMENTARY_SOLID_H
|
||||
#define CR_ELEMENTARY_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <op_duplication_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbFaceShell;
|
||||
class MbRegTransform;
|
||||
class MbRegDuplicate;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель размноженого набора граней.
|
||||
\en Constructor of duplication face sets . \~
|
||||
\details \ru Строитель выполняет размножение тела согласно параметрам и объединяет копии в одно тело\n
|
||||
\en Creator makes duplication of face sets accordind to parameters and unite its into a single face set\~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbDuplicationSolid : public MbCreator {
|
||||
protected:
|
||||
DuplicationValues * parameters; ///< \ru Параметры размножения. \en Parameters of duplication.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по параметрам. \en Constructor by parameters.
|
||||
MbDuplicationSolid( const DuplicationValues & p, const MbSNameMaker & n );
|
||||
private:
|
||||
MbDuplicationSolid( const MbDuplicationSolid & init, MbRegDuplicate *ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbDuplicationSolid( const MbDuplicationSolid & init );
|
||||
public:
|
||||
virtual~MbDuplicationSolid();
|
||||
|
||||
/** \ru \name Общие функции строителя оболочки.
|
||||
\en \name Common functions of the shell creator.
|
||||
\{ */
|
||||
/// \ru Получить регистрационный тип (для копирования, дублирования). \en Get the registration type (for copying, duplication).
|
||||
virtual MbeCreatorType IsA() const;
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru сделать копию \en create a copy
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru записать свойства объекта \en set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru являются ли объекты подобными \en whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
/** \} */
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbDuplicationSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbDuplicationSolid )
|
||||
}; // MbDuplicationSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbDuplicationSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку размножения исходной оболочки.
|
||||
\en Create a shell of duplication of original shell. \~
|
||||
\details \ru По данной оболочке и параметрам размножения построить оболочку как результат объединения копий.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a given shell and duplication parameters construct a shell as a result of a union of copies. \n
|
||||
The function simultaneously constructs the shell and creates its constructor.\~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en Original face set. \~
|
||||
\param[in] params - \ru Параметры размножения.
|
||||
\en Parameters of duplication. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] duplSolid - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Solid_Modeling
|
||||
*/
|
||||
MATH_FUNC (MbCreator *) CreateDuplication( const MbFaceShell & solid,
|
||||
const DuplicationValues & params,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // CR_ELEMENTARY_SOLID_H
|
||||
@@ -0,0 +1,220 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки элементарного тела.
|
||||
\en Construction of shell for elementary solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_ELEMENTARY_SOLID_H
|
||||
#define __CR_ELEMENTARY_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <mb_enum.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbElementarySurface;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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
|
||||
\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 \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbElementarySolid : public MbCreator {
|
||||
protected :
|
||||
SArray<MbCartPoint3D> points; ///< \ru Опорные точки оболочки тела. \en Support points of a solid shell.
|
||||
ElementaryShellType type; ///< \ru Тип тела. \en Type of a solid.
|
||||
|
||||
public :
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по точкам и типу тела.
|
||||
\en Constructor by points and a type of a solid. \~
|
||||
|
||||
\param[in] pnts - \ru Опорные точки. \n
|
||||
pnts[0] определяет начало локальной системы координат. \n
|
||||
Для сферы, тора, цилиндра и конуса: \n
|
||||
pnts[1] определяет направление оси Z локальной системы. \n
|
||||
pnts[2] определяет направление оси X локальной системы. \n
|
||||
Для блока, клина и плиты: \n
|
||||
pnts[1] определяет направление оси X локальной системы. \n
|
||||
pnts[2] определяет направление оси Y локальной системы. \n
|
||||
Кроме того, \n
|
||||
pnts[1] определяет высоту цилиндра, высоту конуса,
|
||||
большой радиус тора, длину блока, длину клина. \n
|
||||
pnts[2] определяет радиус цилиндра, радиус конуса, радиус сферы,
|
||||
малый радиус тора, ширину блока, ширину клина. \n
|
||||
Последняя точка определяет высоту блока, клина, плиты, вершину пирамиды.
|
||||
\en Support points. \n
|
||||
pnts[0] determines a local coordinate system origin. \n
|
||||
For a sphere, a torus, a cylinder or 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
|
||||
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. \~
|
||||
\param[in] t - \ru Тип элементарного тела.
|
||||
\en Elementary solid type. \~
|
||||
\param[in] n - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
*/
|
||||
template<class Points>
|
||||
MbElementarySolid( const Points & pnts, ElementaryShellType t, const MbSNameMaker & n )
|
||||
: MbCreator( n )
|
||||
, points ( )
|
||||
, type ( t )
|
||||
{
|
||||
size_t cnt = pnts.size();
|
||||
points.reserve( cnt );
|
||||
for ( size_t k = 0; k < cnt; ++k ) {
|
||||
points.push_back( pnts[k] );
|
||||
}
|
||||
}
|
||||
|
||||
private :
|
||||
MbElementarySolid( const MbElementarySolid &, MbRegDuplicate * iReg ); // \ru Конструктор копирования с регистратором \en Copy-constructor with the registrator
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbElementarySolid( const MbElementarySolid & );
|
||||
public :
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbElementarySolid();
|
||||
|
||||
/** \ru \name Общие функции строителя оболочки.
|
||||
\en \name Common functions of the shell creator.
|
||||
\{ */
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems( RPArray<MbSpaceItem> & s ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar ( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * = NULL ); // \ru Построение \en Construction
|
||||
/** \} */
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbElementarySolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbElementarySolid )
|
||||
}; // MbElementarySolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbElementarySolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку элементарного тела.
|
||||
\en Create a shell of an 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
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en Create an elementary solid shell by a set of support points and 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
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] points - \ru Набор опорных точек.
|
||||
\en Set of support points. \~
|
||||
\param[in] t - \ru Тип элементарного тела.
|
||||
\en Elementary solid type. \~
|
||||
\param[in] n - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Оболочка - результат построения.
|
||||
\en Shell - the result of construction. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Solid_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateElementary( const SArray<MbCartPoint3D> & points,
|
||||
ElementaryShellType t,
|
||||
const MbSNameMaker & n,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку элементарного тела.
|
||||
\en Create a shell of an elementary solid. \~
|
||||
\details \ru Создать оболочку элементарного тела по элементарной поверхности.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en Create an elementary solid shell by an elementary surface.\n
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] surface - \ru Элементарная поверхность.\n
|
||||
Допускается тип поверхности - шар, тор, цилиндр, конус.
|
||||
\en Elementary surface.\n
|
||||
The acceptable surface types are sphere, torus, cylinder, cone. \~
|
||||
\param[in] n - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Оболочка - результат операции.
|
||||
\en Shell - the result of operation. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Solid_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateElementary( const MbElementarySurface & surface,
|
||||
const MbSNameMaker & n,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_ELEMENTARY_SOLID_H
|
||||
@@ -0,0 +1,271 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки кинематического тела.
|
||||
\en Constructor of shell of evolution solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_EVOLUTION_SOLID_H
|
||||
#define __CR_EVOLUTION_SOLID_H
|
||||
|
||||
|
||||
#include <surf_spine.h>
|
||||
#include <cr_swept_solid.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки кинематического тела.
|
||||
\en Constructor of shell of evolution solid. \~
|
||||
\details \ru Строитель оболочки тела путём движения образующей кривой по направляющей кривой. \n
|
||||
\en Constructor of solid shell by moving generating curve along a spine curve. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCurveEvolutionSolid : public MbCurveSweptSolid {
|
||||
protected :
|
||||
MbSweptData sweptData; ///< \ru Данные об образующей. \en Generating curve data.
|
||||
SPtr<MbCurve3D> spineCurve; ///< \ru Направляющая кривая. \en Spine curve.
|
||||
SPtr<MbCurve3D> directionCurve; ///< \ru Кривая вектора ориентации матрицы преобразования (может быть NULL для простой траектории). \en A curve of the transformation matrix orientation (it may be NULL for a simple trajectory).
|
||||
MbVector3D direction; ///< \ru Вектор ориентации матрицы преобразования (может быть нулевой, в случае автоопределения). \en Vector of transformation matrix orientation (it's equal zero in the mode of automatic direction calculation).
|
||||
MbSNameMaker spineNames; ///< \ru Именователь направляющей. \en An object defining the name of the spine curve.
|
||||
EvolutionValues parameters; ///< \ru Параметры. \en Parameters.
|
||||
|
||||
public :
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по одному контуру на поверхности.
|
||||
\en Constructor by one contour on a surface. \~
|
||||
\param[in] surface_ - \ru Поверхность образующей.
|
||||
\en Surface of a generating curve. \~
|
||||
\param[in] contour_ - \ru Контур в параметрах поверхности.
|
||||
\en Contour in surface parameters domain. \~
|
||||
\param[in] spine_ - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[in] params - \ru Параметры кинематической операции.
|
||||
\en Parameters of the sweeping operation. \~
|
||||
\param[in] oType - \ru Тип булевой операции с предыдущим результатом.
|
||||
\en Type of Boolean operation with the previous result. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contourNames - \ru Имена контуров образующей для именования граней.
|
||||
\en Generatix contours' names for naming faces. \~
|
||||
\param[in] spineNames - \ru Имена направляющей.
|
||||
\en Generating curve names. \~
|
||||
*/
|
||||
MbCurveEvolutionSolid( const MbSurface & surface_,
|
||||
const MbContour & contour_,
|
||||
const MbCurve3D & spine_,
|
||||
const EvolutionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const MbSNameMaker & contourNames,
|
||||
const MbSNameMaker & spineNames_ );
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по смешанной образующей.
|
||||
\en Constructor by combined generating curve. \~
|
||||
\param[in] sweptData_ - \ru Образующая.
|
||||
\en Generating curve. \~
|
||||
\param[in] spine_ - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[in] params - \ru Параметры кинематической операции.
|
||||
\en Parameters of the sweeping operation. \~
|
||||
\param[in] oType - \ru Тип булевой операции с предыдущим результатом.
|
||||
\en Type of Boolean operation with the previous result. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contourNames - \ru Имена контуров образующей для именования граней.
|
||||
\en Generatix contours' names for naming faces. \~
|
||||
\param[in] spineNames - \ru Имена направляющей.
|
||||
\en Generating curve names. \~
|
||||
*/
|
||||
MbCurveEvolutionSolid( const MbSweptData & sweptData_,
|
||||
const MbCurve3D & spine_,
|
||||
const EvolutionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
const MbSNameMaker & spineNames_ );
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по смешанной образующей.
|
||||
\en Constructor by combined generating curve. \~
|
||||
\param[in] sweptData_ - \ru Образующая.
|
||||
\en Generating curve. \~
|
||||
\param[in] spine_ - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[in] params - \ru Параметры кинематической операции.
|
||||
\en Parameters of the sweeping operation. \~
|
||||
\param[in] oType - \ru Тип булевой операции с предыдущим результатом.
|
||||
\en Type of Boolean operation with the previous result. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contourNames - \ru Имена контуров образующей для именования граней.
|
||||
\en Generatix contours' names for naming faces. \~
|
||||
\param[in] spineNames - \ru Имена направляющей.
|
||||
\en Generating curve names. \~
|
||||
*/
|
||||
MbCurveEvolutionSolid( const MbSweptData & sweptData_,
|
||||
const MbSpine & spine_,
|
||||
const EvolutionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
const MbSNameMaker & spineNames_ );
|
||||
|
||||
private :
|
||||
MbCurveEvolutionSolid( const MbCurveEvolutionSolid & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbCurveEvolutionSolid( const MbCurveEvolutionSolid & );
|
||||
public :
|
||||
virtual ~MbCurveEvolutionSolid();
|
||||
|
||||
/** \ru \name Общие функции математического объекта.
|
||||
\en \name Common functions of the mathematical object.
|
||||
\{ */
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & s ); // \ru Дать базовые объекты \en Get the base objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
/** \} */
|
||||
/** \ru \name Общие функции твердого тела (формообразующей операции).
|
||||
\en \name Common functions of the rigid solid (forming operations).
|
||||
\{ */
|
||||
virtual MbFaceShell * InitShell( bool in );
|
||||
virtual void InitBasis( RPArray<MbSpaceItem> & items );
|
||||
virtual bool GetPlacement( MbPlacement3D & p ) const;
|
||||
virtual void SetYourVersion( VERSION version, bool forAll );
|
||||
/** \} */
|
||||
/** \ru \name Функции строителя оболочки кинематического тела.
|
||||
\en \name Functions of creator of evolution solid shell.
|
||||
\{ */
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( EvolutionValues & params ) const { params = parameters; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const EvolutionValues & params ) { parameters = params; }
|
||||
/** \} */
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbCurveEvolutionSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCurveEvolutionSolid )
|
||||
}; // MbCurveEvolutionSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCurveEvolutionSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку кинематического тела.
|
||||
\en Create a shell of evolution solid. \~
|
||||
\details \ru Построить оболочку путём движения образующей кривой по направляющей кривой
|
||||
и выполнить булеву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a shell by moving the generating curve along the spine curve
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Набор граней, к которым дополняется построение.
|
||||
\en Face set the construction is complemented with respect to. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней.
|
||||
\en The method of copying faces. \~
|
||||
\param[in] sweptData - \ru Данные об образующей.
|
||||
\en The generating curve data. \~
|
||||
\param[in] spine - \ru Направляющая кривая.
|
||||
\en The spine curve. \~
|
||||
\param[in] params - \ru Параметры кинематической операции.
|
||||
\en Parameters of the sweeping operation. \~
|
||||
\param[in] oType - \ru Тип операции дополнения построения.
|
||||
\en Type of operation of construction complement. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en Name-maker with version for a Boolean operation with the source solid. \~
|
||||
\param[in] contoursNames - \ru Имена образующей.
|
||||
\en Names of the generating curve. \~
|
||||
\param[in] spineNames - \ru Имена пути.
|
||||
\en Names of the path. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveEvolution( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbSweptData & sweptData,
|
||||
const MbCurve3D & spine,
|
||||
const EvolutionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
const MbSNameMaker & spineNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку кинематического тела.
|
||||
\en Create a shell of evolution solid. \~
|
||||
\details \ru Построить оболочку путём движения образующей кривой по направляющей кривой
|
||||
и выполнить булуву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a shell by moving the generating curve along the spine curve
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Набор граней, к которым дополняется построение.
|
||||
\en Face set the construction is complemented with respect to. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней.
|
||||
\en The method of copying faces. \~
|
||||
\param[in] sweptData - \ru Данные об образующей.
|
||||
\en The generating curve data. \~
|
||||
\param[in] spine - \ru Направляющая кривая c дополнительной информацией.
|
||||
\en The spine curve with additional data. \~
|
||||
\param[in] params - \ru Параметры кинематической операции.
|
||||
\en Parameters of the sweeping operation. \~
|
||||
\param[in] oType - \ru Тип операции дополнения построения.
|
||||
\en Type of operation of construction complement. \~
|
||||
\param[in] operNames - \ru Именователь с версией для булевой с исходным телом.
|
||||
\en Name-maker with version for a Boolean operation with the source solid. \~
|
||||
\param[in] contoursNames - \ru Имена образующей.
|
||||
\en Names of the generating curve. \~
|
||||
\param[in] spineNames - \ru Имена пути.
|
||||
\en Names of the path. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveEvolution( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbSweptData & sweptData,
|
||||
const MbSpine & spine,
|
||||
const EvolutionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
const MbSNameMaker & spineNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_EVOLUTION_SOLID_H
|
||||
@@ -0,0 +1,123 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение удлинённой грани оболочки.
|
||||
\en Construction of an extended face of a shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_EXTENSION_SHELL_H
|
||||
#define __CR_EXTENSION_SHELL_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
#include <math_define.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель удлинённой грани оболочки.
|
||||
\en Constructor of an extended face of a shell. \~
|
||||
\details \ru Строитель удлинённой грани оболочки. Удлинение может быть выполнено следующими способами.
|
||||
Может быть ублинена на заданное расстояние указанная грань.
|
||||
К указанной грани может быть добавлена гладко стыкующаяся с ней грань.
|
||||
К указанной грани может быть добавлена грань, полученная выдавливанием крайнего ребра в заданном направлении.
|
||||
\en Constructor of an extended face of a shell. Extension can be performed in the following ways:
|
||||
The specified faces can be extended on the given distance.
|
||||
A smoothly connected face can be added to the given face.
|
||||
A face obtained by extrusion of boundary edge in the given direction can be added to the specified face. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbExtensionShell : public MbCreator {
|
||||
protected :
|
||||
MbItemIndex faceIndex; ///< \ru Идентификатор удлиняемой грани в оболочке. \en Identifier of a shell face to extend.
|
||||
SArray<MbItemIndex> edgeIndexes; ///< \ru Идентификаторы ребер в грани. \en Identifier of edges in the face.
|
||||
ExtensionValues parameters; ///< \ru Параметры построения удлинённой оболочки. \en Parameters of the extended shell construction.
|
||||
|
||||
public :
|
||||
MbExtensionShell( const MbItemIndex & fInd, const SArray<MbItemIndex> & inds,
|
||||
const ExtensionValues & p, const MbSNameMaker & n );
|
||||
private :
|
||||
MbExtensionShell( const MbExtensionShell &, MbRegDuplicate * ireg );
|
||||
public :
|
||||
virtual ~MbExtensionShell();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( ExtensionValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const ExtensionValues & params ) { parameters = params; }
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbExtensionShell )
|
||||
OBVIOUS_PRIVATE_COPY( MbExtensionShell )
|
||||
}; // MbExtensionShell
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbExtensionShell )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить удлинённую грань оболочки.
|
||||
\en Construct the extended face of a shell. \~
|
||||
\details \ru Построить удлинённую грань оболочки. Удлинение может быть выполнено следующими способами.
|
||||
Может быть ублинена на заданное расстояние указанная грань.
|
||||
К указанной грани может быть добавлена гладко стыкующаяся с ней грань.
|
||||
К указанной грани может быть добавлена грань, полученная выдавливанием крайнего ребра в заданном направлении.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct the extended face of a shell. Extension can be performed in the following ways:
|
||||
The specified faces can be extended on the given distance.
|
||||
A smoothly connected face can be added to the given face.
|
||||
A face obtained by extrusion of a boundary edge in the given direction can be added to the specified face.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] face - \ru Удлиняемая грагнь.
|
||||
\en Face to extend. \~
|
||||
\param[in] edges - \ru Крайние рёбра удлиняемой грани.
|
||||
\en Boundary edges of a face to extend. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] operNames - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateExtensionShell( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
MbFace & face,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const ExtensionValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_EXTENSION_SHELL_H
|
||||
@@ -0,0 +1,180 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки тела выдавливания.
|
||||
\en Constructor of an extrusion solid's shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_EXTRUSION_SOLID_H
|
||||
#define __CR_EXTRUSION_SOLID_H
|
||||
|
||||
|
||||
#include <cr_swept_solid.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbRect;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки тела выдавливания.
|
||||
\en Constructor of an extrusion solid's shell. \~
|
||||
\details \ru Строитель оболочки тела путём движения образующих кривых вдоль заданного вектора на заданное расстояние. \n
|
||||
\en Constructor of a solid's shell by moving generating curves along the given vector at the given distance. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCurveExtrusionSolid : public MbCurveSweptSolid {
|
||||
protected:
|
||||
MbSweptData sweptData; ///< \ru Данные об образующей. \en Generating curve data.
|
||||
MbVector3D direction; ///< \ru Направление выдавливания. \en Extrusion direction.
|
||||
ExtrusionValues parameters; ///< \ru Параметры. \en Parameters.
|
||||
|
||||
public :
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\param[in] sweptData - \ru Данные об образующей.
|
||||
\en The generating curve data. \~
|
||||
\param[in] direction - \ru Направление выдавливания.
|
||||
\en An extrusion direction. \~
|
||||
\param[in] parameters - \ru Параметры выдавливания.
|
||||
\en The extrusion parameters. \~
|
||||
\param[in] oType - \ru Тип булевой операции.
|
||||
\en A Boolean operation type. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contoursNames - \ru Именователь контуров для именования граней.
|
||||
\en An object defining contours' names for faces naming. \~
|
||||
\param[in] creators - \ru Построители тела, используемого в опции "До ближайшего объекта".
|
||||
\en Creators of a solid used with option "To the nearest object (solid)". \~
|
||||
\param[in] sameCreators - \ru Признак использования оригиналов построителей.
|
||||
\en Flag of using the original creators. \~
|
||||
*/
|
||||
MbCurveExtrusionSolid( const MbSweptData & sweptData,
|
||||
const MbVector3D & direction,
|
||||
const ExtrusionValues & parameters,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
const c3d::CreatorsSPtrVector * creators = NULL,
|
||||
bool sameCreators = true );
|
||||
|
||||
private :
|
||||
MbCurveExtrusionSolid( const MbCurveExtrusionSolid & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbCurveExtrusionSolid( const MbCurveExtrusionSolid & );
|
||||
public :
|
||||
virtual ~MbCurveExtrusionSolid();
|
||||
|
||||
/** \ru \name Общие функции математического объекта.
|
||||
\en \name Common functions of the mathematical object.
|
||||
\{ */
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element.
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Cделать копию. \en Make a copy.
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице. \en Transform element according to the matrix.
|
||||
virtual void Move( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг. \en Move.
|
||||
virtual void Rotate( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси. \en Rotate around an axis.
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты. \en Get the base objects.
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными. \en Determine whether the objects are similar.
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным. \en Make equal.
|
||||
|
||||
/** \} */
|
||||
/** \ru \name Общие функции твердого тела (формообразующей операции).
|
||||
\en \name Common functions of the rigid solid (forming operations).
|
||||
\{ */
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение. \en Construction.
|
||||
|
||||
virtual MbFaceShell * InitShell( bool in );
|
||||
virtual void InitBasis( RPArray<MbSpaceItem> & items );
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const;
|
||||
/** \} */
|
||||
/** \ru \name Функции строителя оболочки тела выдавливания.
|
||||
\en \name Functions of an extrusion solid's shell creator.
|
||||
\{ */
|
||||
/// \ru Поверхность двумерных контуров. \en A surface of two-dimensional contours.
|
||||
const MbSurface * GetSurface() const { return sweptData.GetSurface(); }
|
||||
/// \ru Направление выдавливания. \en An extrusion direction.
|
||||
const MbVector3D & GetDirection() const { return direction; }
|
||||
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( ExtrusionValues & params ) const { params = parameters; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const ExtrusionValues & params ) { parameters = params; }
|
||||
/// \ru Дать габарит контуров на плейсменте. \en Get bounding boxes of contours in the placement.
|
||||
void AddPlacementRect( MbRect & r ) const;
|
||||
/** \} */
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbCurveExtrusionSolid & ); // \ru НЕЛЬЗЯ!!! \en NOT ALLOWED!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCurveExtrusionSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCurveExtrusionSolid )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку тела выдавливания.
|
||||
\en Create an extrusion solid's shell. \~
|
||||
\details \ru Построить оболочку тела путём движения образующих кривых вдоль заданного вектора на заданное расстояние
|
||||
и выполнить булеву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a boy's shell by moving generating curves along the given vector at the given distance
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Набор граней, к которым дополняется построение.
|
||||
\en Face set the construction is complemented with respect to. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней.
|
||||
\en The method of copying faces. \~
|
||||
\param[in] creators - \ru Строители тела solid.
|
||||
\en Creators of the solid. \~
|
||||
\param[in] sweptData - \ru Данные об образующей.
|
||||
\en The generating curve data. \~
|
||||
\param[in] direction - \ru Направление выдавливания
|
||||
\en Extrusion direction. \~
|
||||
\param[in, out] params - \ru Параметры выдавливания.
|
||||
Возвращают информацию для построения элементов массива операций до поверхности.
|
||||
\en The extrusion parameters.
|
||||
Returns the information for construction of the up-to-surface operation array elements. \~
|
||||
\param[in] oType - \ru Тип операции дополнения построения.
|
||||
\en Type of operation of construction complement. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contoursNames - \ru Именователь контуров.
|
||||
\en An object defining the names of contours. \~
|
||||
\param[out] resType - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveExtrusion( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const c3d::CreatorsSPtrVector * solidCreators,
|
||||
const MbSweptData & sweptData,
|
||||
const MbVector3D & direction,
|
||||
const ExtrusionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
MbResultType & resType,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_EXTRUSION_SOLID_H
|
||||
@@ -0,0 +1,169 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель cкругления ребeр.
|
||||
\en Edges fillet constructor.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_FILLET_SOLID_H
|
||||
#define __CR_FILLET_SOLID_H
|
||||
|
||||
|
||||
#include <cr_smooth_solid.h>
|
||||
#include <function.h>
|
||||
|
||||
|
||||
struct MATH_CLASS MbEdgeFunction;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель cкругления ребeр.
|
||||
\en Edges fillet constructor. \~
|
||||
\details \ru Строитель cкругления ребeр содержит параметры для выполнения операции, функции изменения радиуса,
|
||||
идентификаторы граней остановки скруглений, идентификаторы скругляемых вершин. \n
|
||||
Скругление ребра заключается в его замене на грань, гладко сопрягающую соединяемые ребром грани.
|
||||
Построенная грань в сечении может иметь форму дуги окружности, эллипса, параболы и гиперболу.
|
||||
Дуга окружности может иметь постоянный или переменный радиус, а также постоянную хорду. \n
|
||||
\en Edges fillet constructor contains parameters for performing the operation, radius law,
|
||||
identifiers of faces terminating fillets, fillet vertices identifiers. \n
|
||||
Edge fillet consists in its replacement with a face smoothly connecting the faces incident at the edge.
|
||||
The section of the constructed face can be an arc of circle, ellipse, parabola or hyperbola.
|
||||
A circular arc can have a constant or variable radius and also a constant chord. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbFilletSolid : public MbSmoothSolid {
|
||||
public :
|
||||
RPArray<MbFunction> functions; ///< \ru Функции изменения радиусов сопряжения. \en Functions of changing conjugation radii.
|
||||
SArray<MbItemIndex> boundaries; ///< \ru Номера граней для обрезки краёв скругления / фаски. \en Indices of faces for trimming the fillet / chamfer boundaries.
|
||||
SArray<MbItemIndex> vertices; ///< \ru Номера скругляемых вершин. \en Indices of vertices to fillet.
|
||||
CornerValues cornerData; ///< \ru Параметры скругления вершин. \en Parameters of vertices fillet.
|
||||
|
||||
public :
|
||||
MbFilletSolid( SArray<MbEdgeFacesIndexes> & inds,
|
||||
RPArray<MbFunction> & funcs,
|
||||
SArray<MbItemIndex> & bounds,
|
||||
SArray<MbItemIndex> & verts,
|
||||
const SmoothValues & params,
|
||||
const CornerValues & data,
|
||||
const MbSNameMaker & n );
|
||||
private :
|
||||
MbFilletSolid( const MbFilletSolid & init, MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbFilletSolid( const MbFilletSolid & init );
|
||||
public :
|
||||
virtual ~MbFilletSolid();
|
||||
|
||||
// \ru Общие функции математического объекта. \en Common functions of the mathematical object.
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента. \en A type of element.
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D &to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта. \en Get properties of the object.
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта. \en Set properties of the object.
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
|
||||
|
||||
virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual( const MbCreator & init ); // \ru Сделать равным. \en Make equal.
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
private :
|
||||
virtual void ReadDistances ( reader &in );
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbFilletSolid & ); // \ru НЕЛЬЗЯ!!! \en NOT ALLOWED!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbFilletSolid )
|
||||
}; // MbFilletSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbFilletSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку со cкруглением ребeр.
|
||||
\en Create a shell with edges fillet. \~
|
||||
\details \ru Для указанной оболочки построить оболочку, в которой выполнено cкругление или фаска рёбер с постоянными параметрами.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a given shell create a shell with edges fillet or chamfer with constant parameters.\n
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней исходной оболочки.
|
||||
\en Method of copying the source shell faces. \~
|
||||
\param[in] initCurves - \ru Скругляемые рёбра исходной оболочки.
|
||||
\en The source shell's edges to fillet. \~
|
||||
\param[in] initBounds - \ru Грани исходной оболочки для обрезки cкругления или фаски.
|
||||
\en The source shell faces to trim the fillet of chamfer. \~
|
||||
\param[in] initVertices - \ru Скругляемые вершины "чемоданных углов".
|
||||
\en Vertices for blending of three surfaces. \~
|
||||
\param[in] parameters - \ru Параметры обработки рёбер.
|
||||
\en Parameters of edges processing. \~
|
||||
\param[in] cornerData - \ru Параметры скругления вершин "чемоданных углов".
|
||||
\en Parameters of blending three surfaces. \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateFillet( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbCurveEdge> & initCurves,
|
||||
RPArray<MbFace> & initBounds,
|
||||
RPArray<MbVertex> & initVertices,
|
||||
const SmoothValues & parameters,
|
||||
const CornerValues & cornerData,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку со cкруглением ребeр.
|
||||
\en Create a shell with edges fillet. \~
|
||||
\details \ru Для указанной оболочки построить оболочку, в которой выполнено cкругление рёбер переменным радиусом.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en For a given shell create a shell with edges fillet with a variable radius.\n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней исходной оболочки.
|
||||
\en Method of copying the source shell faces. \~
|
||||
\param[in] initCurves - \ru Обрабатываемые рёбра исходной оболочки и значения переменного радиуса.
|
||||
\en The source shell edges to process and values of variable radius. \~
|
||||
\param[in] initBounds - \ru Грани исходной оболочки для обрезки cкругления или фаски.
|
||||
\en The source shell faces to trim the fillet or chamfer. \~
|
||||
\param[in] parameters - \ru Параметры обработки рёбер.
|
||||
\en Parameters of edges processing. \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateFillet( MbFaceShell * solid, MbeCopyMode sameShell,
|
||||
SArray<MbEdgeFunction> & initCurves,
|
||||
RPArray<MbFace> & initBounds,
|
||||
const SmoothValues & parameters,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_FILLET_SOLID_H
|
||||
@@ -0,0 +1,171 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки отверстия, кармана, фигурного паза.
|
||||
\en Constructor of shell of hole, pocket, groove. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_HOLE_SOLID_H
|
||||
#define __CR_HOLE_SOLID_H
|
||||
|
||||
|
||||
#include <cr_swept_solid.h>
|
||||
#include <op_shell_parameter.h>
|
||||
#include <mb_placement3d.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки отверстия, кармана, фигурного паза.
|
||||
\en Constructor of shell of hole, pocket, groove. \~
|
||||
\details \ru Строитель оболочки отверстия, кармана, фигурного паза. \n
|
||||
Построение отверстия происходит следующим образом :
|
||||
создается контур сверла в конструктивной плоскости,
|
||||
вращением контура строится сверло, затем оно вычитается из присланного тела.
|
||||
Построение кармана/бобышки происходит следующим образом :
|
||||
создается прямоугольный контур в конструктивной плоскости,
|
||||
который затем выдавливается в зависимости от типа объекта
|
||||
либо в положительном направлении Z, либо в отрицательном,
|
||||
затем скругляются боковые ребра и ребра на дне,
|
||||
далее вычитается карман из присланного тела или приклеивается бобышка.
|
||||
Построение фигурного паза происходит следующим образом :
|
||||
создается контур паза в конструктивной плоскости,
|
||||
выдавливанием контура строится паз, затем он вычитается из присланного тела.
|
||||
\en Constructor of shell of hole, pocket, groove. \n
|
||||
Construction of a hole is performed as follows:
|
||||
a contour of a drill is created in the constructive plane,
|
||||
and a drill is constructed by revolution of the contour; then the drill is subtracted from the given solid.
|
||||
A pocket/boss is constructed as follows:
|
||||
a rectangular contour is created in the constructive plane
|
||||
which is extruded then
|
||||
either in the positive direction of Z or in the negative one subject to the object type;
|
||||
then the side edges and edges on the bottom are filleted;
|
||||
then the obtained pocket is subtracted from the given solid or the obtained boss is attached to the solid.
|
||||
The groove is constructed as follows:
|
||||
a contour of a groove is created in the constructive plane;
|
||||
the groove is constructed by extrusion of the contour; then it is subtracted from the given solid. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbHoleSolid : public MbCurveSweptSolid {
|
||||
protected :
|
||||
MbPlacement3D placement; ///< \ru Плоскость отверстия. \en Plane of the hole.
|
||||
HoleValues * parameters; ///< \ru Параметры отверстия. \en The hole parameters.
|
||||
|
||||
private :
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbHoleSolid( const MbHoleSolid & init );
|
||||
MbHoleSolid( const MbHoleSolid & init, MbRegDuplicate * ireg );
|
||||
public :
|
||||
/// \ru Конструктор по параметрам. \en Constructor by parameters.
|
||||
MbHoleSolid( const MbPlacement3D & pl, const HoleValues & p,
|
||||
OperationType op, const MbSNameMaker & n );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbHoleSolid();
|
||||
|
||||
public :
|
||||
|
||||
// \ru Переопределение функций базового класса \en The base class functions override
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & s ); // \ru Дать базовые объекты \en Get the base objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
virtual MbFaceShell * InitShell( bool in );
|
||||
virtual void InitBasis( RPArray<MbSpaceItem> & items );
|
||||
virtual bool GetPlacement( MbPlacement3D & p ) const;
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbHoleSolid & ); // \ru Не реализовано!!! \en Not implemented!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbHoleSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbHoleSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку с отверстием, карманом, или фигурным пазом.
|
||||
\en Create a shell with a hole, a pocket or a groove. \~
|
||||
\details \ru Для указанной оболочки построить оболочку с отверстием, карманом, или фигурным пазом. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a given shell construct a shell with a hole, a pocket or a groove. \n
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] solid - \ru Набор граней, к которым дополняется построение.
|
||||
\en Face set the construction is complemented with respect to. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней.
|
||||
\en The method of copying faces. \~
|
||||
\param[in] place - \ru Локальная система координат.
|
||||
\en A local coordinate system. \~
|
||||
\param[in] par - \ru Параметры.
|
||||
\en Parameters. \~
|
||||
\param[in] ns - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateHole( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
const HoleValues & par,
|
||||
const MbSNameMaker & ns,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Определить глубину отверстия "до указанной поверхности" при построении оболочки с отверстием.
|
||||
\en Determine the hole depth "to the specified surface" while creating a shell with a hole. \~
|
||||
\details \ru Определить глубину отверстия "до указанной поверхности" при построении оболочки с отверстием.
|
||||
Глубина отверстия "до поверхности" определяться расстоянием между
|
||||
точкой привязки отверстия на поверхности расположения и
|
||||
точкой пересечения оси отверстия с указанной поверхностью ограничения глубины.
|
||||
\en Determine the hole depth "to the specified surface" while creating a shell with a hole.
|
||||
The hole depth "to the surface" is defined by the distance between
|
||||
the fasten point of the hole on the location surface and
|
||||
a point of intersection of the hole axis with the given surface limiting the depth. \~
|
||||
\param[in] face - \ru Грань, до которой надо ограничить глубину.
|
||||
\en A face terminating the depth. \~
|
||||
\param[in] place - \ru Плоскость отверстия.
|
||||
\en Plane of the hole. \~
|
||||
\param[in] pars - \ru Параметры отверстия.
|
||||
\en The hole parameters. \~
|
||||
\param[out] depth - \ru Глубина.
|
||||
\en Depth. \~
|
||||
\return \ru true в случае , если расстояние было найдено \n false - если ось не пересекает грань
|
||||
\en True if the distance was found \n false - if the axis does not intersect the face \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) GetDepthToFace( const MbFace & face,
|
||||
const MbPlacement3D & place,
|
||||
HoleValues & pars,
|
||||
double & depth );
|
||||
|
||||
|
||||
#endif // __CR_HOLE_SOLID_H
|
||||
@@ -0,0 +1,73 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель кривой пересечения.
|
||||
\en Intersection curve constructor.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_INTERSECTION_CURVE_H
|
||||
#define __CR_INTERSECTION_CURVE_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель кривой пересечения.
|
||||
\en Intersection curve constructor. \~
|
||||
\details \ru Строитель кривой пересечения.\n
|
||||
\en Intersection curve constructor.\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbIntCurveCreator : public MbCreator {
|
||||
private:
|
||||
RPArray<MbCreator> creators1; // \ru Журнал построения первой оболочки. \en The first shell history tree.
|
||||
RPArray<MbCreator> creators2; // \ru Журнал построения второй оболочки. \en The second shell history tree.
|
||||
|
||||
protected:
|
||||
MbIntCurveCreator( const MbIntCurveCreator &, MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
MbIntCurveCreator( const MbIntCurveCreator & ); // \ru Не реализовано \en Not implemented
|
||||
MbIntCurveCreator(); // \ru Не реализовано \en Not implemented
|
||||
public:
|
||||
MbIntCurveCreator( const RPArray<MbCreator> & creators1, bool same1,
|
||||
const RPArray<MbCreator> & creators2, bool same2,
|
||||
const MbSNameMaker & snMaker );
|
||||
public:
|
||||
virtual ~MbIntCurveCreator();
|
||||
|
||||
// \ru Общие функции строителя. \en The common functions of the creator.
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * iReg = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
// \ru Построить кривую по журналу построения \en Create a curve from the history tree
|
||||
virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
|
||||
void operator = ( const MbIntCurveCreator & ); // \ru Не реализовано!!! \en Not implemented!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbIntCurveCreator )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbIntCurveCreator )
|
||||
|
||||
#endif // __CR_INTERSECTION_CURVE_H
|
||||
@@ -0,0 +1,239 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки соединения.
|
||||
\en Construction of a join shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_JOIN_SHELL_H
|
||||
#define __CR_JOIN_SHELL_H
|
||||
|
||||
|
||||
#include <op_shell_parameter.h>
|
||||
#include <creator.h>
|
||||
#include <math_define.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки соединения.
|
||||
\en Constructor of a join shell. \~
|
||||
\details \ru Строитель оболочки, соединяющей две грани по двум кривым на них. \n
|
||||
\en Constructor of a shell joining two faces by two curves on them. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbJoinShell : public MbCreator {
|
||||
protected:
|
||||
MbCurve3D * curve1; ///< \ru Первая образующая кривая. \en The first generating curve.
|
||||
MbCurve3D * curve2; ///< \ru Вторая образующая кривая. \en The second generating curve.
|
||||
JoinSurfaceValues parameters; ///< \ru Параметры поверхности соединения. \en Parameters of a join surface.
|
||||
public :
|
||||
MbJoinShell( MbCurve3D & c1, MbCurve3D & c2, const JoinSurfaceValues & p, const MbSNameMaker & n );
|
||||
private :
|
||||
MbJoinShell( const MbJoinShell & init, MbRegDuplicate * ireg );
|
||||
public :
|
||||
virtual ~MbJoinShell();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA () const; ///< \ru Тип элемента \en Element type
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; ///< \ru Сделать копию \en Make a copy
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); ///< \ru Преобразовать элемент согласно матрице \en Transform an element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); ///< \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); ///< \ru Поворот вокруг оси \en Rotation about an axis
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными. \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual MbePrompt GetPropertyName (); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties ( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties ( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); ///< \ru Построение \en Construction
|
||||
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( JoinSurfaceValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const JoinSurfaceValues & params ) { parameters = params; }
|
||||
|
||||
const MbCurve3D & GetCurve( ptrdiff_t num ) const;
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbJoinShell )
|
||||
OBVIOUS_PRIVATE_COPY( MbJoinShell )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbJoinShell )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* \brief \ru Проверить необходимость модификации второй кривой.
|
||||
\en Check if a modification of the second curve is necessary. \~
|
||||
\details \ru Проверить необходимость модификации второй кривой для построения оболочки соединения на этих кривых. \n
|
||||
\en Check whether a modification of the second curve is necessary for construction of a join shell on these curves. \n \~
|
||||
\param[in] curve1 - \ru Первая кривая.
|
||||
\en The first curve. \~
|
||||
\param[in] curve2 - \ru Вторая кривая.
|
||||
\en The second curve. \~
|
||||
\param[out] isInverted1 - \ru Была ли первая кривая инвертирована.
|
||||
\en Whether the first curve was inverted. \~
|
||||
\param[out] isShifted1 - \ru Было ли смещено начало второй кривой.
|
||||
\en Whether the beginning of the first curve was shifted. \~
|
||||
\param[in] version - \ru Версия построения.
|
||||
\en The version of construction. \~
|
||||
\result \ru Возвращает построенную оболочку.
|
||||
\en Returns the constructed shell. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
//---
|
||||
void CheckJoinedShellCurve( const MbCurve3D & curve1,
|
||||
const MbCurve3D & curve2,
|
||||
bool & isInverted1,
|
||||
bool & isShifted1,
|
||||
VERSION version );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* \brief \ru Построить кривую по набору рёбер.
|
||||
\en Construct a curve given a set of edges. \~
|
||||
\details \ru Построить кривую по набору рёбер для поверхности соединения.
|
||||
\en Construct a curve given a set of edges for a join surface. \~
|
||||
\param[in] edges - \ru Набор ребер.
|
||||
\en A set of edges. \~
|
||||
\param[in] orients - \ru Ориентация рёбер набора.
|
||||
\en Orientation of edges from the set. \~
|
||||
\param[in] matr - \ru Матрица преобразования рёбер набора.
|
||||
\en Transformation matrix of edges from the set. \~
|
||||
\param[out] res - \ru Код результата построения.
|
||||
\en Construction result code. \~
|
||||
\result \ru Возвращает построенную кривую.
|
||||
\en Returns the constructed curve. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
//---
|
||||
MbCurve3D * CreateJoinedShellCurve( const RPArray<MbCurveEdge> & edges,
|
||||
const SArray<bool> & orients,
|
||||
const MbMatrix3D & matr,
|
||||
MbResultType & res );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/* \brief \ru Построить оболочку соединения.
|
||||
\en Construct a join shell. \~
|
||||
\details \ru Построить оболочку, соединяющую две грани по двум кривым на них. \n
|
||||
\en Construct a shell joining two faces by two curves on them. \n \~
|
||||
\param[in] curve1 - \ru Кривая на первой соединяемой поверхности.
|
||||
\en A curve on the first surface to join. \~
|
||||
\param[in] curve2 - \ru Кривая на второй соединяемой поверхности.
|
||||
\en A curve on the second surface to join. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] res - \ru Код результата построения.
|
||||
\en Construction result code. \~
|
||||
\result \ru Возвращает построенную оболочку.
|
||||
\en Returns the constructed shell. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MbFaceShell * MakeJoinShell( MbSurfaceCurve & curve1,
|
||||
MbSurfaceCurve & curve2,
|
||||
JoinSurfaceValues & parameters,
|
||||
const MbSNameMaker & names,
|
||||
bool isPhantom,
|
||||
MbResultType & res );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку соединения.
|
||||
\en Construct a join shell. \~
|
||||
\details \ru Построить оболочку, соединяющую две грани по двум кривым на них.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell joining two faces by two curves on them.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] curve1 - \ru Кривая на первой соединяемой поверхности.
|
||||
\en A curve on the first surface to join. \~
|
||||
\param[in] curve2 - \ru Кривая на второй соединяемой поверхности.
|
||||
\en A curve on the second surface to join. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата построения.
|
||||
\en Construction result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateJoinShell( MbSurfaceCurve & curve1,
|
||||
MbSurfaceCurve & curve2,
|
||||
JoinSurfaceValues & parameters,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку соединения.
|
||||
\en Construct a join shell. \~
|
||||
\details \ru Построить оболочку соединения по двум наборам ребер.
|
||||
Рёбра двух наборов определяют набор граней соединения, каждая из которых побстроена по двум кривым.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell of join given two sets of edges.
|
||||
Edges of two sets define a set of join faces each of which is constructed by two curves.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] edges1 - \ru Первый набор ребер.
|
||||
\en The first set of edges. \~
|
||||
\param[in] orients1 - \ru Ориентация рёбер первого набора.
|
||||
\en Orientation of edges from the first set. \~
|
||||
\param[in] edges2 - \ru Второй набор ребер.
|
||||
\en The second set of edges. \~
|
||||
\param[in] orients2 - \ru Ориентация рёбер второго набора.
|
||||
\en Orientation of edges of the second set. \~
|
||||
\param[in] matr1 - \ru Матрица преобразования рёбер первого набора.
|
||||
\en Transformation matrix of edges from the first set. \~
|
||||
\param[in] matr2 - \ru Матрица преобразования рёбер второго набора.
|
||||
\en Transformation matrix of edges from the second set. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateJoinShell( const RPArray<MbCurveEdge> & edges1,
|
||||
const SArray<bool> & orients1,
|
||||
const RPArray<MbCurveEdge> & edges2,
|
||||
const SArray<bool> & orients2,
|
||||
const MbMatrix3D & matr1,
|
||||
const MbMatrix3D & matr2,
|
||||
JoinSurfaceValues & parameters,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell,
|
||||
bool isPhantom );
|
||||
|
||||
|
||||
#endif // __CR_JOIN_SHELL_H
|
||||
@@ -0,0 +1,217 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки тела по плоским сечениям.
|
||||
\en Constructor of a lofted shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_LOFTED_SOLID_H
|
||||
#define __CR_LOFTED_SOLID_H
|
||||
|
||||
|
||||
#include <cur_contour_on_plane.h>
|
||||
#include <cr_swept_solid.h>
|
||||
#include <templ_sptr.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки тела по сечениям.
|
||||
\en Constructor of a lofted shell. \~
|
||||
\details \ru Строитель оболочки тела, проходящей по заданным сечениям и вдоль заданной осевой линии и направляющих. \n
|
||||
\en Constructor of solid's shell passing through the given sections along the specified spine curve and guide curves. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCurveLoftedSolid : public MbCurveSweptSolid {
|
||||
protected :
|
||||
RPArray<MbContourOnSurface> curves; ///< \ru Плоские сечения. \en Plane sections.
|
||||
SPtr<MbCurve3D> spine; ///< \ru Осевая линия (может отсутствовать). \en Spine curve (can be absent).
|
||||
LoftedValues parameters; ///< \ru Параметры. \en Parameters.
|
||||
RPArray<MbCurve3D> * guideCurves; ///< \ru Массив направляющих кривых (может быть NULL). \en An array of guide curves (can be NULL).
|
||||
SArray<MbCartPoint3D> * userPnts; ///< \ru Пользовательские точки на сечениях. \en Custom points on the sections.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbCurveLoftedSolid( const RPArray<MbSurface> & surfs,
|
||||
const RPArray<MbContour> & cntrs,
|
||||
const LoftedValues & p,
|
||||
OperationType op,
|
||||
const MbSNameMaker & n,
|
||||
RPArray<MbSNameMaker> & ns,
|
||||
RPArray<MbCurve3D> * guideCrvs,
|
||||
SArray<MbCartPoint3D> * userPnts );
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbCurveLoftedSolid( const MbCurve3D & s,
|
||||
const RPArray<MbSurface> & surfs,
|
||||
const RPArray<MbContour> & cntrs,
|
||||
const LoftedValues & p,
|
||||
OperationType op,
|
||||
const MbSNameMaker & n,
|
||||
RPArray<MbSNameMaker> & ns,
|
||||
RPArray<MbCurve3D> * guideCrvs,
|
||||
SArray<MbCartPoint3D> * userPnts );
|
||||
|
||||
private :
|
||||
MbCurveLoftedSolid( const MbCurveLoftedSolid & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbCurveLoftedSolid( const MbCurveLoftedSolid & init );
|
||||
|
||||
public :
|
||||
virtual ~MbCurveLoftedSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать \en Transform
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the base objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual MbFaceShell * InitShell( bool /*in*/ );
|
||||
virtual void InitBasis( RPArray<MbSpaceItem> & items );
|
||||
virtual bool GetPlacement( MbPlacement3D & ) const;
|
||||
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( LoftedValues & params ) const { params = parameters; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const LoftedValues & params ) { parameters = params; }
|
||||
/// \ru Направляющая кривая. \en The spine curve.
|
||||
const MbCurve3D * GetSpine() const { return spine.get(); }
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbCurveLoftedSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCurveLoftedSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCurveLoftedSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать тело по плоским сечениям.
|
||||
\en Create a solid from a planar sections. \~
|
||||
\details \ru Построить оболочку тела, проходящую по заданным сечениям
|
||||
и выполнить булеву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a solid's shell passing through the given sections
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveLofted( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
SArray<MbPlacement3D> & pl,
|
||||
RPArray<MbContour> & c,
|
||||
const LoftedValues & p,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
RPArray<MbSNameMaker> & ns,
|
||||
SArray<MbCartPoint3D> * ps,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать тело по пространственным сечениям.
|
||||
\en Create a solid from sections on surfaces. \~
|
||||
\details \ru Построить оболочку тела, проходящую по заданным сечениям
|
||||
и выполнить булеву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a solid's shell passing through the given sections
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveLofted( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbSurface> & surfs,
|
||||
RPArray<MbContour> & c,
|
||||
const LoftedValues & p,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
RPArray<MbSNameMaker> & ns,
|
||||
RPArray<MbCurve3D> * guideCurves,
|
||||
SArray<MbCartPoint3D> * ps,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать тело по плоским сечениям.
|
||||
\en Create a solid from a planar sections. \~
|
||||
\details \ru Построить оболочку тела, проходящую по заданным сечениям вдоль заданной направляющей
|
||||
и выполнить булеву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a solid's shell passing through the given sections along the specified spine curve
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveLofted( MbFaceShell * solid,
|
||||
MbeCopyMode _sameShell,
|
||||
SArray<MbPlacement3D> & pl,
|
||||
RPArray<MbContour> & c,
|
||||
const MbCurve3D & centre_line,
|
||||
const LoftedValues & p,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
RPArray<MbSNameMaker> & ns,
|
||||
SArray<MbCartPoint3D> * ps,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать тело по пространственным сечениям.
|
||||
\en Create a solid from a space sections. \~
|
||||
\details \ru Построить оболочку тела, проходящую по заданным сечениям вдоль заданной осевой линии и направляющих
|
||||
и выполнить булеву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a solid's shell passing through the given sections along the specified spine curve and guide curves
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveLofted( MbFaceShell * solid,
|
||||
MbeCopyMode _sameShell,
|
||||
RPArray<MbSurface> & surfs,
|
||||
RPArray<MbContour> & c,
|
||||
const MbCurve3D & centre_line,
|
||||
const LoftedValues & p,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
RPArray<MbSNameMaker> & ns,
|
||||
RPArray<MbCurve3D> * guideCurves,
|
||||
SArray<MbCartPoint3D> * ps,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_LOFTED_SOLID_H
|
||||
@@ -0,0 +1,115 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение срединной оболочки между гранями тела.
|
||||
\en Construction of a median shell between faces of solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_MEDIAN_SHELL_H
|
||||
#define __CR_MEDIAN_SHELL_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <math_define.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MedianShellFaces;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель срединной оболочки тела.
|
||||
\en Constructor of a median shell of solid. \~
|
||||
\details \ru Строитель осуществляет построение срединной оболочки между выбранными парами граней тела.
|
||||
Поверхности выбранные граней должны быть эквидистантны по отношению друг к другу. \n
|
||||
\en Constructor performs the building of a median shell between suitable selected face pairs of solid.
|
||||
Suitable face pairs should be equidistant from each other. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbMedianShell : public MbCreator {
|
||||
private :
|
||||
MedianShellFaces faces; ///< \ru Выбранные грани. \en Selected faces .
|
||||
MedianShellValues parameters; ///< \ru Параметры срединной оболочки. \en Parameters of median shell.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор по выбранным граням и параметрам срединной оболочки. \en Constructor by selected faces and parameters of median shell.
|
||||
MbMedianShell( const MedianShellFaces & faces, const MedianShellValues & params, const MbSNameMaker & snMaker );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbMedianShell();
|
||||
|
||||
private:
|
||||
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
|
||||
MbMedianShell( const MbMedianShell &, MbRegDuplicate * );
|
||||
|
||||
public:
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
// \ru Построение оболочки по исходным данным \en Construction of a shell from the given data
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( MedianShellValues & params ) const { params = parameters; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MedianShellValues & params ) { parameters = params; }
|
||||
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbMedianShell )
|
||||
OBVIOUS_PRIVATE_COPY( MbMedianShell )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbMedianShell )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить срединную оболочку между выбранными парами граней тела.
|
||||
\en Build a median shell between selected faces of solid. \~
|
||||
\details \ru Построить срединную оболочку между выбранными парами граней тела.
|
||||
Выбранные грани должны быть эквидистантны по отношению друг к другу.
|
||||
Грани должны принадлежать одному и тому же телу.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Build a median shell between suitable selected face pairs of solid.
|
||||
Suitable face pairs should be offset from each other.
|
||||
The faces must belong to the same body.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The initial solid. \~
|
||||
\param[in] faces - \ru Выбранные пары граней.
|
||||
\en Selected face pairs. \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en Parameters of operation. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная срединная оболочка.
|
||||
\en Constructed median shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateMedianShell( const MbFaceShell & solid,
|
||||
const std::vector<c3d::IndicesPair> & faceIndexes,
|
||||
const MedianShellValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_MEDIAN_SHELL_H
|
||||
@@ -0,0 +1,103 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки на сетке кривых.
|
||||
\en Construction of a shell from a mesh of curves. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_MESH_SHELL_H
|
||||
#define __CR_MESH_SHELL_H
|
||||
|
||||
|
||||
#include <math_define.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbFaceShell;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки на сетке кривых.
|
||||
\en Constructor of a shell from a mesh of curves. \~
|
||||
\details \ru Строитель оболочки на сетке кривых, образованной двумя сечействами кривых. \n
|
||||
\en Constructor of a shell from a mesh of curves formed by two sets of curves. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS MbMeshShell : public MbCreator {
|
||||
private :
|
||||
MeshSurfaceValues parameters; ///< \ru Параметры построения. \en Construction parameters.
|
||||
mutable bool changed; ///< \ru Флаг изменения параметров. \en Flag of parameters modification.
|
||||
private:
|
||||
/// \ru Конструктор копирования. \en Copy-constructor.
|
||||
MbMeshShell( const MbMeshShell & obj, MbRegDuplicate * ireg );
|
||||
public:
|
||||
/// \ru Конструктор по параметрам операции и именователю на оригиналах кривых и копиях поверхностей. \en Constructor by operation parameters and name-maker for original curves and copies of surfaces.
|
||||
MbMeshShell( const MeshSurfaceValues & pars, const MbSNameMaker & n );
|
||||
virtual ~MbMeshShell();
|
||||
|
||||
public: // \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
virtual MbeCreatorType IsA() const; ///< \ru Тип элемента \en Element type
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; ///< \ru Сделать копию \en Make a copy
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); ///< \ru Сделать равным \en Make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); ///< \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); ///< \ru Сдвиг по вектору \en Translation by the vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); ///< \ru Поворот вокруг оси \en Rotation about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); ///< \ru Выдать заголовок свойства объекта \en Get name of object property
|
||||
virtual void GetProperties( MbProperties & ); ///< \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); ///< \ru Записать свойства объекта \en Write properties of the object
|
||||
virtual void GetBasisItems( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
public:
|
||||
/// \ru Построение оболочки \en Creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( MeshSurfaceValues & params ) const;
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MeshSurfaceValues & params );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbMeshShell )
|
||||
OBVIOUS_PRIVATE_COPY( MbMeshShell )
|
||||
}; // MbMeshShell
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbMeshShell )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку на сетке кривых.
|
||||
\en Construct a shell from a mesh of curves. \~
|
||||
\details \ru Построить оболочку на сетке кривых, образованной двумя сечействами кривых. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a shell from a mesh of curves formed by two sets of curves. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] operNames - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateMeshShell( MeshSurfaceValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_MESH_SHELL_H
|
||||
@@ -0,0 +1,217 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки c деформируемыми гранями.
|
||||
\en Constructor of a shell with deformable faces.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_MODIFIED_NURBS_H
|
||||
#define __CR_MODIFIED_NURBS_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки c деформируемыми гранями.
|
||||
\en Constructor of a shell with deformable faces. \~
|
||||
\details \ru Строитель оболочки, выполняющий замену поверхностей указанных граней деформируемыми поверхностями. \n
|
||||
\en Constructor of a shell performing replacement of the surfaces of the specified faces with deformable surfaces. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbModifiedNurbsItem : public MbCreator {
|
||||
protected:
|
||||
NurbsValues parameters; ///< \ru Параметры модифицированных поверхностей. \en Parameters of modified surfaces.
|
||||
SArray<MbItemIndex> itemIndices; ///< \ru Идентификаторы модифицируемых граней. \en Identifiers of faces being modified.
|
||||
RPArray<MbSurface> surfaces; ///< \ru Множество поверхностей модифицированных граней. \en A set of surfaces of the modified faces.
|
||||
|
||||
public: // \ru конструктор по параметрам \en constructor by parameters
|
||||
MbModifiedNurbsItem( const NurbsValues & p, const SArray<MbItemIndex> & faces,
|
||||
RPArray<MbSurface> & surfs, const MbSNameMaker & names );
|
||||
private: // \ru конструктор дублирующий \en duplication constructor
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbModifiedNurbsItem( const MbModifiedNurbsItem & init );
|
||||
MbModifiedNurbsItem( const MbModifiedNurbsItem & init, MbRegDuplicate * ireg );
|
||||
|
||||
public: // \ru деструктор \en destructor
|
||||
virtual ~MbModifiedNurbsItem();
|
||||
|
||||
public: // \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru сделать копию \en create a copy
|
||||
virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru сдвиг по вектору \en translation by a vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru записать свойства объекта \en set properties of the object
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
/// \ru Построение оболочки. \en creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
virtual void Refresh( MbFaceShell & outer ); ///< \ru обновить форму оболочки \en update shape of the shell
|
||||
// \ru Выдать базовые объекты. \en Get basis objects.
|
||||
virtual void GetBasisItems( RPArray<MbSpaceItem> & s );
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( NurbsValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const NurbsValues & params ) { parameters = params; }
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbModifiedNurbsItem & );
|
||||
void SurfacesFree(); // \ru Удалить поверхности \en Delete the surfaces
|
||||
void SurfacesAddRef(); // \ru Учесть поверхности \en Consider the surfaces
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbModifiedNurbsItem )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbModifiedNurbsItem )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Модификатор оболочки c деформируемой гранью.
|
||||
\en Modifier of a shell with a deformable face. \~
|
||||
\details \ru Модификатор оболочки выполняет деформацию поверхности указанной грани.
|
||||
Указанная грань должна быть дефолрмируемой. \n
|
||||
\en Modifier of a shell performs deformation of a surface of the specified face.
|
||||
The specified face should be deformable. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbNurbsModification : public MbCreator {
|
||||
protected:
|
||||
MbItemIndex faceIndex; ///< \ru Идентификатор деформируемой грани. \en Identifier of the deformable face.
|
||||
MbSurface * faceSurface; ///< \ru Поверхность деформируемой грани. \en Surface of the deformable face.
|
||||
Array2<bool> fixedPoints; ///< \ru Матрица положений неизменяемых контрольных точек модифицируемой поверхности. \en Matrix of positions of the invariant control points of the modifiable surface.
|
||||
|
||||
public: // \ru конструктор по параметрам \en constructor by parameters
|
||||
MbNurbsModification( const MbItemIndex & index, MbSurface & fSurface, Array2<bool> & fPoints,
|
||||
const MbSNameMaker & names );
|
||||
private: // \ru конструктор дублирующий \en duplication constructor
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbNurbsModification( const MbNurbsModification & init );
|
||||
MbNurbsModification( const MbNurbsModification & init, MbRegDuplicate * ireg );
|
||||
|
||||
public: // \ru деструктор \en destructor
|
||||
virtual ~MbNurbsModification();
|
||||
|
||||
public: // \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru сделать копию \en create a copy
|
||||
virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru сдвиг по вектору \en translation by a vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru записать свойства объекта \en set properties of the object
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
/// \ru построение оболочки \en creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
virtual void Refresh( MbFaceShell & outer ); ///< \ru обновить форму оболочки \en update shape of the shell
|
||||
// \ru Выдать базовые объекты. \en Get basis objects.
|
||||
virtual void GetBasisItems( RPArray<MbSpaceItem> & s );
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbNurbsModification & ); // \ru не реализован!!! \en not implemented!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbNurbsModification )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbNurbsModification )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку c деформируемыми гранями.
|
||||
\en Construct a shell with deformable faces. \~
|
||||
\details \ru Построить оболочку c заменjq указанных граней исходной оболочки деформируемыми гранями.
|
||||
Поверхности выбранных граней аппроксимируются NURBS поверхностями или
|
||||
деформируемыми поверхностями для последующего редактирования.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell with replacement of the specified faces of the source shell with deformable faces.
|
||||
Surfaces of the selected faces are approximated with NURBS surfaces or
|
||||
deformable surfaces for the further editing.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] outer - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the source shell. \~
|
||||
\param[in] parameters - \ru Параметры модификации.
|
||||
\en Parameters of the modification. \~
|
||||
\param[in] faces - \ru Изменяемые грани тела.
|
||||
\en Faces to be modified. \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateModifiedNurbsItem( MbFaceShell * outer,
|
||||
MbeCopyMode sameShell,
|
||||
const NurbsValues & parameters,
|
||||
const RPArray<MbFace> & faces,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку, в которой деформирована указанная грань.
|
||||
\en Construct a shell in which the specified face is deformed. \~
|
||||
\details \ru Построить оболочку, в которой деформирована указанная грань путём
|
||||
подстановки контрольных точек присланной NURBS-поверхности с фиксацией указанных точек.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell in which the specified face is deformed by
|
||||
replacement of the control points of the given NURBS surface with fixing the specified points.\n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] outer - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the source shell. \~
|
||||
\param[in] face - \ru Деформируемая грань оболочки.
|
||||
\en Deformable face of the shell. \~
|
||||
\param[in] faceSurface - \ru Новая деформируемая поверхность для грани.
|
||||
\en The new deformable surface of the face. \~
|
||||
\param[in] fixedPoints - \ru Матрица положений неизменяемых контрольных точек деформируемой поверхности (false).
|
||||
\en Matrix of positions of invariant control points of the deformable surface (false). \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateNurbsModification( MbFaceShell * outer,
|
||||
MbeCopyMode sameShell,
|
||||
MbFace * face,
|
||||
MbSurface & faceSurface,
|
||||
Array2<bool> & fixedPoints,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_MODIFIED_NURBS_H
|
||||
@@ -0,0 +1,152 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель модифицированной оболочки.
|
||||
\en Constructor of a modified shell.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_MODIFIED_SOLID_H
|
||||
#define __CR_MODIFIED_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель модифицированной оболочки.
|
||||
\en Constructor of a modified shell. \~
|
||||
\details \ru Строитель оболочки, выполняющий модификацию исходной оболочки.
|
||||
Строитель выполняет следующие модификации исходной оболочки: \n
|
||||
удаление из тела выбранных граней с окружением, \n
|
||||
создание тела из выбранных граней с окружением, \n
|
||||
перемещение выбранных граней с окружением относительно оставшихся граней тела, \n
|
||||
замена выбранных граней тела эквидистантными гранями (перемещение по нормали, изменение радиуса), \n
|
||||
замена выбранных граней тела деформируемыми гранями (превращение в NURBS для редактирования).\n
|
||||
\en Constructor of a shell performing modification of the source shell.
|
||||
Constructor performs the following modifications of the source shell: \n
|
||||
deletion the selected faces with neighborhood from the solid, \n
|
||||
creation of the solid from the selected faces with the neighborhood, \n
|
||||
translation of the selected faces with the neighborhood relative to the remained faces of the solid, \n
|
||||
replacement of the selected faces of the solid with the offset faces (translation along the normal, changing the radius), \n
|
||||
replacement of the specified faces of the solid with the deformable faces (conversion to the NURBS for editing).\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbFaceModifiedSolid : public MbCreator {
|
||||
protected: // \ru Данные класса. \en Data of class.
|
||||
ModifyValues parameters; ///< \ru Параметры редактирования оболочки. \en Shell editing parameters.
|
||||
SArray<MbItemIndex> faceIndices; ///< \ru Идентификаторы модифицированных граней. \en Identifiers of the modified faces.
|
||||
SArray<MbEdgeFacesIndexes> edgeIndices; ///< \ru Идентификаторы модифицированных рёбер. \en Identifiers of the modified edges.
|
||||
RPArray<MbSurface> surfaces; ///< \ru Массив-указателей на nurbs поверхности граней. \en Array of pointers to NURBS surfaces of the faces.
|
||||
|
||||
public:
|
||||
// \ru Конструктор по параметрам. \en Constructor by parameters.
|
||||
MbFaceModifiedSolid( const ModifyValues & p, const SArray<MbItemIndex> & faces,
|
||||
RPArray<MbSurface> & surfs, const MbSNameMaker & names );
|
||||
// \ru Конструктор по параметрам. \en Constructor by parameters.
|
||||
MbFaceModifiedSolid( const ModifyValues & p, const SArray<MbEdgeFacesIndexes> edges,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
// \ru Конструктор дублирующий. \en Duplicating constructor.
|
||||
MbFaceModifiedSolid( const MbFaceModifiedSolid & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbFaceModifiedSolid( const MbFaceModifiedSolid & init );
|
||||
|
||||
public: // \ru Деструктор \en Destructor
|
||||
~MbFaceModifiedSolid();
|
||||
|
||||
public:
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг по вектору \en Translation by the vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
/// \ru Построение оболочки \en Creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
virtual void Refresh( MbFaceShell & outer ); ///< \ru Обновить форму оболочки \en Update shape of the shell
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( ModifyValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const ModifyValues & params ) { parameters = params; }
|
||||
|
||||
void GetFaceIndices( SArray<MbItemIndex> & faces ) const { faces = faceIndices; } // \ru Идентификаторы модифицированных граней. \en Identifiers of the modified faces.
|
||||
void GetEdgeIndices( SArray<MbEdgeFacesIndexes> & edges ) const { edges = edgeIndices; } // \ru Идентификаторы модифицированных рёбер. \en Identifiers of the modified edges.
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbFaceModifiedSolid & );
|
||||
void SurfacesFree(); // \ru Удалить поверхности \en Delete the surfaces
|
||||
void SurfacesAddRef(); // \ru Учесть поверхности \en Consider the surfaces
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbFaceModifiedSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbFaceModifiedSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить модифицированную оболочку.
|
||||
\en Construct the modified shell. \~
|
||||
\details \ru Построить оболочку тела путём модификации исходной оболочки.
|
||||
В зависимости от параметров возможны следующие модификации исходной оболочки: \n
|
||||
удаление из тела выбранных граней с окружением, \n
|
||||
создание тела из выбранных граней с окружением, \n
|
||||
перемещение выбранных граней с окружением относительно оставшихся граней тела, \n
|
||||
замена выбранных граней тела эквидистантными гранями (перемещение по нормали, изменение радиуса), \n
|
||||
замена выбранных граней тела деформируемыми гранями (превращение в NURBS для редактирования).\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct the solid's shell by modification the source shell.
|
||||
The following modifications of the source shell are possible depend on the parameters: \n
|
||||
deletion the selected faces with neighborhood from the solid, \n
|
||||
creation of the solid from the selected faces with the neighborhood, \n
|
||||
translation of the selected faces with the neighborhood relative to the remained faces of the solid, \n
|
||||
replacement of the selected faces of the solid with the offset faces (translation along the normal, changing the radius), \n
|
||||
replacement of the specified faces of the solid with the deformable faces (conversion to the NURBS for editing).\n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] outer - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the source shell. \~
|
||||
\param[in] parameters - \ru Параметры модификации.
|
||||
\en Parameters of the modification. \~
|
||||
\param[in] faces - \ru Изменяемые грани тела.
|
||||
\en Faces to be modified. \~
|
||||
\param[in] edges - \ru Изменяемые рёроа тела.
|
||||
\en Edges to be modified. \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateFaceModifiedSolid( MbFaceShell * outer,
|
||||
MbeCopyMode sameShell,
|
||||
const ModifyValues & parameters,
|
||||
const RPArray<MbFace> & faces,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_MODIFIED_SOLID_H
|
||||
@@ -0,0 +1,129 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель пространственного сплайна с сопряжениями.
|
||||
\en Constructor of the spatial spline with tangents.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_NURBS3D_H
|
||||
#define __CR_NURBS3D_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <cur_nurbs3d.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель пространственного сплайна.
|
||||
\en Spatial spline constructor. \~
|
||||
\details \ru Строитель пространственного сплайна.\n
|
||||
\en Spatial spline constructor.\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbNurbs3DCreator : public MbCreator {
|
||||
private:
|
||||
SArray<MbCartPoint3D> points; // \ru Точки, через которые проходит сплайн \en Points which the spline passes through
|
||||
SArray<double> weights; // \ru Веса \en Weights
|
||||
SArray<double> knots; // \ru Узлы \en Knots
|
||||
RPArray< MbPntMatingData<MbVector3D> > matingData; // \ru Данные сопряжения в точках \en Data about mating in the points
|
||||
MbeSplineParamType paramType; // \ru Тип параметризации \en Parametrization type
|
||||
size_t degree; // \ru Степень сплайна \en Spline degree
|
||||
bool closed; // \ru Замкнутость сплайна \en Spline closedness
|
||||
bool throughPnts; // \ru через точки \en Through points
|
||||
|
||||
protected:
|
||||
MbNurbs3DCreator( const MbNurbs3DCreator &, MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
MbNurbs3DCreator( const MbNurbs3DCreator & ); // \ru Не реализовано \en Not implemented
|
||||
MbNurbs3DCreator(); // \ru Не реализовано \en Not implemented
|
||||
public:
|
||||
MbNurbs3DCreator( const SArray<MbCartPoint3D> & spacePnts, bool throughPnts,
|
||||
MbeSplineParamType paramType, size_t degree, bool closed,
|
||||
const SArray<double> * weights,
|
||||
const SArray<double> * knots,
|
||||
const RPArray< MbPntMatingData<MbVector3D> > & matingData,
|
||||
const MbSNameMaker & snMaker );
|
||||
public:
|
||||
virtual ~MbNurbs3DCreator();
|
||||
|
||||
// \ru Общие функции строителя. \en The common functions of the creator.
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * iReg = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
// \ru Построить кривую по журналу построения \en Create a curve from the history tree
|
||||
virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
|
||||
void operator = ( const MbNurbs3DCreator & ); // \ru Не реализовано!!! \en Not implemented!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbNurbs3DCreator )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbNurbs3DCreator )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать пространственный сплайн через точки и с сопряжениями.
|
||||
\en Create a spatial spline through points and with the given tangents. \~
|
||||
\details \ru Создать пространственный сплайн через точки и с сопряжениями
|
||||
Если есть сопряжения, то количество сопряжений д.б. равно количеству точек.
|
||||
Отсутствующие сопряжения должны быть представлены нулевыми указателями в массиве.
|
||||
\en Create a spatial spline through points with tangents
|
||||
If the tangents are specified, then the number of tangents should be equal to the number of points.
|
||||
The missing tangents should be represented as the null pointers in the array. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbCreator *) CreateSplineThrough( const SArray<MbCartPoint3D> & points, // \ru Точки \en Points
|
||||
MbeSplineParamType paramType, // \ru Тип параметризации \en Parametrization type
|
||||
size_t degree, // \ru Порядок сплайна \en Spline degree
|
||||
bool closed, // \ru Замкнуть \en Make close
|
||||
RPArray< MbPntMatingData<MbVector3D> > & transitions, // \ru Сопряжения \en Tangents
|
||||
const MbSNameMaker & snMaker, // \ru Именователь \en An object for naming the new objects
|
||||
MbResultType & resType,
|
||||
MbCurve3D *& resCurve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать пространственный сплайн по точкам и сопряжениями.
|
||||
\en Create a spatial spline from points and tangents. \~
|
||||
\details \ru Создать пространственный сплайн по точкам и сопряжениями.\n
|
||||
\en Create a spatial spline from points and tangents.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbCreator *) CreateSplineBy( const SArray<MbCartPoint3D> & points, // \ru Точки \en Points
|
||||
size_t degree, // \ru Порядок сплайна \en Spline degree
|
||||
bool closed, // \ru Замкнуть \en Make close
|
||||
const SArray<double> * weights, // \ru Веса \en Weights
|
||||
const SArray<double> * knots, // \ru Узлы \en Knots
|
||||
MbPntMatingData<MbVector3D> * begData, // \ru Сопряжение в начале \en Tangent at the start point
|
||||
MbPntMatingData<MbVector3D> * endData, // \ru Сопряжение в конце \en Tangent at the end point
|
||||
const MbSNameMaker & snMaker, // \ru Именователь \en An object for naming the new objects
|
||||
MbResultType & resType,
|
||||
MbCurve3D *& resCurve );
|
||||
|
||||
|
||||
#endif // __CR_NURBS3D_H
|
||||
@@ -0,0 +1,111 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель блока из nurbs-поверхностей.
|
||||
\en Constructor of a block from NURBS-surfaces.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_NURBS_BLOCK_SOLID_H
|
||||
#define __CR_NURBS_BLOCK_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки в форме блока.
|
||||
\en Constructor of a shell in the form of block. \~
|
||||
\details \ru Строитель оболочки в форме блока, имеющего шесть четырёхугольных граней на базе Nurbs-поверхностей. \n
|
||||
\en Constructor of a shell in the form of a block with six quadrangular faces on the base of NURBS-surfaces. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbNurbsBlockSolid : public MbCreator {
|
||||
protected:
|
||||
RPArray<MbSurface> surfaces; ///< \ru Множество поверхностей граней nurbs-блока. \en A set of surfaces of NURBS-block faces.
|
||||
bool out; ///< \ru Направление нормалей граней (out = true - нормали направлены наружу блока). \en The faces normals direction (out = true - normals are directed outside the block).
|
||||
SimpleName name; ///< \ru Имя объекта. \en A name of an object.
|
||||
|
||||
public: // \ru Конструктор по параметрам \en Constructor by parameters
|
||||
MbNurbsBlockSolid( RPArray<MbSurface> & surf, bool bOutDir, const MbSNameMaker & names, SimpleName name );
|
||||
private: // \ru Конструктор дублирующий \en Duplication constructor
|
||||
MbNurbsBlockSolid( const MbNurbsBlockSolid &, MbRegDuplicate *ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbNurbsBlockSolid( const MbNurbsBlockSolid & );
|
||||
public: // \ru Деструктор \en Destructor
|
||||
virtual ~MbNurbsBlockSolid();
|
||||
|
||||
public: // \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
virtual bool IsSame( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг по вектору \en Translation by a vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & s ); // \ru Дать базовые объекты \en Get the base objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
public:
|
||||
/// \ru Построение оболочки \en Creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
virtual void Refresh( MbFaceShell & outer ); ///< \ru Обновить форму оболочки \en Update shape of the shell
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbNurbsBlockSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbNurbsBlockSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbNurbsBlockSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить модифицированную оболочку.
|
||||
\en Construct the modified shell. \~
|
||||
\details \ru Построить оболочку в форме блока, имеющего шесть четырёхугольных граней на базе Nurbs-поверхностей.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Create a shell in the form of a block with six quadrangular faces on the base of NURBS-surfaces.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] place - \ru Локальная система координат, вдоль осей которой будут стороиться ребра оболочки.
|
||||
\en The local coordinate system along axes of which the shell's edges will be constructed. \~
|
||||
\param[in] ax - \ru Размер блока вдоль первой оси локальной системы координат.
|
||||
\en The block size along the first axis of the local coordinate system. \~
|
||||
\param[in] ay - \ru Размер блока вдоль второй оси локальной системы координат.
|
||||
\en The block size along the second axis of the local coordinate system. \~
|
||||
\param[in] az - \ru Размер блока вдоль третьей оси локальной системы координат.
|
||||
\en The block size along the third axis of the local coordinate system. \~
|
||||
\param[in] out - \ru Направление нормалей граней (out = true - нормали наравлены наружу блока).
|
||||
\en The faces normals direction (out = true - the normals are directed outside the block). \~
|
||||
\param[in] names - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] name - \ru Имя объекта.
|
||||
\en A name of an object. \~
|
||||
\param[out] parameters - \ru Параметры построения оболочки.
|
||||
\en The shell construction parameters. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateNurbsBlock( const MbPlacement3D & place,
|
||||
double ax, double ay, double az,
|
||||
bool out,
|
||||
const MbSNameMaker & names,
|
||||
SimpleName name,
|
||||
NurbsBlockValues & parameters,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_NURBS_BLOCK_SOLID_H
|
||||
@@ -0,0 +1,73 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Создание оболочки из нурбс-поверхностей
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __NURBS_SURFACES_SHELL_H
|
||||
#define __NURBS_SURFACES_SHELL_H
|
||||
|
||||
#include <templ_rp_array.h>
|
||||
#include <math_define.h>
|
||||
#include <mb_operation_result.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCreator;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbFaceShell;
|
||||
struct NurbsSurfaceValues;
|
||||
class IProgressIndicator;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку из NURBS-поверхностей.
|
||||
\en Construct a shell from NURBS-surfaces. \~
|
||||
\details \ru Построить оболочку из NURBS-поверхностей MbSplineSurface по заданному множеству точек условно расположенных в узлах четырехугольной сетки. \n
|
||||
\en Construct a shell from NURBS-surfaces MbSplineSurface by a given set of points conventionally located at the nodes of a quadrangle grid. \n \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] operNames - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\param[out] indicator - \ru Индикатор хода построения позволяющий прервать построение.
|
||||
\en Construction process indicator which allow to interrupt the construction. \~
|
||||
\result \ru Возвращает оболочку.
|
||||
\en Returns the constructуed shell. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbFaceShell *) CreateNurbsSurfacesShell( NurbsSurfaceValues & params,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbResultType & res,
|
||||
IProgressIndicator * = NULL );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// проверить оболочку из нурбс-поверхностей
|
||||
/** \brief \ru Построить оболочку из NURBS-поверхностей.
|
||||
\en Construct a shell from NURBS-surfaces. \~
|
||||
\details \ru Построить оболочку из NURBS-поверхностей MbSplineSurface по заданному множеству точек условно расположенных в узлах четырехугольной сетки. \n
|
||||
\en Construct a shell from NURBS-surfaces MbSplineSurface by a given set of points conventionally located at the nodes of a quadrangle grid. \n \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] shell - \ru Оболочка, построенная по заданным параметрам.
|
||||
\en The shell constructed by given parameters. \~
|
||||
\param[out] indicator - \ru Индикатор хода построения позволяющий прервать построение.
|
||||
\en Construction process indicator which allow to interrupt the construction. \~
|
||||
\result \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CheckNurbsSurfacesShell( const NurbsSurfaceValues & params,
|
||||
const MbFaceShell & shell,
|
||||
IProgressIndicator * = NULL );
|
||||
|
||||
|
||||
#endif // __NURBS_SURFACES_SHELL_H
|
||||
@@ -0,0 +1,116 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки из NURBS-поверхностей.
|
||||
\en Construction of a sell from NURBS-surfaces. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_NURBS_SURFACES_SOLID_H
|
||||
#define __CR_NURBS_SURFACES_SOLID_H
|
||||
|
||||
|
||||
#include <math_define.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCreator;
|
||||
class MATH_CLASS MbSNameMaker;
|
||||
class MATH_CLASS MbFaceShell;
|
||||
struct MATH_CLASS NurbsSurfaceValues;
|
||||
class IProgressIndicator;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из NURBS-поверхностей.
|
||||
\en Constructor of a shell from NURBS-surfaces. \~
|
||||
\details \ru Строитель оболочки из NURBS-поверхностей MbSplineSurface.
|
||||
Аббревиатура NURBS получена из первых букв словосочетания Non-Uniform Rational B-Spline.
|
||||
\en Constructor of a shell from NURBS-surfaces MbSplineSurface.
|
||||
Abbreviation of NURBS is obtained from the first letters of "Non-Uniform Rational B-Spline" phrase. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbNurbsSurfacesSolid : public MbCreator {
|
||||
protected:
|
||||
NurbsSurfaceValues parameters; ///< \ru Параметры построения. \en Construction parameters.
|
||||
mutable bool changed; ///< \ru Флаг изменения параметров. \en Flag of parameters modification.
|
||||
|
||||
public:
|
||||
// \ru конструктор, копирующий параметры \en constructor copying the parameters
|
||||
MbNurbsSurfacesSolid( const NurbsSurfaceValues & params, const MbSNameMaker & names );
|
||||
private:
|
||||
MbNurbsSurfacesSolid( const MbNurbsSurfacesSolid &, MbRegDuplicate * ireg );
|
||||
public:
|
||||
// \ru деструктор \en destructor
|
||||
~MbNurbsSurfacesSolid();
|
||||
|
||||
public: // \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru сделать копию \en create a copy
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru сделать равным \en make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru сдвиг по вектору \en translation by a vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru выдать заголовок свойства объекта \en get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru выдать свойства объекта \en get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru записать свойства объекта \en set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & s ); // \ru дать базовые объекты \en get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
public:
|
||||
/// \ru построение оболочки \en creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
virtual void Refresh( MbFaceShell & outer ); ///< \ru обновить форму оболочки \en update shape of the shell
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( NurbsSurfaceValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const NurbsSurfaceValues & params ) { parameters = params; }
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbNurbsSurfacesSolid )
|
||||
OBVIOUS_PRIVATE_COPY( MbNurbsSurfacesSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbNurbsSurfacesSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку из NURBS-поверхностей.
|
||||
\en Construct a shell from NURBS-surfaces. \~
|
||||
\details \ru Построить оболочку из NURBS-поверхностей MbSplineSurface.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell from NURBS-surfaces MbSplineSurface.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of a shell creation. \~
|
||||
\param[in] operNames - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\param[out] indicator - \ru Индикатор хода построения.
|
||||
\en Construction process indicator. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateNurbsShell( NurbsSurfaceValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell,
|
||||
IProgressIndicator * indicator = NULL );
|
||||
|
||||
|
||||
#endif // __CR_NURBS_SURFACES_SOLID_H
|
||||
@@ -0,0 +1,167 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель эквидистантной кривой.
|
||||
\en Offset curve constructor.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_OFFSET_CURVE_H
|
||||
#define __CR_OFFSET_CURVE_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <templ_sptr.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve3D;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель эквидистантной кривой.
|
||||
\en Offset curve constructor. \~
|
||||
\details \ru Строитель эквидистантной кривой.\n
|
||||
\en Offset curve constructor.\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbOffsetCurveCreator : public MbCreator {
|
||||
private:
|
||||
// \ru Основные параметры \en The basic parameters
|
||||
SPtr<MbCurve3D> curve; // \ru Исходная кривая. \en The initial curve.
|
||||
MbVector3D dir; // \ru Направление смещения. \en The offset direction.
|
||||
double dist; // \ru Величина смещения. \en The offset distance.
|
||||
bool fromBeg; // \ru Вектор смещения привязан к началу кривой (иначе к концу). \en The translation vector is associated with the beginning (with the end otherwise).
|
||||
|
||||
// \ru Дополнительные параметры (эквидистанта в пространстве) \en Auxiliary parameters (spatial offset)
|
||||
bool useFillet; // \ru Заполнять ли разрывы скруглениями (иначе продлять сегменты). \en Whether to fill the gaps with fillets (extend segments otherwise).
|
||||
bool keepRadius; // \ru Сохранять ли радиусы в скруглениях. \en Whether to keep the radii at fillets.
|
||||
bool bluntAngle; // \ru Притуплять острые углы стыков сегментов \en Whether to blunt the sharp edges of segments joints.
|
||||
|
||||
// \ru Дополнительные параметры (эквидистанта на поверхности грани оболочки) \en Auxiliary parameters (offset on the shell face surface)
|
||||
c3d::CreatorsSPtrVector shellCreators; // \ru Журнал построения оболочки. \en The shell history tree.
|
||||
|
||||
protected:
|
||||
MbOffsetCurveCreator( const MbOffsetCurveCreator &, MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
MbOffsetCurveCreator( const MbOffsetCurveCreator & ); // \ru Не реализовано \en Not implemented
|
||||
MbOffsetCurveCreator(); // \ru Не реализовано \en Not implemented
|
||||
public:
|
||||
// \ru Конструктор эквидистанты в пространстве \en Constructor of offset in the space
|
||||
MbOffsetCurveCreator( const MbCurve3D &, bool fromBeg, const MbVector3D & dir, double dist,
|
||||
bool useFillet, bool keepRadius, bool bluntAngle,
|
||||
const MbSNameMaker & snMaker );
|
||||
// \ru Конструктор эквидистанты на поверхности грани оболочки \en Constructor of offset on the shell face surface
|
||||
MbOffsetCurveCreator( const MbCurve3D &, bool fromBeg, const MbVector3D & dir, double dist,
|
||||
const RPArray<MbCreator> & shellCreators, bool sameCreators,
|
||||
const MbSNameMaker & snMaker );
|
||||
public :
|
||||
virtual ~MbOffsetCurveCreator();
|
||||
|
||||
// \ru Общие функции строителя. \en The common functions of the creator.
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * iReg = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
virtual size_t GetCreatorsCount( MbeCreatorType ct ) const; // \ru Посчитать внутренние построители по типу. \en Count internal creators by type.
|
||||
virtual bool GetInternalCreators( MbeCreatorType, c3d::ConstCreatorsSPtrVector & ) const; // \ru Получить внутренние построители по типу. \en Get internal creators by type.
|
||||
virtual bool SetInternalCreators( MbeCreatorType, c3d::CreatorsSPtrVector & ); // \ru Получить внутренние построители по типу. \en Get internal creators by type.
|
||||
|
||||
// \ru Построить кривую по журналу построения \en Create a curve from the history tree
|
||||
virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
|
||||
void operator = ( const MbOffsetCurveCreator & ); // \ru Не реализовано!!! \en Not implemented!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbOffsetCurveCreator )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbOffsetCurveCreator )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать офсетную кривую по трехмерной кривой и вектору направления.
|
||||
\en Create an offset curve from three-dimensional curve and direction. \~
|
||||
\details \ru Создать офсетную кривую по трехмерной кривой и вектору направления. \n
|
||||
\en Create an offset curve from three-dimensional curve and direction. \n \~
|
||||
\param[in] initCurve - \ru Постранственная кривая, к которой строится эквидистантная.
|
||||
\en A space curve for which to construct the offset curve. \~
|
||||
\param[in] offsetVect - \ru Вектор, задающий смещение в точке кривой.
|
||||
\en The displacement vector at a point of the curve. \~
|
||||
\param[in] useFillet - \ru Если true, то разрывы заполнять скруглением, иначе продолженными кривыми.
|
||||
\en If 'true', the gaps are to be filled with fillet, otherwise with the extended curves. \~
|
||||
\param[in] keepRadius - \ru Если true, то в существующих скруглениях сохранять радиусы.
|
||||
\en If 'true', the existent fillet radii are to be kept. \~
|
||||
\param[in] fromBeg - \ru Вектор смещения привязан к началу.
|
||||
\en The translation vector is associated with the beginning. \~
|
||||
\param[in] snMaker - \ru Именователь кривых каркаса.
|
||||
\en An object defining the frame curves names. \~
|
||||
\param[out] resType - \ru Код результата операции
|
||||
\en Operation result code \~
|
||||
\param[out] resCurve - \ru Эквидистантная кривая.
|
||||
\en The offset curve. \~
|
||||
\return \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbCreator *) CreateOffsetCurve( const MbCurve3D & initCurve,
|
||||
const MbVector3D & offsetVect,
|
||||
const bool useFillet,
|
||||
const bool keepRadius,
|
||||
const bool bluntAngle,
|
||||
const bool fromBeg,
|
||||
const MbSNameMaker & snMaker,
|
||||
MbResultType & resType,
|
||||
MbCurve3D *& resCurve );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать офсетную кривую по поверхностной кривой и значению смещения.
|
||||
\en Create an offset curve from a spatial curve and offset value. \~
|
||||
\details \ru Создать офсетную кривую по поверхностной кривой и значению смещения. \n
|
||||
\en Create an offset curve from a spatial curve and offset value. \n \~
|
||||
\param[in] curve - \ru Кривая на поверхности грани face.
|
||||
\en A curve on face 'face' surface. \~
|
||||
\param[in] face - \ru Грань, на которой строится эквидистанта.
|
||||
\en The edge on which to build the offset curve. \~
|
||||
\param[in] dirAxis - \ru Направление смещения с точкой приложения.
|
||||
\en The offset direction with a point of application. \~
|
||||
\param[in] dist - \ru Величина смещения.
|
||||
\en The offset distance. \~
|
||||
\param[in] snMaker - \ru Именователь кривых каркаса.
|
||||
\en An object defining the frame curves names. \~
|
||||
\param[out] resType - \ru Код результата операции
|
||||
\en Operation result code \~
|
||||
\param[out] resCurves - \ru Множество эквидистантных кривых.
|
||||
\en Offset curve array. \~
|
||||
\return \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Curve3D_Modeling
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbCreator *) CreateOffsetCurve( const MbCurve3D & curve,
|
||||
const MbFace & face,
|
||||
const MbAxis3D & dirAxis,
|
||||
double dist,
|
||||
const MbSNameMaker & snMaker,
|
||||
MbResultType & resType,
|
||||
RPArray<MbCurve3D> & resCurves );
|
||||
|
||||
|
||||
#endif // __CR_OFFSET_CURVE_H
|
||||
@@ -0,0 +1,170 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки в форме заплатки.
|
||||
\en Construction of a patch-shaped shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_PATCH_CREATOR_H
|
||||
#define __CR_PATCH_CREATOR_H
|
||||
|
||||
|
||||
#include <templ_rp_array.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbCurve3D;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
class MATH_CLASS MbFaceShell;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки в форме заплатки.
|
||||
\en Constructor of a patch-shaped shell. \~
|
||||
\details \ru Строитель оболочки в форме заплатки на заданных ребрах или кривых. \n
|
||||
\en Constructor of a patch-shaped shell from the given edges or curves. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbPatchCreator : public MbCreator {
|
||||
protected:
|
||||
RPArray<MbCurve3D> initCurves; ///< \ru Кривые, определяющие края заплатки. \en Curves determining the boundaries of a patch.
|
||||
PatchValues parameters; ///< \ru Параметры построения заплатки. \en Parameters of patch construction.
|
||||
/// \ru Cледующие данные имеются только, если обрабатываются ребра. \en The following data are defined only when edges are being processed.
|
||||
SArray<bool> orientations; ///< \ru Ориентация кривых для замыкания в цепь. \en Orientation of curves for enclosing into a chain.
|
||||
SArray<double> tolerances; ///< \ru Толерантности стыков кривых для замыкания в цепь. \en Tolerances of joints of curves for enclosing into a chain.
|
||||
SArray<ptrdiff_t> surfInds; ///< \ru Номер поверхности кривой пересечения, отвечающей существующей грани. \en Number of surface of the intersection curve corresponding to the existent face.
|
||||
|
||||
private :
|
||||
MbPatchCreator( const MbPatchCreator &, MbRegDuplicate * ireg );
|
||||
|
||||
public :
|
||||
MbPatchCreator( const RPArray<MbCurve3D> & curves,
|
||||
const PatchValues & params,
|
||||
const MbSNameMaker & n,
|
||||
const SArray<ptrdiff_t> * surfInds,
|
||||
const SArray<bool> * orientations,
|
||||
const SArray<double> * tolerances );
|
||||
virtual ~MbPatchCreator();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ;
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL );
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL );
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const;
|
||||
virtual bool SetEqual ( const MbCreator & );
|
||||
|
||||
// \ru Построение оболочки по исходным данным \en Construction of a shell from the given data
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( PatchValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const PatchValues & params ) { parameters = params; }
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbPatchCreator )
|
||||
OBVIOUS_PRIVATE_COPY( MbPatchCreator )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbPatchCreator )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку в форме заплатки.
|
||||
\en Construct a patch-shaped shell. \~
|
||||
\details \ru Построить оболочку в форме заплатки на заданных кривых.
|
||||
\en Construct a patch-shaped shell from the given curves. \~
|
||||
\param[in] initEdges - \ru Кривые, определяющие края заплатки.
|
||||
\en Curves determining the bounds of the patch. \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\result \ru Возвращает построенную оболочку.
|
||||
\en Returns the constructed shell. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MbFaceShell * CreatePatchShell( const RPArray<MbCurve3D> & initCurves,
|
||||
const PatchValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку в форме заплатки.
|
||||
\en Construct a patch-shaped shell. \~
|
||||
\details \ru Построить оболочку в форме заплатки на заданных ребрах.
|
||||
Одновременно с построением оболочки функция создает её строитель.\n
|
||||
\en Construct a patch-shaped shell from the given edges.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initEdges - \ru Рёбра, определяющие края заплатки.
|
||||
\en Edges determining the bounds of the patch. \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreatePatchSet( const RPArray<MbPatchCurve> & initEdges,
|
||||
const PatchValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку в форме заплатки.
|
||||
\en Construct a patch-shaped shell. \~
|
||||
\details \ru Построить оболочку в форме заплатки на заданных кривых.
|
||||
Одновременно с построением оболочки функция создает её строитель.\n
|
||||
\en Construct a patch-shaped shell from the given curves.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initEdges - \ru Кривые, определяющие края заплатки.
|
||||
\en Curves determining the bounds of the patch. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of shell creation. \~
|
||||
\param[in] operNames - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *)CreatePatchSet( const RPArray<MbCurve3D> & initCurves,
|
||||
const PatchValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_PATCH_CREATOR_H
|
||||
@@ -0,0 +1,86 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель проволочного каркаса из проекционных кривых.
|
||||
\en Projection wireframe constructor.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_PROJECTION_CURVE_H
|
||||
#define __CR_PROJECTION_CURVE_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <wire_frame.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель проволочного каркаса из проекционных кривых.
|
||||
\en Projection wireframe constructor. \~
|
||||
\details \ru Строитель проволочного каркаса из проекционных кривых.\n
|
||||
\en Projection wireframe constructor.\n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbProjCurveCreator : public MbCreator {
|
||||
private:
|
||||
MbWireFrame * wireFrame; // \ru Проецируемый проволочный каркас. \en Wireframe to project.
|
||||
RPArray<MbCreator> shellCreators; // \ru Протокол построения оболочки, на которую выполняется проецирование \en History tree of the shell the projection is performed onto
|
||||
MbVector3D dir; // \ru Вектор направления (если нулевой, то проекция по нормали) \en Direction vector (if zero, the normal projection)
|
||||
bool createExact; // \ru Создавать проекционную кривую при необходимости \en Create the projection curve if necessary
|
||||
bool truncateByBounds; // \ru Усечь границами \en Truncate by bounds
|
||||
|
||||
protected:
|
||||
MbProjCurveCreator( const MbProjCurveCreator &, MbRegDuplicate * iReg ); // \ru Конструктор копирования \en Copy-constructor
|
||||
MbProjCurveCreator( const MbProjCurveCreator & ); // \ru Не реализовано \en Not implemented
|
||||
MbProjCurveCreator(); // \ru Не реализовано \en Not implemented
|
||||
public:
|
||||
MbProjCurveCreator( const MbCurve3D & curve,
|
||||
const RPArray<MbCreator> & shellCreators, bool sameCreators,
|
||||
const MbVector3D * dir, bool exact, bool truncate,
|
||||
const MbSNameMaker & snMaker );
|
||||
|
||||
MbProjCurveCreator( const MbWireFrame &wf, const bool sameWire,
|
||||
const RPArray<MbCreator> & shellCreators, bool sameCreators,
|
||||
const MbVector3D * dir, bool exact, bool truncate,
|
||||
const MbSNameMaker & snMaker );
|
||||
public:
|
||||
virtual ~MbProjCurveCreator();
|
||||
|
||||
// \ru Общие функции строителя. \en The common functions of the creator.
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * iReg = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Дать имя свойства объекта \en Get the object property name
|
||||
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
virtual size_t GetCreatorsCount( MbeCreatorType ct ) const; // \ru Посчитать внутренние построители по типу. \en Count internal creators by type.
|
||||
virtual bool GetInternalCreators( MbeCreatorType, c3d::ConstCreatorsSPtrVector & ) const; // \ru Получить внутренние построители по типу. \en Get internal creators by type.
|
||||
virtual bool SetInternalCreators( MbeCreatorType, c3d::CreatorsSPtrVector & ); // \ru Получить внутренние построители по типу. \en Get internal creators by type.
|
||||
|
||||
// \ru Построить кривую по журналу построения \en Create a curve from the history tree
|
||||
virtual bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * items = NULL );
|
||||
|
||||
/** \} */
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation, to prevent an assignment by default.
|
||||
void operator = ( const MbProjCurveCreator & ); // \ru Не реализовано!!! \en Not implemented!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbProjCurveCreator )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbProjCurveCreator )
|
||||
|
||||
#endif // __CR_PROJECTION_CURVE_H
|
||||
@@ -0,0 +1,161 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки тела вращения.
|
||||
\en Constructor of a revolution shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_REVOLUTION_SOLID_H
|
||||
#define __CR_REVOLUTION_SOLID_H
|
||||
|
||||
|
||||
#include <mb_axis3d.h>
|
||||
#include <cr_swept_solid.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки тела вращения.
|
||||
\en Constructor of a revolution shell. \~
|
||||
\details \ru Строитель оболочки тела путём вращения образующих кривых вокруг заданной оси на заданный угол. \n
|
||||
\en Constructor of a solid's shell by revolution of generating curves around the given axis at the given angle. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbCurveRevolutionSolid : public MbCurveSweptSolid {
|
||||
protected :
|
||||
MbSweptData sweptData; ///< \ru Данные об образующей. \en Generating curve data.
|
||||
MbAxis3D axis; ///< \ru Ось вращения образующих кривых. \en Rotation axis of the generating curves.
|
||||
RevolutionValues parameters; ///< \ru Параметры. \en Parameters.
|
||||
|
||||
public :
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\param[in] sweptData_ - \ru Данные об образующей.
|
||||
\en The generating curve data. \~
|
||||
\param[in] axis_ - \ru Ось вращения.
|
||||
\en Rotation axis. \~
|
||||
\param[in] parameters_ - \ru Параметры вращения.
|
||||
\en The revolution parameters. \~
|
||||
\param[in] oType - \ru Тип булевой операции.
|
||||
\en A Boolean operation type. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contoursNames - \ru Именователь контуров для именования граней.
|
||||
\en An object defining contours' names for faces naming. \~
|
||||
*/
|
||||
MbCurveRevolutionSolid( const MbSweptData & sweptData_,
|
||||
const MbAxis3D & axis_,
|
||||
const RevolutionValues & parameters_,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames );
|
||||
|
||||
private :
|
||||
MbCurveRevolutionSolid( const MbCurveRevolutionSolid & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbCurveRevolutionSolid( const MbCurveRevolutionSolid & init );
|
||||
public :
|
||||
virtual ~MbCurveRevolutionSolid();
|
||||
|
||||
/** \ru \name Общие функции математического объекта.
|
||||
\en \name Common functions of the mathematical object.
|
||||
\{ */
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const ; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform( const MbMatrix3D &matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move( const MbVector3D &to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate( const MbAxis3D &axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & s ); // \ru Дать базовые объекты \en Get the base objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
/** \} */
|
||||
/** \ru \name Общие функции твердого тела (формообразующей операции).
|
||||
\en \name Common functions of the rigid solid (forming operations).
|
||||
\{ */
|
||||
virtual MbFaceShell * InitShell( bool in );
|
||||
virtual void InitBasis( RPArray<MbSpaceItem> & items );
|
||||
virtual bool GetPlacement( MbPlacement3D & p ) const;
|
||||
/** \} */
|
||||
/** \ru \name Функции строителя оболочки тела вращения.
|
||||
\en \name Functions of the revolution solid's shell creator.
|
||||
\{ */
|
||||
const MbSurface * GetSurface() const { return sweptData.GetSurface(); } ///< \ru Поверхность двумерных контуров. \en Surface of two-dimensional contours.
|
||||
const MbAxis3D & GetAxis() const { return axis; } ///< \ru Ось вращения. \en Rotation axis.
|
||||
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( RevolutionValues & p ) const { p = parameters; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const RevolutionValues & p ) { parameters = p; }
|
||||
/** \} */
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbCurveRevolutionSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCurveRevolutionSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCurveRevolutionSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку тела вращения.
|
||||
\en Create a shell of the revolution solid. \~
|
||||
\details \ru Построить оболочку тела путём вращения образующих кривых кривых вокруг заданной оси на заданный угол
|
||||
и выполнить булуву операцию с оболочкой, если последняя задана. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell of a solid by rotating the generating curves around the given axis at the specified angle.
|
||||
and perform the Boolean operation with the shell if it is specified. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] solid - \ru Набор граней, к которым дополняется построение.
|
||||
\en Face set the construction is complemented with respect to. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней.
|
||||
\en The method of copying faces. \~
|
||||
\param[in] sweptData - \ru Данные об образующей.
|
||||
\en The generating curve data. \~
|
||||
\param[in] axis - \ru Ось вращения.
|
||||
\en Rotation axis. \~
|
||||
\param[in, out] params - \ru Параметры выдавливания.
|
||||
Возвращают информацию для построения элементов массива операция до поверхности.
|
||||
\en The extrusion parameters.
|
||||
Returns the information for construction of elements of operation-to-surface array. \~
|
||||
\param[in] oType - \ru Тип операции дополнения построения.
|
||||
\en Type of operation of construction complement. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[in] contoursNames - \ru Именователь контуров.
|
||||
\en An object defining the names of contours. \~
|
||||
\param[out] resType - \ru Код результата операции выдавливания.
|
||||
\en The extrusion operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateCurveRevolution( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbSweptData & sweptData,
|
||||
const MbAxis3D & axis,
|
||||
const RevolutionValues & params,
|
||||
OperationType oType,
|
||||
const MbSNameMaker & operNames,
|
||||
const RPArray<MbSNameMaker> & contoursNames,
|
||||
MbResultType & resType,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_REVOLUTION_SOLID_H
|
||||
@@ -0,0 +1,157 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель тела с ребром жёсткости.
|
||||
\en Constructor of a solid with a rib.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_RIB_SOLID_H
|
||||
#define __CR_RIB_SOLID_H
|
||||
|
||||
|
||||
#include <cur_contour.h>
|
||||
#include <creator.h>
|
||||
#include <op_swept_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель тела с ребром жёсткости.
|
||||
\en Constructor of a solid with a rib. \~
|
||||
\details \ru Строитель тела с ребром жёсткости, форма которого задана плоским контуром.
|
||||
\en Constructor of a solid with a rib whose shape is specified by a planar contour. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbRibSolid : public MbCreator {
|
||||
protected :
|
||||
MbPlacement3D place; ///< \ru Подложка для формообразующей кривой, точки и вектора уклона. \en Placement of the forming curve, point and inclination vector.
|
||||
MbContour * spine; ///< \ru Формообразующая кривая (хребет ребра жёсткости). \en Forming curve (rib's spine).
|
||||
size_t index; ///< \ru Индекс сегмента в контуре, от которого будет установлено направление уклона. \en The segment index in the contour from which the inclination direction will be set.
|
||||
RibValues parameters; ///< \ru Параметры формообразования ребра жёсткости. \en Forming parameters of the rib.
|
||||
|
||||
public :
|
||||
MbRibSolid( const MbPlacement3D & place, const MbContour & contour,
|
||||
size_t index, const RibValues & param, const MbSNameMaker & n );
|
||||
private :
|
||||
MbRibSolid( const MbRibSolid & bres, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbRibSolid( const MbRibSolid & bres );
|
||||
public :
|
||||
virtual ~MbRibSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA () const; // \ru Тип элемента \en A type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
virtual void Transform ( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate around an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *&shell, MbeCopyMode sameShell,
|
||||
RPArray <MbSpaceItem> *items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( RibValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const RibValues & params ) { parameters = params; }
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbRibSolid & ); // \ru НЕЛЬЗЯ!!! \en NOT ALLOWED!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbRibSolid )
|
||||
}; // MbRibSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbRibSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку с ребром жёсткости.
|
||||
\en Create a shell with a rib. \~
|
||||
\details \ru Для указанной оболочки построить оболочку с ребром жёсткости, форма которого задана плоским контуром.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a specified shell create a shell with a rib which shape is given by the planar contour.\n
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Способ копирования граней исходной оболочки.
|
||||
\en Method of copying the source shell faces. \~
|
||||
\param[in] place - \ru Локальная система координат, в плоскости XY которай расположен двумерный контур.
|
||||
\en A local coordinate system the two-dimensional contour is located in XY plane of. \~
|
||||
\param[in] contour - \ru Двумерный контур ребра жесткости расположен в плоскости XY локальной системы координат.
|
||||
\en Two-dimensional contour of a rib located in XY plane of the local coordinate system. \~
|
||||
\param[in] index - \ru Индекс сегмента в контуре, от которого будет установлено направление уклона.
|
||||
\en Index of a segment in the contour at which the inclination direction will be set. \~
|
||||
\param[in] parameters - \ru Правметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateRib( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
size_t index,
|
||||
RibValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать отдельное ребро жёсткости.
|
||||
\en Create a separate rib. \~
|
||||
\details \ru Для указанной оболочки построить оболочку в виде отдельного ребра жёсткости.
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For the specified shell create a shell as a separate rib.
|
||||
The function simultaneously constructs the shell and creates its constructor. \n \~
|
||||
\param[in] solid - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] place - \ru Локальная система координат, в плоскости XY которай расположен двумерный контур.
|
||||
\en A local coordinate system the two-dimensional contour is located in XY plane of. \~
|
||||
\param[in] contour - \ru Двумерный контур ребра жесткости расположен в плоскости XY локальной системы координат.
|
||||
\en Two-dimensional contour of a rib located in XY plane of the local coordinate system. \~
|
||||
\param[in] index - \ru Индекс сегмента в контуре, от которого будет установлено направление уклона.
|
||||
\en Index of a segment in the contour at which the inclination direction will be set. \~
|
||||
\param[in] parameters - \ru Правметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь операции.
|
||||
\en An object defining names generation in the operation. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенный набор граней.
|
||||
\en Constructed set of faces. \~
|
||||
\result \ru Возвращает строитель, если операция была выполнена успешно.
|
||||
\en Returns the constructor if the operation has been successfully performed. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateRibElement( MbFaceShell * solid,
|
||||
const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
size_t index,
|
||||
RibValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_RIB_SOLID_H
|
||||
@@ -0,0 +1,109 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построить линейчатую оболочку.
|
||||
\en Construct a ruled shell. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_RULED_SHELL_H
|
||||
#define __CR_RULED_SHELL_H
|
||||
|
||||
|
||||
#include <math_define.h>
|
||||
#include <mb_operation_result.h>
|
||||
#include <name_item.h>
|
||||
#include <creator.h>
|
||||
#include <op_shell_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbFaceShell;
|
||||
class MATH_CLASS MbCurveEdge;
|
||||
class MATH_CLASS MbOrientedEdge;
|
||||
class MATH_CLASS MbLoop;
|
||||
struct MATH_CLASS RuledSurfaceValues;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель линейчатой оболочки.
|
||||
\en Constructor of a ruled shell. \~
|
||||
\details \ru Строитель линейчатой оболочки по двум кривым. \n
|
||||
\en Constructor of a ruled shell from two curves. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
//---
|
||||
class MATH_CLASS MbRuledShell : public MbCreator {
|
||||
|
||||
private :
|
||||
RuledSurfaceValues parameters; ///< \ru Параметры построения. \en Construction parameters.
|
||||
private:
|
||||
MbRuledShell( const MbRuledShell & obj, MbRegDuplicate * ireg );
|
||||
public:
|
||||
/// \ru Конструктор по параметрам операции и именователю. \en Constructor by operation parameters and name-maker.
|
||||
MbRuledShell( const RuledSurfaceValues & pars, const MbSNameMaker & n );
|
||||
virtual ~MbRuledShell();
|
||||
|
||||
public: // \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
virtual MbeCreatorType IsA() const; ///< \ru Тип элемента \en Element type
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; ///< \ru Сделать копию \en Make a copy
|
||||
virtual bool IsSame( const MbCreator &, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool SetEqual ( const MbCreator & ); ///< \ru Сделать равным \en Make equal
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); ///< \ru Преобразовать по матрице \en Transform according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); ///< \ru Сдвиг по вектору \en Translation by the vector
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); ///< \ru Поворот вокруг оси \en Rotation about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); ///< \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); ///< \ru Записать свойства объекта \en Write properties of the object
|
||||
virtual MbePrompt GetPropertyName(); ///< \ru Выдать заголовок свойства объекта \en Get name of object property
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
public:
|
||||
/// \ru Построение оболочки \en Creation of a shell
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL );
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( RuledSurfaceValues & params ) const;
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const RuledSurfaceValues & params );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbRuledShell )
|
||||
OBVIOUS_PRIVATE_COPY( MbRuledShell )
|
||||
}; // MbRuledShell
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbRuledShell )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить линейчатую оболочку.
|
||||
\en Construct a ruled shell. \~
|
||||
\details \ru Построить линейчатую оболочку по двум кривым.
|
||||
Кривые могут быть составными.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a ruled shell from two curves
|
||||
Curves can be composite.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] operNames - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[in] isPhantom - \ru Режим создания фантома.
|
||||
\en Create in the phantom mode. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateRuledShell( RuledSurfaceValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
bool isPhantom,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_RULED_SHELL_H
|
||||
@@ -0,0 +1,122 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки тела с выполнеными сгибами.
|
||||
\en Construction of a shell from any solid with bends. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_BEND_ANY_SOLID_H
|
||||
#define __CR_SHEET_BEND_ANY_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
#include <surf_plane.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала с выполненым сгибом/разгибом.
|
||||
\en Constructor of a shell from sheet material with bend/unbend. \~
|
||||
\details \ru Строитель оболочки из листового материала с выполненым сгибом/разгибом.
|
||||
Построение сгиба/разгиба на касательную плоскость к указанной грани в указанной
|
||||
точке с индивидуальными для каждого сгиба параметрами. \n
|
||||
\en Constructor of a shell from sheet material with bend/unbend.
|
||||
Construction of a bend/unbend to the tangent plane to the specified face at
|
||||
the given point with parameters individual for each bend. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbBendAnySolid : public MbCreator {
|
||||
MbPlane cutPlane;
|
||||
SArray<MbAnyBend> bends;
|
||||
|
||||
public :
|
||||
MbBendAnySolid( const MbPlane & cutPlane,
|
||||
const SArray<MbAnyBend> & bends,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbBendAnySolid( const MbBendAnySolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbBendAnySolid( const MbBendAnySolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbBendAnySolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbBendAnySolid & operator = ( const MbBendAnySolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBendAnySolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBendAnySolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку с выполнеными сгибами.
|
||||
\en Construct a shell with bends. \~
|
||||
\details \ru Построить оболочку любого тела с выполнеными сгибами.
|
||||
Построение сгиба/разгиба на касательную плоскость к указанной грани в указанной
|
||||
точке с индивидуальными для каждого сгиба параметрами. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell from sheet material with bend/unbend.
|
||||
Construction of a bend/unbend to the tangent plane to the specified face at
|
||||
the given point with parameters individual for each bend. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] bends - \ru Сгибы оболочки.
|
||||
\en Bends of a shell. \~
|
||||
\param[in] fixedFace - \ru Неподвижная грань.
|
||||
\en Fixed face. \~
|
||||
\param[in] fixedPoint - \ru Неподвижная точка.
|
||||
\en Fixed point. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateAnyBend( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbPlane & cutPlane,
|
||||
const SArray<MbAnyBend> & bends,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
|
||||
#endif // __CR_SHEET_BEND_ANY_SOLID_H
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение сгибов по рёбрам оболочки тела из листового материала.
|
||||
\en Construction of bends by edges of a shell of a solid from sheet material. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_BEND_BY_EDGE_SOLID_H
|
||||
#define __CR_SHEET_BEND_BY_EDGE_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель сгибов по рёбрам оболочки тела из листового материала.
|
||||
\en Constructor of bends by edges of a shell of a solid from sheet material. \~
|
||||
\details \ru Строитель сгибов по рёбрам оболочки тела из листового материала. \n
|
||||
От заданных рёбер строятся сгибы с продолжением.
|
||||
В зависимости от параметров операции они могут быть смещены от рёбер внутрь или наружу тела,
|
||||
строиться от всей длины ребра или от его части, иметь уклон на сгибе и/или его продолжении,
|
||||
расширение продолжения с каждой стороны.
|
||||
Сгиб может быть построен с освобождением, а также с подрезкой сгибов,
|
||||
с которыми он стыкуется своими боковыми сторонами.
|
||||
\en Constructor of bends by edges of a shell of a solid from sheet material. \n
|
||||
Bends with extensions are built from the given edges.
|
||||
Depending on parameters of the operation they can be shifted from the edges inside or outside the solid,
|
||||
they can be built from the whole length of the edge or from its part, they can have a slope at the bend and/or its extension,
|
||||
an expansion of the extension from each side.
|
||||
A bend can be constructed with release and also with trimming of the bends
|
||||
it meets with by its side boundaries. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbBendsByEdgesSolid : public MbCreator {
|
||||
SArray<MbEdgeFacesIndexes> edgesIndices; ///< \ru Идентификаторы рёбер, по которым строятся сгибы. \en Identifiers of edges the bends are built by.
|
||||
bool unbended; ///< \ru Флаг построения сгиба в разогнутом виде. \en Flag of construction of a bend in unbent form.
|
||||
MbBendByEdgeValues parameters; ///< \ru Параметры построения. \en Construction parameters.
|
||||
RPArray<MbSMBendNames> bendsParams; ///< \ru Множество параметров для каждого формируемого сгиба. \en Set of parameters for each bend.
|
||||
|
||||
public :
|
||||
MbBendsByEdgesSolid( const SArray<MbEdgeFacesIndexes> & edgesIndices,
|
||||
const bool unbended,
|
||||
const MbBendByEdgeValues & params,
|
||||
const RPArray<MbSMBendNames> & bendsParams,
|
||||
const MbSNameMaker & nameMaker );
|
||||
private:
|
||||
MbBendsByEdgesSolid( const MbBendsByEdgesSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbBendsByEdgesSolid( const MbBendsByEdgesSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbBendsByEdgesSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( MbBendByEdgeValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MbBendByEdgeValues & params ) { parameters = params; }
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbBendsByEdgesSolid & operator = ( const MbBendsByEdgesSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBendsByEdgesSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBendsByEdgesSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить сгибы вдоль рёбер оболочки.
|
||||
\en Construct bends along edges of a shell. \~
|
||||
\details \ru Построить сгибы по рёбрам оболочки тела из листового материала.
|
||||
От заданных рёбер строятся сгибы с продолжением.
|
||||
В зависимости от параметров операции они могут быть смещены от рёбер внутрь или наружу тела,
|
||||
строиться от всей длины ребра или от его части, иметь уклон на сгибе и/или его продолжении,
|
||||
расширение продолжения с каждой стороны.
|
||||
Сгиб может быть построен с освобождением, а также с подрезкой сгибов,
|
||||
с которыми он стыкуется своими боковыми сторонами.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct bends by edges of a shell of a solid from sheet material.
|
||||
Bends with extensions are built from the given edges.
|
||||
Depending on parameters of the operation they can be shifted from the edges inside or outside the solid,
|
||||
they can be built from the whole length of the edge or from its part, they can have a slope at the bend and/or its extension,
|
||||
an expansion of the extension from each side.
|
||||
A bend can be constructed with release and also with trimming of the bends
|
||||
it meets with by its side boundaries.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] edges - \ru Рёбра, по которым строятся сгибы.
|
||||
\en Edges the bends are built along. \~
|
||||
\param[in] unbended - \ru Флаг построения сгиба в разогнутом виде.
|
||||
\en Flag of construction of a bend in unbent form. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of shell creation. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBendsByEdges( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const bool unbended,
|
||||
const MbBendByEdgeValues & parameters,
|
||||
MbSNameMaker & names,
|
||||
RPArray<MbSMBendNames> & resultBends,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_BEND_BY_EDGE_SOLID_H
|
||||
@@ -0,0 +1,131 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки из листового материала, согнутого вдоль отрезка.
|
||||
\en Construction of a shell from sheet material bent along a segment. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_BEND_OVER_SEG_SOLID_H
|
||||
#define __CR_SHEET_BEND_OVER_SEG_SOLID_H
|
||||
|
||||
|
||||
#include <templ_ss_array.h>
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала, согнутой вдоль отрезка.
|
||||
\en Constructor of a shell from sheet material bent along a segment. \~
|
||||
\details \ru Строитель оболочки из листового материала, согнутой слева или справа от отрезка,
|
||||
либо указанных граней, либо, в случае отсутствия таковых, всех подходящих для сгиба граней. \n
|
||||
\en Constructor of a shell from sheet material bent to the left or to the right from a segment
|
||||
or from the specified faces or, if they are absent, from all the faces appropriate for bending. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbBendOverSegSolid : public MbCreator {
|
||||
SArray<MbItemIndex> bendingFacesIndices; ///< \ru Идентификаторы указанных для сгиба граней (сортированы и не повторяются). \en Identifiers of faces given for the bend (sorted and not duplicated).
|
||||
MbCurve3D * curve; ///< \ru Линия по которой гнуть. \en Line along which to bend.
|
||||
bool unbended; ///< \ru Флаг построения сгиба в разогнутом состоянии. \en Flag of construction of a bend in unbent form.
|
||||
MbBendOverSegValues parameters; ///< \ru Параметры операции. \en The operation parameters.
|
||||
|
||||
public :
|
||||
MbBendOverSegSolid( const SArray<MbItemIndex> & bendingFacesIndices,
|
||||
MbCurve3D & curve,
|
||||
const bool unbended,
|
||||
const MbBendOverSegValues & pars,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbBendOverSegSolid( const MbBendOverSegSolid &, MbRegDuplicate *ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbBendOverSegSolid( const MbBendOverSegSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbBendOverSegSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual void GetBasisItems ( RPArray<MbSpaceItem> & ); // \ru Дать базовые объекты \en Get the basis objects
|
||||
virtual void GetBasisPoints( MbControlData3D & ) const; // \ru Выдать контрольные точки объекта. \en Get control points of object.
|
||||
virtual void SetBasisPoints( const MbControlData3D & ); // \ru Изменить объект по контрольным точкам. \en Change the object by control points.
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( MbBendOverSegValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MbBendOverSegValues & params ) { parameters = params; }
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbBendOverSegSolid & operator = ( const MbBendOverSegSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBendOverSegSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBendOverSegSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку из листового материала, согнутую вдоль отрезка.
|
||||
\en Create a shell from sheet material bent along a segment. \~
|
||||
\details \ru Построить оболочку из листового материала, согнутую слева или справа от отрезка,
|
||||
либо указанных граней, либо, в случае отсутствия таковых, всех подходящих для сгиба граней. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell from sheet material bent to the left and to the right from a segment
|
||||
or from the specified faces or, if they are absent, from all the faces appropriate for bending. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] bendingFaces - \ru Грани, которые гнуть.
|
||||
\en Faces to bend. \~
|
||||
\param[in] curve - \ru Кривая, по которой сгибать.
|
||||
\en A curve along which to bend. \~
|
||||
\param[in] unbended - \ru Флаг построения сгиба в разогнутом виде.
|
||||
\en Flag of construction of a bend in unbent form. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of shell creation. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBendOverSegment( MbFaceShell & initialShell,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbFace> & bendingFaces,
|
||||
MbCurve3D & curve,
|
||||
const bool unbended,
|
||||
const MbBendOverSegValues & parameters,
|
||||
MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_BEND_OVER_SEG_SOLID_H
|
||||
@@ -0,0 +1,129 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки из листового материала с выполненым сгибом/разгибом.
|
||||
\en Construction of a shell from sheet material with bend/unbend. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_BEND_UNBEND_SOLID_H
|
||||
#define __CR_SHEET_BEND_UNBEND_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала с выполненым сгибом/разгибом.
|
||||
\en Constructor of a shell from sheet material with bend/unbend. \~
|
||||
\details \ru Строитель оболочки из листового материала с выполненым сгибом/разгибом.
|
||||
Построение сгиба/разгиба на касательную плоскость к указанной грани в указанной
|
||||
точке с индивидуальными для каждого сгиба параметрами. \n
|
||||
\en Constructor of a shell from sheet material with bend/unbend.
|
||||
Construction of a bend/unbend to the tangent plane to the specified face at
|
||||
the given point with parameters individual for each bend. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbBendUnbendSolid : public MbCreator {
|
||||
PArray<MbBendIndices> bendIndices; ///< \ru Идентификаторы сгибаемых/разгибаемых граней и параметры сгибов. \en Identifiers of faces to bend/unbend and parameters of bends.
|
||||
MbItemIndex fixedFaceIndex; ///< \ru Идентификатор грани, на касательную к которой разгибаем. \en Identifier of the face on a tangent to which to unbend.
|
||||
MbCartPoint fixedPoint; ///< \ru Точка в параметрической области фиксированной грани, определяющая касательную плоскость, на которую будет выполняться разгиб. \en A point in parametric domain of a fixed face determining the tangent plane on which to perform the bend.
|
||||
bool bend; ///< \ru Флаг, определяющий тип операции: сгиб или разгиб. \en Flag determining the operation type: bend or unbend
|
||||
|
||||
public :
|
||||
MbBendUnbendSolid( const RPArray<MbBendIndices> & bendInd,
|
||||
const MbItemIndex fixedFaceIndex,
|
||||
const MbCartPoint & fixedPoint,
|
||||
const bool bend,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbBendUnbendSolid( const MbBendUnbendSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbBendUnbendSolid( const MbBendUnbendSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbBendUnbendSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbBendUnbendSolid & operator = ( const MbBendUnbendSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBendUnbendSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBendUnbendSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку с выполненым сгибом/разгибом.
|
||||
\en Construct a shell with bend/unbend. \~
|
||||
\details \ru Построить оболочку из листового материала с выполненым сгибом/разгибом.
|
||||
Построение сгиба/разгиба на касательную плоскость к указанной грани в указанной
|
||||
точке с индивидуальными для каждого сгиба параметрами. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell from sheet material with bend/unbend.
|
||||
Construction of a bend/unbend to the tangent plane to the specified face at
|
||||
the given point with parameters individual for each bend. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] bends - \ru Сгибы оболочки.
|
||||
\en Bends of a shell. \~
|
||||
\param[in] fixedFace - \ru Неподвихная грань.
|
||||
\en Fixed face. \~
|
||||
\param[in] fixedPoint - \ru Неподвихная точка.
|
||||
\en Fixed point. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\param[out] ribContours - \ru Набор контуров содержащих кривые границ ребер жесткости(при их наличии) в разогнутом виде.
|
||||
\en The set of contours, which are containing edges of stamp rib in unfolded state. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBendUnbend( MbFaceShell & initialShell,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbSheetMetalBend> & bends,
|
||||
const MbFace & fixedFace,
|
||||
const MbCartPoint & fixedPoint,
|
||||
bool bend,
|
||||
MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell,
|
||||
RPArray<MbContour3D> * ribContours = NULL );
|
||||
|
||||
|
||||
|
||||
#endif // __CR_SHEET_BEND_UNBEND_SOLID_H
|
||||
@@ -0,0 +1,131 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки из листового материала с замыканием угла.
|
||||
\en Construction of a shell from sheet material with corner enclosure. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_CLOSED_CORNER_SOLID_H
|
||||
#define __CR_SHEET_CLOSED_CORNER_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала с замыканием угла.
|
||||
\en Constructor of a shell from sheet material with corner enclosure. \~
|
||||
\details \ru Строитель оболочки из листового материала с замыканием угла.
|
||||
В зависимости от параметров замыкание продолжений сгибов может быть с перекрытием, встык и плотное,
|
||||
а сами сгибы могут остаться без замыкания или замкнуться по хорде или по кромке.
|
||||
Возможно также построение замыкания с зазором. \n
|
||||
\en Constructor of a shell from sheet material with corner enclosure.
|
||||
Subject to the parameters closure of bends extensions can be overlapping, butted or tight,
|
||||
the bends themselves can remain unclosed or can be closed by a chord or a boundary.
|
||||
Construction of corner closure with a gap is also possible. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbClosedCornerSolid : public MbCreator {
|
||||
MbEdgeFacesIndexes edgeIndexPlus; ///< \ru Идентификатор ребра сгиба, условно принятого за положительное. \en Identifier of an edge of the bend considered to be positive.
|
||||
MbEdgeFacesIndexes edgeIndexMinus; ///< \ru Идентификатор ребра сгиба, условно принятого за отрицательное. \en Identifier of an edge of the bend considered to be negative.
|
||||
MbClosedCornerValues parameters; ///< \ru Параметры замыкания угла. \en Parameters of a corner closure.
|
||||
|
||||
public :
|
||||
MbClosedCornerSolid( const MbEdgeFacesIndexes edgeIndexPlus,
|
||||
const MbEdgeFacesIndexes edgeIndexMinus,
|
||||
const MbClosedCornerValues & params,
|
||||
const MbSNameMaker & nameMaker );
|
||||
private:
|
||||
MbClosedCornerSolid( const MbClosedCornerSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbClosedCornerSolid( const MbClosedCornerSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbClosedCornerSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D &, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D &, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
|
||||
virtual bool CreateShell( MbFaceShell *& shell,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( MbClosedCornerValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MbClosedCornerValues & params ) { parameters = params; }
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbClosedCornerSolid & operator = ( const MbClosedCornerSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbClosedCornerSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbClosedCornerSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку из листового материала с замыканием угла.
|
||||
\en Construct a shell form sheet material with corner closure. \~
|
||||
\details \ru Построить оболочку из листового материала с замыканием угла.
|
||||
В зависимости от параметров замыкание продолжений сгибов может быть с перекрытием, встык и плотное,
|
||||
а сами сгибы могут остаться без замыкания или замкнуться по хорде или по кромке.
|
||||
Возможно также построение замыкания с зазором. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct a shell form sheet material with corner closure.
|
||||
Subject to the parameters closure of bends extensions can be overlapping, butted or tight,
|
||||
the bends themselves can remain unclosed or can be closed by a chord or a boundary.
|
||||
Construction of corner closure with a gap is also possible. \n
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The source shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the source shell. \~
|
||||
\param[in] curveEdgePlus - \ru Ребро сгиба, условно принятого за положительное.
|
||||
\en Edge of the bend considered as positive. \~
|
||||
\param[in] curveEdgeMinus - \ru Ребро сгиба, условно принятого за отрицательное.
|
||||
\en Edge of the bend considered as negative. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of shell creation. \~
|
||||
\param[in] names - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateClosedCorner( MbFaceShell & initialShell,
|
||||
MbeCopyMode sameShell,
|
||||
MbCurveEdge * curveEdgePlus,
|
||||
MbCurveEdge * curveEdgeMinus,
|
||||
const MbClosedCornerValues & parameters,
|
||||
MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_CLOSED_CORNER_SOLID_H
|
||||
@@ -0,0 +1,146 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение комбинированного сгиба.
|
||||
\en A composite bend construction. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_JOINT_BEND_SOLID_H
|
||||
#define __CR_SHEET_JOINT_BEND_SOLID_H
|
||||
|
||||
|
||||
#include <cur_contour.h>
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель комбинированного сгиба.
|
||||
\en Construction of a composite bend. \~
|
||||
\details \ru Строитель сгибов, заданных эскизом, по рёбрам оболочки тела из листового материала. \n
|
||||
По заданному контуру, состоящему из отрезков и дуг, строит листовое тело, формируя сгибы на месте
|
||||
дуг и между отрезками по параметрам, заданным в bendsParams, и присоединяет его к каждому ребру,
|
||||
указанному в edgesIndices.
|
||||
\en Construction of bends specified by a sketch, along edges of solid's shell from sheet material. \n
|
||||
From the given contour consisting of segments and arcs it constructs a sheet solid with forming bends at
|
||||
the arcs and between segments using parameters specified in bendsParams, and attaches it to each edge
|
||||
specified in edgesIndices. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbJointBendSolid : public MbCreator {
|
||||
MbPlacement3D placement; ///< \ru Локальная система координат образующего контура. \en The local coordinate system of the generating contour.
|
||||
MbContour contour; ///< \ru Образующий контур. \en Generating contour.
|
||||
SArray<MbEdgeFacesIndexes> edgesIndices; ///< \ru Идентификаторы направляющих рёбер. \en Identifiers of guide edges.
|
||||
bool unbended; ///< \ru Флаг построения сгибов в разогнутом состоянии. \en Flag of construction of bends in unbent form.
|
||||
MbJointBendValues parameters; ///< \ru Параметры операции. \en The operation parameters.
|
||||
RPArray< RPArray<MbSMBendNames> > bendsParams; ///< \ru Множество параметров для каждого формируемого сгиба. \en Set of parameters for each bend.
|
||||
|
||||
public :
|
||||
MbJointBendSolid( const MbPlacement3D & placement,
|
||||
const MbContour & contour,
|
||||
const SArray<MbEdgeFacesIndexes> & edgesIndices,
|
||||
const bool unbended,
|
||||
const MbJointBendValues & parameters,
|
||||
const RPArray< RPArray<MbSMBendNames> > & bendsParams,
|
||||
const MbSNameMaker & nameMaker );
|
||||
|
||||
private:
|
||||
MbJointBendSolid( const MbJointBendSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbJointBendSolid( const MbJointBendSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbJointBendSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en Type of element
|
||||
virtual MbCreator & Duplicate( MbRegDuplicate * = NULL ) const; // \ru Сделать копию \en Create a copy
|
||||
|
||||
virtual bool IsSame ( const MbCreator & other, double accuracy ) const; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
|
||||
virtual bool IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is similar?
|
||||
virtual bool SetEqual ( const MbCreator & ); // \ru Сделать равным \en Make equal
|
||||
|
||||
virtual void Transform( const MbMatrix3D & matr, MbRegTransform * = NULL ); // \ru Преобразовать элемент согласно матрице \en Transform element according to the matrix
|
||||
virtual void Move ( const MbVector3D & to, MbRegTransform * = NULL ); // \ru Сдвиг \en Translation
|
||||
virtual void Rotate ( const MbAxis3D & axis, double angle, MbRegTransform * = NULL ); // \ru Повернуть вокруг оси \en Rotate about an axis
|
||||
|
||||
virtual void GetProperties( MbProperties & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
virtual MbePrompt GetPropertyName(); // \ru Выдать заголовок свойства объекта \en Get a name of object property
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid solid
|
||||
virtual bool CreateShell( MbFaceShell *& shell,
|
||||
MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
// \ru Дать параметры. \en Get the parameters.
|
||||
void GetParameters( MbJointBendValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MbJointBendValues & params ) { parameters = params; }
|
||||
|
||||
private:
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbJointBendSolid & operator = ( const MbJointBendSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbJointBendSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbJointBendSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить комбинированные сгибы.
|
||||
\en Construct composite bends. \~
|
||||
\details \ru Построить сгибы, заданные эскизом, по рёбрам оболочки тела из листового материала.
|
||||
По заданному контуру, состоящему из отрезков и дуг, строит листовое тело, формируя сгибы на месте
|
||||
дуг и между отрезками по параметрам, заданным в bendsParams, и присоединяет его к каждому ребру,
|
||||
указанному в edgesIndices.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en Construct bends specified by a sketch, along edges of solid's shell from sheet material.
|
||||
From the given contour consisting of segments and arcs it constructs a sheet solid with forming bends at
|
||||
the arcs and between segments using parameters specified in bendsParams, and attaches it to each edge
|
||||
specified in edgesIndices.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] placement - \ru Локальная система координат, в плоскости XY которй расположен контур сгиба.
|
||||
\en A local coordinate system the bend contour is located in XY plane of. \~
|
||||
\param[in] contours - \ru Контур сгиба.
|
||||
\en The bend contour. \~
|
||||
\param[in] edges - \ru Рёбра, по которым строятся сгибы.
|
||||
\en Edges the bends are built along. \~
|
||||
\param[in] unbended - \ru Флаг построения сгиба в разогнутом виде.
|
||||
\en Flag of construction of a bend in unbent form. \~
|
||||
\param[in] parameters - \ru Параметры построения.
|
||||
\en Parameters of shell creation. \~
|
||||
\param[in] nameMaker - \ru Именователь граней.
|
||||
\en An object for naming faces. \~
|
||||
\param[in] resultBends - \ru Имена построенных сгибов.
|
||||
\en Constructed bends names. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Построенная оболочка.
|
||||
\en The resultant shell. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateJointBend( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbPlacement3D & placement,
|
||||
const MbContour & contour,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const bool unbended,
|
||||
const MbJointBendValues & parameters,
|
||||
MbSNameMaker & nameMaker,
|
||||
RPArray< RPArray<MbSMBendNames> > & resultBends,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_JOINT_BEND_SOLID_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user