- C3d aggiornamento delle librerie ( 117939).
This commit is contained in:
SaraP
2023-02-14 12:21:38 +01:00
parent d21fd1b357
commit 58dff21d20
25 changed files with 679 additions and 85 deletions
+85 -12
View File
@@ -130,6 +130,21 @@ public:
};
//------------------------------------------------------------------------------
/** \brief \ru Режим отбраковки выбросов при вписывании поверхности в набор точек.
\en Outliers rejection mode for surface fitting. \~
\ingroup Polygonal_Objects
*/
// ---
enum MbeRejectOutliersType
{
rot_NoReject = 0, ///< \ru Не отбраковывать выбросы. \en No outliers rejection.
rot_Sigma = 1, ///< \ru Отбраковывать выбросы по критерию N*sigma. \en Reject outliers by N*sigma criterion.
rot_Percent = 2, ///< \ru Отбраковывать выбросы по процентному критерию. \en Reject outliers by percent criterion.
rot_MaxDistance = 3 ///< \ru Отбраковывать выбросы по критерию максимального отклонения. \en Reject outliers by maximum distance criterion.
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры вписывания поверхности.
\en Parameters of surface fitting. \~
@@ -138,17 +153,44 @@ public:
// ---
class MATH_CLASS MbSurfaceFitToGridParameters {
private:
MbeSpaceType _surfaceType; ///< \ru Тип поверхности. \en A surface type.
double _tolerance; ///< \ru Точность распознавания. \en A fitting tolerance.
c3d::IndicesVector _indicies; ///< \ru Индексы полигонов сетки. \en Indicies of polygons.
public:
MbeSpaceType _surfaceType; ///< \ru Тип поверхности. \en A surface type.
double _tolerance; ///< \ru Точность распознавания. \en A fitting tolerance.
c3d::IndicesVector _indicies; ///< \ru Индексы полигонов сетки. \en Indicies of polygons.
MbeRejectOutliersType _typeReject; ///< \ru Способ отбраковки выбросов. \en Outliers rejection mode.
double _valueReject; ///< \ru Пороговое значения для отбраковки выбросов. \en Outliers rejection mode treshold value.
private:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbSurfaceFitToGridParameters()
: _surfaceType ( st_Undefined )
, _tolerance ( c3d::DELTA_MIN )
, _indicies ( )
, _typeReject ( rot_NoReject )
, _valueReject ( 0. )
{}
public:
/// \ru Конструктор по параметрам. \en Constructor by parameters.
explicit MbSurfaceFitToGridParameters( MbeSpaceType surfaceType,
double tolerance,
const c3d::IndicesVector & indicies )
: _surfaceType( surfaceType )
, _tolerance ( tolerance )
, _indicies ( indicies )
, _typeReject ( rot_NoReject )
, _valueReject( 0. )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
explicit MbSurfaceFitToGridParameters( MbeSpaceType surfaceType,
double tolerance,
const c3d::IndicesVector & indicies,
MbeRejectOutliersType rejectType,
double rejectValue )
: _surfaceType( surfaceType )
, _tolerance ( tolerance )
, _indicies ( indicies )
, _typeReject ( rejectType )
, _valueReject( rejectValue )
{}
/// \ru Выдать тип поверхности. \en Get surface type.
MbeSpaceType GetSurfaceType() const { return _surfaceType; }
@@ -156,6 +198,10 @@ public:
double GetTolerance() const { return _tolerance; }
/// \ru Выдать индексы полигонов. \en Get indicies of polygons.
const c3d::IndicesVector & GetIndicies() const { return _indicies; }
/// \ru Выдать метод отбраковки выбросов. \en Get outliers rejection mode.
MbeRejectOutliersType GetOutliersRejectionMode() const { return _typeReject; }
/// \ru Выдать пороговое значения для отбраковки выбросов. \en Get outliers rejection mode treshold value.
double GetOutliersRejectionValue() const { return _valueReject; }
OBVIOUS_PRIVATE_COPY( MbSurfaceFitToGridParameters )
};
@@ -170,26 +216,53 @@ public:
class MATH_CLASS MbSurfaceFitToGridResults {
private:
c3d::SurfaceSPtr _surface; ///< \ru Поверхность. \en A surface.
double _tolerance; ///< \ru Достигнутая точность распознавания. \en Obtained tolerance.
double _devMax; ///< \ru Максимальное получившееся отклонение. \en A maximal deviation.
double _devMean; ///< \ru Среднее получившееся отклонение. \en A mean deviation.
double _rmsd; ///< \ru Среднее квадратическое отклонение. \en A root-mean-square deviation.
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbSurfaceFitToGridResults()
: _surface ( nullptr )
, _tolerance( 0.0 )
: _surface( nullptr )
, _devMax ( 0.0 )
, _devMean( 0.0 )
, _rmsd ( 0.0 )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbSurfaceFitToGridResults( MbSurface * surface, double tolerance )
: _surface( surface )
, _tolerance( tolerance )
: _surface( surface )
, _devMax ( tolerance )
, _devMean( 0.0 )
, _rmsd ( 0.0 )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbSurfaceFitToGridResults( MbSurface * surface, double devMax, double devMean, double rmsd )
: _surface( surface )
, _devMax ( devMax )
, _devMean( devMean )
, _rmsd ( rmsd )
{}
/// \ru Инициализировать данные. \en Initialize data.
void Init( MbSurface * surface, double tolerance ) {
_surface = surface;
_tolerance = tolerance;
_devMax = tolerance;
_devMean = 0.;
_rmsd = 0.;
}
/// \ru Инициализировать данные. \en Initialize data.
void Init( MbSurface * surface, double devMax, double devMean, double rmsd ) {
_surface = surface;
_devMax = devMax;
_devMean = devMean;
_rmsd = rmsd;
}
/// \ru Выдать поверхность. \en Get surface.
c3d::SurfaceSPtr GetSurface() const { return _surface; }
/// \ru Выдать достигнутую точность распознавания. \en Get obtained tolerance.
double GetTolerance() const { return _tolerance; }
/// \ru Выдать максимальное отклонение. \en Get maximal deviation.
double GetTolerance() const { return _devMax; }
/// \ru Выдать среднее отклонение. \en Get mean deviation.
double GetMeanDeviation() const { return _devMean; }
/// \ru Выдать cреднее квадратическое отклонение. \en Get root-mean-square deviation.
double GetRmsd() const { return _rmsd; }
OBVIOUS_PRIVATE_COPY( MbSurfaceFitToGridResults )
};
+91
View File
@@ -799,6 +799,29 @@ public:
, progress ( nullptr )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbMinMaxGridDistancesParams( const MbCurve3D & srcCurve,
size_t srcTCnt,
const MbVector3D * dir,
const MbeSenseValue & orient,
bool useEqualDists,
const MbSurface & dstSurface,
size_t nMin,
size_t nMax,
VERSION ver = Math::DefaultMathVersion() )
: srcItem ( &srcCurve )
, srcSplitsCount ( srcTCnt, 0 )
, dstItem ( &dstSurface )
, projDirection ( )
, projOrient ( orient )
, useEqualDistances ( useEqualDists )
, desiredMinimaNumber( nMin )
, desiredMaximaNumber( nMax )
, version ( ver )
, progress ( nullptr )
{
SetProjectionDirection( dir, orient );
}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbMinMaxGridDistancesParams( const MbCurve3D & srcCurve,
size_t srcTCnt,
const MbCurve3D & dstCurve,
@@ -814,6 +837,31 @@ public:
, version ( ver )
, progress ( nullptr )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbMinMaxGridDistancesParams( const MbCurve3D & srcCurve,
size_t srcTCnt,
bool useEqualDists,
bool byNormal,
const MbCurve3D & dstCurve,
size_t nMin,
size_t nMax,
VERSION ver = Math::DefaultMathVersion() )
: srcItem ( &srcCurve )
, srcSplitsCount ( srcTCnt, 0 )
, dstItem ( &dstCurve )
, projDirection ( )
, projOrient ( orient_FORWARD )
, useEqualDistances ( useEqualDists )
, desiredMinimaNumber( nMin )
, desiredMaximaNumber( nMax )
, version ( ver )
, progress ( nullptr )
{
if ( !byNormal ) {
MbVector3D vect( 1.0, 1.0, 1.0 );
SetProjectionDirection( &vect, orient_FORWARD );
}
}
public:
/// \ru Получить базовый объект. \en Get base object.
@@ -912,4 +960,47 @@ MATH_FUNC (MbeProcessState) MinMaxSurfaceSurfaceGridDistances( const MbMinMaxGri
MbMinMaxGridDistancesResults<MbCartPoint, MbCartPoint> & results );
//------------------------------------------------------------------------------
/** \brief \ru Экстремальные расстояния между объектами (кривыми и поверхностями).
\en Extreme distances between objects (curves and surfaces). \~
\details \ru Экстремальные расстояния между объектами по сетке на кривой,
причем замеры выполняются в заданном направлении (если есть
вектор) или по нормали к поверхности.
\en Extreme distances between objects along the grid on the curve,
and measurements are taken in a given direction (if there is
a vector) or along the normal to the surface. \~
\param[in] params - \ru Параметры операции сеточного поиска минимумов и максимумов.
\en Parameters of the operation of the grid search for minima and maxima. \~
\param[out] results - \ru Результаты операции сеточного поиска минимумов и максимумов.
\en Results of the operation of the grid search for minima and maxima. \~
\return \ru Возвращает результат замера (получен, не получен или же процесс был прерван).
\en Returns the result of measurement (obtained, not obtained, or the process has been aborted). \~
\ingroup Algorithms_3D
*/ // ---
MATH_FUNC (MbeProcessState) MinMaxCurveSurfaceGridDistances( const MbMinMaxGridDistancesParams & params,
MbMinMaxGridDistancesResults<double, MbCartPoint> & results );
//------------------------------------------------------------------------------
/** \brief \ru Экстремальные расстояния между кривыми.
\en Extreme distances between curves. \~
\details \ru Экстремальные расстояния между кривыми по сетке,
причем замеры осуществляются в точках разбивки первой кривой по
нормали ко второй кривой или между точками разбивки первой кривой
и точками второй кривой.
\en Extreme distances between curves along the grid,
and measurements are taken at the break points of the first curve
along the normal to the second curve or between the break points
of the first curve and the points of the second curve. \~
\param[in] params - \ru Параметры операции сеточного поиска минимумов и максимумов.
\en Parameters of the operation of the grid search for minima and maxima. \~
\param[out] results - \ru Результаты операции сеточного поиска минимумов и максимумов.
\en Results of the operation of the grid search for minima and maxima. \~
\return \ru Возвращает результат замера (получен, не получен или же процесс был прерван).
\en Returns the result of measurement (obtained, not obtained, or the process has been aborted). \~
\ingroup Algorithms_3D
*/ // ---
MATH_FUNC (MbeProcessState) MinMaxCurveCurveGridDistances( const MbMinMaxGridDistancesParams & params,
MbMinMaxGridDistancesResults<double, double> & results );
#endif // __ALG_DIMENSION_H
+16 -2
View File
@@ -27,13 +27,18 @@ protected :
bool changeable; ///< \ru Признак редактируемости. \en Attribute of editability.
protected :
/// \ru Конструктор. \en Constructor.
MbCommonAttribute( const MbCommonAttribute & );
/// \ru Конструктор. \en Constructor.
MbCommonAttribute( const c3d::string_t & prompt, const bool change );
/// \ru Конструктор. \en Constructor.
explicit MbCommonAttribute( const bool change );
private:
/// \ru Оператор присваивания (не реализован. \en Assignment operator (not implemented).
MbCommonAttribute & operator = ( const MbCommonAttribute & );
public:
/// \ru Деструктор. \en Destructor.
virtual ~MbCommonAttribute();
public :
MbeAttributeType AttributeFamily() const override; // \ru Выдать тип атрибута. \en Get attribute type.
//virtual MbeAttributeType AttributeType() const = 0; // \ru Выдать подтип атрибута. \en Get subtype of an attribute.
@@ -76,11 +81,11 @@ public :
bool IsChangeable() const;
DECLARE_PERSISTENT_CLASS( MbCommonAttribute )
OBVIOUS_PRIVATE_COPY( MbCommonAttribute )
};
IMPL_PERSISTENT_OPS( MbCommonAttribute )
//------------------------------------------------------------------------------
/** \brief \ru bool атрибут.
\en Bool attribute. \~
@@ -117,6 +122,7 @@ OBVIOUS_PRIVATE_COPY( MbBoolAttribute )
IMPL_PERSISTENT_OPS( MbBoolAttribute )
//------------------------------------------------------------------------------
/** \brief \ru int атрибут.
\en Int attribute. \~
@@ -153,6 +159,7 @@ OBVIOUS_PRIVATE_COPY( MbIntAttribute )
IMPL_PERSISTENT_OPS( MbIntAttribute )
//------------------------------------------------------------------------------
/** \brief \ru int64 атрибут.
\en Int64 attribute. \~
@@ -189,6 +196,7 @@ OBVIOUS_PRIVATE_COPY( MbInt64Attribute )
IMPL_PERSISTENT_OPS( MbInt64Attribute )
//------------------------------------------------------------------------------
/** \brief \ru double атрибут.
\en Double attribute. \~
@@ -225,6 +233,7 @@ OBVIOUS_PRIVATE_COPY( MbDoubleAttribute )
IMPL_PERSISTENT_OPS( MbDoubleAttribute )
//------------------------------------------------------------------------------
/** \brief \ru String атрибут.
\en String attribute. \~
@@ -262,6 +271,7 @@ OBVIOUS_PRIVATE_COPY( MbStringAttribute )
IMPL_PERSISTENT_OPS( MbStringAttribute )
//------------------------------------------------------------------------------
/** \brief \ru Бинарный атрибут.
\en Binary attribute. \~
@@ -299,6 +309,7 @@ OBVIOUS_PRIVATE_COPY( MbBinaryAttribute )
IMPL_PERSISTENT_OPS( MbBinaryAttribute )
//------------------------------------------------------------------------------
/** \brief \ru Атрибут массив целочисленных значений типа int32.
\en Array of integer (int32) values attribute. \~
@@ -339,6 +350,7 @@ OBVIOUS_PRIVATE_COPY( MbInt32VectorAttribute )
IMPL_PERSISTENT_OPS( MbInt32VectorAttribute )
//------------------------------------------------------------------------------
/** \brief \ru Атрибут массив целочисленных значений типа int64.
\en Array of integer (int64) values attribute. \~
@@ -379,6 +391,7 @@ OBVIOUS_PRIVATE_COPY( MbInt64VectorAttribute )
IMPL_PERSISTENT_OPS( MbInt64VectorAttribute )
//------------------------------------------------------------------------------
/** \brief \ru Атрибут массив действительных чисел типа double.
\en Array of real (double) values attribute. \~
@@ -419,4 +432,5 @@ OBVIOUS_PRIVATE_COPY( MbDoubleVectorAttribute )
IMPL_PERSISTENT_OPS( MbDoubleVectorAttribute )
#endif // __ATTR_COMMON_ATTRIBUE_H
+20 -14
View File
@@ -278,7 +278,12 @@ private :
protected :
/// \ru Конструктор без параметров для наследников. \en Constructor without parameters for inheritors.
MbAttribute();
MbAttribute();
/// \ru Конструктор копирования для наследников. \en Copy constructor for inheritors.
MbAttribute( const MbAttribute & );
private:
/// \ru Оператор присваивания (не реализован. \en Assignment operator (not implemented).
const MbAttribute & operator = ( const MbAttribute & );
public :
/// \ru Деструктор. \en Destructor.
virtual ~MbAttribute();
@@ -448,14 +453,14 @@ public :
/// \ru Выдать заголовок свойства объекта. \en Get a name of object property.
virtual MbePrompt GetPropertyName() = 0;
bool IsFamilyRegistrable() const override;
bool IsFamilyRegistrable() const override;
DECLARE_PERSISTENT_CLASS( MbAttribute )
OBVIOUS_PRIVATE_COPY( MbAttribute )
};
IMPL_PERSISTENT_OPS( MbAttribute )
//------------------------------------------------------------------------------
/** \brief \ru Объект для свойств.
\en Object for properties. \~
@@ -481,23 +486,24 @@ public:
/// \ru Конструктор с параметрами. \en Constructor with parameters.
MbAttributeAction( uint8 & cha, uint8 & con, uint8 & tra, uint8 & cop, uint8 & mer, uint8 & rep, uint8 & spl, uint8 & del,
bool & fre, bool & cob )
: MbRefItem()
, forChange( cha )
, forConvert( con )
: MbRefItem ( )
, forChange ( cha )
, forConvert ( con )
, forTransform( tra )
, forCopy( cop )
, forMerge( mer )
, forReplace( rep )
, forSplit( spl )
, forDelete( del )
, freeable( fre )
, copyable( cob ) {}
, forCopy ( cop )
, forMerge ( mer )
, forReplace ( rep )
, forSplit ( spl )
, forDelete ( del )
, freeable ( fre )
, copyable ( cob )
{}
/// \ru Деструктор. \en Destructor.
~MbAttributeAction() {}
public:
/// \ru Выдать свойства объекта. \en Get properties of the object.
void GetProperties( MbProperties & );
void GetProperties( MbProperties & ) const;
/// \ru Установить свойства объекта. \en Set properties of object.
void SetProperties( const MbProperties & );
+6 -6
View File
@@ -497,11 +497,11 @@ public:
/// \ru Получить имя. \en Specify name.
DEPRECATE_DECLARE_REPLACE ( GetC3dName ) void GetName( std::string & nm ) const;
/// \ru Задать имя. \en Specify name.
void SetC3dName ( const c3d::string_t& nm );
/// \ru Задать имя. \en Specify name.
void SetC3dName ( const c3d::string_t& nm );
/// \ru Получить имя. \en Specify name.
c3d::string_t GetC3dName ( ) const;
/// \ru Получить имя. \en Specify name.
c3d::string_t GetC3dName ( ) const;
/// \ru Задать видимость. \en Set visibility.
void SetVisibility( bool v );
@@ -645,9 +645,9 @@ public:
/// \ru Получить проекционную кривую ко второму объекту привязки. \en Get the projection curve to the second binding object.
MbLineSegment3D* GetProjectionTarget() const;
/// \ru Задать кривую, вдоль которой провдится измерение. \en Set the curve the measurement is performed along.
/// \ru Задать кривую, вдоль которой проводится измерение. \en Set the curve the measurement is performed along.
void SetPath( MbCurve3D* inPath );
/// \ru Получить кривую, вдоль которой провдится измерение. \en Get the curve the measurement is performed along.
/// \ru Получить кривую, вдоль которой проводится измерение. \en Get the curve the measurement is performed along.
MbCurve3D* GetPath();
/// \ru Создать дубликат и трансформировать его согласно матрице. \en Create a replica then transform it.
+2 -1
View File
@@ -342,6 +342,7 @@ struct C3DConverterDebugSettings {
, idForLogging( -1 )
{
}
~C3DConverterDebugSettings() {}
};
@@ -660,7 +661,7 @@ public:
/// \ru Добавлять ли удаленные грани в качестве оболочек. \en Whether to add removed faces as shells.
bool AddRemovedFacesAsShells() const override { return addRemovedFacesAsShells; }
/// \ru Получить генератор однострочного идентификтора изделия. \en Get generator of one-line product identifier.
virtual SPtr<IProductIdMaker> ProductIdentifierGenerator() const { return SPtr<IProductIdMaker>( new NameProductIdMaker() ); }
SPtr<IProductIdMaker> ProductIdentifierGenerator() const override { return SPtr<IProductIdMaker>( new NameProductIdMaker() ); }
/// \ru Получить пользовательский преобразователь строк. \en Get user string transformer.
SPtr<IC3DCharEncodingTransformer> GetUserCharEncodingTransformer() const override;
+2 -2
View File
@@ -1,8 +1,8 @@
//////////////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Типы данных геометрического решателя
\en Data types of geometric solver \~
\brief \ru Типы данных геометрического решателя.
\en Data types of geometric solver. \~
*/
//////////////////////////////////////////////////////////////////////////////////////////
+13 -17
View File
@@ -161,13 +161,15 @@ public:
{
PRECONDITION( m_graph == &g );
typename Graph::vertex_index v = father[u];
if ( v == NO_VERTEX ) // СЛУЧАЙ 1: Вершина u - корневая, завершен обход fds-дерева
// СЛУЧАЙ 1: Вершина v - корневая, завершен обход fds-дерева.
if ( v == NO_VERTEX )
{
// Оценить является ли u - точкой сочленения
// Сколько раз стартовая вершина стала папой (столько же в ней стыкуется блоков)
if ( _ChildrenNb(u, g) > 1)
{
// В корневой вершине стыкуются 2 или более блоков - значит она же является и точкой сочленения
// В корневой вершине стыкуются 2 или более блоков - значит она же является и точкой сочленения.
m_bicompVis.CutNode( u, g );
}
// Извещение о найденном блоке
@@ -177,8 +179,10 @@ public:
// После извещения визитера - вычищаем стек
m_stackEdges.clear();
}
return;
}
else // СЛУЧАЙ 2: u - не корневая вершина
// СЛУЧАЙ 2: u - не корневая вершина.
{
lval[v] = min_of( lval[v], lval[u] ); // см. лемму 6;
if ( lval[u] >= num[v] )
@@ -187,7 +191,7 @@ public:
// стека все ребра, включая ребро vu.
// (!) Если вершина v не корень d-дерева, то можно утверждать, что она - есть точка сочленения;
// См. теорему 8.2.
// См. теорему 8.2. [М.О.Асанов]
if ( father[v] != NO_VERTEX ) // если v корневая вершина, то оценки для неё делаются в конце обхода дерева
{
m_bicompVis.CutNode( v, *m_graph );
@@ -199,24 +203,16 @@ public:
// Тут мы запретили собирать блок, т.к. вершина фильтрованная, однако это не принесет ущерба,
// если окажется что v - не точка сочленения. Вот почему:
/*
Если v - есть корень dfs-дерева, то возможны 2 варианта: v принадлежит одному блоку,
тогда v не точка сочленения; v принадлежит двум и более блокам, тогда v - есть точка сочленения.
Если v - есть корень DFS-дерева, то возможны 2 варианта:
i) v принадлежит одному блоку, тогда v не точка сочленения;
ii) v принадлежит двум и более блокам, тогда v - есть точка сочленения.
В первом случае единственный блок, куда включена v, будет собран в конце текущего обхода dfs-дерева,
массив m_stackEdges полностью будет содержать этот блок. Во втором случае, если блок не
единственный, то v - есть точка сочленения, тогда очевидно запрет правомерен - в конце обхода дерева все,
что осталось в стеке ребер есть один блок.
*/
PRECONDITION( !m_stackEdges.empty() );
/*
std::vector<edge>::reverse_iterator vuIter =
std::find( m_stackEdges.rbegin(), m_stackEdges.rend(), edge(v,u) ); // Ищем с конца
PRECONDITION( vuIter != m_stackEdges.rend() ) // Это ребро обязано быть в стеке
m_bicompVis.BlockFounded( vuIter.base()-1, m_stackEdges.end(), *m_graph );
// После извещения визитера - вычищаем блок из стека конца
m_stackEdges.erase( vuIter.base()-1, m_stackEdges.end() );
*/
PRECONDITION( !m_stackEdges.empty() );
const edge seek( v, u );
typename std::vector<edge>::iterator first = m_stackEdges.begin();
typename std::vector<edge>::iterator iter, last;
@@ -363,7 +359,7 @@ void DepthFirstSearch( const Graph & graph, Visitor & vis )
const vertices_size_t vCount = graph.NumVertices();
std::vector<DFSVertexInfo<Graph>> stack;
std::vector<color_code> colourMap( vCount, white_color ); // отображение: вершина -> цвет
std::vector<color_code> colourMap( vCount, white_color ); // Отображение: вершина -> цвет.
// Пометить, как рассмотренные, игнорируемые вершины
for ( vertex_index xIdx = 0; xIdx<vCount; ++xIdx )
+20
View File
@@ -80,6 +80,7 @@ public:
\en Returns true if a copy of the object is already registered. \~
*/
virtual bool IsReg ( const MbRefItem * srcItem, MbRefItem *& cpyItem ) = 0;
/** \brief \ru Зарегистрировать копию объекта.
\en Register copy of the object. \~
\details \ru Зарегистрировать копию объекта. \n
@@ -90,6 +91,25 @@ public:
\en The object copy. \~
*/
virtual void SetReg ( const MbRefItem * srcItem, MbRefItem * cpyItem ) = 0;
/** \brief \ru Зарегистрировать копию объекта с проверкой наличия уже зарегистрированной копии.
\en Register a copy of the object with verification of the presence of already registered copy. \~
\details \ru Зарегистрировать копию объекта с проверкой наличия уже зарегистрированной копии.
Если уже существует зарегистрированная копия объекта, то присланная копия не регистрируется и удаляется.
Функция возвращает зарегистрированную копию объекта. \n
\en Register a copy of the object with verification of the presence of already registered copy.
If a registered copy of the object already exists, then the input copy is not registered and deleted.
The function returns a registered copy of the object.
\n \~
\param[in] srcItem - \ru Исходный объект.
\en The initial object. \~
\param[in/out] cpyItem - \ru Копия объекта. Удаляется, если уже существует зарегистрированная копия.
\en The object copy. Deleted if a registered copy already exists. \~
\return \ru Возращает зарегистрированную копию объекта.
\en Returns the registered copy of the object. \~
*/
virtual MbRefItem * SetRegCheck ( const MbRefItem * srcItem, MbRefItem *& cpyItem ) = 0;
/// \ru Освободить используемую память и удалить себя. \en Free memory and remove itself.
virtual void Free() = 0;
+16 -5
View File
@@ -538,6 +538,11 @@ public:
// ---
//DEPRECATE_DECLARE
struct MATH_CLASS MbFairCurveData {
public:
typedef std::vector<std::pair<size_t, MbVector3D> > IndexVectorArray;
private:
IndexVectorArray fixData; /// \ru Массив данных для фиксации точек и касательных. \en Data array for fixing points and tangents.
public:
MbeFairSmoothing fairing; ///< \ru Сглаживание (без сглаживания, со сглаживанием, со сглаживанием и исправлением острых углов, со сглаживанием зашумленных точек). \en Smoothing of curve: 0 - disable, 1 - enable, 2 - enable and correct acute angles \~
@@ -558,9 +563,6 @@ public:
double clothoidRMin; ///< \ru Радиус кривизны на конце начального участка клотоиды. \en Curvature radius on end of initial part of Clothoid. \~
double clothoidLMax; ///< \ru Максимальная длина начального участка клотоиды. \en Max length of initial part of Clothoid. \~
size_t clothoidSegms; ///< \ru Количество сегментов аппроксимирующей клотоиду кривой. \en Number of segments of curve approximated the Clothoid. \~
SArray<int> arrayFixPntTngSign; ///< \ru Признаки учета касательных на точках / точек на касательных. \en Signs of points on tangents / tangents on points.
SArray<size_t> arrayFixNoisyNum; ///< \ru Номера точек точных значений зашумленных точек. \en Signs of exactly noisy points.
size_t numberOfIterationsBSpl; ///< \ru Количество итераций построения B-сплайна (заданное и фактическое). \en The number of iterations for building the B-spline (given and actual).
double realAccuracyBSpl; ///< \ru Точность построения B-сплайна (заданная и фактическая). \en The accuracy of creating the B-spline (given and actual).
@@ -596,7 +598,7 @@ public:
tangentCorrectBspline( true ),
fixPntTng( fixPntTng_NotFix ),
//approx( fairApprox_KnotsSpline ), create( 1 ), degreeBSpline( 8 ),
approx( fairApprox_IsoNurbs ), create( fairMethod_Polyline ), degreeBSpline( 8 ), //DEBUG 2020 25
approx( fairApprox_IsoSpline ), create( fairMethod_Polyline ), degreeBSpline( 8 ), //DEBUG 2020 25
outFormat( fairFormat_Close ),
nSegments( 4 ), numSegment( 0 ), tParam( 0.5 ),
clothoidRMin( 50.0 ), clothoidLMax( 200.0 ), clothoidSegms( 10 ), numberOfIterationsBSpl( 1000 ),
@@ -610,7 +612,16 @@ public:
switchFixFirstPointAtNoisy( false ), switchFixLastPointAtNoisy( false ),
warning( fwarn_Success ), error( rt_Success ), errInfo() {}
~MbFairCurveData() {}
~MbFairCurveData();
// \ru Инициализировать данные для фиксации точек и касательных. \en Initialize данные для фиксации точек и касательных.
void InitFixConstraints( const std::vector<std::pair<size_t, MbVector3D *>> & constraints );
// \ru Инициализировать данные для фиксации точек и касательных. \en Initialize данные для фиксации точек и касательных.
void InitFixConstraints( const IndexVectorArray & constraints );
//< \ru Получить данные для фиксации точек и касательных. \en Get данные для фиксации точек и касательных.
const IndexVectorArray & GetFixConstraints() const { return fixData; }
/// \ru Оператор присваивания. \en Assignment operator.
MbFairCurveData & operator = ( const MbFairCurveData & other );
+3 -2
View File
@@ -669,7 +669,8 @@ enum MbeFairSubdivision
{
fairSubdiv_No = 0, ///< \ru Без уплотнения. \en Without subdivision.
fairSubdiv_Single = 1, ///< \ru Однократное уплотнение. \en Single subdivision.
fairSubdiv_Double = 2 ///< \ru Двукратное уплотнение. \en Double subdivision.
fairSubdiv_Double = 2, ///< \ru Двукратное уплотнение. \en Double subdivision.
fairSubdiv_Thrice = 3 ///< \ru Двукратное уплотнение. \en Double subdivision.
};
//------------------------------------------------------------------------------
@@ -777,7 +778,7 @@ enum MbeFairWarning
fwarn_IncorrectPolylines = 3, ///< \ru Некорректные формы ломаных / направления касательных. \en Incorrect polylines / tangent directions.
fwarn_IncorrectFixPntTng = 4, ///< \ru Некорректное направление / положение фиксированной касательной / точки. Игнорируется. \en Incorrect direction / position of a fixed tangent / point. Ignored.
fwarn_BadAccuracyFixPntTng = 5, ///< \ru Погрешность направления / положения фиксированной касательной / точки превышает заданную точность. \en The error of the direction / position of the fixed tangent / point exceeds the specified accuracy.
fwarn_BadStructureFixPntTng = 6, ///< \ru Положения фиксированных касательных не согласованы со стркуктурой кривой. Игнорируются. \en The positions of the fixed tangents are not consistent with the structure of the curve. Are ignored.
fwarn_BadStructureFixPntTng = 6, ///< \ru Положения фиксированных касательных не согласованы со структурой кривой / степенью B-сплайна. Игнорируются. \en The positions of the fixed tangents are not consistent with the structure of the curve / degree of B-сплайн. Are ignored.
fwarn_BadPositionFixPntTng = 7, ///< \ru Положения фиксированных касательных не согласованы по интервалу. Игнорируются. \en The positions of fixed tangents are not matched by interval. Are ignored.
fwarn_CriticalConfig = 8, ///< \ru Критическая конфигурация для B-сплайновой аппроксимации. \en Critical configuration for B-Spline approximation.
fwarn_CantSetCurvature = 9, ///< \ru Конфигурация ломаной не позволяет установить кривизну с заданным значением. \en Configuration of polyline does not allow setting curvature value.
+266
View File
@@ -0,0 +1,266 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Элемент аннотации.
\en Annotation item.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __MB_PMI_H
#define __MB_PMI_H
#include <legend.h>
#include <model_item.h>
#include <mb_placement.h>
//----------------------------------------------------------------------------------------
/** \brief \ru Элемент текста объекта аннотации.
\en Reference-counted object. \~
\details \ru Базовый класс текстовых элементов - составного текста или несущего содержание. \n
\en Base class for text items - composite or readable. \n\~
\note \ru Текст размещается в плоскости элемента аннотации и может быть либо группой текстовых
элементов, либо строкой либо специальным символом.
\en Text is located in the plane of annotation and can be either formatter or unformatted
text or symbol or a group of text elements. \~
\ingroup Legend
*/
// ---
class MATH_CLASS MbTextItem : public TapeBase, public MbRefItem
{
public:
/// \ru Создать копию объекта. \en Create a copy of an object.
virtual SPtr<MbTextItem> Clone( MbRegDuplicate * = nullptr ) const = 0;
/// \ru Являются ли объекты равными. \en Are the objects equal.
virtual bool IsSame( const MbTextItem & to, double accuracy ) const = 0;
DECLARE_PERSISTENT_CLASS( MbTextItem );
protected:
MbTextItem();
OBVIOUS_PRIVATE_COPY( MbTextItem )
};
IMPL_PERSISTENT_OPS( MbTextItem )
//----------------------------------------------------------------------------------------
/** \brief \ru Интерпретация текста.
\en Text content type. \~
\details \ru Текст или специальный символ. \n
\en Object counting number of its owners. \n\~
\ingroup Legend
*/
// ---
enum MbeTextLiteralForm
{
tlf_UnformattedString = 0, ///< \ru Текст без кодов форматирования. \en Text as is.
tlf_PreDefinedCode = 1, ///< \ru Код специального символа. \en Text is a code of a symbol.
tlf_FormattedString = 2 ///< \ru Текст с элементами форматирования форматирования. \en Formatted text.
};
//----------------------------------------------------------------------------------------
/** \brief \ru Текстовый элемент, несущий содержание.
\en Text element which has content. \~
\details \ru Текст или специальный символ. \n
\en Either text or pre-defined simbol. \n\~
\ingroup Legend
*/
// ---
class MATH_CLASS MbTextLiteral : public MbTextItem
{
c3d::string_t m_text; ///< \ru Текст или код символа. \en Text or symbol's code.
c3d::string_t m_font; ///< \ru Шрифт. \en Font.
/** \brief \ru Положение в плоскости аннотации.
\en Location in annotation plane. \~
\details \ru Начало системы координат соответствует левому нижнему углу.
\en The origin of the location is position of the left-bottom corner. \~
*/
MbPlacement m_location;
double m_width; ///< \ru Ширина. \en Width.
double m_height; ///< \ru Высота. \en Height.
MbeTextLiteralForm m_textForm; ///< \ru Способ интерпретации текста. \en Meaning of the text field..
public:
explicit MbTextLiteral( const c3d::string_t & initText, const MbPlacement & place, MbeTextLiteralForm preDefinedCode );
/// \ru Получить текст. \en Get text.
c3d::string_t GetText() const;
/// \ru Получить положение в плоскости аннотации. \en Get location in annotation plane.
MbPlacement GetLocation() const;
/// \ru Получить ширину. \en Get width.
double GetWidth() const;
/// \ru Получить высоту. \en Get height.
double SetHeight() const;
/// \ru Задать ширину. \en Set width.
bool SetWidth( double w );
/// \ru Задать высоту. \en Set height.
bool SetHeight( double h );
/// \ru Получить тип текста. \en Get text form.
MbeTextLiteralForm GetTextForm() const;
/// \ru Получить шрифт. \en Get font.
c3d::string_t GetFont() const;
/// \ru Задать шрифт. \en Set font.
void SetFont( const c3d::string_t & font );
/// \ru Создать копию объекта. \en Create a copy of an object.
SPtr<MbTextItem> Clone( MbRegDuplicate * = nullptr ) const override;
/// \ru Являются ли объекты равными. \en Are the objects equal.
bool IsSame( const MbTextItem & to, double accuracy ) const override;
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbTextLiteral )
OBVIOUS_PRIVATE_COPY( MbTextLiteral )
};
IMPL_PERSISTENT_OPS( MbTextLiteral )
//----------------------------------------------------------------------------------------
/** \brief \ru Составной текст.
\en Composite text. \~
\details \ru Группа из более, чем одного текстового элемента. \n
\en Group of two or more text items. \n\~
\ingroup Legend
*/
// ---
class MATH_CLASS MbCompositeText : public MbTextItem
{
/// \ru Элементы группы текстовых элементов. \en Grouped items.
std::vector<SPtr<MbTextItem>> m_textItems;
public:
/** \brief \ru Создать составной текстовый элемент.
\en Create composite text element. \~
\details \ru Элемент создаётся только в том случае, если в исходных данных будет два или более ненулевых элемента.
\en New element is created if two or more text items found in the source array. \~
*/
static SPtr<MbCompositeText> Create( const std::vector<SPtr<MbTextItem>> & textItems );
private:
/// \ru Конструктор. \en Constructor.
explicit MbCompositeText( std::vector<SPtr<MbTextItem>> && textItems );
/// \ru Создать копию объекта. \en Create a copy of an object.
SPtr<MbTextItem> Clone( MbRegDuplicate * = nullptr ) const override;
/// \ru Являются ли объекты равными. \en Are the objects equal.
bool IsSame( const MbTextItem & to, double accuracy ) const override;
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbCompositeText )
OBVIOUS_PRIVATE_COPY( MbCompositeText )
};
IMPL_PERSISTENT_OPS( MbCompositeText )
//----------------------------------------------------------------------------------------
/** \brief \ru Элемент аннотации.
\en Reference-counted object. \~
\ingroup Legend
*/
// ---
class MATH_CLASS MbPMI : public MbLegend
{
/// \ru Плоскость для отображения текста. \en The plane text is shown in.
MbPlacement3D m_planeTextDisplay;
/// \ru Заголовок элемента аннотации. \en The title of the annotation item.
c3d::string_t m_title;
/// \ru Элементы для непосредственного отображения. \en The elements to be displaied directly.
c3d::ItemsSPtrVector m_nonTextItems;
/// \ru Текстовые элементы. \en The text items of the annotation.
std::vector<SPtr<MbTextItem>> m_textItems;
public:
/** \brief \ru Создать элемент аннотации.
\en Create annotation item. \~
\param[in] plane - \ru Плоскость для отображения плоских элементов,
\en Plane for planar elements transformation into space, \~
\param[in] pmiName - \ru Название элемента аннотации,
\en Captrion of the annotation element, \~
\param[in] pmiVisual - \ru Геометрические компоненты элемента аннотации,
\en Geometric items ot the annotation element, \~
\param[in] pmiText \ru Текстовые компоненты элемента аннотации.
\en Text items ot the annotation element. \~
\return \ru Возвращает указатель на элемент аннотации, если передаётся хотя бы один
ненулевой текстовый или геометрический элемент, иначе нулевой указатель.
\en Returns pointer to new annotation element if only at least one text or geometric
element is given, otherwise null pointer. \~
*/
static SPtr<MbPMI> Create ( const MbPlacement3D & plane = MbPlacement3D::global,
const c3d::string_t & pmiName = c3d::string_t(),
const c3d::ItemsSPtrVector & pmiVisual = c3d::ItemsSPtrVector(),
const std::vector<SPtr<MbTextItem>> & pmiText = std::vector<SPtr<MbTextItem>>() );
protected:
/** \brief \ru Конструктор.
\en Constructor. \~
\param[in] plane - \ru Плоскость для отображения плоских элементов,
\en Plane for planar elements transformation into space, \~
\param[in] pmiName - \ru Название элемента аннотации,
\en Captrion of the annotation element, \~
\param[in] pmiVisual - \ru Геометрические компоненты элемента аннотации,
\en Geometric items ot the annotation element, \~
\param[in] pmiText \ru Текстовые компоненты элемента аннотации.
\en Text items ot the annotation element. \~
*/
MbPMI( const MbPlacement3D & plane, const c3d::string_t & pmiName, c3d::ItemsSPtrVector &&, std::vector<SPtr<MbTextItem>> && pmiText );
public:
/// \ru Получить плоскость для отображения плоских элементов. \en Get plane for planar elements transformation into space.
MbPlacement3D GetLocation() const;
/// \ru Получить название элемента аннотации. \en Get captrion of the annotation element.
c3d::string_t GetTitle() const;
/// \ru Получить количество геометрических элементов. \en Get count of geometric items.
size_t GeometricElementsCount() const;
/** \brief \ru Получить геометрический элемент с указанным индексом.
\en Get geometric item at the specified index. \~
\param[in] elementIndex - \ru Индекс элемента,
\en Element's index, \~
\return \ru Элемент по указанному индексу, если индекс допустим, иначе нулевой указатель.
\en Element if index is valid, null pointer otherwise. \~
*/
c3d::ItemSPtr GetGeometricElement( size_t elementIndex ) const;
/// \ru Получить количество текстовых элементов. \en Get count of text items.
size_t TextElementsCount() const;
/** \brief \ru Получить текстовый элемент с указанным индексом.
\en Get text item at the specified index. \~
\param[in] elementIndex - \ru Индекс элемента,
\en Element's index, \~
\return \ru Элемент по указанному индексу, если индекс допустим, иначе нулевой указатель.
\en Element if index is valid, null pointer otherwise. \~
*/
SPtr<MbTextItem> GetTextElement( size_t elementIndex ) const;
MbeSpaceType IsA () const override; // \ru Тип объекта. \en A type of an object.
MbeSpaceType Type () const override; // \ru Групповой тип объекта. \en Group type of object.
MbSpaceItem & Duplicate( MbRegDuplicate * = nullptr ) const override; // \ru Создать копию. \en Create a copy.
bool IsSame ( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ) const override; // \ru Являются ли объекты равными? \en Are the objects equal?
bool SetEqual ( const MbSpaceItem & ) override; // \ru Сделать объекты равным. \en Make the objects equal.
void Transform( const MbMatrix3D &, MbRegTransform * = nullptr ) override; // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
void Move ( const MbVector3D &, MbRegTransform * = nullptr ) override; // \ru Сдвинуть вдоль вектора. \en Translate along a vector.
void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) override; // \ru Повернуть вокруг оси. \en Rotate around an axis.
bool IsSimilar( const MbSpaceItem & init ) const override; // \ru Являются ли объекты подобными? \en Determine whether the objects are similar.
double DistanceToPoint ( const MbCartPoint3D & ) const override; // \ru Вычислить расстояние до точки. \en Calculate the distance to a point.
void AddYourGabaritTo( MbCube & r ) const override; // \ru Добавь свой габарит в куб. \en Add bounding box into a cube.
void CalculateMesh( const MbStepData & stepData, const MbFormNote & note, MbMesh & mesh ) const override; // \ru Построить полигональную копию mesh. \en Build polygonal copy mesh.
MbProperty & CreateProperty( MbePrompt n ) const override; // \ru Создать собственное свойство. \en Create a custom property.
void GetProperties( MbProperties & properties ) override; // \ru Выдать свойства объекта. \en Get properties of the object.
void SetProperties( const MbProperties & properties ) override; // \ru Установить свойства объекта. \en Set properties of the object.
DECLARE_PERSISTENT_CLASS( MbPMI )
private:
MbPMI( const MbPMI& );
const MbPMI& operator=( const MbPMI& ) = delete;
};
IMPL_PERSISTENT_OPS( MbPMI )
#endif /* __MB_PMI_H */
+7
View File
@@ -385,6 +385,9 @@ enum MbePrompt
// \ru Обозначение \en Notation
IDS_ITEM_0671, ///< \ru Условное обозначение. \en Symbolic Notation.
IDS_ITEM_0672, ///< \ru Элемент аннотации. \en PMI object.
IDS_ITEM_0673, ///< \ru Текстовый элемент. \en Text item.
IDS_ITEM_0674, ///< \ru Составной текст. \en Composite text.
// \ru Объекты. \en Objects.
@@ -1159,6 +1162,10 @@ enum MbePrompt
IDS_PROP_0930, ///< \ru Допустимое несовпадение. \en Permissible mismatch.
IDS_PROP_0931, ///< \ru Совпадение направлений. \en Directions matching.
IDS_PROP_0932, ///< \ru Исходный проволочный каркас. \en Initial wire frame.
IDS_PROP_0933, ///< \ru Признак строгого построения уклона 1. \en Sign of strict construction a slope angle 1.
IDS_PROP_0934, ///< \ru Признак строгого построения уклона 2. \en Sign of strict construction a slope angle 2.
// \ru Конвертеры \en Converters
IDS_PROP_1000, ///< \ru Заголовок. \en Title.
+60 -13
View File
@@ -1058,13 +1058,14 @@ class MATH_CLASS MbCurvesWrappingParams : public MbPrecision {
private:
c3d::ConstPlaneCurvesSPtrVector curves; ///< \ru Двумерные кривые, копии которых будут перенесены на другой носитель. \en 2d curves, copies of which will be transferred to another medium. \~
c3d::ConstSurfaceSPtr surface; ///< \ru Поверхность. \en The surface. \~
MbPlacement3D place; ///< \ru Локальная система координат (ЛСК). \en The local coordinate system (LCS) of the curves. \~
MbCartPoint xy; ///< \ru Точка привязки на плоскости XY локальной системы координат. \en The anchor point on the "XY" plane of the LCS that will be aligned with the uv point on the parametric plane of the surface. \~
MbCartPoint uv; ///< \ru Точка привязки в параметрической плоскости "UV" параметров поверхности. \en The anchor point in the parametric plane "UV" of the surface parameters. \~
double angle; ///< \ru Угол поворота плоскости "XY" ЛСК и параметрической плоскости "UV" поверхности. \en The angle of rotation of the LSC "XY" plane and the parametric "UV" plane of the surface. \~
bool sense; ///< \ru Совпадают ли направления оси "X" ЛСК и оси "U" поверхности? \en Whether the directions of the "X" axis of the LSC and the "U" axis of the surface coincide? \~
bool equals; ///< \ru Должны ли длины кривых на другом носителе соответствовать оригиналам? \en Should the lengths of the curves on another medium match the originals? \~
VERSION version; ///< \ru Версия алгоритма. \en The version. \~
MbPlacement3D place; ///< \ru Локальная система координат (ЛСК). \en The local coordinate system (LCS) of the curves. \~
MbCartPoint xy; ///< \ru Точка привязки на плоскости XY локальной системы координат. \en The anchor point on the "XY" plane of the LCS that will be aligned with the uv point on the parametric plane of the surface. \~
MbCartPoint uv; ///< \ru Точка привязки в параметрической плоскости "UV" параметров поверхности. \en The anchor point in the parametric plane "UV" of the surface parameters. \~
double angle; ///< \ru Угол поворота плоскости "XY" ЛСК и параметрической плоскости "UV" поверхности. \en The angle of rotation of the LSC "XY" plane and the parametric "UV" plane of the surface. \~
bool sense; ///< \ru Совпадают ли направления оси "X" ЛСК и оси "U" поверхности? \en Whether the directions of the "X" axis of the LSC and the "U" axis of the surface coincide? \~
bool equals; ///< \ru Должны ли длины кривых на другом носителе соответствовать оригиналам? \en Should the lengths of the curves on another medium match the originals? \~
bool uSeamStitch; ///< \ru Нужно ли сдвинуть кривые, попавшие краем на шов umax. \en Whether to shift curves with one end on umax seam. \~
VERSION version; ///< \ru Версия алгоритма. \en Algorithm version. \~
public:
/** \brief \ru Конструктор.
@@ -1110,7 +1111,7 @@ public:
VERSION ver_ );
/** \brief \ru Конструктор.
/** \brief \ru Конструктор.
\en Constructor.\~
\details \ru Конструктор.
\en Constructor.\~
@@ -1153,7 +1154,7 @@ public:
VERSION ver_ );
/** \brief \ru Конструктор.
/** \brief \ru Конструктор.
\en Constructor.\~
\details \ru Конструктор.
\en Constructor.\~
@@ -1207,6 +1208,14 @@ public:
*/
MbCurvesWrappingParams( const MbCurvesWrappingParams & other, bool copyCurves, bool copySurface );
/** \brief \ru Конструктор копирования, копирует кривые и поверхности.
\en Copy constructor, copies curves and surfaces.\~
\details \ru Конструктор копирования, копирует кривые и поверхности.
\en Copy constructor, copies curves and surfaces.\~
*/
MbCurvesWrappingParams( const MbCurvesWrappingParams & other )
: MbCurvesWrappingParams( other, true, true ) {}
/// \ru Деструктор. \ en Destructor.
~MbCurvesWrappingParams() {}
@@ -1251,17 +1260,46 @@ public:
void SetAngle( double a ) { angle = a; }
/// \ru Совпадают ли направления оси "X" ЛСК и оси "U" поверхности. \en Does the coincidence of the directions of the "X" axis of the LSC and the "U" axis of the surface. \~
bool IsSense() const { return sense; }
/// \ru Установить флаг совпадения направления оси "X" ЛСК и оси "U" поверхности. \en Set the coincidence of the directions of the "X" axis of the LSC and the "U" axis of the surface. \~
void SetSense( bool s ) { sense = s; }
/// \ru Соответствует ли длина кривых в плоскости и на поверхности? \en Does the curves length correspond to the originals on the surface? \~
bool IsEquals() const { return equals; }
/// \ru Установить требование совпадения длины кривых в плоскости и на поверхности? \en Set the curves length correspondence to the originals on the surface? \~
void SetEquals( bool e ) { equals = e; }
/// \ru Дать точность построения. \en Get an accuracy. \~
double GetAccuracy() const { return GetPrecision(); }
/// \ru Установить точность построения. \en Set an accuracy. \~
void SetAccuracy( double acc ) { SetPrecision( acc ); }
/// \ru Версия алгоритма. \en The version. \~
VERSION GetVersion() const { return version; }
/// \ru Установить версию алгоритма. \en Set the algorithm version. \~
void SetVersion( VERSION ver ) { version = ver; }
/** \brief \ru Нужно ли сдвинуть кривые, попавшие одним краем на шов Umax.
\en Whether to shift curves with one end on Umax seam.\~
\details \ru Нужно ли сдвинуть кривые, попавшие краем на шов Umax. Если кривая попадает одним краем на шов Umax,
а другим не попадает ни на Umax, ни на Umin, то сдвинуть эту кривую на Umax-Umin. Это упрощённая
стыковка кривых, которые в 3д соединяются краями на шве, но в 2д разнесены на период. При включении
этого флага на развёртке они также будут стыковаться.
\en Whether to shift curves with one end on Umax seam. If one curve end is on the Umax seam and the other
is neither on Umax nor Umin, then shift the curve for Umax-Umin. This is a simplified stitching of
curves which have connected edges in 3d on the seam, but in 2d are spaced apart on a period.
If this flag is enabled, those unwrapped curves are alse connected. \~
*/
bool GetUSeamStitch() const { return uSeamStitch; }
/** \brief \ru Нужно ли сдвинуть кривые, попавшие одним краем на шов Umax.
\en Whether to shift curves with one end on Umax seam.\~
\details \ru Нужно ли сдвинуть кривые, попавшие краем на шов Umax. Если кривая попадает одним краем на шов Umax,
а другим не попадает ни на Umax, ни на Umin, то сдвинуть эту кривую на Umax-Umin. Это упрощённая
стыковка кривых, которые в 3д соединяются краями на шве, но в 2д разнесены на период. При включении
этого флага на развёртке они также будут стыковаться.
\en Whether to shift curves with one end on Umax seam. If one curve end is on the Umax seam and the other
is neither on Umax nor Umin, then shift the curve for Umax-Umin. This is a simplified stitching of
curves which have connected edges in 3d on the seam, but in 2d are spaced apart on a period.
If this flag is enabled, those unwrapped curves are alse connected. \~
*/
void SetUSeamStitch( bool s ) { uSeamStitch = s; }
/** \brief \ru Создать копию текущих параметров.
\en Make a copy of current parameters.\~
\details \ru Создать копию текущих параметров.
@@ -1321,6 +1359,11 @@ KNOWN_OBJECTS_RW_REF_OPERATORS( MbClothoidParams ) // \ru Для работы с
// ---
struct MATH_CLASS MbFairCreateData : public MbPrecision
{
public:
typedef std::vector<std::pair<size_t, MbVector3D> > IndexVectorArray;
private:
IndexVectorArray _fixData; /// \ru Массив данных для фиксации точек и касательных. \en Data array for fixing points and tangents.
public:
// \ru Общие параметры построения плавной кривой. \en The common parameters for a fire curve creation.
MbeFairSmoothing _fairing; ///< \ru Сглаживание. \en Smoothing of curve. \~
@@ -1329,7 +1372,6 @@ public:
MbeFairCurvature _accountCurvature; ///< \ru Учет кривизны в концевых точках. \en Accounting for curvature at end points. \~
MbeFairVector _accountVectorInflect; ///< \ru Учет вектора в точке перегиба при построении NURBzS кривой. \en How to take into account the vector at the inflection point at creating NURBzS. \~
MbeFixPntTng _fixPointTangent; ///< \ru Фиксировать точки на касательных / касательные в точках. \en Fix the points on tangents / the tangents on points.
SArray<int> _fixTangentSigns; ///< \ru Признаки учета касательных на точках / точек на касательных. \en Signs of points on tangents / tangents on points.
// \ru Параметры построения B-сплайновой кривой. \en The Parameters for B-Spline curve creation.
size_t _degree; ///< \ru Степень B-сплайновой кривой m ( 3 <= m <= 10). \en The degree m (3 <= m <= 10) of B-Spline curve. \~
@@ -1344,8 +1386,6 @@ public:
bool _fixFirstPointNoisy; ///< \ru Флаг фиксации сплайна в начальной точке. \en Flag of fixing a spline at the first point.
bool _fixLastPointNoisy; ///< \ru Флаг фиксации сплайна в конечной точке. \en Flag of fixing a spline at the last point.
SArray<size_t> _arrayFixNoisyNum; ///< \ru Номера точек точных значений зашумленных точек. \en Signs of exactly noisy points.
// \ru Диагностика. \en The diagnostics.
MbeFairWarning _warning; ///< \ru Предупреждение о работе. \en The operation warning. \~
MbResultType _error; ///< \ru Ошибка о работе. \en The operation error. \~
@@ -1359,7 +1399,7 @@ public:
MbFairCreateData() : MbPrecision( METRIC_ACCURACY * 0.1, ANGLE_REGION ),
_fairing( fairSmooth_Yes ), _arrange( false ), _subdivision( fairSubdiv_Single ),
_accountCurvature( fairCur_No ), _accountVectorInflect( fairVector_Tangent ), _fixPointTangent( fixPntTng_NotFix ),
_degree( 8 ), _approx( fairApprox_IsoNurbs ), _tangentCorrect( true ),
_degree( 8 ), _approx( fairApprox_IsoSpline ), _tangentCorrect( true ),
_smoothTorsion( false ), _iterationsNumber( 1000 ),
_noisyDeviation( 0.002 ), _noisyIterations( 200 ),
_fixFirstPointNoisy( false ), _fixLastPointNoisy( false ),
@@ -1370,6 +1410,13 @@ public:
~MbFairCreateData() {}
// \ru Инициализировать данные для фиксации точек и касательных. \en Initialize данные для фиксации точек и касательных..
void InitFixConstraints( const std::vector<std::pair<size_t, MbVector3D *>> & constraints );
//< \ru Получить данные для фиксации точек и касательных. \en Get данные для фиксации точек и касательных.
const IndexVectorArray & GetFixConstraints() const { return _fixData; }
/// \ru Оператор присваивания. \en Assignment operator.
MbFairCreateData & operator = ( const MbFairCreateData & other );
+43 -7
View File
@@ -278,12 +278,17 @@ public:
const c3d::PlaneContoursSPtrVector & GetContours() const { return contours; }
/// \ru Выдать набор трехмерных контуров. \en Get the set of three-dimensional contours.
const c3d::SpaceContoursSPtrVector & GetContours3D() const { return contours3D; }
/// \ru Выдать проволочный каркас. \en Get the wire frame.
const MbWireFrame * GetWireFrame() const { return wireFrame; }
/// \ru Выдать проволочный каркас для изменения. \en Get the wire frame for editing.
MbWireFrame * SetWireFrame() const { return wireFrame; }
/// \ru Выдать тело. \en Get the solid.
const MbSolid * GetSolid() const { return solid; }
const MbSolid * GetSolid() const { return solid; }
/// \ru Выдать тело для изменения. \en Get the solid for editing.
MbSolid * SetSolid() const { return solid; }
MbSolid * SetSolid() const { return solid; }
/// \ru Перестроить объект по журналу построения. Для перестроения проволочного каркаса. \en Rebuild object according to the history tree. For rebuilding the wire frame.
void RebuildItem();
void RebuildItem();
/** \brief \ru Выдать двумерные контуры с поверхностью или трехмерные контуры, полученные с проволочного каркаса.
\en Get two-dimensional contours with a surface or three-dimensional contours obtained from a wireframe. \~
@@ -442,6 +447,18 @@ public:
double rake;
protected:
/** \brief \ru Строгое соблюдение заданного угла уклона.
\en Strict adherence to the specified draft angle. \~
\details \ru Строгое соблюдение заданного угла уклона.\n
При значении true каждая боковая грань операции с уклоном должна быть построена строго под заданным углом уклона,
иначе операция не будет выполнена.
\en Strict adherence to the specified draft angle.\n
If set to true, each side face of a taper operation must be built strictly at the specified taper angle,
otherwise, the operation will not be performed. \~
*/
bool strictRake;
/** \brief \ru Поверхность, до которой строим операцию.
\en The surface to construct up to. \~
\details \ru Поверхность, до которой строим операцию.\n
@@ -486,6 +503,7 @@ public:
, scalarValue( 0.0 )
, distance ( 0.0 )
, rake ( 0.0 )
, strictRake ( false )
, surface ( nullptr )
, sameSense ( orient_BOTH )
{}
@@ -502,6 +520,7 @@ public:
, scalarValue( sVal )
, distance ( 0.0 )
, rake ( 0.0 )
, strictRake ( false )
, surface ( nullptr )
, sameSense ( orient_BOTH )
{}
@@ -567,13 +586,19 @@ public:
/// \ru Доступ к признаку совпадения нормали поверхности с нормалью грани. \en Access to the attribute of coincidence between the surface normal and the face normal.
MbeSenseValue & SetSameSense() { return sameSense; }
/// \ru Задан признак строгого соблюдения угла уклона. \en A sign of strict observance of the draft angle is set.
bool IsStrictRake() const { return strictRake; }
/// \ru Установить признак строгого соблюдения угла уклона. \en Set a sign of strict observance of the draft angle.
void SetStrictRake( bool strict ) { strictRake = strict; }
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const MbSweptSide & other, double accuracy ) const
{
if ( (other.way == way) && (other.sameSense == sameSense) ) {
if ( (::fabs(other.scalarValue - scalarValue) < accuracy) &&
(::fabs(other.distance - distance) < accuracy) &&
(::fabs(other.rake - rake) < accuracy) )
(::fabs(other.rake - rake) < accuracy) &&
( strictRake == other.strictRake ) )
{
bool isSurf1 = (surface != nullptr);
bool isSurf2 = (other.surface != nullptr);
@@ -2218,7 +2243,7 @@ public :
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbSectionLayout( const MbPlacement3D & pl, const MbCartPoint3D & pnt1, const MbCartPoint3D & pnt2,
const MbVector3D & vec1, const MbVector3D & vec2, const MbCartPoint3D & apx )
const MbVector3D & vec1, const MbVector3D & vec2, const MbCartPoint3D & apx )
: place ( pl )
, point1 ( pnt1 )
, point2 ( pnt2 )
@@ -2249,6 +2274,9 @@ public :
vec2 = vector2;
apx = apex;
}
/// \ru Выдать значения объектов и полложение центра скеругления. \en Get an object values and the fillet center position. \~
void CentreLayout( MbPlacement3D & pl, MbCartPoint3D & pnt1, MbCartPoint3D & pnt2,
MbVector3D & vec1, MbVector3D & vec2, MbCartPoint3D & apx, MbCartPoint3D & centre ) const;
/// \ru Установить значения объектов. \en Set an object values. \~
void SetLayout( const MbPlacement3D & pl, const MbCartPoint3D & pnt1, const MbCartPoint3D & pnt2,
const MbVector3D & vec1, const MbVector3D & vec2, const MbCartPoint3D & apx )
@@ -2308,7 +2336,7 @@ public :
/// \ru Деструктор. \en Destructor.
~MbSectionPhantom() {}
/// \ru Выдать значения объектов. \en Get an object values. \~
/// \ru Выдать значения объектов для края по его индексу i. \en Get an object values for the side by its index i. \~
void GetLayout( size_t i, MbPlacement3D & pl, MbCartPoint3D & pnt1, MbCartPoint3D & pnt2,
MbVector3D & vec1, MbVector3D & vec2, MbCartPoint3D & apx ) const {
if ( i == 1 )
@@ -2316,7 +2344,15 @@ public :
else
endLayout.GetLayout( pl, pnt1, pnt2, vec1, vec2, apx );
}
/// \ru Установить значения объектов. \en Set an object values. \~
/// \ru Выдать значения объектов для края по его индексу i. \en Get an object values for the side by its index i. \~
void CentreLayout( size_t i, MbPlacement3D & pl, MbCartPoint3D & pnt1, MbCartPoint3D & pnt2,
MbVector3D & vec1, MbVector3D & vec2, MbCartPoint3D & apx, MbCartPoint3D & centre ) const {
if ( i == 1 )
begLayout.CentreLayout( pl, pnt1, pnt2, vec1, vec2, apx, centre );
else
endLayout.CentreLayout( pl, pnt1, pnt2, vec1, vec2, apx, centre );
}
/// \ru Установить значения объектов для края по его индексу i. \en Set an object values for the side by its index i. \~
void SetLayout( size_t i, const MbPlacement3D & pl, const MbCartPoint3D & pnt1, const MbCartPoint3D & pnt2,
const MbVector3D & vec1, const MbVector3D & vec2, const MbCartPoint3D & apx ) {
if ( i == 1 )
+10
View File
@@ -211,6 +211,16 @@ void DeleteMatItems( Vector & items )
}
//------------------------------------------------------------------------------
// \ru Сделать копию объекта и вернуть умный указатель на неё. \en Create a copy if object and return a smart pointer of the copy.
// ---
template <class Type, class RegType>
SPtr<Type> Clone( const Type & item, RegType * iReg )
{
return SPtr<Type>{ &(item.Duplicate( iReg )) };
}
//------------------------------------------------------------------------------
/// \ru Сделать копию, если объект используется, иначе вернуть оригинал. \en Create a copy if object is used, otherwise return original.
// ---
+3 -2
View File
@@ -161,10 +161,11 @@ enum MbeSpaceType {
st_Rough = 406, ///< \ru Обозначение шероховатости. \en Designation of roughness.
st_Leader = 407, ///< \ru Обозначение линии выноски. \en Designation of the leader line.
st_Dimension3D = 408, ///< \ru Размер. \en Dimension
st_LinearDimension3D = 409, ///< \ru Линейный размер. \en Linear dimension.
st_LinearDimension3D = 409, ///< \ru Линейный размер. \en Linear dimension.
st_DiameterDimension3D = 410, ///< \ru Диаметральный размер. \en Diameter dimension.
st_RadialDimension3D = 411, ///< \ru Радиальный размер. \en Radial dimension.
st_AngularDimension3D = 412, ///< \ru Угловой размер. \en Angular dimension.
st_AngularDimension3D = 412, ///< \ru Угловой размер. \en Angular dimension.
st_PMI = 413, ///< \ru Элемент аннотации. \en Annotation item..
st_FreeLegend = 500, ///< \ru Тип для вспомогательных объектов, созданных пользователем. \en Type for the user helper objects. \n
// \ru Типы объектов модели геометрического ядра с журналом построения и атрибутами. \en Model object types with history tree and attributes.
+2 -1
View File
@@ -187,8 +187,9 @@ public:
/// \ru Локальная система координат. \en A local coordinate system.
const MbPlacement3D & GetPlacement() const { return position; }
MbPlacement3D & SetPlacement() { return position; }
/// \ru Установить локальную систему координат. \en Set the local coordinate system.
void InitPlacement( MbPlacement3D & p ) { position.Init( p ); }
void InitPlacement( const MbPlacement3D & p ) { position.Init( p ); }
/// \ru Является ли система координат ортонормированной. \en Whether the coordinate system is orthonormalized.
bool IsPositionNormal() const { return ( !position.IsAffine() ); }
/// \ru Является ли система координат ортогональной и изотропной по осям. \en Whether the coordinate system is orthogonal and isotropic by the axes.
+1
View File
@@ -312,6 +312,7 @@ public:
MbSurface & SetBasisSurface() override; // \ru Дать базовую поверхность. \en Get the base surface.
bool GetCylinderAxis( MbAxis3D & ) const override; // \ru Дать ось вращения для поверхности. \en Get a rotation axis of a surface.
bool GetCenterLines( std::vector<MbCurve3D *> & clCurves ) const override; // \ru Дать осевые (центральные) линии для поверхности. \en Get center lines of a surface.
// \ru Подобные ли поверхности для объединения (слива). \en Whether the surfaces to union (joining) are similar.
bool IsSimilarToSurface( const MbSurface & surf, VERSION version, double precision = METRIC_PRECISION ) const override;
// \ru Дать двумерную матрицу преобразования из своей параметрической области в параметрическую область surf. \en Get two-dimensional transformation matrix from own parametric region to parametric region of 'surf'.
+5
View File
@@ -13,6 +13,7 @@
#include <templ_fdp_array_.h>
#include <templ_rp_array.h>
#include <templ_sptr.h>
#include <algorithm>
//#include <xutility>
@@ -133,6 +134,10 @@ public: // \ru Стандартные функции контейнерного
///< \ru Получить указатель на участок памяти после массива. \en Get the pointer to the piece of memory after the array.
using RPArray<Type>::end; //const stored_type * end() const { return RPArray<Type>::end(); }
public: // \ru Функции для упрощения перехода на std::vector<SPtr<Type>>. \en Functions to replace this class to std::vector<SPtr<T>>.
void push_back( const SPtr<Type> & elem ) { Add(elem.get()); }
void clear() { Flush(); }
void erase( typename RPArray<Type>::TPtr * ptr ) { RemoveInd( ptr - RPArray<Type>::begin()); }
public: // \ru Доступные методы от RPArray<Type> \en Available methods from RPArray<Type>
using RPArray<Type>::Adjust;
+8 -1
View File
@@ -962,6 +962,8 @@ public :
/// \ru Получить параметры разрезки для периодического ребра. \en Get the cutting parameters for a periodic edge.
bool CutPeriodicEdge( const MbVector3D & eye, SSArray<double> & trimParams,
double & delT1, double & delT2 ) const;
/// \ru Согласовать тип кроивой пересечения. \en Agree on the type of intersection curve.
void AgreeBuildType( double tCurve );
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
OBVIOUS_PRIVATE_COPY( MbCurveEdge )
@@ -1118,10 +1120,15 @@ public :
/// \ru Установить свойства объекта. \en Set properties of the object.
void SetProperties( const MbProperties & );
// \ru Дать информацию для конвертеров. \en Get information for converters.
// \ru Дать информацию для конвертеров. \en Get information for converters.
DEPRECATE_DECLARE_REPLACE( GetFinCurve with 'SPtr' argument )
void GetFinCurve( const MbSurface &, MbCurve *&, bool & );
void GetFinCurve( const MbSurface &, SPtr<MbCurve> &, bool & );
// \ru Дать информацию для конвертеров. \en Get information for converters.
DEPRECATE_DECLARE_REPLACE( GetFin with 'SPtr' argument )
void GetFin( const MbSurface &, bool, MbCurve *&, bool & ) const;
void GetFin( const MbSurface &, bool, SPtr<MbCurve> &, bool & ) const;
// \ru Нормализовать fin по ChooseCurve() и установить правило выбора для конвертеров. \en Normalize 'fin' by ChooseCurve() and set the rule for selection of convertors.
void NormalizeFin();
// \ru Установить правило выбора для конвертеров. \en Set the rule for selection of converters.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.