- C3d aggiornamento librerie ( 118044).
This commit is contained in:
SaraP
2025-08-28 14:47:28 +02:00
parent daccdfc398
commit f05795ffff
53 changed files with 1756 additions and 520 deletions
+309 -10
View File
@@ -2203,6 +2203,8 @@ private:
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.
bool outDirs[4]; /// \ru Направления сопряжений для случая смены типа автопределения направления для сохранения формы ППСК.
/// \en Mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
bool autoDirection; ///< \ru Тип автоопределения направления \en Type of automatic direction detection
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.
@@ -2399,6 +2401,8 @@ public:
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;
/// \ru Установить направление сопряжения на границе с номером i. \en Set mate direction at the i-th boundary.
void SetDefaultDirection( size_t i, bool fl );
/// \ru Замкнутость по U направлению. \en Closedness along U direction.
bool GetUClosed() const { return uClosed; }
@@ -2528,6 +2532,12 @@ public:
void SetAutoDirection( bool fl ) { autoDirection = fl; }
/// \ru Получить тип автоопределения направления \en Get the auto-detect direction type.
bool GetAutoDirection() const { return autoDirection; }
// \ru Установить направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Set the mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
void SetOutDirection( size_t bnd, bool outD ) { outDirs[bnd > 3 ? 3 : bnd] = outD; }
// \ru Получить направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Get the mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
bool GetOutDirection( size_t bnd ) const { return outDirs[bnd > 3 ? 3 : bnd]; }
/// \ru Получить поверхность сопряжения к граничной кривой по параметру на кривой.
/// \en Get the mating surface to the border curve by the curve parameter.
@@ -2573,6 +2583,60 @@ OBVIOUS_PRIVATE_COPY( MeshSurfaceValues )
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты построения поверхности по сети кривых.
\en Results of construction of a shell by mesh of curves. \~
\details \ru Результаты построения поверхности по сети кривых.
\en Results of construction of a shell by mesh of curves. \~
\ingroup Shell_Building_Parameters
*/
// ---
class MATH_CLASS MbMeshShellResults : public MbOperationResults {
private:
c3d::SolidSPtr _solid; // \ru Оболочка \en Result shell.
bool _outDirs[4]; // \ru Направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Mating direction in case of changing the type of automatic direction detection to maintain the surface shape.
public:
MbMeshShellResults()
: MbOperationResults()
, _solid ()
{
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = false;
}
/// \ru Конструктор копирования. \en Copy-constructor.
MbMeshShellResults( const MbMeshShellResults & other )
: MbOperationResults( other )
, _solid ( other._solid )
{
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = other._outDirs[i];
}
~MbMeshShellResults() {}
/// \ru Оператор присваивания. \en Assignment operator.
MbMeshShellResults & operator = ( const MbMeshShellResults & other ) {
MbOperationResults::operator =( static_cast<const MbOperationResults &>(other) );
_solid = other._solid;
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = other._outDirs[i];
return *this;
}
/// \ru Получить результирующее тело. \en Get resulting solid.
c3d::SolidSPtr GetResultSolid() const { return _solid; }
/// \ru Получить результирующее тело. \en Get resulting solid.
c3d::SolidSPtr & SetResultSolid() { return _solid; }
// \ru Получить направления сопряжений для случая смены типа автопределения направления для сохранения форма ППСК
// \en Get the mating direction in case of changing the type of automatic direction detection to preserve the surface shape.
bool GetOutDirection( size_t bnd ) const { return _outDirs[bnd > 3 ? 3 : bnd]; }
/// \ru Функция инициализации. \en Initialization function.
void Init ( MbSolid & s, const bool (&dirFlags)[4] ){
_solid = &s;
for( size_t i = 0; i < 4; i++ )
_outDirs[i] = dirFlags[i];
}
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры построения поверхности по сети кривых.
\en Parameters for creating the shell by mesh of curves. \~
@@ -2637,10 +2701,10 @@ private:
MbCurve3D * curve1; ///< \ru Вторая кривая. \en The second curve.
SArray<double> breaks0; ///< \ru Параметры разбиения первой кривой curve0. \en Splitting parameters of the first curve0 curve.
SArray<double> breaks1; ///< \ru Параметры разбиения второй кривой curve1. \en Splitting parameters of the second curve1 curve.
bool joinByVertices; ///< \ru Соединять контура с одинаковым количеством сегментов через вершины. \en Join contour with the same count of segments through vertices.
bool joinByVertices; ///< \ru Соединять контура с одинаковым количеством сегментов через вершины. \en Join contours with the same count of segments through vertices.
bool checkSelfInt; ///< \ru Искать самопересечения. \en Find self-intersections.
bool simplifyFaces; ///< \ru Упрощать грани. \en SimplifyFaces.
bool proportional; ///< \ru Пропорциональная натуральной параметризация кривых. \en Proportional to the natural parameterization of curves.
bool simplifyFaces; ///< \ru Упрощать грани. \en Simplify faces.
bool proportional; ///< \ru Пропорциональная натуральной параметризация кривых. \en Parameterization of curves is proportional to the natural.
double mismatchMax; ///< \ru Допустимое несовпадение противолежащих точек стыковки сегментов. \en Permissible mismatch of opposite points of connecting segments.
bool segmentSplit; ///< \ru Разделять оболочку на грани по сегментам контуров. \en Divide the shell into faces by contour segments.
@@ -4309,6 +4373,194 @@ OBVIOUS_PRIVATE_COPY ( MbShellCuttingParams )
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры операции усечения оболочки.
\en Shell truncating operation parameters. \~
\details \ru Параметры операции усечения оболочки. \n
\en Shell truncating operation parameters. \n \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbTruncateShellParams : public MbPrecision {
private:
c3d::IndicesVector _selIndices; ///< \ru Номера выбранных граней (если массив пуст, то вся оболочка). \en The numbers of selected faces (if the array is empty, the whole shell is selected).
c3d::SpaceItemsSPtrVector _truncatingItems; ///< \ru Усекающие объекты ( кривые, поверхности или тела ). \en Truncating objects ( curves, surfaces or solids ).
c3d::BoolVector _truncatingOrients; ///< \ru Ориентации усекающих объектов. \en The truncating objects orientations.
MbeCopyMode _truncatingCopyMode; ///< \ru Режим копирования усекающих оболочек. \en Whether to copy the truncating shells.
bool _truncatingSplitMode; ///< \ru Кривые используются как линии разъема. \en The curves are used as parting lines.
MbMergingFlags _mergeFlags; ///< \ru Флаги слияния элементов оболочки. \en Control flags of shell items merging.
c3d::SNameMakerSPtr _nameMaker; ///< \ru Именователь. \en An object for naming the new objects.
private:
MbTruncateShellParams(); /// \ru Конструктор по умолчанию. Запрещен. \en. Default constructor. Forbidden.
public:
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по набору граней, усекающим объектам и их ориентациям. \n
\en Constructor by set of curves and object defining names generation in the operation. \n \~
\param[in] selIndices - \ru Номера выбранных граней.
\en The numbers of selected faces. \~
\param[in] truncatingItems - \ru Усекающие объекты ( кривые, поверхности или тела ).
\en Truncating objects ( curves, surfaces or solids ). \~
\param[in] truncatingOrients - \ru Ориентации усекающих объектов.
\en The truncating objects orientations. \~
\param[in] truncatingCopyMode - \ru Режим копирования усекающих оболочек.
\en Whether to copy the truncating shells. \~
\param[in] truncatingSplitMode - \ru Кривые используются как линии разъема.
\en The curves are used as parting lines. \~
\param[in] mergeFlags - \ru Флаги слияния элементов оболочки.
\en Control flags of shell items merging. \~
\param[in] nameMaker - \ru Именователь.
\en An object for naming the new objects. \~
*/
template<class IndicesVec, class ItemVec, class BoolVec>
MbTruncateShellParams( const IndicesVec & selIndices,
ItemVec & truncatingItems,
const BoolVec & truncatingOrients,
MbeCopyMode truncatingCopyMode,
bool truncatingSplitMode,
MbMergingFlags mergeFlags,
const MbSNameMaker & nameMaker );
/// \ru Деструктор. \en Destructor. \~
~MbTruncateShellParams() {};
public:
/// \ru Получить номера выбранных граней. \en Get the numbers of selected faces.
void GetIndices( c3d::IndicesVector & indices ) const { indices.assign( _selIndices.begin(), _selIndices.end() ); }
/// \ru Получить усекающие объекты. \en Get the truncating objects.
void GetTruncateItems( c3d::SpaceItemsSPtrVector & items ) const { items.assign( _truncatingItems.begin(), _truncatingItems.end() ); }
/// \ru Получить ориентации усекающих объектов. \en Get the truncating objects orientation.
void GetTruncateOrients( c3d::BoolVector & orients ) const { orients.assign( _truncatingOrients.begin(), _truncatingOrients.end() ); }
/// \ru Режим копирования усекающих оболочек. \en Whether to copy the truncating shells.
MbeCopyMode GetTruncateCopyMode() const { return _truncatingCopyMode; }
/// \ru Кривые используются как линии разъема. \en The curves are used as parting lines.
bool GetTruncateSplitMode() const { return _truncatingSplitMode; }
/// \ru Флаги слияния элементов оболочки. \en Control flags of shell items merging.
const MbMergingFlags & GetMerging() const { return _mergeFlags; }
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_nameMaker; }
private:
/// \ru Инициализация параметров операции усечения. \en The initialization of truncating operation parameters.
template<class IndicesVec, class ItemVec, class BoolVec>
void InitTruncateParams( const IndicesVec & indices, ItemVec & items, const BoolVec & orients );
OBVIOUS_PRIVATE_COPY( MbTruncateShellParams )
};
//------------------------------------------------------------------------------
// \ru Шаблонный конструктор. \en The Template constructor.
// ---
template<class IndicesVec, class ItemVec, class BoolVec >
MbTruncateShellParams::MbTruncateShellParams( const IndicesVec & indices,
ItemVec & items,
const BoolVec & orients,
MbeCopyMode copyMode,
bool splitMode,
MbMergingFlags mergeFlags,
const MbSNameMaker & names )
: MbPrecision()
, _selIndices( )
, _truncatingItems( )
, _truncatingOrients( )
, _truncatingCopyMode( copyMode )
, _truncatingSplitMode( splitMode )
, _mergeFlags( mergeFlags )
, _nameMaker ( &(names.Duplicate()) )
{
InitTruncateParams( indices, items, orients );
}
//------------------------------------------------------------------------------
// \ru Инициализация параметров операции усечения. \en The initialization of truncating operation parameters.
// ---
template<class IndicesVec, class ItemVec, class BoolVec>
void MbTruncateShellParams::InitTruncateParams( const IndicesVec & indices, ItemVec & items, const BoolVec & orients )
{
const size_t indicesCnt = indices.size();
const size_t itemsCnt = items.size();
const size_t orientsCnt = orients.size();
_truncatingItems.clear();
_truncatingItems.reserve( itemsCnt );
for ( size_t i = 0; i < itemsCnt; ++i ) {
MbSpaceItem * item = items[i];
if ( item != nullptr )
_truncatingItems.emplace_back( item );
}
_truncatingOrients.clear();
_truncatingOrients.reserve( orientsCnt );
for ( size_t i = 0; i < orientsCnt; ++i )
_truncatingOrients.push_back( orients[i] );
_selIndices.clear();
_selIndices.reserve( indicesCnt );
for ( size_t i = 0; i < indicesCnt; ++i )
_selIndices.push_back( indices[i] );
}
//------------------------------------------------------------------------------
/** \brief \ru Результаты операции усечения оболочки.
\en Results of shell truncating operation. \~
\details \ru Результаты операции усечения оболочки.
\en Results of shell truncating operation. \~
\ingroup ingroup Shell_Building_Parameters
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MbTruncateShellResults {
private:
c3d::SolidSPtr _solid; ///< \ru Результирующее тело. \en The resulting solid.
MbPlacement3D _resultPlace; ///< \ru Фантомное направление усечения. \en A phantom direction of truncation.
public:
/// \ru Конструктор. \en Constructor.
MbTruncateShellResults()
: _solid()
, _resultPlace()
{}
/// \ru Деструктор. \en Destructor.
~MbTruncateShellResults() {}
/// \ru Конструктор копирования. \en Copy-constructor.
MbTruncateShellResults( const MbTruncateShellResults & other )
: _solid( other._solid )
, _resultPlace( other._resultPlace )
{
}
/// \ru Оператор присваивания. \en Assignment operator.
MbTruncateShellResults & operator = ( const MbTruncateShellResults & other ) {
_solid = other._solid;
_resultPlace = other._resultPlace;
return *this;
}
public:
/// \ru Функция инициализации. \en Initialization function.
void Init( const c3d::SolidSPtr & solid, const MbPlacement3D & resultPlace ) {
_solid = solid;
_resultPlace = resultPlace;
}
/// \ru Получить результирующее тело. \en Get resulting solid.
c3d::SolidSPtr GetResultSolid() const { return _solid; }
/// \ru Получить фантомное направление усечения. \en Get phantom direction of truncation.
const MbPlacement3D & GetResultPlace() const { return _resultPlace; }
/// \ru Отцепить результирующее тело. \en Detach resulting solid.
MbSolid * DetachSolid() { return _solid.detach(); }
};
//------------------------------------------------------------------------------
// \ru Установить требование по оставляемой части. \en Set retained part demand.
// ---
@@ -4735,6 +4987,7 @@ private:
MbSNameMaker _names; ///< \ru Именователь. \en An object defining names generation in the operation.
SimpleName _name; ///< \ru Идентификатор. \en An identifier.
private:
MbLoftedCurvesShellParams(); /// \ru Конструктор по умолчанию. Запрещен. \en. Default constructor. Forbidden.
public:
@@ -5573,7 +5826,7 @@ public:
\ingroup Shell_Building_Parameters
*/
// ---
class MATH_CLASS MbRuledShellParams
class MATH_CLASS MbRuledShellParams : public MbPrecision
{
private:
RuledSurfaceValues _pars; ///< \ru Параметры операции.\en The operation parameters. \~
@@ -5607,6 +5860,8 @@ public:
void SetPhantom ( bool isPhantom ) { _isPhantom = isPhantom; }
/// \ru Получить параметры операции. \en Get the operation parameters. \~
const RuledSurfaceValues & GetParams() const { return _pars; }
/// \ru Изменить параметры операции. \en Change the operation parameters. \~
RuledSurfaceValues & SetParams() { return _pars; }
/// \ru Оператор копирования. \en Copy operator. \~
void operator = ( const MbRuledShellParams & other );
@@ -6827,9 +7082,9 @@ public:
class MATH_CLASS MbJoinShellParams
{
protected:
c3d::EdgesSPtrVector _edges1; ///< \ru Первый набор ребер. \en The first set of edges. \~
c3d::ConstEdgesSPtrVector _edges1; ///< \ru Первый набор ребер. \en The first set of edges. \~
c3d::BoolVector _orients1; ///< \ru Ориентация рёбер первого набора. \en Orientation of edges from the first set. \~
c3d::EdgesSPtrVector _edges2; ///< \ru Второй набор ребер. \en The second set of edges. \~
c3d::ConstEdgesSPtrVector _edges2; ///< \ru Второй набор ребер. \en The second set of edges. \~
c3d::BoolVector _orients2; ///< \ru Ориентация рёбер второго набора. \en Orientation of edges of the second set. \~
MbMatrix3D _matr1; ///< \ru Матрица преобразования рёбер первого набора. \en Transformation matrix of edges from the first set. \~
MbMatrix3D _matr2; ///< \ru Матрица преобразования рёбер второго набора. \en Transformation matrix of edges from the second set. \~
@@ -6863,13 +7118,14 @@ public:
\param[in] isPhantom - \ru Режим создания фантома.
\en Create in the phantom mode. \~
*/
DEPRECATE_DECLARE_REPLACE ( Constructor with ConstEdgesSPtrVector )
MbJoinShellParams( const c3d::EdgesSPtrVector & edges1, const c3d::BoolVector & orients1,
const c3d::EdgesSPtrVector & edges2, const c3d::BoolVector & orients2,
const MbMatrix3D & matr1, const MbMatrix3D & matr2, const JoinSurfaceValues & parameters,
const MbSNameMaker & names, bool isPhantom = false )
: _edges1 ( edges1 )
: _edges1 ( )
, _orients1 ( orients1 )
, _edges2 ( edges2 )
, _edges2 ( )
, _orients2 ( orients2 )
, _matr1 ( matr1 )
, _matr2 ( matr2 )
@@ -6878,6 +7134,49 @@ public:
, _isPhantom ( isPhantom )
, _curve1 ( )
, _curve2 ( )
{
_edges1.assign( edges1.begin(), edges1.end() );
_edges2.assign( edges2.begin(), edges2.end() );
}
/** \brief \ru Конструктор параметров оболочки соединения.
\en A shell of join parameter constructor. \~
\details \ru Конструктор параметров оболочки соединения по двум наборам ребер.
\en Constructor of parameters for creating a shell of join given two sets of edges. \~
\param[in] edges1 - \ru Первый набор ребер.
\en The first set of edges. \~
\param[in] orients1 - \ru Ориентации ребер первого набора.
\en The edges senses in the first set. \~
\param[in] edges2 - \ru Второй набор ребер.
\en The second set of edges. \~
\param[in] orients2 - \ru Ориентации ребер второго набора.
\en The edges senses in the second set. \~
\param[in] matr1 - \ru Матрица преобразования первого набора ребер в единую систему координат.
\en The matrix of transformation of the first set of edges to the common coordinate system. \~
\param[in] matr2 - \ru Матрица преобразования второго набора ребер в единую систему координат.
\en The matrix of transformation of the second set of edges to the common coordinate system. \~
\param[in] parameters - \ru Параметры операции.
\en The operation parameters. \~
\param[in] names - \ru Именователь операции.
\en An object for naming the new objects. \~
\param[in] isPhantom - \ru Режим создания фантома.
\en Create in the phantom mode. \~
*/
MbJoinShellParams( const c3d::ConstEdgesSPtrVector & edges1, const c3d::BoolVector & orients1,
const c3d::ConstEdgesSPtrVector & edges2, const c3d::BoolVector & orients2,
const MbMatrix3D & matr1, const MbMatrix3D & matr2, const JoinSurfaceValues & parameters,
const MbSNameMaker & names, bool isPhantom = false )
: _edges1 ( edges1 )
, _orients1 ( orients1 )
, _edges2 ( edges2 )
, _orients2 ( orients2 )
, _matr1 ( matr1 )
, _matr2 ( matr2 )
, _parameters( parameters )
, _names ( &names.Duplicate() )
, _isPhantom ( isPhantom )
, _curve1 ( )
, _curve2 ( )
{
}
@@ -6919,9 +7218,9 @@ public:
/// \ru Установить параметры операции. \en Set the operation parameters.
JoinSurfaceValues & SetParams() { return _parameters; }
/// \ru Получить исходный набор первых ребер. \en Get the initial set of the first edges.
const c3d::EdgesSPtrVector & GetFirstEdges() const { return _edges1; }
const c3d::ConstEdgesSPtrVector & GetFirstEdges() const { return _edges1; }
/// \ru Получить исходный набор вторых ребер. \en Get the initial set of the second edges.
const c3d::EdgesSPtrVector & GetSecondEdges() const { return _edges2; }
const c3d::ConstEdgesSPtrVector & GetSecondEdges() const { return _edges2; }
/// \ru Получить исходный набор ориентации первых ребер. \en Get the initial set of the first edges orientations.
const c3d::BoolVector & GetFirstOrientations() const { return _orients1; }
/// \ru Получить исходный набор ориентации вторых ребер. \en Get the initial set of the second edges orientations.