Extern :
- C3d aggiornamento delle librerie.
This commit is contained in:
+1319
-1276
File diff suppressed because it is too large
Load Diff
+384
-334
@@ -1,334 +1,384 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Функции для анализа нормалей и кривизны поверхностей и кривых.
|
||||
\en Functions for normals and curvature analysis of surfaces and curves. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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,
|
||||
c3d::DoubleVector * bendPoints = NULL,
|
||||
c3d::DoubleVector * maxPoints = NULL,
|
||||
c3d::DoubleVector * minPoints = NULL,
|
||||
c3d::DoublePairsVector * 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 absolute 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
|
||||
|
||||
+457
-396
@@ -1,396 +1,457 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 Режим построения модели BRep.
|
||||
\en BRep creation mode. \~
|
||||
\details \ru Режим построения модели BRep.
|
||||
\en BRep creation mode. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
enum MbeCreateBRepMode
|
||||
{
|
||||
cbm_Strict = 0, ///< \ru Соседние грани пересекаются по общей кривой. \en Adjancent faces have a common edge.
|
||||
cbm_Weak = 1, ///< \ru Все ребра каждой из граней - граничные. \en All edges of each face are a boundary edges.
|
||||
cbm_Default = cbm_Strict ///< \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 Smoothing flag of boundary edges. \~
|
||||
\details \ru Сглаживать краевые ребра результирующей оболочки или строить их кусочно-линейными.
|
||||
\en Smooth boundary edges of the resultant shell or build them piecewise linear. \~
|
||||
*/
|
||||
bool smoothBoundaryEdges;
|
||||
|
||||
/** \brief \ru Предельное значение угла между соседними внешними ребрами сетки в радианах.
|
||||
\en The treshold value of angle between two adjanced external edges of mesh (in radians). \~
|
||||
\details \ru Предельное значение угла между соседними ребрами сетки используется при построении граничных ребер оболочки: граничные ребра оболочки
|
||||
будут разделяться в вершинах, где наименьший угол между соседними внешними ребрами сетки менее данного предельного.
|
||||
\en The treshold value of angle between two adjanced edges of mesh is used for building boundary edges of the shell:
|
||||
boundary edge will be divied at the vertices at which minimum angle between two adjanced edges of mesh is less
|
||||
then a given treshold value. \~
|
||||
*/
|
||||
double bAngle;
|
||||
|
||||
/** \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;
|
||||
|
||||
/** \brief \ru Режим построения модели BRep.
|
||||
\en BRep creation mode. \~
|
||||
*/
|
||||
MbeCreateBRepMode brepCreationMode;
|
||||
|
||||
/// \ru Конструктор по умолчанию. \en Default constructor.
|
||||
explicit MbMeshProcessorValues( bool useRelTol = true,
|
||||
bool smoothBoundary = true,
|
||||
double tol = 0.01,
|
||||
double angle = M_PI_2,
|
||||
MbeSurfReconstructMode reconMode = srm_Default,
|
||||
MbeCreateBRepMode bMode = cbm_Default )
|
||||
: useRelativeTolerance( useRelTol )
|
||||
, smoothBoundaryEdges ( smoothBoundary )
|
||||
, tolerance ( tol )
|
||||
, bAngle ( angle )
|
||||
, surfReconstructMode ( reconMode )
|
||||
, brepCreationMode ( bMode )
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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 Установить режим построения модели BRep.
|
||||
\en Set the BRep creation mode. \~
|
||||
\details \ru Задать степень связности граней в результирующей модели BRep. \n
|
||||
\en Set connectivity type of faces of resultant BRep model. \n \~
|
||||
\param[in] mode - \ru Режим построения модели BRep.
|
||||
\en BRep creation mode.
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual void SetBrepCreationMode( MbeCreateBRepMode 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. \~
|
||||
\param[in] smoothBoundaryEdges - \ru Флаг сглаживания краевых ребер.
|
||||
\en Smoothing flag of boundary edges. \~
|
||||
\param[in] bondThresholdAngle - \ru Предельное значение угла между соседними внешними ребрами сетки в радианах.
|
||||
\en The treshold value of angle between two adjanced external edges of mesh (in radians). \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
virtual MbResultType CreateBRepShell( MbFaceShell *& pShell, bool smoothBoundaryEdges, double bondThresholdAngle ) = 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
|
||||
|
||||
+764
-757
File diff suppressed because it is too large
Load Diff
+1269
-1226
File diff suppressed because it is too large
Load Diff
+472
-472
@@ -1,472 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+318
-279
@@ -1,279 +1,318 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 a parallepiped mesh. \~
|
||||
\details \ru Построить ориентированный параллелепипед в виде полигональной модели.
|
||||
Если матрица 'trans' единичная, то результатом вызова будет кубик
|
||||
единичного объема. В общем случае матрица содержит смещение и ротацию,
|
||||
позиционирующую куб относительно начала координат. Размеры параллелепипеда
|
||||
определяются коэффициентами масштабирования по собственным осям ЛСК
|
||||
параллелепипеда, содержащимися в матрице.
|
||||
\en Construct an oriented box in the mesh representation. If the matrix 'trans'
|
||||
is identity then the result of the call will be an unit cube. In general,
|
||||
the matrix contains a translation and rotation that positions the cube
|
||||
relative to the origin. The sizes of the parallelepiped are specified
|
||||
by the scaling factors of the matrix along the eigen axes of the LCS of
|
||||
the parallelepiped. \~
|
||||
\note \ru У матрицы должна быть ротационная часть ортогональной и не вырожденной.
|
||||
Масштабирующая часть определяет размеры параллелепипеда.
|
||||
\en The rotational componet of the matrix should be nondegenerate and ortogonal.
|
||||
The scaling component specifies the box sizes.
|
||||
\param[in] trans - \ru Матрица, задающая позицию, ориентацию и размеры сторон параллелепипеда.
|
||||
\en The matrix specifying a postion, orientation and sizes of the box sides. \~
|
||||
\param[out] result - \ru Результат построения.
|
||||
\en The resulting mesh. \~
|
||||
\return \ru Возвращает код результата операции.
|
||||
\en Returns operation result code. \~
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateBoxMesh( const MbMatrix3D & trans, SPtr<MbMesh> & result );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить параллелепипед в виде проволочной модели.
|
||||
\en Construct an parallepiped wireframe.
|
||||
\details \ru Функция конструирует проволочный каркас параллелепипеда по тем же правилам, что и #CreateBoxMesh.
|
||||
\en The function makes the wireframe of the oriented box by the same rules as #CreateBoxMesh.
|
||||
\ingroup Polygonal_Objects
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC (MbResultType) CreateBoxWire( const MbMatrix3D & trans, SPtr<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
|
||||
|
||||
+317
-299
@@ -1,299 +1,317 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построение функции изменения указанной координаты кривой.
|
||||
\en Create a function by one of three coordinates of curve. \~
|
||||
\details \ru Для указанной координаты кривой построить склярную функцию её изменения, зависящую от параметра кривой. \n
|
||||
\en A function creation for behavior of selected curve coordinate with curve parameter. \n
|
||||
\param[in] curve - \ru Кривая.
|
||||
\en The curve. \~
|
||||
\param[in] coordinate - \ru Номер координаты пространства.
|
||||
\en The number of curve coordinate. \~
|
||||
\return \ru Возвращает построенную функцию.
|
||||
\en Returns the created function. \~
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbFunction *) CreateFunction( const MbCurve3D & curve,
|
||||
size_t coordinate );
|
||||
|
||||
|
||||
#endif // __ACTION_PHANTOM_H
|
||||
|
||||
+852
-820
File diff suppressed because it is too large
Load Diff
+69
-25
@@ -876,7 +876,7 @@ MATH_FUNC (MbResultType) CloseCorner( MbSolid & solid,
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Подрезка массива тела solidArray контурами плоских листовых граней тела sheetSolid.
|
||||
\en Cutting the solidArray with contours of plane sheet faces of sheetSolid. \~
|
||||
\details \ru Для подрезания используются только грани, компланарые хотя бы одной ЛСК из массива placements.
|
||||
\details \ru Для подрезания используются только грани, компланарные хотя бы одной ЛСК из массива placements.
|
||||
Контурные тела граней строятся выдавливанием ограничивающих контуров в обе стороны на величину depth.\n
|
||||
\en For cutting are used only those faces whose placements are complanar to the ones from placements array.
|
||||
The faces contours solids is built by extrusion of bounding contours of the faces in both directions on "depth" value.\n \~
|
||||
@@ -1002,11 +1002,11 @@ MATH_FUNC (MbResultType) Stamp( MbSolid & solid,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Штамповка телом-инструментом (пуансоном или матрицей).
|
||||
\en Stamping by tool solid (punch or die). \~
|
||||
\en Stamping with a tool solid (punch or die). \~
|
||||
\details \ru Штамповка строится на основе произвольного тела-инструмента и заданной плоской листовой грани.
|
||||
Штамповка подрезается границами листовой грани, которую перескает тело.\n
|
||||
\en The stamping is created based on a tool body and a flat sheet face.
|
||||
The stamping is trimmed by the boundary of the sheet face which contains the sketch.\n \~
|
||||
Штамповка подрезается границами листовой грани, которую пересекает тело.\n
|
||||
\en The stamping is created based on a tool body and a flat sheet face.
|
||||
The stamping is trimmed by the boundary of the sheet face which contains the sketch.\n \~
|
||||
\param[in] solid - \ru Исходное листовое тело.
|
||||
\en The source sheet solid. \~
|
||||
\param[in] sameShell - \ru Флаг удаления оболочки исходного тела.
|
||||
@@ -1032,16 +1032,16 @@ MATH_FUNC (MbResultType) Stamp( MbSolid & solid,
|
||||
\ingroup Sheet_Metal_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC( MbResultType ) StampBySolid( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbFace & targetFace,
|
||||
MbSolid & toolSolid,
|
||||
MbeCopyMode sameShellTool,
|
||||
bool punch,
|
||||
const RPArray<MbFace> & openingFaces,
|
||||
const MbUserStampingValues & params,
|
||||
const MbSNameMaker & names,
|
||||
MbSolid *& result );
|
||||
MATH_FUNC( MbResultType ) StampWithToolSolid( MbSolid & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbFace & targetFace,
|
||||
MbSolid & toolSolid,
|
||||
MbeCopyMode sameShellTool,
|
||||
bool punch,
|
||||
const RPArray<MbFace> & pierceFaces,
|
||||
const MbToolStampingValues & params,
|
||||
const MbSNameMaker & nameMaker,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -1892,16 +1892,24 @@ MATH_FUNC (MbResultType) SplitContourIntoSegments( const MbCurve & curve,
|
||||
\en Split a part of a contours (an arc) into segments. \~
|
||||
\details \ru Аппроксимировать участки контуров (дуги) ломаной.\n
|
||||
\en Split a part of a contours (an arc) into segments.\n \~
|
||||
\param[in] contour1 - \ru Первый контур.
|
||||
\en First contour.\~
|
||||
\param[in] breaks1 - \ru Массив параметров разбиения первого контура.
|
||||
\en Parameters of a partition of the first contour. \~
|
||||
\param[in] contour2 - \ru Второй контур.
|
||||
\en Second contour.\~
|
||||
\param[in] breaks2 - \ru Массив параметров разбиения второго контура.
|
||||
\en Parameters of a partition of the second contour. \~
|
||||
\param[in] segmNumber - \ru Количество сегментов аппроксимации.
|
||||
\en Number of segments after splitting.\~
|
||||
\param[in,out] contour1 - \ru Первый контур.
|
||||
\en First contour.\~
|
||||
\param[in,out] breaks1 - \ru Массив параметров разбиения первого контура.
|
||||
\en Parameters of a partition of the first contour. \~
|
||||
\param[in,out] contour2 - \ru Второй контур.
|
||||
\en Second contour.\~
|
||||
\param[in,out] breaks2 - \ru Массив параметров разбиения второго контура.
|
||||
\en Parameters of a partition of the second contour. \~
|
||||
\param[in,out] names - \ru Именователь.
|
||||
\en Name maker.
|
||||
\param[in] segmNumbers1 - \ru Количество сегментов аппроксимации для каждого сегмента обечайки после применения разбиения по breaks1.
|
||||
\en Number of the linear segments for each segment of the lofted bend after splitting by breaks1.
|
||||
\param[in] segmNumbers2 - \ru Количество сегментов аппроксимации для каждого сегмента обечайки после применения разбиения по breaks2.
|
||||
\en Number of the linear segments for each segment of the lofted bend after splitting by breaks2.
|
||||
\param[in] defSegmNumb - \ru Количество сегментов аппроксимации, если не задано в segmNumbers1 и segmNumbers2.
|
||||
\en Number of segments after splitting, if not defined in segmNumbers1 и segmNumbers2.\~
|
||||
\param[in] gapValue - \ru Ширина зазора.
|
||||
\en The gap width.
|
||||
\result \ru - Код результата операции.
|
||||
\en - The operation result code. \~
|
||||
\ingroup Sheet_Metal_Modeling
|
||||
@@ -2347,6 +2355,42 @@ MATH_FUNC (MbResultType) RemoveOperationResult( MbSolid & solid,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Преобразовать тело в листовой металл.
|
||||
\en Construct sheet metal solid based on an arbitary solid. \~
|
||||
\details \ru Операция строит листовое тело на базе произвольного тела.\n
|
||||
\en The operation builds a sheet metal solid based on an arbitrary solid.\n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The source solid. \~
|
||||
\param[in] sameShell - \ru Флаг удаления оболочки исходного тела.
|
||||
\en Whether to delete the shell of the source solid. \~
|
||||
\param[in] initFace - \ru Исходная грань для построения листового тела.
|
||||
\en The initial face for sheet metall solid building. \~
|
||||
\param[in] sense - \ru Направление придания толщины относительно нормали исходной грани.
|
||||
\en Direction of sheet metal building relative to initial face normal. \~
|
||||
\param[in] parameters - \ru Параметры операции.
|
||||
\en Operation parameters. \~
|
||||
\param[in] nameMaker - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующее тело.
|
||||
\en The resultant solid. \~
|
||||
\result \ru - Код результата операции.
|
||||
\en - The operation result code. \~
|
||||
\warning \ru В разработке.
|
||||
\en Under development. \~
|
||||
\ingroup Sheet_Metal_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) ConvertSolidToSheetMetal( MbSolid & solid,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbFace & initFace,
|
||||
bool sence,
|
||||
const MbSolidToSheetMetalValues & parameters,
|
||||
MbSNameMaker & nameMaker,
|
||||
MbSolid *& result );
|
||||
|
||||
|
||||
#endif // __ACTION_SHEET_H
|
||||
|
||||
|
||||
|
||||
+906
-842
File diff suppressed because it is too large
Load Diff
+2237
-2239
File diff suppressed because it is too large
Load Diff
+865
-798
File diff suppressed because it is too large
Load Diff
+1082
-1083
File diff suppressed because it is too large
Load Diff
+7
-70
@@ -287,7 +287,7 @@ inline bool ArFind( const Vector & arParam, double t, ptrdiff_t & id )
|
||||
}
|
||||
|
||||
while ( rangeId > 8 ) { // \ru До тех пор пока диапазон больше восьми \en Until the range contains more than eight elements
|
||||
ptrdiff_t mIndex = ( rangeId / 2 ) + idLeft; // \ru Найти индекс в середине диапазона \en Find the index in the middle of the range
|
||||
size_t mIndex = ( rangeId / 2 ) + idLeft; // \ru Найти индекс в середине диапазона \en Find the index in the middle of the range
|
||||
|
||||
if ( arParam[mIndex] < t ) // \ru Если t больше серединного параметра \en If t is greater than the middle parameter
|
||||
idLeft = mIndex; // \ru Установить левую границу \en Set the left bound
|
||||
@@ -507,71 +507,8 @@ bool IsMonotonic( const TypeVector & items, bool isAscending, bool allowEqual =
|
||||
\ingroup Base_Algorithms
|
||||
*/
|
||||
// ---
|
||||
template<class Point, class Vector>
|
||||
bool ArePointsOnLine( const SArray<Point> & pnts, double metricEps = METRIC_EPSILON )
|
||||
{
|
||||
bool onLine = false;
|
||||
|
||||
size_t cnt = pnts.size();
|
||||
double lenEps = std_min( LENGTH_EPSILON, metricEps );
|
||||
lenEps = std_max( EXTENT_EQUAL, lenEps );
|
||||
|
||||
if ( cnt > 2 ) {
|
||||
const Point & pnt0 = pnts[0];
|
||||
|
||||
Vector tau( pnt0, pnts[1] );
|
||||
double tauLen = tau.Length();
|
||||
if ( tauLen <= lenEps ) {
|
||||
for ( size_t k = 2; k < cnt; k++ ) {
|
||||
const Point & pntk = pnts[k];
|
||||
tau.Init( pnt0, pntk );
|
||||
tauLen = tau.Length();
|
||||
if ( tauLen > lenEps )
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( tauLen > lenEps ) {
|
||||
onLine = true;
|
||||
tau /= tauLen;
|
||||
Vector vect;
|
||||
Point pnt;
|
||||
for ( size_t k = 1; k < cnt; k++ ) {
|
||||
const Point & pntk = pnts[k];
|
||||
vect.Init( pnt0, pntk );
|
||||
vect = tau * (vect * tau);
|
||||
pnt = pnt0 + vect;
|
||||
if ( pntk.DistanceToPoint( pnt ) > metricEps ) {
|
||||
onLine = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( cnt == 2 ) {
|
||||
if ( pnts[0].DistanceToPoint( pnts[1] ) > lenEps )
|
||||
onLine = true;
|
||||
}
|
||||
|
||||
return onLine;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Лежат ли точки на линии.
|
||||
\en Whether points lie on the line. \~
|
||||
\details \ru Лежат ли точки на линии (улучшенный вариант IsPointOnLine). \n
|
||||
\en Whether points lie on the line (improved variant of IsPointOnLine). \n \~
|
||||
\param[in] pnts - \ru Набор точек.
|
||||
\en Point set. \~
|
||||
\param[in] metricEps - \ru Точность проверки.
|
||||
\en Check accuracy. \~
|
||||
\return \ru true, если точки лежат на линии, \n иначе false
|
||||
\en True if points lie on line, \n otherwise false. \~
|
||||
\ingroup Base_Algorithms
|
||||
*/
|
||||
// ---
|
||||
template<class Point, class Vector>
|
||||
bool ArePointsOnLine( const std::vector<Point> & pnts, double metricEps = METRIC_EPSILON )
|
||||
template<class Point, class Vector, class PointsVector>
|
||||
bool ArePointsOnLine( const PointsVector & pnts, double metricEps = METRIC_EPSILON )
|
||||
{
|
||||
bool onLine = false;
|
||||
|
||||
@@ -635,8 +572,8 @@ bool ArePointsOnLine( const std::vector<Point> & pnts, double metricEps = METRIC
|
||||
\ingroup Base_Algorithms
|
||||
*/
|
||||
// ---
|
||||
template <class PointsVector>
|
||||
bool IsPlanar( const PointsVector & pnts, MbPlacement3D * place, double mEps = METRIC_EPSILON )
|
||||
template <class SpacePointsVector>
|
||||
bool IsPlanar( const SpacePointsVector & pnts, MbPlacement3D * place, double mEps = METRIC_EPSILON )
|
||||
{
|
||||
bool isPlanar = false;
|
||||
mEps = ::fabs( mEps );
|
||||
@@ -743,8 +680,8 @@ bool IsPlanar2( const Array2<Point> & pnts, MbPlacement3D * place, double mEps =
|
||||
\en Set the range of parameter. \~
|
||||
\details \ru Установить (репараметризовать) область изменения параметра в массиве. \n
|
||||
\en Set (reparametrize) range of parameter in the array. \n \~
|
||||
\param[in,out] params - \ru Множество параметров, упорядоченный по возрастанию параметра.
|
||||
\en The array of parameters sorted in ascending order. \~
|
||||
\param[in,out] tarr - \ru Множество параметров, упорядоченных по возрастанию параметра.
|
||||
\en The array of parameters sorted in ascending order. \~
|
||||
\param[in] pmin - \ru Минимальное значение параметра.
|
||||
\en Minimal value of parameter. \~
|
||||
\param[in] pmax - \ru Максимальное значение параметра.
|
||||
|
||||
@@ -233,7 +233,7 @@ private:
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CircleTanLineLineRad( MbLine & pl1, MbLine & pl2, double rad, MbTempCircle * pc );
|
||||
MATH_FUNC (ptrdiff_t) CircleTanLineLineRad( const MbLine & pl1, const MbLine & pl2, double rad, MbTempCircle * pc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -280,7 +280,7 @@ MATH_FUNC (ptrdiff_t) CircleTanLineCircleRadius( const MbLine & pl1, const MbArc
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (ptrdiff_t) CircleTanCircleCircleRad( MbArc & pc1, MbArc & pc2, double rad,
|
||||
MATH_FUNC (ptrdiff_t) CircleTanCircleCircleRad( const MbArc & pc1, const MbArc & pc2, double rad,
|
||||
MbTempCircle * pc );
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ MATH_FUNC (ptrdiff_t) CircleTanCircleCircleRad( MbArc & pc1, MbArc & pc2, double
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanCurveCentre( const MbCurve & pCurve, MbCartPoint & pnt,
|
||||
MATH_FUNC (void) CircleTanCurveCentre( const MbCurve & pCurve, const MbCartPoint & pnt,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
@@ -322,9 +322,10 @@ MATH_FUNC (void) CircleTanCurveCentre( const MbCurve & pCurve, MbCartPoint & pnt
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
MbCartPoint & on1, MbCartPoint & on2,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
MATH_FUNC (void) CircleTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
const MbCartPoint & on1,
|
||||
const MbCartPoint & on2,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -345,8 +346,10 @@ MATH_FUNC (void) CircleTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTangentCurveRPointOn( const MbCurve & pCurve, double radius, MbCartPoint & on,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
MATH_FUNC (void) CircleTangentCurveRPointOn( const MbCurve & pCurve,
|
||||
double radius,
|
||||
const MbCartPoint & on,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -367,8 +370,10 @@ MATH_FUNC (void) CircleTangentCurveRPointOn( const MbCurve & pCurve, double radi
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanTwoCurvesRadius( const MbCurve & pCurve1, const MbCurve & pCurve2, double rad,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
MATH_FUNC (void) CircleTanTwoCurvesRadius( const MbCurve & pCurve1,
|
||||
const MbCurve & pCurve2,
|
||||
double rad,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -389,8 +394,10 @@ MATH_FUNC (void) CircleTanTwoCurvesRadius( const MbCurve & pCurve1, const MbCurv
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanTwoCurvesPointOn( const MbCurve & pCurve1, const MbCurve & pCurve2, const MbCartPoint & pOn,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
MATH_FUNC (void) CircleTanTwoCurvesPointOn( const MbCurve & pCurve1,
|
||||
const MbCurve & pCurve2,
|
||||
const MbCartPoint & pOn,
|
||||
PArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -411,8 +418,10 @@ MATH_FUNC (void) CircleTanTwoCurvesPointOn( const MbCurve & pCurve1, const MbCur
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleOriginOneTangentTwo( const MbCurve & pCurve1, const MbCurve & pCurve2, const MbCartPoint & pp,
|
||||
RPArray<MbTempCircle> & pCircle );
|
||||
MATH_FUNC (void) CircleOriginOneTangentTwo( const MbCurve & pCurve1,
|
||||
const MbCurve & pCurve2,
|
||||
const MbCartPoint & pp,
|
||||
RPArray<MbTempCircle> & pCircle );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -441,7 +450,7 @@ MATH_FUNC (void) CircleOriginOneTangentTwo( const MbCurve & pCurve1, const MbCur
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanCurvePointOnAngle( MbCurve & curve, MbCartPoint & p1, double angle,
|
||||
MATH_FUNC (void) CircleTanCurvePointOnAngle( const MbCurve & curve, const MbCartPoint & p1, double angle,
|
||||
PArray<MbTempCircle> & circles );
|
||||
|
||||
|
||||
@@ -463,9 +472,10 @@ MATH_FUNC (void) CircleTanCurvePointOnAngle( MbCurve & curve, MbCartPoint & p1,
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
MbCartPoint & on1, MbCartPoint & on2,
|
||||
PArray<MbArc> & arc );
|
||||
MATH_FUNC (void) ArcTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
const MbCartPoint & on1,
|
||||
const MbCartPoint & on2,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -486,8 +496,10 @@ MATH_FUNC (void) ArcTangentCurveTwoPoints( const MbCurve & pCurve,
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveRPointOn( const MbCurve & pCurve, double radius, MbCartPoint & on,
|
||||
PArray<MbArc> & arc );
|
||||
MATH_FUNC (void) ArcTangentCurveRPointOn( const MbCurve & pCurve,
|
||||
double radius,
|
||||
const MbCartPoint & on,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -506,8 +518,9 @@ MATH_FUNC (void) ArcTangentCurveRPointOn( const MbCurve & pCurve, double radius,
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveContinue( MbLine & line, MbCartPoint & p2,
|
||||
PArray<MbArc> & arc );
|
||||
MATH_FUNC (void) ArcTangentCurveContinue( const MbLine & line,
|
||||
const MbCartPoint & p2,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -530,8 +543,10 @@ MATH_FUNC (void) ArcTangentCurveContinue( MbLine & line, MbCartPoint & p2,
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) ArcTangentCurveRadContinue( MbLine & line, double rad, MbCartPoint & p2,
|
||||
PArray<MbArc> & arc );
|
||||
MATH_FUNC (void) ArcTangentCurveRadContinue( const MbLine & line,
|
||||
double rad,
|
||||
const MbCartPoint & p2,
|
||||
PArray<MbArc> & arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -556,9 +571,11 @@ MATH_FUNC (void) ArcTangentCurveRadContinue( MbLine & line, double rad, MbCartPo
|
||||
\ingroup Curve_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CircleTanThreeCurves( const MbCurve * curve1, const MbCurve * curve2, const MbCurve * curve3,
|
||||
MbCartPoint & pnt,
|
||||
PArray<MbTempCircle> & circle );
|
||||
MATH_FUNC (void) CircleTanThreeCurves( const MbCurve * curve1,
|
||||
const MbCurve * curve2,
|
||||
const MbCurve * curve3,
|
||||
const MbCartPoint & pnt,
|
||||
PArray<MbTempCircle> & circle );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -576,7 +593,7 @@ MATH_FUNC (void) CircleTanThreeCurves( const MbCurve * curve1, const MbCurve * c
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) CreateNewCircles( PArray<MbTempCircle> & cTmp,
|
||||
PArray<MbArc> & pCircle );
|
||||
PArray<MbArc> & pCircle );
|
||||
|
||||
|
||||
#endif // __ALG_CIRCLE_CURVE_H
|
||||
|
||||
@@ -38,9 +38,10 @@
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) DeleteCurvePart( List<MbCurve> & curveList,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
MATH_FUNC (MbeState) DeleteCurvePart( List<MbCurve> & curveList,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve * curve,
|
||||
MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -70,7 +71,8 @@ MATH_FUNC (MbeState) DeleteCurvePart( List<MbCurve> & curveList,
|
||||
MATH_FUNC (MbeState) DeleteCurvePart( const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
const MbCartPoint & p3,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
MbCurve * curve,
|
||||
MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -99,9 +101,10 @@ MATH_FUNC (MbeState) DeleteCurvePart( const MbCartPoint & p1,
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) TrimmCurvePart( List<MbCurve> & curveList,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
MATH_FUNC (MbeState) TrimmCurvePart( List<MbCurve> & curveList,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve * curve,
|
||||
MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -133,13 +136,14 @@ MATH_FUNC (MbeState) TrimmCurvePart( List<MbCurve> & curveList,
|
||||
MATH_FUNC (MbeState) TrimmCurvePart( const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
const MbCartPoint & p3,
|
||||
MbCurve * curve, MbCurve *& part2 );
|
||||
MbCurve * curve,
|
||||
MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Выровнить кривую.
|
||||
/** \brief \ru Выровнять кривую.
|
||||
\en Justify the curve. \~
|
||||
\details \ru Выровнить кривую по отношению к заданной кривой и точке на кривой.\n
|
||||
\details \ru Выровнять кривую по отношению к заданной кривой и точке на кривой.\n
|
||||
Кривая усекается точкой пересечения ее с граничной кривой, ближайшей к заданной
|
||||
точке. Остается часть кривой со стороны указанной точки.
|
||||
\en Justify the curve relative to the given curve and a point on the curve.\n
|
||||
@@ -160,8 +164,10 @@ MATH_FUNC (MbeState) TrimmCurvePart( const MbCartPoint & p1,
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) JustifyCurve( MbCurve * curve, MbCurve * limitCurve,
|
||||
const MbCartPoint & pnt, MbCurve *& part2 );
|
||||
MATH_FUNC (MbeState) JustifyCurve( MbCurve * curve,
|
||||
const MbCurve * limitCurve,
|
||||
const MbCartPoint & pnt,
|
||||
MbCurve *& part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -266,15 +272,16 @@ MATH_FUNC (MbeState) BreakByCurvesArr( MbCurve & curve,
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbeState) BreakCurve( MbCurve & curve,
|
||||
const MbCartPoint & p1, const MbCartPoint & p2,
|
||||
MATH_FUNC (MbeState) BreakCurve( MbCurve & curve,
|
||||
const MbCartPoint & p1,
|
||||
const MbCartPoint & p2,
|
||||
PArray<MbCurve> & part2 );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Разбить кривую..
|
||||
\en Split the curve. \~
|
||||
\details \ru Разбить кривую на ресколько равных частей.
|
||||
\details \ru Разбить кривую на несколько равных частей.
|
||||
\en Split the curve by several equal pieces. \~
|
||||
\param[in, out] curve - \ru Разбиваемая кривая.
|
||||
\en The curve for splitting. \~
|
||||
@@ -294,22 +301,23 @@ MATH_FUNC (MbeState) BreakCurveNParts( MbCurve & curve, ptrdiff_t partsCount, co
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Удлиннить кривую.
|
||||
/** \brief \ru Удлинить кривую.
|
||||
\en Extend the curve. \~
|
||||
\details \ru Удлиннить кривую curve до кривой-границы limitCurve с конца ближайшего к точке pnt
|
||||
\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 Точка, показывающая удлинняемый конец кривой.
|
||||
\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,
|
||||
MATH_FUNC (MbeState) ExtendCurveToCurve( MbCurve * curve,
|
||||
const MbCurve * limitCurve,
|
||||
const MbCartPoint & pnt );
|
||||
|
||||
|
||||
|
||||
@@ -260,15 +260,14 @@ MATH_FUNC (void) CircleCentreOnCurveTwoPoints( const MbCurve & pCurve, const MbC
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Расстояние между объектами.
|
||||
\en Distance between objects. \~
|
||||
\details \ru Расстояние между двумя объектами.\n
|
||||
\en The distance between two objects.\n \~
|
||||
/** \brief \ru Расстояние между кривыми.
|
||||
\en Distance between curves. \~
|
||||
\details \ru Расстояние между двумя кривыми.\n
|
||||
\en The distance between two curves.\n \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbDistance {
|
||||
public :
|
||||
struct MATH_CLASS MbDistance {
|
||||
double u; ///< \ru Параметр на первой кривой. \en Parameter on the first curve.
|
||||
double v; ///< \ru Параметр на второй кривой. \en Parameter on the second curve.
|
||||
double d; ///< \ru Минимальное расстояние. \en Minimal distance.
|
||||
|
||||
@@ -31,17 +31,18 @@
|
||||
\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 Узел - массив точек пересечения кривой в сторону продолжения конутра.
|
||||
\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 );
|
||||
MATH_FUNC (bool) BeginEnvelopeContour( const MbCartPoint & insidePnt,
|
||||
const MbCurve * selectCurve,
|
||||
SArray<MbCrossPoint> & cross,
|
||||
MbContour & contour,
|
||||
SArray<MbCrossPoint> & crossRight );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -58,7 +59,7 @@ MATH_FUNC (bool) BeginEnvelopeContour( MbCartPoint & insidePnt, const MbCurve *
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCurve *) FindNearestCurve( List<MbCurve> & curveList, MbCartPoint & pnt );
|
||||
MATH_FUNC (MbCurve *) FindNearestCurve( List<MbCurve> & curveList, const MbCartPoint & pnt );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -79,9 +80,10 @@ MATH_FUNC (MbCurve *) FindNearestCurve( List<MbCurve> & curveList, MbCartPoint &
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) IntersectWithAll( const MbCurve * selectCurve,
|
||||
LIterator<MbCurve> & fromCurve,
|
||||
SArray<MbCrossPoint> & cross, bool self );
|
||||
MATH_FUNC (void) IntersectWithAll( const MbCurve * selectCurve,
|
||||
LIterator<MbCurve> & fromCurve,
|
||||
SArray<MbCrossPoint> & cross,
|
||||
bool self );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
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
|
||||
0 - on the left by direction,\n
|
||||
1 - on the right by direction,\n
|
||||
2 - on the both sides. \~
|
||||
\param[in] arcMode - \ru Cпособ обхода углов:\n
|
||||
\param[in] arcMode - \ru Способ обхода углов:\n
|
||||
true - дугой,
|
||||
false - срезом.
|
||||
\en The way of traverse of angles:\n
|
||||
@@ -53,9 +53,14 @@
|
||||
\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 );
|
||||
MATH_FUNC (void) Equid( const MbCurve * curve,
|
||||
double radLeft,
|
||||
double radRight,
|
||||
int side,
|
||||
bool arcMode,
|
||||
bool degState,
|
||||
PArray<MbCurve> & equLeft,
|
||||
PArray<MbCurve> & equRight );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -48,12 +48,12 @@ class MATH_CLASS MbContour;
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (bool) Fillet( MbCurve * curve1, const MbCartPoint & pnt1, bool trim1,
|
||||
MbCurve * curve2, const MbCartPoint & pnt2, bool trim2,
|
||||
double rad,
|
||||
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 );
|
||||
MbArc *& arc );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -94,11 +94,13 @@ MATH_FUNC (bool) Fillet( MbCurve * curve1, const MbCartPoint & pnt1, bool trim1,
|
||||
\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,
|
||||
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 );
|
||||
|
||||
|
||||
|
||||
@@ -20,16 +20,18 @@
|
||||
Для штриховки.
|
||||
\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. \~
|
||||
\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. \~
|
||||
\param[in] skipTouchPoints - \ru Пропускать точки касания. true - пропускаем точки касания, false - старое поведение функции.
|
||||
\en Skip touch points. true - skip touch points, false - old function behavior. \~
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) HatchIntersectLine( double y, MbCurve * curve, SArray<MbCartPoint> & crossPnt );
|
||||
MATH_FUNC (void) HatchIntersectLine( double y, const MbCurve * curve, SArray<MbCartPoint> & crossPnt, bool skipTouchPoints = false );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -48,7 +50,7 @@ MATH_FUNC (void) HatchIntersectLine( double y, MbCurve * curve, SArray<MbCartPoi
|
||||
\ingroup Algorithms_2D
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (void) HatchIntersectCircle( MbCurve * circle, MbCurve * curve, SArray<MbCartPoint> & crossPnt );
|
||||
MATH_FUNC (void) HatchIntersectCircle( const MbCurve * circle, const MbCurve * curve, SArray<MbCartPoint> & crossPnt );
|
||||
|
||||
|
||||
#endif // __ALG_CURVE_HATCH_H
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
/** \brief \ru Построить касательные прямые.
|
||||
\en Construct a line. \~
|
||||
\details \ru Построить все возможные прямые через точку касательно данной кривой.\n
|
||||
Базовая точка прямой сопадает с точкой касания.
|
||||
\en Construct a line passing throgh a point and tangent to a given curve.\n
|
||||
Базовая точка прямой совпадает с точкой касания.
|
||||
\en Construct a line passing through 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. \~
|
||||
@@ -26,12 +26,12 @@
|
||||
\en The curve which the constructed line should be tangent to. \~
|
||||
\param[out] pLine - \ru Набор прямых.
|
||||
\en The set of lines. \~
|
||||
\param[in] lineAsCurve - \ru Обрабатывать прямую, ломаную и отрезок как кривую в общеи мслучае.
|
||||
\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,
|
||||
MATH_FUNC (void) LinePointTangentCurve( const MbCartPoint & pnt, const MbCurve & pCurve,
|
||||
PArray<MbLine> & pLine, bool lineAsCurve = false );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ MATH_FUNC (void) LinePointTangentCurve( MbCartPoint & pnt, const MbCurve & pCurv
|
||||
/** \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 Угол к оси абсцисс.
|
||||
@@ -60,7 +60,7 @@ MATH_FUNC (void) LineAngleTangentCurve( double angle, const MbCurve & pCurve,
|
||||
\en Construct lines tangent to circles. \~
|
||||
\details \ru Построить прямые, касательные к двум окружностям,
|
||||
заданным центрами и радиусами.\n
|
||||
Базовая точка прямой сопадает с точкой касания первой окружности.
|
||||
Базовая точка прямой совпадает с точкой касания первой окружности.
|
||||
Функция строит от 0 до 4 прямых.
|
||||
\en Construct lines tangent to two circles.
|
||||
with given centers and radii.\n
|
||||
@@ -94,7 +94,7 @@ MATH_FUNC (ptrdiff_t) LineTan2Circles( const MbCartPoint & centre1, double radiu
|
||||
/** \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 Первая кривая, которой должна касаться построенная прямая.
|
||||
@@ -141,9 +141,9 @@ MATH_FUNC (ptrdiff_t) LineAngleTanCircle( double angle, const MbCartPoint & cent
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Перестывить прямые.
|
||||
/** \brief \ru Переставить прямые.
|
||||
\en Swap lines. \~
|
||||
\details \ru Перестывить прямые местами.
|
||||
\details \ru Переставить прямые местами.
|
||||
\en Swap lines. \~
|
||||
\param[in] l1 - \ru Первая прямая.
|
||||
\en The first line. \~
|
||||
|
||||
+446
-446
@@ -1,446 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
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.
|
||||
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.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#ifndef __ALG_DRAW_H
|
||||
#define __ALG_DRAW_H
|
||||
|
||||
|
||||
#include <templ_s_array.h>
|
||||
#include <templ_sptr.h>
|
||||
#include <math_define.h>
|
||||
@@ -41,6 +40,8 @@
|
||||
#define TRGB_CERISE 255, 0, 125 ///< \ru Светло-вишневый цвет. \en Cerise color. \~ \ingroup Drawing
|
||||
#define TRGB_OLIVE 128, 128, 0 ///< \ru Оливковый цвет. \en Olive color. \~ \ingroup Drawing
|
||||
#define TRGB_SPRINGGREEN 0, 255, 127 ///< \ru Весенне-зеленый цвет. \en Spring green color. \~ \ingroup Drawing
|
||||
#define TRGB_AVIATION 125, 225, 255 ///< \ru Авиационный цвет. \en Aviation color. \~ \ingroup Drawing
|
||||
#define TRGB_GOLD 205, 255, 25 ///< \ru Золотой цвет. \en Gold color. \~ \ingroup Drawing
|
||||
|
||||
#define TRGB_DELETE TRGB_GREEN // \ru цвет удаляемых объектов \en A color of deleted objects
|
||||
#define TRGB_NEW TRGB_RED // \ru цвет вновь создаваемых объектов \en A color of new objects
|
||||
@@ -145,6 +146,11 @@ public:
|
||||
virtual void DrawItem( const MbCurve * curve, const MbSurface * surface, int R, int G, int B, int width = 1 ) = 0;
|
||||
/// \ru Отрисовать карту кривой на поверхности. \en Draw a map of a curve on a surface.
|
||||
virtual void DrawCurveMap( const MbCurve * curve, const MbSurface * surface, int R, int G, int B ) = 0;
|
||||
// \ru Отрисовать карту кривой на поверхности в масштабе, определяемом так, чтобы активная область окна покрывалась заданным прямоугольником rect.
|
||||
// Флаг isotropic отвечает за отрисовку объектов равных масштабах по осям. Если isotropic==false, окружность может отобразиться как эллипс, квадрат как прямоугольник и т.п.
|
||||
// \en Draw a map of a curve on a surface with a specified scale determined as a way of covering an active window by the given rectangle rect.
|
||||
// The flag isotropic is responsible for drawing in equal scales along the axes. If isotropic==false then a circle can be shown as an ellipsis, a square as an rectangle etc.
|
||||
virtual void DrawCurveMap( const MbCurve * curve, const MbSurface * surface, const MbRect & rect, int R, int G, int B, const int boundaryWidth, const int curveWidth, const bool isotropic, const bool showSurfaceBoundaries ) = 0;
|
||||
/// \ru Отрисовать кривую на поверхности. \en Draw a curve on a surface.
|
||||
virtual void DrawSurfaceCurveMap( const MbSurfaceCurve * scurve, int R, int G, int B ) = 0;
|
||||
/// \ru Отрисовать точку на поверхности. \en Draw a point on a surface.
|
||||
@@ -192,7 +198,6 @@ OBVIOUS_PRIVATE_COPY( IfDrawGI )
|
||||
|
||||
#if defined(_DRAWGI)
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Функции отладочной отрисовки объектов приложения.
|
||||
\en Functions of debug drawing of application objects. \~
|
||||
@@ -1001,7 +1006,7 @@ void DrawItem( SPtr<Type> & item, int R, int G, int B ) {
|
||||
template <class PtrArray>
|
||||
void DrawItems( const PtrArray & items, int R, int G, int B )
|
||||
{
|
||||
for ( size_t k = 0, cnt = items.Count(); k < cnt; k++ )
|
||||
for ( size_t k = 0, cnt = items.size(); k < cnt; ++k )
|
||||
DrawGI::DrawItem( items[k], R, G, B );
|
||||
}
|
||||
|
||||
@@ -1022,7 +1027,7 @@ void DrawVertexEdges( const Vertex * vertex, int vR, int vG, int vB,
|
||||
MbMesh edgeMesh;
|
||||
MbStepData stepData( ist_SpaceStep, Math::visualSag );
|
||||
MbFormNote note(true, false);
|
||||
for ( size_t k = 0, cnt = edges.Count(); k < cnt; k++ ) {
|
||||
for ( size_t k = 0, cnt = edges.size(); k < cnt; ++k ) {
|
||||
if ( edges[k] != NULL ) {
|
||||
edges[k]->GetCurve().CalculateMesh( stepData, note, edgeMesh );
|
||||
DrawGI::DrawMesh( &edgeMesh, TRGB_WHITE );
|
||||
|
||||
+165
-165
@@ -1,165 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+102
-96
@@ -1,96 +1,102 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 <mesh_triangle.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 IProgressIndicator;
|
||||
class MATH_CLASS ProgressBarWrapper;
|
||||
struct MATH_CLASS GridsToShellValues;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Удалить дублирующие с заданной точностью друг друга точки.
|
||||
// ---
|
||||
bool RemoveRedundantPoints( c3d::SpacePointsVector & points,
|
||||
c3d::MeshTrianglesVector & triangles,
|
||||
double epsilon,
|
||||
ProgressBarWrapper * baseProgBar );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Удалить дублирующие с заданной точностью друг друга точки.
|
||||
// ---
|
||||
bool RemoveRedundantPoints( std::vector<c3d::SpacePointVector> & pointNormals,
|
||||
c3d::MeshTrianglesVector & triangles,
|
||||
double epsilon,
|
||||
ProgressBarWrapper * baseProgBar );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Удалить дублирующие с заданной точностью друг друга точки.
|
||||
// ---
|
||||
bool RemoveRedundantPoints( c3d::SpacePointsVector & points,
|
||||
c3d::UintVector & indexes,
|
||||
double epsilon );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Объединить ребра двух смежных плоских граней с полигональной границей
|
||||
// (возвращает общее после сшивки ребро)
|
||||
// ---
|
||||
MbCurveEdge * StitchAdjacentGridsEdges( MbFace & face1, MbOrientedEdge & edge1,
|
||||
MbFace & face2, MbLoop & loop2, size_t e2Ind );
|
||||
|
||||
//---------------------------------------------------------s---------------------
|
||||
// Обеспечить связность треугольных граней
|
||||
// ---
|
||||
bool ConnectTriangleFaces( const c3d::FacesSPtrVector & faces,
|
||||
const std::vector<c3d::IndicesPairsPair> & edgesPairs,
|
||||
std::vector<c3d::IndicesPairsPair> * 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
|
||||
|
||||
+377
-377
@@ -1,377 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+397
-392
@@ -1,392 +1,397 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 MbRefItem * owner, const MbItem * subItem ) = 0;
|
||||
virtual void ExamineInstance( const MbInstance * inst, const MbItem * srcItem ) = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Алгоритм общего назначения для обхода дерева модели в глубину.
|
||||
// General-purpose algorithm traversing the model graph in depth.
|
||||
//---
|
||||
MATH_FUNC(void) Traverse( const MbItem *, ItModelVisitor & );
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \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() != c3d::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() == c3d::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
|
||||
|
||||
+100
-100
@@ -1,100 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
#define __ATTR_COLOR_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribut.h>
|
||||
#include <attr_elementary_attribute.h>
|
||||
#include <mb_variables.h>
|
||||
|
||||
|
||||
#define __RGB__ 3
|
||||
const_expr uint __RGB__ = 3;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -44,6 +44,33 @@ inline uint32 RGB2uint32( double r, double g, double b )
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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( float r, float g, float b, float a )
|
||||
{
|
||||
const float f1 = 255.0 / 256.0;
|
||||
uint32 uinturgb[4];
|
||||
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 );
|
||||
uinturgb[3] = uint32 ( 256.0 * a * f1 );
|
||||
for ( int n = 0; n < 4; n++ )
|
||||
if ( uinturgb[n] >= bt ) {
|
||||
uinturgb[n] = bt - 1;
|
||||
//C3D_ASSERT_UNCONDITIONAL( false );
|
||||
}
|
||||
return uinturgb[0] + bt * ( uinturgb[1] + bt * ( uinturgb[2] + bt * uinturgb[3] ) );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Преобразовать unit32 в три компоненты цвета.
|
||||
\en Convert unit32 to 3 components of color. \~
|
||||
@@ -64,6 +91,72 @@ void uint322RGB( uint32 color, float_t& r, float_t& g, float_t& b ) {
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Преобразовать цвет из модели HSV в uint32.
|
||||
\en Convert a color from HSV model in uint32. \~
|
||||
\details \ru Преобразовать цвет из модели HSV в uint32. \n
|
||||
\en Convert a color from HSV model in uint32. \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
// ---
|
||||
inline
|
||||
uint32 HSV2uint32( double h, double s, double v )
|
||||
{
|
||||
double hh, p, q, t, ff;
|
||||
long i;
|
||||
double r, g, b;
|
||||
if ( s <= 0.0 ) {
|
||||
r = v;
|
||||
g = v;
|
||||
b = v;
|
||||
return ::RGB2uint32( r, g, b );
|
||||
}
|
||||
hh = h;
|
||||
if ( hh >= 360.0 )
|
||||
hh = 0.0;
|
||||
hh /= 60.0;
|
||||
i = (long)hh;
|
||||
ff = hh - i;
|
||||
p = v * (1.0 - s);
|
||||
q = v * (1.0 - (s * ff));
|
||||
t = v * (1.0 - (s * (1.0 - ff)));
|
||||
|
||||
switch ( i ) {
|
||||
case 0 : {
|
||||
r = v;
|
||||
g = t;
|
||||
b = p;
|
||||
} break;
|
||||
case 1 : {
|
||||
r = q;
|
||||
g = v;
|
||||
b = p;
|
||||
} break;
|
||||
case 2 : {
|
||||
r = p;
|
||||
g = v;
|
||||
b = t;
|
||||
} break;
|
||||
case 3 : {
|
||||
r = p;
|
||||
g = q;
|
||||
b = v;
|
||||
} break;
|
||||
case 4 : {
|
||||
r = t;
|
||||
g = p;
|
||||
b = v;
|
||||
} break;
|
||||
default : {
|
||||
r = v;
|
||||
g = p;
|
||||
b = q;
|
||||
} break;
|
||||
}
|
||||
return ::RGB2uint32( r, g, b );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Цвет.
|
||||
\en Color. \~
|
||||
@@ -243,7 +336,7 @@ public :
|
||||
|
||||
/// \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 ) {
|
||||
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.
|
||||
|
||||
@@ -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, const bool change );
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
explicit MbCommonAttribute( const 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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = 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
|
||||
+163
-163
@@ -1,163 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты. Плотность.
|
||||
\en Attributes. Density. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_DENCITY_H
|
||||
#define __ATTR_DENCITY_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribute.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 &, MbRegTransform * = NULL );
|
||||
// \ru Действия при перемещении владельца. \en Actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Действия при вращении владельца. \en Actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Действия при копировании владельца. \en Actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = 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,79 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибут отбортовки листового тела.
|
||||
\en Swept flange attribute of a sheet solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_FLANGE_ATTRIBUTE_H
|
||||
#define __ATTR_FLANGE_ATTRIBUTE_H
|
||||
|
||||
|
||||
#include <attr_common_attribute.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Атрибут отбортовки листового тела.
|
||||
\en Swept flange attribute of a sheet solid. \~
|
||||
\details \ru .
|
||||
\en \n \~
|
||||
\ingroup Model_Attributes
|
||||
*/
|
||||
class MATH_CLASS MbSheetFlangingAttribute : public MbCommonAttribute {
|
||||
protected :
|
||||
MbBendByEdgeValues params; ///< \ru Параметры операции. \en The operation parameters.
|
||||
MbSNameMaker names; ///< \ru Именователь операции. \en An object defining names generation in the operation.
|
||||
|
||||
public :
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbSheetFlangingAttribute( const MbBendByEdgeValues & pars, const MbSNameMaker & n, const bool changeable );
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbSheetFlangingAttribute( const MbBendByEdgeValues & pars, const MbSNameMaker & n, const bool changeable, const c3d::string_t & itemPrompt );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
virtual ~MbSheetFlangingAttribute();
|
||||
|
||||
private:
|
||||
// \ru Конструктор копирования. \en Copy constructor.
|
||||
MbSheetFlangingAttribute( const MbSheetFlangingAttribute & init, MbRegDuplicate * iReg );
|
||||
|
||||
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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = NULL );
|
||||
// \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 operation parameters.
|
||||
const MbBendByEdgeValues & GetFlangeValues() const { return params; }
|
||||
/// \ru Дать именователь операции. \en Get an object defining a name of the operation.
|
||||
const MbSNameMaker & GetNameMaker() const { return names; }
|
||||
|
||||
DECLARE_PERSISTENT_CLASS( MbSheetFlangingAttribute )
|
||||
OBVIOUS_PRIVATE_COPY( MbSheetFlangingAttribute )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSheetFlangingAttribute )
|
||||
|
||||
#endif // __ATTR_FLANGE_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_attribute.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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = NULL );
|
||||
// \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
|
||||
+322
-322
@@ -1,322 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Идентификатор объекта.
|
||||
\en Object identifier. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_IDENTIFIER_H
|
||||
#define __ATTR_IDENTIFIER_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribute.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.
|
||||
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( c3d::ConstNamesVector & ) 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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = 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
|
||||
|
||||
+470
-431
@@ -1,432 +1,471 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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_attribute.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 &, MbRegTransform * = NULL );
|
||||
// Действия при перемещении владельца.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// Действия при вращении владельца.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// Действия при копировании владельца.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = 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 full name with prefixes and suffixes. \~
|
||||
*/
|
||||
c3d::string_t NameOneLine() const;
|
||||
|
||||
/**
|
||||
\brief \ru Получить полное название организации. \en Get full name of organization. \~
|
||||
*/
|
||||
c3d::string_t OrganizationOneLine() const;
|
||||
|
||||
/**
|
||||
\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 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 GetOrganizationDetails( c3d::string_t& oOrgId, c3d::string_t& oOrgLabel, c3d::string_t& oOrgDesc ) const;
|
||||
|
||||
|
||||
/**
|
||||
\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 );
|
||||
|
||||
/// \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;
|
||||
|
||||
|
||||
/**
|
||||
\brief \ru Выдать данные лица. \en Swap 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] oMiddles - \ru Список отчеств/средних имен. \en List of middle names. \~
|
||||
\param[in] oPrefixes - \ru Список титулов предшествующих. \en List of prefix titles. \~
|
||||
\param[in] oSuffixed - \ru Список титулов завершающих. \en List of suffix titles. \~
|
||||
*/
|
||||
void GetPersonDetails( c3d::string_t& oPersonId, c3d::string_t& oLast, c3d::string_t& oFirst,
|
||||
std::list<c3d::string_t>& oMiddles,
|
||||
std::list<c3d::string_t>& oPrefixes,
|
||||
std::list<c3d::string_t>& oSuffixed ) const;
|
||||
|
||||
/**
|
||||
\brief \ru Обменять данные лица. \en Swap 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] oMiddles - \ru Список отчеств/средних имен. \en List of middle names. \~
|
||||
\param[in] oPrefixes - \ru Список титулов предшествующих. \en List of prefix titles. \~
|
||||
\param[in] oSuffixed - \ru Список титулов завершающих. \en List of suffix titles. \~
|
||||
*/
|
||||
void SwapPersonDetails( c3d::string_t& oPersonId, c3d::string_t& oLast, c3d::string_t& oFirst,
|
||||
std::list<c3d::string_t>& oMiddles,
|
||||
std::list<c3d::string_t>& oPrefixes,
|
||||
std::list<c3d::string_t>& oSuffixed );
|
||||
|
||||
|
||||
/**
|
||||
\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 >
|
||||
DEPRECATE_DECLARE 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 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 >
|
||||
DEPRECATE_DECLARE 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 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 >
|
||||
DEPRECATE_DECLARE 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 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 >
|
||||
DEPRECATE_DECLARE 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 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. \~
|
||||
*/
|
||||
DEPRECATE_DECLARE void GetOrganizationInfo( std::string& oOrgId, std::string& oOrgLabel, std::string& oOrgDesc ) const;
|
||||
|
||||
|
||||
/**
|
||||
\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. \~
|
||||
*/
|
||||
DEPRECATE_DECLARE 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. \~
|
||||
*/
|
||||
DEPRECATE_DECLARE void SetPersonOrganizationInfo( const std::string& person, const std::string& organization );
|
||||
|
||||
|
||||
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
|
||||
+91
-91
@@ -1,91 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+154
-154
@@ -1,154 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибуты. Селектированность. Видимость. Изменённость.
|
||||
\en Attributes. Selection. Visibility. Modification. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_SELECTED_H
|
||||
#define __ATTR_SELECTED_H
|
||||
|
||||
|
||||
#include <attr_elementary_attribute.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
|
||||
|
||||
@@ -1,93 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Атрибут ребра жесткости листового тела.
|
||||
\en Attribute of reinforsed rib of sheet solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ATTR_STAMPRIB_ATTRIBUTE_H
|
||||
#define __ATTR_STAMPRIB_ATTRIBUTE_H
|
||||
|
||||
|
||||
#include <attr_geometric_attribute.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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = NULL );
|
||||
// \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
|
||||
@@ -1,426 +1,412 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 * DisassembleUserAttrib( const MbExternalAttribute & source ) = 0;
|
||||
|
||||
/// \ru "Собрать" из составляющих атрибутов. \en Reassemble from attributes.
|
||||
virtual bool ReassembleUserAttrib ( const MbFixAttrSet & source, MbExternalAttribute & target ) = 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 * DisassembleUserAttrib( const MbExternalAttribute & source );
|
||||
|
||||
/// \ru "Собрать" из составляющих атрибутов. \en Reassemble from attributes.
|
||||
virtual bool ReassembleUserAttrib( const MbFixAttrSet & source, MbExternalAttribute & target );
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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 *, const MbUserAttribType & );
|
||||
|
||||
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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = 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 );
|
||||
|
||||
/// \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 & ) 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 (copy).
|
||||
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.
|
||||
|
||||
//warning: dependent nested name specifier 'UserAttrDefinition<AttrClass>::' for friend class declaration is not supported; turning off access control for 'MbUserAttribute'
|
||||
//template <typename AttrClass>
|
||||
//friend MbUserAttribute * UserAttrDefinition<AttrClass>::ReduceUserAttrib( const MbExternalAttribute & );
|
||||
|
||||
template <typename AttrClass>
|
||||
friend class UserAttrDefinition;
|
||||
|
||||
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 )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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 & ) = 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 &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при перемещении владельца. \en Perform actions when moving the owner.
|
||||
virtual void OnMoveOwner( const MbAttributeContainer & owner, const MbVector3D &, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при вращении владельца. \en Perform actions when rotating the owner.
|
||||
virtual void OnRotateOwner( const MbAttributeContainer & owner, const MbAxis3D &, double angle, MbRegTransform * = NULL );
|
||||
// \ru Выполнить действия при копировании владельца. \en Perform actions when copying the owner.
|
||||
virtual void OnCopyOwner( const MbAttributeContainer & owner, MbAttributeContainer & other, MbRegDuplicate * = 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.
|
||||
|
||||
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 & );
|
||||
public:
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~MbFixAttrSet() { std::for_each( attributes.begin(), attributes.end(), ReleaseItem<MbAttribute> ); }
|
||||
|
||||
public:
|
||||
/// \ru Выдать идентификатор атрибута. \en Get attribute identifier.
|
||||
const MbUserAttribType & GetUserAttrId() const { return userAttrId; }
|
||||
/// \ru Выдать атрибуты. \en Get attributes.
|
||||
const MbAttribute * GetAttribute( size_t k ) const { return ((k < attributes.size()) ? attributes[k] : NULL); }
|
||||
// \ru Выдать количество атрибутов. \en Get the number of attributes.
|
||||
size_t AttributesCount() const { return attributes.size(); }
|
||||
|
||||
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, public MbSyncItem
|
||||
{
|
||||
private:
|
||||
AttrDefClass * attrDef; ///< \ru "Определение" пользовательского атрибута. \en "Definition" of user attribute.
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
UserAttrDefinitionInstance( const MbUserAttribType & );
|
||||
/// \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>::DisassembleUserAttrib( const MbExternalAttribute & /*source*/ ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/// \ru "Собрать" из составляющих атрибутов. \en Reassemble from attributes.
|
||||
// ---
|
||||
template <typename AttrClass>
|
||||
bool UserAttrDefinition<AttrClass>::ReassembleUserAttrib( const MbFixAttrSet & /*source*/, MbExternalAttribute & /*target*/ ) {
|
||||
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 ) {
|
||||
ScopedLock ll( GetLock() );
|
||||
attrDef = new AttrDefClass();
|
||||
}
|
||||
return attrDef;
|
||||
}
|
||||
|
||||
|
||||
#endif // __ATTR_USER_ATTRIBUT_H
|
||||
+553
-540
File diff suppressed because it is too large
Load Diff
+339
-338
@@ -1,338 +1,339 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 {
|
||||
public:
|
||||
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( bool onDeleteOwner = false );
|
||||
|
||||
/// \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 Изменить цвет объекта (0-255). \en Change color of the object (0-255).
|
||||
void SetColor( int R, int G, int B );
|
||||
/// \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
|
||||
|
||||
+57
-57
@@ -1,57 +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
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
|
||||
+70
-18
@@ -25,8 +25,8 @@ class MbHRepSolid;
|
||||
//----------------------------------------------------------------------------------------
|
||||
/// \ru Объект набора для контроля столкновений. \en Object of the set for collision detection.
|
||||
//---
|
||||
typedef MbHRepSolid * cdet_item;
|
||||
typedef MbResultType cdet_result; ///< \ru Код результата контроля столкновений. \en Result code of collision queries.
|
||||
typedef const MbHRepSolid * cdet_item;
|
||||
typedef MbResultType cdet_result; ///< \ru Код результата контроля столкновений. \en Result code of collision queries.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// \ru Код результата контроля столкновений. \en Codes of collision detection.
|
||||
@@ -45,8 +45,8 @@ 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.
|
||||
const cdet_item CDET_NULL = C3D_NULL_PTR; ///< \ru Пустой объект набора для контроля столкновений. \en Empty object of the collision query set.
|
||||
const cdet_app_item CDET_APP_NULL = C3D_NULL_PTR; ///< \ru "Нулевой" объект модели приложения. \en "Null object" of the client app.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// Base class to implement collision query details
|
||||
@@ -77,8 +77,8 @@ struct cdet_query
|
||||
const MbRefItem * refItem;
|
||||
const MbMatrix3D * wMatrix;
|
||||
geom_element()
|
||||
: appItem( NULL )
|
||||
, refItem( NULL )
|
||||
: appItem( C3D_NULL_PTR )
|
||||
, refItem( C3D_NULL_PTR )
|
||||
, wMatrix( &MbMatrix3D::identity ) {}
|
||||
};
|
||||
|
||||
@@ -117,7 +117,7 @@ struct cdet_query_result: public cdet_query
|
||||
private:
|
||||
static cback_res QueryFunc( cdet_query * query, message code, cback_data & )
|
||||
{
|
||||
C3D_ASSERT( NULL != query );
|
||||
C3D_ASSERT( C3D_NULL_PTR != query );
|
||||
cdet_query_result * q = static_cast<cdet_query_result*>( query );
|
||||
switch( code )
|
||||
{
|
||||
@@ -140,7 +140,6 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// The structure queries first founded collision faces
|
||||
//---
|
||||
@@ -163,7 +162,7 @@ private:
|
||||
{
|
||||
case CDET_QUERY_STARTED: // The collision query is started for all solids of the set
|
||||
{
|
||||
q->first = q->second = NULL;
|
||||
q->first = q->second = C3D_NULL_PTR;
|
||||
return CBACK_VOID;
|
||||
}
|
||||
case CDET_FINISHED: // A pair of solids is finished.
|
||||
@@ -310,6 +309,36 @@ private:
|
||||
OBVIOUS_PRIVATE_COPY( cdet_collided_faces );
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
//---
|
||||
typedef enum
|
||||
{
|
||||
CDET_EXAM_EnableComponentsOnly // Test collisions between components only.
|
||||
, CDET_EXAM_Enabled // Enable the pair to test collisions.
|
||||
, CDET_EXAM_Disabled // Reject the collision test of the pair.
|
||||
} CDET_exam_status;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
//---
|
||||
struct CDET_item_data
|
||||
{
|
||||
cdet_item comp; // Descriptor of the component owning the inctance.
|
||||
cdet_item inst; // Descriptor of the instance.
|
||||
cdet_app_item appItem; // Application pointer for the instance or the component.
|
||||
CDET_item_data()
|
||||
{
|
||||
comp = inst = CDET_NULL;
|
||||
appItem = CDET_APP_NULL;
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
//---
|
||||
typedef CDET_exam_status (*CDET_exam_func)( cdet_query *, const CDET_item_data &, const CDET_item_data & );
|
||||
|
||||
/** \} */ // Collision_Detection
|
||||
|
||||
class TapeBase;
|
||||
@@ -321,23 +350,40 @@ class MbFace;
|
||||
// ---
|
||||
class MbCollisionFace
|
||||
{
|
||||
const MbFace * mathFace;
|
||||
TapeBase * partFace;
|
||||
cdet_item item; // The instance to witch the face belongs.
|
||||
const MbFace * mathFace; // The topological face identified in the collision detection or proximity query.
|
||||
TapeBase * partFace; // The face of the application representation.
|
||||
|
||||
public:
|
||||
MbCollisionFace( const MbFace &_mathFace ) : mathFace( &_mathFace ), partFace( NULL ) {}
|
||||
MbCollisionFace( const MbFace & f )
|
||||
: item( CDET_NULL )
|
||||
, mathFace( &f )
|
||||
, partFace( C3D_NULL_PTR )
|
||||
{}
|
||||
|
||||
const MbFace & GetMathFace() const { return *mathFace; }
|
||||
const MbFace & Face() const { return *mathFace; }
|
||||
cdet_item Item() const { return item; }
|
||||
const MbFace & GetMathFace() const { return *mathFace; }
|
||||
|
||||
// \ru Установка объекта модели. \en Setting an object of model.
|
||||
void SetCollisionFaceObject( TapeBase * _partFace ) { partFace = _partFace; }
|
||||
void SetCollisionFaceObject( TapeBase * _partFace ) { partFace = _partFace; }
|
||||
|
||||
// \ru Выдача объекта модели. \en Getting an object of model.
|
||||
TapeBase * GetCollisionFaceObject() const { return partFace; }
|
||||
|
||||
// \ru Задать грань и компонент-вставку, которой принадлежит. \en Set a face and its component-instance.
|
||||
MbCollisionFace & SetFace( const MbFace * f, cdet_item inst )
|
||||
{
|
||||
mathFace = f;
|
||||
item = inst;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MbCollisionFace & operator = ( const MbCollisionFace & other )
|
||||
{
|
||||
item = other.item;
|
||||
mathFace = other.mathFace;
|
||||
partFace = other.partFace; //CppCheck
|
||||
partFace = other.partFace;
|
||||
return *this;
|
||||
}
|
||||
bool operator > ( const MbCollisionFace & other ) const { return mathFace > other.mathFace; }
|
||||
@@ -359,9 +405,11 @@ class MATH_CLASS MbProximityParameters
|
||||
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.
|
||||
//cdet_item fstItem, sndItem; // \ru Дескрипторы
|
||||
MbCartPoint3D fstPnt, sndPnt; // \ru Пара точек близости, принадлежащие триангуляционным сеткам. \en The points of the proximity belonging to the triangulation grids.
|
||||
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();
|
||||
@@ -379,12 +427,16 @@ public:
|
||||
const MbCollisionFace & FaceTwo() const { return *theFace2; }
|
||||
|
||||
void SetFacePair( const MbFace &, const MbFace & );
|
||||
void SetFacePair( const MbFace *, cdet_item, const MbFace *, cdet_item );
|
||||
|
||||
private:
|
||||
MbProximityParameters( const MbProximityParameters & ); // not implemented
|
||||
MbProximityParameters & operator = ( const MbProximityParameters & ); // not implemented
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __CDET_DATA_H
|
||||
|
||||
// eof
|
||||
|
||||
+68
-20
@@ -10,13 +10,20 @@
|
||||
#define __CDET_UTILITY_H
|
||||
|
||||
#include <cdet_data.h>
|
||||
#include <mt_ref_item.h>
|
||||
|
||||
class MtRefItem;
|
||||
class MbItem;
|
||||
class MbSolid;
|
||||
class MbAssembly;
|
||||
struct MbLumpAndFaces;
|
||||
class MbCollisionDetector;
|
||||
|
||||
/**
|
||||
\addtogroup Collision_Detection
|
||||
\{
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
/** \brief \ru Утилита расчета параметров пересечения и близости тел.
|
||||
\en Utility for calculation of intersection and proximity parameters of solids. \~
|
||||
@@ -31,7 +38,6 @@ class MbCollisionDetector;
|
||||
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
|
||||
@@ -84,12 +90,6 @@ public:
|
||||
|
||||
|
||||
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. \~
|
||||
@@ -98,19 +98,41 @@ public: // the functions below can be deprecated in future version.
|
||||
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 );
|
||||
/**
|
||||
\brief \ru Добавить новый компонент контроля соударений и параметров близости.
|
||||
\en Add a new component to track collisions and proximity parameters. \~
|
||||
*/
|
||||
cdet_item AddComponent( cdet_app_item );
|
||||
/**
|
||||
\brief \ru Добавить новый экземпляр тела в компонент контроля соударений.
|
||||
\en Add a new instance of a reused solid into the component. \~
|
||||
\param[in] compItem - \ru Компонент, которому будет принадлежать экземпляр.
|
||||
\en A component to witch the instance will belong.
|
||||
\param[in] solidItem - \ru Оригинальное тело, добавленное методом #AddSolid, по которому изготавливается экземпляр.
|
||||
\en An original solid added by the method #AddSolid by witch the instance is made.
|
||||
\param[in] place - \ru Положение, которое занимает тело экземпляра в глобальной СК.
|
||||
\en The placement that the instance solid takes in global space.
|
||||
\return \ru Новый экземпляр тела, зарегистрированный с аппарате контроля соударений.
|
||||
\en The new solid instance registered in the detector.
|
||||
\note \ru Значение compItem может быть нулевым. Значит просто вставка не будет
|
||||
принадлежать ни одному компоненту.
|
||||
\en The value compItem can be CDET_NULL. This just means that the
|
||||
instance does not belong to any component.
|
||||
*/
|
||||
cdet_item AddInstance( cdet_item compItem, cdet_item solidItem, const MbPlacement3D & place );
|
||||
/// \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 Вычисление минимального расстояния между объектами (см.функцию #SetDistanceTracking) \en Calculation of minimal distance between objects (see the function #SetDistanceTracking)
|
||||
cdet_result DistanceQuery( MbProximityParameters & ) const;
|
||||
/// \ru Вычисление минимального расстояния между объектами
|
||||
cdet_result DistanceQuery( cdet_item, cdet_item, MbProximityParameters & ) 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).
|
||||
/// \ru Выдать иерархическое представление тела (CDET_NULL = отсутствие такового в списке). \en Get the hierarchical representation of the solid (CDET_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 );
|
||||
@@ -126,20 +148,22 @@ public: // the functions below can be deprecated in future version.
|
||||
// \ru Объявление конструктора копирования и оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration without implementation of the copy-constructor and assignment operator to prevent an assignment by default.
|
||||
OBVIOUS_PRIVATE_COPY( MbCollisionDetectionUtility );
|
||||
|
||||
public:
|
||||
public: /*
|
||||
Deprecated and testing functions
|
||||
*/
|
||||
void SetCallback( CDET_exam_func );
|
||||
// Use AppItem() insead this
|
||||
cdet_app_item Component( size_t solIdx ) const;
|
||||
// The func is deprecated. Instead, use CheckCollisions
|
||||
cdet_result InterferenceDetect( void * formalPar = NULL ) const;
|
||||
cdet_result InterferenceDetect( void * formalPar = C3D_NULL_PTR ) const;
|
||||
// The func is deprecated. Use SetDistanceTracking instead.
|
||||
void SetDistanceComputationObjects( const MbLumpAndFaces &, const MbLumpAndFaces & );
|
||||
// The func is deprecated. Use AddSolid/AddItem instead.
|
||||
size_t AddLump( 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 & );
|
||||
|
||||
const MtRefItem * _ComputeBVTree( cdet_item );
|
||||
|
||||
private:
|
||||
/*
|
||||
@@ -162,6 +186,30 @@ inline cdet_result MbCollisionDetectionUtility::CheckCollisions()
|
||||
return CheckCollisions( defaultQuery );
|
||||
}
|
||||
|
||||
/// \ru Узел дерева объемов. \en A node of the bounding volume tree.
|
||||
typedef const MtRefItem * cdet_bvt_node;
|
||||
/// \ru Пустое дерево объемов. \en An empty bounding volume tree.
|
||||
const cdet_bvt_node CDET_BVT_NULL = C3D_NULL_PTR;
|
||||
/// \ru Пара ветвей поддерева объемов. \en A pair of branches of the bounding volume subtree.
|
||||
typedef std::pair<cdet_bvt_node,cdet_bvt_node> cdet_bvt_pair;
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
/**
|
||||
\brief \ru Получить левую и правую ветви поддерева объемов.
|
||||
\en Get the left and the right branches of the bounding volume subtree.
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC(cdet_bvt_pair) BvtSubNodes( cdet_item, cdet_bvt_node );
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
/** \brief \ru Матрица получения ограничивающего параллелепипеда из единичного куба.
|
||||
\en Transformation matrix yielding bounding parallelepiped from the unit cube.
|
||||
*/
|
||||
//---
|
||||
MATH_FUNC(void) GetOrientedBox( cdet_item, cdet_bvt_node, MbMatrix3D & );
|
||||
|
||||
#endif // __CDET_UTILITY_H
|
||||
|
||||
/** \} */
|
||||
|
||||
// eof
|
||||
@@ -30,7 +30,7 @@
|
||||
\ingroup Algorithms_3D
|
||||
*/
|
||||
//---
|
||||
struct MATH_CLASS MbIntersectionData {
|
||||
struct MATH_CLASS MbShellsIntersectionData {
|
||||
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.
|
||||
@@ -45,28 +45,28 @@ protected:
|
||||
|
||||
public:
|
||||
/// \ru Конструктор. \en Constructor.
|
||||
MbIntersectionData();
|
||||
MbShellsIntersectionData();
|
||||
/// \ru Конструктор по ребру. \en Constructor by an edge.
|
||||
MbIntersectionData( const MbCurveEdge & );
|
||||
MbShellsIntersectionData( const MbCurveEdge & );
|
||||
/// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData( const EdgesVector &, bool isSolidEdges );
|
||||
MbShellsIntersectionData( const EdgesVector &, bool isSolidEdges );
|
||||
/// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
template <class EdgesVector, class FaceIndicesVector>
|
||||
MbIntersectionData( const EdgesVector &, const FaceIndicesVector & faceNumbers1, const FaceIndicesVector & faceNumbers2 );
|
||||
MbShellsIntersectionData( const EdgesVector &, const FaceIndicesVector & faceNumbers1, const FaceIndicesVector & faceNumbers2 );
|
||||
/// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData( const EdgesVector &, const c3d::IndicesPairsVector & faceNumbersPairs );
|
||||
MbShellsIntersectionData( const EdgesVector &, const c3d::IndicesPairsVector & faceNumbersPairs );
|
||||
/// \ru Конструктор по телу. \en Constructor by a solid.
|
||||
explicit MbIntersectionData( const MbSolid & );
|
||||
explicit MbShellsIntersectionData( const MbSolid & );
|
||||
/// \ru Конструктор по точкам. \en Constructor by points.
|
||||
explicit MbIntersectionData( const std::vector<MbCartPoint3D> & );
|
||||
explicit MbShellsIntersectionData( 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 );
|
||||
explicit MbShellsIntersectionData( 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 );
|
||||
explicit MbShellsIntersectionData( const c3d::ConstVerticesSPtrVector &, bool same );
|
||||
/// \ru Деструктор. \en Destructor.
|
||||
~MbIntersectionData();
|
||||
~MbShellsIntersectionData();
|
||||
|
||||
public:
|
||||
/// \ru Пересечение - есть тело. \en Intersection is a solid.
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
/// \ru Получить набор точек касания. \en Get a set of touch points.
|
||||
const MbPointFrame * GetPointFrame() const { return pointFrame; }
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( MbIntersectionData ) // \ru Не реализовано \en Not implemented
|
||||
OBVIOUS_PRIVATE_COPY( MbShellsIntersectionData ) // \ru Не реализовано \en Not implemented
|
||||
};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ OBVIOUS_PRIVATE_COPY( MbIntersectionData ) // \ru Не реализовано \e
|
||||
// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
//---
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges, bool isSolidEgdes )
|
||||
MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & initEdges, bool isSolidEgdes )
|
||||
: edges ( )
|
||||
, faceIndices1 ( )
|
||||
, faceIndices2 ( )
|
||||
@@ -140,9 +140,9 @@ MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges, bool isSo
|
||||
// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
//---
|
||||
template <class EdgesVector, class FaceIndicesVector>
|
||||
MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges,
|
||||
const FaceIndicesVector & faceInds1,
|
||||
const FaceIndicesVector & faceInds2 )
|
||||
MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & initEdges,
|
||||
const FaceIndicesVector & faceInds1,
|
||||
const FaceIndicesVector & faceInds2 )
|
||||
: edges ( )
|
||||
, faceIndices1 ( )
|
||||
, faceIndices2 ( )
|
||||
@@ -172,8 +172,8 @@ MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges,
|
||||
// \ru Конструктор по ребрам. \en Constructor by edges.
|
||||
//---
|
||||
template <class EdgesVector>
|
||||
MbIntersectionData::MbIntersectionData( const EdgesVector & initEdges,
|
||||
const c3d::IndicesPairsVector & faceIndicesPairs )
|
||||
MbShellsIntersectionData::MbShellsIntersectionData( const EdgesVector & initEdges,
|
||||
const c3d::IndicesPairsVector & faceIndicesPairs )
|
||||
: edges ( )
|
||||
, faceIndices1 ( )
|
||||
, faceIndices2 ( )
|
||||
@@ -209,7 +209,7 @@ MbIntersectionData::MbIntersectionData( const EdgesVector & initEdge
|
||||
// \ru Получить массив кривых пересечения. \en Get the intersection curve array.
|
||||
//---
|
||||
template <class EdgesVector>
|
||||
void MbIntersectionData::GetCurves( EdgesVector & dstEdges ) const
|
||||
void MbShellsIntersectionData::GetCurves( EdgesVector & dstEdges ) const
|
||||
{
|
||||
size_t addCnt = edges.size();
|
||||
c3d::EdgeSPtr edge;
|
||||
@@ -226,7 +226,7 @@ void MbIntersectionData::GetCurves( EdgesVector & dstEdges ) const
|
||||
// \ru Получить номера касающихся граней первого/второго тела. \en Get numbers concerning faces of the first/second solid.
|
||||
//---
|
||||
template <class OutputIndicesVector>
|
||||
void MbIntersectionData::GetFaceNumbers( bool first, OutputIndicesVector & outputIndices ) const
|
||||
void MbShellsIntersectionData::GetFaceNumbers( bool first, OutputIndicesVector & outputIndices ) const
|
||||
{
|
||||
const c3d::IndicesVector & faceIndices = first ? faceIndices1 : faceIndices2;
|
||||
size_t addCnt = faceIndices.size();
|
||||
@@ -243,7 +243,7 @@ void MbIntersectionData::GetFaceNumbers( bool first, OutputIndicesVector & outpu
|
||||
// \ru Получить номера касающихся граней первого и второго тел. \en Get numbers concerning faces of the first and second solids.
|
||||
//---
|
||||
template <class OutputIndicesPairsVector>
|
||||
void MbIntersectionData::GetFaceNumbersPairs( OutputIndicesPairsVector & outputIndicesPairs ) const
|
||||
void MbShellsIntersectionData::GetFaceNumbersPairs( OutputIndicesPairsVector & outputIndicesPairs ) const
|
||||
{
|
||||
size_t addCnt = std_min( faceIndices1.size(), faceIndices2.size() );
|
||||
if ( addCnt > 0 ) {
|
||||
@@ -272,14 +272,6 @@ void MbIntersectionData::GetFaceNumbersPairs( OutputIndicesPairsVector & outputI
|
||||
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. \~
|
||||
@@ -320,7 +312,7 @@ MATH_FUNC (bool) CheckSolidClosure( const MbSolid & solid );
|
||||
/** \brief \ru Поиск краевых ребер замкнутой оболочки.
|
||||
\en Search for the boundary edges of a closed shell. \~
|
||||
\details \ru Поиск краевых ребер замкнутой оболочки. \n
|
||||
Краевое ребер - это ребро у которого нет ссылки на одну из смежных граней. \n
|
||||
Краевое ребро - это ребро у которого нет ссылки на одну из смежных граней. \n
|
||||
Наличие краевых ребер замкнутой оболочки может приводит к отказу операций над оболочкой,
|
||||
если операцией будет затронута часть оболочки с краевыми ребрами. \n
|
||||
Наличие одиночных краевых ребер практически никак не влияет на правильность расчета МЦХ.
|
||||
|
||||
+337
-337
@@ -1,337 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 C3D_STANDARD_CXX_11_PARTIAL
|
||||
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 C3D_STANDARD_CXX_11_PARTIAL
|
||||
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 C3D_STANDARD_CXX_11_PARTIAL
|
||||
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
|
||||
|
||||
+58
-58
@@ -1,59 +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
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
+237
-229
@@ -1,229 +1,237 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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.
|
||||
SimpleName 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( c3d::UNDEFINED_SNAME )
|
||||
, hash( c3d::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 name of a connected element.
|
||||
SimpleName GetPropName() const { return propName; }
|
||||
///< \ru Выдать имя объекта сборки или подсборки, содержащего объект связи с ограничением. \en Get hash code of the path from the root to the item.
|
||||
SimpleName GetHash() const { return hash; }
|
||||
///< \ru Выдать сборку, содержащую объект с ограничением. \en Get assembly that hosts geom object with entity connected to constraint.
|
||||
const MbAssembly * GetRoot() const { return root; }
|
||||
/// \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 geometric constraint implementation. \~
|
||||
const ItConstraintItem * ConstraintItem() const { return m_cItem; }
|
||||
/// \ru Выдать аргументы геометрического ограничения. \en Get arguments of geometric constraint. \~
|
||||
const std::vector<MtGeomArgument> & GeomArguments() const { return m_arguments; }
|
||||
/// \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;
|
||||
|
||||
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
|
||||
|
||||
+254
-254
@@ -1,255 +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
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
@@ -370,7 +370,7 @@ public:
|
||||
\param[in] m - \ru Направление обхода.\n
|
||||
Имеет значение знак числа m:\n
|
||||
если m > 0, то обход против часовой стрелки,\n
|
||||
если m < 0, то по часовой стрелки.
|
||||
если m < 0, то по часовой стрелке.
|
||||
\en The traversal direction.\n
|
||||
Has a value of sign of number m:\n
|
||||
if m > 0, then traversal is counterclockwise,\n
|
||||
|
||||
@@ -9,16 +9,18 @@
|
||||
#ifndef __CONV_ANNOTATION_ITEM_H
|
||||
#define __CONV_ANNOTATION_ITEM_H
|
||||
|
||||
|
||||
#include <reference_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 <mb_placement3d.h>
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
class MbLineSegment3D;
|
||||
class MbArc3D;
|
||||
class MbItem;
|
||||
class MbPlaneItem;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Тип элемента аннотации.
|
||||
@@ -182,7 +184,7 @@ enum MbeDefinedDimensionSymbol {
|
||||
dds_RegardlessOfFeatureSize, ///< \ru . \en .
|
||||
dds_Straightness, ///< \ru Допуск прямолинейности. \en Straightness.
|
||||
dds_Symmetry, ///< \ru Допуск симметричности. \en .Symmetry
|
||||
dds_TotlaRunout, ///< \ru Допуск полного радиального (либо торцевого) биения. \en TotlaRunout.
|
||||
dds_TotlaRunout, ///< \ru Допуск полного радиального (либо торцевого) биения. \en Full radial (or face) runout tolerance.
|
||||
};
|
||||
|
||||
|
||||
@@ -393,7 +395,7 @@ struct MaTerminatorSymbol {
|
||||
\en Curve and terminators. \~
|
||||
*/
|
||||
class CONV_CLASS MaDecoratedCurve : public MbRefItem {
|
||||
c3d::SpaceCurveSPtr curve;
|
||||
SPtr<MbCurve3D> curve;
|
||||
std::vector< MaTerminatorSymbol > terminators;
|
||||
MbeDecoratedCurveRole curveType;
|
||||
public:
|
||||
@@ -401,7 +403,7 @@ public:
|
||||
MaDecoratedCurve( const MaDecoratedCurve& ); ///< \ru Конструктор копирования. \en Copy constructor.
|
||||
const MaDecoratedCurve& operator= ( const MaDecoratedCurve& ); ///< \ru Оператор присваивания. \en Assignment operator.
|
||||
|
||||
c3d::SpaceCurveSPtr GetCurve() const; ///< \ru Получить кривую. \en Get curve.
|
||||
SPtr<MbCurve3D> 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.
|
||||
@@ -409,6 +411,7 @@ public:
|
||||
void AddTerminator( const MaTerminatorSymbol& term ); ///< \ru Добавить законцовку. \en Add terminator.
|
||||
|
||||
bool IsA( MbeDecoratedCurveRole ) const; ///< \ru Проверка типа кривой. \en Check curve type.
|
||||
MbeDecoratedCurveRole IsA() const; ///< \ru Проверка типа кривой. \en Check curve type.
|
||||
|
||||
void DuplicateCurve( const MbMatrix3D& transform ); ///< \ru Заменить кривую на преобразованный по матрице дубликат. \en Replace curve by transformed replica.
|
||||
};
|
||||
@@ -450,6 +453,15 @@ public:
|
||||
/// \ru Добавить геометрический визуальный аннотационный элемент. \en Add the geometric visual annotation element of the kernel.
|
||||
void AddGeometricAnnotationElement( const MbItem& );
|
||||
|
||||
/// \ru Добавить собственные геометрические визуальные аннотационный элементы в контейнер. \en Add own geometric visual annotation elements to container.
|
||||
void AddAnnotationGeometryTo( std::vector< SPtr<MbItem> >& addTo ) const;
|
||||
|
||||
/// \ru Число текстовых элементов. \en Count of text items.
|
||||
size_t TextItemsCount() const;
|
||||
|
||||
/// \ru Получить текстовый элемент с указанным индексом. \en Get specified text item.
|
||||
SPtr<MaTextItem> TextItem( size_t ) const;
|
||||
|
||||
/// \ru Задать аннотационные объекты ядра. \en Set the annotation objects of the kernel.
|
||||
template< typename In >
|
||||
void SetAnnotationGeometry( In first, In last );
|
||||
@@ -498,6 +510,27 @@ protected:
|
||||
|
||||
typedef SPtr<MaAnnotationItem> AnnotationSPtr;
|
||||
|
||||
/** \brief \ru Контейнер объектов аннотации.
|
||||
\en Container of annotation objects. \~
|
||||
\ingroup Exchange_Base
|
||||
*/
|
||||
typedef std::vector<AnnotationSPtr> vector_of_annotation;
|
||||
typedef std::vector<AnnotationSPtr> AnnotationSptrVector;
|
||||
|
||||
|
||||
/** \brief \ru Ассоциация наборов аннотационных объектов элементам со счётчиком ссылок.
|
||||
\en Association of sets of annotation objects with elements with reference counter. \~
|
||||
\ingroup Exchange_Base
|
||||
*/
|
||||
typedef std::map< SPtr<const MbItem>, AnnotationSptrVector > map_of_visual_items;
|
||||
|
||||
|
||||
/** \brief \ru Контейнер текстовых блоков.
|
||||
\en Container of text blocks. \~
|
||||
\ingroup Exchange_Base
|
||||
*/
|
||||
typedef std::vector< SPtr<MaTextItem> > vector_of_text;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Размер - родоначальник классов для размеров различных типов.
|
||||
@@ -524,7 +557,7 @@ public:
|
||||
virtual Mae_AnnotationType Type() const;
|
||||
|
||||
/// \ru Получить размерную кривую. \en Get the dimensional curve.
|
||||
MbCurve3D* GetDimensionCurve();
|
||||
MbCurve3D* GetDimensionCurve() const;
|
||||
|
||||
/// \ru Задать номинал. \en Set a value.
|
||||
void SetValue( double v );
|
||||
@@ -551,9 +584,9 @@ public:
|
||||
*/
|
||||
bool AddTerminator( const MaTerminatorSymbol& init );
|
||||
/// \ru Получить первый законцовочный символ. \en Get the first terminator.
|
||||
bool GetFirstTerminator( MaTerminatorSymbol& first );
|
||||
bool GetFirstTerminator( MaTerminatorSymbol& first ) const;
|
||||
/// \ru Получить второй законцовочный символ. \en Get the second terminator.
|
||||
bool GetSecondTerminator( MaTerminatorSymbol& second );
|
||||
bool GetSecondTerminator( MaTerminatorSymbol& second ) const;
|
||||
|
||||
void InitValueTerminators( const MaDimension& init );
|
||||
protected:
|
||||
@@ -595,9 +628,9 @@ public:
|
||||
const MbRefItem * GetBindTarget();
|
||||
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D* GetProjectionBase();
|
||||
MbLineSegment3D* GetProjectionBase() const;
|
||||
/// \ru Получить проекционную кривую ко второму объекту привязки. \en Get the projection curve to the second binding object.
|
||||
MbLineSegment3D* GetProjectionTarget();
|
||||
MbLineSegment3D* GetProjectionTarget() const;
|
||||
|
||||
/// \ru Задать кривую, вдоль которой провдится измерение. \en Set the curve the measurement is performed along.
|
||||
void SetPath( MbCurve3D* inPath );
|
||||
@@ -645,9 +678,9 @@ public:
|
||||
const MbRefItem * GetBindTarget();
|
||||
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D * GetProjectionBase();
|
||||
MbLineSegment3D * GetProjectionBase() const;
|
||||
/// \ru Получить проекционную кривую ко второму объекту привязки. \en Get the projection curve to the second binding object.
|
||||
MbLineSegment3D * GetProjectionTarget();
|
||||
MbLineSegment3D * GetProjectionTarget() const;
|
||||
/// \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.
|
||||
@@ -684,7 +717,7 @@ public:
|
||||
/// \ru Получить базовый объект привязки. \en Get the base binding object.
|
||||
const MbRefItem * GetBindBase();
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D * GetProjectionBase();
|
||||
MbLineSegment3D * GetProjectionBase() const;
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D& );
|
||||
|
||||
@@ -723,9 +756,9 @@ public:
|
||||
const MbRefItem * GetBindBase();
|
||||
|
||||
/// \ru Получить проекционную кривую к базовому объекту привязки. \en Get projection curve to the base binding object.
|
||||
MbLineSegment3D * GetProjectionBase();
|
||||
MbLineSegment3D * GetProjectionBase() const;
|
||||
/// \ru Получить вторую проекционную кривую к объекту привязки. \en Get the first projection curve to the binding object.
|
||||
MbLineSegment3D * GetProjectionTarget();
|
||||
MbLineSegment3D * GetProjectionTarget() const;
|
||||
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
|
||||
virtual SPtr<MaAnnotationItem> ShallowDuplicateTransform( const MbMatrix3D& );
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __BINOBJ_H
|
||||
#define __BINOBJ_H
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// бинарный объект
|
||||
// ---
|
||||
struct BinaryObj {
|
||||
|
||||
void * p;
|
||||
void * pSort;
|
||||
|
||||
BinaryObj( void *otherId, void *otherP ) : p( otherId ), pSort( otherP ) {}
|
||||
|
||||
bool operator == ( const BinaryObj &o ) const { return pSort == o.pSort; }
|
||||
bool operator < ( const BinaryObj &o ) const { return pSort < o.pSort; }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,25 +1,24 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Перечисления, используемые при импорте и экспорте.
|
||||
\en Enumerations for import/export operations.\~
|
||||
\details \ru Определены перечисления, определяющие результат конвертирования,
|
||||
разрешение на чтение и запись различных объектов и передаваемых черезх конвертер строк.
|
||||
\en Converting result, objects and properties filters, special strings
|
||||
of enumerations are defined.\~
|
||||
\brief \ru Настройки импорта и экспорта.
|
||||
\en Settings of import and export procedure. \~
|
||||
\details \ru Интерфейс настроек и предопределённая реализация ConvConvertorProperty3D.
|
||||
\en Interface of settings and pre-defined implementation ConvConvertorProperty3D. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_ERROR_RESULT_H
|
||||
#define __CONV_ERROR_RESULT_H
|
||||
|
||||
|
||||
#include <mb_enum.h>
|
||||
#ifndef __CONV_MODEL_PROPERTIES_H
|
||||
#define __CONV_MODEL_PROPERTIES_H
|
||||
|
||||
#include <math_define.h>
|
||||
#include <mb_placement3d.h>
|
||||
#include <mb_data.h>
|
||||
#include <conv_predefined.h>
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Константы единиц измерения.
|
||||
\en Length units constants.\~
|
||||
\en Length units constants.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Прикладной протокол.
|
||||
\en Applied protocol.\~
|
||||
\en Applied protocol.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
@@ -58,51 +57,24 @@ enum MbeImpExpFormat {
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Обменный формат модели.
|
||||
\en Model exchange format.\~
|
||||
/** \brief \ru Индексы строк, передаваемых через конвертер.
|
||||
\en Indices of strings, transmitted through converter.\~
|
||||
\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.
|
||||
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_CAD_NAME, ///< \ru Название САПР при экспорте. \en CAD Name for export.
|
||||
cvs_END ///< \ru Для удобства перебора. \en For lookup only.
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Индексы, управляющие разрешением на чтение или запись объектов.
|
||||
\en Indeces, which filter imported/exported objects or properties.\~
|
||||
\en Indeces, which filter imported/exported objects or properties.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
@@ -137,59 +109,17 @@ enum MbeIOPermiss {
|
||||
iop_wAssociated, ///< \ru Разрешение на запись ассоциированной геометрии (резьбы и др). \en Export associated geometry (threads etc).
|
||||
iop_rDensity, ///< \ru Разрешение на чтение единиц плотности. \en Import density units.
|
||||
iop_wDensity, ///< \ru Разрешение на запись единиц плотности. \en Export density units.
|
||||
iop_rValidationProperties, ///< \ru Разрешение на чтение контрольных параметров - объёма, площади поверхности, центра масс. \en Import validation properties - volume, surface area, centroid.
|
||||
iop_wValidationProperties, ///< \ru Разрешение на запись контрольных параметров - объёма, площади поверхности, центра масс. \en Export validation properties - volume, surface area, centroid.
|
||||
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.\~
|
||||
\en Type of a log message.\~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
// ---
|
||||
@@ -204,7 +134,7 @@ enum eMsgType {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Код подробного сообщения об ошибке при выводе в лог.
|
||||
\en The key of a detailed log message.\~
|
||||
\en The key of a detailed log message.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
@@ -288,8 +218,10 @@ enum eMsgDetail {
|
||||
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_WarningSameShapeEdgeTwiceInLoop, ///< \ru В цикле дважды встречается одинаковое ребро. \en Edge based on same curves twice enters a loop.
|
||||
emd_WarningIncorrectFaceWasNotAddedToShell, ///< \ru Некорректная грань не была добавлена в оболочку. \en Incorrect face was not added to shell.
|
||||
emd_WarningBoundsNotConnectedWithSeams, ///< \ru Границы замкнутой грани не стыкуются со швами. \en Bounds of periodic face not connected with seams.
|
||||
emd_WarningIntCurveWasReplacedBySegment, ///< \ru Кривая пересечения была заменена отрезком. \en Intersection curve was replaced by segment.
|
||||
|
||||
emd_MessageWeightsFilled, ///< \ru Веса заданы. \en Weights are set.
|
||||
|
||||
@@ -303,12 +235,15 @@ enum eMsgDetail {
|
||||
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_WarningBooleanUndefined, ///< \ru Булево значение не определено. \en Boolean value not defined.
|
||||
|
||||
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_WarningVRMLGridDuplicatesInMeshes, ///< \ru Присутствуют дубликаты объектов в сетках. \en There are grid duplicates in meshes.
|
||||
emd_WarningACISLawIntCurveIsNotCreated, ///< \ru Кривая по закону не создана. \en Law intersection curve is not created.
|
||||
|
||||
emd_ErrorIGESIncorrectExternalReference, ///< \ru Неверное имя внешней ссылки. \en Invalid external reference in IGES.
|
||||
|
||||
@@ -321,54 +256,247 @@ enum eMsgDetail {
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Идентификаторы сообщений индикатора прогресса выполнения конвертации данных.
|
||||
\en Identifiers of the execution progress indicator messages converters data exchange \~
|
||||
\ingroup Data_Exchange
|
||||
/** \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
|
||||
*/
|
||||
//---
|
||||
enum MbeProgBarId_Converters {
|
||||
pbarId_Cnv_Beg = pbarId_PointsSurface_End + 1,
|
||||
class IConvertorProperty3D {
|
||||
public :
|
||||
virtual ~IConvertorProperty3D() {}
|
||||
|
||||
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...
|
||||
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;
|
||||
|
||||
pbarId_Cnv_End,
|
||||
};
|
||||
/** \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 Identifiers of the execution progress indicator messages triangulation. \~
|
||||
\ingroup Data_Exchange
|
||||
/** \brief \ru Предопределённая реализация интерфейса свойств конвертера.
|
||||
\en Pre-defined implementation of converter's properties. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
//---
|
||||
enum MbeProgBarId_Triangulation {
|
||||
pbarId_Triangulation_Beg = pbarId_Cnv_End + 1,
|
||||
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.
|
||||
|
||||
pbarId_Calc_Triangulation, // \ru Расчет триангуляции \en Calculating of triangulation
|
||||
public:
|
||||
|
||||
pbarId_Triangulation_End,
|
||||
};
|
||||
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
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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
|
||||
#endif // __CONV_MODEL_PROPERTIES_H
|
||||
@@ -0,0 +1,575 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Сущности конвертерной модели: документ, деталь, сборка, вставка.
|
||||
\en Entities of converter-compatible model: document, part, assembly, instance. \~
|
||||
\details \ru Интерфейсы сущностей и предопределённая реализация модельного документа C3dModelDocument.
|
||||
\en Interfaces of entities and pre-defined implementation of model document C3dModelDocument. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_MODEL_DOCUMENT_H
|
||||
#define __CONV_MODEL_DOCUMENT_H
|
||||
|
||||
#include <model_item.h>
|
||||
#include <attribute.h>
|
||||
#include <conv_annotation_item.h>
|
||||
#include <conv_predefined.h>
|
||||
#include <tool_cstring.h>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
|
||||
class MbPlacement3D;
|
||||
class MbName;
|
||||
|
||||
class MbAttributeContainer;
|
||||
|
||||
class ItModelAssembly;
|
||||
class ItModelPart;
|
||||
class ItModelInstance;
|
||||
|
||||
class IProgressIndicator;
|
||||
|
||||
typedef SPtr<ItModelAssembly> ModelAssemblyPtr;
|
||||
typedef SPtr<ItModelPart> ModelPartPtr;
|
||||
typedef SPtr<ItModelInstance> ModelInstancePtr;
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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 ModelAssemblyPtr CreateAssembly( const c3d::ItemsSPtrVector & 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 ModelPartPtr CreatePart( const c3d::ItemsSPtrVector & 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 ModelAssemblyPtr 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 ModelPartPtr 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 Generator of text element's geometry shape. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS C3DSymbolToItem : public MbRefItem {
|
||||
public:
|
||||
virtual SPtr<MbItem> TextToItem( const MaTextItem*, const MbPlacement3D& location ) const;
|
||||
virtual SPtr<MbItem> TerminatorToItem( const MaTerminatorSymbol*, const MbPlacement3D& location ) const;
|
||||
|
||||
virtual ~C3DSymbolToItem();
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Формирователь геометрического представления PMI.
|
||||
\en Generator of PMI's geometry shape. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS C3DPmiToItem : public MbRefItem {
|
||||
SPtr<C3DSymbolToItem> symToItem;
|
||||
public:
|
||||
C3DPmiToItem( SPtr<C3DSymbolToItem> = SPtr<C3DSymbolToItem>() );
|
||||
virtual SPtr<MbItem> operator() ( const MaAnnotationItem* ) const;
|
||||
|
||||
virtual ~C3DPmiToItem();
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Реализация документа модели, формирующая регулярную структуру.
|
||||
\en Implementation of model document which has regular structure. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
// ---
|
||||
class CONV_CLASS C3dModelDocument: public ItModelDocument {
|
||||
|
||||
ModelPartPtr part; ///< \ru Представление в виде детали. \en Representation as detail.
|
||||
ModelAssemblyPtr assembly; ///< \ru Представление в виде сборки. \en Representation as assembly.
|
||||
map_of_visual_items visualItems; ///< \ru Элементы аннотации. \en Annotation items.
|
||||
c3d::ItemSPtr rawContent; ///< \ru Передаваемый модельный элемент. \en Converted model item.
|
||||
SPtr<C3DPmiToItem> pmiToItem; ///< \ru Включены ли элементы аннотации непосредственно в модельный элемент. \en Model item contains PMI.
|
||||
public:
|
||||
|
||||
C3dModelDocument( SPtr<C3DPmiToItem> pmiToContent = SPtr<C3DPmiToItem>() ); ///< \ru Конструктор. \en Conscructor.
|
||||
|
||||
virtual ~C3dModelDocument(); ///< \ru Деструктор. \en Descructor.
|
||||
|
||||
// Является ли сборкой.
|
||||
virtual bool IsAssembly() const;
|
||||
// Пуст ли.
|
||||
virtual bool IsEmpty() const;
|
||||
// Задать модель напрямую.
|
||||
virtual void SetContent( MbItem* /*content*/);
|
||||
// Выдать модель напрямую.
|
||||
virtual MbItem * GetContent();
|
||||
// Создать сборку.
|
||||
virtual ModelAssemblyPtr CreateAssembly( const c3d::ItemsSPtrVector & componentItems, const c3d::string_t& fileName );
|
||||
// Создать деталь.
|
||||
virtual ModelPartPtr CreatePart( const c3d::ItemsSPtrVector & componentItems, const c3d::string_t& fileName );
|
||||
// Выдать сборку.
|
||||
virtual ModelAssemblyPtr GetInstanceAssembly( );
|
||||
// Выдать деталь.
|
||||
virtual ModelPartPtr 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 Включены ли PMI в элемент модели. \en If PMI is included into model item.
|
||||
SPtr<C3DPmiToItem>PmiInContent() const;
|
||||
|
||||
/// \ru Зарегистрировать элемент аннотации. \en Register annotation object.
|
||||
void RegisterAnnotation( c3d::ItemSPtr component, const AnnotationSptrVector& annotation, const AnnotationSptrVector& requirements );
|
||||
};
|
||||
|
||||
|
||||
typedef C3dModelDocument RegularModelDocument;
|
||||
typedef C3dModelDocument ConvModelDocument;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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( AnnotationSptrVector &, eTextForm ) const = 0;
|
||||
|
||||
/// \ru Задать технические требования. \en Set technical requirements.
|
||||
virtual void SetRequirements( const AnnotationSptrVector & ) = 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 ModelAssemblyPtr CreateAssembly( const MbPlacement3D &place, const c3d::ItemsSPtrVector & 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 ModelPartPtr CreatePart( const MbPlacement3D &place, const c3d::ItemsSPtrVector & 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 ModelAssemblyPtr 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 ModelPartPtr 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 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 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 ModelInstancePtr 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 ModelInstancePtr 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( c3d::ItemsSPtrVector & 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 c3d::ItemsSPtrVector & 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 AnnotationSptrVector GetAnnotationItems( eTextForm, bool ) const { return AnnotationSptrVector(); }; // Реализация будет удалена после того, как она будет осуществлена на стороне 3D
|
||||
virtual AnnotationSptrVector GetAnnotationItems( eTextForm ) const { return AnnotationSptrVector(); }; // Будет удалена после её реализации на стороне 3D
|
||||
|
||||
/** \brief \ru Задать элементы аннотации в сборке.
|
||||
\en Set elements of annotation in the assembly. \~
|
||||
\param[in] sourceDim - \ru Элементы аннотации
|
||||
\en Elements of annotation. \~
|
||||
*/
|
||||
virtual void SetAnnotationItems( const AnnotationSptrVector & ) = 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 ModelInstancePtr 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 ModelInstancePtr 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( c3d::ItemsSPtrVector & 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 c3d::ItemsSPtrVector & 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 AnnotationSptrVector GetAnnotationItems( eTextForm, bool ) const { return AnnotationSptrVector(); }; // Реализация будет удалена после того, как она будет осуществлена на стороне 3D
|
||||
virtual AnnotationSptrVector GetAnnotationItems( eTextForm ) const { return AnnotationSptrVector(); }; // Будет удалена после её реализации на стороне 3D
|
||||
|
||||
|
||||
/** \brief \ru Задать элементы аннотации в детали.
|
||||
\en Set elements of annotation in the part. \~
|
||||
\param[in] sourceDim - \ru Элементы аннотации
|
||||
\en Elements of annotation. \~
|
||||
*/
|
||||
virtual void SetAnnotationItems( const AnnotationSptrVector & ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __CONV_MODEL_DOCUMENT_H
|
||||
@@ -1,154 +1,367 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Интерфейсы конвертера.
|
||||
\en Interfaces of the converter. \~
|
||||
|
||||
\brief \ru Общий интерфейс конвертера.
|
||||
\en Common API of the converter. \~
|
||||
\details \ru Функции чтения и записи в буфер и файл с автоопределением формата по
|
||||
расширению файла, класс-конвертер с методами для каждого формата и возможностью
|
||||
подключения плагина, функции для работы с каждым форматом.
|
||||
\en Functions for export and import from buffer and file using file's extension
|
||||
for format detection, class of converter for format-specific methods and API for
|
||||
plugin, format-specific import and export functions. \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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;
|
||||
#include <model_item.h>
|
||||
#include <model.h>
|
||||
|
||||
class IProgressIndicator;
|
||||
struct IScaleRequestor;
|
||||
class ItModelDocument;
|
||||
class IConvertorProperty3D;
|
||||
|
||||
/**
|
||||
\addtogroup Exchange_Interface
|
||||
\{
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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 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
|
||||
/** \brief \ru Результат конвертирования.
|
||||
\en Result of converting operation.
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
class IConvertorProperty3D {
|
||||
public :
|
||||
virtual ~IConvertorProperty3D() {}
|
||||
// ---
|
||||
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.
|
||||
};
|
||||
|
||||
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. \~
|
||||
|
||||
namespace c3d {
|
||||
|
||||
class C3DExchangeBuffer;
|
||||
|
||||
/** \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
|
||||
*/
|
||||
virtual bool EnableAutoStitch( double& /*stitchPrecision*/ ) const = 0;
|
||||
CONV_FUNC (MbeConvResType) ImportFromFile( MbModel & model,
|
||||
const path_string & fileName,
|
||||
IConvertorProperty3D * prop = C3D_NULL_PTR,
|
||||
IProgressIndicator * indicator = C3D_NULL_PTR );
|
||||
|
||||
/** \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. \~
|
||||
|
||||
/** \brief \ru Прочитать файл обменного формата в элемент.
|
||||
\en Read a file of an exchange format into element. \~
|
||||
\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] item - \ru Замещаемый элемент.
|
||||
\en The element to replace. \~
|
||||
\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
|
||||
*/
|
||||
virtual double LengthUnitsFactor() const { return LENGTH_UNIT_MM; }
|
||||
CONV_FUNC (MbeConvResType) ImportFromFile( c3d::ItemSPtr& item,
|
||||
const path_string& filePath,
|
||||
IConvertorProperty3D* prop = C3D_NULL_PTR,
|
||||
IProgressIndicator* indicator = C3D_NULL_PTR );
|
||||
|
||||
|
||||
/** \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. \~
|
||||
/** \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
|
||||
*/
|
||||
virtual double AppLengthUnitsFactor() const { return LENGTH_UNIT_MM; }
|
||||
CONV_FUNC (MbeConvResType) ImportFromFile( ItModelDocument & mDoc,
|
||||
const path_string & filePath,
|
||||
IConvertorProperty3D * prop = C3D_NULL_PTR,
|
||||
IProgressIndicator * indicator = C3D_NULL_PTR );
|
||||
|
||||
/** \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. \~
|
||||
/** \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
|
||||
*/
|
||||
virtual void LogReport( ptrdiff_t id, eMsgType msgType, eMsgDetail msgText ) = 0;
|
||||
CONV_FUNC (MbeConvResType) ExportIntoFile( MbModel & model,
|
||||
const path_string & filePath,
|
||||
IConvertorProperty3D * prop = C3D_NULL_PTR,
|
||||
IProgressIndicator * indicator = C3D_NULL_PTR );
|
||||
|
||||
// /** \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; }
|
||||
/** \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 exported element. \~
|
||||
\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( MbItem& item,
|
||||
const path_string& filePath,
|
||||
IConvertorProperty3D* prop = C3D_NULL_PTR,
|
||||
IProgressIndicator* indicator = C3D_NULL_PTR );
|
||||
|
||||
/// \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 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[in] mDoc - \ru Экспортируемый модельный документ.
|
||||
\en The exported model document. \~
|
||||
\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( ItModelDocument& mDoc,
|
||||
const path_string& filePath,
|
||||
IConvertorProperty3D* prop = C3D_NULL_PTR,
|
||||
IProgressIndicator* indicator = C3D_NULL_PTR );
|
||||
|
||||
|
||||
/** \brief \ru Импортировать данные из буфера в модель.
|
||||
\en Import data from buffer into model. \~
|
||||
\param[out] model - \ru Модель.
|
||||
\en The model. \~
|
||||
\param[in] buffer - \ru Буфер.
|
||||
\en Buffer. \~
|
||||
\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 C3DExchangeBuffer& buffer,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
IConvertorProperty3D * prop = C3D_NULL_PTR,
|
||||
IProgressIndicator * indicator = C3D_NULL_PTR );
|
||||
|
||||
|
||||
/** \brief \ru Импортировать данные из буфера в модель.
|
||||
\en Import data from buffer into model. \~
|
||||
\param[out] item - \ru Замещаемый элемент.
|
||||
\en The item to replace. \~
|
||||
\param[in] buffer - \ru Буфер.
|
||||
\en Buffer. \~
|
||||
\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( c3d::ItemSPtr& item,
|
||||
const C3DExchangeBuffer& buffer,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
IConvertorProperty3D* prop = C3D_NULL_PTR,
|
||||
IProgressIndicator* indicator = C3D_NULL_PTR );
|
||||
|
||||
|
||||
/** \brief \ru Экспортировать модель в буфер.
|
||||
\en Export model into buffer. \~
|
||||
\param[in] model - \ru Модель.
|
||||
\en The model. \~
|
||||
\param[in] modelFormat - \ru Формат модели.
|
||||
\en Model format. \~
|
||||
\param[out] buffer - \ru Буфер.
|
||||
\en Buffer. \~
|
||||
\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,
|
||||
C3DExchangeBuffer& buffer,
|
||||
IConvertorProperty3D * prop = C3D_NULL_PTR,
|
||||
IProgressIndicator * indicator = C3D_NULL_PTR );
|
||||
|
||||
|
||||
/** \brief \ru Экспортировать модель в буфер.
|
||||
\en Export model into buffer. \~
|
||||
\param[in] item - \ru Экспортируемый элемент.
|
||||
\en The item to export. \~
|
||||
\param[in] modelFormat - \ru Формат модели.
|
||||
\en Model format. \~
|
||||
\param[out] buffer - \ru Буфер.
|
||||
\en Buffer. \~
|
||||
\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( MbItem& item,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
C3DExchangeBuffer& buffer,
|
||||
IConvertorProperty3D* prop = C3D_NULL_PTR,
|
||||
IProgressIndicator* indicator = C3D_NULL_PTR );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Буфер для обмена.
|
||||
\en Memory buffer for data exchange. \~
|
||||
\details \ru Обеспечивает обмен данными через оперативную память с контролем выделения и освобождения.
|
||||
\en Prvides data exchange with memory allocation and deallocation control. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
class C3DExchangeBuffer {
|
||||
char* data; ///< \ru Адрес буфера. \en Buffer address.
|
||||
size_t count; ///< \ru Число байт. \en Bytes count.
|
||||
public:
|
||||
|
||||
// \ru Конструктор. \en Constructor.
|
||||
C3DExchangeBuffer()
|
||||
: data( C3D_NULL_PTR )
|
||||
, count( 0 ) {
|
||||
}
|
||||
|
||||
// \ru Деструктор. \en Destructor.
|
||||
~C3DExchangeBuffer() {
|
||||
Clear();
|
||||
}
|
||||
|
||||
// \ru Очистить. \en Clear.
|
||||
inline void Clear() {
|
||||
delete[] data;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
// \ru Инициализировать буфер. \en Initialize buffer.
|
||||
inline void Init( const char* init, size_t size ) {
|
||||
Clear();
|
||||
data = new char[size];
|
||||
count = size;
|
||||
::memcpy( data, init, count );
|
||||
}
|
||||
|
||||
// \ru Инициализировать буфер. \en Initialize buffer.
|
||||
inline void Swap( char*& init, size_t& size ) {
|
||||
std::swap( init, data );
|
||||
std::swap( size, count );
|
||||
}
|
||||
|
||||
// \ru Получить адрес буфера. \en Get buffer address.
|
||||
inline const char* Data() const {
|
||||
return data;
|
||||
}
|
||||
|
||||
// \ru Получить число байт. \en Get count of bytes.
|
||||
inline size_t Count() const {
|
||||
return count;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -500,6 +713,42 @@ public:
|
||||
*/
|
||||
virtual MbeConvResType ASCIIPointCloudWrite ( IConvertorProperty3D & prop, ItModelDocument & idoc, IProgressIndicator * indicator = 0, MbRefItem * qeuryStitch = 0 ) = 0;
|
||||
|
||||
|
||||
/** \brief \ru Загрузить плагин получения данных для построения модели.
|
||||
\en Load plugin for getting information necessary to build model. \~
|
||||
\param[in] pluginName - \ru Имя подключаемого файла.
|
||||
\en Name of the file to link. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ASCII_Exchange
|
||||
*/
|
||||
virtual MbeConvResType LoadForeignReader( const c3d::path_string& pluginName ) = 0;
|
||||
|
||||
|
||||
/** \brief \ru Отключить загруженный плагин получения данных для построения модели.
|
||||
\en Release the loaded plugin for getting information necessary to build model. \~
|
||||
\return \ru Код завершения операции.
|
||||
\en Code of the operation termination. \~
|
||||
\ingroup ASCII_Exchange
|
||||
*/
|
||||
virtual MbeConvResType ReleaseForeignReader() = 0;
|
||||
|
||||
/** \brief \ru Прочитать файл с использованием плагина.
|
||||
\en Read a file using plugin. \~
|
||||
\param[in] path - \ru ПУть к файлу, который нужно прочитать.
|
||||
\en Path of the file to read. \~
|
||||
\param[in] idoc - \ru Реализация интерфейса документа.
|
||||
\en Implementation of document interface. \~
|
||||
\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 ASCII_Exchange
|
||||
*/
|
||||
virtual MbeConvResType ImportForeign( const c3d::path_string& path, ItModelDocument & idoc, IConvertorProperty3D * prop = 0, IProgressIndicator * indicator = 0 ) = 0;
|
||||
|
||||
}; // IConvertor3D
|
||||
|
||||
|
||||
@@ -511,6 +760,13 @@ public:
|
||||
CONV_FUNC (IConvertor3D *) GetConvertor3D();
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Освободить интерфейс конвертера.
|
||||
\en Release the converter interface. \~
|
||||
\ingroup Exchange_Interface
|
||||
*/
|
||||
CONV_FUNC( void ) ReleaseConvertor3D( IConvertor3D* );
|
||||
|
||||
|
||||
/** \brief \ru Прочитать файл формата SAT.
|
||||
\en Read a file of SAT format. \~
|
||||
@@ -773,75 +1029,6 @@ CONV_FUNC (MbeConvResType ) ASCIIPointCloudWrite( IConvertorProperty3D & prop, I
|
||||
|
||||
|
||||
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. \~
|
||||
@@ -861,12 +1048,36 @@ namespace c3d {
|
||||
\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 );
|
||||
DEPRECATE_DECLARE CONV_FUNC (MbeConvResType) ImportFromBuffer( MbModel & model,
|
||||
const char* data,
|
||||
size_t length,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
IConvertorProperty3D * prop = 0,
|
||||
IProgressIndicator * indicator = 0 );
|
||||
|
||||
/** \brief \ru Импортировать данные из буфера в модель.
|
||||
\en Import data from buffer into model. \~
|
||||
\param[out] item - \ru Замещаемый элемент.
|
||||
\en The item to replace. \~
|
||||
\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
|
||||
*/
|
||||
DEPRECATE_DECLARE CONV_FUNC(MbeConvResType) ImportFromBuffer( c3d::ItemSPtr& item,
|
||||
const char* data,
|
||||
size_t length,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
IConvertorProperty3D* prop = NULL, IProgressIndicator* indicator = NULL);
|
||||
|
||||
/** \brief \ru Экспортировать модель в буфер.
|
||||
\en Export model into buffer. \~
|
||||
@@ -886,13 +1097,38 @@ namespace c3d {
|
||||
\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 );
|
||||
};
|
||||
DEPRECATE_DECLARE CONV_FUNC (MbeConvResType) ExportIntoBuffer( MbModel & model,
|
||||
MbeModelExchangeFormat modelFormat,
|
||||
char*& data,
|
||||
size_t& length,
|
||||
IConvertorProperty3D * prop = 0,
|
||||
IProgressIndicator * indicator = 0 );
|
||||
|
||||
|
||||
/** \brief \ru Экспортировать модель в буфер.
|
||||
\en Export model into buffer. \~
|
||||
\param[in] item - \ru Экспортируемый элемент.
|
||||
\en The item to export. \~
|
||||
\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
|
||||
*/
|
||||
DEPRECATE_DECLARE CONV_FUNC(MbeConvResType) ExportIntoBuffer( MbItem& item, MbeModelExchangeFormat modelFormat,
|
||||
char*& data,
|
||||
size_t& length,
|
||||
IConvertorProperty3D* prop = NULL, IProgressIndicator* indicator = NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** \} */
|
||||
@@ -1,712 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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,151 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 Representation of exported text.\~
|
||||
\ingroup Data_Exchange
|
||||
*/
|
||||
// ---
|
||||
enum eTextForm {
|
||||
exf_TextOnly, ///< \ru Только текст. \en Text only.
|
||||
exf_GeometryOnly, ///< \ru Только геометрия. \en Geometry only.
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Предопределённые ключи атрибутов для передачи контрольных параметров.
|
||||
\en Predefined key of attributes used for validation properties' exchange.\~
|
||||
\ingroup Data_Interface
|
||||
*/
|
||||
// ---
|
||||
/// \ru Объём. \en Volume.
|
||||
#define C3D_CAD_VALIDATION_PROPERTY_VOLUME c3d::c3dStr_ValidationPropertyVolumeExchange
|
||||
/// \ru Площать поверхости. \en Surface area.
|
||||
#define C3D_CAD_VALIDATION_PROPERTY_AREA c3d::c3dStr_ValidationPropertySurfaceAreaExchange
|
||||
/// \ru Масса. \en Mass.
|
||||
#define C3D_CAD_VALIDATION_PROPERTY_MASS c3d::c3dStr_ValidationPropertyMassExchange
|
||||
/// \ru Идентификатор элемента. \en Item Identifier.
|
||||
#define C3D_CAD_ITEM_IDENTIFIER c3d::c3dStr_ItemIdentifierExchange
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \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 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 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,90 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief Преобразователь сетки к форме, сохраняющей связи граней и полигонов.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONV_TOPO_MESH_H
|
||||
#define __CONV_TOPO_MESH_H
|
||||
|
||||
#include <mb_cart_point3d.h>
|
||||
|
||||
#include <reference_item.h>
|
||||
#include <templ_sptr.h>
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
class MbMesh;
|
||||
|
||||
namespace JTC {
|
||||
|
||||
class TopoMesh;
|
||||
class TopoGrid;
|
||||
class TopoLoop;
|
||||
class TopoVertex;
|
||||
class MeshVertex;
|
||||
class MeshPolygon;
|
||||
|
||||
typedef SPtr<TopoMesh> TopoMeshPtr;
|
||||
typedef SPtr<TopoGrid> TopoGridPtr;
|
||||
typedef SPtr<TopoLoop> TopoLoopPtr;
|
||||
typedef SPtr<TopoVertex> TopoVertexPtr;
|
||||
typedef SPtr<MeshVertex> MeshVertexPtr;
|
||||
typedef SPtr<MeshPolygon> MeshPolygonPtr;
|
||||
|
||||
typedef std::vector<TopoGrid*> RawTopoGridVector;
|
||||
typedef std::vector<TopoGridPtr> TopoGridVector;
|
||||
typedef std::vector<TopoLoopPtr> TopoLoopVector;
|
||||
typedef std::vector<TopoVertexPtr> TopoVertexVector;
|
||||
typedef std::vector<MeshVertexPtr> MeshVertexVector;
|
||||
typedef std::vector<MeshPolygonPtr> MeshPolygonVector;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Сетка с топологической информацией
|
||||
// ---
|
||||
class CONV_CLASS TopoMesh : public MbRefItem {
|
||||
SPtr<const MbMesh> mesh;
|
||||
TopoGridVector grids;
|
||||
MeshVertexVector ownPoints;
|
||||
MeshPolygonVector ownFacePolygons;
|
||||
std::map< size_t, std::vector<size_t> > degeneratedTriangles;
|
||||
std::vector<MbCartPoint3D> boundaryPoints;
|
||||
double metricTolerance;
|
||||
public:
|
||||
TopoMesh(); // Конструктор
|
||||
|
||||
virtual ~TopoMesh(); //Деструктор
|
||||
|
||||
bool Init( const MbMesh& mesh, bool enableDiagnostics = false ); // Инициализировать
|
||||
|
||||
const MbMesh* GetMesh() const; // Получить сетку
|
||||
|
||||
size_t MeshPolygonsCount() const; // Число полигонов
|
||||
|
||||
MeshPolygonPtr Polygon( size_t index ) const; // Получить полигон
|
||||
|
||||
size_t MeshVerticisCount() const; // Число вершин
|
||||
|
||||
MeshVertexPtr Vertex( size_t index ) const; // Получить вершину
|
||||
|
||||
std::map< size_t, std::vector<size_t> > GetDegeneratedTriangles() const; // Получить вырожденные треуголники
|
||||
|
||||
std::vector<MbCartPoint3D> GetBoundaryPoints() const; // Получить граничные точки сетки
|
||||
|
||||
void Reset(); // Сбросить все данные
|
||||
|
||||
size_t NextBoundaryVertex( size_t indexBoundaryVertex, const std::vector<size_t>& allBoundary ) const; // Получить следующую в цепочке граничную вершину.
|
||||
|
||||
bool InitVoidBoundFrom( std::vector<size_t>& freeBoundaryVerticis ); // Сформировать внешнюю границу начиная с указанной вершины.
|
||||
|
||||
double MetricTolerance() const; // Получить точность задания расстояния.
|
||||
|
||||
OBVIOUS_PRIVATE_COPY( TopoMesh )
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif // !__CONV_TOPO_MESH_H
|
||||
+153
-153
@@ -1,153 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+195
-181
@@ -1,182 +1,196 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 );
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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/out] t1 - \ru Параметр точки на кривой 1 соединения с кривой соединения.
|
||||
\en A point parameter on curve 1 of connection with fillet curve. \~
|
||||
\param[in] curve2 - \ru Кривая 2.
|
||||
\en Curve 2. \~
|
||||
\param[in/out] t2 - \ru Параметр точки на кривой 2 соединения с кривой соединения.
|
||||
\en A point parameter on curve 2 of connection with fillet curve. \~
|
||||
\param[in/out] radius - \ru Радиус дуги или цилиндра.
|
||||
\en The radius of an arc or a cylinder. \~
|
||||
\param[in] type - \ru Тип скругления.
|
||||
\en The fillet type. \~
|
||||
\param[in] names - \ru Именователь построенного ребра.
|
||||
\en An object defining the edges names. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] surface - \ru Поверхность, которая будет создана и на которой базируется соединительная кривая, (может быть возращён NULL).
|
||||
\en A surface on which the fillet curve is based on, it will be created by the method (can be NULL). \~
|
||||
\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
|
||||
+104
-103
@@ -1,103 +1,104 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель размноженного набора граней.
|
||||
\en Constructor of duplication face sets . \~
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CR_DUPLICATION_SOLID_H
|
||||
#define CR_DUPLICATION_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 according 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 &, const MbSNameMaker & );
|
||||
private:
|
||||
MbDuplicationSolid( const MbDuplicationSolid &, MbRegDuplicate * );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbDuplicationSolid( const MbDuplicationSolid & );
|
||||
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 &, 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 & ); // \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 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> * 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_DUPLICATION_SOLID_H
|
||||
@@ -48,12 +48,21 @@ 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.
|
||||
|
||||
MbPlacement3D position; ///< \ru Локальная система координат тела. \en Local coordinate system оf a solid.
|
||||
double radius; ///< \ru Радиус основания тела. \en Radius of the base of the solid.
|
||||
double minorRadius; ///< \ru Малый радиус основания тела. \en Small radius of the base of the solid.
|
||||
double height; ///< \ru Высота тела. \en Height of a solid.
|
||||
double length; ///< \ru Длина тела. \en Length of a solid.
|
||||
double minorLength; ///< \ru Малая длина тела. \en Small length of a solid.
|
||||
double width; ///< \ru Ширина тела. \en Width of a solid.
|
||||
double angle; ///< \ru Угол между осью position.axisZ и боковой образующей. \en Angle between position.axisZ axis and lateral generatrix.
|
||||
double ratio; ///< \ru Коэффициент растяжения. \en Stretch factor.
|
||||
public :
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\details \ru Конструктор по точкам и типу тела.
|
||||
\en Constructor by points and a type of a solid. \~
|
||||
\details \ru Конструктор по точкам и типу тела. При этом, по массиву точек тела и его типу наполняются соответствующие его параметры.
|
||||
\en Constructor by points and type of solid.
|
||||
At the same time, the corresponding parameters are filled in by the array of points of the body and its type. \~
|
||||
|
||||
\param[in] pnts - \ru Опорные точки. \n
|
||||
pnts[0] определяет начало локальной системы координат. \n
|
||||
@@ -89,17 +98,8 @@ public :
|
||||
\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] );
|
||||
}
|
||||
}
|
||||
MbElementarySolid( const Points & pnts, ElementaryShellType t, const MbSNameMaker & n );
|
||||
|
||||
|
||||
private :
|
||||
MbElementarySolid( const MbElementarySolid &, MbRegDuplicate * iReg ); // \ru Конструктор копирования с регистратором \en Copy-constructor with the registrator
|
||||
@@ -183,7 +183,7 @@ IMPL_PERSISTENT_OPS( MbElementarySolid )
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateElementary( const SArray<MbCartPoint3D> & points,
|
||||
ElementaryShellType t,
|
||||
const ElementaryShellType t,
|
||||
const MbSNameMaker & n,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
+121
-123
@@ -1,123 +1,121 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 :
|
||||
std::vector<MbExtendedIndex> facesIndex; ///< \ru Идентификаторы удлиняемых граней в оболочке. \en Identifier of a shell faces to extend.
|
||||
ExtensionValues parameters; ///< \ru Параметры построения удлинённой оболочки. \en Parameters of the extended shell construction.
|
||||
|
||||
public :
|
||||
MbExtensionShell( const std::vector<MbExtendedIndex> & fInd,
|
||||
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. An 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] edges - \ru Множество краевых ребер, через которые выполняется продление.
|
||||
\en An array of boundary edges through which to extend the face. \~
|
||||
\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,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const ExtensionValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_EXTENSION_SHELL_H
|
||||
|
||||
@@ -36,6 +36,7 @@ struct MATH_CLASS MbEdgeFunction;
|
||||
class MATH_CLASS MbFilletSolid : public MbSmoothSolid {
|
||||
public :
|
||||
RPArray<MbFunction> functions; ///< \ru Функции изменения радиусов сопряжения. \en Functions of changing conjugation radii.
|
||||
RPArray<MbCurve3D> slideways; ///< \ru Опорные кривые сопряжения. \en Supporting curves of conjugation.
|
||||
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.
|
||||
@@ -43,6 +44,7 @@ public :
|
||||
public :
|
||||
MbFilletSolid( SArray<MbEdgeFacesIndexes> & inds,
|
||||
RPArray<MbFunction> & funcs,
|
||||
RPArray<MbCurve3D> & slids,
|
||||
SArray<MbItemIndex> & bounds,
|
||||
SArray<MbItemIndex> & verts,
|
||||
const SmoothValues & params,
|
||||
@@ -68,6 +70,7 @@ public :
|
||||
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 IsSimilar ( const MbCreator & ) const; // \ru Являются ли объекты подобными \en Whether the objects are similar
|
||||
virtual bool SetEqual( const MbCreator & init ); // \ru Сделать равным. \en Make equal.
|
||||
|
||||
// \ru Общие функции твердого тела \en Common functions of solid
|
||||
@@ -85,6 +88,7 @@ private :
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbFilletSolid )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку со cкруглением ребeр.
|
||||
\en Create a shell with edges fillet. \~
|
||||
|
||||
@@ -1,73 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+239
-239
@@ -1,239 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+117
-114
@@ -1,115 +1,118 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 );
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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] medianFaces - \ru Множество граней для создания срединной оболочки.
|
||||
\en Set of faces for build a median shell. \~
|
||||
\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 c3d::IndicesPairsVector & faceIndexes,
|
||||
const MedianShellValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MedianShellFaces & medianFaces,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_MEDIAN_SHELL_H
|
||||
+103
-103
@@ -1,103 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+217
-217
@@ -1,217 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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 заменой указанных граней исходной оболочки деформируемыми гранями.
|
||||
Поверхности выбранных граней аппроксимируются 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
|
||||
|
||||
+129
-129
@@ -1,129 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
@@ -1,73 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Создание оболочки из нурбс-поверхностей
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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
|
||||
|
||||
@@ -1,116 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
+167
-167
@@ -1,167 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
@@ -32,23 +32,23 @@ class MATH_CLASS MbFaceShell;
|
||||
// ---
|
||||
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.
|
||||
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.
|
||||
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<MbeIntCurSurface> 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 );
|
||||
MbPatchCreator( const RPArray<MbCurve3D> & curves,
|
||||
const PatchValues & params,
|
||||
const MbSNameMaker & n,
|
||||
const SArray<MbeIntCurSurface> * surfInds,
|
||||
const SArray<bool> * orientations,
|
||||
const SArray<double> * tolerances );
|
||||
virtual ~MbPatchCreator();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
@@ -1,86 +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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
@@ -66,12 +66,12 @@ public :
|
||||
\{ */
|
||||
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 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 & properties ); // \ru Выдать свойства объекта \en Get properties of the object
|
||||
virtual void SetProperties( const MbProperties & properties ); // \ru Записать свойства объекта \en Set properties of the object
|
||||
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.
|
||||
@@ -87,13 +87,13 @@ public :
|
||||
\{ */
|
||||
virtual MbFaceShell * InitShell( bool in );
|
||||
virtual void InitBasis( RPArray<MbSpaceItem> & items );
|
||||
virtual bool GetPlacement( MbPlacement3D & p ) const;
|
||||
virtual bool GetPlacement( MbPlacement3D & ) 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.
|
||||
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; }
|
||||
@@ -110,6 +110,7 @@ private :
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbCurveRevolutionSolid )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку тела вращения.
|
||||
\en Create a shell of the revolution solid. \~
|
||||
|
||||
+108
-108
@@ -1,109 +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 );
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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,137 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки на поверхности переменного сечения.
|
||||
\en Constructor of shell of evolution solid. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SECTION_SHELL_H
|
||||
#define __CR_SECTION_SHELL_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <curve3d.h>
|
||||
#include <name_item.h>
|
||||
#include <op_swept_parameter.h>
|
||||
|
||||
|
||||
class MATH_CLASS MbFaceShell;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки на поверхности переменного сечения.
|
||||
\en Constructor of the shell on swept mutable section surface. \~
|
||||
\details \ru Грань оболочки строится путём движения переменного сечения по опорной кривой. \n
|
||||
\en Constructor of face by moving generating curve along a reference spine curve. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSectionShell : public MbCreator {
|
||||
protected :
|
||||
MbSectionData sectionData; ///< \ru Данные о поверхности переменного сечения. \en Data about swept mutable section surface.
|
||||
MbSectionCode sectionCode; ///< \ru Данные о поверхности переменного сечения. \en Data about swept mutable section surface.
|
||||
|
||||
/** \brief \ru Конструктор.
|
||||
\en Constructor. \~
|
||||
\param[in] data - \ru Данные о поверхности переменного сечения.
|
||||
\en Data about swept mutable section surface. \~
|
||||
\param[in] names - \ru Именователь грани оболочки.
|
||||
\en Generating face names. \~
|
||||
*/
|
||||
MbSectionShell( const MbSectionData & data,
|
||||
const MbSectionCode & code,
|
||||
const MbSNameMaker & names );
|
||||
private :
|
||||
MbSectionShell( const MbSectionShell & init, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbSectionShell( const MbSectionShell & );
|
||||
public :
|
||||
virtual ~MbSectionShell();
|
||||
|
||||
/** \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 bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell,
|
||||
RPArray<MbSpaceItem> * items = NULL ); // \ru Построение \en Construction
|
||||
|
||||
virtual void SetYourVersion( VERSION version );
|
||||
/** \} */
|
||||
|
||||
/** \ru \name Функции строителя оболочки на поверхности переменного сечения.
|
||||
\en \name Functions of creator of evolution solid shell.
|
||||
\{ */
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
const MbSectionData & GetSectionData() { return sectionData; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetSectionData( const MbSectionData & data ) { sectionData = data; }
|
||||
/// \ru Дать параметры. \en Get the parameters.
|
||||
const MbSectionCode & GetSectionCode() { return sectionCode; }
|
||||
/// \ru Установить параметры. \en Set the parameters.
|
||||
void SetSectionCode( const MbSectionCode & code ) { sectionCode = code; }
|
||||
/** \} */
|
||||
|
||||
/** \brief \ru Создать оболочку на поверхности переменного сечения.
|
||||
\en Create a shell on swept mutable section surface. \~
|
||||
\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] data - \ru Данные о поверхности переменного сечения.
|
||||
\en Data about swept mutable section surface. \~
|
||||
\param[in] names - \ru Именователь грани оболочки.
|
||||
\en Generating face names. \~
|
||||
\param[out] res - \ru Код результата операции.
|
||||
\en Operation result code. \~
|
||||
\param[out] shell - \ru Код ошибки порстроения.
|
||||
\en Result code of building. \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor of operation. \~
|
||||
*/
|
||||
static MbSectionShell * Create( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbSectionData & data,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbSectionShell & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbSectionShell )
|
||||
|
||||
}; // MbSectionShell
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSectionShell )
|
||||
|
||||
|
||||
#endif // __CR_SECTION_SHELL_H
|
||||
@@ -1,122 +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
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\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
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ IMPL_PERSISTENT_OPS( MbBendsByEdgesSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBendsByEdges( MbFaceShell & initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateBendsByEdges( SPtr<MbFaceShell> & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const RPArray<MbCurveEdge> & edges,
|
||||
const bool unbended,
|
||||
|
||||
@@ -117,7 +117,7 @@ IMPL_PERSISTENT_OPS( MbBendOverSegSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBendOverSegment( MbFaceShell & initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateBendOverSegment( SPtr<MbFaceShell> & initialShell,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbFace> & bendingFaces,
|
||||
MbCurve3D & curve,
|
||||
|
||||
@@ -113,7 +113,7 @@ IMPL_PERSISTENT_OPS( MbBendUnbendSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBendUnbend( MbFaceShell & initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateBendUnbend( SPtr<MbFaceShell> & initialShell,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbSheetMetalBend> & bends,
|
||||
const MbFace & fixedFace,
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель оболочки из листового материала на основе произвольного тела.
|
||||
\en Constructor of the sheet metal shell based on an arbitrary solid.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_BUILDER_SOLID_H
|
||||
#define __CR_SHEET_BUILDER_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала на основе произвольного тела.
|
||||
\en Constructor of the sheet metal shell based on an arbitrary solid. \~
|
||||
\details \ru Строитель оболочки из листового материала на основе граней и ребер произвольного тела.\n
|
||||
Оболочка строится на базе исходной плоской грани и указанных ребер сгиба и разреза.
|
||||
\en Constructor of the sheet metal shell based on faces and edges of an arbitrary solid. \n
|
||||
Shell builds based on initial planar face and given edges of bend and corner enclosure. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbBuildSheetMetalSolid : public MbCreator {
|
||||
private:
|
||||
MbItemIndex faceIndex; ///< \ru Индекс исходной грани для построения листового тела. \en Index of initial face for sheet metal solid creation.
|
||||
bool sense; ///< \ru Признак совпадения придания толщины с нормалью исходной грани. \en Attribute of coincidence of extrusion direction to the normal of the initial face.
|
||||
MbSolidToSheetMetalValues parameters; ///< \ru Параметры построения листового тела по произвольному телу. \en The parameters of sheet metal solid building based on an arbitrary solid.
|
||||
|
||||
public :
|
||||
MbBuildSheetMetalSolid( const MbItemIndex & faceIndex,
|
||||
const bool sense,
|
||||
const MbSolidToSheetMetalValues & params,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbBuildSheetMetalSolid( const MbBuildSheetMetalSolid &, MbRegDuplicate * iReg );
|
||||
|
||||
public:
|
||||
virtual ~MbBuildSheetMetalSolid();
|
||||
|
||||
// \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 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 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.
|
||||
|
||||
// \ru Общие функции твердого тела. \en Common functions of solid.
|
||||
|
||||
// \ru Построение оболочки листового тела. \en Construction of a sheet metal shell.
|
||||
virtual bool CreateShell( MbFaceShell *& shell, MbeCopyMode sameShell, RPArray <MbSpaceItem> *items = NULL );
|
||||
// \ru Получить параметры. \en Get the parameters.
|
||||
void GetParameters( MbSolidToSheetMetalValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const MbSolidToSheetMetalValues & params ) { parameters = params; }
|
||||
|
||||
private:
|
||||
OBVIOUS_PRIVATE_COPY( MbBuildSheetMetalSolid )
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbBuildSheetMetalSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbBuildSheetMetalSolid )
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала на основе произвольного тела.
|
||||
\en Constructor of the sheet metal shell based on an arbitrary solid. \~
|
||||
\details \ru На базе исходной произвольной оболочки построить оболочку из листового материала. \n
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en A shell is to be constructed on the basis of the source arbitary shell. \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] initFace - \ru Исходная грань для построения листового тела.
|
||||
\en The initial face for sheet metal solid construction. \~
|
||||
\param[in] sense - \ru Признак совпадения направления придания толщины с нормалью исходной грани.
|
||||
\en Attribute of coincidence of extrusion direction to the normal of the initial face. \~
|
||||
\param[in] params - \ru Параметры построения листового тела по произвольному телу.
|
||||
\en The parameters of sheet metal solid building based on an arbitrary solid. \~
|
||||
\param[in] nameMaker - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующее тело.
|
||||
\en The resultant solid. \~
|
||||
\result \ru Возвращает строитель оболочки.
|
||||
\en Returns the shell constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) ConvertShellToSheetMetall( MbFaceShell * initialShell, // Исходная оболочка,
|
||||
const MbeCopyMode sameShell, // флаг способа использования исходной оболочки,
|
||||
const MbFace & initFace, // базовая грань, относительно которой будет строиться листовое тело,
|
||||
bool sense, // признак совпадения придания толщины с нормалью базовой грани,
|
||||
const MbSolidToSheetMetalValues & params, // параметры построения листового тела,
|
||||
MbSNameMaker & nameMaker, // именователь,
|
||||
MbResultType & res, // флаг успешности операции,
|
||||
SPtr<MbFaceShell> & resultShell ); // результирующая оболочка.
|
||||
|
||||
|
||||
#endif // __CR_SHEET_BUILDER_SOLID_H
|
||||
@@ -118,7 +118,7 @@ IMPL_PERSISTENT_OPS( MbClosedCornerSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateClosedCorner( MbFaceShell & initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateClosedCorner( SPtr<MbFaceShell> & initialShell,
|
||||
MbeCopyMode sameShell,
|
||||
MbCurveEdge * curveEdgePlus,
|
||||
MbCurveEdge * curveEdgeMinus,
|
||||
|
||||
@@ -130,7 +130,7 @@ IMPL_PERSISTENT_OPS( MbJointBendSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateJointBend( MbFaceShell & initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateJointBend( c3d::ShellSPtr & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbPlacement3D & placement,
|
||||
const MbContour & contour,
|
||||
|
||||
@@ -167,7 +167,7 @@ IMPL_PERSISTENT_OPS( MbSheetMetalSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSheetMetal( MbFaceShell * solid,
|
||||
MATH_FUNC (MbCreator *) CreateSheetMetal( SPtr<MbFaceShell> & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & placement,
|
||||
RPArray<MbContour> & contours,
|
||||
|
||||
@@ -1,103 +1,103 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение упрощённой развёртки листового тела.
|
||||
\en Construction of the simplified flat pattern. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_SIMPLIFIED_FLAT_SOLID_H
|
||||
#define __CR_SHEET_SIMPLIFIED_FLAT_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель упрощения развёртки тела из листового материала.
|
||||
\en Constructor of the simplified flat pattern. \~
|
||||
\details \ru Строитель упрощения развёртки тела из листового материала.
|
||||
Возможно два вида упрощения: обработка углов и слияние подобных граней. \n
|
||||
\en Constructor of the simplified flat pattern.
|
||||
There are two types of simplification. The first one is the corners treatment. The second one is the similar faces unification. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSimplifyFlatSolid : public MbCreator {
|
||||
MbSimplifyFlatPatternValues parameters;
|
||||
|
||||
public :
|
||||
MbSimplifyFlatSolid( const MbSimplifyFlatPatternValues & params,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbSimplifyFlatSolid( const MbSimplifyFlatSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbSimplifyFlatSolid( const MbSimplifyFlatSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbSimplifyFlatSolid();
|
||||
|
||||
// \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.
|
||||
MbSimplifyFlatSolid & operator = ( const MbSimplifyFlatSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbSimplifyFlatSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSimplifyFlatSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Упростить развёртку листового тела.
|
||||
\en Simplify flattened sheet solid. \~
|
||||
\details \ru Упростить развёртку листового тела. \n
|
||||
\en Simplify flattened sheet solid. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The source solid. \~
|
||||
\param[in] sameShell - \ru Флаг удаления оболочки исходного тела.
|
||||
\en Whether to delete the shell of the source solid. \~
|
||||
\param[in] params - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] nameMaker - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующее тело.
|
||||
\en The resultant solid. \~
|
||||
\result \ru - Код результата операции.
|
||||
\en - The operation result code. \~
|
||||
\ingroup Sheet_Metal_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSimplifiedFlatPattern( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbSimplifyFlatPatternValues & params,
|
||||
const MbSNameMaker & nameMaker,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_SIMPLIFIED_FLAT_SOLID_H
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение упрощённой развёртки листового тела.
|
||||
\en Construction of the simplified flat pattern. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_SIMPLIFIED_FLAT_SOLID_H
|
||||
#define __CR_SHEET_SIMPLIFIED_FLAT_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
#include <sheet_metal_param.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель упрощения развёртки тела из листового материала.
|
||||
\en Constructor of the simplified flat pattern. \~
|
||||
\details \ru Строитель упрощения развёртки тела из листового материала.
|
||||
Возможно два вида упрощения: обработка углов и слияние подобных граней. \n
|
||||
\en Constructor of the simplified flat pattern.
|
||||
There are two types of simplification. The first one is the corners treatment. The second one is the similar faces unification. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSimplifyFlatSolid : public MbCreator {
|
||||
MbSimplifyFlatPatternValues parameters;
|
||||
|
||||
public :
|
||||
MbSimplifyFlatSolid( const MbSimplifyFlatPatternValues & params,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbSimplifyFlatSolid( const MbSimplifyFlatSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbSimplifyFlatSolid( const MbSimplifyFlatSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbSimplifyFlatSolid();
|
||||
|
||||
// \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.
|
||||
MbSimplifyFlatSolid & operator = ( const MbSimplifyFlatSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbSimplifyFlatSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSimplifyFlatSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Упростить развёртку листового тела.
|
||||
\en Simplify flattened sheet solid. \~
|
||||
\details \ru Упростить развёртку листового тела. \n
|
||||
\en Simplify flattened sheet solid. \n \~
|
||||
\param[in] solid - \ru Исходное тело.
|
||||
\en The source solid. \~
|
||||
\param[in] sameShell - \ru Флаг удаления оболочки исходного тела.
|
||||
\en Whether to delete the shell of the source solid. \~
|
||||
\param[in] params - \ru Параметры операции.
|
||||
\en The operation parameters. \~
|
||||
\param[in] nameMaker - \ru Именователь.
|
||||
\en An object for naming the new objects. \~
|
||||
\param[out] result - \ru Результирующее тело.
|
||||
\en The resultant solid. \~
|
||||
\result \ru - Код результата операции.
|
||||
\en - The operation result code. \~
|
||||
\ingroup Sheet_Metal_Modeling
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSimplifiedFlatPattern( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbSimplifyFlatPatternValues & params,
|
||||
const MbSNameMaker & nameMaker,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_SIMPLIFIED_FLAT_SOLID_H
|
||||
|
||||
|
||||
+112
-112
@@ -1,112 +1,112 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель операции объединения листовых тел по торцу.
|
||||
\en Constructor of operation of union of sheet solids by butt. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_UNION_SOLID_H
|
||||
#define __CR_SHEET_UNION_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель операции объединения листовых тел по торцу.
|
||||
\en Constructor of operation of union of sheet solids by butt. \~
|
||||
\details \ru Строитель операции объединения листовых тел по торцу объединяет тела
|
||||
только по указанному с помощью ориентированных рёбер торцу,
|
||||
независимо от возможных пересечений тел в других местах.\n.
|
||||
\en Constructor of operation of union of sheet solids by butt unites solids
|
||||
only by the bound specified using oriented edges
|
||||
independently of possible intersections of solids in other places.\n. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSheetUnionSolid : 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 countOne; ///< \ru Разделитель строителей тел-операндов. \en Separator of operand solids creators.
|
||||
|
||||
public :
|
||||
MbSheetUnionSolid( MbCreator & solid2, const bool same2, const MbSNameMaker & n );
|
||||
MbSheetUnionSolid( const RPArray<MbCreator> & solid2, const bool same2, const MbSNameMaker & n );
|
||||
private :
|
||||
MbSheetUnionSolid( const MbSheetUnionSolid & init, MbRegDuplicate *ireg );
|
||||
|
||||
public :
|
||||
virtual ~MbSheetUnionSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en 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 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> & ); // \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 & 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
|
||||
|
||||
// \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 );
|
||||
|
||||
/// \ru Количество строителей первого тела. \en Count of creators of the first solid.
|
||||
size_t GetCountOne() const { return countOne; }
|
||||
/// \ru Общее количество строителей. \en Total count of creators.
|
||||
size_t GetCreatorsCount() const { return creators.Count(); }
|
||||
/// \ru Добавить в журнал. \en Add to the history tree.
|
||||
void AddCreator ( MbCreator & creator );
|
||||
/// \ru Дать строитель. \en Get the constructor.
|
||||
MbCreator * GetCreator ( const size_t ind ) const;
|
||||
void DeleteCreator( const size_t ind );
|
||||
|
||||
private :
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbSheetUnionSolid( const MbSheetUnionSolid & init );
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbSheetUnionSolid & operator = ( const MbSheetUnionSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbSheetUnionSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSheetUnionSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку объединённых по торцу листовых тел.
|
||||
\en Create a shell of sheet solids united by a butt. \~
|
||||
\details \ru Для указанных оболочек построить оболочку как результат операции объединения над множествами граней двух тел.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en For the specified shells create a shell using operation of union of face sets of two solids.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSheetUnion( MbFaceShell & faceShell1,
|
||||
const MbeCopyMode sameShell1,
|
||||
const RPArray<MbCreator> & creators2,
|
||||
MbFaceShell & faceShell2,
|
||||
const MbeCopyMode sameShell2,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_UNION_SOLID_H
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель операции объединения листовых тел по торцу.
|
||||
\en Constructor of operation of union of sheet solids by butt. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_SHEET_UNION_SOLID_H
|
||||
#define __CR_SHEET_UNION_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель операции объединения листовых тел по торцу.
|
||||
\en Constructor of operation of union of sheet solids by butt. \~
|
||||
\details \ru Строитель операции объединения листовых тел по торцу объединяет тела
|
||||
только по указанному с помощью ориентированных рёбер торцу,
|
||||
независимо от возможных пересечений тел в других местах.\n.
|
||||
\en Constructor of operation of union of sheet solids by butt unites solids
|
||||
only by the bound specified using oriented edges
|
||||
independently of possible intersections of solids in other places.\n. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbSheetUnionSolid : 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 countOne; ///< \ru Разделитель строителей тел-операндов. \en Separator of operand solids creators.
|
||||
|
||||
public :
|
||||
MbSheetUnionSolid( MbCreator & solid2, const bool same2, const MbSNameMaker & n );
|
||||
MbSheetUnionSolid( const RPArray<MbCreator> & solid2, const bool same2, const MbSNameMaker & n );
|
||||
private :
|
||||
MbSheetUnionSolid( const MbSheetUnionSolid & init, MbRegDuplicate *ireg );
|
||||
|
||||
public :
|
||||
virtual ~MbSheetUnionSolid();
|
||||
|
||||
// \ru Общие функции математического объекта \en Common functions of the mathematical object
|
||||
|
||||
virtual MbeCreatorType IsA() const; // \ru Тип элемента \en 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 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> & ); // \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 & 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
|
||||
|
||||
// \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 );
|
||||
|
||||
/// \ru Количество строителей первого тела. \en Count of creators of the first solid.
|
||||
size_t GetCountOne() const { return countOne; }
|
||||
/// \ru Общее количество строителей. \en Total count of creators.
|
||||
size_t GetCreatorsCount() const { return creators.Count(); }
|
||||
/// \ru Добавить в журнал. \en Add to the history tree.
|
||||
void AddCreator ( MbCreator & creator );
|
||||
/// \ru Дать строитель. \en Get the constructor.
|
||||
MbCreator * GetCreator ( const size_t ind ) const;
|
||||
void DeleteCreator( const size_t ind );
|
||||
|
||||
private :
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbSheetUnionSolid( const MbSheetUnionSolid & init );
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
MbSheetUnionSolid & operator = ( const MbSheetUnionSolid & );
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbSheetUnionSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbSheetUnionSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку объединённых по торцу листовых тел.
|
||||
\en Create a shell of sheet solids united by a butt. \~
|
||||
\details \ru Для указанных оболочек построить оболочку как результат операции объединения над множествами граней двух тел.
|
||||
Одновременно с построением оболочки функция создаёт её строитель.\n
|
||||
\en For the specified shells create a shell using operation of union of face sets of two solids.
|
||||
The function simultaneously creates the shell and its constructor.\n \~
|
||||
\result \ru Возвращает строитель.
|
||||
\en Returns the constructor. \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSheetUnion( MbFaceShell & faceShell1,
|
||||
const MbeCopyMode sameShell1,
|
||||
const RPArray<MbCreator> & creators2,
|
||||
MbFaceShell & faceShell2,
|
||||
const MbeCopyMode sameShell2,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_SHEET_UNION_SOLID_H
|
||||
|
||||
@@ -207,8 +207,8 @@ bool MbSimpleCreator::DeleteShellCopies( const CreatorsVector & creators )
|
||||
//------------------------------------------------------------------------------
|
||||
// \ru Есть ли в каком-то простом построителе (MbSimpleCreator) заданная оболочка. \en Is there a simple builder (MbSimpleCreator) that contains a given shell?.
|
||||
// ---
|
||||
template <class Creators>
|
||||
bool MbSimpleCreator::IsThisShell( const MbFaceShell & shell, const Creators & creators )
|
||||
template <class CreatorsVector>
|
||||
bool MbSimpleCreator::IsThisShell( const MbFaceShell & shell, const CreatorsVector & creators )
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
|
||||
+523
-523
File diff suppressed because it is too large
Load Diff
@@ -143,7 +143,7 @@ IMPL_PERSISTENT_OPS( MbBeadSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateBead( MbFaceShell * initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateBead( SPtr<MbFaceShell> & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbFace * face,
|
||||
const MbPlacement3D & placement,
|
||||
|
||||
@@ -134,7 +134,7 @@ IMPL_PERSISTENT_OPS( MbJalousieSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateJalousie( MbFaceShell * initialShell,
|
||||
MATH_FUNC (MbCreator *) CreateJalousie( SPtr<MbFaceShell> & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const MbFace * face,
|
||||
const MbPlacement3D & placement,
|
||||
|
||||
@@ -138,18 +138,18 @@ IMPL_PERSISTENT_OPS( MbJogSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateSheetSolidJog( MbFaceShell & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbFace> & bendingFaces,
|
||||
MbCurve3D & curve,
|
||||
const bool unbended,
|
||||
const MbJogValues & parameters,
|
||||
const MbBendValues & secondBendParams,
|
||||
MbSNameMaker & names,
|
||||
RPArray<MbFace> & firstBendFaces,
|
||||
RPArray<MbFace> & secondBendFaces,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
MATH_FUNC (MbCreator *) CreateSheetSolidJog( SPtr<MbFaceShell> & solid,
|
||||
MbeCopyMode sameShell,
|
||||
const RPArray<MbFace> & bendingFaces,
|
||||
MbCurve3D & curve,
|
||||
const bool unbended,
|
||||
const MbJogValues & parameters,
|
||||
const MbBendValues & secondBendParams,
|
||||
MbSNameMaker & names,
|
||||
RPArray<MbFace> & firstBendFaces,
|
||||
RPArray<MbFace> & secondBendFaces,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
#endif // __CR_STAMP_JOG_SOLID_H
|
||||
|
||||
+110
-110
@@ -1,110 +1,110 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки тела с без указанной операции.
|
||||
\en Construction of a shell without the specified operation. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_STAMP_REMOVE_SOLID_H
|
||||
#define __CR_STAMP_REMOVE_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
//#include <sheet_metal_param.h>
|
||||
//#include <surf_plane.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала с удалёнными элементами указанной операции.
|
||||
\en The constructor of a shell from sheet material without elements of the specified operation. \~
|
||||
\details \ru Строитель оболочки из листового материала с удалёнными элементами указанной операции.
|
||||
Удаляет грани с указанным главным именем операции и затягивает образовавшуюся дыру расширением соседних граней. \n
|
||||
\en The constructor of a shell from sheet material without elements of the specified operation.
|
||||
It removes faces with specified main name and then mends the hole by stretching the neighbour faces. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbRemoveOperationSolid : public MbCreator {
|
||||
SimpleName removeName;
|
||||
|
||||
public :
|
||||
MbRemoveOperationSolid( const SimpleName removeName,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbRemoveOperationSolid( const MbRemoveOperationSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbRemoveOperationSolid( const MbRemoveOperationSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbRemoveOperationSolid();
|
||||
|
||||
// \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.
|
||||
MbRemoveOperationSolid & operator = ( const MbRemoveOperationSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbRemoveOperationSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbRemoveOperationSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку без указанной операции.
|
||||
\en Constructs a shell without the specified operation. \~
|
||||
\details \ru Построить оболочку без указанной операции.
|
||||
Удаляет грани с указанным главным именем операции и затягивает образовавшуюся дыру расширением соседних граней. \n
|
||||
\en Constructs a shell without the specified operation.
|
||||
It removes faces with specified main name and then mends the hole by stretching the neighbour faces. \n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] removeName - \ru Главное имя операции которую надо удалить.
|
||||
\en The main name of the operation to be removed. \~
|
||||
\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 *) CreateRemovedOperationResult( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const SimpleName removeName,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
|
||||
#endif // __CR_STAMP_REMOVE_SOLID_H
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Построение оболочки тела с без указанной операции.
|
||||
\en Construction of a shell without the specified operation. \~
|
||||
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_STAMP_REMOVE_SOLID_H
|
||||
#define __CR_STAMP_REMOVE_SOLID_H
|
||||
|
||||
|
||||
#include <creator.h>
|
||||
//#include <sheet_metal_param.h>
|
||||
//#include <surf_plane.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель оболочки из листового материала с удалёнными элементами указанной операции.
|
||||
\en The constructor of a shell from sheet material without elements of the specified operation. \~
|
||||
\details \ru Строитель оболочки из листового материала с удалёнными элементами указанной операции.
|
||||
Удаляет грани с указанным главным именем операции и затягивает образовавшуюся дыру расширением соседних граней. \n
|
||||
\en The constructor of a shell from sheet material without elements of the specified operation.
|
||||
It removes faces with specified main name and then mends the hole by stretching the neighbour faces. \n \~
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
class MATH_CLASS MbRemoveOperationSolid : public MbCreator {
|
||||
SimpleName removeName;
|
||||
|
||||
public :
|
||||
MbRemoveOperationSolid( const SimpleName removeName,
|
||||
const MbSNameMaker & names );
|
||||
private:
|
||||
MbRemoveOperationSolid( const MbRemoveOperationSolid &, MbRegDuplicate * iReg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbRemoveOperationSolid( const MbRemoveOperationSolid & );
|
||||
|
||||
public:
|
||||
virtual ~MbRemoveOperationSolid();
|
||||
|
||||
// \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.
|
||||
MbRemoveOperationSolid & operator = ( const MbRemoveOperationSolid & ); // \ru Не реализовано \en Not implemented
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbRemoveOperationSolid )
|
||||
};
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbRemoveOperationSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Построить оболочку без указанной операции.
|
||||
\en Constructs a shell without the specified operation. \~
|
||||
\details \ru Построить оболочку без указанной операции.
|
||||
Удаляет грани с указанным главным именем операции и затягивает образовавшуюся дыру расширением соседних граней. \n
|
||||
\en Constructs a shell without the specified operation.
|
||||
It removes faces with specified main name and then mends the hole by stretching the neighbour faces. \n \~
|
||||
\param[in] initialShell - \ru Исходная оболочка.
|
||||
\en The initial shell. \~
|
||||
\param[in] sameShell - \ru Режим копирования исходной оболочки.
|
||||
\en Mode of copying the initial shell. \~
|
||||
\param[in] removeName - \ru Главное имя операции которую надо удалить.
|
||||
\en The main name of the operation to be removed. \~
|
||||
\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 *) CreateRemovedOperationResult( MbFaceShell & initialShell,
|
||||
const MbeCopyMode sameShell,
|
||||
const SimpleName removeName,
|
||||
const MbSNameMaker & names,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
|
||||
#endif // __CR_STAMP_REMOVE_SOLID_H
|
||||
|
||||
|
||||
|
||||
+135
-135
@@ -1,135 +1,135 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель листового тела с ребром жёсткости.
|
||||
\en Constructor of a sheet solid with a rib.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_STAMP_RIB_SOLID_H
|
||||
#define __CR_STAMP_RIB_SOLID_H
|
||||
|
||||
|
||||
#include <cur_contour.h>
|
||||
#include <creator.h>
|
||||
#include <op_swept_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель тела с ребром жёсткости.
|
||||
\en Constructor of a sheet 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 MbStampRibSolid : 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.
|
||||
SheetRibValues parameters; ///< \ru Параметры формообразования. \en Forming parameters.
|
||||
|
||||
public :
|
||||
MbStampRibSolid( const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
size_t index,
|
||||
const SheetRibValues & param,
|
||||
const MbSNameMaker & names );
|
||||
private :
|
||||
MbStampRibSolid( const MbStampRibSolid & bres, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbStampRibSolid( const MbStampRibSolid & bres );
|
||||
public :
|
||||
virtual ~MbStampRibSolid();
|
||||
|
||||
// \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 IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is 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( SheetRibValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const SheetRibValues & params ) { parameters = params; }
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbStampRibSolid & ); // \ru НЕЛЬЗЯ!!! \en NOT ALLOWED!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbStampRibSolid )
|
||||
}; // MbRibSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbStampRibSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку с ребром жёсткости.
|
||||
\en Create a shell with a rib. \~
|
||||
\details \ru Для указанной листовой оболочки построить оболочку с ребром жёсткости, форма которого задана плоским контуром.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a specified sheet 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 *) CreateSheetRib( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
size_t index,
|
||||
SheetRibValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Построение элементов ребра жёсткости.
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateSheetRibParts( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
const size_t index,
|
||||
const SheetRibValues & pars,
|
||||
const MbSNameMaker & names,
|
||||
MbFaceShell *& shellToAdd,
|
||||
MbFaceShell *& shellToSubtract );
|
||||
|
||||
#endif // __CR_STAMP_RIB_SOLID_H
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
\file
|
||||
\brief \ru Строитель листового тела с ребром жёсткости.
|
||||
\en Constructor of a sheet solid with a rib.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CR_STAMP_RIB_SOLID_H
|
||||
#define __CR_STAMP_RIB_SOLID_H
|
||||
|
||||
|
||||
#include <cur_contour.h>
|
||||
#include <creator.h>
|
||||
#include <op_swept_parameter.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Строитель тела с ребром жёсткости.
|
||||
\en Constructor of a sheet 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 MbStampRibSolid : 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.
|
||||
SheetRibValues parameters; ///< \ru Параметры формообразования. \en Forming parameters.
|
||||
|
||||
public :
|
||||
MbStampRibSolid( const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
size_t index,
|
||||
const SheetRibValues & param,
|
||||
const MbSNameMaker & names );
|
||||
private :
|
||||
MbStampRibSolid( const MbStampRibSolid & bres, MbRegDuplicate * ireg );
|
||||
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
|
||||
MbStampRibSolid( const MbStampRibSolid & bres );
|
||||
public :
|
||||
virtual ~MbStampRibSolid();
|
||||
|
||||
// \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 IsSimilar( const MbCreator & item ) const; // \ru Являются ли объекты подобными? \en Determine whether an object is 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( SheetRibValues & params ) const { params = parameters; }
|
||||
// \ru Установить параметры. \en Set the parameters.
|
||||
void SetParameters( const SheetRibValues & params ) { parameters = params; }
|
||||
|
||||
private :
|
||||
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
|
||||
void operator = ( const MbStampRibSolid & ); // \ru НЕЛЬЗЯ!!! \en NOT ALLOWED!!!
|
||||
|
||||
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbStampRibSolid )
|
||||
}; // MbRibSolid
|
||||
|
||||
IMPL_PERSISTENT_OPS( MbStampRibSolid )
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** \brief \ru Создать оболочку с ребром жёсткости.
|
||||
\en Create a shell with a rib. \~
|
||||
\details \ru Для указанной листовой оболочки построить оболочку с ребром жёсткости, форма которого задана плоским контуром.\n
|
||||
Одновременно с построением оболочки функция создаёт её строитель. \n
|
||||
\en For a specified sheet 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 *) CreateSheetRib( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
size_t index,
|
||||
SheetRibValues & parameters,
|
||||
const MbSNameMaker & operNames,
|
||||
MbResultType & res,
|
||||
MbFaceShell *& shell );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Построение элементов ребра жёсткости.
|
||||
// ---
|
||||
MATH_FUNC (MbResultType) CreateSheetRibParts( MbFaceShell * solid,
|
||||
MbeCopyMode sameShell,
|
||||
const MbPlacement3D & place,
|
||||
const MbContour & contour,
|
||||
const size_t index,
|
||||
const SheetRibValues & pars,
|
||||
const MbSNameMaker & names,
|
||||
MbFaceShell *& shellToAdd,
|
||||
MbFaceShell *& shellToSubtract );
|
||||
|
||||
#endif // __CR_STAMP_RIB_SOLID_H
|
||||
|
||||
@@ -131,7 +131,7 @@ IMPL_PERSISTENT_OPS( MbStampSolid )
|
||||
\ingroup Model_Creators
|
||||
*/
|
||||
// ---
|
||||
MATH_FUNC (MbCreator *) CreateStamp( MbFaceShell * initialShell, // исходная оболочка
|
||||
MATH_FUNC (MbCreator *) CreateStamp( SPtr<MbFaceShell> & initialShell, // исходная оболочка
|
||||
const MbeCopyMode sameShell, // флаг способа использования исходной оболочки
|
||||
const MbFace * face, // грань штамповки
|
||||
const MbPlacement3D & placement, // локальная система координат контура
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user