- C3d aggiornamento delle librerie ( 117922).
This commit is contained in:
SaraP
2022-11-07 15:43:25 +01:00
parent 8a651174ac
commit 4e8d0af1a3
45 changed files with 959 additions and 365 deletions
+34 -5
View File
@@ -35,7 +35,6 @@ class MATH_CLASS MbSurface;
class MATH_CLASS MbItem;
class MATH_CLASS MbName;
class MATH_CLASS MbSweptData;
class MATH_CLASS MbCurveExtensionParameters;
class MATH_CLASS MbSNameMaker;
class MATH_CLASS MbContourChamferParams;
class MATH_CLASS MbNurbsCopyCurveResult;
@@ -1140,11 +1139,41 @@ MATH_FUNC (MbResultType) CreateFairBSplineCurveOnBasePolylineOfHermiteGD( MbCurv
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC( MbResultType ) CreateFairBSplineCurveOnBasePolylineOfHermiteGDInflex( MbCurve3D * pllne,
MATH_FUNC( MbResultType ) CreateFairBSplineCurveOnBasePolylineOfHermiteGDInflex( const MbCurve3D * pllne,
MbFairCurveData & data,
MbCurve3D *& resCurve );
// ------------------------------------------------------------------------------
// Создать плавную B-сплайновую кривую [со сглаживанием и репараметризацией] на зашумленных данных
// (опорной ломаной, ГО Эрмита)
// ---
//------------------------------------------------------------------------------
/** \brief \ru Создать плавную B-сплайновую кривую (со сглаживанием и репараметризацией) на зашумленных данных.
\en Create a fair B-spline curve with smoothing and reparametrization on noisy data. \~
\details \ru Создать плавную B-сплайновую кривую [со сглаживанием и репараметризацией] на зашумленных данных
(опорной ломаной, ГО Эрмита).
\en Create a fair B-spline curve with smoothing and reparametrization on noisy data (base polyline of Hermite GD). \n
\attention \ru Экспериментальный класс. \en Experimental class. \~
\param[in] polyline - \ru Исходная ломаная.
\en An initial polyline. \~
\param[in] inType - \ru Тип данных построения кривой.
\en The type of the curve construction data. \~
\param[in] data - \ru Данные построения кривой.
\en The curve construction data. \~
\param[out] resCurve - \ru Сплайновая кривая.
\en The spline curve. \~
\return \ru Возвращает значение результата операции. 0 - при успешном построении кривой. При > 0 значение равно номеру сообщения об ошибке из списка сообщений метода MessageError.
\en Returns operation result value. 0 - upon successful creation of the curve. If > 0, the value is equal to the error message number from the message list of the MessageError method.\~
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC( MbResultType ) CreateFairBSplineCurveOnNoisyData( MbCurve3D* pllne,
int inType, // 1 - простая ломаная, 2 - ГО Эрмита
MbFairCurveData & data,
MbCurve3D *& resCurve );
//------------------------------------------------------------------------------
/** \brief \ru Создать плавную B-сплайновую кривую на касательных прямых ГО Эрмита.
\en Create a fair B-spline curve on tangent lines of Hermite GD. \~
@@ -1496,9 +1525,9 @@ MATH_FUNC ( MbCurve3D * ) SetProportionalParametrization( MbCurve3D * curve,
\en Under development. \~
*/
// ---
MATH_FUNC( MbResultType ) ExtendCurve( const MbCurve3D & sourceCurve,
const MbCurveExtensionParameters & parameters,
c3d::WireFrameSPtr & resFrame );
MATH_FUNC( MbResultType ) ExtendCurve( const MbCurve3D & sourceCurve,
const MbCurveExtensionParameters3D & parameters,
c3d::WireFrameSPtr & resFrame );
//------------------------------------------------------------------------------
+14 -8
View File
@@ -149,8 +149,8 @@ MATH_FUNC (MbResultType) OffsetShell( MbSolid & solid,
\en Create an open solid from a point set specified in parameters. \n \~
\deprecated \ru Функция устарела, взамен использовать #NurbsSurfacesShell с набором параметров #MbNurbsSurfacesShellParams.
\en The function is deprecated, instead use #NurbsSurfacesShell with the parameter list #MbNurbsSurfacesShellParams. \~
\param[in] params - \ru Параметры операции.
\en The operation parameters. \~
\param[in, out] params - \ru Параметры операции.
\en The operation parameters. \~
\param[in] operNames - \ru Именователь.
\en An object for naming the new objects. \~
\param[in] isPhantom - \ru Режим создания фантома.
@@ -177,8 +177,8 @@ MATH_FUNC (MbResultType) NurbsSurfacesShell( NurbsSurfaceValues & params,
\en Create an open solid from a point set. \~
\details \ru Построить незамкнутое тело по множеству точек, заданных в параметрах построения. \n
\en Create an open solid from a point set specified in parameters. \n \~
\param[in] params - \ru Параметры операции.
\en The operation parameters. \~
\param[in, out] params - \ru Параметры операции.
\en The operation parameters. \~
\param[out] result - \ru Результирующая оболочка.
\en The required shell. \~
\param[in, out] progBar - \ru Индикатор прогресса выполнения операции.
@@ -188,9 +188,9 @@ MATH_FUNC (MbResultType) NurbsSurfacesShell( NurbsSurfaceValues & params,
\ingroup Shell_Modeling
*/
// ---
MATH_FUNC (MbResultType) NurbsSurfacesShell( const MbNurbsSurfacesShellParams & params,
c3d::SolidSPtr & result,
IProgressIndicator * progBar );
MATH_FUNC (MbResultType) NurbsSurfacesShell( MbNurbsSurfacesShellParams & params,
c3d::SolidSPtr & result,
IProgressIndicator * progBar );
//------------------------------------------------------------------------------
@@ -582,7 +582,13 @@ MATH_FUNC (MbResultType) DivideShell( MbSolid & solid,
/** \brief \ru Разделить оболочку на части по заданному набору ребер.
\en Divide a shell into parts using a given set of edges. \~
\details \ru Разделить оболочку на части по заданному набору ребер. \n
\en Divide shell into parts using a given set of edges. \n \~
Разделение тела\оболочки выполняется путем удаления в ребрах топологических связей между смежными гранями.
После выполнения операции весь результат будет в находится в результирующей оболочке.
Для разделения оболочки на части, далее используйте функции CreateParts или DetachParts
\en Divide shell into parts using a given set of edges. \n
Dividing of the body\shell is performed by removing topological connections in the edges between adjacent faces.
When the operation is completed, the entire result will be in the resulting shell.
Use the CreateParts or DetachParts functions to separate the shell into parts. \~
\param[in] solid - \ru Оболочка.
\en A shell. \~
\param[in] params - \ru Параметры деления оболочки.
+10
View File
@@ -62,6 +62,16 @@ void MergeCoincidentPoints( c3d::SpacePointsVector & points,
c3d::MeshTrianglesVector & triangles,
double epsilon );
//------------------------------------------------------------------------------
// Удалить дублирующие с заданной точностью друг друга точки с помощью кд-дерева.
// ---
void MergeCoincidentPoints( const c3d::SpacePointsVector & points,
c3d::SpacePointsVector & pointsMerged,
c3d::IndicesVector & mapVertex,
double epsilon );
//------------------------------------------------------------------------------
// Объединить ребра двух смежных плоских граней с полигональной границей
// (возвращает общее после сшивки ребро)
+80
View File
@@ -0,0 +1,80 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief \ru Атрибут Uuid для вставок.
\en Uuid attribute for instances. \~
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __ATTR_UUID_ATTRIBUTE_H
#define __ATTR_UUID_ATTRIBUTE_H
#include <attr_common_attribute.h>
#include <tool_uuid.h>
//------------------------------------------------------------------------------
/** \brief \ru Атрибут Uuid для вставок (MbInstance).
\en Uuid attribute for instances (MbInstance). \~
\details \ru Атрибут Uuid должен применяться только для вставок (MbInstance).
\en Uuid attribute should be applied to instances (MbInstance) only. \n \~
\ingroup Model_Attributes
*/
class MATH_CLASS MbUuidInstanceAttribute : public MbCommonAttribute {
protected :
MbUuid _uuid; ///< ru Глобально уникальный идентификатор. \en Global unique identifier.
public :
/// \ru Конструктор. \en Constructor.
MbUuidInstanceAttribute( const MbUuid & uuid, const bool changeable, const c3d::string_t & prompt );
/// \ru Конструктор. \en Constructor.
MbUuidInstanceAttribute( const MbUuid & uuid, const bool changeable = true );
/// \ru Деструктор. \en Destructor.
virtual ~MbUuidInstanceAttribute();
private:
// \ru Конструктор копирования. \en Copy constructor.
MbUuidInstanceAttribute( const MbUuidInstanceAttribute & init, MbRegDuplicate * iReg );
public:
// \ru Выдать подтип атрибута. \en Get subtype of an attribute.
MbeAttributeType AttributeType() const override;
// \ru Сделать копию элемента. \en Create a copy of the element.
MbAttribute & Duplicate( MbRegDuplicate * = nullptr ) const override;
// \ru Определить, являются ли объекты равными. \en Determine whether objects are equal.
bool IsSame( const MbAttribute &, double accuracy ) const override;
// \ru Инициализировать данные по присланным. \en Initialize data.
bool Init( const MbAttribute & ) override;
// \ru Выполнить действия при изменении владельца, не связанное с другими действиями. \en Perform actions which are not associated with other actions when changing the owner.
void OnChangeOwner( const MbAttributeContainer & owner ) override;
// \ru Выполнить действия при конвертации владельца. \en Perform actions when converting the owner.
void OnConvertOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ) override;
// \ru Выполнить действия при замене владельца. \en Perform actions when replacing the owner.
void OnReplaceOwner( const MbAttributeContainer & owner, MbAttributeContainer & other ) override;
// \ru Выполнить действия при разделении владельца. \en Perform actions when splitting the owner.
// \ru Выполнить действия при удалении владельца. \en Perform actions when deleting the owner.
void OnDeleteOwner( const MbAttributeContainer & owner ) override;
void GetCharValue( TCHAR * v ) const override; // \ru Выдать строковое значение свойства. \en Get a string value of the property.
void GetProperties( MbProperties & ) override; // \ru Выдать свойства объекта. \en Get properties of the object.
size_t SetProperties( const MbProperties & ) override; // \ru Установить свойства объекта. \en Set properties of object.
MbePrompt GetPropertyName() override; // \ru Выдать заголовок свойства объекта. \en Get a name of object property.
/// \ru Инициализировать значением Uuid. \en Initialize with Uuid value.
void Init( const MbUuid & uuid ) { _uuid = uuid; }
/// \ru Задать значение Uuid. \en Set Uuid value.
void SetUuid( const MbUuid & uuid ) { _uuid = uuid; }
/// \ru Получить значение Uuid. \en Get Uuid value.
const MbUuid & GetUuid() const { return _uuid; }
DECLARE_PERSISTENT_CLASS( MbUuidInstanceAttribute )
OBVIOUS_PRIVATE_COPY( MbUuidInstanceAttribute )
};
IMPL_PERSISTENT_OPS( MbUuidInstanceAttribute )
#endif // __ATTR_UUID_ATTRIBUTE_H
+1
View File
@@ -87,6 +87,7 @@ enum MbeAttributeType
at_Int32VectorAttribute = 211, ///< \ru Атрибут массив целочисленных значений типа int32. \en Array of integer (int32) values attribute.
at_Int64VectorAttribute = 212, ///< \ru Атрибут массив целочисленных значений типа int64. \en Array of integer (int64) values attribute.
at_DoubleVectorAttribute = 213, ///< \ru Атрибут массив действительных чисел типа double. \en Array of real (double) values attribute.
at_UuidInstanceAttribute = 214, ///< \ru Атрибут Uuid для вставок. \en Uuid attribute for instances.
at_CommonLast = 300, ///< \ru Обобщенные атрибуты вставлять перед этим значением. \en Common attributes should be inserted before this value. \n
// \ru Типы связующих атрибутов. \en Types of linking attributes.
+65 -13
View File
@@ -24,15 +24,16 @@ class MATH_CLASS MbDraftSolidParams;
// ---
class MATH_CLASS MbDraftSolid: public MbCreator {
protected:
double angle; ///< \ru Угол уклона. \en Draft angle.
c3d::ItemIndices faceIndices; ///< \ru Номера множества уклоняемых граней. \en Indices of faces to draft.
MbeFacePropagation fp; ///< \ru Признак захвата граней ( face propagation ). \en Flag of face propagation.
double angle; ///< \ru Угол уклона. \en Draft angle.
c3d::ItemIndices faceIndices; ///< \ru Индексы множества уклоняемых граней. \en Indices of faces to draft.
SArray<MbEdgeFacesIndexes> edgeIndices; ///< \ru Индексы множества нейтральных ребер. \en Indices of edges to draft.
MbeFacePropagation fp; ///< \ru Признак захвата граней ( face propagation ). \en Flag of face propagation.
// \ru Атрибуты, определяющие направление тяги (pull direction) и нейтральную изолинию уклона. \en Attributes determining the pull direction and the neutral isoline of the draft.
MbPlacement3D * np; ///< \ru Нейтральная плоскость ( neutral plane ) ( не обязателен ). \en Neutral plane (optional).
ptrdiff_t edgeNb; ///< \ru Номер прямолинейного ребра, направляющего уклон ( не обязателен ). \en The index of straight edge specifying the draft (optional).
SArray<ptrdiff_t> * pl; ///< \ru Линии разъема (ребра) ( parting line ) ( не обязателен ). \en Parting lines (of edge) (optional).
bool reverse; ///< \ru Обратное направление тяги. \en Reverse pull direction.
bool step; ///< \ru Ступенчатый способ уклона. \en Stepwise method of draft.
MbPlacement3D * np; ///< \ru Нейтральная плоскость ( neutral plane ) ( не обязателен ). \en Neutral plane (optional).
ptrdiff_t edgeNb; ///< \ru Номер прямолинейного ребра, направляющего уклон ( не обязателен ). \en The index of straight edge specifying the draft (optional).
SArray<ptrdiff_t> * pl; ///< \ru Линии разъема (ребра) ( parting line ) ( не обязателен ). \en Parting lines (of edge) (optional).
bool reverse; ///< \ru Обратное направление тяги. \en Reverse pull direction.
bool step; ///< \ru Ступенчатый способ уклона. \en Stepwise method of draft.
public:
/// \ru Конструктор уклона по известной нейтральной плоскости. \en Constructor of drafting by the given neutral plane.
@@ -40,11 +41,12 @@ public:
double ang, // угол уклона
const std::vector<MbItemIndex> & faceInds, // номера множества уклоняемых граней
MbeFacePropagation faceProp, // признак захвата граней
bool rev, // обратное направление тяги
bool rev, // обратное направление тяги
const MbSNameMaker & n )
: MbCreator ( n )
, angle ( ang )
, faceIndices( faceInds )
, edgeIndices( )
, fp ( faceProp )
, np ( new MbPlacement3D( nPlace ) )
, edgeNb ( -1 )
@@ -53,7 +55,7 @@ public:
, step ( false )
{
}
// \ru Конструктор уклона по линии разъема \en Constructor of drafting by the parting line
/// \ru Конструктор уклона по линии разъема \en Constructor of drafting by the parting line
MbDraftSolid( double ang, // угол уклона
const MbPlacement3D * nPlace, // нейтральная плоскость ( neutral plane )
ptrdiff_t edgeInd, // номер прямолинейного ребра - направляющего уклон ( не обязателен )
@@ -65,6 +67,7 @@ public:
: MbCreator ( n )
, angle ( ang )
, faceIndices( )
, edgeIndices( )
, fp ( faceProp )
, np ( nPlace ? new MbPlacement3D( *nPlace ) : nullptr )
, edgeNb ( edgeInd )
@@ -73,14 +76,61 @@ public:
, step ( st )
{
}
/// \ru Конструктор уклона по линии разъема и уклоняемым граням \en Constructor of drafting by the parting line and drafting faces
MbDraftSolid( double ang, // угол уклона
const MbPlacement3D * nPlace, // нейтральная плоскость ( neutral plane )
ptrdiff_t edgeInd, // номер прямолинейного ребра - направляющего уклон ( не обязателен )
MbeFacePropagation faceProp, // признак захвата граней
const std::vector<MbItemIndex> & faceInds, // индексы множества уклоняемых граней
const SArray<ptrdiff_t> & partLines, // линии разъема (ребра) (parting line) (не обязателен)
bool rev, // обратное направление тяги
bool st, // ступенчатый способ уклона
const MbSNameMaker & n )
: MbCreator ( n )
, angle ( ang )
, faceIndices( faceInds )
, edgeIndices( )
, fp ( faceProp )
, np ( nPlace ? new MbPlacement3D( *nPlace ) : nullptr )
, edgeNb ( edgeInd )
, pl ( new SArray<ptrdiff_t>( partLines ) )
, reverse ( rev )
, step ( st )
{
}
/// \ru Конструктор уклона по нейтральным ребрам и уклоняемым граням \en Constructor of drafting by the parting line and drafting faces
MbDraftSolid( double ang, // угол уклона
const MbPlacement3D * nPlace, // нейтральная плоскость ( neutral plane )
ptrdiff_t edgeInd, // номер прямолинейного ребра - направляющего уклон ( не обязателен )
MbeFacePropagation faceProp, // признак захвата граней
const std::vector<MbItemIndex> & faceInds, // индексы множества уклоняемых граней
const SArray<MbEdgeFacesIndexes> & edgeInds, // индексы множества нейтральных ребер
bool rev, // обратное направление тяги
bool st, // ступенчатый способ уклона
const MbSNameMaker & n )
: MbCreator ( n )
, angle ( ang )
, faceIndices( faceInds )
, edgeIndices( edgeInds )
, fp ( faceProp )
, np ( nPlace ? new MbPlacement3D( *nPlace ) : nullptr )
, edgeNb ( edgeInd )
, pl ( nullptr )
, reverse ( rev )
, step ( st )
{
}
private :
MbDraftSolid( const MbDraftSolid &, MbRegDuplicate * ); // \ru Конструктор копирования \en Copy-constructor
// \ru Конструктор копирования \en Copy-constructor
MbDraftSolid( const MbDraftSolid &, MbRegDuplicate * );
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
MbDraftSolid( const MbDraftSolid & );
public :
virtual ~MbDraftSolid();
// \ru Общие функции математического объекта \en Common functions of the mathematical object
/// \ru Общие функции математического объекта \en Common functions of the mathematical object
MbeCreatorType IsA() const override; // \ru Тип элемента \en A type of element
MbCreator & Duplicate( MbRegDuplicate * = nullptr ) const override;
@@ -96,7 +146,7 @@ public :
bool SetEqual ( const MbCreator & ) override; // \ru Сделать равным \en Make equal
bool IsSimilar( const MbCreator & ) const override; // \ru Являются ли объекты подобными \en Whether the objects are similar
// \ru Общие функции твердого тела \en Common functions of solid
/// \ru Общие функции твердого тела \en Common functions of solid
bool CreateShell( MbFaceShell *&, MbeCopyMode sameShell,
RPArray<MbSpaceItem> * = nullptr ) override; // \ru Построение \en Construction
@@ -176,6 +226,8 @@ MATH_FUNC (MbCreator *) CreateDraft( MbFaceShell * solid,
\result \ru Возвращает строитель оболочки.
\en Returns the shell constructor. \~
\ingroup Model_Creators
\warning \ru В разработке.
\en Under development. \~
*/
// ---
MATH_FUNC (c3d::CreatorSPtr) CreateDraft( c3d::ShellSPtr & solid,
+7 -7
View File
@@ -28,8 +28,8 @@
class MATH_CLASS MbExtendCurveCreator : public MbCreator
{
private:
c3d::SpaceCurveSPtr _sourceCurve; // \ru Исходная (расширяемая) кривая. Всегда не ноль. \en Source (extended) curve. It is not nullptr. \~
MbCurveExtensionParameters _parameters; // \ru Параметры продления. \en Extension parameters. \~
c3d::SpaceCurveSPtr _sourceCurve; // \ru Исходная (расширяемая) кривая. Всегда не ноль. \en Source (extended) curve. It is not nullptr. \~
MbCurveExtensionParameters3D _parameters; // \ru Параметры продления. \en Extension parameters. \~
protected:
/// \ru Конструктор копирования. \en Copy-constructor.
@@ -40,7 +40,7 @@ private:
public:
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbExtendCurveCreator( const MbCurve3D & curve, const MbCurveExtensionParameters & extendParams );
MbExtendCurveCreator( const MbCurve3D & curve, const MbCurveExtensionParameters3D & extendParams );
/// \ru Деструктор. \en Destructor.
~MbExtendCurveCreator() override;
@@ -97,10 +97,10 @@ IMPL_PERSISTENT_OPS( MbExtendCurveCreator )
\en Under development. \~
*/
// ---
MATH_FUNC( c3d::CreatorSPtr ) CreateExtendedCurve( const MbCurve3D & sourceCurve,
const MbCurveExtensionParameters & parameters,
MbResultType & res,
c3d::SpaceCurveSPtr & resCurve );
MATH_FUNC( c3d::CreatorSPtr ) CreateExtendedCurve( const MbCurve3D & sourceCurve,
const MbCurveExtensionParameters3D & parameters,
MbResultType & res,
c3d::SpaceCurveSPtr & resCurve );
#endif // __CR_EXTENDING_CURVE_H
+8 -8
View File
@@ -91,8 +91,8 @@ IMPL_PERSISTENT_OPS( MbNurbsSurfacesSolid )
The function simultaneously creates the shell and its constructor.\n \~
\deprecated \ru Функция устарела, взамен использовать #CreateNurbsShell с набором параметров #MbNurbsSurfacesShellParams.
\en The function is deprecated, instead use #CreateNurbsShell with the parameter list #MbNurbsSurfacesShellParams. \~
\param[in] parameters - \ru Параметры построения.
\en Parameters of a shell creation. \~
\param[in, out] parameters - \ru Параметры построения.
\en Parameters of a shell creation. \~
\param[in] operNames - \ru Именователь граней.
\en An object for naming faces. \~
\param[in] isPhantom - \ru Режим создания фантома.
@@ -124,8 +124,8 @@ MATH_FUNC (MbCreator *) CreateNurbsShell( NurbsSurfaceValues & parameters,
Одновременно с построением оболочки функция создаёт её строитель.\n
\en Construct a shell from NURBS-surfaces MbSplineSurface.
The function simultaneously creates the shell and its constructor.\n \~
\param[in] parameters - \ru Параметры построения.
\en Parameters of a shell creation. \~
\param[in, out] parameters - \ru Параметры построения.
\en Parameters of a shell creation. \~
\param[out] res - \ru Код результата операции.
\en Operation result code. \~
\param[out] shell - \ru Построенная оболочка.
@@ -137,10 +137,10 @@ MATH_FUNC (MbCreator *) CreateNurbsShell( NurbsSurfaceValues & parameters,
\ingroup Model_Creators
*/
// ---
MATH_FUNC (c3d::CreatorSPtr) CreateNurbsShell( const MbNurbsSurfacesShellParams & params,
MbResultType & res,
c3d::ShellSPtr & shell,
IProgressIndicator * indicator = nullptr );
MATH_FUNC (c3d::CreatorSPtr) CreateNurbsShell( MbNurbsSurfacesShellParams & params,
MbResultType & res,
c3d::ShellSPtr & shell,
IProgressIndicator * indicator = nullptr );
#endif // __CR_NURBS_SURFACES_SOLID_H
+1 -1
View File
@@ -430,7 +430,7 @@ public :
void GetWeightCentre( MbCartPoint3D & ) const override;
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
bool Normalize(); ///< \ru Ортонормировать локальную систему координат. \en Orthonormalize the local coordinate system.
bool IsPositionNormal() const { return ( !position.IsAffine() ); }
+1 -1
View File
@@ -220,7 +220,7 @@ public:
MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const override;
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
double Step ( double t, double sag ) const override; // \ru Вычисление шага по стрелке прогиба. \en Calculation of parameter step by the sag.
double DeviationStep( double t, double angle ) const override; // \ru Вычисление шага по углу отклонения нормали. \en Calculation of parameter step by the deviation angle.
+40 -40
View File
@@ -77,7 +77,7 @@ public :
MbContour3D(); ///< \ru Пустой контур. \en Empty contour.
/// \ru Конструктор по набору кривых. \en Constructor by curves.
template <class CurvesVector>
MbContour3D( const CurvesVector & initSegments, bool sameCurves/*, VERSION version = Math::DefaultMathVersion()*/ ); // \ru sameCurves - кривые или их копии \en SameCurves - curves or their copies
MbContour3D( const CurvesVector & initSegments, bool sameCurves, VERSION version = Math::DefaultMathVersion() ); // \ru sameCurves - кривые или их копии \en SameCurves - curves or their copies
protected:
MbContour3D( const MbContour3D &, MbRegDuplicate * ); ///< \ru Конструктор копирования. \en Copy constructor.
public :
@@ -173,7 +173,7 @@ public:
MbCurve3D * Trimmed( double t1, double t2, int sense ) const override; // \ru Создание усеченной кривой \en Creation of a trimmed curve
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
// \ru Изменить направление \en Change direction
void Inverse( MbRegTransform * iReg = nullptr ) override;
@@ -262,7 +262,7 @@ public:
/// \ru Инициализация по набору кривых (sameCurves - кривые или их копии). \en Initialize by curves (sameCurves - curves or their copies).
template <class CurvesVector>
bool Init( const CurvesVector & initSegments, bool sameCurves, bool cls/*, VERSION version = Math::DefaultMathVersion()*/ );
bool Init( const CurvesVector & initSegments, bool sameCurves, bool cls, VERSION version = Math::DefaultMathVersion() );
/// \ru Инициализация по набору точек. \en Initialize by points.
template <class PointsVector>
bool Init( const PointsVector & points, bool doClosed = true );
@@ -290,11 +290,11 @@ public:
void DeleteSegment( size_t ind ); ///< \ru Удалить сегмент контура. \en Delete the segment of contour.
MbCurve3D * DetachSegment( size_t ind ); ///< \ru Отцепить сегмент контура. \en Detach the segment of contour.
const MbCurve3D * GetSegment( size_t ind ) const { return segments[ind]; } ///< \ru Выдать сегмент контура по индексу. \en Get contour segment by the index.
MbCurve3D * SetSegment( size_t ind ) { return segments[ind]; } ///< \ru Выдать сегмент контура по индексу. \en Get contour segment by the index.
const MbCurve3D * GetSegment( size_t ind ) const { return segments[ind]; } ///< \ru Выдать сегмент контура по индексу. \en Get contour segment by the index.
MbCurve3D * SetSegment( size_t ind ) { return segments[ind]; } ///< \ru Выдать сегмент контура по индексу. \en Get contour segment by the index.
void SetSegment ( MbCurve3D & newSegment, size_t ind, bool same ); ///< \ru Заменить сегмент в контуре. \en Replace a segment in the contour.
void AddSegment ( MbCurve3D & newSegment, bool same/*, VERSION version = Math::DefaultMathVersion()*/ ); ///< \ru Добавить сегмент в контур. \en Add a segment to the contour.
void AddSegment ( MbCurve3D & newSegment, bool same, VERSION version = Math::DefaultMathVersion() ); ///< \ru Добавить сегмент в контур. \en Add a segment to the contour.
void AddAtSegment ( MbCurve3D & newSegment, size_t ind, bool same ); ///< \ru Добавить сегмент в контур перед сегментом с индексом ind. \en Add a segment to the contour before the segment with index ind.
void AddAfterSegment( MbCurve3D & newSegment, size_t ind, bool same ); ///< \ru Добавить сегмент в контур после сегмента с индексом ind. \en Add a segment to the contour after the segment with index ind.
@@ -404,7 +404,7 @@ IMPL_PERSISTENT_OPS( MbContour3D )
// \ru Конструктор по набору кривых. \en Constructor by curves.
// ---
template <class CurvesVector>
MbContour3D::MbContour3D( const CurvesVector & initSegments, bool sameCurves/*, VERSION version*/ )
MbContour3D::MbContour3D( const CurvesVector & initSegments, bool sameCurves, VERSION version )
: MbCurve3D ( )
, segments ( initSegments.size(), 1 )
, closed ( false )
@@ -419,25 +419,25 @@ MbContour3D::MbContour3D( const CurvesVector & initSegments, bool sameCurves/*,
const MbCurve3D * initSegment = initSegments[i];
if ( initSegment != nullptr ) {
C3D_ASSERT( initSegment->GetSubstrate().Type() != st_Contour3D ); // \ru Использование контура не по назначению. \en Wrong contour use as contours container.
//if ( version >= 0x15001008L && // \ru Контур в контуре возможен в ранних версиях. \ en A contour within a contour is possible in early versions.
// initSegment->Type() == st_Contour3D ) { // \ru Присланный контур удаляет владелец. \en contour should be deleted by owner.
// const MbContour3D * cntr = static_cast<const MbContour3D *>( initSegment );
// MbContour3D * contour = const_cast<MbContour3D *>( cntr );
// size_t cnt = contour->segments.size();
// for ( size_t j = 0; j < cnt; j++ ) {
// MbCurve3D * seg = contour->segments[j];
// if ( seg != nullptr ) {
// MbCurve3D * segment = sameCurves ? seg : static_cast<MbCurve3D *>(&seg->Duplicate(ireg));
// segments.push_back( segment );
// segment->AddRef();
// }
// }
//}
//else {
if ( version >= 0x1500100AL && // \ru Контур в контуре возможен в ранних версиях. \ en A contour within a contour is possible in early versions.
initSegment->Type() == st_Contour3D ) { // \ru Присланный контур удаляет владелец. \en contour should be deleted by owner.
const MbContour3D * cntr = static_cast<const MbContour3D *>( initSegment );
MbContour3D * contour = const_cast<MbContour3D *>( cntr );
size_t cnt = contour->segments.size();
for ( size_t j = 0; j < cnt; j++ ) {
MbCurve3D * seg = contour->segments[j];
if ( seg != nullptr ) {
MbCurve3D * segment = sameCurves ? seg : static_cast<MbCurve3D *>(&seg->Duplicate(ireg));
segments.push_back( segment );
segment->AddRef();
}
}
}
else {
MbCurve3D * segment = sameCurves ? const_cast<MbCurve3D *>(initSegment) : static_cast<MbCurve3D *>(&initSegment->Duplicate(ireg));
segments.push_back( segment );
segment->AddRef();
//}
}
}
}
CalculateParamLengthAndClosed();
@@ -449,7 +449,7 @@ MbContour3D::MbContour3D( const CurvesVector & initSegments, bool sameCurves/*,
// \ru Инициализация по набору кривых. \en Initialize by curves.
// ---
template <class CurvesVector>
bool MbContour3D::Init( const CurvesVector & initSegments, bool sameCurves, bool cls/*, VERSION version*/ )
bool MbContour3D::Init( const CurvesVector & initSegments, bool sameCurves, bool cls, VERSION version )
{
size_t count = initSegments.size();
@@ -463,25 +463,25 @@ bool MbContour3D::Init( const CurvesVector & initSegments, bool sameCurves, bool
const MbCurve3D * initSegment = initSegments[i];
if ( initSegment != nullptr ) {
C3D_ASSERT( initSegment->GetSubstrate().Type() != st_Contour3D ); // \ru Использование контура не по назначению. \en Wrong contour use as contours container.
//if ( version >= 0x15001008L && // \ru Контур в контуре возможен в ранних версиях. \ en A contour within a contour is possible in early versions.
// initSegment->Type() == st_Contour3D ) { // \ru Присланный контур удаляет владелец. \en contour should be deleted by owner.
// const MbContour3D * cntr = static_cast<const MbContour3D *>( initSegment );
// MbContour3D * contour = const_cast<MbContour3D *>( cntr );
// size_t cnt = contour->segments.size();
// for ( size_t j = 0; j < cnt; j++ ) {
// MbCurve3D * seg = contour->segments[j];
// if ( seg != nullptr ) {
// MbCurve3D * segment = sameCurves ? seg : static_cast<MbCurve3D *>(&seg->Duplicate(ireg));
// segments.push_back( segment );
// segment->AddRef();
// }
// }
//}
//else {
if ( version >= 0x1500100AL && // \ru Контур в контуре возможен в ранних версиях. \ en A contour within a contour is possible in early versions.
initSegment->Type() == st_Contour3D ) { // \ru Присланный контур удаляет владелец. \en contour should be deleted by owner.
const MbContour3D * cntr = static_cast<const MbContour3D *>( initSegment );
MbContour3D * contour = const_cast<MbContour3D *>( cntr );
size_t cnt = contour->segments.size();
for ( size_t j = 0; j < cnt; j++ ) {
MbCurve3D * seg = contour->segments[j];
if ( seg != nullptr ) {
MbCurve3D * segment = sameCurves ? seg : static_cast<MbCurve3D *>(&seg->Duplicate(ireg));
segments.push_back( segment );
segment->AddRef();
}
}
}
else {
MbCurve3D * segment = sameCurves ? const_cast<MbCurve3D *>( initSegment ) : static_cast<MbCurve3D *>(&initSegment->Duplicate(ireg));
segments.push_back( segment );
segment->AddRef();
//}
}
}
}
::DecRefItems( initSegments );
+1 -1
View File
@@ -132,7 +132,7 @@ public :
void InvertNormal( MbRegTransform * = nullptr );
/// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
private:
+3
View File
@@ -207,6 +207,9 @@ public :
/// \ ru Определение точек излома контура. \en The determination of contour smoothness break points.
void BreakPoints( std::vector<double> & vBreaks, double precision = ANGLE_REGION ) const override;
/// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
/// \ru Доступ к полям класса. \en Access to the fields of a class.
/// \ru Выдать базовую поверхность. \en Get the base surface.
+1 -1
View File
@@ -145,7 +145,7 @@ public :
void SetLimitPoint( ptrdiff_t number, const MbCartPoint3D &pnt ); // \ru Заменить точку отрезка \en Replace the point of a line segment
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
/// \ru Является ли объект смещением \en Whether the object is a shift
bool IsShift ( const MbSpaceItem &, MbVector3D &, bool & isSame, double accuracy = LENGTH_EPSILON ) const override;
+1 -1
View File
@@ -173,7 +173,7 @@ public :
void BreakPoints( std::vector<double> & vBreaks, double precision = ANGLE_REGION ) const override;
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
private:
void operator = ( const MbPlaneCurve & ); // \ru Не реализовано. \en Not implemented.
+1 -1
View File
@@ -253,7 +253,7 @@ public:
void BreakPoints( std::vector<double> & vBreaks, double precision = ANGLE_REGION ) const override;
/// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
/** \} */
+1 -1
View File
@@ -164,7 +164,7 @@ public :
bool IsSimilarToCurve( const MbCurve3D & curve, double precision = METRIC_PRECISION ) const override; // \ru Подобные ли кривые для объединения (слива) \en Whether the curves for union (joining) are similar
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
private:
void operator = ( const MbTrimmedCurve3D & ); // \ru Не реализовано. \en Not implemented.
+2 -2
View File
@@ -34,7 +34,7 @@ class MATH_CLASS MbSurface;
class MATH_CLASS MbPolygon3D;
class MATH_CLASS MbNurbs3D;
class MATH_CLASS MbPlacement3D;
class MATH_CLASS MbCurveExtensionParameters;
class MATH_CLASS MbCurveExtensionParameters3D;
class MbCurveIntoNurbsInfo;
struct MbNurbsParameters;
@@ -1086,7 +1086,7 @@ public :
\warning \ru В разработке.
\en Under development. \~
*/
virtual MbResultType Extend( const MbCurveExtensionParameters & parameters, c3d::SpaceCurveSPtr & resCurve ) const;
virtual MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const;
// \ru Функции унификации кривой и вектора кривых в шаблонных функциях. \en Functions for compatibility of a curve and a vector of curves in template functions.
size_t size() const { return 1; } ///< \ru Размер кривой трактуемой как в виде вектора кривых. \en Size of curve interpreted as vector of curves.
+60 -20
View File
@@ -62,15 +62,16 @@ private:
//----------------------------------------------------------------------------------------
/**
\brief \ru Состояние определенности системы геометрических ограничений.
\en State of geometric constraints system.
\en Difinition State of geometric constraints system.
*/
//---
typedef enum
{
GCE_STATE_Unknown = 0 ///< \ru О состоянии ничего не известно. \en State is unknown.
, GCE_STATE_WellConstrained ///< \ru Полностью определенная система - не имеет степеней свобод. \en Well-constrained system - does not have degrees of freedom.
, GCE_STATE_UnderConstrained ///< \ru Недоопределенная система - имеются степени свободы. \en Underconstrained system - there are degrees of freedom.
, GCE_STATE_OverConstrained ///< \ru Переопределенная система - система ограничений несовместна. \en Overconstrained system - the system of constraints is inconsistent (there are contradictions).
GCE_STATE_Unknown = 0 ///< \ru О состоянии ничего не известно. \en State is unknown.
, GCE_STATE_WellConstrained ///< \ru Полностью определенная система - все степени свободы нулевые. \en Well-constrained system - all degrees of freedom are zero.
, GCE_STATE_UnderConstrained ///< \ru Недоопределенная система - имеются ненулевые степени свободы. \en Underconstrained system - there are non-zero degrees of freedom.
, GCE_STATE_UnresolvedRedundancy ///< \ru Имеются не удовлетворенные избыточные ограничения. There are unresolved redundant constraints.
, GCE_STATE_OverConstrained = GCE_STATE_UnresolvedRedundancy
/*
\ru Идентификаторы не менять (возможна запись в файлы)!
\en Don't change identifiers (record to files is possible)!
@@ -98,16 +99,26 @@ GCE_FUNC(bool) GCE_CheckPointSatisfaction( GCE_system gSys, geom_item pnt, point
/**
\brief \ru Выдать состояние системы ограничений.
\en Get constraint system state.
\note It will be removed at 2023. Use GCE_DefinitionState instead.
*/
//---
DEPRECATE_DECLARE GCE_FUNC(GCE_s_state) GCE_StateOfSystem( GCE_system gSys );
//----------------------------------------------------------------------------------------
/**
\brief \ru Выдать состояние определенности системы ограничений.
\en Get constraint system definition state.
\param[in] gSys - \ru Система ограничений.
\en System of constraints. \~
\return \ru Одно из состояний, перечисленного набором: "Система недоопределена",
"Полностью определена" или "Переопределена".
\en One of the states enumerated by a set: Under-defined, Well-defined and Over-defined. \~
\note \ru Сложность выполнения функции эквивалентна запросу GCE_PointDOF.
\en Function complexity is equivalent to request GCE_PointDOF.
"Полностью определена" или "Есть не решенные избыточные ограничения".
\en One of the states enumerated by a set: "Under-defined", "Well-defined" and
"There are unsolved redundant constraints (non solved overdefinition)". \~
\note \ru Сложность выполнения функции сопоставима с GCE_Evaluate.
\en Function complexity is comparable to GCE_Evaluate.
*/
//---
GCE_FUNC(GCE_s_state) GCE_StateOfSystem( GCE_system gSys );
GCE_FUNC(GCE_s_state) GCE_DefinitionState( GCE_system gSys );
//----------------------------------------------------------------------------------------
/// \ru Проверить, удовлетворена ли система ограничений. \en To check the satisfaction of constraints.
@@ -169,6 +180,43 @@ GCE_FUNC(void) GCE_ResetMovingMode( GCE_system );
//---
GCE_FUNC( bool ) GCE_InitFrozenCoords( GCE_system gSys );
//----------------------------------------------------------------------------------------
/** \brief \ru Собрать плохо-обусловленную часть системы ограничений.
\en Collect ill-conditioned part of the constraint system. \~
\note \ru Данная функция может быть удалена из API в будущем. Для получения информации
о группе ограничений, образующих между собой избыточную или переопределенную
часть ограничений, воспользуйтесь вызовом GCE_ConstraintStatus.
\en The call may be removed from the API in the future. Use GCE_ConstraintStatus
call to query which of constraints form a redundant or overdefined subsystem
with each other. \~
\details
\ru Это вспомогательный вызов для диагностических целей. Функция собирает часть
ограничений, которые имеют один из следующих статусов:\n
GCE_STATUS_IllConditioned,\n
GCE_STATUS_WellConditioned,\n
GCE_STATUS_Redundant,\n
GCE_STATUS_OverConstrained,\n
GCE_STATUS_NotConsistent,\n
GCE_STATUS_NotSolved.\n
Такие ограничения обычно образуют избыточную или переопределенную подсистему.
Для более детальной информации о статусе каждого из ограничений воспользуйтесь
вызовом GCE_ConstraintStatus.
\en This is an auxiliary call for diagnostic purposes.The function collects
constraints that have one of the following statuses:\n
GCE_STATUS_IllConditioned,\n
GCE_STATUS_WellConditioned,\n
GCE_STATUS_Redundant,\n
GCE_STATUS_OverConstrained,\n
GCE_STATUS_NotConsistent,\n
GCE_STATUS_NotSolved.\n
These constraints usually form the redundant or overdifined part. For more detailed
information about the status of each constraint use the call GCE_ConstraintStatus.
*/
// ---
GCE_FUNC(bool) GCE_CollectLinearDependedConstrains( GCE_system, SArray<constraint_item> & );
/**
\}
Constraints2D_API
@@ -179,17 +227,9 @@ GCE_FUNC( bool ) GCE_InitFrozenCoords( GCE_system gSys );
*/
//----------------------------------------------------------------------------------------
// \ru Собрать плохо-обусловленную часть системы ограничений. \en Collect ill-conditioned part of the constraint system.
/*
It is planned to use GCE_ConstraintStatus instead this call.
*/
// ---
GCE_FUNC(bool) GCE_CollectLinearDependedConstrains( GCE_system, SArray<constraint_item> & );
//----------------------------------------------------------------------------------------
//
// It will be removed at 2023.
//---
GCE_FUNC(GCE_s_state) GCE_GetConstraintStatus( GCE_system gSys );
DEPRECATE_DECLARE GCE_FUNC(GCE_s_state) GCE_GetConstraintStatus( GCE_system gSys );
//----------------------------------------------------------------------------------------
/**
+1 -1
View File
@@ -120,6 +120,6 @@ typedef int8 sign_t;
/*! @} */
#endif __GCE_PRECISION_H
#endif //__GCE_PRECISION_H
// eof
+30 -23
View File
@@ -15,12 +15,13 @@
#include <mb_cube.h>
#include <math_define.h>
#include <reference_item.h>
#include <templ_sptr.h>
#include <solid.h>
#include <model_item.h>
class MbRegDuplicate;
struct MATH_CLASS MbLump;
class MATH_CLASS MbSolid;
class MATH_CLASS MbMesh;
namespace c3d // namespace C3D
{
@@ -67,21 +68,23 @@ typedef std::pair<ConstLumpsSPtrSetConstIt, bool> ConstLumpsSPtrSetRet;
// ---
struct MATH_CLASS MbLump: public MbRefItem {
protected:
c3d::ConstSolidSPtr solid; ///< \ru Тело (всегда не nullptr). \en Solid (always not nullptr).
MbMatrix3D from; ///< \ru Матрица преобразования из локальной системы координат. \en A transformation matrix from the local coordinate system.
uint component; ///< \ru Идентификатор компонента, в котором определено тело. \en An identifier of a component which a solid is defined in.
size_t identifier; ///< \ru Идентификатор нити. \en A thread identifier.
c3d::ConstItemSPtr _item; ///< \ru Объект геометрической модели (всегда не nullptr). \en A geometric model object (always not nullptr).
MbMatrix3D _from; ///< \ru Матрица преобразования из локальной системы координат. \en A transformation matrix from the local coordinate system.
uint _component; ///< \ru Идентификатор компонента, в котором определено тело. \en An identifier of a component which a solid is defined in.
size_t _identifier; ///< \ru Идентификатор нити. \en A thread identifier.
private:
bool changed; ///< \ru Флаг необходимости обработки компонента. \en Component processing flag.
bool _changed; ///< \ru Флаг необходимости обработки компонента. \en Component processing flag.
private:
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
MbLump( const MbLump & other, MbRegDuplicate * iReg );
public:
/// \ru Пустой конструктор. \en Empty constructor.
MbLump() : solid( nullptr ), from(), component( 0 ), identifier( SYS_MAX_T ), changed( true ) {}
/// \ru Конструктор по данным. \en Constructor by data.
MbLump( const MbSolid & _solid, const MbMatrix3D & _from, uint _comp = 0, size_t _ident = SYS_MAX_T, bool _changed = true );
MbLump() : _item( nullptr ), _from(), _component( 0 ), _identifier( SYS_MAX_T ), _changed( true ) {}
/// \ru Конструктор по твердому телу. \en Constructor by solid.
MbLump( const MbSolid & solid, const MbMatrix3D & from, uint comp = 0, size_t ident = SYS_MAX_T, bool changed = true );
/// \ru Конструктор по полигональному объекту. \en Constructor by polygonal object.
MbLump( const MbMesh & mesh, const MbMatrix3D & from, uint comp = 0, size_t ident = SYS_MAX_T, bool changed = true );
/// \ru Деструктор. \en Destructor.
virtual ~MbLump();
@@ -98,28 +101,32 @@ public:
/// \ru Дублирование объекта. \en Duplication of an object.
virtual MbLump & Duplicate( MbRegDuplicate * iReg = nullptr ) const;
/// \ru Получить имя компонента. \en Get the name of a component.
uint GetComponent() const { return component; }
uint GetComponent() const { return _component; }
/// \ru Установить имя компонента. \en Set the name of a component.
void SetComponent( uint comp ) { component = comp; }
void SetComponent( uint comp ) { _component = comp; }
/// \ru Получить идентификатор. \en Get the thread identifier.
size_t GetIdentifier() const { return identifier; }
size_t GetIdentifier() const { return _identifier; }
/// \ru Есть идентификатор? \en Is an thread identifier.
bool IsIdentifier() const { return (identifier != SYS_MAX_T); }
bool IsIdentifier() const { return (_identifier != SYS_MAX_T); }
/// \ru Установить идентификатор. \en Set the thread identifier.
void SetIdentifier( size_t id ) { identifier = id; }
void SetIdentifier( size_t id ) { _identifier = id; }
/// \ru Получить матрицу преобразования в мир. \en Get the matrix of transformation to the world coordinate system.
const MbMatrix3D & GetMatrixFrom() const { return from; }
const MbMatrix3D & GetMatrixFrom() const { return _from; }
/// \ru Получить матрицу преобразования в мир. \en Get the matrix of transformation to the world coordinate system.
MbMatrix3D & SetMatrixFrom() { return from; }
MbMatrix3D & SetMatrixFrom() { return _from; }
/// \ru Инициализировать тело и матрицу. \en Initialize solid and matrix.
void SetSolid( const MbSolid & _solid, const MbMatrix3D & _from, bool _changed = true );
/// \ru Получить тело. \en Get solid.
const MbSolid & GetSolid() const { return *solid; }
void SetSolid( const MbSolid & solid, const MbMatrix3D & from, bool changed = true );
/// \ru Получить тело. \en Get solid.
//DEPRECATE_DECLARE_REPLACE( GetItem )
const MbSolid & GetSolid() const;
/// \ru Инициализировать тело и матрицу. \en Initialize solid and matrix.
void SetMesh( const MbMesh & mesh, const MbMatrix3D & from, bool changed = true );
/// \ru Получить объект геометрической модели. \en Get a geometric model object.
const MbItem & GetItem() const;
/// \ru Получить флаг необходимости обработки компонента. \en Get component processing flag.
bool GetChanged() const { return changed; }
bool GetChanged() const { return _changed; }
/// \ru Установить флаг необходимости обработки компонента. \en Set component processing flag.
void SetChanged( bool c ) { changed = c; }
void SetChanged( bool c ) { _changed = c; }
/// \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
KNOWN_OBJECTS_RW_REF_OPERATORS_EX( MbLump, MATH_FUNC_EX )
+9 -8
View File
@@ -21,6 +21,7 @@
#include <mesh_primitive.h>
#include <mb_thread.h>
#include <map_vestige.h>
#include <solid.h>
#include <mb_symbol.h>
@@ -1139,10 +1140,10 @@ public:
C3D_ASSERT( count > 0 && _lumps[0] != nullptr );
if ( count > 0 && _lumps[0] != nullptr ) {
from = _lumps[0]->GetMatrixFrom();
component = _lumps[0]->GetComponent();
identifier = _lumps[0]->GetIdentifier();
solid = &_lumps[0]->GetSolid();
_from = _lumps[0]->GetMatrixFrom();
_component = _lumps[0]->GetComponent();
_identifier = _lumps[0]->GetIdentifier();
_item = &_lumps[0]->GetItem();
willCutOnDeriveView = _lumps[0]->WillCutOnDeriveView();
@@ -1230,10 +1231,10 @@ public:
void ChangeLump( size_t ind, MbLump * newLump )
{
if ( ind == 0 ) {
solid = &newLump->GetSolid();
from = newLump->GetMatrixFrom();
component = newLump->GetComponent();
identifier = newLump->GetIdentifier();
_item = &newLump->GetItem();
_from = newLump->GetMatrixFrom();
_component = newLump->GetComponent();
_identifier = newLump->GetIdentifier();
}
else if ( lumps != nullptr && ind - 1 < lumps->size() ) {
(*lumps)[ind - 1] = newLump;
+2
View File
@@ -43,6 +43,7 @@ public:
\param[in] lump - \ru Тело с матрицей преобразования.
\en A solid with a matrix of transformation. \~
*/
//DEPRECATE_DECLARE_REPLACE( ThreadMapperStruct with 'MbSolid' )
ThreadMapperStruct( const MbThread & thr, const MbLump & lump,
const VERSION ver = Math::DefaultMathVersion() )
: thread ( thr )
@@ -87,6 +88,7 @@ public:
\param[in] tmType - \ru Тип отображения резьбы.
\en A type of thread mapping. \~
*/
//DEPRECATE_DECLARE_REPLACE( ThreadMapperStruct with 'MbSolid' )
ThreadMapperStruct( const MbThread & thr, const MbLump & lump, const MbPlacement3D & plView, MbeThrMapType tmType,
const VERSION ver = Math::DefaultMathVersion() )
: thread ( thr )
+44
View File
@@ -18,6 +18,7 @@
#include <mb_matrix.h>
#include <curve.h>
#include <topology_item.h>
#include <mesh_primitive.h>
#include <algorithm>
#include <iterator>
#include <vector>
@@ -80,6 +81,7 @@ public:
vt_SpacePoint, ///< \ru Пространственная точка. \en A spatial point.
vt_SpaceCurve, ///< \ru Пространственная кривая. \en A spatial curve.
vt_CenterLine, ///< \ru Осевая (центральная) линия. \en A center line.
vt_MeshEdge, ///< \ru Отображение ребра или линия очерка полигонального объекта. \en Mapping of edge or isocline curve of polygonal object.
};
/** \brief \ru Классификатор подтипов аннотационных ребер.
@@ -732,6 +734,22 @@ protected:
, curveInfos ( 0, 1, true )
, vesType ( vt_Edge )
{}
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор следа грани.\n
\en Constructor of a face vestige.\n \~
\param[in] otherComp - \ru Компонент.
\en A component. \~
\param[in] otherIdent - \ru Идентификатор нити.
\en A thread identifier. \~
\param[in] otherItem - \ru Полигоанльный объект.
\en A polygonal object. \~
*/
MbFaceVestige( uint otherComp, size_t otherIdent, const MbGrid & grid )
: MbBaseVestige( otherComp, otherIdent, grid.GetName() )
, curveInfos ( 0, 1, true )
, vesType ( vt_MeshEdge )
{}
/// \ru Конструктор копирования с регистратором. \en Copy-constructor with the registrator.
MbFaceVestige( const MbFaceVestige & other, MbRegDuplicate * iReg );
public:
@@ -1119,6 +1137,19 @@ public:
*/
MbFaceVestige * AddVestigeFace( uint otherComp, size_t otherIdent, const MbTopologyItem & otherItem );
/** \brief \ru Добавить MbFaceVestige в массив.
\en Add the MbFaceVestige to an array. \~
\details \ru Добавить MbFaceVestige в массив через закрытые конструкторы. \n
\en Add the MbFaceVestige to an array by the private constructors. \n \~
\param[in] otherComp - \ru Компонент.
\en A component. \~
\param[in] otherIdent - \ru Идентификатор нити.
\en A thread identifier. \~
\param[in] otherItem - \ru Полигональный объект.
\en A polygonal object. \~
*/
MbFaceVestige * AddVestigeFace( uint otherComp, size_t otherIdent, const MbGrid & otherItem );
/** \brief \ru Добавить MbAnnotationEdgeVestige в массив.
\en Add the MbAnnotationEdgeVestige to an array. \~
\details \ru Добавить MbAnnotationEdgeVestige в массив через закрытые конструкторы. \n
@@ -1320,6 +1351,19 @@ inline MbFaceVestige * MbVEFVestiges::AddVestigeFace( uint otherComp, size_t oth
return vestige;
}
//------------------------------------------------------------------------------
//
// ---
inline MbFaceVestige * MbVEFVestiges::AddVestigeFace( uint otherComp, size_t otherIdent, const MbGrid & otherItem )
{
MbFaceVestige * vestige = new MbFaceVestige( otherComp, otherIdent, otherItem );
if ( vestige )
faceVestiges.Add( vestige );
return vestige;
}
//------------------------------------------------------------------------------
//
// ---
+7 -2
View File
@@ -34,14 +34,16 @@ private:
\details \ru Способ вычисления приращения параметра при движении по кривой или поверхности.
Для визуализации геометрической формы используется способ ist_SpaceStep. \n
Для операций построения используется способ ist_DeviationStep. \n
Для 3D принтеров используется способ ist_MetricStep и могут быть добавлены первые два. \n
Способ ist_MetricStep используется при необходимости ограничения максимальной длины ребер получаемых треугольников,\n
например для подготовки для последующей печати на 3D принтере. Способ может использоваться совместно с первыми двумя. \n
Для привязки объектов к параметрам поверхности следует добавить способ ist_ParamStep,
Для определения столкновений элементов модели используется способ ist_CollisionStep,
Для вычисления инерционных характеристик используется способ ist_MipStep.
\en Methods of calculation of parameter increment by the object. \n \~
Step by sag ist_SpaceStep is used for visualizations.
Step by deviation angle ist_DeviationStep is used for calculation.
Step by length ist_MetricStep is used for 3D printer (plus by sag and by deviation angle). \n
Step by length ist_MetricStep is used if it is necessary to limit the maximum length of a side of a triangle,\n
for example for a 3D printer. (plus by sag and by deviation angle). \n
Special step ist_ParamStep is added for binding with surface parameters.
Special step ist_CollisionStep is used for collision detection of model elements.
Special step ist_MipStep is used for calculation of inertial characteristics. \~
@@ -575,6 +577,8 @@ public:
double clearanceNoisy; ///< \ru Коридор отклонения сглаживающей кривой от зашумленных точек; \en Corridor of smoothing curve deviation from noisy points;
size_t clearanceNoisyIteration; ///< \ru Количество итераций сглаживания зашумленных точек. \en Number of iterations of smoothing noisy points.
double scaleParam; ///< \ru Параметр масштабирования. \en Scaling parameter.
bool switchFixFirstPointAtNoisy; ///< \ru Флаг фиксации сплайна в начальной точке. \en Flag of fixing a spline at the first point.
bool switchFixLastPointAtNoisy; ///< \ru Флаг фиксации сплайна в конечной точке. \en Flag of fixing a spline at the last point.
/// \ru Выходные параметры. \en Output parameters.
MbeFairWarning warning; ///< \ru Предупреждение о работе. \en The operation warning. \~
@@ -605,6 +609,7 @@ public:
switchEndTangents( false ), switchEndCurvature( false ),
firstCurvature( 0.0 ), lastCurvature( 0.0 ), smoothTorsion( false ),
clearanceNoisy( 0.002 ), clearanceNoisyIteration( 200 ), scaleParam( 1.0 ),
switchFixFirstPointAtNoisy( false ), switchFixLastPointAtNoisy( false ),
warning( fwarn_Success ), error( rt_Success ), errInfo() {}
~MbFairCurveData() {}
+87
View File
@@ -605,6 +605,93 @@ bool IsValidNurbsKnots( const KnotsVector & knots, double eps = EXTENT_EPSILON )
}
//------------------------------------------------------------------------------
/** \brief \ru Проверить и попытаться починить обрезанный узловой вектор nurbs-объекта.
\en Check and try to restore knots vector of a nurbs-object. \~
\details \ru Проверить и попытаться починить обрезанный узловой вектор nurbs-объекта.
\en Check and try to restore knots vector of a nurbs-object. \~
\param[in] degree - \ru Порядок B-сплайна.
\en B-spline degree. \~
\param[in] closed - \ru Признак замкнутости.
\en A closedness attribute. \~
\param[in] pointsCnt - \ru Количество точек.
\en Number of points. \~
\param[in,out] knots - \ru Узловой вектор.
\en Knots vector. \~
\return \ru true, если параметры согласованы.
\en Returns true if parameters are consistent. \~
\ingroup Base_Algorithms
*/
// ---
template <class KnotsVector>
bool RestoreClippedKnots( size_t degree, bool closed, size_t pointsCnt, KnotsVector & knots )
{
bool isValid = false;
if ( ::IsValidNurbsParamsExt( degree, closed, pointsCnt, knots ) )
isValid = true;
else if ( !closed ) {
if ( IsValidNurbsParams( degree, closed, pointsCnt ) ) {
if ( c3d::IsMonotonic( knots, true, true ) ) {
const double knotEps = EXTENT_EQUAL;
KnotsVector initKnots;
std::copy( knots.begin(), knots.end(), std::back_inserter( initKnots ) );
const double begKnot = knots.front();
size_t begCnt = 1;
{
bool check = true;
for ( size_t i = 1; i < degree && check; ++i ) {
check = false;
if ( ::fabs( begKnot - knots[i] ) < knotEps ) {
check = true;
begCnt++;
}
}
}
const double endKnot = knots.back();
size_t endCnt = 1;
{
bool check = true;
size_t knotsCnt = knots.size();
for ( size_t i = 1; i < degree && check; ++i ) {
check = false;
if ( ::fabs( endKnot - knots[knotsCnt - i - 1] ) < knotEps ) {
check = true;
endCnt++;
}
}
}
if ( begCnt < degree ) {
while ( begCnt < degree ) {
knots.insert( knots.begin(), begKnot );
begCnt++;
}
}
if ( endCnt < degree ) {
while ( endCnt < degree ) {
knots.push_back( endKnot );
endCnt++;
}
}
if ( ::IsValidNurbsParamsExt( degree, closed, pointsCnt, knots ) )
isValid = true;
else {
knots.clear();
std::copy( initKnots.begin(), initKnots.end(), std::back_inserter( knots ) );
}
}
}
}
return isValid;
}
//------------------------------------------------------------------------------
/** \brief \ru Определение индекса узла left для первой ненулевой функции.
\en Definition of "left" knot index for the first non-zero function. \~
+19 -1
View File
@@ -446,6 +446,8 @@ public: /** \}
void Normalize();
/// \ru Проверить,является ли объект смещением. \en Check if the object is a translation.
bool IsShift ( const MbPlacement3D &, MbVector3D &, bool & isSame, double accuracy = LENGTH_EPSILON ) const;
/// \ru Является ли объект смещением данного вдоль оси Z? \en Check if the object is a shift of the current one along axis Z?
bool IsShiftZ( const MbPlacement3D & other, MbVector3D & vect, double accuracy ) const;
/// \ru Проверить на вырожденность. \en Check for degeneracy.
bool IsDegenerate( double lenEps = Math::metricRegion, double angEps = Math::angleRegion ) const;
@@ -909,7 +911,7 @@ inline void MbPlacement3D::TransformPoint( const MbMatrix3D & matr, MbCartPoint
//-------------------------------------------------------------------------------
// \ru Является ли объект смещением данного \en Check if the object is a shift of the current one
// \ru Является ли объект смещением данного? \en Check if the object is a shift of the current one.
// ---
inline bool MbPlacement3D::IsShift( const MbPlacement3D & other, MbVector3D & vect, bool & isSame, double accuracy ) const
{
@@ -924,6 +926,22 @@ inline bool MbPlacement3D::IsShift( const MbPlacement3D & other, MbVector3D & ve
}
//-------------------------------------------------------------------------------
// \ru Является ли объект смещением данного вдоль оси Z? \en Check if the object is a shift of the current one along axis Z?
// ---
inline bool MbPlacement3D::IsShiftZ( const MbPlacement3D & other, MbVector3D & vect, double accuracy ) const
{
if ( axisZ.IsSame(other.axisZ, accuracy) &&
axisY.IsSame(other.axisY, accuracy) &&
axisX.IsSame(other.axisX, accuracy) ) {
vect.Init( origin, other.origin );
if ( axisZ.RoundColinear(vect, accuracy) )
return true;
}
return false;
}
//-------------------------------------------------------------------------------
/** \brief \ru Функция перевода координат из декартовой системы в цилиндрическую
\en Function for transforming coordinates from the Cartesian coordinate system to a cylindrical coordinate system \~
+1
View File
@@ -431,6 +431,7 @@ enum MbePrompt
IDS_ITEM_0778, ///< \ru Данные об изделии. \en Product data.
IDS_ITEM_0779, ///< \ru Атрибут ребра жесткости листового тела. \en Attribute of stamp rib of sheet solid.
IDS_ITEM_0780, ///< \ru Атрибут отбортовки листового тела. \en Swept flange attribute of a sheet solid.
IDS_ITEM_0781, ///< \ru Атрибут Uuid для вставок. \en Uuid attribute for instances.
IDS_ITEM_0782, ///< \ru Атрибут пользовательский. \en Custom Attribute.
IDS_ITEM_0783, ///< \ru Атрибут обобщенный. \en Generalized Attribute.
+2 -2
View File
@@ -18,6 +18,7 @@
#include <surface.h>
#include <topology.h>
#include <lump.h>
#include <solid.h>
#include <name_item.h>
#include <iterator>
#include <set>
@@ -28,7 +29,6 @@ class MATH_CLASS MbMatrix3D;
class MATH_CLASS MbSurface;
class MATH_CLASS MbCurveEdge;
class MATH_CLASS MbFace;
class MATH_CLASS MbSolid;
//------------------------------------------------------------------------------
@@ -595,7 +595,7 @@ public :
\return \ru true, если резьба принадлежит одной из граней тела.
\en True if thread belongs to one of solid faces. \~
*/
bool IsBodyThread( const MbLump & lump ) const { return IsBodyThread( lump.GetSolid(), lump.GetMatrixFrom() ); }
bool IsBodyThread( const MbLump & lump ) const;
/** \brief \ru Адаптировать начало и конец резьбы к телу.
\en Fit start and end of thread to solid. \~
+75 -74
View File
@@ -44,7 +44,7 @@ typedef DPtr<MbMeshTopology> MeshTopologyPtr;
Например, сетку можно построить на основе множества точек, полученных замерами
реального физического тела. Полигональный объект содержит множество точек, являющимися
узлами (вершинами) в таких структурах данных:
множество указателей на триангуляции MbGrid (наборы стыкующихса треугольных и четырёхугольных пластин),
множество указателей на триангуляции MbGrid (наборы стыкующихся треугольных и четырёхугольных пластин),
множество указателей на полигоны MbPolygon3D (наборы точек, описывающих ломаные линии),
множество указателей на апексы MbApex3D (точки, описывающие положение вершин или объектов-точек).
\en Mesh is an object of geometric model (subclass MbItem) which is
@@ -81,27 +81,27 @@ typedef DPtr<MbMeshTopology> MeshTopologyPtr;
class MATH_CLASS MbMesh : public MbItem
{
private:
RPArray<MbGrid> grids; ///< \ru Множество указателей на триангуляции. \en A set of pointers to triangulations.
RPArray<MbPolygon3D> wires; ///< \ru Множество указателей на полигоны. \en A set of pointers to polygons.
RPArray<MbApex3D> peaks; ///< \ru Множество указателей на апексы. \en A set of pointers to apexes.
const MbRefItem * item; ///< \ru Источник сетки. \en Source of mesh.
MbeSpaceType type; ///< \ru Тип сетки отражает характер, но не связан напрямую с item. \en A mesh type describes the character but it is not related to "item".
bool exact; ///< \ru Объекты построены на числах double. \en Objects builded on double data.
RPArray<MbGrid> _grids; ///< \ru Множество указателей на триангуляции. \en A set of pointers to triangulations.
RPArray<MbPolygon3D> _wires; ///< \ru Множество указателей на полигоны. \en A set of pointers to polygons.
RPArray<MbApex3D> _peaks; ///< \ru Множество указателей на апексы. \en A set of pointers to apexes.
const MbRefItem * _item; ///< \ru Источник сетки. \en Source of mesh.
MbeSpaceType _type; ///< \ru Тип сетки отражает характер, но не связан напрямую с item. \en A mesh type describes the character but it is not related to "item".
bool _exact; ///< \ru Объекты построены на числах double. \en Objects builded on double data.
/** \brief \ru Замкнутость объекта.
\en Closeness of object. \~
\details \ru Замкнутость указывает на отсутствие края в триангуляции. Значение флага может быть пересчитано по запросу.
\en Closeness indicates the absence of edge in the triangulation. The flag value can be recalculated by request. \n \~
*/
mutable bool closed;
mutable bool _closed;
/** \brief \ru Габаритный куб объекта.
\en Bounding box of object. \~
\details \ru Габаритный куб объекта расчитывается только при запросе габарита объекта. Габаритный куб в конструкторе объекта и после модификации объекта принимает неопределенное значение.
\en Bounding box of object is calculated only at the request. Bounding box of object is undefined after object constructor and after object modifications \n \~
*/
mutable MbCube cube;
mutable c3d::MeshTopologyPtr topo; ///< \ru Дополнительная информация о топологии полигонального объекта. \en Additional information about a topology of the polygonal object.
mutable MbCube _cube;
mutable c3d::MeshTopologyPtr _topo; ///< \ru Дополнительная информация о топологии полигонального объекта. \en Additional information about a topology of the polygonal object.
private:
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en The copy constructor without implementation prevents from copying by default.
MbMesh( const MbMesh & );
@@ -110,11 +110,11 @@ private:
public:
/// \ru Конструктор без параметров. \en Constructor without parameters.
MbMesh( bool _exact = false, const MbCreator * = nullptr );
explicit MbMesh( bool _exact = false, const MbCreator * = nullptr );
/// \ru Конструктор без параметров. \en Constructor without parameters.
MbMesh( bool _exact, const RPArray<MbCreator> & );
explicit MbMesh( bool _exact, const RPArray<MbCreator> & );
/// \ru Конструктор без параметров. \en Constructor without parameters.
MbMesh( bool _exact, const c3d::CreatorsSPtrVector & );
explicit MbMesh( bool _exact, const c3d::CreatorsSPtrVector & );
/// \ru Деструктор \en Destructor
virtual ~MbMesh();
@@ -173,20 +173,20 @@ public:
/// \ru Является ли полигональный объект аппроксимацией твёрдого тела? \en Whether the polygonal object is approximation of solid.
bool IsASolidMesh () const;
/// \ru Содержат ли контейнеры сетки данные? \en Whether containers of mesh contain data.
bool IsComplete() const { return (grids.size() > 0) || (wires.size() > 0) || (peaks.size() > 0); }
bool IsComplete() const { return (_grids.size() > 0) || (_wires.size() > 0) || (_peaks.size() > 0); }
/// \ru Зарезервировать место для пластин. \en Reserve space for the plates.
void GridsReserve(size_t cnt, bool fill = false );
/// \ru Зарезервировать место для полигонов. \en Reserve space for the polygons.
void PolygonsReserve( size_t cnt ) { wires.Reserve( cnt ); }
void PolygonsReserve( size_t cnt ) { _wires.Reserve( cnt ); }
/// \ru Зарезервировать место для апексов. \en Reserve space for the apexes.
void ApexReserve( size_t cnt ) { peaks.Reserve( cnt ); }
void ApexReserve( size_t cnt ) { _peaks.Reserve( cnt ); }
/// \ru Обнулить данные объекта. \en Set object data to null.
void Flush();
/// \ru Освободить лишнюю память. \en Free the unnecessary memory.
void Adjust() { grids.Adjust(); wires.Adjust(); peaks.Adjust(); }
void Adjust() { _grids.Adjust(); _wires.Adjust(); _peaks.Adjust(); }
/// \ru Выдать количество триангуляций. \en Get the number of triangulations.
size_t GridsCount() const { return grids.size(); }
size_t GridsCount() const { return _grids.size(); }
/// \ru Добавить триангуляцию. \en Add triangulation.
void AddGrid( MbGrid & gr );
/// \ru Добавить новую пустую триангуляцию и выдать её для заполнения. \en Add new empty triangulation and give it to fill.
@@ -197,31 +197,31 @@ public:
template <class GridsVector>
void DetachAllGrids( GridsVector & gridsVector )
{
gridsVector.reserve( gridsVector.size() + grids.size() );
for( size_t i = 0, iCount = grids.size(); i < iCount; ++i ) {
MbGrid * gr = grids[i];
gridsVector.reserve( gridsVector.size() + _grids.size() );
for( size_t i = 0, iCount = _grids.size(); i < iCount; ++i ) {
MbGrid * gr = _grids[i];
if ( gr != nullptr ) {
gr->DecRef();
gridsVector.push_back( gr );
}
}
grids.clear();
grids.shrink_to_fit();
cube.SetEmpty();
_grids.clear();
_grids.shrink_to_fit();
_cube.SetEmpty();
ResetMeshTopology();
}
/// \ru Вернуть указатель на триангуляцию по её номеру. \en Return pointer to triangulation by it number.
const MbGrid * GetGrid( size_t i ) const { return ( (i < grids.size()) ? grids[i]: nullptr ); }
const MbGrid * GetGrid( size_t i ) const { return ( (i < _grids.size()) ? _grids[i]: nullptr ); }
/// \ru Вернуть указатель на триангуляцию по её номеру для модификации. \en Return the pointer to triangulation by its number to be modified.
MbGrid * SetGrid( size_t i ) { return ( (i < grids.size()) ? grids[i]: nullptr ); }
MbGrid * SetGrid( size_t i ) { return ( (i < _grids.size()) ? _grids[i]: nullptr ); }
/// \ru Получить указатели на триангуляции. \en Get pointers to triangulations.
template <class GridsVector>
void GetGrids( GridsVector & gridsVector ) const
{
size_t gridsCnt = grids.size();
size_t gridsCnt = _grids.size();
gridsVector.reserve( gridsVector.size() + gridsCnt );
for ( size_t k = 0; k < gridsCnt; ++k ) {
const MbGrid * grid = grids[k];
const MbGrid * grid = _grids[k];
gridsVector.push_back( grid );
}
}
@@ -231,23 +231,23 @@ public:
{
size_t addPointsCnt = 0;
size_t k, gridsCnt = grids.size();
size_t k, gridsCnt = _grids.size();
for ( k = 0; k < gridsCnt; ++k ) {
const MbGrid * grid = grids[k];
const MbGrid * grid = _grids[k];
if ( grid != nullptr )
addPointsCnt += grid->PointsCount();
}
points.reserve( points.size() + addPointsCnt );
for ( k = 0; k < gridsCnt; ++k ) {
const MbGrid * grid = grids[k];
const MbGrid * grid = _grids[k];
if ( grid != nullptr )
grid->GetPoints<Point>( points );
}
}
/// \ru Выдать количество полигонов. \en Get the number of polygons.
size_t PolygonsCount() const { return wires.size(); }
size_t PolygonsCount() const { return _wires.size(); }
/// \ru Добавить полигон. \en Add polygon.
void AddPolygon( MbPolygon3D & );
/// \ru Добавить новый пустой полигон и выдать его для заполнения. \en Add new empty polygon and give it to fill.
@@ -257,34 +257,34 @@ public:
/// \ru Отсоединить все полигоны. \en Detach all polygons.
template <class PolygonsVector>
void DetachAllPolygons( PolygonsVector & polyVector ) {
polyVector.reserve( polyVector.size() + wires.size() );
for( size_t i = 0, iCount = wires.size(); i < iCount; ++i ) {
MbPolygon3D * pl = wires[i];
polyVector.reserve( polyVector.size() + _wires.size() );
for( size_t i = 0, iCount = _wires.size(); i < iCount; ++i ) {
MbPolygon3D * pl = _wires[i];
if ( pl != nullptr ) {
pl->DecRef();
polyVector.push_back( pl );
}
}
wires.clear();
wires.shrink_to_fit();
cube.SetEmpty();
_wires.clear();
_wires.shrink_to_fit();
_cube.SetEmpty();
}
/// \ru Вернуть указатель на полигон по его номеру. \en Return the pointer to polygon by its number.
const MbPolygon3D * GetPolygon( size_t i ) const { return ( (i < wires.size()) ? wires[i]: nullptr ); }
const MbPolygon3D * GetPolygon( size_t i ) const { return ( (i < _wires.size()) ? _wires[i]: nullptr ); }
/// \ru Вернуть указатель на полигон по его номеру. \en Return the pointer to polygon by its number.
MbPolygon3D * SetPolygon( size_t i ) { return ( (i < wires.size()) ? wires[i]: nullptr ); }
MbPolygon3D * SetPolygon( size_t i ) { return ( (i < _wires.size()) ? _wires[i]: nullptr ); }
/// \ru Получить указатели на полигоны. \en Get pointers to polygons.
template <class PolygonsVector>
void GetPolygons( PolygonsVector & polyVector ) const {
size_t polyCnt = wires.size();
size_t polyCnt = _wires.size();
polyVector.reserve( polyVector.size() + polyCnt );
for ( size_t k = 0; k < polyCnt; ++k ) {
const MbPolygon3D * poly = wires[k];
const MbPolygon3D * poly = _wires[k];
polyVector.push_back( poly );
}
}
/// \ru Выдать количество апексов. \en Get the number of apexes.
size_t ApexesCount() const { return peaks.size(); }
size_t ApexesCount() const { return _peaks.size(); }
/// \ru Добавить новый апекс. \en Add new apex.
void AddApex( MbApex3D & ap );
/// \ru Добавить новый пустой апекс и выдать его для заполнения. \en Add new empty apex and give it to fill.
@@ -294,29 +294,29 @@ public:
/// \ru Отсоединить все вершины. \en Detach all apexes.
template <class ApexesVector>
void DetachAllApexes( ApexesVector & peakVector ) {
peakVector.reserve( peakVector.size() + peaks.size() );
for( size_t i = 0, iCount = peaks.size(); i < iCount; ++i ) {
MbApex3D * peak = peaks[i];
peakVector.reserve( peakVector.size() + _peaks.size() );
for( size_t i = 0, iCount = _peaks.size(); i < iCount; ++i ) {
MbApex3D * peak = _peaks[i];
if ( peak != nullptr ) {
peak->DecRef();
peakVector.push_back( peak );
}
}
peaks.clear();
peaks.shrink_to_fit();
cube.SetEmpty();
_peaks.clear();
_peaks.shrink_to_fit();
_cube.SetEmpty();
}
/// \ru Вернуть указатель на апекс по его номеру. \en Return the pointer to apex by its number.
const MbApex3D * GetApex( size_t i ) const { return ( (i < peaks.size()) ? peaks[i]: nullptr ); }
const MbApex3D * GetApex( size_t i ) const { return ( (i < _peaks.size()) ? _peaks[i]: nullptr ); }
/// \ru Вернуть указатель на апекс по его номеру для модификации. \en Return the pointer to apex by its number to be modified.
MbApex3D * SetApex( size_t i ) { return ( (i < peaks.size()) ? peaks[i]: nullptr ); }
MbApex3D * SetApex( size_t i ) { return ( (i < _peaks.size()) ? _peaks[i]: nullptr ); }
/// \ru Получить указатели на вершины. \en Get pointers to apexes.
template <class ApexesVector>
void GetApexes( ApexesVector & peakVector ) const {
size_t peaksCnt = peaks.size();
size_t peaksCnt = _peaks.size();
peakVector.reserve( peakVector.size() + peaksCnt );
for ( size_t k = 0; k < peaksCnt; ++k ) {
const MbApex3D * peak = peaks[k];
const MbApex3D * peak = _peaks[k];
peakVector.push_back( peak );
}
}
@@ -334,32 +334,32 @@ public:
/// \ru Вывернуть объект наизнанку - переориентировать заданную триангуляцию. \en Revert the object - reorient given grids.
bool ReverseGrid( size_t gIndex );
/// \ru Получить пространственный объект, для которого построен полигональный объект. \en Get a spatial object for which a polygonal object is constructed.
const MbSpaceItem * SpaceItem() const { return ((item != nullptr && item->RefType() == rt_SpaceItem) ? (const MbSpaceItem *)item : nullptr); }
const MbSpaceItem * SpaceItem() const { return ((_item != nullptr && _item->RefType() == rt_SpaceItem) ? (const MbSpaceItem *)_item : nullptr); }
/// \ru Получить двумерный объект, для которого построен полигональный объект. \en Get a two-dimensional object for which a polygonal object is constructed.
const MbPlaneItem * PlaneItem() const { return ((item != nullptr && item->RefType() == rt_PlaneItem) ? (const MbPlaneItem *)item : nullptr); }
const MbPlaneItem * PlaneItem() const { return (( _item != nullptr && _item->RefType() == rt_PlaneItem) ? (const MbPlaneItem *)_item : nullptr); }
/// \ru Получить объект геометрической модели, для которого построен полигональный объект. \en Get a model geometric object for which a polygonal object is constructed.
const MbItem * Item() const
{
const MbItem * modelItem = nullptr;
if ( item != nullptr ) {
MbeRefType refType = item->RefType();
if ( _item != nullptr ) {
MbeRefType refType = _item->RefType();
if ( refType == rt_SpaceItem ) {
if ( static_cast<const MbSpaceItem *>(item)->Family() == st_Item )
modelItem = static_cast<const MbItem *>(item);
if ( static_cast<const MbSpaceItem *>( _item)->Family() == st_Item )
modelItem = static_cast<const MbItem *>( _item);
}
}
return modelItem;
}
/// \ru Получить объект, для которого построен полигональный объект. \en Get an object for which a polygonal object is constructed.
const MbRefItem * GetRefItem() const { return item; }
const MbRefItem * GetRefItem() const { return _item; }
/// \ru Запомнить объект, для которого построен полигональный объект. \en Remember an object for which a polygonal object is constructed.
void SetRefItem( const MbRefItem * g ) { item = g; }
void SetRefItem( const MbRefItem * g ) { _item = g; }
/// \ru Сбросить все запомненные объекты. \en Reset all reference objects.
void ResetRefItems();
/// \ru Установить тип полигонального объекта. \en Set a type of polygonal object.
void SetMeshType( MbeSpaceType t ) { type = t; }
void SetMeshType( MbeSpaceType t ) { _type = t; }
/// \ru Дать тип полигонального объекта. \en Get a type of polygonal object.
MbeSpaceType GetMeshType() const { return type; }
MbeSpaceType GetMeshType() const { return _type; }
/// \ru Установить имя всем апексам. \en Set the name of all apexes.
void SetApexName( SimpleName n );
@@ -376,14 +376,14 @@ public:
const MbGrid * FindGridByName( const SimpleName h ) const;
/// \ru Замкнутость объекта. \en Object closeness.
bool IsClosed() const { return closed; }
bool IsClosed() const { return _closed; }
/// \ru Установить (не)замкнутость объекта. \en Set object (un-) closeness.
void SetClosed( bool c ) const { closed = c; }
void SetClosed( bool c ) const { _closed = c; }
/// \ru Определить (не)замкнутость объекта и установить флаг. \en Check object (un-) closeness and set the flag.
void CheckClosed() const;
/// \ru Объекты на числах double. \en Objects on double data.
bool IsExact() const { return exact; }
bool IsExact() const { return _exact; }
/**
\brief \ru Определить положение объекта относительно плоскости.
@@ -468,8 +468,8 @@ public:
*/
void CreateGridSearchTrees( bool forcedNew = false )
{
for ( size_t k = grids.size(); k--; ) {
const MbGrid * grid = grids[k];
for ( size_t k = _grids.size(); k--; ) {
const MbGrid * grid = _grids[k];
if ( nullptr != grid ) {
if ( forcedNew || !grid->IsSearchTreeReady() )
grid->CreateSearchTree();
@@ -483,18 +483,19 @@ public:
*/
void DeleteGridSearchTrees()
{
for ( size_t k = grids.size(); k--; ) {
const MbGrid * grid = grids[k];
for ( size_t k = _grids.size(); k--; ) {
const MbGrid * grid = _grids[k];
if ( nullptr != grid )
grid->DeleteSearchTree();
}
}
/// \ru Готова ли топология полигонального объекта. \en Whether information about polygonal object topology is ready.
bool IsMeshTopologyReady() const { return topo != nullptr; }
/// \ru Создать новый временный объект информации о топологии полигонального объекта. \en Create new temporary maintenance object information about polygonal object topology.
const MbMeshTopology * CreateMeshTopology( bool keepExisting ) const;
MbMeshTopology * CreateMeshTopology( bool keepExisting ) const;
/// \ru Удалить информацию о топологии полигонального объекта. \en Delete a information about polygonal object topology.
void ResetMeshTopology() const;
void ResetMeshTopology() const;
/// \ru Инициализировать по топологии полигонального объекта. \en Initialize by polygonal object topology.
void UpdateByMeshTopology();
private:
// \ru Объявление оператора присваивания без реализации, чтобы не было присваивания по умолчанию. \en The declaration of the assignment operator without implementation to prevent an assignment by default.
MbMesh & operator = ( const MbMesh & );
+2 -4
View File
@@ -58,8 +58,7 @@ public:
// \ru \name Общие функции примитива. \en \name Common functions of primitive.
MbePrimitiveType IsA() const override; // \ru Тип объекта. \en A type of an object.
DEPRECATE_DECLARE_REPLACE(Clone) MbExactGrid & Duplicate( MbRegDuplicate * = nullptr ) const override; // \ru Создать копию объекта. \en Create a copy of the object.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
void Transform( const MbMatrix3D & ) override; // \ru Преобразовать сетку согласно матрице. \en Transform mesh according to the matrix.
void Move ( const MbVector3D & ) override; // \ru Сдвиг сетки. \en Move mesh.
void Rotate ( const MbAxis3D &, double angle ) override; // \ru Поворот сетки вокруг оси. \en Rotation of mesh about an axis.
@@ -324,8 +323,7 @@ public:
// \ru \name Общие функции примитива. \en \name Common functions of primitive.
MbePrimitiveType IsA() const override; // \ru Тип объекта. \en A type of an object.
DEPRECATE_DECLARE_REPLACE(Clone) MbFloatGrid & Duplicate( MbRegDuplicate * = nullptr ) const override; // \ru Создать копию объекта. \en Create a copy of the object.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
void Transform( const MbMatrix3D & ) override; // \ru Преобразовать сетку согласно матрице. \en Transform mesh according to the matrix.
void Move ( const MbVector3D & ) override; // \ru Сдвиг сетки. \en Move mesh.
void Rotate ( const MbAxis3D &, double angle ) override; // \ru Поворот сетки вокруг оси. \en Rotation of mesh about an axis.
+4 -6
View File
@@ -50,9 +50,8 @@ public :
public:
// \ru Общие функции примитива. \en Common functions of the primitive.
MbePrimitiveType IsA() const override; // \ru Вернуть тип объекта \en Get the object type.
DEPRECATE_DECLARE_REPLACE(Clone) MbExactPolygon3D & Duplicate( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
MbePrimitiveType IsA() const override; // \ru Вернуть тип объекта \en Get the object type.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
void Transform( const MbMatrix3D & ) override; // \ru Преобразовать полигон согласно матрице \en Transform polygon according to the matrix
void Move ( const MbVector3D & ) override; // \ru Сдвиг полигона \en Translation of the polygon.
void Rotate ( const MbAxis3D &, double angle ) override; // \ru Поворот полигона вокруг оси \en Rotation of the polygon around an axis
@@ -178,9 +177,8 @@ public :
public:
// \ru Общие функции примитива. \en Common functions of the primitive.
MbePrimitiveType IsA() const override; // \ru Вернуть тип объекта \en Get the object type.
DEPRECATE_DECLARE_REPLACE(Clone) MbFloatPolygon3D & Duplicate( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
MbePrimitiveType IsA() const override; // \ru Вернуть тип объекта \en Get the object type.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
void Transform( const MbMatrix3D & ) override; // \ru Преобразовать полигон согласно матрице \en Transform polygon according to the matrix
void Move ( const MbVector3D & ) override; // \ru Сдвиг полигона \en Translation of the polygon.
void Rotate ( const MbAxis3D &, double angle ) override; // \ru Поворот полигона вокруг оси \en Rotation of the polygon around an axis
+29 -19
View File
@@ -105,7 +105,7 @@ enum MbePrimitiveType {
////////////////////////////////////////////////////////////////////////////////
class MATH_CLASS MbPrimitive : public MbAttributeContainer, public MbRefItem, public MbNestSyncItem {
protected:
SimpleName name; ///< \ru Имя примитива (хеш сложного имени). \en Name of primitive (hash of a complex name).
MbName name; ///< \ru Имя примитива. \en Name of primitive.
const MbRefItem * parentItem; ///< \ru Породивший объект (не владеем). \en Begetter object (don't own).
MbeRefType type; ///< \ru Тип примитива. \en Type of primitive.
@@ -126,7 +126,8 @@ public:
\en \name Common functions of primitive.
\{ */
/// \ru Получить тип объекта. \en Get the object type.
virtual MbePrimitiveType Type() const = 0;
virtual MbePrimitiveType Type() const = 0;
virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object.
/// \ru Регистрационный тип (для копирования, дублирования). \en Registration type (for copying, duplication).
MbeRefType RefType() const override;
@@ -153,7 +154,7 @@ public:
\return \ru Копия объекта.
\en The object copy. \~
*/
DEPRECATE_DECLARE_REPLACE(Clone) virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0;
virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = nullptr ) const { return *Clone(iReg).detach(); };
/** \brief \ru Создать копию примитива.
\en Create a copy of primitive. \~
@@ -178,7 +179,7 @@ public:
\return \ru Копия объекта.
\en The object copy. \~
*/
virtual SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const = 0;
virtual SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const = 0;
/** \brief \ru Преобразовать примитив согласно матрице.
\en Transform primitive according to the matrix. \~
@@ -258,10 +259,21 @@ public:
/// \ru Записать свойства объекта. \en Set properties of the object.
virtual void SetProperties( const MbProperties & ) = 0;
// \ru Выдать имя примитива. \en Get name of primitive.
SimpleName GetPrimitiveName() const { return name; }
// \ru Выдать имя примитива. \en Get name of primitive.
SimpleName GetPrimitiveName() const { return name.GetMainName(); }
// \ru Установить имя примитива. \en Set name of primitive.
void SetPrimitiveName( SimpleName n ) { name = n; }
void SetPrimitiveName( SimpleName n ) { name.SetMainName( n ); }
/// \ru Выдать имя объекта. \en Get name of object.
const MbName & GetName() const { return name; }
/// \ru Выдать имя объекта для модификации. \en Get name of object for modification.
MbName & SetName() { return name; }
/// \ru Получить первое имя. \en Get first name.
SimpleName GetFirstName() const { return (name.CountBase() > (size_t)MbName::i_First) ? name.GetFirstNameDirect() : 0; }
/// \ru Выдать hash имени. \en Get hash of name.
SimpleName GetNameHash() const { return name.Hash(); }
/// \ru Установить имя. \en Set name.
void SetName( const MbName & n ) { name.SetName( n ); }
/// \ru Выдать породивший примитив объект. \en Get begetter object of primitive.
const MbRefItem * GetItem() const { return parentItem; }
/// \ru Установить породивший примитив объект. \en Set begetter object of primitive.
@@ -319,8 +331,8 @@ public:
// \ru Общие функции примитива. \en Common functions of the primitive.
MbePrimitiveType Type() const override; // \ru Тип объекта. \en A type of an object.
virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object.
DEPRECATE_DECLARE_REPLACE(Clone) virtual MbApex3D & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object.
//virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object.
//virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object.
//virtual void Transform( const MbMatrix3D & ) = 0; // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
//virtual void Move ( const MbVector3D & ) = 0; // \ru Сдвинуть вдоль вектора. \en Translate along a vector.
//virtual void Rotate ( const MbAxis3D &, double angle ) = 0; // \ru Повернуть вокруг оси на угол. \en Rotate about an axis by an angle.
@@ -384,9 +396,8 @@ public :
public:
// \ru Общие функции примитива. \en Common functions of the primitive.
MbePrimitiveType IsA() const override; // \ru Тип объекта. \en A type of an object.
DEPRECATE_DECLARE_REPLACE(Clone) MbExactApex3D & Duplicate( MbRegDuplicate * = nullptr ) const override; // \ru Создать копию объекта. \en Create a copy of the object
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
MbePrimitiveType IsA() const override; // \ru Тип объекта. \en A type of an object.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
void Transform( const MbMatrix3D & ) override; // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
void Move ( const MbVector3D & ) override; // \ru Сдвинуть вдоль вектора. \en Translate along a vector.
void Rotate ( const MbAxis3D &, double angle ) override; // \ru Повернуть вокруг оси на угол. \en Rotate about an axis by an angle.
@@ -451,9 +462,8 @@ public :
public:
// \ru Общие функции примитива. \en Common functions of the primitive.
MbePrimitiveType IsA() const override; // \ru Тип объекта. \en A type of an object.
DEPRECATE_DECLARE_REPLACE(Clone) MbFloatApex3D & Duplicate( MbRegDuplicate * = nullptr ) const override; // \ru Создать копию объекта. \en Create a copy of the object.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
MbePrimitiveType IsA() const override; // \ru Тип объекта. \en A type of an object.
SPtr<MbPrimitive> Clone( MbRegDuplicate * iReg = nullptr ) const override; // \ru Создать копию объекта \en Create a copy of the object
void Transform( const MbMatrix3D & ) override; // \ru Преобразовать согласно матрице. \en Transform according to the matrix.
void Move ( const MbVector3D & ) override; // \ru Сдвинуть вдоль вектора. \en Translate along a vector.
void Rotate ( const MbAxis3D &, double angle ) override; // \ru Повернуть вокруг оси на угол. \en Rotate about an axis by an angle.
@@ -523,8 +533,8 @@ public:
// \ru Общие функции примитива. \en Common functions of the primitive.
MbePrimitiveType Type() const override; // \ru Вернуть тип объекта \en Get the object type.
virtual MbePrimitiveType IsA() const = 0; // \ru Вернуть тип объекта \en Get the object type.
DEPRECATE_DECLARE_REPLACE(Clone) virtual MbPolygon3D & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию объекта \en Create a copy of the objec
//virtual MbePrimitiveType IsA() const = 0; // \ru Вернуть тип объекта \en Get the object type.
//virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; // \ru Создать копию объекта \en Create a copy of the objec
//virtual void Transform( const MbMatrix3D & ) = 0; // \ru Преобразовать полигон согласно матрице \en Transform polygon according to the matrix
//virtual void Move ( const MbVector3D & ) = 0; // \ru Сдвиг полигона \en Translation of the polygon.
//virtual void Rotate ( const MbAxis3D &, double angle ) = 0; // \ru Поворот полигона вокруг оси \en Rotation of the polygon around an axis
@@ -706,8 +716,8 @@ public:
\en \name Common functions of primitive.
\{ */
MbePrimitiveType Type() const override; // \ru Тип объекта. \en A type of an object.
virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object.
DEPRECATE_DECLARE_REPLACE(Clone) virtual MbGrid & Duplicate( MbRegDuplicate * = nullptr ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object.
//virtual MbePrimitiveType IsA() const = 0; // \ru Тип объекта. \en A type of an object.
//virtual MbPrimitive & Duplicate( MbRegDuplicate * iReg = nullptr ) const = 0; // \ru Создать копию объекта. \en Create a copy of the object.
//virtual void Transform( const MbMatrix3D & ) = 0; // \ru Преобразовать сетку согласно матрице. \en Transform mesh according to the matrix.
//virtual void Move ( const MbVector3D & ) = 0; // \ru Сдвиг сетки. \en Move mesh.
//virtual void Rotate ( const MbAxis3D &, double angle ) = 0; // \ru Поворот сетки вокруг оси. \en Rotation of mesh about an axis.
+4
View File
@@ -931,6 +931,7 @@ private:
//////////////////////////////////////////////////////////////////////////////////////////
class MATH_CLASS MbTopologyItem;
class MATH_CLASS MbPrimitive;
class MATH_CLASS MbTopologyProxy;
//----------------------------------------------------------------------------------------
@@ -1326,6 +1327,9 @@ public:
/// \ru Генерация имени по другому имени, полное совпадение. \en Generate name by other name, full coincidence.
virtual void CompileEdgeName( MbTopologyItem & item, const MbName & other ) const;
/// \ru Генерация имени триангуляции: mainName, hash( sideName, add ). \en Generate name for grid: mainName, hash( sideName, add ).
virtual void MakeGridName( MbPrimitive & item, size_t i, SimpleName add ) const;
public:
/// \ru Добавить генератор имен. \en Add name generator.
void AddSNameMaker( const MbSNameMaker & other ) { *this += other; }
+14
View File
@@ -397,10 +397,24 @@ public:
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const MbEdgeFacesIndexes & other, double accuracy ) const;
/// \ru Номер ребра в множестве рёбер тела. \en The index of the edge in the set of solid edges.
size_t GetEdgeIndex() const { return edgeIndex; }
/// \ru Номер грани слева в множестве граней тела. \en The index of the face on the left in the set of solid faces.
size_t GetFacePIndex() const { return facePIndex; }
/// \ru Номер грани справа в множестве граней тела. \en The index of the face on the right in the set of solid faces.
size_t GetFaceMIndex() const { return faceMIndex; }
/// \ru Контрольная точка ребра. \en Control point of the edge.
const MbCartPoint3D & GetPoint() const { return point; }
MbCartPoint3D & SetPoint() { return point; }
/// \ru Имя объекта. \en A name of an object.
SimpleName GetItemName() const { return itemName; }
/// \ru Установить индекс. \en Set index.
void SetIndex( size_t index, size_t indexP, size_t indexM ) { edgeIndex = index; facePIndex = indexP; faceMIndex = indexM; }
/// \ru Установить имя. \en Set name.
void SetName( SimpleName name ) { itemName = name; }
/// \ru Установить имя. \en Set name.
void SetPoint( const MbCartPoint3D & p ) { point = p; }
/// \ru Статический оператор меньше. \en Static operator "less".
static bool LessByEdgeIndex( const MbEdgeFacesIndexes & ind1, const MbEdgeFacesIndexes & ind2 )
+101 -44
View File
@@ -18,6 +18,7 @@
#include <mb_axis3d.h>
#include <curve.h>
#include <curve3d.h>
#include <cur_surface_curve.h>
#include <topology.h>
#include <wire_frame.h>
#include <op_binding_data.h>
@@ -721,20 +722,13 @@ public:
// ---
class MATH_CLASS MbCurveExtensionParameters : public MbPrecision
{
public:
friend class MbExtendCurveCreator;
private:
MbCurveExtensionEnds _paramStart; ///< \ru Параметры продления начала. \en The parameters to extend to the start point. \~
MbCurveExtensionEnds _paramEnd; ///< \ru Параметры продления конца. \en The parameters to extend to the end point. \~
c3d::SNameMakerSPtr _operName; ///< \ru Именователь операции. Всегда не ноль. \en An object defining names generation in the operation. It is always not nullptr. \~
bool _allowClosure; ///< \ru Разрешено ли замыкание. По умолчанию разрешено. \en Whether closure is allowed. It is allowed by default. \~
bool _extendAlongSurface; ///< \ru Удлинять вдоль поверхности. Действует только на поверхностные кривые (MbSurfaceCurve). \en Extend along the surface. It works only with MbSurfaceCurve. \~
c3d::ConstSurfaceSPtr _surface; ///< \ru Поверхность, на которой расположена кривая. Может быть nullptr. \en A surface, which the curve lies in. It can be nullptr. \~
protected:
MbCurveExtensionEnds _paramStart; ///< \ru Параметры продления начала. \en The parameters to extend to the start point. \~
MbCurveExtensionEnds _paramEnd; ///< \ru Параметры продления конца. \en The parameters to extend to the end point. \~
c3d::SNameMakerSPtr _operName; ///< \ru Именователь операции. Всегда не ноль. \en An object defining names generation in the operation. It is always not nullptr. \~
bool _allowClosure; ///< \ru Разрешено ли замыкание. По умолчанию разрешено. \en Whether closure is allowed. It is allowed by default. \~
public:
//------------------------------------------------------------------------------
/** \brief \ru Конструктор.
\en Constructor. \~
@@ -746,6 +740,10 @@ public:
\en Parameters of extension from the end point. \~
\param[in] allowClosure - \ru Допустимо ли замыкание удлиненной кривой.
\en Whether closure of the extended curve is allowed. \~
\param[in] alongSurface - \ru Если true, то будет удлинена параметрическая (2D) кривая.
Если false, будет удлинена пространственная (3D) кривая.
\en If that is true then the parametric (2D) curve will be extended.
If that is false then the spatial (3D) curve will be extended.\~
\param[in] operName - \ru Именователь операции.
\en An object defining names generation in the operation. \~
*/
@@ -755,46 +753,22 @@ public:
const bool allowClosure,
const MbSNameMaker & operName );
//------------------------------------------------------------------------------
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор копирования.
\en Copy constructor. \~
*/
// ---
MbCurveExtensionParameters( const MbCurveExtensionParameters & other );
//------------------------------------------------------------------------------
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\param[in] sourceCurve - \ru Исходная кривая, нуждающаяся в удлинении.
\en The source curve, which is needed to be extended. \~
\param[in] paramStart - \ru Параметры продления начала кривой.
\en Parameters of extension to the start point. \~
\param[in] paramEnd - \ru Параметры продления конца кривой.
\en Parameters of extension from the end point. \~
\param[in] allowClosure - \ru Допустимо ли замыкание удлиненной кривой .
\en Whether closure of the extended curve allowed. \~
\param[in] alongSurface - \ru Если true, то будет удлинена параметрическая (2D) кривая.
Если false, будет удлинена пространственная (3D) кривая.
\en If that is true then the parametric (2D) curve will be extended.
If that is false then the spatial (3D) curve will be extended.\~
\param[in] operName - \ru Именователь операции.
\en An object defining names generation in the operation. \~
*/
// ---
MbCurveExtensionParameters( const MbSurfaceCurve & sourceCurve,
const MbCurveExtensionEnds & paramStart,
const MbCurveExtensionEnds & paramEnd,
const bool allowClosure,
const bool alongSurface,
const MbSNameMaker & operName );
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор для чтения.
\en Constructor for reading. \~
*/
// ---
MbCurveExtensionParameters( TapeInit tapeInit );
/// \ru Деструктор. \en Destructor. \~
@@ -823,11 +797,8 @@ public:
/// \ru Получить информацию о разрешении замкнутости. \en Get the information about closure allowing. \~
bool IsClosureAllowed() const { return _allowClosure; }
/// \ru Удлинять поверхностные кривые вдоль поверхности. \en Extend surface curves along the surface. \~
bool IsExtensionAlongSurface() const { return (_extendAlongSurface && !_surface.is_null() ); }
/// \ru Поверхность, на которой расположена кривая. Имеет смысл только в случае удлинения вдоль поверхности. В противном случае всегда nullptr. \en A surface, which the curve lies in. It makes a sense if the option "Along surface" is switched on. Otherwise it is always nullptr. \~
const c3d::ConstSurfaceSPtr & GetSurface() const { return _surface; }
/// \ru Версия операции. \en Version of the operation. \~
VERSION GetVersion() const { return _operName->GetMathVersion(); }
/// \ru Минимальная величина зазора (в параметрическом пространстве) для случая, когда запрещено создания замкнутых кривых. \en Minimal gap value (in parametric space) for case when closed result curves are forbidden. \~
static double GetMinUnclosedGap() { return Math::paramPrecision; }
@@ -837,6 +808,78 @@ public:
KNOWN_OBJECTS_RW_REF_OPERATORS( MbCurveExtensionParameters ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
};
//-------------------------------------------------------------------------------
/** \brief \ru Параметры продления кривой.
\en Parameters of the curve extension. \~
\details \ru Параметры продления кривой.
\en Parameters of the curve extension. \~
\ingroup Data_Structures
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbCurveExtensionParameters3D : public MbCurveExtensionParameters
{
private:
bool _extendAlongSurface; ///< \ru Удлинять вдоль поверхности. Действует только на поверхностные кривые. \en Extend along the surface. It works only with curves on surface. \~
public:
//------------------------------------------------------------------------------
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по параметрам.
\en Constructor by parameters. \~
\param[in] paramStart - \ru Параметры продления начала кривой.
\en Parameters of extension to the start point. \~
\param[in] paramEnd - \ru Параметры продления конца кривой.
\en Parameters of extension from the end point. \~
\param[in] allowClosure - \ru Допустимо ли замыкание удлиненной кривой.
\en Whether closure of the extended curve is allowed. \~
\param[in] alongSurface - \ru Флаг, определяющий, продлевается ли поверхностная кривая, оставаясь лежать на поверхности.
\en The flag determining whether the curve on surface is extended, staying to lie in the surface.
\param[in] operName - \ru Именователь операции.
\en An object defining names generation in the operation. \~
*/
// ---
MbCurveExtensionParameters3D( const MbCurveExtensionEnds & paramStart,
const MbCurveExtensionEnds & paramEnd,
const bool allowClosure,
const bool alongSurface,
const MbSNameMaker & operName );
//------------------------------------------------------------------------------
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор копирования.
\en Copy constructor. \~
*/
// ---
MbCurveExtensionParameters3D( const MbCurveExtensionParameters3D & other );
//------------------------------------------------------------------------------
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор для чтения.
\en Constructor for reading. \~
*/
// ---
MbCurveExtensionParameters3D( TapeInit tapeInit );
/// \ru Деструктор. \en Destructor. \~
~MbCurveExtensionParameters3D();
/// \ru Вернуть true, если *this == other. \en Return true if *this == other. \~
bool IsEqual( const MbCurveExtensionParameters3D & other ) const;
/// \ru Если true, то поверхностные кривые после удлинения останутся лежать на поверхности. В противном случае, удлиненная часть может покинуть поверхность. Действует только на поверхностные кривые. \en If it is true then curves on surface will lie in the surface after extension. Otherwise, extending part can leave the surface. It works only with curves on surface. \~
bool IsExtensionAlongSurface() const { return _extendAlongSurface; }
/// \ru Оператор присваивания. \en Assignment operator. \~
MbCurveExtensionParameters3D & operator=( const MbCurveExtensionParameters3D & other );
KNOWN_OBJECTS_RW_REF_OPERATORS( MbCurveExtensionParameters3D ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
};
//-------------------------------------------------------------------------------
/** \brief \ru Параметры создания фаски.
@@ -1116,6 +1159,8 @@ public:
// \ru Параметры сглаживания зашумленных точек. \en Parameters for smoothing noisy points.
double _noisyDeviation; ///< \ru Величина отклонения сглаживающей кривой от зашумленных точек. \en Value of smoothing curve deviation from noisy points.
size_t _noisyIterations; ///< \ru Количество итераций сглаживания зашумленных точек. \en Number of iterations of smoothing noisy points.
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.
// \ru Диагностика. \en The diagnostics.
MbeFairWarning _warning; ///< \ru Предупреждение о работе. \en The operation warning. \~
@@ -1133,6 +1178,7 @@ public:
_degree( 8 ), _approx( fairApprox_IsoNurbs ), _tangentCorrect( true ),
_smoothTorsion( false ), _iterationsNumber( 1000 ),
_noisyDeviation( 0.002 ), _noisyIterations( 200 ),
_fixFirstPointNoisy( false ), _fixLastPointNoisy( false ),
#ifdef C3D_DEBUG_FAIR_CURVES
prt( nullptr ),
#endif
@@ -1226,6 +1272,9 @@ public:
double _scaleParam; ///< \ru Параметр репараметризации. \en Scaling parameter.
MbeFairCurvature _accountCurvature; ///< \ru Учет кривизны в концевых точках. \en Accounting for curvature at end points. \~
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.
MbeFairWarning _warning; ///< \ru Предупреждение о работе. \en The operation warning. \~
MbResultType _error; ///< \ru Ошибка о работе. \en The operation error. \~
@@ -1238,6 +1287,7 @@ public:
MbFairChangeData() : MbPrecision(),
_outFormat( fairFormat_Close ), _nSegments( 4 ), _numSegment( 0 ), _tParam( 0.5 ),
_fairing( fairSmooth_Yes ), _degree ( 8 ), _scaleParam( 1.0 ), _accountCurvature( fairCur_No ),
_fixFirstPointNoisy( false ), _fixLastPointNoisy( false ),
#ifdef C3D_DEBUG_FAIR_CURVES
prt( nullptr ),
#endif
@@ -1319,6 +1369,13 @@ public:
/// \ru Получить результирующую кривую. \en Get the result curve.
c3d::WireFrameSPtr & SetCurve() { return _resultCurve; }
/// \ru Забрать кривую, удалив ее из каркаса. \en Extract a curve, removing it from wireframe.
c3d::SpaceCurveSPtr ExtractCurve() {
c3d::SpaceCurvesSPtrVector curves;
ExtractCurves( _resultCurve, curves );
return curves.size() ? curves[0] : nullptr;
}
/// \ru Сведения об ошибке аппроксимации. \en Approximation error information.
const MbApproxError & GetApproxError() const { return *this; }
+36 -8
View File
@@ -182,7 +182,7 @@ public:
, endLength ( UNDEFINED_DBL )
, form ( smoothForm )
, smoothCorner ( cornerForm )
, prolong ( bProlong )
, prolong ( bProlong )
, keepCant ( keepForm )
, strict ( isStrict )
, equable ( isEquable )
@@ -228,7 +228,14 @@ public:
return *this;
}
/// \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSame( const SmoothValues & other, double accuracy ) const;
bool IsSame( const SmoothValues & other, double accuracy ) const;
/// \ru Являются ли объекты равными по части параметров. \en Determine whether objects are partially equal.
bool IsSimilar ( const SmoothValues & other, double accuracy = PARAM_EPSILON ) const {
return ::fabs(distance1 - other.distance1) < accuracy &&
::fabs(distance2 - other.distance2) < accuracy &&
::fabs(conic - other.conic) < accuracy &&
keepCant == other.keepCant;
}
public:
KNOWN_OBJECTS_RW_REF_OPERATORS( SmoothValues ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
@@ -1457,6 +1464,7 @@ public:
MbCartPoint3D origin; ///< \ru Точка опоры при модификации. \en Fulcrum when modifying.
double value; ///< \ru Величина смещения/изменение радиуса. \en Offset value/change of radius.
double tolerance; ///< \ru Точность построения. \en Operation tolerance.
bool removeWithFillets; ///< \ru Удалять грань вместе с прилегающими скруглениями. \en Whether to delete a face toghether with ajacent fillets.
public:
/** \brief \ru Конструктор по умолчанию.
@@ -1470,6 +1478,7 @@ public:
, origin ( 0.0, 0.0, 0.0 )
, value ( 0.0 )
, tolerance( Math::metricAccuracy )
, removeWithFillets ( true )
{}
/// \ru Конструктор по способу модификации и вектору перемещения. \en Constructor by way of modification and movement vector.
ModifyValues( MbeModifyingType w, const MbVector3D & p )
@@ -1478,6 +1487,7 @@ public:
, origin ( 0.0, 0.0, 0.0 )
, value ( 0.0 )
, tolerance( Math::metricAccuracy )
, removeWithFillets ( true )
{}
/// \ru Конструктор по способу модификации и скалярному параметру. \en Constructor by way of modification and the scalar value.
ModifyValues( MbeModifyingType w, double val, double eps = Math::metricAccuracy )
@@ -1486,6 +1496,16 @@ public:
, origin ( 0.0, 0.0, 0.0 )
, value ( val )
, tolerance( eps )
, removeWithFillets ( true )
{}
/// \ru Конструктор по способу модификации и скалярному параметру. \en Constructor by way of modification and the scalar value.
ModifyValues( MbeModifyingType w, double val, bool removeAjacentFillets )
: way ( w )
, direction( 0.0, 0.0, 0.0 )
, origin ( 0.0, 0.0, 0.0 )
, value ( val )
, tolerance( Math::metricAccuracy )
, removeWithFillets ( removeAjacentFillets )
{}
/// \ru Конструктор копирования. \en Copy-constructor.
ModifyValues( const ModifyValues & other )
@@ -1494,6 +1514,7 @@ public:
, origin ( other.origin )
, value ( other.value )
, tolerance( other.tolerance )
, removeWithFillets ( other.removeWithFillets)
{}
/// \ru Деструктор. \en Destructor.
~ModifyValues() {}
@@ -1505,6 +1526,7 @@ public:
origin = other.origin;
value = other.value;
tolerance = other.tolerance;
removeWithFillets = other.removeWithFillets;
}
/// \ru Оператор присваивания. \en Assignment operator.
ModifyValues & operator = ( const ModifyValues & other ) {
@@ -1513,6 +1535,7 @@ public:
origin = other.origin;
value = other.value;
tolerance = other.tolerance;
removeWithFillets = other.removeWithFillets;
return *this;
}
/// \ru Преобразовать объект согласно матрице. \en Transform an object according to the matrix.
@@ -1536,6 +1559,8 @@ public:
/// \ru Точность построения. \en Operation tolerance.
double GetTolerance() const { return tolerance; }
void SetTolerance( double t ) { tolerance = ::fabs( t ); }
/// \ru Установить флаг удаления сопряжённых скруглений. \en Set the flag to remove ajacent fillets.
void SetRemoveFillets( bool remove ) { removeWithFillets = remove; }
KNOWN_OBJECTS_RW_REF_OPERATORS( ModifyValues ) // \ru Для работы со ссылками и объектами класса. \en For working with references and objects of the class.
};
@@ -2012,13 +2037,13 @@ inline void NurbsSurfaceValues::SetThroughPoints( bool tp )
class MATH_CLASS MbNurbsSurfacesShellParams : public MbPrecision {
private:
NurbsSurfaceValues _params; ///< \ru Параметры операции. \en The operation parameters.
SPtr<MbSNameMaker> _operNames; ///< \ru Именователь операции. \en An object defining names generation in the operation.
bool _isPhantom; ///< \ru Создается ли фантомное тело. \en Is phantom shell created.
NurbsSurfaceValues & _params; ///< \ru Параметры операции. \en The operation parameters.
SPtr<MbSNameMaker> _operNames; ///< \ru Именователь операции. \en An object defining names generation in the operation.
bool _isPhantom; ///< \ru Создается ли фантомное тело. \en Is phantom shell created.
public:
/// \ru Конструктор по параметрам. \en Сonstructor by parameters.
MbNurbsSurfacesShellParams( const NurbsSurfaceValues& values, const MbSNameMaker & operNames, bool isPhantom )
MbNurbsSurfacesShellParams( NurbsSurfaceValues & values, const MbSNameMaker & operNames, bool isPhantom )
: MbPrecision( )
, _params ( values )
, _operNames ( &operNames.Duplicate() )
@@ -2030,6 +2055,7 @@ public:
/// \ru Получить параметры операции. \en Get the operation parameters.
const NurbsSurfaceValues & GetParams() const { return _params; }
NurbsSurfaceValues & SetParams() { return _params; }
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_operNames; }
/// \ru Создается ли фантомное тело. \en Is phantom shell created.
@@ -6325,7 +6351,7 @@ public:
/// \ru Получить набор граней. \en Get the faces.
void GetFaces( c3d::FacesVector & faces ) const;
/// \ru Получить набор ребер. \en Get the edges.
void GetEdges( c3d::EdgesSPtrVector & edges ) const;
void GetEdges( c3d::EdgesVector & edges ) const;
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *_names; }
/// \ru Получить базовое направление. \en Get basic direction.
@@ -6342,8 +6368,10 @@ public:
const MbDraftSolidParams & operator = ( const MbDraftSolidParams & );
private:
/// \ru Поменять на противоположный угол уклона и флаг обращения базового направления. \en Invert drafts angle and basic directions flag.
// \ru Поменять на противоположный угол уклона и флаг обращения базового направления. \en Invert drafts angle and basic directions flag.
void Invert();
// \ru Поменять на противоположный угол уклона и флаг обращения базового направления c проверкой версии. \en Invert drafts angle and basic directions flag with version check.
void InvertWithCheckVersion();
};
+93 -61
View File
@@ -1529,12 +1529,13 @@ private:
class MATH_CLASS MbSectionRail {
private:
std::vector<c3d::EdgeSPtr> edges; ///< \ru Направляющие рёбра (могут отсутствовать). \en The guide edges (may be empty). \~
std::vector<bool> edgeSide; ///< \ru С какой гранью ребра гладко стыковать поверхность (синхронно с edges). \en What face of edge should the surface join smoothly to (synchronously with edges). \~
std::vector<MbEdgeFacesIndexes> edgeIndex; ///< \ru Номера направляющих рёбер (могут отсутствовать). \en The guide edge numbers (may be empty). \~
std::vector<c3d::FaceSPtr> faces; ///< \ru Опорные грани (могут отсутствовать). \en The reference faces (may be empty). \~
std::vector<bool> faceSide; ///< \ru С каких сторон касаться поверхностей при form==cs_Linea (синхронно с faces). \en On which sides to touch surfaces when form==cs_Linea (synchronously with faces). \~
std::vector<MbItemIndex> faceIndex; ///< \ru Номера опорных граней. \en The reference face numbers (may be empty). \~
std::vector<c3d::EdgeSPtr> edges; ///< \ru Направляющие рёбра (могут отсутствовать). \en The guide edges (may be empty). \~
std::vector<bool> edgeSide; ///< \ru С какой гранью ребра гладко стыковать поверхность (синхронно с edges). \en What face of edge should the surface join smoothly to (synchronously with edges). \~
std::vector<MbItemIndex> edgeIndex; ///< \ru Номера направляющих рёбер (могут отсутствовать). \en The guide edge numbers (may be empty). \~
std::vector<c3d::SolidSPtr> solids; ///< \ru Тела опорных граней или направляющих рёбер (могут отсутствовать). \en The solids of reference faces or guide edges (may be empty). \~
std::vector<c3d::SpaceCurveSPtr> curves; ///< \ru Направляющие кривые (могут отсутствовать). \en The guide curves (may be empty). \~
c3d::SpaceCurveSPtr track; ///< \ru Кривая, через которую должно пройти сечение (может отсутствовать). \en The curve that the section should pass through (may be nullptr). \~
c3d::FunctionSPtr function; ///< \ru Функция угла наклона, или длины, или радиуса (может отсутствовать). \en The function of the angle of inclination, or of the length, or of the fillet radius (may be nullptr). \~
@@ -1544,12 +1545,12 @@ public:
/// \ru Конструктор по умолчанию. \en Empty constructor.
MbSectionRail()
: edges ()
, edgeSide ()
, edgeIndex()
, faces ()
: faces ()
, faceSide ()
, faceIndex()
, edges ()
, edgeSide ()
, edgeIndex()
, curves ()
, track ( nullptr )
, function ( nullptr )
@@ -1588,26 +1589,8 @@ public:
public:
/// \ru Добавить в данные направляющую кривую. \en Add guiding to data. \~
void AddEdge( MbCurveEdge & _edge, bool side );
/// \ru Выдать направляющие рёбра. \en Get guide edges.
void GetEdges( std::vector<MbCurveEdge *> & eds ) const;
void GetEdges( RPArray<MbCurveEdge> & eds ) const;
/// \ru Какую сторону кривой гладко стыковать с поверхностью? \en Which side should the surface join smoothly to?
void GetEdgeSide( std::vector<bool> & eSide ) const;
/// \ru Выдать номера направляющих рёбер. \en Get guide edge numbers.
void GetEdgeIndex( std::vector<MbEdgeFacesIndexes> & ads ) const;
std::vector<MbEdgeFacesIndexes> & SetEdgeIndex() { return edgeIndex; }
/// \ru Выдать количество направляющих ребер. \en Get guide edges count.
size_t GetEdgesCount() const { return edges.size(); }
size_t GetEdgeSideCount() const { return edgeSide.size(); }
/// \ru Выдать направляющее ребро. \en Get guide edge.
MbCurveEdge * SetEdge( size_t i ) { return ( i < edges.size() ) ? edges[i].get() : nullptr; }
/// \ru Установить сторону ребра. \en Set edge side.
void SetEdgeSide( size_t i, bool s ) { if ( i < edgeSide.size() ) edgeSide[i] = s; }
/// \ru Добавить в данные поверхность. \en Add surface to data. \~
void AddFace( MbFace & _face, bool side );
void AddFace( MbFace & _face, bool side, MbSolid * solid = nullptr );
/// \ru Выдать грани. \en Get faces.
void GetFaces( std::vector<MbFace *> & fas ) const;
void GetFaces( RPArray<MbFace> & fas ) const;
@@ -1616,14 +1599,44 @@ public:
/// \ru Выдать номера опорных граней. \en Get reference face numbers.
void GetFaceIndex( std::vector<MbItemIndex> & fas ) const;
std::vector<MbItemIndex> & SetFaceIndex() { return faceIndex; }
/// \ru Выдать количество направляющих граней. \en Get guide faces count.
/// \ru Выдать количество опорных граней. \en Get guide faces count.
size_t GetFacesCount() const { return faces.size(); }
size_t GetFaceSideCount() const { return faceSide.size(); }
/// \ru Выдать направляющую грань. \en Get guide face.
/// \ru Выдать опорную грань. \en Get guide face.
MbFace * SetFace( size_t i ) { return ( i < faces.size() ) ? faces[i].get() : nullptr; }
/// \ru Установить сторону касания грани. \en Set face side.
void SetFaceSide( size_t i, bool s ) { if ( i < faceSide.size() ) faceSide[i] = s; }
/// \ru Добавить в данные направляющую кривую. \en Add guiding to data. \~
void AddEdge( MbCurveEdge & _edge, bool side, MbSolid * solid = nullptr );
/// \ru Выдать направляющие рёбра. \en Get guide edges.
void GetEdges( std::vector<MbCurveEdge *> & eds ) const;
void GetEdges( RPArray<MbCurveEdge> & eds ) const;
/// \ru Какую сторону кривой гладко стыковать с поверхностью? \en Which side should the surface join smoothly to?
void GetEdgeSide( std::vector<bool> & eSide ) const;
/// \ru Выдать номера направляющих рёбер. \en Get guide edge numbers.
void GetEdgeIndex( std::vector<MbItemIndex> & ads ) const;
std::vector<MbItemIndex> & SetEdgeIndex() { return edgeIndex; }
/// \ru Выдать количество направляющих ребер. \en Get guide edges count.
size_t GetEdgesCount() const { return edges.size(); }
size_t GetEdgeSideCount() const { return edgeSide.size(); }
/// \ru Выдать направляющее ребро. \en Get guide edge.
MbCurveEdge * SetEdge( size_t i ) { return ( i < edges.size() ) ? edges[i].get() : nullptr; }
/// \ru Установить сторону ребра. \en Set edge side.
void SetEdgeSide( size_t i, bool s ) { if ( i < edgeSide.size() ) edgeSide[i] = s; }
/// \ru Выдать тела опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges.
void GetSolids( std::vector<MbSolid *> & sols ) const;
void GetSolids( RPArray<MbSolid> & sols ) const;
/// \ru Выдать количество тел опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges count.
size_t GetSolidsCount() const { return solids.size(); }
/// \ru Выдать тело по индексу. \en Get solid by index.
MbSolid * SetSolid( size_t i ) { return ( i < solids.size() ) ? solids[i].get() : nullptr; }
/// \ru Очистить контейр тел. \en Solid conteiner clear.
void SolidsClear();
/// \ru Выдать уникальные тела. \en Give out unique solids.
void GetUniqueSolids( std::vector<MbSolid *> sols ) const;
/// \ru Добавить в данные кривую. \en Add curve to data. \~
void AddCurve( MbCurve3D & _curve );
/// \ru Добавить в данные кривые. \en Add curves to data. \~
@@ -1687,7 +1700,8 @@ public:
*/
// ---
struct MATH_CLASS MbSectionRule {
public:
private:
c3d::FunctionSPtr discr; ///< \ru Функция управления сечением (дискриминант или радиус, может быть nullptr). \en Section control function (discriminant or radius). \~
c3d::SpaceCurveSPtr track; ///< \ru Кривая, через которую должно пройти сечение. \en The curve that the section should pass through. \~
c3d::SurfaceSPtr touch; ///< \ru Поверхность, которой должно касаться сечение. \en The surface that the section should touch. \~
@@ -1717,6 +1731,7 @@ public:
/// \ru Выдать функцию управления сечением. \en Get section control function. \~
const MbFunction * GetFunction() const { return discr.get(); }
MbFunction * SetFunction() { return discr.get(); }
/// \ru Установить функцию управления сечением. \en Set section control function. \~
void SetFunction( MbFunction & f );
void SetFunction( double f );
@@ -1888,36 +1903,9 @@ public:
///< \ru Данные конечного края сечения. \en The data of the end of section.
MbSectionRail & GetRrail2() { return rail2; }
/// \ru Добавить в данные направляющее ребро. \en Add guiding to data. \~
void AddEdge1( MbCurveEdge & _edge, bool side ) { rail1.AddEdge( _edge, side ); }
void AddEdge2( MbCurveEdge & _edge, bool side ) { rail2.AddEdge( _edge, side ); }
/// \ru Выдать направляющие рёбра. \en Get guide edges.
void GetEdges1( std::vector<MbCurveEdge *> & eds ) const { rail1.GetEdges( eds ); }
void GetEdges1( RPArray<MbCurveEdge> & eds ) const { rail1.GetEdges( eds ); }
/// \ru Выдать направляющие рёбра. \en Get guide edges.
void GetEdges2( std::vector<MbCurveEdge *> & eds ) const { rail2.GetEdges( eds ); }
void GetEdges2( RPArray<MbCurveEdge> & eds ) const { rail2.GetEdges( eds ); }
/// \ru Какую сторону кривой гладко стыковать с поверхностью? \en Which side should the surface join smoothly to?
void GetEdgeSide1( std::vector<bool> & eSide ) const { rail1.GetEdgeSide( eSide ); }
/// \ru Какую сторону кривой гладко стыковать с поверхностью? \en Which side should the surface join smoothly to?
void GetEdgeSide2( std::vector<bool> & eSide ) const { rail2.GetEdgeSide( eSide ); }
/// \ru Выдать номера направляющих рёбер. \en Get guide edge numbers.
void GetEdgeIndex1( std::vector<MbEdgeFacesIndexes> & eds ) const { rail1.GetEdgeIndex( eds ); }
void GetEdgeIndex2( std::vector<MbEdgeFacesIndexes> & eds ) const { rail2.GetEdgeIndex( eds ); }
std::vector<MbEdgeFacesIndexes> & SetEdgeIndex( size_t i ) { return ( (i == 1) ? rail1.SetEdgeIndex() : rail2.SetEdgeIndex() ); }
/// \ru Выдать количество направляющих ребер. \en Get guide edges count.
size_t GetEdgesCount1() const { return rail1.GetEdgesCount(); }
size_t GetEdgesCount2() const { return rail2.GetEdgesCount(); }
size_t GetEdgeSideCount1() const { return rail1.GetEdgeSideCount(); }
size_t GetEdgeSideCount2() const { return rail2.GetEdgeSideCount(); }
/// \ru Выдать направляющее ребро. \en Get guide edge.
MbCurveEdge * SetEdge1( size_t i ) { return rail1.SetEdge( i ); }
/// \ru Выдать направляющее ребро. \en Get guide edge.
MbCurveEdge * SetEdge2( size_t i ) { return rail2.SetEdge( i ); }
/// \ru Добавить направляющую грань. \en Add guide face.
void AddFace1( MbFace & _face, bool side ) { rail1.AddFace( _face, side ); }
void AddFace2( MbFace & _face, bool side ) { rail2.AddFace( _face, side ); }
void AddFace1( MbFace & _face, bool side, MbSolid * solid = nullptr ) { rail1.AddFace( _face, side, solid ); }
void AddFace2( MbFace & _face, bool side, MbSolid * solid = nullptr ) { rail2.AddFace( _face, side, solid ); }
/// \ru Выдать поверхности. \en Get surfaces.
void GetFaces1( std::vector<MbFace *> & fas ) const { rail1.GetFaces( fas ); }
void GetFaces1( RPArray<MbFace> & fas ) const { rail1.GetFaces( fas ); }
@@ -1942,6 +1930,49 @@ public:
/// \ru Выдать направляющую грань. \en Get guide face.
MbFace * SetFace2( size_t i ) { return rail2.SetFace( i ); }
/// \ru Добавить в данные направляющее ребро. \en Add guiding to data. \~
void AddEdge1( MbCurveEdge & _edge, bool side, MbSolid * solid = nullptr ) { rail1.AddEdge( _edge, side, solid ); }
void AddEdge2( MbCurveEdge & _edge, bool side, MbSolid * solid = nullptr ) { rail2.AddEdge( _edge, side, solid ); }
/// \ru Выдать направляющие рёбра. \en Get guide edges.
void GetEdges1( std::vector<MbCurveEdge *> & eds ) const { rail1.GetEdges( eds ); }
void GetEdges1( RPArray<MbCurveEdge> & eds ) const { rail1.GetEdges( eds ); }
/// \ru Выдать направляющие рёбра. \en Get guide edges.
void GetEdges2( std::vector<MbCurveEdge *> & eds ) const { rail2.GetEdges( eds ); }
void GetEdges2( RPArray<MbCurveEdge> & eds ) const { rail2.GetEdges( eds ); }
/// \ru Какую сторону кривой гладко стыковать с поверхностью? \en Which side should the surface join smoothly to?
void GetEdgeSide1( std::vector<bool> & eSide ) const { rail1.GetEdgeSide( eSide ); }
/// \ru Какую сторону кривой гладко стыковать с поверхностью? \en Which side should the surface join smoothly to?
void GetEdgeSide2( std::vector<bool> & eSide ) const { rail2.GetEdgeSide( eSide ); }
/// \ru Выдать номера направляющих рёбер. \en Get guide edge numbers.
void GetEdgeIndex1( std::vector<MbItemIndex> & eds ) const { rail1.GetEdgeIndex( eds ); }
void GetEdgeIndex2( std::vector<MbItemIndex> & eds ) const { rail2.GetEdgeIndex( eds ); }
std::vector<MbItemIndex> & SetEdgeIndex( size_t i ) { return ( (i == 1) ? rail1.SetEdgeIndex() : rail2.SetEdgeIndex() ); }
/// \ru Выдать количество направляющих ребер. \en Get guide edges count.
size_t GetEdgesCount1() const { return rail1.GetEdgesCount(); }
size_t GetEdgesCount2() const { return rail2.GetEdgesCount(); }
size_t GetEdgeSideCount1() const { return rail1.GetEdgeSideCount(); }
size_t GetEdgeSideCount2() const { return rail2.GetEdgeSideCount(); }
/// \ru Выдать направляющее ребро. \en Get guide edge.
MbCurveEdge * SetEdge1( size_t i ) { return rail1.SetEdge( i ); }
/// \ru Выдать направляющее ребро. \en Get guide edge.
MbCurveEdge * SetEdge2( size_t i ) { return rail2.SetEdge( i ); }
/// \ru Выдать тела опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges.
void GetSolids1( std::vector<MbSolid *> & sols ) const { rail1.GetSolids( sols ); }
void GetSolids1( RPArray<MbSolid> & sols ) const { rail1.GetSolids( sols ); }
void GetSolids2( std::vector<MbSolid *> & sols ) const { rail2.GetSolids( sols ); }
void GetSolids2( RPArray<MbSolid> & sols ) const { rail2.GetSolids( sols ); }
/// \ru Выдать количество тел опорных граней или направляющих рёбер. \en Get solids of reference faces or guide edges count.
size_t GetSolidsCount1() const { return rail1.GetSolidsCount(); }
size_t GetSolidsCount2() const { return rail2.GetSolidsCount(); }
/// \ru Выдать тело по индексу. \en Get solid by index.
MbSolid * SetSolid1( size_t i ) { return rail1.SetSolid( i ); }
MbSolid * SetSolid2( size_t i ) { return rail2.SetSolid( i ); }
/// \ru Выдать уникальные тела. \en Give out unique solids.
void GetUniqueSolids1( std::vector<MbSolid *> sols ) const { rail1.GetUniqueSolids( sols ); }
void GetUniqueSolids2( std::vector<MbSolid *> sols ) const { rail1.GetUniqueSolids( sols ); }
void GetUniqueSolids ( std::vector<MbSolid *> sols ) const { rail1.GetUniqueSolids( sols );
rail2.GetUniqueSolids( sols ); }
/// \ru Добавить в данные направляющую кривую. \en Add guiding to data. \~
void AddCurve1( MbCurve3D & crv ) { rail1.AddCurve( crv ); }
void AddCurve2( MbCurve3D & crv ) { rail2.AddCurve( crv ); }
@@ -2001,8 +2032,8 @@ public:
const MbSectionRule & GetSectionRule() const { return descript; }
MbSectionRule & SetSectionRule() { return descript; }
/// \ru Выдать функцию управления сечением (радиус или дискриминант). \en Get section control function (radius or discriminant).
const MbFunction * GetFunction() const { return descript.discr; }
MbFunction * SetFunction() { return descript.discr; }
const MbFunction * GetFunction() const { return descript.GetFunction(); }
MbFunction * SetFunction() { return descript.SetFunction(); }
/// \ru Установить функцию управления сечением. \en Set section control function.
void SetFunction( MbFunction & f ) { descript.SetFunction( f ); }
void SetFunction( double f ) { descript.SetFunction( f ); }
@@ -2079,7 +2110,8 @@ public:
bool SetEqual ( const MbSectionData & other );
// \ru Найти номера рёбер и граней в оболочке. \en Find the numbers of edges and faces in the shell. \~
bool FindIndex( const MbFaceShell & shell );
// \ru Выдать версию апостьроения. \en Get the build version. \~
VERSION GetVersion() const { return nameMaker.GetMathVersion(); }
/// \ru Оператор присваивания без копирования данных. \en Assignment operator without copying.
void operator = ( const MbSectionData & other );
+2 -2
View File
@@ -483,9 +483,9 @@ size_t KdTree<Scalar>::split( size_t start, size_t end, size_t dim, double split
for( ; l < r; ++l, --r ) {
while( l < end && points[l][dim] < splitValue )
l++;
while( r >= start && points[r][dim] >= splitValue )
while( r < SYS_MAX_T && r >= start && points[r][dim] >= splitValue )
r--;
if( l > r )
if( l > r || r == SYS_MAX_T )
break;
std::swap( points[l], points[r] );
std::swap( indices[l], indices[r] );
+19
View File
@@ -563,6 +563,25 @@ inline void ToLower( ::std::wstring & v ) {
}
#ifndef C3D_WINDOWS //_MSC_VER
//------------------------------------------------------------------------------
/** \brief \ru Перевести символы в верхний регистр.
\en Convert symbols to upper case. \~
*/
inline
TCHAR * CharUpper( TCHAR * s ) {
for( TCHAR * ch(s); *ch != '\0'; ++ch ) {
#ifdef _UNICODE
*ch = towupper( *ch );
#else
*ch = toupper( *ch );
#endif
}
return s;
}
#endif // C3D_WINDOWS
} // namespace C3D
+47
View File
@@ -761,6 +761,9 @@ public :
template <class ConstEdgesVector>
bool GetBoundaryEdges( ConstEdgesVector & ) const;
// \ru Для множества рёбер найти множество их номеров. \en For a set of edges find a set of their indices.
template <class CurvesArray, class ItemIndices>
bool FindIndexByEdges( const CurvesArray & init, ItemIndices & indices ) const;
/// \ru Для множества ребер найти номера ребер и номера ее граней. \en For a set of edges find their indices and indices of their faces.
template<class CurvesArray, class IndexesArray>
bool FindFacesIndexByEdges( const CurvesArray & init, IndexesArray & indexes, bool any = false ) const;
@@ -835,6 +838,12 @@ public :
const MbFace * FindFaceByIndex( MbItemIndex & ) const;
/// \ru Найти грань по комбинированному индексу. \en Find a face by combined index.
MbFace * FindFaceByIndex( MbItemIndex & );
/// \ru Найти ребро по комбинированному индексу. \en Find an edge by combined index.
const MbCurveEdge * FindEdgeByIndex( MbItemIndex & ) const;
/// \ru Найти ребро по комбинированному индексу. \en Find an edge by combined index.
MbCurveEdge * FindEdgeByIndex( MbItemIndex & );
/// \ru Найти ребрa по номерам. \en Find edges by the indices.
bool FindEdgesByIndex( const std::vector<MbItemIndex> & indexes, std::vector<MbCurveEdge *> & initCurves ) const;
/// \ru Найти множество ребер с общей заданной вершиной. \en Find a set of edges with the common given vertex.
void FindEdgesForVertex( const MbVertex & vertex, RPArray<MbCurveEdge> & findEdges ) const;
/// \ru Найти множество граней с общей заданной вершиной. \en Find a set of faces with the common given vertex.
@@ -1310,6 +1319,43 @@ bool MbFaceShell::GetBoundaryEdges( ConstEdgesVector & boundaryEdges ) const
return false;
}
//------------------------------------------------------------------------------
// \ru Для множества рёбер найти множество их номеров. \en For a set of edges find a set of their indices.
// ---
template <class CurvesArray, class ItemIndices>
bool MbFaceShell::FindIndexByEdges( const CurvesArray & init, ItemIndices & indices ) const
{
size_t foundCount = 0;
if ( init.size() > 0 ) {
std::vector<c3d::EdgeSPtr> edges;
GetEdges<std::vector<c3d::EdgeSPtr>>( edges );
size_t initCount, i, edgesCount = edges.size();
MbItemIndex index;
for ( i = 0, initCount = init.size(); i < initCount; i++ ) {
size_t i0 = SYS_MAX_T;
const MbCurveEdge * init_i = init[i];
for ( size_t j = 0; j < edgesCount; j++ )
if ( init_i == edges[j] ) {
i0 = j;
break;
}
if ( i0 != SYS_MAX_T && (init_i != nullptr) ) {
index.Init( *init_i, i0 );
index.SetName( init_i->GetNameHash() );
indices.push_back( index );
foundCount++;
}
}
foundCount = indices.size();
}
return foundCount > 0;
}
//------------------------------------------------------------------------------
// \ru Для множества ребер найти номера ребер и номера ее граней. \en For a set of edges find their indices and indices of their faces.
// ---
@@ -1348,6 +1394,7 @@ bool MbFaceShell::FindFacesIndexByEdges( const CurvesArray & init, IndexesArray
return foundCount > 0;
}
//------------------------------------------------------------------------------
// \ru Для множества структур (ребер и функций изменения радиусов) найти номера ребер и номера ее граней. \en For a set of structures (edges and functions of radii changing) find indices of edges and their faces.
// ---
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.