- C3d aggiornamento delle librerie.
This commit is contained in:
Dario Sassi
2020-09-14 16:42:31 +00:00
parent 555eae9594
commit e8f0fa2d27
332 changed files with 59308 additions and 52918 deletions
+299 -80
View File
@@ -813,6 +813,47 @@ public:
};
class MbPatchCurveMating;
//------------------------------------------------------------------------------
/** \brief \ru Сопряжение по кривой заплатки.
\en Patch curve conjugation. \~
\details \ru Сопряжение по кривой заплатки. \n
\en Patch curve conjugation. \n \~
\ingroup Build_Parameters
*/
// ---
class MATH_CLASS MbPatchMating {
protected:
/// \ru Конструктор. \en Constructor.
MbPatchMating() {}
/// \ru Конструктор. \en Constructor.
MbPatchMating( const MbPatchMating & ) {}
public:
/// \ru Деструктор. \en Destructor.
virtual ~MbPatchMating() {}
public:
/// \ru Установить тип сопряжения. \en Set conjugation type.
virtual void SetMate( MbePatchMatingType newType, const MbSurface * newSurface ) = 0;
/// \ru Установить тип сопряжения сегмента. \en Set conjugation type of segment.
virtual void SetMate( size_t segInd, MbePatchMatingType newType, const MbSurface * newSurface ) = 0;
/// \ru Выдать тип сопряжения. \en Get the type of conjugation.
virtual MbePatchMatingType GetMatingType() const = 0;
/// \ru Выдать посверхность. \en Get surface.
virtual const MbSurface * GetSurface() const = 0;
/// \ru Сопряжение для сегмента номер segInd. \en The conjugation by segment number segInd.
virtual MbPatchCurveMating & GetSegmentMate( size_t segInd ) = 0;
/// \ru Чье сопряжение. \en The conjugation owner type.
virtual MbeSpaceType GetOwnerType() = 0;
private:
MbPatchMating & operator = ( const MbPatchMating & );
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры заплатки.
\en The parameters of patch. \~
@@ -834,11 +875,14 @@ public:
ts_tang, ///< \ru По касательной. \en Along the tangent.
ts_norm, ///< \ru По нормали. \en Along the normal.
ts_none, ///< \ru Не определено. \en Undefined.
ts_plane ///< \ru Плоская заплатка. \en Plane patch.
ts_plane, ///< \ru Плоская заплатка. \en Plane patch.
ts_byCurves, ///< \ru Построение задается сопряжениями по каждой кривой. \en The construction is defined by conjugations on curves.
};
private:
SurfaceType type; ///< \ru Тип заплатки. \en Type of patch.
bool checkSelfInt; ///< \ru Флаг проверки самопересечений (вычислительно "тяжелыми" методами). \en Flag for checking of self-intersection (computationally by "heavy" methods).
SurfaceType type; ///< \ru Тип заплатки. \en Type of patch.
bool checkSelfInt; ///< \ru Флаг проверки самопересечений (вычислительно "тяжелыми" методами). \en Flag for checking of self-intersection (computationally by "heavy" methods).
bool mergeEdges; ///< \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
std::vector<DPtr<MbPatchMating>> curvesMatings; ///< \ru Сопряжения по кривым. Параметр используется при type == ts_byCurves. \en The conjugation by curves.
public:
/** \brief \ru Конструктор по умолчанию.
@@ -849,11 +893,14 @@ public:
PatchValues()
: type ( ts_none )
, checkSelfInt( false )
, mergeEdges ( true )
{}
/// \ru Конструктор копирования. \en Copy-constructor.
PatchValues( const PatchValues & other )
: type ( other.type )
, checkSelfInt( other.checkSelfInt )
: type ( other.type )
, checkSelfInt ( other.checkSelfInt )
, mergeEdges ( other.mergeEdges )
, curvesMatings( other.curvesMatings )
{}
/// \ru Деструктор. \en Destructor.
~PatchValues()
@@ -868,10 +915,27 @@ public:
bool CheckSelfInt() const { return checkSelfInt; }
/// \ru Установить флаг проверки самопересечений. \en Set the flag of checking self-intersection.
void SetCheckSelfInt( bool c ) { checkSelfInt = c; }
/// \ru Сливать подобные ребра (true)? \en Whether to merge similar edges (true)?
bool MergeEdges() const { return mergeEdges; }
/// \ru Сливать подобные ребра. \en Whether to merge similar edges.
void SetMergingEdges( bool s ) { mergeEdges = s; }
/// \ru Установить сопряжение кривой номер cInd. \en Set mate for curve number cInd.
void SetCurveMating( size_t cInd, MbePatchMatingType curveMate, const MbSurface * surface );
/// \ru Выдать тип сопряжения по кривой cInd. \en Get the type of conjugation on curve cInd.
MbePatchMatingType GetCurveMatingType( size_t cInd ) const;
/// \ru Выдать поверхность сопряжения по кривой cInd. \en Get the surface of conjugation on curve cInd.
const MbSurface * GetCurveMatingSurface( size_t cInd ) const;
/// \ru Установить сопряжение сегмента sInd контура cInd. \en Set mate for segment number sInd for contour number cInd.
void SetCurveMating( size_t cInd, size_t sInd, MbePatchMatingType curveMate, const MbSurface * surface );
/// \ru Декомпозиция сопряжений контура номер cInd, segCount - число сегментов контура. \en Decomposition of cInd - contour mates, segCount - the number of contour segments.
void DecomposeMates( size_t cInd, size_t segCount );
/// \ru Оператор присваивания. \en Assignment operator.
void operator = ( const PatchValues & other ) { type = other.type; checkSelfInt = other.checkSelfInt; }
void operator = ( const PatchValues & other ) { type = other.type; checkSelfInt = other.checkSelfInt; mergeEdges = other.mergeEdges; curvesMatings = other.curvesMatings; }
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const PatchValues & obj, double ) const { return ((obj.type == type) && (obj.checkSelfInt == checkSelfInt)); }
bool IsSame( const PatchValues & obj, double ) const { return ((obj.type == type) && (obj.checkSelfInt == checkSelfInt) && (obj.mergeEdges == mergeEdges) && (obj.curvesMatings == curvesMatings)); }
KNOWN_OBJECTS_RW_REF_OPERATORS( PatchValues ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
};
@@ -887,18 +951,18 @@ public:
// ---
class MATH_CLASS MbPatchCurve : public MbRefItem {
private:
MbCurve3D * curve; ///< \ru Кривая. \en A curve.
double begTolerance; ///< \ru Толерантность привязки в начале. \en Binding tolerance at the start.
double endTolerance; ///< \ru Толерантность привязки в начале. \en Binding tolerance at the start.
bool isSurfaceOne; ///< \ru В ребре есть грань с первой поверхностью из кривой пересечения. \en There is face with the first surface from the intersection curve in the edge.
bool isSurfaceTwo; ///< \ru В ребре есть грань со второй поверхностью из кривой пересечения. \en There is face with the second surface from the intersection curve in the edge.
mutable bool isUsed; ///< \ru Флаг использования. \en An using flag.
c3d::SpaceCurveSPtr curve; ///< \ru Кривая. \en A curve.
double begTolerance; ///< \ru Толерантность привязки в начале. \en Binding tolerance at the start.
double endTolerance; ///< \ru Толерантность привязки в начале. \en Binding tolerance at the start.
bool isSurfaceOne; ///< \ru В ребре есть грань с первой поверхностью из кривой пересечения. \en There is face with the first surface from the intersection curve in the edge.
bool isSurfaceTwo; ///< \ru В ребре есть грань со второй поверхностью из кривой пересечения. \en There is face with the second surface from the intersection curve in the edge.
mutable bool isUsed; ///< \ru Флаг использования. \en An using flag.
public:
/// \ru Конструктор по кривой (копирует кривую, трансформируя по матрице). \en Constructor by a curve (copies a curve, transforms by the matrix).
MbPatchCurve( const MbCurve3D & crv, const MbMatrix3D & mtr );
MbPatchCurve( const MbCurve3D &, const MbMatrix3D & );
/// \ru Конструктор по ребру (копирует кривую, трансформируя по матрице). \en Constructor by an edge (copies a curve, transforms by the matrix).
MbPatchCurve( const MbCurveEdge & edge, const MbMatrix3D & mtr );
MbPatchCurve( const MbCurveEdge &, const MbMatrix3D & );
/// \ru Деструктор. \en Destructor.
virtual ~MbPatchCurve();
@@ -1594,18 +1658,19 @@ private:
MbeMatingType type1; ///< \ru Сопряжение на границе 1. \en Mate on the boundary 1.
MbeMatingType type2; ///< \ru Сопряжение на границе 2. \en Mate on the boundary 2.
MbeMatingType type3; ///< \ru Сопряжение на границе 3. \en Mate on the boundary 3.
MbSurface * surface0; ///< \ru Сопрягаемая поверхность через границу 0 (curvesU[0]). \en Mating surface through the boundary 0 (curvesU[0]).
MbSurface * surface1; ///< \ru Сопрягаемая поверхность через границу 1 (curvesV[0]). \en Mating surface through the boundary 1 (curvesV[0]).
MbSurface * surface2; ///< \ru Сопрягаемая поверхность через границу 2 (curvesU[maxU]). \en Mating surface through the boundary 2 (curvesU[maxU]).
MbSurface * surface3; ///< \ru Сопрягаемая поверхность через границу 3 (curvesV[maxV]). \en Mating surface through the boundary 3 (curvesV[maxV]).
MbPoint3D * point; ///< \ru Точка на поверхности. Используется для уточнения. \en Point on the surface. Used for specializing.
c3d::SurfacesVector surface0; /// \ru Сопрягаемые поверхности через curvesU[0] \en Mating surfaces through curvesU[0]
c3d::SurfacesVector surface1; /// \ru Сопрягаемые поверхности через curvesV[0] \en Mating surfaces through curvesV[0]
c3d::SurfacesVector surface2; /// \ru Сопрягаемые поверхности через curvesU[maxU] \en Mating surfaces through curvesU[maxU]
c3d::SurfacesVector surface3; /// \ru Сопрягаемые поверхности через curvesV[maxV] \en Mating surfaces through curvesV[maxV]
MbPoint3D * point; ///< \ru Точка на поверхности. Используется для уточнения. \en Point on the surface. Used for specializing.
bool defaultDir0; ///< \ru Направление сопряжения на границе 0 по умолчанию. \en Default mate direction through the boundary 0.
bool defaultDir1; ///< \ru Направление сопряжения на границе 1 по умолчанию. \en Default mate direction through the boundary 1.
bool defaultDir2; ///< \ru Направление сопряжения на границе 2 по умолчанию. \en Default mate direction through the boundary 2.
bool defaultDir3; ///< \ru Направление сопряжения на границе 3 по умолчанию. \en Default mate direction through the boundary 3.
mutable uint8 directOrderV;///< \ru По второму семейству кривых порядок кривых совпадает. \en Order of the curves coincides by the second set of curves.
bool tesselate; ///< \ru Достраивать ли дополнительные сечения. \en Whether to build additional sections.
private:
/// \ru Конструктор копирования. \en Copy-constructor.
MeshSurfaceValues( const MeshSurfaceValues &, MbRegDuplicate * ireg );
@@ -1628,24 +1693,33 @@ public:
\en Closedness attribute along the u and v directions. \~
\param[in] checkSelfInt - \ru Флаг проверки на самопересечение.
\en Flag of check for self-intersection. \~
\param[in] tesselate - \ru Достраивать ли дополнительные сечения.
\en Whether to build additional sections. \~
\param[in] type0, type1, type2, type3 - \ru Типы сопряжений на границах.
\en Mates types on the boundaries. \~
\param[in] surfaces0, surfaces1, surfaces2, surfaces3 - \ru Соответствующие сопрягаемые поверхности.
\en Corresponding mating surfaces. \~
\param[in] surf0, surf1, surf2, surf3 - \ru Соответствующие сопрягаемые поверхности.
\en Corresponding mating surfaces. \~
\param[in] point - \ru Точка на поверхности. Используется для уточнения.
\en Point on the surface. Used for specializing.\~
\param[in] modify - \ru Флаг модификации кривых по сопряжениям.
\en Flag of curves modification by mates. \~
\param[in] direct0, direct1, direct2, direct3 - \ru Направление поверхности на границе сопряжения.
\en The direction of the surface at the border of mating. \~
\return \ru Статус выполнения.
\en Execution status.
*/
bool Init( const RPArray<MbCurve3D> & curvesU, bool uClosed,
const RPArray<MbCurve3D> & curvesV, bool vClosed,
bool checkSelfInt,
bool tess = false,
const RPArray<MbPolyline3D> * chainsU = NULL,
const RPArray<MbPolyline3D> * chainsV = NULL,
MbeMatingType type0 = trt_Position, MbeMatingType type1 = trt_Position,
MbeMatingType type2 = trt_Position, MbeMatingType type3 = trt_Position,
const MbSurface * surf_0 = NULL, // \ru Сопрягаемые поверхности через curvesU[0] \en Mating surfaces through curvesU[0]
const MbSurface * surf_1 = NULL, // \ru Сопрягаемые поверхности через curvesV[0] \en Mating surfaces through curvesV[0]
const MbSurface * surf_2 = NULL, // \ru Сопрягаемые поверхности через curvesU[maxU] \en Mating surfaces through curvesU[maxU]
const MbSurface * surf_3 = NULL, // \ru Сопрягаемые поверхности через curvesV[maxV] \en Mating surfaces through curvesV[maxV]
const c3d::ConstSurfacesVector * surf0 = NULL, // \ru Сопрягаемые поверхности через curvesU[0] \en Mating surfaces through curvesU[0]
const c3d::ConstSurfacesVector * surf1 = NULL, // \ru Сопрягаемые поверхности через curvesV[0] \en Mating surfaces through curvesV[0]
const c3d::ConstSurfacesVector * surf2 = NULL, // \ru Сопрягаемые поверхности через curvesU[maxU] \en Mating surfaces through curvesU[maxU]
const c3d::ConstSurfacesVector * surf3 = NULL, // \ru Сопрягаемые поверхности через curvesV[maxV] \en Mating surfaces through curvesV[maxV]
const MbPoint3D * pnt = NULL,
bool modify = true,
bool direct0 = true, bool direct1 = true, bool direct2 = true, bool direct3 = true );
@@ -1669,32 +1743,45 @@ public:
\en Checking curve. \~
\param[in] surf - \ru Проверяемая поверхность.
\en Checking surface. \~
\return \ru Признак, что кривая лежит на поверхности.
\en A sign that the curve is on the surface.
*/
bool IsCurveOnSurface( const MbCurve3D & curve, const MbSurface & surf ) const;
/** \brief \ru Сопрягаются ли кривые с поверхностью точках пересечения с otherCurve.
\en Whether the curves are mated with surface in the points of intersection with otherCurve. \~
\details \ru Сопрягаются ли кривые (касательно, по нормали, гладко) с поверхностью в точках пересечения с otherCurve.
\en Whether the curves are mated (tangentially, along the normal, smoothly) with surface in the points of intersection with otherCurve. \~
/** \brief \ru Сопрягаются ли кривые с поверхностью в точках пересечения с borderCurve.
\en Whether the curves are mated with surface in the points of intersection with borderCurve. \~
\details \ru Сопрягаются ли кривые (касательно, по нормали, гладко) с поверхностью в точках пересечения с borderCurve.
\en Whether the curves are mated (tangentially, along the normal, smoothly) with surface in the points of intersection with borderCurve. \~
\param[in] curves - \ru Набор проверяемых кривых.
\en Set of checking curves. \~
\param[in] surf - \ru Поверхность.
\en The surface. \~
\param[in] otherCurve - \ru Кривая на этой поверхности.
\en Curve on this surface. \~
\param[in] borderCurve- \ru Кривая на поверхности.
\en Curve on the surface. \~
\param[in] matSurfaces- \ru Набор поверхностей сопряжения.
\en Set of mating surfaces. \~
\param[out] isTangent - \ru Признак касательного сопряжения.
\en Attribute of the tangent mate. \~
\param[out] isNormal - \ru Признак сопряжения по нормали.
\en Attribute of normal mate. \~
\param[out] isSmooth - \ru Признак гладкого сопряжения.
\en Attribute of the smooth mate. \~
\param[in] uc, vc - \ru Замкнутость поверхности по u и v.
\en Surface closeness by u and v. \~
\return \ru Признак, что кривая лежит на поверхности.
\en A sign that the curve is on the surface.
*/
void AreCurvesMatingToSurface( const RPArray<MbCurve3D> & curves,
const MbSurface & surf,
const MbCurve3D * otherCurve,
bool & isTangent,
bool & isNormal,
bool & isSmooth ) const;
static bool AreCurvesMatingToSurface( const RPArray<MbCurve3D> & curves,
const MbCurve3D * borderCurve,
const c3d::SurfacesVector & matSurfaces,
bool & isTangent,
bool & isNormal,
bool & isSmooth,
bool uc,
bool vc );
/// \ru Сопрягаются ли кривые с поверхностью в точках пересечения с поверхностной кривой (borderCurve).
/// \en Whether the curves are mated with surface in the points of intersection with the surface curve (borderCurve).
static bool AreCurvesMatingToSurface( const RPArray<MbCurve3D> & curves, const MbCurve3D * borderCurve,
bool & isTangent, bool & isNormal, bool & isSmooth, bool uc, bool vc );
/// \ru Получить точки скрещивания-пересечения кривой с семейством кривых. \en Get crossing-intersection points of curves with the set of curves.
bool GetPointsOfCrossing( const MbCurve3D & curve, const RPArray<MbCurve3D> & otherCurves,
@@ -1709,9 +1796,9 @@ public:
/// \ru Получить тип сопряжения на границе с номером i. \en Get i-th mate type on the boundary.
MbeMatingType GetTransitType( ptrdiff_t i ) const;
/// \ru Получить поверхность сопряжения на границе с номером i. \en Get i-th mate surface on the boundary.
const MbSurface * GetSurface( size_t i ) const;
void GetSurface( size_t i, c3d::ConstSurfacesVector & surfaces ) const;
/// \ru Получить поверхность сопряжения на границе с номером i. \en Get i-th mate surface on the boundary.
MbSurface * SetSurface( size_t i );
void SetSurface( size_t i, c3d::SurfacesVector & surfaces );
/// \ru Получить направление сопряжения на границе с номером i. \en Get i-th mate direction on the boundary.
bool IsDefaultDirection( size_t i ) const;
@@ -1811,17 +1898,34 @@ public:
/// \ru Повернуть кривые вокруг оси на заданный угол. \en Rotate curves at a given angle around an axis.
void Rotate ( const MbAxis3D &, double angle, MbRegTransform * ireg );
/// \ru Привести кривые к поверхностной форме (кривые на поверхности) \en Convert curves to the surface form (curves on the surface)
bool TransformCurves();
bool TransformCurves( );
/// \ru Привести кривые к поверхностной форме (кривые на поверхности) \en Convert curves to the surface form (curves on the surface)
bool TransformForCompositeSurfaceMating();
/// \ru Обеспечить непрерывность длины первой производной для кривых семейства dirU.
/// \en Ensure continuity of the length of the first derivative for the curves of the dirU family.
bool SetContinuousDerivativeLength( bool dirU, bool & smooth, VERSION version );
/** \} */
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const MeshSurfaceValues &, double accuracy ) const;
/// \ru Набор граничных поверхность пуст? \en Whether the set of boundary surfaces is empty?
bool AreSurfacesEmpty() const { return (surface0 == NULL && surface1 == NULL && surface2 == NULL && surface3 == NULL); }
/// \ru Нужно ли проверять самопересечения? \en Whether it is necessary to check self-intersections?
bool CheckSelfInt() const { return checkSelfInt; }
///< \ru Достраивать ли дополнительные сечения. \en Whether to build additional sections.
bool IsTesselate() const { return tesselate; }
/// \ru Получить поверхность сопряжения к граничной кривой по параметру на кривой.
/// \en Get the mating surface to the border curve by the curve parameter.
static const MbSurface *
GetMatingSurface( const MbCurve3D * borderCurve, double param );
/// \ru Получить поверхность сопряжения к граничной кривой в точке пересечения с трансверсальной кривой.
/// \en Get the mating surface to the border curve at the intersection with the transversal curve.
static const MbSurface *
GetMatingSurface( const MbCurve3D * borderCurve, const MbCurve3D * transCurve );
/// \ru Получить поверхностную кривую в указанной точке на границе сопряжения.
/// \en Get a surface curve at a specified point on the mating border.
static bool GetSurfaceCurve( const MbCurve3D * borderCurve, double param, const MbSurfaceCurve *& sCurve, double & t );
/// \ru Является ли кривая поверхностной по типу. \en Is the curve surface in type.
static bool IsSurfaceCurveType( const MbCurve3D * borderCurve );
private:
void AddRefCurves(); // \ru Увеличить счетчик ссылок у кривых. \en Increase the reference count of curves.
void AddRefPoint(); // \ru Увеличить счетчик ссылок у точки. \en Increase the reference count of point.
@@ -1832,10 +1936,16 @@ private:
// \ru Определить порядок следования кривых по второму направлению. \en Determine the order of curves along the second direction.
void CalculateOrderV() const;
// \ru Привести кривую к типу поверхностной кривой или к контура из SurfaceCurve. \en Convert the curve to type of surface curve or contour from SurfaceCurve.
bool TransformToSurfaceCurve( const MbCurve3D & initCurve,
static bool TransformToSurfaceCurve( const MbCurve3D & initCurve,
bool isWhole,
const MbSurface & surface,
const RPArray<MbCurve3D> & constrCurves,
MbSurfaceCurve *& resCurve ) const;
MbSurfaceCurve *& resCurve );
// \ru Привести кривую к типу поверхностной кривой или к контура из SurfaceCurve. \en Convert the curve to type of surface curve or contour from SurfaceCurve.
static bool TransformToSurfaceCurve( const MbCurve3D & initCurve,
const c3d::SurfacesVector & surfaces,
const RPArray<MbCurve3D> & constrCurves,
MbCurve3D *& resCurve );
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MeshSurfaceValues, MATH_FUNC_EX )
OBVIOUS_PRIVATE_COPY( MeshSurfaceValues )
@@ -2018,7 +2128,7 @@ public:
enum ExtensionWay {
ew_distance = -2, ///< \ru Продолжить на расстояние. \en Prolong on the distance.
ew_vertex = -1, ///< \ru Продолжить до вершины. \en Prolong to the vertex.
ew_surface = 0, ///< \ru Продолжить до поверхности. \en Prolong to the surface.
ew_shell = 0, ///< \ru Продолжить до оболочки. \en Prolong to the shell.
};
/** \brief \ru Способы построения боковых рёбер.
\en Methods of construction of the lateral edges. \~
@@ -2040,7 +2150,7 @@ public:
bool prolong; ///< \ru Продолжить по гладко стыкующимся рёбрам. \en Prolong along smoothly mating edges.
bool combine; ///< \ru Объединять грани при возможности. \en Combine faces if it is possible.
private:
MbFaceShell * shell; ///< \ru Оболочка. \en A shell.
MbFaceShell * shell; ///< \ru Оболочка, до которой продляются грани. \en A shell to which the faces are extended.
MbItemIndex faceIndex; ///< \ru Номер грани в оболочке. \en The index of face in the shell.
public:
@@ -2095,7 +2205,7 @@ public:
\param[in] s - \ru Тело для замены оболочки.
\en Solid for replacement of shell. \~
*/
void InitBySurface ( ExtensionType t, LateralKind k, const MbFace * f, const MbSolid * s );
void InitByShell ( ExtensionType t, LateralKind k, const MbFace * f, const MbSolid * s );
/// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix.
void Transform( const MbMatrix3D & matr, MbRegTransform * ireg = NULL );
@@ -2392,47 +2502,70 @@ public:
*/
// ---
struct MATH_CLASS MedianShellValues {
public:
/** \brief \ru Тип расчета радиуса скругления между гранями срединной оболочки.
\en Type of fillet radius calculation between faces of median shell. \~
\details \ru Флаг можно установить через вызов MedianShellValues::SetFilletType().
\en The flag can be set by calling MedianShellValues::SetFilletType(). \~
*/
enum FilletType {
tf_none, ///< \ru Не определено. \en Undefined.
tf_internal, ///< \ru По внутренней грани скругления. \en Along the tangent.
tf_external, ///< \ru По внешней грани скругления. \en Along the normal.
tf_average ///< \ru По среднему значению. \en Plane patch.
};
public:
double position; ///< \ru Параметр смещения срединной оболочки относительно первой грани из пары. По умолчанию равен 50% расстояния между гранями. \en Parameter of shift the median surface from first face in faces pair. By default is 50% from distance between faces in pair.
double dmin; ///< \ru Минимальный параметр эквидистантности. \en Minimal equidistation value.
double dmax; ///< \ru Максимальный параметр эквидистантности. \en Maximal equidistation value.
FilletType filletType;
double position; ///< \ru Параметр смещения срединной оболочки относительно первой грани из пары. По умолчанию равен 50% расстояния между гранями. \en Parameter of shift the median surface from first face in faces pair. By default is 50% from distance between faces in pair.
double dmin; ///< \ru Минимальный параметр эквидистантности. \en Minimal equidistation value.
double dmax; ///< \ru Максимальный параметр эквидистантности. \en Maximal equidistation value.
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MedianShellValues()
: position ( 0.5 )
, dmin ( 0.0 )
, dmax ( 0.0 )
: filletType ( tf_average )
, position ( 0.5 )
, dmin ( 0.0 )
, dmax ( 0.0 )
{}
/// \ru Конструктор копирования. \en Copy-constructor.
MedianShellValues( const MedianShellValues & other )
: position ( other.position )
, dmin ( other.dmin )
, dmax ( other.dmax )
: filletType ( other.filletType )
, position ( other.position )
, dmin ( other.dmin )
, dmax ( other.dmax )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MedianShellValues( double pos, double d1, double d2 )
: position ( pos )
, dmin ( d1 )
, dmax ( d2 )
: filletType( tf_average )
, position ( pos )
, dmin ( d1 )
, dmax ( d2 )
{}
public:
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const MedianShellValues & obj, double accuracy ) const
{
if ( (::fabs(dmin - obj.dmin) < accuracy) &&
if ( filletType == obj.filletType &&
(::fabs(dmin - obj.dmin) < accuracy) &&
(::fabs(dmax - obj.dmax) < accuracy) &&
(::fabs( position - obj.position) < accuracy ) )
{
(::fabs(position - obj.position) < accuracy) )
return true;
}
return false;
}
/// \ru Выдать тип заплатки. \en Get type of patch.
FilletType GetType() const { return filletType; }
/// \ru Выдать тип заплатки для изменения. \en Get type of patch for changing.
FilletType & SetType() { return filletType; }
public:
/// \ru Оператор присваивания. \en Assignment operator.
MedianShellValues & operator = ( const MedianShellValues & other )
{
filletType = other.filletType;
position = other.position;
dmin = other.dmin;
dmax = other.dmax;
@@ -2468,6 +2601,12 @@ public:
facePairs = pairs;
distances.resize( pairs.size() );
}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MedianShellFaces( const MedianShellFaces & other )
{
facePairs = other.facePairs;
distances = other.distances;
}
/// \ru Деструктор. \en Destructor.
~MedianShellFaces() {}
@@ -2489,7 +2628,7 @@ public:
distances.push_back( dist );
}
/// \ru Получить пару граней по индексу. \en Get pair of faces by index.
const c3d::ItemIndexPair & _GetFacePair( size_t index ) const { return facePairs[index];}
const c3d::ItemIndexPair & _GetFacePair( size_t index ) const { return facePairs[index]; }
/// \ru Удалить пару граней из набора. \en Remove pair of faces from set.
void RemovePairByIndex( size_t index )
{
@@ -2500,6 +2639,8 @@ public:
const double & _GetDistance( size_t index ) const { return distances[index]; }
/// \ru Установить расстояние между гранями. \en Set distance between faces.
void _SetDistance( size_t index, double value ) { distances[index] = value; }
/// \ru Инвертировать пару граней в наборе. \en Inverse face pair.
void Inverse( size_t index ) { std::swap(facePairs[index].first, facePairs[index].second); }
/// \ru Вернуть количество пар граней в наборе. \en Get count of pairs in given set.
size_t Count() const { return facePairs.size(); }
/// \ru Оператор присваивания. \en Assignment operator.
@@ -2510,27 +2651,105 @@ public:
}
/// \ru Очистка текущего набора. \en Clear current faces set.
void Clear() { facePairs.clear(); distances.clear(); }
/// \ru Проверить наличие пары в наборе. \en Check if pair already in set.
size_t IsExist( const MbItemIndex & ind, size_t start_pos, size_t end_pos, bool & first ) const;
KNOWN_OBJECTS_RW_REF_OPERATORS( MedianShellFaces ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры сшивки.
\en Stitch parameters. \~
\details \ru Параметры сшивки оболочек. \n
\en Shells stitch parameters. \n \~
\ingroup Build_Parameters
*/
// ---
struct MATH_CLASS MbShellStitchParams {
private:
MbSNameMaker nameMaker; ///< \ru Именователь операции. \en An object defining names generation in the operation.
double stitchAccuracy; ///< \ru Точность сшивки (точность поиска парных ребер). \en Stitching accuracy (search accuracy of edges pairs).
bool formSolidBody; ///< \ru Флаг формирования твердого тела из результирующей оболочки. \en Whether to form a solid solid from the resultant shell.
bool mergeEdges; ///< \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
private:
MbShellStitchParams();
public:
/** \brief \ru Конструктор параметров сшивки оболочек.
\en Stitch faces of several solids into single solid. \~
\details \ru Сшить стыкующиеся друг с другом грани нескольких тел в одно тело. Ориентация граней может быть изменена. \n
\en Stitch faces of several solids with coincident edges into single solid. The faces orientation can be changed. \n \~
\param[in] operNames - \ru Именователь операции.
\en An object defining names generation in the operation. \~
\param[in] formBody - \ru Флаг формирования твердого тела из результирующей оболочки.
\en Whether to form a solid solid from the resultant shell. \~
\param[in] sewingAccuracy - \ru Точность сшивки (точность поиска парных ребер).
\en Stitching accuracy (search accuracy of edges pairs). \~
\param[in] edgesMerging - \ru Сливать подобные ребра (true).
\en Whether to merge similar edges (true). \~
*/
MbShellStitchParams( const MbSNameMaker & operNames, bool formBody, double sewingAccuracy, bool edgesMerging = true )
: nameMaker ( operNames )
, stitchAccuracy( sewingAccuracy )
, formSolidBody ( formBody )
, mergeEdges ( edgesMerging )
{}
~MbShellStitchParams()
{}
public:
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return nameMaker; }
/// \ru Получить точность поиска парных ребер. \en Get search accuracy of edges pairs.
double GetStitchAccuracy() const { return stitchAccuracy; }
/// \ru Пытаться формировать твердое тело из результирующей оболочки.. \en Whether to try forming a solid solid from the resultant shell.
bool TryBodyForming() const { return formSolidBody; }
/// \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
bool PerformEdgesMerging() const { return mergeEdges; }
OBVIOUS_PRIVATE_COPY ( MbShellStitchParams )
};
//------------------------------------------------------------------------------
/// \ru Типы продления секущих поверхностей. \en Prolongation types of cutter surfaces.
// ---
enum MbeSurfaceProlongType {
cspt_None = 0x00, // 0000 ///< \ru Не продлевать. \en Don't prolong.
cspt_Planar = 0x01, // 0001 ///< \ru Плоские поверхности. \en Planar surfaces.
cspt_RevolutionAxis = 0x02, // 0010 ///< \ru Поверхности вращения (вдоль оси). \en Revolution surfaces (along axis).
cspt_RevolutionAngle = 0x04, // 0100 ///< \ru Поверхности вращения (по углу). \en Revolution surfaces (by angle).
cspt_Revolution = 0x06, // 0110 ///< \ru Поверхности вращения. \en Revolution surfaces.
cspt_None = 0x00, // 00000 ///< \ru Не продлевать. \en Don't prolong.
cspt_Planar = 0x01, // 00001 ///< \ru Плоские поверхности. \en Planar surfaces.
cspt_RevolutionAxis = 0x02, // 00010 ///< \ru Поверхности вращения (вдоль оси). \en Revolution surfaces (along axis).
cspt_RevolutionAngle = 0x04, // 00100 ///< \ru Поверхности вращения (по углу). \en Revolution surfaces (by angle).
cspt_Revolution = 0x06, // 00110 ///< \ru Поверхности вращения. \en Revolution surfaces.
cspt_ExtrusionGeneratrix = 0x08, // 01000 ///< \ru Поверхности выдавливания (по образующей). \en Extrusion surfaces (by generatrix).
cspt_ExtrusionDistance = 0x10, // 10000 ///< \ru Поверхности выдавливания (по расстоянию). \en Extrusion surfaces (by distance).
cspt_Extrusion = 0x18, // 11000 ///< \ru Поверхности выдавливания. \en Extrusion surfaces.
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры операции резки оболочки.
\en Shell cutting operation parameters. \~
\details \ru Параметры операции резки оболочки. \n
\en Shell cutting operation parameters. \n \~
Предполагается взаимоисключающее состояние флагов при их активном состоянии в #MbShellCuttingParams : \n
1. #cspt_Planar - продлять или нет грани на основе плоскости; \n
2. #cspt_Revolution - продлять или нет поверхности, имеющие ось вращения (у которых функция поверхности GetCylinderAxis возвращает true ),
причем возможно раздельное управление : \n
#cspt_RevolutionAngle - замкнуть поверхность по углу, \n
#cspt_RevolutionAxis - продлить поверхность вдоль оси так, чтобы включить габарит тела, если это возможно); \n
3. #cspt_Extrusion - продлять или нет поверхности, являющиеся поверхностями выдавливания (поверхность выдавливания, цилиндрическая поверхность),
причем возможно раздельное управление : \n
#cspt_ExtrusionGeneratrix - продлить вдоль образующей для включения габарита тела или замкнуть, если образующая периодична (дуга), \n
#cspt_ExtrusionDistance - продлить поверхность вдоль направления выдавливания так, чтобы включить габарит тела, если это возможно). \n
\en Shell cutting operation parameters. \n
The mutually exclusive state of flags is assumed when they are active in #MbShellCuttingParams: \n
1. #cspt_Planar - extend or not the face based on the plane; \n
2. #cspt_Revolution - extend or not surfaces having a rotation axis (for which the GetCylinderAxis surface function returns true),
moreover, separate control is possible: \n
#cspt_RevolutionAngle - close the surface by angle, \n
#cspt_RevolutionAxis - extend the surface along the axis so as to embrace the body, if it's possible; \n
3. #cspt_Extrusion - to extend or not surfaces that are extrusion surfaces (extrusion surface, cylindrical surface),
moreover, separate control is possible: \n
#cspt_ExtrusionGeneratrix - extend along the generatrix to cover the body or close if the generatrix is periodic (like an arc), \n
#cspt_ExtrusionDistance - extend the surface along the extrusion direction so as to embrace the body, if it's possible. \n \~
\ingroup Build_Parameters
*/
// ---
@@ -2788,7 +3007,7 @@ public:
const MbSNameMaker & snMaker )
{
if ( cutterData.InitPlaneContour( place, dir, contour, sameContour ) ) {
nameMaker.SetName( snMaker, true );
nameMaker.SetNameMaker( snMaker, true );
booleanFlags.InitCutting( cutAsClosed );
booleanFlags.SetMerging( mergingFlags );
SetRetainedPart( part );
@@ -2840,7 +3059,7 @@ public:
const MbSNameMaker & snMaker )
{
if ( cutterData.InitSurfaces( surface, sameSurface ) ) {
nameMaker.SetName( snMaker, true );
nameMaker.SetNameMaker( snMaker, true );
booleanFlags.InitCutting( cutAsClosed );
booleanFlags.SetMerging( mergingFlags );
SetRetainedPart( part );
@@ -2890,7 +3109,7 @@ public:
const MbSNameMaker & snMaker )
{
if ( cutterData.InitSolid( solid, sameSolid, true ) ) {
nameMaker.SetName( snMaker, true );
nameMaker.SetNameMaker( snMaker, true );
booleanFlags.InitCutting( cutAsClosed );
booleanFlags.SetMerging( mergingFlags );
SetRetainedPart( part );
@@ -2960,7 +3179,7 @@ public:
/// \ru Получить тип продления режущей поверхности. \en Get cutter surface prolong type.
const ProlongState & GetProlongState() const { return prolongState; }
/// \ru Получить тип продления режущей поверхности. \en Get cutter surface prolong type.
/// \ru Сбросить тип продления режущей поверхности. \en Reset cutter surface prolong type.
void ResetProlongState() { prolongState.Reset(); }
/// \ru Добавить тип продления режущей поверхности. \en Add cutter surface prolong type.
void SetSurfaceProlongType( MbeSurfaceProlongType pt ) { prolongState.SetActiveType( true, pt ); }